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
*/
/*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;
HashMap<String, String> refCompIdMap= new HashMap<String, String>();
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;
String gridGroupName = "";
String gridCssName = "";
......@@ -88,7 +88,6 @@ public class GraphComponent extends Composite
//final ArrayList<FilterInfo> filterList = metaDataDtl.getFilters(metaDataJsnObj);
public GraphComponent(ArrayList<String> parameterList, JSONObject metaDataJsnObj,String showfilter)
{
userMail = Window.Location.getParameter("EMP_MAILCODE") == null ? "" : Window.Location.getParameter("EMP_MAILCODE");
reportCaption= Window.Location.getParameter("GEO_LOCATION") == null ? "" : Window.Location.getParameter("GEO_LOCATION");
String isShowfilter= Window.Location.getParameter("FLAG");
......@@ -156,7 +155,10 @@ public class GraphComponent extends Composite
JSONObject filtrGridJSN = null;
String avlDate = "";
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*/
// added variable to add html tag to ssgrid by swati on 08-sep-2015
String htmlString="";
......@@ -178,6 +180,7 @@ public class GraphComponent extends Composite
}
}*/
/** End Code By Dhanendra for No Data Found Msg **/
if (idList.size() > 0)
{
for (int i = 0; i < idList.size(); i++)
......@@ -199,6 +202,7 @@ public class GraphComponent extends Composite
{*/ // for only OTC
for (String componentId : gridNGraphMeataDataMap.keySet())
{
jsonObjFrGraph=new JSONObject();
if(isNumeric(componentId))
{
......@@ -241,6 +245,10 @@ public class GraphComponent extends Composite
jsonObjFrGraph = (JSONObject) dataMap.get(dtSrouce);
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())
{
graphDtlList = graphDataMap.get(graphNo);
......@@ -352,6 +360,10 @@ public class GraphComponent extends Composite
}
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)
{
/*comment line by Dhanendra*/
......@@ -426,6 +438,7 @@ public class GraphComponent extends Composite
filtrGridJSN.put(dtSrouce, dataJsn);
flexTable = data.jsonToArrayList(dataDtl.getGridNMapMetData(jsonObjMetaData,parameterList.get(parameterList.size()-1),parameterList), filtrGridJSN,dtSrouce,componentId,parameterList, filterList,firstIndex);
this.createOuterDiv(gridGroupName+"Grid",type,null);
idList.add(gridGroupName+"GridDiv");
Image gridTtlImg = new Image("FusionChart/images/"+gridIconName);
HorizontalPanel gridTtlPanel = new HorizontalPanel();
gridTitleLbl = new Label(firstIndex);
......@@ -479,6 +492,10 @@ public class GraphComponent extends Composite
}
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())
{
graphDtlList = graphDataMap.get(graphNo);
......@@ -500,6 +517,10 @@ public class GraphComponent extends Composite
/**Start of india map build method by swati 17 April 2015**/
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())
{
graphDtlList = graphDataMap.get(graphNo);
......@@ -521,6 +542,11 @@ public class GraphComponent extends Composite
/**start of card build method by sachin 10 July 2015**/
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())
{
//RootPanel.get("chartContainer"+componentId).clear();
......@@ -561,14 +587,12 @@ public class GraphComponent extends Composite
}
/**end of card build method by sachin 10 July 2015**/
/** Star Code for Building ganttChart by sachin 5 Aug 2015 **/
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())
{
graphDtlList = graphDataMap.get(graphNo);
......@@ -619,12 +643,12 @@ public class GraphComponent extends Composite
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())
{
graphDtlList = graphDataMap.get(graphNo);
for (int i = 0; i < graphDtlList.size(); i++)
{
if (i == 0)
......@@ -651,11 +675,6 @@ public class GraphComponent extends Composite
}
}
/** End Star Code for Building HTML_GAUGE by sachin 5 Aug 2015 **/
}
}
e12LoadImg.setLoading(false);
......@@ -663,9 +682,7 @@ public class GraphComponent extends Composite
{
Window.alert("No Data Found");
}*/
}
/** Added new Method by sachin on 18 Aug 2015 **/
private native void createGaugeChart(String chartData, String chartContainer)
/*-{
......@@ -826,6 +843,10 @@ public class GraphComponent extends Composite
// System.out.print("jsonObjFrGraph is ="+jsonObjFrGraph);
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())
{
graphDtlList = graphDataMap.get(graphNo);
......@@ -930,6 +951,10 @@ public class GraphComponent extends Composite
}
} 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)
{
//RootPanel.get("chartContainer" + componentId).clear();
......@@ -1004,6 +1029,7 @@ public class GraphComponent extends Composite
filtrGridJSN.put(dtSrouce, dataJsn);
flexTable = data.jsonToArrayList(dataDtl.getGridNMapMetData(jsonObjMetaData,parameterList.get(parameterList.size()-1),parameterList), filtrGridJSN,dtSrouce,componentId,parameterList, filterList,firstIndex);
this.createOuterDiv(gridGroupName+"Grid",type,null);
idList.add(gridGroupName+"GridDiv");
Image gridTtlImg = new Image("FusionChart/images/"+gridIconName);
HorizontalPanel gridTtlPanel = new HorizontalPanel();
gridTitleLbl = new Label(firstIndex);
......@@ -1062,6 +1088,10 @@ public class GraphComponent extends Composite
}
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())
{
graphDtlList = graphDataMap.get(graphNo);
......@@ -1083,6 +1113,10 @@ public class GraphComponent extends Composite
/** Start of india map build method by swati 17 April 2015 **/
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())
{
graphDtlList = graphDataMap.get(graphNo);
......@@ -1108,6 +1142,9 @@ public class GraphComponent extends Composite
/** Star Code for Building ganttChart by sachin 5 Aug 2015 **/
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())
{
graphDtlList = graphDataMap.get(graphNo);
......@@ -1158,12 +1195,12 @@ public class GraphComponent extends Composite
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())
{
graphDtlList = graphDataMap.get(graphNo);
for (int i = 0; i < graphDtlList.size(); i++)
{
if (i == 0)
......@@ -1190,9 +1227,6 @@ public class GraphComponent extends Composite
}
}
/** End Star Code for Building HTML_GAUGE by sachin 5 Aug 2015 **/
}
}
e12LoadImg.setLoading(false);
......@@ -1200,9 +1234,33 @@ public class GraphComponent extends Composite
* }else { Window.alert("No Data Found"); }
*/
}
/*ended of new 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)
/*-{
try {
......@@ -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**/
String flitrValue="";
objActionPath = "/ibase/" + servletname;
int cnt=0;
if(filterList.size()>0)
......@@ -1300,13 +1358,24 @@ public class GraphComponent extends Composite
{
cnt++;
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)
{
objActionPath=objActionPath + "?" + filterInfo.getColName()+"="+parameterList.get(cnt);
objActionPath=objActionPath + "?" + filterInfo.getColName()+"="+flitrValue;
}else
{
objActionPath=objActionPath + "&" + filterInfo.getColName()+"="+parameterList.get(cnt);
objActionPath=objActionPath + "&" + filterInfo.getColName()+"="+flitrValue;
}
}
objActionPath=objActionPath+"&dataSourceName=" + dbDataSource + "&reportName="+page+"&viewOptionSelectd="+viewOptionSelectd;
......@@ -1441,7 +1510,7 @@ public class GraphComponent extends Composite
groupVal = groupVal.replace('"', ' ');
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());
if(!prevGroupVal.equals(groupVal) && !("").equals(prevGroupVal))
......@@ -1484,7 +1553,7 @@ public class GraphComponent extends Composite
}
}
}
//Window.alert("rawDataMapJsonOuter :"+rawDataMapJsonOuter);
//Window.alert("rawDataMapJsonOuter :"+rawDataMapOuterJsn);
return rawDataMapOuterJsn;
}
private JSONObject getFltrDataJson(JSONObject dataJsn, String groupName, String selcetIndex)
......@@ -1549,6 +1618,7 @@ public class GraphComponent extends Composite
{
fetchRowWiseVal = (JSONObject) dataJsn.get(String.valueOf(jsnCnt));
set = fetchRowWiseVal.keySet();
for(String key : set)
{
keyVal = fetchRowWiseVal.get(key).toString().replace("\"", "").trim();
......@@ -1571,6 +1641,9 @@ public class GraphComponent extends Composite
if(entry.getKey().equalsIgnoreCase(groupName))
{
refrshComponatId = entry.getValue();
/*Add if condition to check last hierachey by Dhanedra on Date 16-10-2015 */
if(!refrshComponatId.equalsIgnoreCase("0"))
{
graphTypeMap = gridNGraphMeataDataMap.get("type"+refrshComponatId);
String type = ""+(graphTypeMap.get("type"+refrshComponatId));
graphDataMap = gridNGraphMeataDataMap.get(refrshComponatId);
......@@ -1630,18 +1703,20 @@ public class GraphComponent extends Composite
flexTable = data.jsonToArrayList(dataDtl.getGridNMapMetData(jsonObjMetaData,parameterList.get(parameterList.size()-1),parameterList), filtrGridJSN,"1",""+compId,parameterList, filterList,firstIndex);
this.clearContainer(groupName+"Grid");
this.createOuterDiv(groupName+"Grid",type,null);
idList.add(groupName+"GridDiv");
RootPanel.get(gridGroupName+"Gridhead").add(gridLblVal);
RootPanel.get(groupName+"GridDiv").add(flexTable);
}
}
}
}
e12LoadImg.setLoading(false);
}
private void getClearDiv(String 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;
JSONObject graphJson = null;
......@@ -1660,6 +1735,7 @@ public class GraphComponent extends Composite
String dateformat = getTimeSince(strDate);
Label refreshDateTime = new Label(dateformat);
this.createOuterDiv(groupName,"G",null);
idList.add(groupName+"Div");
HorizontalPanel componantTtlPanel = new HorizontalPanel();
HorizontalPanel dateHPanel = new HorizontalPanel();
......@@ -1682,10 +1758,10 @@ public class GraphComponent extends Composite
String[] personArr = null;
String persondesg = "";
for (final String multGrph : mainDataJson.keySet())
for (String multGrph : mainDataJson.keySet())
{
cnt++;
//Window.alert("multGrph :"+multGrph);
this.createInnerDiv(cnt,groupName);
personArr = multGrph.split("@");
......@@ -1712,18 +1788,34 @@ public class GraphComponent extends Composite
@Override
public void onClick(ClickEvent event)
{
/*Add if else condition to open a new window by Dhanendra on Date 16-10-2015*/
e12LoadImg.setLoading(true);
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()
{
@Override
public void onClick(ClickEvent event)
{
/*Add if else condition to open a new window by Dhanendra on Date 16-10-2015*/
e12LoadImg.setLoading(true);
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);
if(dataCnt == 0)
......@@ -1788,4 +1880,26 @@ public class GraphComponent extends Composite
}
/*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