Commit 0843db2b authored by dkasliwal's avatar dkasliwal

GraphComponent : Changes in buildChart method for unique id

DOM.createUniqueId() for Smart filter
ChartCreator : Add code for open link metadatadata from pie chart
GwtDashboardPage.css :Add outerVPanel class to smart filter popup
 SmartFiltrCreator : change in initPopUpPnl method add uniqueID to smartfilterDivID
And popup add to Rootpanel
CustomGrid :In createTableComponent method add personName to set on title for sardia dashboard


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@99334 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 687a4795
......@@ -351,43 +351,109 @@ public class ChartCreator
String url=Window.Location.getParameter("titleName");
String prdFilter="";
/*Added code to open new chart in frame by swati 25 Nov 2015*/
String propertyStr="";
int count=0;
for (FilterInfo filterInfo : filterList)
{
if(count==0)
{
propertyStr = "&"+filterInfo.getFieldName()+"@"+parameterList.get(count+1);
}
else
{
propertyStr = propertyStr+"&"+filterInfo.getFieldName()+"@"+parameterList.get(count+1);
}
count++;
}
if(prdFilterName.length()>0)
{
prdFilter=prdFilterName;
}
if(url=="undefined" || url.equals("undefined") || url.equalsIgnoreCase("undefined"))
{
if((FilterCreator.title).size()>0)
url="&titleName@"+(FilterCreator.title).get(0)+(""+jsnStringValue).replace('"', ' ').trim();
}
else
{
url="&titleName@"+url+":"+(FilterCreator.title).get(0)+(""+jsnStringValue).replace('"', ' ').trim();
}
if((prevUrl).trim().length()>1)
{
if(linkTypeList.get(seriesCnt).trim().equalsIgnoreCase("n"))
{
linkStringValue=new JSONString(linkTypeList.get(seriesCnt)+"-"+"/ibase/dwh/GwtDashboardPage.html?metadataname@"+linkLMetadataList.get(seriesCnt)+prevUrl.replace('=', '@')+"&"+prdFilter+"@"+period+url+"&"+yAxisColunList.get(seriesCnt)+"@"+(""+dataStringValue).replace('"', ' ').trim()+"&"+xAxisColunList.get(0)+"@"+(""+jsnStringValue).replace('"', ' ').trim());
if(linkLMetadataList.get(seriesCnt).trim().contains("/"))
{
linkStringValue=new JSONString(linkTypeList.get(seriesCnt).trim()+"-"+linkLMetadataList.get(seriesCnt)+propertyStr+prevUrl.replace('=', '@')+"&"+prdFilter+"@"+period+url+"&"+yAxisColunList.get(seriesCnt)+"@"+(""+dataStringValue).replace('"', ' ').trim()+"&"+xAxisColunList.get(0)+"@"+(""+jsnStringValue).replace('"', ' ').trim());
}else {
linkStringValue=new JSONString(linkTypeList.get(seriesCnt).trim()+"-"+"/ibase/dwh/GwtDashboardPage.html?metadataname@"+linkLMetadataList.get(seriesCnt)+propertyStr+prevUrl.replace('=', '@')+"&"+prdFilter+"@"+period+url+"&"+yAxisColunList.get(seriesCnt)+"@"+(""+dataStringValue).replace('"', ' ').trim()+"&"+xAxisColunList.get(0)+"@"+(""+jsnStringValue).replace('"', ' ').trim());
}
}
else if(linkTypeList.get(seriesCnt).trim().equalsIgnoreCase("p"))
{
linkStringValue=new JSONString(linkTypeList.get(seriesCnt)+"-detailsPopUp,"+linkedProperties+"-/ibase/dwh/GwtDashboardPage.html?metadataname@"+linkLMetadataList.get(seriesCnt)+prevUrl.replace('=', '@')+"&"+prdFilter+"@"+period+url+"&"+yAxisColunList.get(seriesCnt)+"@"+(""+dataStringValue).replace('"', ' ').trim()+"&"+xAxisColunList.get(0)+"@"+(""+jsnStringValue).replace('"', ' ').trim());
if(linkLMetadataList.get(seriesCnt).trim().contains("/"))
{
linkStringValue=new JSONString(linkTypeList.get(seriesCnt).trim()+"-detailsPopUp,"+linkedProperties+"-"+linkLMetadataList.get(seriesCnt)+propertyStr+prevUrl.replace('=', '@')+"&"+prdFilter+"@"+period+url+"&"+yAxisColunList.get(seriesCnt)+"@"+(""+dataStringValue).replace('"', ' ').trim()+"&"+xAxisColunList.get(0)+"@"+(""+jsnStringValue).replace('"', ' ').trim());
}else {
linkStringValue=new JSONString(linkTypeList.get(seriesCnt).trim()+"-detailsPopUp,"+linkedProperties+"-/ibase/dwh/GwtDashboardPage.html?metadataname@"+linkLMetadataList.get(seriesCnt)+propertyStr+prevUrl.replace('=', '@')+"&"+prdFilter+"@"+period+url+"&"+yAxisColunList.get(seriesCnt)+"@"+(""+dataStringValue).replace('"', ' ').trim()+"&"+xAxisColunList.get(0)+"@"+(""+jsnStringValue).replace('"', ' ').trim());
}
}
/*Added code to open new chart in frame by swati 25 Nov 2015*/
if(linkTypeList.get(seriesCnt).trim().equalsIgnoreCase("f"))
{
String cellValue=(""+dataStringValue).replace('"', ' ');
String urlStr="";
String parameterListString=yAxisColunList.get(seriesCnt)+"&"+(""+dataStringValue).replace('"', ' ').trim()+"&"+xAxisColunList.get(0)+"@"+(""+jsnStringValue).replace('"', ' ').trim();
if(linkLMetadataList.get(seriesCnt).trim().length()>0 )
{
linkStringValue=new JSONString("JavaScript: isJavaScriptCall=true;linkFunction('"+linkLMetadataList.get(seriesCnt)+"', '"+cellValue+"', '"+propertyStr+"','"+ urlStr+"', '"+parameterListString+"', 'Y')");
}
}
/*ended code to open new chart in frame by swati 25 Nov 2015*/
}
else
{
if(linkTypeList.get(seriesCnt).trim().equalsIgnoreCase("n"))
{
linkStringValue=new JSONString(linkTypeList.get(seriesCnt)+"-"+"/ibase/dwh/GwtDashboardPage.html?metadataname@"+linkLMetadataList.get(seriesCnt)+"&"+prdFilter+"@"+period+url+"&"+yAxisColunList.get(seriesCnt)+"@"+(""+dataStringValue).replace('"', ' ').trim()+"&"+xAxisColunList.get(0)+"@"+(""+jsnStringValue).replace('"', ' ').trim());
if(linkLMetadataList.get(seriesCnt).trim().contains("/"))
{
linkStringValue=new JSONString(linkTypeList.get(seriesCnt).trim()+"-"+linkLMetadataList.get(seriesCnt)+propertyStr+"&"+prdFilter+"@"+period+url+"&"+yAxisColunList.get(seriesCnt)+"@"+(""+dataStringValue).replace('"', ' ').trim()+"&"+xAxisColunList.get(0)+"@"+(""+jsnStringValue).replace('"', ' ').trim());
}else {
linkStringValue=new JSONString(linkTypeList.get(seriesCnt).trim()+"-"+"/ibase/dwh/GwtDashboardPage.html?metadataname@"+linkLMetadataList.get(seriesCnt)+propertyStr+"&"+prdFilter+"@"+period+url+"&"+yAxisColunList.get(seriesCnt)+"@"+(""+dataStringValue).replace('"', ' ').trim()+"&"+xAxisColunList.get(0)+"@"+(""+jsnStringValue).replace('"', ' ').trim());
}
else if(linkTypeList.get(seriesCnt).trim().equalsIgnoreCase("p")){
linkStringValue=new JSONString(linkTypeList.get(seriesCnt)+"-detailsPopUp,"+linkedProperties+"-/ibase/dwh/GwtDashboardPage.html?metadataname@"+linkLMetadataList.get(seriesCnt)+"&"+prdFilter+"@"+period+url+"&"+yAxisColunList.get(seriesCnt)+"@"+(""+dataStringValue).replace('"', ' ').trim()+"&"+xAxisColunList.get(0)+"@"+(""+jsnStringValue).replace('"', ' ').trim());
}
else if(linkTypeList.get(seriesCnt).trim().equalsIgnoreCase("p"))
{
if(linkLMetadataList.get(seriesCnt).trim().contains("/"))
{
linkStringValue=new JSONString(linkTypeList.get(seriesCnt).trim()+"-detailsPopUp,"+linkedProperties+"-"+linkLMetadataList.get(seriesCnt)+propertyStr+"&"+prdFilter+"@"+period+url+"&"+yAxisColunList.get(seriesCnt)+"@"+(""+dataStringValue).replace('"', ' ').trim()+"&"+xAxisColunList.get(0)+"@"+(""+jsnStringValue).replace('"', ' ').trim());
}else {
linkStringValue=new JSONString(linkTypeList.get(seriesCnt).trim()+"-detailsPopUp,"+linkedProperties+"-/ibase/dwh/GwtDashboardPage.html?metadataname@"+linkLMetadataList.get(seriesCnt)+propertyStr+"&"+prdFilter+"@"+period+url+"&"+yAxisColunList.get(seriesCnt)+"@"+(""+dataStringValue).replace('"', ' ').trim()+"&"+xAxisColunList.get(0)+"@"+(""+jsnStringValue).replace('"', ' ').trim());
}
categoryMap.put(linkStringKey, linkStringValue);
}
/*Added code to open new chart in frame by swati 25 Nov 2015*/
if(linkTypeList.get(seriesCnt).trim().equalsIgnoreCase("f"))
{
String metadataName=parameterList.get(0);
String cellValue=(""+dataStringValue).replace('"', ' ');
String urlStr="";
String parameterListString=yAxisColunList.get(seriesCnt)+"&"+(""+dataStringValue).replace('"', ' ').trim()+"&"+xAxisColunList.get(0)+"@"+(""+jsnStringValue).replace('"', ' ').trim();
if(linkLMetadataList.get(seriesCnt).trim().length()>0 )
{
linkStringValue=new JSONString("JavaScript: isJavaScriptCall=true;linkFunction('"+linkLMetadataList.get(seriesCnt)+"', '"+cellValue+"', '"+propertyStr+"','"+ urlStr+"', '"+parameterListString+"', 'Y')");
}
}
/*ended code to open new chart in frame by swati 25 Nov 2015*/
}
categoryMap.put(linkStringKey, linkStringValue);
}
/*ended for serdia*/
/*ended link code fpr poup,new tab,frame by swati date 25 Nov 2015*/
barValueList.add(categoryMap);
barDataVal = JSONParser.parseStrict(barValueList.toString().replace('=', ':'));
}
......
......@@ -384,6 +384,9 @@ public class CustomGrid extends AbstractDataGrid<DataGridTableRowModel>
/* add code for Compliance Dashboard JNJ by Dhanendra 16/06/15*/
String salesPers = Window.Location.getParameter("SALES_PERS") == null ? "" : Window.Location.getParameter("SALES_PERS");
/*End code for Compliance Dashboard JNJ by Dhanendra 16/06/15*/
/* add code for epa Dashboard by Dhanendra 29/09/15*/
String empCode = Window.Location.getParameter("EMP_CODE") == null ? "" : Window.Location.getParameter("EMP_CODE");
/*End code for epa Dashboard by Dhanendra 29/09/15*/
if(caption.trim().length()==0 && cellVal.trim().length()>0)
{
if(brandName.trim().length()>0)
......@@ -396,6 +399,10 @@ public class CustomGrid extends AbstractDataGrid<DataGridTableRowModel>
caption = salesPers.trim()+" - "+cellVal.trim();
}
/* add code for Compliance Dashboard JNJ by Dhanendra 16/06/15*/
else if(empCode.trim().length()>0)
{
caption = "Employee Code : "+empCode.trim();
}
else
{
caption = cellVal.trim();
......@@ -574,7 +581,8 @@ public class CustomGrid extends AbstractDataGrid<DataGridTableRowModel>
try {
$wnd.createFrameContainer();
document.getElementById('frameContainer').innerHTML = "<iframe scrolling='no' id='frame1' width='99%' height='230' frameborder='0' src='/ibase/dwh/GwtDashboardPage.html?metadataname="+metadataName+propertyStr+"&"+parameterListString+"&CELL_VAL="+cellValue.trim()+"&P1="+urlStr+"&FLAG=N'></iframe>";
// set height 430 and width 100% by dhanendra on date 21-10-2015
document.getElementById('frameContainer').innerHTML = "<iframe scrolling='no' id='frame1' width='100%' height='430' frameborder='0' src='/ibase/dwh/GwtDashboardPage.html?metadataname="+metadataName+propertyStr+"&"+parameterListString+"&CELL_VAL="+cellValue.trim()+"&P1="+urlStr+"&FLAG=N'></iframe>";
//document.getElementById('frameContainer').innerHTML = "<iframe scrolling='no' id='frame1' width='99%' height='230' frameborder='0' src='/ibase/dwh/GwtDashboardPage.html?metadataname="+metadataName+propertyStr+"&"+parameterListString+"&CELL_VAL="+cellValue.trim()+"&P1="+urlStr+"&FLAG="+dispFilterStatus+"'></iframe>";
} catch (e) {
......@@ -768,12 +776,22 @@ public class CustomGrid extends AbstractDataGrid<DataGridTableRowModel>
displayPager.setRangeCommand( setRowCmd );
String cellVal = Window.Location.getParameter("CELL_VAL") == null ? "" : Window.Location.getParameter("CELL_VAL");
String brandName = Window.Location.getParameter("brand") == null ? "" : Window.Location.getParameter("brand");
/*Add Code for sardia Dashboard to set on title by Dhanendra on Date 03-12-2015*/
String personName = Window.Location.getParameter("personName") == null ? "" : Window.Location.getParameter("personName");
/*End Code for sardia Dashboard to set on title by Dhanendra on Date 03-12-2015*/
if(caption.trim().length()==0 && cellVal.trim().length()>0)
{
if(brandName.trim().length()>0)
{
caption = brandName.trim()+" - "+cellVal.trim()+" (Stock Quantity) ";
}
/*Add Code for sardia Dashboard to set on title by Dhanendra on Date 03-12-2015*/
else if(personName.trim().length()>0)
{
caption = personName.trim()+" - "+cellVal.trim();
}
/*End Code for sardia Dashboard to set on title by Dhanendra on Date 03-12-2015*/
else
{
caption = cellVal.trim();
......
......@@ -105,14 +105,11 @@ public class GraphComponent extends Composite
/*End Added New code by sachin on 4/5/15*/
initWidget(mainContainer);
/*if(isCheck)
{
RootPanel panel = RootPanel.get("chartContainer");
}*/
}
@SuppressWarnings("unchecked")
public void buildChart(final LinkedHashMap<String, JSONObject> dataMap,ArrayList<String> parameterList,ArrayList<FilterInfo> filterList)
{
/*Start Add uniqueId for random Id by Dhanendra on 09-11-2015*/
String uniqueId = DOM.createUniqueId();
/*End Add uniqueId for random Id by Dhanendra on 09-11-2015*/
......@@ -135,7 +132,7 @@ public class GraphComponent extends Composite
HashMap<String, ArrayList<String>> graphTypeMap = null;
String dtSrouce="";
/*Added By Dhanendra on 25May2015 for Group*/
/** Added By Dhanendra on 25May2015 for Group **/
ArrayList<String> groupNameList = null;
ArrayList<String> componantTitlNameList = null;
ArrayList<String> groupCssTypeNameList = null;
......@@ -158,15 +155,17 @@ 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
/* 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
/*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="";
HTMLPanel htmlPnl=null;
// ended variable to add html tag to ssgrid by swati on 08-sep-2015
/* ended variable to add html tag to ssgrid by swati on 08-sep-2015 */
/** Add Code By Dhanendra for No Data Found Msg **/
/*String parameter="";
boolean isParameter = false;
......@@ -183,29 +182,28 @@ public class GraphComponent extends Composite
}
}*/
/** End Code By Dhanendra for No Data Found Msg **/
/*Add Veriable by Dhanendra on 20-10-2015*/
String firstNameforTitle = "";
/*Add Veriable by Dhanendra on 20-10-2015*/
/** End Code By Dhanendra for No Data Found Msg **/
if (idList.size() > 0)
{
for (int i = 0; i < idList.size(); i++)
{
/*comment line because of container name change by Dhanedra 01-07-15*/
//RootPanel panel = RootPanel.get("chartContainer" + idList.get(i));
/*comment line because of container name change by Dhanedra 01-07-15*/
/**comment line because of container name change by Dhanedra 01-07-15**/
/*RootPanel panel = RootPanel.get("chartContainer" + idList.get(i));*/
/**comment line because of container name change by Dhanedra 01-07-15**/
RootPanel panel = RootPanel.get(idList.get(i));
/*if(panel!=null)
{*/
if(panel!=null)
{
panel.clear();
if (panel.getElement().getFirstChild() != null)
{
//panel.getElement().getFirstChild().removeFromParent();
panel.getElement().removeFromParent();
}
/*}*/
}
}
idList = new ArrayList<String>();
}
......@@ -236,6 +234,7 @@ public class GraphComponent extends Composite
component = "" + componentTypeMap.get("buildComponent"+componentId);
/* Add code for get value from metadata by Dhanendra 10Jun2015*/
groupTypeMap = gridNGraphMeataDataMap.get("groupName"+componentId);
gridGroupName = ""+ groupTypeMap.get("groupName"+componentId);
gridRefCompontDataMap = gridNGraphMeataDataMap.get("refreshCompont"+componentId);
......@@ -245,21 +244,18 @@ public class GraphComponent extends Composite
gridCssName = ""+ gridCssMap.get("cssName"+componentId);
gridComponantTitleMap = gridNGraphMeataDataMap.get("componantTitle"+componentId);
gridComponantTitleName = ""+ gridComponantTitleMap.get("componantTitle"+componentId);
// added by swati to add image in grid title
gridIconMap= gridNGraphMeataDataMap.get("iconName"+componentId);
gridIconName = ""+ gridIconMap.get("iconName"+componentId);
// ended by swati to add image in grid title
/* End code for get value from metadata by Dhanendra 10Jun2015*/
/*added by swati to add image in grid title*/
gridIconMap= gridNGraphMeataDataMap.get("iconName"+componentId);
gridIconName = ""+ gridIconMap.get("iconName"+componentId);
/*ended by swati to add image in grid title*/
}
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);
......@@ -280,6 +276,8 @@ public class GraphComponent extends Composite
// ended code to add html tag to ssgrid by swati on 08-sep-2015
if(groupNameList.size()>0)
{
/**Loop for Compliance Dashboard**/
refreshComponantIdList =(ArrayList<String>)graphDtlList.get(20);
refCompIdMap.put(groupNameList.get(0), refreshComponantIdList.get(0));
rawDataMapJsonOuter = new JSONObject();
......@@ -337,9 +335,10 @@ public class GraphComponent extends Composite
}/*end Code for display Dashboard one by one in one page by Dhanendra*/
else
{
/*For Normal Graph */
graphJson = ChartCreator.buildChartData(graphDtlList, jsonObjFrGraph, dtSrouce,parameterList,filterList);
// start- added empty json chartdata to display no data found message by swati on 7jan2015
if(graphJson.size()==0 )
if(graphJson.size()==0)
{
graphJson.put("chart", new JSONString(""));
}
......@@ -354,7 +353,6 @@ public class GraphComponent extends Composite
/*End uniqueId to Graph by Dhanendra on date 10-11-2015*/
Label componantTtl = new Label(componantTitlNameList.get(0));
Image componantTtlImg = new Image("FusionChart/images/"+componentIconName);
Image refreshImg = new Image("FusionChart/images/refresh.png");
......@@ -386,7 +384,7 @@ public class GraphComponent extends Composite
RootPanel.get("Graph"+uniqueId+componentId+"head").add(mainPanel);
/*End uniqueId to Graph by Dhanendra on date 10-11-2015*/
// added code to add html tag to ssgrid by swati on 08-sep-2015
/* added code to add html tag to ssgrid by swati on 08-sep-2015*/
if(htmlString.length()>0)
{
htmlPnl = new HTMLPanel(htmlString);
......@@ -394,7 +392,7 @@ public class GraphComponent extends Composite
RootPanel.get("Graph"+uniqueId+componentId).add(htmlPnl);
/*End uniqueId to Graph by Dhanendra on date 10-11-2015*/
}
// ended code to add html tag to ssgrid by swati on 08-sep-2015
/* ended code to add html tag to ssgrid by swati on 08-sep-2015 */
/*Add uniqueId to Graph by Dhanendra on date 10-11-2015*/
this.createInnerDiv(uniqueId+componentId,"Graph"+uniqueId+componentId);
......@@ -407,10 +405,6 @@ 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*/
......@@ -446,6 +440,7 @@ public class GraphComponent extends Composite
filtrGridJSN = new JSONObject();
if(gridGroupName.length() == 0)
{
/*Loop for normal Data Grid*/
flexTable = data.jsonToArrayList(gridNGraphMeataDataMap, jsonObjFrGraph,dtSrouce,componentId,parameterList, filterList,firstIndex);
/*Added code for Dyanamic Div and New CSS By Dhanendra 01-07-15*/
Image gridTtlImg = new Image("FusionChart/images/"+gridIconName);
......@@ -468,8 +463,9 @@ public class GraphComponent extends Composite
/*RootPanel.get("chartContainer"+componentId).clear();
RootPanel.get("chartContainer"+componentId).add(flexTable);*/
}else{
}else
{
/*Loop for Compliance Data Grid*/
fltrDataJson = getFltrDataJson(fltrDataJson, gridGroupName,null);
avlDateMap = new HashMap<String, JSONObject>();
dataJsn = new JSONObject();
......@@ -555,10 +551,6 @@ 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);
......@@ -580,17 +572,15 @@ 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);
imageName = (String) graphDtlList.get(0);
width = (String) graphDtlList.get(1);
height = (String) graphDtlList.get(2);
graphJson = ChartCreator.buildCountryMap(graphDtlList, jsonObjFrGraph, dtSrouce); // start- added empty json chartdata to display no data found message by swati on 7jan2015
graphJson = ChartCreator.buildCountryMap(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(""));
......@@ -605,11 +595,6 @@ 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();
......@@ -641,15 +626,8 @@ public class GraphComponent extends Composite
RootPanel.get("Card"+uniqueId+componentId+"Div").add(panel);
/*End uniqueId to Card by Dhanendra on date 10-11-2015*/
/*Ended code for Dyanamic Div and New CSS By Dhanendra 13-07-15*/
/*
* imageName = (String) graphDtlList.get(0); width =
* (String) graphDtlList.get(1); height = (String)
* graphDtlList.get(2);
*/
/*Ended code for Dyanamic Div and New CSS By Dhanendra 13-07-15*/
}
}
/**end of card build method by sachin 10 July 2015**/
......@@ -657,9 +635,6 @@ 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);
......@@ -710,9 +685,6 @@ 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);
......@@ -766,10 +738,10 @@ public class GraphComponent extends Composite
/*added new method for smart filter by sachin 12 may 2015*/
/*Add IdList Parameter to buildchart method by dhanendra on date 23-11-2015*/
@SuppressWarnings("unchecked")
public void buildChart(final LinkedHashMap<String, JSONObject> dataMap ,HashMap<String, HashMap> gridNGraphMeataDataMap,ArrayList<FilterInfo> filterList,ArrayList<String> idListTemp)
public void buildChart(final LinkedHashMap<String, JSONObject> dataMap ,HashMap<String, HashMap> gridNGraphMeataDataMap,ArrayList<FilterInfo> filterList,ArrayList<String> containerIdList)
{
/*Start Add uniqueId for random Id by Dhanendra on 19-11-2015*/
String uniqueId = DOM.createUniqueId();
//String uniqueId = DOM.createUniqueId();
/*End Add uniqueId for random Id by Dhanendra on 19-11-2015*/
JSONObject jsonObjFrGraph = null;
......@@ -830,6 +802,10 @@ public class GraphComponent extends Composite
String firstNameforTitle = "";
/*Add Veriable by Dhanendra on 20-10-2015*/
/*Add Veriable by Dhanendra on 20-10-2015*/
int countForSmartFilter = 0;
/*Add Veriable by Dhanendra on 20-10-2015*/
/*String parameter = "";
boolean isParameter = false;
for (int i = 0; i < parameterList.size(); i++)
......@@ -868,32 +844,32 @@ public class GraphComponent extends Composite
*/// for only OTC
/*Add code Initialisation and clear container Idlist by dhanendra on date 23-11-2015*/
if(idList.size()>0)
/*if(idList.size()>0)
{
idListTemp = new ArrayList<String>();
idList1 = new ArrayList<String>();
}
if (idListTemp.size() > 0)
if (idList1.size() > 0)
{
for (int i = 0; i < idListTemp.size(); i++)
for (int i = 0; i < idList1.size(); i++)
{
RootPanel panel = RootPanel.get(idListTemp.get(i));
RootPanel panel = RootPanel.get(idList1.get(i));
panel.clear();
if (panel.getElement().getFirstChild() != null)
{
panel.getElement().removeFromParent();
}
}
idListTemp = new ArrayList<String>();
idList1 = new ArrayList<String>();
}
/*End code Initialisation Idlist by dhanendra on date 23-11-2015*/
End code Initialisation Idlist by dhanendra on date 23-11-2015
if (idList.size() > 0)
{
for (int i = 0; i < idList.size(); i++)
{
/*comment line because of container name change by Dhanedra 01-07-15*/
comment line because of container name change by Dhanedra 01-07-15
//RootPanel panel = RootPanel.get("chartContainer" + idList.get(i));
/*comment line because of container name change by Dhanedra 01-07-15*/
comment line because of container name change by Dhanedra 01-07-15
RootPanel panel = RootPanel.get(idList.get(i));
panel.clear();
if (panel.getElement().getFirstChild() != null)
......@@ -903,11 +879,12 @@ public class GraphComponent extends Composite
}
}
idList = new ArrayList<String>();
}
}*/
for (String componentId : gridNGraphMeataDataMap.keySet())
{
jsonObjFrGraph = new JSONObject();
if (isNumeric(componentId))
{
//idList.add(componentId);
......@@ -935,35 +912,18 @@ public class GraphComponent extends Composite
gridCssName = ""+ gridCssMap.get("cssName"+componentId);
gridComponantTitleMap = gridNGraphMeataDataMap.get("componantTitle"+componentId);
gridComponantTitleName = ""+ gridComponantTitleMap.get("componantTitle"+componentId);
// added by swati to add image in grid title
/* End code for get value from metadata by Dhanendra 10Jun2015*/
/*added by swati to add image in grid title */
gridIconMap= gridNGraphMeataDataMap.get("iconName"+componentId);
gridIconName = ""+ gridIconMap.get("iconName"+componentId);
// ended by swati to add image in grid title
/* End code for get value from metadata by Dhanendra 10Jun2015*/
/* ended by swati to add image in grid title */
}
jsonObjFrGraph = (JSONObject) dataMap.get(dtSrouce);
// Window.alert("dtSrouce is ="+dtSrouce +"json is ="+jsonObjFrGraph);
/*
* String abc=
* "{'0':{'tran_ser':'R-ADV', 'adj_amt':'0', 'cust_code':'CV0004 ', 'cr_term':'', 'cust_name':'CVS PHARMACY', 'bal_amt':'-5000', 'ref_date':'12/02/15', 'site_code':'TA821', 'exch_rate':'1', 'ref_no':'718IR00058 ', 'due_date':'12/02/15', 'tot_amt':'-5000', 'curr_code':'USD '}, '1':{'tran_ser':'R-ADV ', 'adj_amt':'0', 'cust_code':'CV0004 ', 'cr_term':'', 'cust_name':'CVS PHARMACY', 'bal_amt':'-2748.77', 'ref_date':'12/02/15', 'site_code':'TA821', 'exch_rate':'1', 'ref_no':'718IR00052 ', 'due_date':'12/02/15', 'tot_amt':'-2748.77', 'curr_code':'USD '}, '2':{'tran_ser':'R-ADV ', 'adj_amt':'0', 'cust_code':'CV0004 ', 'cr_term':'', 'cust_name':'CVS PHARMACY', 'bal_amt':'-2748.77', 'ref_date':'12/02/15', 'site_code':'TA821', 'exch_rate':'1', 'ref_no':'718IR00054 ', 'due_date':'12/02/15', 'tot_amt':'-2748.77', 'curr_code':'USD '}, '3':{'tran_ser':'R-ADV ', 'adj_amt':'0', 'cust_code':'CV0004 ', 'cr_term':'', 'cust_name':'CVS PHARMACY', 'bal_amt':'-60', 'ref_date':'28/04/15', 'site_code':'TA821', 'exch_rate':'2.5', 'ref_no':'718IR00207 ', 'due_date':'28/04/15', 'tot_amt':'-60', 'curr_code':'RS '}, '4':{'tran_ser':'R-ADV ', 'adj_amt':'0', 'cust_code':'CV0004 ', 'cr_term':'', 'cust_name':'CVS PHARMACY', 'bal_amt':'-2748.77', 'ref_date':'12/02/15', 'site_code':'TA821', 'exch_rate':'1', 'ref_no':'718IR00056 ', 'due_date':'12/02/15', 'tot_amt':'-2748.77', 'curr_code':'USD '}, '5':{'tran_ser':'R-ADV ', 'adj_amt':'0', 'cust_code':'CV0004 ', 'cr_term':'', 'cust_name':'CVS PHARMACY', 'bal_amt':'-5000', 'ref_date':'13/02/15', 'site_code':'TA821', 'exch_rate':'1', 'ref_no':'718IR00059 ', 'due_date':'13/02/15', 'tot_amt':'-5000', 'curr_code':'USD '}, '6':{'tran_ser':'R-ADV ', 'adj_amt':'0', 'cust_code':'CV0004 ', 'cr_term':'', 'cust_name':'CVS PHARMACY', 'bal_amt':'-10000', 'ref_date':'13/02/15', 'site_code':'TA821', 'exch_rate':'1', 'ref_no':'718IR00060 ', 'due_date':'13/02/15', 'tot_amt':'-10000', 'curr_code':'USD '}, '7':{'tran_ser':'R-ADV ', 'adj_amt':'0', 'cust_code':'CV0004 ', 'cr_term':'', 'cust_name':'CVS PHARMACY', 'bal_amt':'-780', 'ref_date':'14/04/15', 'site_code':'TA821', 'exch_rate':'1', 'ref_no':'718IR00177 ', 'due_date':'14/04/15', 'tot_amt':'-780', 'curr_code':'USD '}, '8':{'tran_ser':'R-ADV ', 'adj_amt':'0', 'cust_code':'CV0004 ', 'cr_term':'', 'cust_name':'CVS PHARMACY', 'bal_amt':'-10', 'ref_date':'13/02/15', 'site_code':'TA821', 'exch_rate':'1', 'ref_no':'718IR00067 ', 'due_date':'13/02/15', 'tot_amt':'-10', 'curr_code':'USD '}, '9':{'tran_ser':'R-ADV ', 'adj_amt':'0', 'cust_code':'CV0004 ', 'cr_term':'', 'cust_name':'CVS PHARMACY', 'bal_amt':'-20', 'ref_date':'18/02/15', 'site_code':'TA821', 'exch_rate':'1', 'ref_no':'718IR00091 ', 'due_date':'18/02/15', 'tot_amt':'-20', 'curr_code':'USD '}, '10':{'tran_ser':'R-ADV ', 'adj_amt':'0', 'cust_code':'CV0004 ', 'cr_term':'', 'cust_name':'CVS PHARMACY', 'bal_amt':'-2748.77', 'ref_date':'12/02/15', 'site_code':'TA821', 'exch_rate':'1', 'ref_no':'718IR00057 ', 'due_date':'12/02/15', 'tot_amt':'-2748.77', 'curr_code':'USD '}, '11':{'tran_ser':'R-ADV ', 'adj_amt':'0', 'cust_code':'CV0004 ', 'cr_term':'', 'cust_name':'CVS PHARMACY', 'bal_amt':'-10', 'ref_date':'12/02/15', 'site_code':'TA821', 'exch_rate':'1', 'ref_no':'718IR00055 ', 'due_date':'12/02/15', 'tot_amt':'-10', 'curr_code':'USD '}}"
* ;
*
* JSONValue jsonValue=new JSONString(abc); JSONObject
* jsonObject=new JSONObject(); jsonObject.put(""+1, jsonValue);
* if(dtSrouce.equals("1")) { jsonObjFrGraph=jsonObject;
* Window.alert("jsonObjFrGraph is =-"+jsonObjFrGraph); }
*/
// 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);
......@@ -976,13 +936,12 @@ public class GraphComponent extends Composite
componantTitlNameList =(ArrayList<String>)graphDtlList.get(18);
groupCssTypeNameList =(ArrayList<String>)graphDtlList.get(19);
componentIconName = ""+graphDtlList.get(22);
//headingOfSSGridList =(ArrayList<String>)graphDtlList.get(24);
if(graphDtlList.get(24)!=null && graphDtlList.get(24).toString().length()>0)
{
htmlString =""+(graphDtlList.get(24));
}
if(groupNameList.size()>0)
if(groupNameList.size()>0) // loop for compliance
{
refreshComponantIdList =(ArrayList<String>)graphDtlList.get(20);
refCompIdMap.put(groupNameList.get(0), refreshComponantIdList.get(0));
......@@ -1014,23 +973,11 @@ public class GraphComponent extends Composite
}
if(rawDataMapJsonOuter.size() > 0)
{
/*Add uniqueId parameter in getDisplayData method to random component id by Dhanendra on Date 09-11-2015 */
getDisplayData(rawDataMapJsonOuter, graphDtlList, groupCssTypeNameList.get(0), width, height, imageName,refCompIdMap,mainDataJsn,groupNameList.get(0),filterList, firstNameforTitle,uniqueId);
getDisplayData(rawDataMapJsonOuter, graphDtlList, groupCssTypeNameList.get(0), width, height, imageName,refCompIdMap,mainDataJsn,groupNameList.get(0),filterList, firstNameforTitle,"");
}
}
else{
/*Add uniqueId to Graph,chartContainer by Dhanendra on Date 10-11-2015*/
this.createOuterDiv("Graph"+uniqueId+componentId,type,groupCssTypeNameList.get(0));
idList.add("Graph"+uniqueId+componentId+"Div");
this.createInnerDiv(uniqueId+componentId,"Graph"+componentId);
graphJson = ChartCreator.buildChartData(graphDtlList, jsonObjFrGraph, dtSrouce,parameterList,filterList);
this.createChart(graphJson.toString().replace('@', '='), uniqueId+componentId, "chartContainer" +uniqueId+ componentId, width, height, imageName,userMail,reportCaption);
/*End uniqueId to Graph,chartContainer by Dhanendra on Date 10-11-2015*/
}
}/*end Code for display Dashboard one by one in one page by Dhanendra*/
else
else // loop for simple graph
{
graphJson = ChartCreator.buildChartData(graphDtlList, jsonObjFrGraph, dtSrouce,parameterList,filterList);
// start- added empty json chartdata to display no data found message by swati on 7jan2015
......@@ -1044,10 +991,12 @@ public class GraphComponent extends Composite
/*Added code for Dyanamic Div and New CSS By Dhanendra 01-07-15*/
/*Add uniqueId to Graph by Dhanendra on date 10-11-2015*/
this.createOuterDiv("Graph"+uniqueId+componentId,type,groupCssTypeNameList.get(0));
idList.add("Graph"+uniqueId+componentId+"Div");
//this.createOuterDiv("Graph"+uniqueId+componentId,type,groupCssTypeNameList.get(0));
//idList.add("Graph"+uniqueId+componentId+"Div");
/*End uniqueId to Graph by Dhanendra on date 10-11-2015*/
Label componantTtl = new Label(componantTitlNameList.get(0));
Image componantTtlImg = new Image("FusionChart/images/"+componentIconName);
......@@ -1078,33 +1027,35 @@ public class GraphComponent extends Composite
mainPanel.setCellHorizontalAlignment(dateHPanel, HasHorizontalAlignment.ALIGN_RIGHT);
/*Add uniqueId to Graph by Dhanendra on date 10-11-2015*/
RootPanel.get("Graph"+uniqueId+componentId+"head").add(mainPanel);
//RootPanel.get("Graph"+uniqueId+componentId+"head").add(mainPanel);
/*End uniqueId to Graph by Dhanendra on date 10-11-2015*/
// added code to add html tag to ssgrid by swati on 08-sep-2015
/** added code to add html tag to ssgrid by swati on 08-sep-2015 **/
if(htmlString.length()>0)
{
htmlPnl = new HTMLPanel(htmlString);
/*Add uniqueId to Graph by Dhanendra on date 10-11-2015*/
RootPanel.get("Graph"+uniqueId+componentId).add(htmlPnl);
/*End uniqueId to Graph by Dhanendra on date 10-11-2015*/
/*Add uniqueId to Graph by Dhanendra on date 03-12-2015*/
RootPanel.get(containerIdList.get(countForSmartFilter)).add(htmlPnl);
/*End uniqueId to Graph by Dhanendra on date 03-12-2015*/
}
// ended code to add html tag to ssgrid by swati on 08-sep-2015
/** ended code to add html tag to ssgrid by swati on 08-sep-2015 **/
/**Start Comment line by Dhanendra 03-12-2015 **/
/*this.createInnerDiv(uniqueId+componentId,"Graph"+uniqueId+componentId);*/
/**End Comment line by Dhanendra 03-12-2015 **/
/*Add uniqueId to Graph by Dhanendra on date 10-11-2015*/
this.createInnerDiv(uniqueId+componentId,"Graph"+uniqueId+componentId);
/*Ended code for Dyanamic Div and New CSS By Dhanendra 01-07-15*/
this.createChart(graphJson.toString().replace('@', '='), uniqueId+componentId, "chartContainer" + uniqueId+componentId, width, height, imageName,userMail,reportCaption);
/*End uniqueId to Graph by Dhanendra on date 10-11-2015*/
/*Add code for get uniqueId from list and also pass to createchart Chartcontainer by Dhanendra 03-12-2015*/
String containerId = containerIdList.get(countForSmartFilter).replace("Graph", "").replace("Div", "");
RootPanel.get("chartContainer" + containerId).clear();
this.createChart(graphJson.toString().replace('@', '='), containerId, "chartContainer" + containerId, width, height, imageName,userMail,reportCaption);
/*End code for get uniqueId from list and also pass to createchart Chartcontainer by Dhanendra 03-12-2015*/
}
}
}
} 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();
......@@ -1128,8 +1079,8 @@ public class GraphComponent extends Composite
scrlPanel.add(flexTable);
scrlPanel.setStyleName("flextableScrlPnl");
// RootPanel.get("chartContainergrid").add(scrlPanel);
RootPanel.get("chartContainer"+uniqueId+componentId).add(scrlPanel);
RootPanel.get("chartContainer"+uniqueId+componentId).add(horizontalPnl);
RootPanel.get("chartContainer"+componentId).add(scrlPanel);
RootPanel.get("chartContainer"+componentId).add(horizontalPnl);
} else if ("DataGrid".equalsIgnoreCase(component))
{
......@@ -1149,66 +1100,30 @@ public class GraphComponent extends Composite
gridTtlPanel.add(gridTtlImg);
gridTtlPanel.add(gridTitleLbl);
/*Add uniqueId to Grid by Dhanendra on date 10-11-2015*/
this.createOuterDiv("Grid"+uniqueId+componentId,type,gridCssName);
/**Add uniqueId to Grid by Dhanendra on date 10-11-2015**/
/*this.createOuterDiv("Grid"+uniqueId+componentId,type,gridCssName);
idList.add("Grid"+uniqueId+componentId+"Div");
RootPanel.get("Grid"+uniqueId+componentId+"head").add(gridTtlPanel);
RootPanel.get("Grid"+uniqueId+componentId+"Div").add(flexTable);
/*Add uniqueId to Grid by Dhanendra on date 10-11-2015*/
/*Ended code for Dyanamic Div and New CSS By Dhanendra 01-07-15*/
RootPanel.get("Grid"+uniqueId+componentId+"Div").add(flexTable);*/
/**Add uniqueId to Grid by Dhanendra on date 10-11-2015**/
/*RootPanel.get("chartContainer"+componentId).clear();
RootPanel.get("chartContainer"+componentId).add(flexTable);*/
/** Add code get id from containerIdList by Dhanendra on 03-12-2015 **/
RootPanel.get(containerIdList.get(countForSmartFilter)).clear();
RootPanel.get(containerIdList.get(countForSmartFilter)).add(flexTable);
/** End code get id from containerIdList by Dhanendra on 03-12-2015 **/
}else{
fltrDataJson = getFltrDataJson(fltrDataJson, gridGroupName,null);
avlDateMap = new HashMap<String, JSONObject>();
dataJsn = new JSONObject();
for (int jsnCnt = 0; jsnCnt < fltrDataJson.size(); jsnCnt++)
{
fetchRowWiseVal = (JSONObject) fltrDataJson.get(String.valueOf(jsnCnt));
avlDate = "" + fetchRowWiseVal.get(availableDate).toString().replace("\"", "");
avlDateMap.put(avlDate, (JSONObject)fetchRowWiseVal);
}
count =0;
for (Map.Entry<String, JSONObject> avlMap : avlDateMap.entrySet())
{
dataJsn.put(""+count, avlMap.getValue());
count++;
}
filtrGridJSN.put(dtSrouce, dataJsn);
flexTable = data.jsonToArrayList(dataDtl.getGridNMapMetData(jsonObjMetaData,parameterList.get(parameterList.size()-1),parameterList), filtrGridJSN,dtSrouce,componentId,parameterList, filterList,firstIndex);
/*Add uniqueId to Grid by Dhanendra on date 10-11-2015*/
this.createOuterDiv(gridGroupName+uniqueId+"Grid",type,null);
idList.add(gridGroupName+uniqueId+"GridDiv");
/*End uniqueId to Grid by Dhanendra on date 10-11-2015*/
Image gridTtlImg = new Image("FusionChart/images/"+gridIconName);
HorizontalPanel gridTtlPanel = new HorizontalPanel();
gridTitleLbl = new Label(firstIndex);
gridTtlImg.setStyleName("componantTtlImg");
gridTitleLbl.setStyleName("componantTtl");
gridTtlPanel.add(gridTtlImg);
gridTtlPanel.add(gridTitleLbl);
/*Ended code for Dyanamic Div and New CSS By Dhanendra 01-07-15*/
/*Add uniqueId to Grid by Dhanendra on date 10-11-2015*/
RootPanel.get(gridGroupName+uniqueId+"Gridhead").add(gridTtlPanel);
RootPanel.get(gridGroupName+uniqueId+"GridDiv").add(flexTable);
/*End uniqueId to Grid by Dhanendra on date 10-11-2015*/
/*RootPanel.get("chartContainer"+componentId).clear();
RootPanel.get("chartContainer"+componentId).add(flexTable);*/
}
/*Add code check condition for gridGroupName present in metadata*/
}
}
/**
* Start Code By Dhanendra for No Data Found Msg - 08 Dec
* 2014
**/
/**Start Code By Dhanendra for No Data Found Msg - 08 Dec 2014 **/
else
{
//RootPanel.get("chartContainer"+componentId).clear();
......@@ -1228,24 +1143,16 @@ public class GraphComponent extends Composite
flexTable.getCellFormatter().setStyleName(1 ,0 , "gwt-ScrollTable");
}else
{
Window.alert("In No Data Found else");
flexTable.setWidget(0, 0, labelNoDataFound);
flexTable.getCellFormatter().setStyleName(0 ,0 , "gwt-ScrollTable");
}
flexTable.setStyleName("flexCSS");
/*Added code for Dyanamic Div and New CSS By Dhanendra 01-07-15*/
gridTitleLbl = new Label(gridComponantTitleName);
/*Add uniqueId to Grid by Dhanendra on date 10-11-2015*/
this.createOuterDiv("Grid"+uniqueId+componentId,type,gridCssName);
idList.add("Grid"+uniqueId+componentId+"Div");
RootPanel.get("Grid"+uniqueId+componentId+"head").add(gridTitleLbl);
RootPanel.get("Grid"+uniqueId+componentId+"Div").add(flexTable);
/*End uniqueId to Grid by Dhanendra on date 10-11-2015*/
/*Ended code for Dyanamic Div and New CSS By Dhanendra 01-07-15*/
/** Add code get id from containerIdList by Dhanendra on 03-12-2015 **/
RootPanel.get(containerIdList.get(countForSmartFilter)).clear();
RootPanel.get(containerIdList.get(countForSmartFilter)).add(flexTable);
/** End code get id from containerIdList by Dhanendra on 03-12-2015 **/
/*RootPanel.get("chartContainer"+componentId).add(flexTable);*/
//}
}
......@@ -1253,10 +1160,6 @@ 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);
......@@ -1278,10 +1181,6 @@ 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);
......@@ -1305,11 +1204,6 @@ 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();
......@@ -1333,117 +1227,21 @@ public class GraphComponent extends Composite
gridTitleLbl.setStyleName("componantTtl");
gridTtlPanel.add(gridTtlImg);
gridTtlPanel.add(gridTitleLbl);
/*Add uniqueId to Card by Dhanendra on date 10-11-2015*/
this.createOuterDiv("Card"+uniqueId+componentId,type,gridCssName);
idList.add("Card"+uniqueId+componentId+"Div");
RootPanel.get("Card"+uniqueId+componentId+"head").add(gridTtlPanel);
RootPanel.get("Card"+uniqueId+componentId+"Div").add(panel);
/*End uniqueId to Card by Dhanendra on date 10-11-2015*/
/*Ended code for Dyanamic Div and New CSS By Dhanendra 13-07-15*/
/** Add code get id from containerIdList by Dhanendra on 03-12-2015 **/
RootPanel.get(containerIdList.get(countForSmartFilter)).clear();
RootPanel.get(containerIdList.get(countForSmartFilter)).add(panel);
/** End code get id from containerIdList by Dhanendra on 03-12-2015 **/
/*
* imageName = (String) graphDtlList.get(0); width =
* (String) graphDtlList.get(1); height = (String)
* graphDtlList.get(2);
*/
}
}
/**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);
for (int i = 0; i < graphDtlList.size(); i++)
{
if (i == 0)
{
gridComponantTitleName = (String) graphDtlList.get(i);
}
if (i == 1)
{
gridCssName = (String) graphDtlList.get(i);
}
if (i == 2)
{
height = (String) graphDtlList.get(i);
}
if (i == 3)
{
width = (String) graphDtlList.get(i);
countForSmartFilter++;
}
if (i == 4)
{
caption = (String) graphDtlList.get(i);
}
if (i == 5)
{
String bgClolorList = (String) graphDtlList.get(i);
}
}
graphJson = new GanttChartBuilder().buildGanttChart(graphDtlList, jsonObjFrGraph, dtSrouce);
if (graphJson.size() == 0)
{
graphJson.put("chart", new JSONString(""));
}
if (graphJson != null && graphJson.size() > 0)
{
this.createOuterDiv("Gantt" +uniqueId+ componentId, type, gridCssName);
idList.add("Gantt"+uniqueId+componentId+"Div");
this.createGnttChart(graphJson.toString(), "Gantt"+uniqueId+componentId +"Div", height, width);
}
}
}
/** End Star Code for Building ganttChart by sachin 5 Aug 2015 **/
/** Star Code for Building HTML_GAUGE by sachin 5 Aug 2015 **/
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)
{
gridComponantTitleName = (String) graphDtlList.get(i);
}
if (i == 1)
{
gridCssName = (String) graphDtlList.get(i);
}
}
graphJson = new GaugeChartBuilder().buildGaugeChart(graphDtlList, jsonObjFrGraph, dtSrouce);
if (graphJson.size() == 0)
{
graphJson.put("chart", new JSONString(""));
}
if (graphJson != null && graphJson.size() > 0)
{
this.createOuterDiv("Gauge"+uniqueId+componentId, type, gridCssName);
idList.add("Gauge"+uniqueId+componentId+"Div");
this.createGaugeChart(graphJson.toString(), "Gauge"+uniqueId+componentId+"Div");
}
}
}
/** End Star Code for Building HTML_GAUGE by sachin 5 Aug 2015 **/
}
}
e12LoadImg.setLoading(false);
/*
......@@ -1606,7 +1404,6 @@ public class GraphComponent extends Composite
/** End Added New code By sachin for Creating Dynamic Url For Report on 04/12/14**/
if(objActionPath.length()>0) // added if by swati
{
RequestBuilder reqBuilder = new RequestBuilder(RequestBuilder.POST, objActionPath);
try
{
......
......@@ -12,6 +12,7 @@ import com.google.gwt.event.dom.client.KeyUpEvent;
import com.google.gwt.event.dom.client.KeyUpHandler;
import com.google.gwt.i18n.client.DateTimeFormat;
import com.google.gwt.json.client.JSONObject;
import com.google.gwt.user.client.DOM;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.CheckBox;
import com.google.gwt.user.client.ui.Composite;
......@@ -22,6 +23,7 @@ import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.PopupPanel;
import com.google.gwt.user.client.ui.RadioButton;
import com.google.gwt.user.client.ui.RootPanel;
import com.google.gwt.user.client.ui.ScrollPanel;
import com.google.gwt.user.client.ui.TextBox;
import com.google.gwt.user.client.ui.VerticalPanel;
......@@ -36,8 +38,9 @@ public class SmartFiltrCreator extends Composite
{
LinkedHashMap<String, ArrayList<String>> datsSourceDtlMap = null;
LinkedHashMap<String, JSONObject> componentDataMap = null;
PopupPanel mainPopupPnl = new PopupPanel();
final VerticalPanel popUpHPnl = new VerticalPanel();
PopupPanel smartFltrPopupPnl = new PopupPanel();
/*Change veriavle name popupPnel to outerPnl by Dhanendra 03-12-2015*/
final VerticalPanel outerPnl = new VerticalPanel();
JSONObject jsonObjMetaData = null;
ArrayList<String> fltrColumnDataList = null;
HashMap<String, ArrayList<String>> fltrDataMap = null;
......@@ -79,13 +82,28 @@ public class SmartFiltrCreator extends Composite
private void initPopUpPnl()
{
/*Add Code by Dhanendra to add unique id to smart filter 03-12-2015*/
String uniqueid = DOM.createUniqueId();
/*End Code by Dhanendra to add unique id to smart filter 03-12-2015*/
//mainPopupPnl.setPopupPosition(30, 60);
/**Change veriable name mainPopupPnl to smartFltrPopupPnl on 03-12-2015 **/
smartFltrPopupPnl.setPopupPosition(10, 12);
smartFltrPopupPnl.setStylePrimaryName("vPanelCSS");
/*Add uniqueid to smartfilter Id by Dhanendra 03-12-2015*/
smartFltrPopupPnl.getElement().setId("smartFilterMainOuterDiv"+uniqueid);
/*End uniqueid to smartfilter Id by Dhanendra 03-12-2015*/
mainPopupPnl.setPopupPosition(30, 60);
mainPopupPnl.setStylePrimaryName("vPanelCSS");
mainPopupPnl.getElement().setId("smartFilterMainOuterDiv");
this.buildSmrtFiltr();
mainPopupPnl.add(popUpHPnl);
mainPopupPnl.show();
smartFltrPopupPnl.add(outerPnl);
outerPnl.setStyleName("outerVPanel");
/** comment popup panel to show on load its add to rootpanel by Dhanendra on 02-12-2015 **/
//smartFltrPopupPnl.show();
RootPanel.get("chartContainer").add(smartFltrPopupPnl);
/** comment popup panel to show on load its add to rootpanel by Dhanendra on 02-12-2015 **/
this.filtrClickActn(fltrDtlList);
}
......@@ -227,13 +245,13 @@ public class SmartFiltrCreator extends Composite
fltrComponentPnl.add(inputTxtBox);
outerVPanel.add(fltrComponentPnl);
popUpHPnl.add(outerVPanel);
outerPnl.add(outerVPanel);
} else if ("2".equals(fltrSelectnMode))
{
new InputListWidget(fltrColumnDataList, fltrComponentPnl, smrtFilterInfo);
outerVPanel.add(fltrComponentPnl);
popUpHPnl.add(outerVPanel);
outerPnl.add(outerVPanel);
} else if ("4".equals(fltrSelectnMode))
{
......@@ -245,7 +263,7 @@ public class SmartFiltrCreator extends Composite
dateBox.setStylePrimaryName("textBoxCss");
fltrComponentPnl.add(dateBox);
outerVPanel.add(fltrComponentPnl);
popUpHPnl.add(outerVPanel);
outerPnl.add(outerVPanel);
} else if ("5".equals(fltrSelectnMode) || "3".equals(fltrSelectnMode))
{
if ("3".equals(fltrSelectnMode))
......@@ -257,7 +275,7 @@ public class SmartFiltrCreator extends Composite
}
outerVPanel.setHeight("200px");
outerVPanel.add(fltrComponentPnl);
popUpHPnl.add(outerVPanel);
outerPnl.add(outerVPanel);
}
}
}
......@@ -432,11 +450,11 @@ public class SmartFiltrCreator extends Composite
{
fltrInfo = smrtFltrDtlList.get(i);
colName = fltrInfo.getFltrColName();
for (int scrlPnlCnt = 0; scrlPnlCnt < popUpHPnl.getWidgetCount(); scrlPnlCnt++)
for (int scrlPnlCnt = 0; scrlPnlCnt < outerPnl.getWidgetCount(); scrlPnlCnt++)
{
if (popUpHPnl.getWidget(scrlPnlCnt) instanceof VerticalPanel)
if (outerPnl.getWidget(scrlPnlCnt) instanceof VerticalPanel)
{
verticalPanel = (VerticalPanel) popUpHPnl.getWidget(scrlPnlCnt);
verticalPanel = (VerticalPanel) outerPnl.getWidget(scrlPnlCnt);
if (verticalPanel.getWidget(1) instanceof HorizontalPanel)
{
horizontalPanel = (HorizontalPanel) verticalPanel.getWidget(1);
......@@ -540,11 +558,11 @@ public class SmartFiltrCreator extends Composite
HorizontalPanel horizontalPanel = null;
VerticalPanel verticalPanel = null;
HashMap<String, ArrayList<String>> selectedDataMap = new HashMap<String, ArrayList<String>>();
for (int scrlPnlCnt = 0; scrlPnlCnt < popUpHPnl.getWidgetCount(); scrlPnlCnt++)
for (int scrlPnlCnt = 0; scrlPnlCnt < outerPnl.getWidgetCount(); scrlPnlCnt++)
{
if (popUpHPnl.getWidget(scrlPnlCnt) instanceof VerticalPanel)
if (outerPnl.getWidget(scrlPnlCnt) instanceof VerticalPanel)
{
verticalPanel = (VerticalPanel) popUpHPnl.getWidget(scrlPnlCnt);
verticalPanel = (VerticalPanel) outerPnl.getWidget(scrlPnlCnt);
if (verticalPanel.getWidget(1) instanceof HorizontalPanel)
{
horizontalPanel = (HorizontalPanel) verticalPanel.getWidget(1);
......
......@@ -87,11 +87,7 @@ function outerDiv(outerDivId,type, cssName)
iDiv.appendChild(headDiv);
outerDiv.appendChild(iDiv);
/*Change code outerdiv append on body tag by Dhanendra on Date 23-11-2015*/
document.getElementsByTagName('body')[0].appendChild(outerDiv);
/*Change code outerdiv append on body tag by Dhanendra on Date 23-11-2015*/
//document.getElementById('chartContainer').appendChild(outerDiv);
document.getElementById('chartContainer').appendChild(outerDiv);
}
function innerDiv(innerDivId,groupName)
{
......
......@@ -493,7 +493,7 @@ ul.token-input-list {
overflow: hidden;
height: auto !important;
height: 20px;
width: 190px;
width: 250px;
border: 1px solid lightgray;
cursor: text;
font-size: 12px;
......@@ -1414,3 +1414,36 @@ color: #999; !important;
}
/**ended css for ss grid title and subtitle by swati on 08-sep-2015*/
.popupScrlPnl
{
overflow-x:hidden;
height: 400px;
width: 285px;
padding: 0px;
cellspacing: 0px;
background-color: white;
border: 1px solid lightgray;
border-radius: 2px;
}
.drpDownBoxCss {
height: 25px;
width: 250px;
}
/* Start Added new Code by sachin on 28 sep 15 for Showing scroll bar to auto suggest box of autocomplete filter */
.suggestPopupMiddleCenterInner
{
overflow-y: scroll;
height: 250px;
}
/*End Added new Code by sachin on 28 sep 15 for Showing scroll bar to auto suggest box of autocomplete filter */
/*Start Added New CSS class for smartFilter Panel padding by Dhanendra on 03-12-2015 */
.outerVPanel
{
padding-left: 10px;
padding-top: 10px;
}
/*End Added New CSS class for smartFilter Panel padding by Dhanendra on 03-12-2015 */
\ No newline at end of file
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