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
public JSONObject metaDataJsnObj = null;
boolean isParameterPrsnt = false;
Label label = null;
ArrayList<String> title = new ArrayList<String>();
ArrayList<String> parameterList = null;
public static ArrayList<String> title = new ArrayList<String>();
public static ArrayList<String> parameterList = null;
HorizontalPanel headingLableImgPanel = new HorizontalPanel();
String windowTitle = "Title";
MetaDataDtl metaDataDtl =new MetaDataDtl();
PopupPanel mainPopupPnl = new PopupPanel(true);
String subTitle="";
public FilterCreator(ArrayList<String> parameterList, JSONObject metaDataJsnObj)
{
boolean showFilter=metaDataDtl.isFiltrHide(metaDataJsnObj);
this.parameterList = parameterList;
xmlName = parameterList.get(0);
label = new Label();
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
{
//label.setText(title.get(0) + parameterList.get(2) + "-" + parameterList.get(3));
label.setText(title.get(0) );//+ parameterList.get(1));//+ "-" + parameterList.get(2));
}
setTitleOnFilterSubmit(parameterList,metaDataJsnObj);
xmlName = parameterList.get(0);
HeadingLableImg.setStyleName("filterImage");
if (getViewFilter(parameterList, metaDataJsnObj) != null)
{
......@@ -112,6 +107,14 @@ public class FilterCreator extends Composite
{
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()
......@@ -126,8 +129,9 @@ public class FilterCreator extends Composite
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();
HorizontalPanel finishCancelBtnsHPnl = new HorizontalPanel();
Label headinglable = new Label("Analysis Scope");
......@@ -247,10 +251,12 @@ public class FilterCreator extends Composite
mainPopupPnl.add(homePgFltrPopupVPnl);
//mainPopupPnl.show();
/* stat--added new code to hide empty filter onload dated : 03-Dec-2014*/
if(popUpHPnl.getWidgetCount()!=0)
{
mainPopupPnl.show();
}
/* End-- added new code to hide empty filter onload*/
cancelimage.addClickHandler(new ClickHandler()
{
......@@ -292,6 +298,8 @@ public class FilterCreator extends Composite
{
getFltrSelectedData(filterList, mainPopupPnl);
}
});
}
......@@ -685,6 +693,7 @@ public class FilterCreator extends Composite
@Override
public void onClick(ClickEvent event)
{
getMetaDataForFltr(null);
}
}
......@@ -972,7 +981,30 @@ public class FilterCreator extends Composite
mainPopupPnl.hide();
popUpSendDtatList.add(selectedView);
setParameterList(popUpSendDtatList);
setTitleOnFilterSubmit(popUpSendDtatList,metaDataJsnObj);
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
ArrayList<FilterInfo> filterList = new ArrayList<FilterInfo>();
HorizontalPanel hpanel= new HorizontalPanel();
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")
public void onModuleLoad()
{
metadataname = Window.Location.getParameter("metadataname") == null ? "" : Window.Location.getParameter("metadataname");
if (metadataname.trim().length() != 0)
{
parameterList.add(metadataname);
E12DashBoardPage.getJsonForFilterData(new Callback<JSONObject, String>()
// added by swati 30 dec 2014 for subtitle
String temp = Window.Location.getHref();
subTitle = temp.substring(temp.lastIndexOf('=')+1, temp.length());
if(subTitle.trim()!=(metadataname.trim()))
{
@Override
public void onSuccess(JSONObject jsnObj)
flag = true;
}
// 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");
if (jsonValue.toString().length() != 2)
@Override
public void onSuccess(JSONObject jsnObj)
{
getParameterList(jsnObj);
}else
JSONValue jsonValue = jsnObj.get("metaData");
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 + "]");
}
}
@Override
public void onFailure(String result)
{
Window.alert("Exception :: onModuleLoad() [" + result + "]");
}
}, metadataname);
} else
{
Window.alert("Please Enter Metadata name");
}
}, metadataname);
} else
{
Window.alert("Please Enter Metadata name");
}
}
public void getParameterList(JSONObject metaDataJsnObj)
......@@ -133,6 +145,4 @@ public class GWTDashBoardReport implements EntryPoint
}
return defaultView;
}
}
......@@ -15,6 +15,7 @@ import com.google.gwt.http.client.RequestException;
import com.google.gwt.http.client.Response;
import com.google.gwt.json.client.JSONObject;
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.ui.Button;
......@@ -141,7 +142,7 @@ public class GraphComponent extends Composite
component = "" + componentTypeMap.get("buildComponent"+componentId);
}
jsonObjFrGraph = (JSONObject) dataMap.get(dtSrouce);
if ("G".equalsIgnoreCase(type) && jsonObjFrGraph != null)
if ("G".equalsIgnoreCase(type))
{
for (String graphNo : graphDataMap.keySet())
{
......@@ -150,9 +151,15 @@ public class GraphComponent extends Composite
width = (String) graphDtlList.get(1);
height = (String) graphDtlList.get(2);
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)
{
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
if(jsonObjFrGraph != null)
{
RootPanel.get("chartContainer"+componentId).clear();
//RootPanel.get().clear();
scrlPanel = new ScrollPanel();
......@@ -185,7 +189,6 @@ public class GraphComponent extends Composite
scrlPanel.add(flexTable);
scrlPanel.setStyleName("flextableScrlPnl");
// RootPanel.get("chartContainergrid").add(scrlPanel);
RootPanel.get("chartContainer"+componentId).add(scrlPanel);
RootPanel.get("chartContainer"+componentId).add(horizontalPnl);
......@@ -196,7 +199,6 @@ public class GraphComponent extends Composite
flexTable = data.jsonToArrayList(gridNGraphMeataDataMap, jsonObjFrGraph,dtSrouce,componentId);
Button excelBtn = new Button("Export To Excel");
excelBtn.setTitle("Excel");
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