Commit 73024b6e authored by dkasliwal's avatar dkasliwal

Add new method getOnClickOpenGrid to open a window to display grid for comliance dashboard


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@98790 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 2f7f68fd
...@@ -64,11 +64,11 @@ public class GraphComponent extends Composite ...@@ -64,11 +64,11 @@ public class GraphComponent extends Composite
*/ */
/*Added By Dhanendra for one to one graph*/ /*Added By Dhanendra for one to one graph*/
ArrayList<String> grpNameList= new ArrayList<String>(); ArrayList<String> grpNameList= null;// declared it null for compliance filter change by dhanendra 06/10/2015
int cnt=0; int cnt=0;
HashMap<String, String> refCompIdMap= new HashMap<String, String>(); HashMap<String, String> refCompIdMap= new HashMap<String, String>();
MetaDataDtl dataDtl = null; MetaDataDtl dataDtl = null;
JSONObject jsonAftrFltr = new JSONObject(); JSONObject jsonAftrFltr = null; // declared it null for compliance filter change by dhanendra 06/10/2015
HashMap<String, HashMap<String, String>> groupTypeMap = null; HashMap<String, HashMap<String, String>> groupTypeMap = null;
String gridGroupName = ""; String gridGroupName = "";
String gridCssName = ""; String gridCssName = "";
...@@ -88,7 +88,6 @@ public class GraphComponent extends Composite ...@@ -88,7 +88,6 @@ public class GraphComponent extends Composite
//final ArrayList<FilterInfo> filterList = metaDataDtl.getFilters(metaDataJsnObj); //final ArrayList<FilterInfo> filterList = metaDataDtl.getFilters(metaDataJsnObj);
public GraphComponent(ArrayList<String> parameterList, JSONObject metaDataJsnObj,String showfilter) public GraphComponent(ArrayList<String> parameterList, JSONObject metaDataJsnObj,String showfilter)
{ {
userMail = Window.Location.getParameter("EMP_MAILCODE") == null ? "" : Window.Location.getParameter("EMP_MAILCODE"); userMail = Window.Location.getParameter("EMP_MAILCODE") == null ? "" : Window.Location.getParameter("EMP_MAILCODE");
reportCaption= Window.Location.getParameter("GEO_LOCATION") == null ? "" : Window.Location.getParameter("GEO_LOCATION"); reportCaption= Window.Location.getParameter("GEO_LOCATION") == null ? "" : Window.Location.getParameter("GEO_LOCATION");
String isShowfilter= Window.Location.getParameter("FLAG"); String isShowfilter= Window.Location.getParameter("FLAG");
...@@ -156,7 +155,10 @@ public class GraphComponent extends Composite ...@@ -156,7 +155,10 @@ public class GraphComponent extends Composite
JSONObject filtrGridJSN = null; JSONObject filtrGridJSN = null;
String avlDate = ""; String avlDate = "";
String componentIconName = ""; String componentIconName = "";
//add initialized to new for compliance filter change by dhanendra 06/10/2015
jsonAftrFltr = new JSONObject();
grpNameList = new ArrayList<String>();
//end of initialized to new for compliance filter change by dhanendra 06/10/2015
/*Ended By Dhanendra on 25May2015 for Group*/ /*Ended By Dhanendra on 25May2015 for Group*/
// added variable to add html tag to ssgrid by swati on 08-sep-2015 // added variable to add html tag to ssgrid by swati on 08-sep-2015
String htmlString=""; String htmlString="";
...@@ -178,6 +180,7 @@ public class GraphComponent extends Composite ...@@ -178,6 +180,7 @@ public class GraphComponent extends Composite
} }
}*/ }*/
/** End Code By Dhanendra for No Data Found Msg **/ /** End Code By Dhanendra for No Data Found Msg **/
if (idList.size() > 0) if (idList.size() > 0)
{ {
for (int i = 0; i < idList.size(); i++) for (int i = 0; i < idList.size(); i++)
...@@ -199,6 +202,7 @@ public class GraphComponent extends Composite ...@@ -199,6 +202,7 @@ public class GraphComponent extends Composite
{*/ // for only OTC {*/ // for only OTC
for (String componentId : gridNGraphMeataDataMap.keySet()) for (String componentId : gridNGraphMeataDataMap.keySet())
{ {
jsonObjFrGraph=new JSONObject(); jsonObjFrGraph=new JSONObject();
if(isNumeric(componentId)) if(isNumeric(componentId))
{ {
...@@ -241,6 +245,10 @@ public class GraphComponent extends Composite ...@@ -241,6 +245,10 @@ public class GraphComponent extends Composite
jsonObjFrGraph = (JSONObject) dataMap.get(dtSrouce); jsonObjFrGraph = (JSONObject) dataMap.get(dtSrouce);
if ("G".equalsIgnoreCase(type)) if ("G".equalsIgnoreCase(type))
{ {
/*this.includeJavascriptFile("FusionChart/js/FusionCharts.js");
this.includeCSSfile("GwtDashboardPage.css");
this.includeJavascriptFile("FusionChart/js/BuildChart.js");
this.includeJavascriptFile("gwtdashboardreport/gwtdashboardreport.nocache.js");*/
for (String graphNo : graphDataMap.keySet()) for (String graphNo : graphDataMap.keySet())
{ {
graphDtlList = graphDataMap.get(graphNo); graphDtlList = graphDataMap.get(graphNo);
...@@ -352,6 +360,10 @@ public class GraphComponent extends Composite ...@@ -352,6 +360,10 @@ public class GraphComponent extends Composite
} }
else if("T".equalsIgnoreCase(type)) else if("T".equalsIgnoreCase(type))
{ {
/*this.includeCSSfile("GwtDashboardPage.css");
this.includeJavascriptFile("FusionChart/js/BuildChart.js");
this.includeJavascriptFile("FusionChart/js/FusionCharts.js");
this.includeJavascriptFile("gwtdashboardreport/gwtdashboardreport.nocache.js");*/
if(jsonObjFrGraph != null) if(jsonObjFrGraph != null)
{ {
/*comment line by Dhanendra*/ /*comment line by Dhanendra*/
...@@ -426,6 +438,7 @@ public class GraphComponent extends Composite ...@@ -426,6 +438,7 @@ public class GraphComponent extends Composite
filtrGridJSN.put(dtSrouce, dataJsn); filtrGridJSN.put(dtSrouce, dataJsn);
flexTable = data.jsonToArrayList(dataDtl.getGridNMapMetData(jsonObjMetaData,parameterList.get(parameterList.size()-1),parameterList), filtrGridJSN,dtSrouce,componentId,parameterList, filterList,firstIndex); flexTable = data.jsonToArrayList(dataDtl.getGridNMapMetData(jsonObjMetaData,parameterList.get(parameterList.size()-1),parameterList), filtrGridJSN,dtSrouce,componentId,parameterList, filterList,firstIndex);
this.createOuterDiv(gridGroupName+"Grid",type,null); this.createOuterDiv(gridGroupName+"Grid",type,null);
idList.add(gridGroupName+"GridDiv");
Image gridTtlImg = new Image("FusionChart/images/"+gridIconName); Image gridTtlImg = new Image("FusionChart/images/"+gridIconName);
HorizontalPanel gridTtlPanel = new HorizontalPanel(); HorizontalPanel gridTtlPanel = new HorizontalPanel();
gridTitleLbl = new Label(firstIndex); gridTitleLbl = new Label(firstIndex);
...@@ -479,6 +492,10 @@ public class GraphComponent extends Composite ...@@ -479,6 +492,10 @@ public class GraphComponent extends Composite
} }
if ("H".equalsIgnoreCase(type)) if ("H".equalsIgnoreCase(type))
{ {
/*this.includeCSSfile("GwtDashboardPage.css");
this.includeJavascriptFile("FusionChart/js/BuildChart.js");
this.includeJavascriptFile("FusionChart/js/fusioncharts.js");
this.includeJavascriptFile("gwtdashboardreport/gwtdashboardreport.nocache.js");*/
for (String graphNo : graphDataMap.keySet()) for (String graphNo : graphDataMap.keySet())
{ {
graphDtlList = graphDataMap.get(graphNo); graphDtlList = graphDataMap.get(graphNo);
...@@ -500,6 +517,10 @@ public class GraphComponent extends Composite ...@@ -500,6 +517,10 @@ public class GraphComponent extends Composite
/**Start of india map build method by swati 17 April 2015**/ /**Start of india map build method by swati 17 April 2015**/
if ("C".equalsIgnoreCase(type)) if ("C".equalsIgnoreCase(type))
{ {
/*this.includeCSSfile("GwtDashboardPage.css");
this.includeJavascriptFile("FusionChart/js/BuildChart.js");
this.includeJavascriptFile("FusionChart/js/fusioncharts.js");
this.includeJavascriptFile("gwtdashboardreport/gwtdashboardreport.nocache.js");*/
for (String graphNo : graphDataMap.keySet()) for (String graphNo : graphDataMap.keySet())
{ {
graphDtlList = graphDataMap.get(graphNo); graphDtlList = graphDataMap.get(graphNo);
...@@ -521,6 +542,11 @@ public class GraphComponent extends Composite ...@@ -521,6 +542,11 @@ public class GraphComponent extends Composite
/**start of card build method by sachin 10 July 2015**/ /**start of card build method by sachin 10 July 2015**/
if ("CARD".equalsIgnoreCase(type)) if ("CARD".equalsIgnoreCase(type))
{ {
/*this.includeCSSfile("circle.css");
this.includeCSSfile("GwtDashboardPage.css");
this.includeJavascriptFile("FusionChart/js/BuildChart.js");
this.includeJavascriptFile("FusionChart/js/FusionCharts.js");
this.includeJavascriptFile("gwtdashboardreport/gwtdashboardreport.nocache.js");*/
for (String graphNo : graphDataMap.keySet()) for (String graphNo : graphDataMap.keySet())
{ {
//RootPanel.get("chartContainer"+componentId).clear(); //RootPanel.get("chartContainer"+componentId).clear();
...@@ -561,14 +587,12 @@ public class GraphComponent extends Composite ...@@ -561,14 +587,12 @@ public class GraphComponent extends Composite
} }
/**end of card build method by sachin 10 July 2015**/ /**end of card build method by sachin 10 July 2015**/
/** Star Code for Building ganttChart by sachin 5 Aug 2015 **/ /** Star Code for Building ganttChart by sachin 5 Aug 2015 **/
if ("DHTML_GANTT".equalsIgnoreCase(type)) if ("DHTML_GANTT".equalsIgnoreCase(type))
{ {
/*this.includeCSSfile("dhtmlxgantt.css");
this.includeJavascriptFile("FusionChart/js/dhtmlxgantt.js");
this.includeJavascriptFile("gwtdashboardreport/gwtdashboardreport.nocache.js");*/
for (String graphNo : graphDataMap.keySet()) for (String graphNo : graphDataMap.keySet())
{ {
graphDtlList = graphDataMap.get(graphNo); graphDtlList = graphDataMap.get(graphNo);
...@@ -619,12 +643,12 @@ public class GraphComponent extends Composite ...@@ -619,12 +643,12 @@ public class GraphComponent extends Composite
if ("HTML_GAUGE".equalsIgnoreCase(type)) if ("HTML_GAUGE".equalsIgnoreCase(type))
{ {
/*this.includeCSSfile("GwtDashboardPage.css");
this.includeJavascriptFile("FusionChart/js/AquaGauge.js");
this.includeJavascriptFile("gwtdashboardreport/gwtdashboardreport.nocache.js");*/
for (String graphNo : graphDataMap.keySet()) for (String graphNo : graphDataMap.keySet())
{ {
graphDtlList = graphDataMap.get(graphNo); graphDtlList = graphDataMap.get(graphNo);
for (int i = 0; i < graphDtlList.size(); i++) for (int i = 0; i < graphDtlList.size(); i++)
{ {
if (i == 0) if (i == 0)
...@@ -651,11 +675,6 @@ public class GraphComponent extends Composite ...@@ -651,11 +675,6 @@ public class GraphComponent extends Composite
} }
} }
/** End Star Code for Building HTML_GAUGE by sachin 5 Aug 2015 **/ /** End Star Code for Building HTML_GAUGE by sachin 5 Aug 2015 **/
} }
} }
e12LoadImg.setLoading(false); e12LoadImg.setLoading(false);
...@@ -663,9 +682,7 @@ public class GraphComponent extends Composite ...@@ -663,9 +682,7 @@ public class GraphComponent extends Composite
{ {
Window.alert("No Data Found"); Window.alert("No Data Found");
}*/ }*/
} }
/** Added new Method by sachin on 18 Aug 2015 **/ /** Added new Method by sachin on 18 Aug 2015 **/
private native void createGaugeChart(String chartData, String chartContainer) private native void createGaugeChart(String chartData, String chartContainer)
/*-{ /*-{
...@@ -826,6 +843,10 @@ public class GraphComponent extends Composite ...@@ -826,6 +843,10 @@ public class GraphComponent extends Composite
// System.out.print("jsonObjFrGraph is ="+jsonObjFrGraph); // System.out.print("jsonObjFrGraph is ="+jsonObjFrGraph);
if ("G".equalsIgnoreCase(type)) if ("G".equalsIgnoreCase(type))
{ {
/*this.includeCSSfile("GwtDashboardPage.css");
this.includeJavascriptFile("FusionChart/js/BuildChart.js");
this.includeJavascriptFile("FusionChart/js/FusionCharts.js");
this.includeCSSfile("gwtdashboardreport/gwtdashboardreport.nocache.js");*/
for (String graphNo : graphDataMap.keySet()) for (String graphNo : graphDataMap.keySet())
{ {
graphDtlList = graphDataMap.get(graphNo); graphDtlList = graphDataMap.get(graphNo);
...@@ -930,6 +951,10 @@ public class GraphComponent extends Composite ...@@ -930,6 +951,10 @@ public class GraphComponent extends Composite
} }
} else if ("T".equalsIgnoreCase(type)) } else if ("T".equalsIgnoreCase(type))
{ {
/*this.includeCSSfile("GwtDashboardPage.css");
this.includeJavascriptFile("FusionChart/js/BuildChart.js");
this.includeJavascriptFile("FusionChart/js/FusionCharts.js");
this.includeJavascriptFile("gwtdashboardreport/gwtdashboardreport.nocache.js");*/
if (jsonObjFrGraph != null) if (jsonObjFrGraph != null)
{ {
//RootPanel.get("chartContainer" + componentId).clear(); //RootPanel.get("chartContainer" + componentId).clear();
...@@ -1004,6 +1029,7 @@ public class GraphComponent extends Composite ...@@ -1004,6 +1029,7 @@ public class GraphComponent extends Composite
filtrGridJSN.put(dtSrouce, dataJsn); filtrGridJSN.put(dtSrouce, dataJsn);
flexTable = data.jsonToArrayList(dataDtl.getGridNMapMetData(jsonObjMetaData,parameterList.get(parameterList.size()-1),parameterList), filtrGridJSN,dtSrouce,componentId,parameterList, filterList,firstIndex); flexTable = data.jsonToArrayList(dataDtl.getGridNMapMetData(jsonObjMetaData,parameterList.get(parameterList.size()-1),parameterList), filtrGridJSN,dtSrouce,componentId,parameterList, filterList,firstIndex);
this.createOuterDiv(gridGroupName+"Grid",type,null); this.createOuterDiv(gridGroupName+"Grid",type,null);
idList.add(gridGroupName+"GridDiv");
Image gridTtlImg = new Image("FusionChart/images/"+gridIconName); Image gridTtlImg = new Image("FusionChart/images/"+gridIconName);
HorizontalPanel gridTtlPanel = new HorizontalPanel(); HorizontalPanel gridTtlPanel = new HorizontalPanel();
gridTitleLbl = new Label(firstIndex); gridTitleLbl = new Label(firstIndex);
...@@ -1062,6 +1088,10 @@ public class GraphComponent extends Composite ...@@ -1062,6 +1088,10 @@ public class GraphComponent extends Composite
} }
if ("H".equalsIgnoreCase(type)) if ("H".equalsIgnoreCase(type))
{ {
/*this.includeCSSfile("GwtDashboardPage.css");
this.includeJavascriptFile("FusionChart/js/BuildChart.js");
this.includeJavascriptFile("FusionChart/js/fusioncharts.js");
this.includeJavascriptFile("gwtdashboardreport/gwtdashboardreport.nocache.js");*/
for (String graphNo : graphDataMap.keySet()) for (String graphNo : graphDataMap.keySet())
{ {
graphDtlList = graphDataMap.get(graphNo); graphDtlList = graphDataMap.get(graphNo);
...@@ -1083,6 +1113,10 @@ public class GraphComponent extends Composite ...@@ -1083,6 +1113,10 @@ public class GraphComponent extends Composite
/** Start of india map build method by swati 17 April 2015 **/ /** Start of india map build method by swati 17 April 2015 **/
if ("C".equalsIgnoreCase(type)) if ("C".equalsIgnoreCase(type))
{ {
this.includeCSSfile("GwtDashboardPage.css");
this.includeJavascriptFile("FusionChart/js/BuildChart.js");
this.includeJavascriptFile("FusionChart/js/fusioncharts.js");
this.includeJavascriptFile("gwtdashboardreport/gwtdashboardreport.nocache.js");
for (String graphNo : graphDataMap.keySet()) for (String graphNo : graphDataMap.keySet())
{ {
graphDtlList = graphDataMap.get(graphNo); graphDtlList = graphDataMap.get(graphNo);
...@@ -1108,6 +1142,9 @@ public class GraphComponent extends Composite ...@@ -1108,6 +1142,9 @@ public class GraphComponent extends Composite
/** Star Code for Building ganttChart by sachin 5 Aug 2015 **/ /** Star Code for Building ganttChart by sachin 5 Aug 2015 **/
if ("DHTML_GANTT".equalsIgnoreCase(type)) if ("DHTML_GANTT".equalsIgnoreCase(type))
{ {
/*this.includeCSSfile("dhtmlxgantt.css");
this.includeJavascriptFile("FusionChart/js/dhtmlxgantt.js");
this.includeJavascriptFile("gwtdashboardreport/gwtdashboardreport.nocache.js");*/
for (String graphNo : graphDataMap.keySet()) for (String graphNo : graphDataMap.keySet())
{ {
graphDtlList = graphDataMap.get(graphNo); graphDtlList = graphDataMap.get(graphNo);
...@@ -1158,12 +1195,12 @@ public class GraphComponent extends Composite ...@@ -1158,12 +1195,12 @@ public class GraphComponent extends Composite
if ("HTML_GAUGE".equalsIgnoreCase(type)) if ("HTML_GAUGE".equalsIgnoreCase(type))
{ {
this.includeCSSfile("GwtDashboardPage.css");
this.includeJavascriptFile("FusionChart/js/AquaGauge.js");
this.includeJavascriptFile("gwtdashboardreport/gwtdashboardreport.nocache.js");
for (String graphNo : graphDataMap.keySet()) for (String graphNo : graphDataMap.keySet())
{ {
graphDtlList = graphDataMap.get(graphNo); graphDtlList = graphDataMap.get(graphNo);
for (int i = 0; i < graphDtlList.size(); i++) for (int i = 0; i < graphDtlList.size(); i++)
{ {
if (i == 0) if (i == 0)
...@@ -1190,9 +1227,6 @@ public class GraphComponent extends Composite ...@@ -1190,9 +1227,6 @@ public class GraphComponent extends Composite
} }
} }
/** End Star Code for Building HTML_GAUGE by sachin 5 Aug 2015 **/ /** End Star Code for Building HTML_GAUGE by sachin 5 Aug 2015 **/
} }
} }
e12LoadImg.setLoading(false); e12LoadImg.setLoading(false);
...@@ -1200,9 +1234,33 @@ public class GraphComponent extends Composite ...@@ -1200,9 +1234,33 @@ public class GraphComponent extends Composite
* }else { Window.alert("No Data Found"); } * }else { Window.alert("No Data Found"); }
*/ */
} }
/*ended of new method*/ /*ended of new method*/
/** Start Native Method */ /** Start Native Method */
//added by swati to include dynamic css/js on 21 sep 2015
private native void includeCSSfile(String cssPath)
/*-{
try {
$wnd.includeCSSfile(cssPath);
} catch (e) {
alert("Excpeiton :: GraphComponent : includeCSSfile [" + e.message+ "]");
}
}-*/;
private native void includeJavascriptFile(String jsPath)
/*-{
try {
// setTimeout(function(){ }, 3000);
//console.log("=====Included File bfr []:"+jsPath);
//alert("in grpahcomponent includeJavascriptFile ");
$wnd.includeJavascriptFile(jsPath);
//console.log("=====Included File after []:"+jsPath);
} catch (e) {
alert("Excpeiton :: GraphComponent : includeJavascriptFile [" + e.message+ "]");
}
}-*/;
//ended by swati to include dynamic css/js on 21 sep 2015
private native void createChart(String chartData, String containerId, String chartContainer, String width, String height, String imageName,String userMail,String reportCaption) private native void createChart(String chartData, String containerId, String chartContainer, String width, String height, String imageName,String userMail,String reportCaption)
/*-{ /*-{
try { try {
...@@ -1291,7 +1349,7 @@ public class GraphComponent extends Composite ...@@ -1291,7 +1349,7 @@ public class GraphComponent extends Composite
/** Start Added New code By sachin for Creating Dynamic Url For Report on 04/12/14**/ /** Start Added New code By sachin for Creating Dynamic Url For Report on 04/12/14**/
String flitrValue="";
objActionPath = "/ibase/" + servletname; objActionPath = "/ibase/" + servletname;
int cnt=0; int cnt=0;
if(filterList.size()>0) if(filterList.size()>0)
...@@ -1300,13 +1358,24 @@ public class GraphComponent extends Composite ...@@ -1300,13 +1358,24 @@ public class GraphComponent extends Composite
{ {
cnt++; cnt++;
filterInfo = filterList.get(i); filterInfo = filterList.get(i);
/*added new code for : if & is in filter value then replace by @ by sachin on 24 sep 2015*/
if (parameterList.get(cnt).indexOf("&") != 0)
{
flitrValue = parameterList.get(cnt).replace("&", "@");
}
else
{
flitrValue = parameterList.get(cnt);
}
/*ended new code for : if & is in filter value then replace by @ by sachin on 24 sep 2015*/
if(i==0) if(i==0)
{ {
objActionPath=objActionPath + "?" + filterInfo.getColName()+"="+parameterList.get(cnt); objActionPath=objActionPath + "?" + filterInfo.getColName()+"="+flitrValue;
}else }else
{ {
objActionPath=objActionPath + "&" + filterInfo.getColName()+"="+parameterList.get(cnt); objActionPath=objActionPath + "&" + filterInfo.getColName()+"="+flitrValue;
} }
} }
objActionPath=objActionPath+"&dataSourceName=" + dbDataSource + "&reportName="+page+"&viewOptionSelectd="+viewOptionSelectd; objActionPath=objActionPath+"&dataSourceName=" + dbDataSource + "&reportName="+page+"&viewOptionSelectd="+viewOptionSelectd;
...@@ -1441,7 +1510,7 @@ public class GraphComponent extends Composite ...@@ -1441,7 +1510,7 @@ public class GraphComponent extends Composite
groupVal = groupVal.replace('"', ' '); groupVal = groupVal.replace('"', ' ');
groupVal = groupVal +"@"+ designation; groupVal = groupVal +"@"+ designation;
xAxisVal = "" + fetchRowWiseValJsn.get(xAxixNameList.get(0)).toString().replace('"', ' '); xAxisVal = "" + fetchRowWiseValJsn.get(xAxixNameList.get(0)).toString().replace('"', ' ').trim();
yAxisVal = Integer.parseInt(fetchRowWiseValJsn.get(yAxixNameList.get(0)).toString().replace('"', ' ').trim()); yAxisVal = Integer.parseInt(fetchRowWiseValJsn.get(yAxixNameList.get(0)).toString().replace('"', ' ').trim());
if(!prevGroupVal.equals(groupVal) && !("").equals(prevGroupVal)) if(!prevGroupVal.equals(groupVal) && !("").equals(prevGroupVal))
...@@ -1484,7 +1553,7 @@ public class GraphComponent extends Composite ...@@ -1484,7 +1553,7 @@ public class GraphComponent extends Composite
} }
} }
} }
//Window.alert("rawDataMapJsonOuter :"+rawDataMapJsonOuter); //Window.alert("rawDataMapJsonOuter :"+rawDataMapOuterJsn);
return rawDataMapOuterJsn; return rawDataMapOuterJsn;
} }
private JSONObject getFltrDataJson(JSONObject dataJsn, String groupName, String selcetIndex) private JSONObject getFltrDataJson(JSONObject dataJsn, String groupName, String selcetIndex)
...@@ -1549,6 +1618,7 @@ public class GraphComponent extends Composite ...@@ -1549,6 +1618,7 @@ public class GraphComponent extends Composite
{ {
fetchRowWiseVal = (JSONObject) dataJsn.get(String.valueOf(jsnCnt)); fetchRowWiseVal = (JSONObject) dataJsn.get(String.valueOf(jsnCnt));
set = fetchRowWiseVal.keySet(); set = fetchRowWiseVal.keySet();
for(String key : set) for(String key : set)
{ {
keyVal = fetchRowWiseVal.get(key).toString().replace("\"", "").trim(); keyVal = fetchRowWiseVal.get(key).toString().replace("\"", "").trim();
...@@ -1571,68 +1641,73 @@ public class GraphComponent extends Composite ...@@ -1571,68 +1641,73 @@ public class GraphComponent extends Composite
if(entry.getKey().equalsIgnoreCase(groupName)) if(entry.getKey().equalsIgnoreCase(groupName))
{ {
refrshComponatId = entry.getValue(); refrshComponatId = entry.getValue();
graphTypeMap = gridNGraphMeataDataMap.get("type"+refrshComponatId); /*Add if condition to check last hierachey by Dhanedra on Date 16-10-2015 */
String type = ""+(graphTypeMap.get("type"+refrshComponatId)); if(!refrshComponatId.equalsIgnoreCase("0"))
graphDataMap = gridNGraphMeataDataMap.get(refrshComponatId); {
if ("G".equalsIgnoreCase(type)) graphTypeMap = gridNGraphMeataDataMap.get("type"+refrshComponatId);
{ String type = ""+(graphTypeMap.get("type"+refrshComponatId));
for (String graphNo : graphDataMap.keySet()) graphDataMap = gridNGraphMeataDataMap.get(refrshComponatId);
{ if ("G".equalsIgnoreCase(type))
graphDtlList = graphDataMap.get(graphNo); {
groupCssList = new ArrayList<String>(); for (String graphNo : graphDataMap.keySet())
nextGroupNameList =(ArrayList<String>) graphDtlList.get(17);
groupCssList = (ArrayList<String>) graphDtlList.get(19);
fltrDataJson = getFltrDataJson(dataJsn, groupName,groupNameVal.trim());
fltrAfterDataJson = getDataMapJson(fltrDataJson, nextGroupNameList.get(0),graphDtlList);
groupName = nextGroupNameList.get(0);
set = fltrAfterDataJson.keySet();
for(String key : set)
{ {
if(key.indexOf("@")!=-1) graphDtlList = graphDataMap.get(graphNo);
{ groupCssList = new ArrayList<String>();
String[] selectIndexArr = key.split("@"); nextGroupNameList =(ArrayList<String>) graphDtlList.get(17);
key = selectIndexArr[0]; groupCssList = (ArrayList<String>) graphDtlList.get(19);
groupNameVal = key; fltrDataJson = getFltrDataJson(dataJsn, groupName,groupNameVal.trim());
}else fltrAfterDataJson = getDataMapJson(fltrDataJson, nextGroupNameList.get(0),graphDtlList);
groupName = nextGroupNameList.get(0);
set = fltrAfterDataJson.keySet();
for(String key : set)
{ {
groupNameVal = key; if(key.indexOf("@")!=-1)
{
String[] selectIndexArr = key.split("@");
key = selectIndexArr[0];
groupNameVal = key;
}else
{
groupNameVal = key;
}
break;
} }
getClearDiv(groupName);
break; getDisplayData(fltrAfterDataJson, graphDtlList, groupCssList.get(0), width, height, imageName, refrshMapVal, mainDataJson,groupName,filterList);
} }
getClearDiv(groupName);
getDisplayData(fltrAfterDataJson, graphDtlList, groupCssList.get(0), width, height, imageName, refrshMapVal, mainDataJson,groupName,filterList); }else if ("T".equalsIgnoreCase(type))
{
} fltrDataJson = getFltrDataJson(dataJsn, groupName,groupNameVal.trim());
avlDateMap = new HashMap<String, JSONObject>();
}else if ("T".equalsIgnoreCase(type)) JSONObject dataJson = new JSONObject();
{ for (int jsnCnt = 0; jsnCnt < fltrDataJson.size(); jsnCnt++)
fltrDataJson = getFltrDataJson(dataJsn, groupName,groupNameVal.trim()); {
avlDateMap = new HashMap<String, JSONObject>(); fetchRowWiseVal = (JSONObject) fltrDataJson.get(String.valueOf(jsnCnt));
JSONObject dataJson = new JSONObject(); avlDate = "" + fetchRowWiseVal.get("available_dy").toString().replace("\"", "");
for (int jsnCnt = 0; jsnCnt < fltrDataJson.size(); jsnCnt++) avlDateMap.put(avlDate, (JSONObject)fetchRowWiseVal);
{ }
fetchRowWiseVal = (JSONObject) fltrDataJson.get(String.valueOf(jsnCnt)); int count =0;
avlDate = "" + fetchRowWiseVal.get("available_dy").toString().replace("\"", ""); for (Map.Entry<String, JSONObject> avlMap : avlDateMap.entrySet())
avlDateMap.put(avlDate, (JSONObject)fetchRowWiseVal); {
} dataJson.put(""+count, avlMap.getValue());
int count =0; count++;
for (Map.Entry<String, JSONObject> avlMap : avlDateMap.entrySet()) }
{ gridLblVal = new Label(firstIndex);
dataJson.put(""+count, avlMap.getValue()); FlexTable flexTable = new FlexTable();
count++; CustomGrid data = new CustomGrid(8);
} filtrGridJSN = new JSONObject();
gridLblVal = new Label(firstIndex); filtrGridJSN.put("1", dataJson);
FlexTable flexTable = new FlexTable(); flexTable = data.jsonToArrayList(dataDtl.getGridNMapMetData(jsonObjMetaData,parameterList.get(parameterList.size()-1),parameterList), filtrGridJSN,"1",""+compId,parameterList, filterList,firstIndex);
CustomGrid data = new CustomGrid(8); this.clearContainer(groupName+"Grid");
filtrGridJSN = new JSONObject(); this.createOuterDiv(groupName+"Grid",type,null);
filtrGridJSN.put("1", dataJson); idList.add(groupName+"GridDiv");
flexTable = data.jsonToArrayList(dataDtl.getGridNMapMetData(jsonObjMetaData,parameterList.get(parameterList.size()-1),parameterList), filtrGridJSN,"1",""+compId,parameterList, filterList,firstIndex); RootPanel.get(gridGroupName+"Gridhead").add(gridLblVal);
this.clearContainer(groupName+"Grid"); RootPanel.get(groupName+"GridDiv").add(flexTable);
this.createOuterDiv(groupName+"Grid",type,null); }
RootPanel.get(gridGroupName+"Gridhead").add(gridLblVal); }
RootPanel.get(groupName+"GridDiv").add(flexTable);
}
} }
} }
e12LoadImg.setLoading(false); e12LoadImg.setLoading(false);
...@@ -1641,7 +1716,7 @@ public class GraphComponent extends Composite ...@@ -1641,7 +1716,7 @@ public class GraphComponent extends Composite
{ {
this.clearContainer(groupName); this.clearContainer(groupName);
} }
private void getDisplayData(final JSONObject mainDataJson,ArrayList<ArrayList<String>> graphDtlList ,final String groupCssTypeName,final String width,final String height,final String imageName,final HashMap<String, String>refrshMap, final JSONObject mainDataJsonCopy, String groupName, final ArrayList<FilterInfo> filterList) private void getDisplayData(final JSONObject mainDataJson,ArrayList<ArrayList<String>> graphDtlList ,final String groupCssTypeName,final String width,final String height,final String imageName,final HashMap<String, String>refrshMap, final JSONObject mainDataJsonCopy, final String groupName, final ArrayList<FilterInfo> filterList)
{ {
int dataCnt = 0; int dataCnt = 0;
JSONObject graphJson = null; JSONObject graphJson = null;
...@@ -1660,6 +1735,7 @@ public class GraphComponent extends Composite ...@@ -1660,6 +1735,7 @@ public class GraphComponent extends Composite
String dateformat = getTimeSince(strDate); String dateformat = getTimeSince(strDate);
Label refreshDateTime = new Label(dateformat); Label refreshDateTime = new Label(dateformat);
this.createOuterDiv(groupName,"G",null); this.createOuterDiv(groupName,"G",null);
idList.add(groupName+"Div");
HorizontalPanel componantTtlPanel = new HorizontalPanel(); HorizontalPanel componantTtlPanel = new HorizontalPanel();
HorizontalPanel dateHPanel = new HorizontalPanel(); HorizontalPanel dateHPanel = new HorizontalPanel();
...@@ -1682,10 +1758,10 @@ public class GraphComponent extends Composite ...@@ -1682,10 +1758,10 @@ public class GraphComponent extends Composite
String[] personArr = null; String[] personArr = null;
String persondesg = ""; String persondesg = "";
for (String multGrph : mainDataJson.keySet())
for (final String multGrph : mainDataJson.keySet())
{ {
cnt++; cnt++;
//Window.alert("multGrph :"+multGrph);
this.createInnerDiv(cnt,groupName); this.createInnerDiv(cnt,groupName);
personArr = multGrph.split("@"); personArr = multGrph.split("@");
...@@ -1712,8 +1788,16 @@ public class GraphComponent extends Composite ...@@ -1712,8 +1788,16 @@ public class GraphComponent extends Composite
@Override @Override
public void onClick(ClickEvent event) public void onClick(ClickEvent event)
{ {
/*Add if else condition to open a new window by Dhanendra on Date 16-10-2015*/
e12LoadImg.setLoading(true); e12LoadImg.setLoading(true);
getOnClickFltrDataJson(mainDataJsonCopy, personName.trim(),refrshMap,groupCssTypeName, width, height, imageName,filterList); if(groupName.equalsIgnoreCase("repname"))
{
getOnClickOpenGrid(personName.trim(),filterList);
}else
{
getOnClickFltrDataJson(mainDataJsonCopy, personName.trim(),refrshMap,groupCssTypeName, width, height, imageName,filterList);
}
/*End if else condition to open a new window by Dhanendra on Date 16-10-2015*/
} }
}); });
lableImg.addClickHandler(new ClickHandler() lableImg.addClickHandler(new ClickHandler()
...@@ -1721,8 +1805,16 @@ public class GraphComponent extends Composite ...@@ -1721,8 +1805,16 @@ public class GraphComponent extends Composite
@Override @Override
public void onClick(ClickEvent event) public void onClick(ClickEvent event)
{ {
/*Add if else condition to open a new window by Dhanendra on Date 16-10-2015*/
e12LoadImg.setLoading(true); e12LoadImg.setLoading(true);
getOnClickFltrDataJson(mainDataJsonCopy, personName.trim(),refrshMap,groupCssTypeName, width, height, imageName,filterList); if(groupName.equalsIgnoreCase("repname"))
{
getOnClickOpenGrid(personName.trim(),filterList);
}else
{
getOnClickFltrDataJson(mainDataJsonCopy, personName.trim(),refrshMap,groupCssTypeName, width, height, imageName,filterList);
}
/*End if else condition to open a new window by Dhanendra on Date 16-10-2015*/
} }
}); });
RootPanel.get("chart"+cnt).setStyleName(groupCssTypeName); RootPanel.get("chart"+cnt).setStyleName(groupCssTypeName);
...@@ -1788,4 +1880,26 @@ public class GraphComponent extends Composite ...@@ -1788,4 +1880,26 @@ public class GraphComponent extends Composite
} }
/*End This method for get time by Dhanendra on 23/06/2015*/ /*End This method for get time by Dhanendra on 23/06/2015*/
/*Add this method to open a new window to display a grid from click on last hierachey by Dhanendra on date 16-10-2015 */
private void getOnClickOpenGrid(String personName,ArrayList<FilterInfo> filterList)
{
int count = 0;
String propertyStr = "";
for (FilterInfo filterInfo : filterList)
{
if(count==0)
{
propertyStr = "&"+filterInfo.getFieldName()+"="+parameterList.get(count+1);
}
else
{
propertyStr = propertyStr+"&"+filterInfo.getFieldName()+"="+parameterList.get(count+1);
}
count++;
}
Window.open("/ibase/dwh/GwtDashboardPage.html?metadataname=compliancegrid&personName="+personName+propertyStr+"&FLAG=N", "_blank", "menubar=no,toolbar=no,location=no,resizable=yes,scrollbars=yes,status=no,height=550,width=800,top=100,left=300");
e12LoadImg.setLoading(false);
}
/*Add this method to open a new window to display a grid from click on last hierachey by Dhanendra on date 16-10-2015 */
} }
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