Commit 77d64713 authored by sbade's avatar sbade

added new linkedchart functionality for graph


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@97097 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 5d2db576
...@@ -54,26 +54,21 @@ public class FilterCreator extends Composite ...@@ -54,26 +54,21 @@ public class FilterCreator extends Composite
public JSONObject metaDataJsnObj = null; public JSONObject metaDataJsnObj = null;
boolean isParameterPrsnt = false; boolean isParameterPrsnt = false;
Label label = null; Label label = null;
ArrayList<String> title = new ArrayList<String>(); public static ArrayList<String> title = new ArrayList<String>();
ArrayList<String> parameterList = null; public static ArrayList<String> parameterList = null;
HorizontalPanel headingLableImgPanel = new HorizontalPanel(); HorizontalPanel headingLableImgPanel = new HorizontalPanel();
String windowTitle = "Title"; String windowTitle = "Title";
MetaDataDtl metaDataDtl =new MetaDataDtl();
PopupPanel mainPopupPnl = new PopupPanel(true);
String subTitle="";
public FilterCreator(ArrayList<String> parameterList, JSONObject metaDataJsnObj) public FilterCreator(ArrayList<String> parameterList, JSONObject metaDataJsnObj)
{ {
boolean showFilter=metaDataDtl.isFiltrHide(metaDataJsnObj);
this.parameterList = parameterList; this.parameterList = parameterList;
xmlName = parameterList.get(0);
label = new Label(); label = new Label();
title = new MetaDataDtl().getTitle(metaDataJsnObj); setTitleOnFilterSubmit(parameterList,metaDataJsnObj);
if (title.size() > 1) xmlName = parameterList.get(0);
{
label.setText(title.get(0) + " " + getMonth(parameterList.get(1)) + title.get(1) + getMonth(parameterList.get(2)));
} else
{
//label.setText(title.get(0) + parameterList.get(2) + "-" + parameterList.get(3));
label.setText(title.get(0) );//+ parameterList.get(1));//+ "-" + parameterList.get(2));
}
HeadingLableImg.setStyleName("filterImage"); HeadingLableImg.setStyleName("filterImage");
if (getViewFilter(parameterList, metaDataJsnObj) != null) if (getViewFilter(parameterList, metaDataJsnObj) != null)
{ {
...@@ -112,6 +107,14 @@ public class FilterCreator extends Composite ...@@ -112,6 +107,14 @@ public class FilterCreator extends Composite
{ {
getMetaDataForFltr(parameterList); getMetaDataForFltr(parameterList);
} }
/* Start Added New Code For Show/ Hide pophelp on Load by sachin on 25/12/14**/
if(! showFilter)
{
mainPopupPnl.hide();
}
/* End Added New Code For Show/ Hide pophelp on Load by sachin on 25/12/14**/
} }
public ArrayList<String> getParameterList() public ArrayList<String> getParameterList()
...@@ -126,8 +129,9 @@ public class FilterCreator extends Composite ...@@ -126,8 +129,9 @@ public class FilterCreator extends Composite
public void getMetaDataForFltr(final ArrayList<String> parameterList) public void getMetaDataForFltr(final ArrayList<String> parameterList)
{ {
final ArrayList<FilterInfo> filterList = new MetaDataDtl().getFilters(metaDataJsnObj);
final PopupPanel mainPopupPnl = new PopupPanel(true); mainPopupPnl = new PopupPanel(true);
final ArrayList<FilterInfo> filterList = metaDataDtl.getFilters(metaDataJsnObj);
VerticalPanel homePgFltrPopupVPnl = new VerticalPanel(); VerticalPanel homePgFltrPopupVPnl = new VerticalPanel();
HorizontalPanel finishCancelBtnsHPnl = new HorizontalPanel(); HorizontalPanel finishCancelBtnsHPnl = new HorizontalPanel();
Label headinglable = new Label("Analysis Scope"); Label headinglable = new Label("Analysis Scope");
...@@ -247,10 +251,12 @@ public class FilterCreator extends Composite ...@@ -247,10 +251,12 @@ public class FilterCreator extends Composite
mainPopupPnl.add(homePgFltrPopupVPnl); mainPopupPnl.add(homePgFltrPopupVPnl);
//mainPopupPnl.show(); //mainPopupPnl.show();
/* stat--added new code to hide empty filter onload dated : 03-Dec-2014*/ /* stat--added new code to hide empty filter onload dated : 03-Dec-2014*/
if(popUpHPnl.getWidgetCount()!=0) if(popUpHPnl.getWidgetCount()!=0)
{ {
mainPopupPnl.show(); mainPopupPnl.show();
} }
/* End-- added new code to hide empty filter onload*/ /* End-- added new code to hide empty filter onload*/
cancelimage.addClickHandler(new ClickHandler() cancelimage.addClickHandler(new ClickHandler()
{ {
...@@ -292,6 +298,8 @@ public class FilterCreator extends Composite ...@@ -292,6 +298,8 @@ public class FilterCreator extends Composite
{ {
getFltrSelectedData(filterList, mainPopupPnl); getFltrSelectedData(filterList, mainPopupPnl);
} }
}); });
} }
...@@ -685,6 +693,7 @@ public class FilterCreator extends Composite ...@@ -685,6 +693,7 @@ public class FilterCreator extends Composite
@Override @Override
public void onClick(ClickEvent event) public void onClick(ClickEvent event)
{ {
getMetaDataForFltr(null); getMetaDataForFltr(null);
} }
} }
...@@ -972,7 +981,30 @@ public class FilterCreator extends Composite ...@@ -972,7 +981,30 @@ public class FilterCreator extends Composite
mainPopupPnl.hide(); mainPopupPnl.hide();
popUpSendDtatList.add(selectedView); popUpSendDtatList.add(selectedView);
setParameterList(popUpSendDtatList); setParameterList(popUpSendDtatList);
setTitleOnFilterSubmit(popUpSendDtatList,metaDataJsnObj);
E12DashBoardPage.initaliseGraphNGrid(popUpSendDtatList); E12DashBoardPage.initaliseGraphNGrid(popUpSendDtatList);
} }
}
public void setTitleOnFilterSubmit(ArrayList<String> parameterList,JSONObject metaDataJsnObj)
{
if(GWTDashBoardReport.flag)
{
subTitle= Window.Location.getParameter("titleName");
}
title = new MetaDataDtl().getTitle(metaDataJsnObj);
if (title.size() > 1)
{
label.setText(title.get(0) + ":" + getMonth(parameterList.get(1)) + title.get(1) + getMonth(parameterList.get(2)));
}
else if(subTitle.trim().length()>0)
{
label.setText( subTitle + ":" + getMonth(parameterList.get(1)) );
}
else
{
label.setText(title.get(0)+ ":" +getMonth( parameterList.get(1)));//+ "-" + parameterList.get(2));
}
} }
} }
\ No newline at end of file
...@@ -23,39 +23,51 @@ public class GWTDashBoardReport implements EntryPoint ...@@ -23,39 +23,51 @@ public class GWTDashBoardReport implements EntryPoint
ArrayList<FilterInfo> filterList = new ArrayList<FilterInfo>(); ArrayList<FilterInfo> filterList = new ArrayList<FilterInfo>();
HorizontalPanel hpanel= new HorizontalPanel(); HorizontalPanel hpanel= new HorizontalPanel();
String metadataname = ""; String metadataname = "";
// added by swati 30 dec 2014 for subtitle
public static String subTitle="";
public static boolean flag= false;
// ended by swati 30 dec 2014 for subtitle
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public void onModuleLoad() public void onModuleLoad()
{ {
metadataname = Window.Location.getParameter("metadataname") == null ? "" : Window.Location.getParameter("metadataname"); metadataname = Window.Location.getParameter("metadataname") == null ? "" : Window.Location.getParameter("metadataname");
if (metadataname.trim().length() != 0) // added by swati 30 dec 2014 for subtitle
{ String temp = Window.Location.getHref();
subTitle = temp.substring(temp.lastIndexOf('=')+1, temp.length());
parameterList.add(metadataname); if(subTitle.trim()!=(metadataname.trim()))
E12DashBoardPage.getJsonForFilterData(new Callback<JSONObject, String>()
{ {
@Override flag = true;
public void onSuccess(JSONObject jsnObj) }
// ended by swati 30 dec 2014 for subtitle
if (metadataname.trim().length() != 0)
{
parameterList.add(metadataname);
E12DashBoardPage.getJsonForFilterData(new Callback<JSONObject, String>()
{ {
JSONValue jsonValue = jsnObj.get("metaData"); @Override
if (jsonValue.toString().length() != 2) public void onSuccess(JSONObject jsnObj)
{ {
getParameterList(jsnObj); JSONValue jsonValue = jsnObj.get("metaData");
}else if (jsonValue.toString().length() != 2)
{
getParameterList(jsnObj);
}else
{
Window.alert("MetaData Should Be Proper");
}
}
@Override
public void onFailure(String result)
{ {
Window.alert("MetaData Should Be Proper"); Window.alert("Exception :: onModuleLoad() [" + result + "]");
} }
} }, metadataname);
} else
@Override {
public void onFailure(String result) Window.alert("Please Enter Metadata name");
{ }
Window.alert("Exception :: onModuleLoad() [" + result + "]");
}
}, metadataname);
} else
{
Window.alert("Please Enter Metadata name");
}
} }
public void getParameterList(JSONObject metaDataJsnObj) public void getParameterList(JSONObject metaDataJsnObj)
...@@ -133,6 +145,4 @@ public class GWTDashBoardReport implements EntryPoint ...@@ -133,6 +145,4 @@ public class GWTDashBoardReport implements EntryPoint
} }
return defaultView; return defaultView;
} }
} }
...@@ -15,6 +15,7 @@ import com.google.gwt.http.client.RequestException; ...@@ -15,6 +15,7 @@ import com.google.gwt.http.client.RequestException;
import com.google.gwt.http.client.Response; import com.google.gwt.http.client.Response;
import com.google.gwt.json.client.JSONObject; import com.google.gwt.json.client.JSONObject;
import com.google.gwt.json.client.JSONParser; import com.google.gwt.json.client.JSONParser;
import com.google.gwt.json.client.JSONString;
import com.google.gwt.user.client.Window; import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.Button; import com.google.gwt.user.client.ui.Button;
...@@ -141,7 +142,7 @@ public class GraphComponent extends Composite ...@@ -141,7 +142,7 @@ public class GraphComponent extends Composite
component = "" + componentTypeMap.get("buildComponent"+componentId); component = "" + componentTypeMap.get("buildComponent"+componentId);
} }
jsonObjFrGraph = (JSONObject) dataMap.get(dtSrouce); jsonObjFrGraph = (JSONObject) dataMap.get(dtSrouce);
if ("G".equalsIgnoreCase(type) && jsonObjFrGraph != null) if ("G".equalsIgnoreCase(type))
{ {
for (String graphNo : graphDataMap.keySet()) for (String graphNo : graphDataMap.keySet())
{ {
...@@ -150,9 +151,15 @@ public class GraphComponent extends Composite ...@@ -150,9 +151,15 @@ public class GraphComponent extends Composite
width = (String) graphDtlList.get(1); width = (String) graphDtlList.get(1);
height = (String) graphDtlList.get(2); height = (String) graphDtlList.get(2);
graphJson = ChartCreator.buildChartData(graphDtlList, jsonObjFrGraph, dtSrouce); graphJson = ChartCreator.buildChartData(graphDtlList, jsonObjFrGraph, dtSrouce);
// start- added empty json chartdata to display no data found message by swati on 7jan2015
if(graphJson.size()==0 )
{
graphJson.put("chart", new JSONString(""));
}
// end- added empty json chartdata to display no data found message by swati on 7jan2015
if (graphJson != null && graphJson.size() > 0) if (graphJson != null && graphJson.size() > 0)
{ {
this.createChart(graphJson.toString(), "chartContainer" + componentId, "chartContainer" + componentId, width, height, imageName); this.createChart(graphJson.toString().replace('$', '='), "chartContainer" + componentId, "chartContainer" + componentId, width, height, imageName);
} }
} }
} }
...@@ -161,9 +168,6 @@ public class GraphComponent extends Composite ...@@ -161,9 +168,6 @@ public class GraphComponent extends Composite
if(jsonObjFrGraph != null) if(jsonObjFrGraph != null)
{ {
RootPanel.get("chartContainer"+componentId).clear(); RootPanel.get("chartContainer"+componentId).clear();
//RootPanel.get().clear(); //RootPanel.get().clear();
scrlPanel = new ScrollPanel(); scrlPanel = new ScrollPanel();
...@@ -185,7 +189,6 @@ public class GraphComponent extends Composite ...@@ -185,7 +189,6 @@ public class GraphComponent extends Composite
scrlPanel.add(flexTable); scrlPanel.add(flexTable);
scrlPanel.setStyleName("flextableScrlPnl"); scrlPanel.setStyleName("flextableScrlPnl");
// RootPanel.get("chartContainergrid").add(scrlPanel); // RootPanel.get("chartContainergrid").add(scrlPanel);
RootPanel.get("chartContainer"+componentId).add(scrlPanel); RootPanel.get("chartContainer"+componentId).add(scrlPanel);
RootPanel.get("chartContainer"+componentId).add(horizontalPnl); RootPanel.get("chartContainer"+componentId).add(horizontalPnl);
...@@ -196,7 +199,6 @@ public class GraphComponent extends Composite ...@@ -196,7 +199,6 @@ public class GraphComponent extends Composite
flexTable = data.jsonToArrayList(gridNGraphMeataDataMap, jsonObjFrGraph,dtSrouce,componentId); flexTable = data.jsonToArrayList(gridNGraphMeataDataMap, jsonObjFrGraph,dtSrouce,componentId);
Button excelBtn = new Button("Export To Excel"); Button excelBtn = new Button("Export To Excel");
excelBtn.setTitle("Excel"); excelBtn.setTitle("Excel");
RootPanel.get("chartContainer"+componentId).add(flexTable); RootPanel.get("chartContainer"+componentId).add(flexTable);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment