Commit c489188c authored by sbade's avatar sbade

Added new functionality of opening graph in frame on click of bar graph.


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@98565 ce508802-f39f-4f6c-b175-0d175dae99d5
parent ed830be1
...@@ -597,14 +597,15 @@ public class ChartCreator ...@@ -597,14 +597,15 @@ public class ChartCreator
} }
count++; count++;
} }
if(prdFilterName.length()>0) if(prdFilterName.length()>0)
{ {
prdFilter=prdFilterName; prdFilter=prdFilterName;
} }
if(url=="undefined" || url.equals("undefined") || url.equalsIgnoreCase("undefined")) if(url=="undefined" || url.equals("undefined") || url.equalsIgnoreCase("undefined"))
{ {
if((FilterCreator.title).size()>0){
url="&titleName@"+(FilterCreator.title).get(0); url="&titleName@"+(FilterCreator.title).get(0);
}
} }
else else
{ {
...@@ -631,6 +632,20 @@ public class ChartCreator ...@@ -631,6 +632,20 @@ public class ChartCreator
linkStringValue=new JSONString(linkType+"-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()); linkStringValue=new JSONString(linkType+"-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 18 Aug 2015*/
if(linkType.equalsIgnoreCase("f"))
{
Window.alert("in f: "+linkType);
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 18 Aug 2015*/
} }
else else
{ {
...@@ -652,6 +667,21 @@ public class ChartCreator ...@@ -652,6 +667,21 @@ public class ChartCreator
linkStringValue=new JSONString(linkType+"-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()); linkStringValue=new JSONString(linkType+"-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());
} }
} }
/*Added code to open new chart in frame by swati 18 Aug 2015*/
if(linkType.equalsIgnoreCase("f"))
{
//CustomGrid data = new CustomGrid(8);
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 18 Aug 2015*/
} }
barChartMap.put(linkStringKey, linkStringValue); barChartMap.put(linkStringKey, linkStringValue);
barValueList.add(barChartMap); barValueList.add(barChartMap);
......
...@@ -156,8 +156,12 @@ public class GraphComponent extends Composite ...@@ -156,8 +156,12 @@ public class GraphComponent extends Composite
JSONObject filtrGridJSN = null; JSONObject filtrGridJSN = null;
String avlDate = ""; String avlDate = "";
String componentIconName = ""; String componentIconName = "";
/*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
String htmlString="";
HTMLPanel htmlPnl=null;
// ended variable to add html tag to ssgrid by swati on 08-sep-2015
/** Add Code By Dhanendra for No Data Found Msg **/ /** Add Code By Dhanendra for No Data Found Msg **/
/*String parameter=""; /*String parameter="";
boolean isParameter = false; boolean isParameter = false;
...@@ -249,6 +253,12 @@ public class GraphComponent extends Composite ...@@ -249,6 +253,12 @@ public class GraphComponent extends Composite
componantTitlNameList =(ArrayList<String>)graphDtlList.get(18); componantTitlNameList =(ArrayList<String>)graphDtlList.get(18);
groupCssTypeNameList =(ArrayList<String>)graphDtlList.get(19); groupCssTypeNameList =(ArrayList<String>)graphDtlList.get(19);
componentIconName = ""+graphDtlList.get(22); componentIconName = ""+graphDtlList.get(22);
// added code to add html tag to ssgrid by swati on 08-sep-2015
if(graphDtlList.get(24)!=null && graphDtlList.get(24).toString().length()>0)
{
htmlString =""+(graphDtlList.get(24));
}
// ended code to add html tag to ssgrid by swati on 08-sep-2015
if(groupNameList.size()>0) if(groupNameList.size()>0)
{ {
refreshComponantIdList =(ArrayList<String>)graphDtlList.get(20); refreshComponantIdList =(ArrayList<String>)graphDtlList.get(20);
...@@ -326,7 +336,13 @@ public class GraphComponent extends Composite ...@@ -326,7 +336,13 @@ public class GraphComponent extends Composite
mainPanel.setStyleName("mainPanel"); mainPanel.setStyleName("mainPanel");
mainPanel.setCellHorizontalAlignment(dateHPanel, HasHorizontalAlignment.ALIGN_RIGHT); mainPanel.setCellHorizontalAlignment(dateHPanel, HasHorizontalAlignment.ALIGN_RIGHT);
RootPanel.get("Graph"+componentId+"head").add(mainPanel); RootPanel.get("Graph"+componentId+"head").add(mainPanel);
// added code to add html tag to ssgrid by swati on 08-sep-2015
if(htmlString.length()>0)
{
htmlPnl = new HTMLPanel(htmlString);
RootPanel.get("Graph"+componentId).add(htmlPnl);
}
// ended code to add html tag to ssgrid by swati on 08-sep-2015
this.createInnerDiv(Integer.parseInt(componentId),"Graph"+componentId); this.createInnerDiv(Integer.parseInt(componentId),"Graph"+componentId);
/*Ended code for Dyanamic Div and New CSS By Dhanendra 01-07-15*/ /*Ended code for Dyanamic Div and New CSS By Dhanendra 01-07-15*/
this.createChart(graphJson.toString().replace('@', '='), componentId, "chartContainer" + componentId, width, height, imageName,userMail,reportCaption); this.createChart(graphJson.toString().replace('@', '='), componentId, "chartContainer" + componentId, width, height, imageName,userMail,reportCaption);
...@@ -592,7 +608,8 @@ public class GraphComponent extends Composite ...@@ -592,7 +608,8 @@ public class GraphComponent extends Composite
if (graphJson != null && graphJson.size() > 0) if (graphJson != null && graphJson.size() > 0)
{ {
this.createOuterDiv("Gantt" + componentId, type, gridCssName); this.createOuterDiv("Gantt" + componentId, type, gridCssName);
this.createGnttChart(graphJson.toString(), "Gantt" + componentId + "Div", height, width); idList.add("Gantt"+componentId+"Div");
this.createGnttChart(graphJson.toString(), "Gantt"+componentId +"Div", height, width);
} }
} }
} }
...@@ -628,7 +645,8 @@ public class GraphComponent extends Composite ...@@ -628,7 +645,8 @@ public class GraphComponent extends Composite
if (graphJson != null && graphJson.size() > 0) if (graphJson != null && graphJson.size() > 0)
{ {
this.createOuterDiv("Gauge"+componentId, type, gridCssName); this.createOuterDiv("Gauge"+componentId, type, gridCssName);
this.createGaugeChart(graphJson.toString(), "Gauge" + componentId + "Div"); idList.add("Gauge"+componentId+"Div");
this.createGaugeChart(graphJson.toString(), "Gauge"+componentId+"Div");
} }
} }
} }
...@@ -1084,6 +1102,97 @@ public class GraphComponent extends Composite ...@@ -1084,6 +1102,97 @@ public class GraphComponent extends Composite
} }
/** end of country map build method by swati 17 April 2015 **/ /** end of country map build method by swati 17 April 2015 **/
/** Star Code for Building ganttChart by sachin 5 Aug 2015 **/
if ("DHTML_GANTT".equalsIgnoreCase(type))
{
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);
}
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" + componentId, type, gridCssName);
idList.add("Gantt"+componentId+"Div");
this.createGnttChart(graphJson.toString(), "Gantt"+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))
{
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"+componentId, type, gridCssName);
idList.add("Gauge"+componentId+"Div");
this.createGaugeChart(graphJson.toString(), "Gauge"+componentId+"Div");
}
}
}
/** End Star Code for Building HTML_GAUGE by sachin 5 Aug 2015 **/
} }
} }
e12LoadImg.setLoading(false); e12LoadImg.setLoading(false);
......
...@@ -446,6 +446,7 @@ public class MetaDataDtl ...@@ -446,6 +446,7 @@ public class MetaDataDtl
groupTypeList = new ArrayList<String>(); groupTypeList = new ArrayList<String>();
groupFltrNameList = new ArrayList<String>(); groupFltrNameList = new ArrayList<String>();
String componentIconName = ""; String componentIconName = "";
String htmlTag="";
/* End By Dhanedra for metadata change */ /* End By Dhanedra for metadata change */
metaDataMap = new LinkedHashMap<JSONString, JSONString>(); metaDataMap = new LinkedHashMap<JSONString, JSONString>();
...@@ -790,7 +791,14 @@ public class MetaDataDtl ...@@ -790,7 +791,14 @@ public class MetaDataDtl
componentIconName = (graphDataNode.getChildNodes().item(0).getNodeValue()); componentIconName = (graphDataNode.getChildNodes().item(0).getNodeValue());
} }
/* End componentIcon tag in metadata by Dhanendra on 01-07-2015 */ /* End componentIcon tag in metadata by Dhanendra on 01-07-2015 */
/* Add html tag in metadata by Swati on 08-09-2015 */
if ("html".equalsIgnoreCase(childNodeName))
{
htmlTag = (graphDataNode.getChildNodes().item(0).getNodeValue());
}
/* End html tag in metadata by Swati on 08-09-2015 */
} }
metaDataList.add(metaDataMap.toString().replace('=', ':')); metaDataList.add(metaDataMap.toString().replace('=', ':'));
graphDtlList.add(xAxisColunList); graphDtlList.add(xAxisColunList);
...@@ -829,6 +837,9 @@ public class MetaDataDtl ...@@ -829,6 +837,9 @@ public class MetaDataDtl
/*Add for Parent Axis by Swati */ /*Add for Parent Axis by Swati */
graphDtlList.add(parentAxisList); graphDtlList.add(parentAxisList);
/*End for Parent Axis by Swati */ /*End for Parent Axis by Swati */
/*Add for html tag by Swati */
graphDtlList.add(htmlTag);
/*End for html tag by Swati */
conuter++; conuter++;
gridNGraphMeataDataMap.put("type" + graphID, typeGraphMap); gridNGraphMeataDataMap.put("type" + graphID, typeGraphMap);
graphMeataDataMap.put("graph" + conuter, graphDtlList); graphMeataDataMap.put("graph" + conuter, graphDtlList);
......
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