Commit 30c31c3d authored by dkasliwal's avatar dkasliwal

Pass current_d and child_d to all method of dash board to open a drill-down...

Pass current_d and child_d to all method of dash board to open a drill-down dash board. remove frame container code and direct call to open a dash-board


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@103450 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 2173834e
......@@ -18,8 +18,9 @@ public class CardBuilder
{
/*Add ParameterList and filterList in buildCard method By Dhanendra on Date 01-04-2016*/
public SimplePanel buildCard(ArrayList<ArrayList<String>> graphDtlList, JSONObject jsonObjGraph, String dataSource,ArrayList<String> parameterList,ArrayList<FilterInfo> filterList)
public SimplePanel buildCard(ArrayList<ArrayList<String>> graphDtlList, JSONObject jsonObjGraph, String dataSource,ArrayList<String> parameterList,ArrayList<FilterInfo> filterList, String currentID)
{
/*Comment Code by Dhanendra on date 07-06-2016*/
//JSONObject jsonObjFrGraph = (JSONObject) jsonObjGraph.get(dataSource);
......@@ -214,7 +215,7 @@ public class CardBuilder
if(linkMetadataName.length() > 0)
{
//setOnClick(linkMetadataName, html,"/ibase/dwh/GwtDashboardPage.html?metadataname="+linkMetadataName+propertyStr);
setOnClick(linkMetadataName, html,"/ibase/dwh/GwtDashboardPage.html?metadataname="+linkMetadataName+propertyStr);
setOnClick(linkMetadataName, html,"/ibase/dwh/GwtDashboardPage.html?metadataname="+linkMetadataName+propertyStr,currentID);
}
/*End Add parameters to url for hyper link data By Swati on Date 05-05-2016*/
hOuterPnl.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
......@@ -282,7 +283,7 @@ public class CardBuilder
/*Add Add parameters to url for hyper link data By Swati on Date 05-05-2016*/
if(linkMetadataName.length() > 0)
{
setOnClick(linkMetadataName, html,"/ibase/dwh/GwtDashboardPage.html?metadataname="+linkMetadataName+propertyStr);
setOnClick(linkMetadataName, html,"/ibase/dwh/GwtDashboardPage.html?metadataname="+linkMetadataName+propertyStr,currentID);
}
/*End Add parameters to url for hyper link data By Swati on Date 05-05-2016*/
verticalPnl.add(horizontalPnl);
......@@ -310,16 +311,17 @@ public class CardBuilder
return simplePnl;
}
/*Added by Dhanendra for Linked Chart on 06-March-16 Start */
public void setOnClick(final String linkMetadata, final HTML html, final String url)
public void setOnClick(final String linkMetadata, final HTML html, final String url,final String currentID)
{
html.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
//Window.open(url, linkMetadata, "");
if(html.getElement().getAttribute("a") != null)
/*if(html.getElement().getAttribute("a") != null)
{
buildGridFrameContainer();
}
}*/
openLinkChart(linkMetadata,url,currentID);
}
});
}
......@@ -335,5 +337,9 @@ public class CardBuilder
alert("Excpeiton :: CardBuilder [" + e.message+ "]");
}
}-*/;
public native void openLinkChart( String metadataName, String uri, String currentID )
/*-{
$wnd.getModuleLoad(metadataName, uri, currentID );
}-*/;
/*Added by Chetan mahajan For add dynamic div to existing chart container panel on 1-July-2016*/
}
......@@ -19,7 +19,7 @@ import com.google.gwt.xml.client.XMLParser;
public class ChartCreator
{
public static JSONObject buildChartData(ArrayList<ArrayList<String>> graphDtlList, JSONObject jsonObjGraph, String dataSource,ArrayList<String> parameterList,ArrayList<FilterInfo> filterList)
public static JSONObject buildChartData(ArrayList<ArrayList<String>> graphDtlList, JSONObject jsonObjGraph, String dataSource,ArrayList<String> parameterList,ArrayList<FilterInfo> filterList, String currentID)
{
String key = "";
String currentvalue = "";
......@@ -80,6 +80,8 @@ public class ChartCreator
List<String> parentAxisList=new ArrayList<String>();
/*Ended by Swati on 31-07-15*/
SamePageOpenContainer samePageOpenContainer = null;
for (int i = 0; i < graphDtlList.size(); i++)
{
if (i == 3)
......@@ -185,6 +187,8 @@ public class ChartCreator
allDataList = new ArrayList<LinkedHashMap<JSONValue, JSONValue>>();
String prdFilterName="";
toolTextDataList = new ArrayList<String>();
samePageOpenContainer = new SamePageOpenContainer();
for (FilterInfo filterInfo : filterList)
{
......@@ -491,15 +495,17 @@ public class ChartCreator
}
}
/*Added code to open new chart in frame by swati 18 Aug 2015*/
if(linkType.equalsIgnoreCase("f"))
if(linkType.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 )
/*if(linkLMetadataList.get(seriesCnt).trim().length()>0 )
{
linkStringValue=new JSONString("JavaScript: isJavaScriptCall=true;linkFunction('"+linkLMetadataList.get(seriesCnt)+"', '"+cellValue+"', '"+propertyStr+"','"+ urlStr+"', '"+parameterListString+"', 'Y')");
}
}*/
url = propertyStr+"&"+parameterListString+"&CELL_VAL="+cellValue.trim()+"&P1="+urlStr;
linkStringValue = new JSONString("JavaScript:getModuleLoad('"+linkLMetadataList.get(seriesCnt)+"','"+url+"','"+currentID+"');");
}
/*ended code to open new chart in frame by swati 18 Aug 2015*/
//-----end---by swati 30 nov 2015------
......@@ -527,17 +533,21 @@ public class ChartCreator
}
}
/*Added code to open new chart in frame by swati 18 Aug 2015*/
if(linkType.equalsIgnoreCase("f"))
if(linkType.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 )
/*if(linkLMetadataList.get(seriesCnt).trim().length()>0 )
{
linkStringValue=new JSONString("JavaScript: isJavaScriptCall=true;linkFunction('"+linkLMetadataList.get(seriesCnt)+"', '"+cellValue+"', '"+propertyStr+"','"+ urlStr+"', '"+parameterListString+"', 'Y')");
}
}*/
url = propertyStr+"&"+parameterListString+"&CELL_VAL="+cellValue.trim()+"&P1="+urlStr;
linkStringValue = new JSONString("JavaScript:getModuleLoad('"+linkLMetadataList.get(seriesCnt)+"','"+url+"','"+currentID+"');");
}
/*ended code to open new chart in frame by swati 18 Aug 2015*/
//-----end--- 30 nov 2015------
......@@ -548,6 +558,7 @@ public class ChartCreator
barDataVal = JSONParser.parseStrict(barValueList.toString().replace('=', ':'));
}
}
CommonUtils.printOnConsole("***** barDataVal ********** :"+barDataVal);
graphJson.put("data", barDataVal);
}
}
......@@ -812,10 +823,12 @@ public class ChartCreator
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 )
/*if(linkLMetadataList.get(seriesCnt).trim().length()>0 )
{
linkStringValue=new JSONString("JavaScript: isJavaScriptCall=true;linkFunction('"+linkLMetadataList.get(seriesCnt)+"', '"+cellValue+"', '"+propertyStr+"','"+ urlStr+"', '"+parameterListString+"', 'Y')");
}
}*/
url = propertyStr+"&"+parameterListString+"&CELL_VAL="+cellValue.trim()+"&P1="+urlStr;
linkStringValue = new JSONString("JavaScript:getModuleLoad('"+linkLMetadataList.get(seriesCnt)+"','"+url+"','"+currentID+"');");
}
/*ended code to open new chart in frame by swati 18 Aug 2015*/
}
......@@ -840,7 +853,7 @@ public class ChartCreator
}
}
/*Added code to open new chart in frame by swati 18 Aug 2015*/
if(linkType.equalsIgnoreCase("f"))
if(linkType.equalsIgnoreCase("f"))
{
//CustomGrid data = new CustomGrid(8);
//String metadataName=parameterList.get(0);
......@@ -848,10 +861,12 @@ public class ChartCreator
String urlStr="";
String parameterListString=yAxisColunList.get(seriesCnt)+"&"+(""+dataStringValue).replace('"', ' ').trim()+"&"+xAxisColunList.get(0)+"@"+(""+jsnStringValue).replace('"', ' ').trim();
String xPlotValue = (""+jsnStringValue).replace('"', ' ').trim();
if(linkLMetadataList.get(seriesCnt).trim().length()>0 )
/*if(linkLMetadataList.get(seriesCnt).trim().length()>0 )
{
linkStringValue=new JSONString("JavaScript: isJavaScriptCall=true;linkFunction('"+linkLMetadataList.get(seriesCnt)+"', '"+cellValue+"', '"+propertyStr+"','"+ urlStr+"', '"+parameterListString+"','"+xPlotValue+"', 'Y')");
}
}*/
url = propertyStr+"&"+parameterListString+"&CELL_VAL="+cellValue.trim()+"&P1="+urlStr;
linkStringValue = new JSONString("JavaScript:getModuleLoad('"+linkLMetadataList.get(seriesCnt)+"','"+url+"','"+currentID+"');");
}
/*ended code to open new chart in frame by swati 18 Aug 2015*/
}
......
......@@ -2,7 +2,6 @@ package ibase.client;
import ibase.e12ria.e12table.client.AbstractDataGrid;
import ibase.e12ria.e12table.client.ColumnInfoBean;
import ibase.e12ria.e12table.client.DataGridTableRowModel;
......@@ -15,9 +14,11 @@ import java.util.ArrayList;
import java.util.Comparator;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import java.util.TreeMap;
import com.google.gwt.cell.client.TextCell;
import com.google.gwt.core.client.Callback;
import com.google.gwt.core.client.GWT;
import com.google.gwt.dom.client.Element;
import com.google.gwt.dom.client.EventTarget;
......@@ -25,6 +26,7 @@ import com.google.gwt.dom.client.TableCellElement;
import com.google.gwt.dom.client.TableRowElement;
import com.google.gwt.dom.client.TableSectionElement;
import com.google.gwt.json.client.JSONObject;
import com.google.gwt.json.client.JSONValue;
import com.google.gwt.user.cellview.client.ColumnSortEvent;
import com.google.gwt.user.cellview.client.ColumnSortEvent.ListHandler;
import com.google.gwt.user.cellview.client.Header;
......@@ -39,6 +41,7 @@ import com.google.gwt.user.client.ui.HasHorizontalAlignment;
import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.Image;
import com.google.gwt.user.client.ui.PopupPanel;
import com.google.gwt.user.client.ui.RootPanel;
import com.google.gwt.user.client.ui.ScrollPanel;
import com.google.gwt.view.client.ListDataProvider;
import com.google.gwt.dom.client.Node;
......@@ -60,6 +63,7 @@ public class CustomGrid extends AbstractDataGrid<DataGridTableRowModel>
private DataGridTableRowModel selDataGridTRModel = null;
HashMap<String, ArrayList<String>> gridPropertyeMap=new HashMap<String, ArrayList<String>>();
String firstIndex="";
String currentID = "";
public CustomGrid(int pageSize) {
super(pageSize);
}
......@@ -78,12 +82,15 @@ public class CustomGrid extends AbstractDataGrid<DataGridTableRowModel>
/*Start code for progess bar to data building- Dhanendra 17Nov2014*/
protected E12LoadingInterface e12LoadImg=new E12LoadingInterface();
/*End code for progess bar to data building- Dhanendra 17Nov2014*/
/*Add currentID Parameter to method by Dhanendra on date 16-09-2016*/
@SuppressWarnings("unchecked")
public FlexTable jsonToArrayList(HashMap<String, HashMap> gridNGraphMeataDataMap,JSONObject jsonObjGridData ,
String dataSrc,String componentId,ArrayList<String> parameterList,ArrayList<FilterInfo> filterList, String firstIndex)
String dataSrc,String componentId,ArrayList<String> parameterList,ArrayList<FilterInfo> filterList, String firstIndex,String currentID)
{
e12LoadImg.setLoadingInfo("Building view...");
e12LoadImg.setLoading(true);
this.currentID = currentID;
DataGridTableRowModel rowDataGrid= null;
E12CustomTextCell.CellData celldata = null;
ArrayList<ColumnInfoBean> dataGridTableColList = new ArrayList<ColumnInfoBean>();
......@@ -550,12 +557,12 @@ public class CustomGrid extends AbstractDataGrid<DataGridTableRowModel>
{
Node tdCell = tr.getChild(i).getFirstChild().getFirstChild();
if(tdCell!=null)
{
{
Element spanElemt = tdCell.cast();
String colName= spanElemt.getElementsByTagName("div").getItem(0).getAttribute("colname");
String colval= spanElemt.getElementsByTagName("div").getItem(0).getAttribute("title");
parameterListString = parameterListString + "&" + colName.trim() + "=" + colval.trim();
}
}
}
String splitArr[] = metadataName.split("@");
metadataName = splitArr[0];
......@@ -578,7 +585,13 @@ public class CustomGrid extends AbstractDataGrid<DataGridTableRowModel>
if(linkFormat.trim().length()>0 && linkFormat.trim().equalsIgnoreCase("F"))
{
/*add height parameter to buildGridFrame by Dhanendra*/
buildGridFrame(metadataName,cellValue, propertyStr,urlStr,parameterListString,dispFilterStatus,height);
/*Comment buildGridFrame method and add code for drill-down dashboard by Dhanendra on date 16-09-2016*/
//buildGridFrame(metadataName,cellValue, propertyStr,urlStr,parameterListString,dispFilterStatus,height);
final String url = propertyStr+"&"+parameterListString+"&CELL_VAL="+cellValue.trim()+"&P1="+urlStr;
SamePageOpenContainer samePageOpenContainer = new SamePageOpenContainer();
samePageOpenContainer.getFrameJSONData(metadataName, url, currentID);
/*Comment buildGridFrame method and add code for drill-down dashboard by Dhanendra on date 16-09-2016*/
}
//P means open url in the new window
if(linkFormat.trim().length()>0 && linkFormat.trim().equalsIgnoreCase("P"))
......@@ -906,4 +919,110 @@ public class CustomGrid extends AbstractDataGrid<DataGridTableRowModel>
}
return true;
}
public void getParameterList(JSONObject metaDataJsnObj,String url,String childID)
{
Date date = new Date();
MetaDataDtl dataDtl = new MetaDataDtl();
filterList =dataDtl.getFilters(metaDataJsnObj);
int year=0;
String month="";
String scmMonth="";
String monthYear="";
year= 1900+date.getYear();
month=String.valueOf(date.getMonth()+1);
scmMonth=String.valueOf((date.getMonth()));
if(month.trim().length()==1)
{
month="0"+month;
}
monthYear=year+month;
int count =0;
if(filterList.size()>0)
{
for (FilterInfo filterInfo : filterList)
{
count++;
//if(count==1)
CommonUtils.printOnConsole("filterInfo.getFieldName() :"+filterInfo.getFieldName());
if(filterInfo.getFieldName().equals("PRD_SALESDASH"))
{
String prdFilterName=filterInfo.getFieldName();
if(prdFilterName=="PRD_SALESDASH")
{
if(scmMonth.trim().length()==1)
{
scmMonth="0"+scmMonth;
}
monthYear=year+scmMonth;
parameterList.add(Window.Location.getParameter(filterInfo.getFieldName()) == null ? monthYear : Window.Location.getParameter(filterInfo.getFieldName()));
}
else
{
parameterList.add(Window.Location.getParameter(filterInfo.getFieldName()) == null ? monthYear : Window.Location.getParameter(filterInfo.getFieldName()));
}
}
/*Add code for current prd code by dhanendra on 06-10-2015 */
else if(filterInfo.getFieldName().equals("CURRENT_PRDCODE"))
{
parameterList.add(Window.Location.getParameter(filterInfo.getFieldName()) == null ? monthYear : Window.Location.getParameter(filterInfo.getFieldName()));
}
/*End code for current prd code by dhanendra on 06-10-2015 */
else
{
//parameterList.add(Window.Location.getParameter(filterInfo.getFieldName()) == null ? "" : Window.Location.getParameter(filterInfo.getFieldName()));
String guess = filterInfo.getFieldName();
CommonUtils.printOnConsole("guess :"+guess);
int wordLgth = guess.length();
CommonUtils.printOnConsole("wordLgth :"+wordLgth);
int index = url.indexOf(guess);
CommonUtils.printOnConsole("index :"+index);
if(index !=-1)
{
String newUri = url.substring(index + 1+wordLgth);
CommonUtils.printOnConsole("newUri :"+newUri);
int parameter = newUri.indexOf("&");
if(parameter == -1 && guess.equals("P1"))
{
parameterList.add(newUri);
}else{
CommonUtils.printOnConsole("parameter :"+parameter);
String paramVal = newUri.substring(0,parameter);
CommonUtils.printOnConsole("paramVal :"+paramVal);
parameterList.add(paramVal == null ? "" : paramVal);
}
CommonUtils.printOnConsole("parameterList in :"+parameterList);
}
else
{
parameterList.add("");
}
}
}
}
/*else
{
parameterList.add(Window.Location.getParameter("metadataname"));
}*/
GWTDashBoardReport boardReport = new GWTDashBoardReport();
parameterList.add(boardReport.getDefaultView(metaDataJsnObj));
CommonUtils.printOnConsole("parameterList :"+parameterList);
E12DashBoardPage e12DashBoardPage = new E12DashBoardPage(parameterList,metaDataJsnObj,childID);
RootPanel.get("filterDiv").add(e12DashBoardPage);
}
/*Add Native method for clear div by Dhanendra on date 19-09-2016*/
private static native void clearDivContainer(String ChartId)
/*-{
try {
$wnd.clearDivOnCloseButton(ChartId);
} catch (e) {
E12CommonUtils.printOnConsole("Exception :: Custom Grid : clearDivOnCloseButton [" + e.message + "]");
}
}-*/;
/*End Native method for clear div by Dhanendra on date 19-09-2016*/
}
......@@ -28,8 +28,8 @@ public class E12DashBoardPage extends Composite
private static GraphComponent graphComponent = null;
public JSONObject metaDataJsnObj = null;
public E12DashBoardPage(ArrayList<String> parameterList, JSONObject metaDataJsnObj)
/*Add childID Parameter to method by Dhanendra on date 16-09-2016*/
public E12DashBoardPage(ArrayList<String> parameterList, JSONObject metaDataJsnObj, String childID)
{
try
{
......@@ -39,14 +39,17 @@ public class E12DashBoardPage extends Composite
mainReportContainer.setWidth("100%");
mainReportContainer.add(graphComponent);
initWidget(mainReportContainer);
initaliseGraphNGrid(parameterList);
/*Add childID Parameter to method by Dhanendra on date 16-09-2016*/
initaliseGraphNGrid(parameterList,childID,metaDataJsnObj);
/*End childID Parameter to method by Dhanendra on date 16-09-2016*/
} catch (Exception e)
{
//Window.alert("Exception :: E12DashBoardPage parametarized constructor [" + e.getMessage() + "]");
}
}
public static void initaliseGraphNGrid(ArrayList<String> parameterList)
/*Add childID Parameter to method by Dhanendra on date 16-09-2016*/
public static void initaliseGraphNGrid(ArrayList<String> parameterList,String childID,JSONObject metaDataJsnObj)
{
graphComponent.getData(new Callback<JSONObject, String>()
{
......@@ -59,7 +62,7 @@ public class E12DashBoardPage extends Composite
{
Window.alert("Exception in initaliseGraphNGrid():: E12DashBoardPage [" + result + "]");
}
}, parameterList);
}, parameterList,childID,metaDataJsnObj);
}
public static void getJsonForFilterData(final Callback<JSONObject, String> callback, String fileName)
......
......@@ -32,6 +32,7 @@ import com.google.gwt.user.client.ui.MenuBar;
import com.google.gwt.user.client.ui.MenuItem;
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;
......@@ -746,7 +747,7 @@ public class FilterCreator extends Composite
}
@SuppressWarnings("serial")
private ScrollPanel getViewFilter(final ArrayList<String> parameterList, JSONObject metaDataJsnObj)
private ScrollPanel getViewFilter(final ArrayList<String> parameterList, final JSONObject metaDataJsnObj)
{
ScrollPanel viewPanel = null;
String xmlMetadata = null;
......@@ -797,7 +798,7 @@ public class FilterCreator extends Composite
selectedView = view;
selectedParamList.remove(parameterList.size() - 1);
selectedParamList.add(view);
E12DashBoardPage.initaliseGraphNGrid(selectedParamList);
E12DashBoardPage.initaliseGraphNGrid(selectedParamList,"",metaDataJsnObj);
}
});
fileMenu.addItem(actionItem);
......@@ -1045,7 +1046,8 @@ public class FilterCreator extends Composite
setParameterListDtl(popUpSendDtatListDtl);
/* End add List for India Map Caption Dhanendra 06/05/2015 */
setTitleOnFilterSubmit(popUpSendDtatList, metaDataJsnObj);
E12DashBoardPage.initaliseGraphNGrid(popUpSendDtatList);
CommonUtils.printOnConsole("************ metaDataJsnObj :"+metaDataJsnObj);
E12DashBoardPage.initaliseGraphNGrid(popUpSendDtatList,"",metaDataJsnObj);
}
}
......
package ibase.client;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import com.google.gwt.core.client.Callback;
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.json.client.JSONObject;
......@@ -19,11 +21,15 @@ import com.google.gwt.xml.client.XMLParser;
public class GWTDashBoardReport implements EntryPoint
{
ArrayList<String> parameterList = new ArrayList<String>();
ArrayList<String> parameterList = new ArrayList<String>();
public ArrayList<FilterInfo> filterList = new ArrayList<FilterInfo>();
HorizontalPanel hpanel= new HorizontalPanel();
String metadataname = "";
public String prdFilterName= "";
/*Add variable by Dhanendra */
public static HashMap<String, ArrayList<String>> drillDownIdsMap = new HashMap<String, ArrayList<String>>();
public static boolean isdrillDownDashBoard = false;
/*End variable by Dhanendra */
public void onModuleLoad()
{
metadataname = Window.Location.getParameter("metadataname") == null ? "" : Window.Location.getParameter("metadataname");
......@@ -119,7 +125,8 @@ public class GWTDashBoardReport implements EntryPoint
parameterList.add(Window.Location.getParameter("metadataname"));
}*/
parameterList.add(this.getDefaultView(metaDataJsnObj));
E12DashBoardPage e12DashBoardPage = new E12DashBoardPage(parameterList,metaDataJsnObj);
E12DashBoardPage e12DashBoardPage = new E12DashBoardPage(parameterList,metaDataJsnObj,"");
RootPanel.get("filterDiv").add(e12DashBoardPage);
}
public String getDefaultView(JSONObject metaDataJsnObj)
......
package ibase.client;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
......@@ -35,6 +37,7 @@ import com.google.gwt.user.client.ui.RootPanel;
import com.google.gwt.user.client.ui.ScrollPanel;
import com.google.gwt.user.client.ui.SimplePanel;
import com.google.gwt.user.client.ui.SplitLayoutPanel;
import com.google.gwt.user.client.ui.Tree;
import com.google.gwt.user.client.ui.VerticalPanel;
/**
......@@ -90,6 +93,10 @@ public class GraphComponent extends Composite
String empCodeEpa="";
String cellVal="";
String isShowfilter="";
HashMap<String, ArrayList<String>> drillDownIdsMapTemp = new HashMap<String, ArrayList<String>>();
SamePageOpenContainer pageOpenContainer = new SamePageOpenContainer();
public GraphComponent(ArrayList<String> parameterList, JSONObject metaDataJsnObj,String showfilter)
{
userMail = Window.Location.getParameter("EMP_MAILCODE") == null ? "" : Window.Location.getParameter("EMP_MAILCODE");
......@@ -112,10 +119,10 @@ public class GraphComponent extends Composite
initWidget(mainContainer);
}
/*Add childID Parameter to method by Dhanendra on date 16-09-2016*/
@SuppressWarnings("unchecked")
public void buildChart(final LinkedHashMap<String, JSONObject> dataMap,ArrayList<String> parameterList,ArrayList<FilterInfo> filterList)
public void buildChart(final LinkedHashMap<String, JSONObject> dataMap,ArrayList<String> parameterList,ArrayList<FilterInfo> filterList,String childID)
{
/*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*/
......@@ -192,7 +199,6 @@ public class GraphComponent extends Composite
/*Add Veriable by Dhanendra on 20-10-2015*/
String firstNameforTitle = "";
/*Add Veriable by Dhanendra on 20-10-2015*/
if (idList.size() > 0)
{
for (int i = 0; i < idList.size(); i++)
......@@ -200,15 +206,31 @@ public class GraphComponent extends Composite
/**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));
/*Window.alert("idList.get(i) :"+idList.get(i));
RootPanel panel = RootPanel.get(idList.get(i));
Window.alert("panel :"+panel);
if(panel!=null)
{
panel.clear();
Window.alert("panel.getElement().getFirstChild() :"+panel.getElement().getFirstChild());
if (panel.getElement().getFirstChild() != null)
{
//panel.getElement().getFirstChild().removeFromParent();
panel.getElement().removeFromParent();
}
}*/
for(Map.Entry<String, ArrayList<String>> entry : GWTDashBoardReport.drillDownIdsMap.entrySet())
{
RootPanel panel1 = RootPanel.get(entry.getKey());
if(panel1!=null)
{
panel1.clear();
if (panel1.getElement().getFirstChild() != null)
{
//panel.getElement().getFirstChild().removeFromParent();
panel1.getElement().removeFromParent();
}
}
}
}
idList = new ArrayList<String>();
......@@ -233,7 +255,6 @@ public class GraphComponent extends Composite
graphTypeMap = gridNGraphMeataDataMap.get("type"+componentId);
String type = ""+(graphTypeMap.get("type"+componentId));
if("T".equalsIgnoreCase(type))
{
componentTypeMap = gridNGraphMeataDataMap.get(compType);
......@@ -280,6 +301,7 @@ public class GraphComponent extends Composite
htmlString =""+(graphDtlList.get(24));
}
// ended code to add html tag to ssgrid by swati on 08-sep-2015
if(groupNameList.size()>0)
{
/**Loop for Compliance Dashboard**/
......@@ -329,11 +351,11 @@ public class GraphComponent extends Composite
}
else{
/*Add uniqueId to Graph,chartContainer by Dhanendra on Date 10-11-2015*/
this.createOuterDiv("Graph"+uniqueId+componentId,type,groupCssTypeNameList.get(0));
this.createOuterDiv("Graph"+uniqueId+componentId,type,groupCssTypeNameList.get(0),"chartContainer");
idList.add("Graph"+uniqueId+componentId+"Div");
/*Add append uniqueId in createInnerDiv method by Dhanendra on Date 14-03-2016*/
this.createInnerDiv(uniqueId+componentId,"Graph"+uniqueId+componentId);
graphJson = ChartCreator.buildChartData(graphDtlList, jsonObjFrGraph, dtSrouce,parameterList,filterList);
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*/
......@@ -342,7 +364,14 @@ public class GraphComponent extends Composite
else
{
/*For Normal Graph */
graphJson = ChartCreator.buildChartData(graphDtlList, jsonObjFrGraph, dtSrouce,parameterList,filterList);
String currentID = "Graph"+uniqueId+componentId+"Div";
graphJson = ChartCreator.buildChartData(graphDtlList, jsonObjFrGraph, dtSrouce,parameterList,filterList,currentID);
/*Add Code for Drill-down metadataxml by Dhanendra on date 16-09-2016*/
pageOpenContainer.putIdListInMap(currentID, childID);
exportDynamicMethod();
/*End Code for Drill-down metadataxml by Dhanendra on date 16-09-2016*/
// start- added empty json chartdata to display no data found message by swati on 7jan2015
if(graphJson.size()==0)
{
......@@ -354,7 +383,21 @@ public class GraphComponent extends Composite
/*Added code for Dynamic 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));
//this.createOuterDiv("Graph"+uniqueId+componentId,type,groupCssTypeNameList.get(0), "chartContainer");
/*Add Code for Drill-down metadataxml by Dhanendra on date 16-09-2016*/
if(childID.equalsIgnoreCase(""))
{
CommonUtils.printOnConsole("In if(childID.equalsIgnoreCase())");
this.createOuterDiv("Graph"+uniqueId+componentId,type,groupCssTypeNameList.get(0), "chartContainer");
}
else
{
CommonUtils.printOnConsole("In else childID = "+childID);
this.createOuterDiv("Graph"+uniqueId+componentId,type,groupCssTypeNameList.get(0),childID);
}
/*Add Code for Drill-down metadataxml by Dhanendra on date 16-09-2016*/
idList.add("Graph"+uniqueId+componentId+"Div");
/*End uniqueId to Graph by Dhanendra on date 10-11-2015*/
/*added code to append x-axis value in child grpah in title by dhanendra on Date: 07-Dec-2015*/
......@@ -370,6 +413,12 @@ public class GraphComponent extends Composite
componantTtl = new Label(componantTitlNameList.get(0));
}
/*added code to append x-axis value in child grpah in title by dhanendra on Date: 07-Dec-2015*/
if(!childID.equalsIgnoreCase(""))
{
componantTtl = new Label(componantTitlNameList.get(0)+ " : " +parameterList.get(parameterList.size()-2));
}
Image componantTtlImg = new Image("FusionChart/images/"+componentIconName);
Image refreshImg = new Image("FusionChart/images/refresh.png");
......@@ -381,6 +430,20 @@ public class GraphComponent extends Composite
HorizontalPanel componantTtlPanel = new HorizontalPanel();
HorizontalPanel dateHPanel = new HorizontalPanel();
/*Add Code for Drill-down metadataxml by Dhanendra on date 16-09-2016*/
final Label closeButton = new Label("x");
closeButton.setStyleName("closeButtonStyle");
closeButton.getElement().setId("Graph"+uniqueId+componentId+"Div");
closeButton.addClickHandler(new ClickHandler()
{
@Override
public void onClick(ClickEvent event)
{
pageOpenContainer.closeLinkedMetadataDiv(closeButton);
}
});
/*End Code for Drill-down metadataxml by Dhanendra on date 16-09-2016*/
componantTtlImg.setStyleName("componantTtlImg");
componantTtl.setStyleName("componantTtl");
componantTtlPanel.add(componantTtlImg);
......@@ -396,6 +459,15 @@ public class GraphComponent extends Composite
mainPanel.add(dateHPanel);
mainPanel.setStyleName("mainPanel");
mainPanel.setCellHorizontalAlignment(dateHPanel, HasHorizontalAlignment.ALIGN_RIGHT);
/*Add Code for Drill-down metadataxml by Dhanendra on date 16-09-2016*/
if(!childID.equalsIgnoreCase(""))
{
mainPanel.add(closeButton);
mainPanel.setCellHorizontalAlignment(closeButton, HasHorizontalAlignment.ALIGN_RIGHT);
mainPanel.setCellWidth( closeButton, "2%" );
}
/*End Code for Drill-down metadataxml by Dhanendra on date 16-09-2016*/
/*Add uniqueId to Graph by Dhanendra on date 10-11-2015*/
RootPanel.get("Graph"+uniqueId+componentId+"head").add(mainPanel);
......@@ -458,21 +530,61 @@ public class GraphComponent extends Composite
if(gridGroupName.length() == 0)
{
/*Loop for normal Data Grid*/
flexTable = data.jsonToArrayList(gridNGraphMeataDataMap, jsonObjFrGraph,dtSrouce,componentId,parameterList, filterList,firstIndex);
String currentID = "Grid"+uniqueId+componentId+"Div";
flexTable = data.jsonToArrayList(gridNGraphMeataDataMap, jsonObjFrGraph,dtSrouce,componentId,parameterList, filterList,firstIndex,currentID);
/*Add Code for Drill-down metadataxml by Dhanendra on date 16-09-2016*/
pageOpenContainer.putIdListInMap(currentID, childID);
final Label closeButton = new Label("x");
closeButton.setStyleName("closeButtonStyle");
closeButton.getElement().setId("Grid"+uniqueId+componentId+"Div");
closeButton.addClickHandler(new ClickHandler()
{
@Override
public void onClick(ClickEvent event)
{
pageOpenContainer.closeLinkedMetadataDiv(closeButton);
}
});
/*End Code for Drill-down metadataxml by Dhanendra on date 16-09-2016*/
/*Added code for Dyanamic Div and New CSS By Dhanendra 01-07-15*/
Image gridTtlImg = new Image("FusionChart/images/"+gridIconName);
HorizontalPanel gridTtlPanel = new HorizontalPanel();
if(!childID.equalsIgnoreCase(""))
{
gridComponantTitleName = gridComponantTitleName+ " : " +parameterList.get(parameterList.size()-2);
}
gridTitleLbl = new Label(gridComponantTitleName);
gridTtlImg.setStyleName("componantTtlImg");
gridTitleLbl.setStyleName("componantTtl");
gridTtlPanel.add(gridTtlImg);
gridTtlPanel.add(gridTitleLbl);
gridTtlPanel.setCellWidth( gridTtlImg, "2%" );
/*Add Code for Drill-down metadataxml by Dhanendra on date 16-09-2016*/
if(!childID.equalsIgnoreCase(""))
{
gridTtlPanel.add(closeButton);
gridTtlPanel.setCellHorizontalAlignment(closeButton, HasHorizontalAlignment.ALIGN_RIGHT);
gridTtlPanel.setCellWidth( closeButton, "2%" );
}
/*Add uniqueId to Grid by Dhanendra on date 10-11-2015*/
this.createOuterDiv("Grid"+uniqueId+componentId,type,gridCssName);
//this.createOuterDiv("Grid"+uniqueId+componentId,type,gridCssName, "chartContainer");
if(childID.equalsIgnoreCase(""))
{
this.createOuterDiv("Grid"+uniqueId+componentId,type,gridCssName, "chartContainer");
}else{
this.createOuterDiv("Grid"+uniqueId+componentId,type,gridCssName, childID);
}
/*End Code for Drill-down metadataxml by Dhanendra on date 16-09-2016*/
idList.add("Grid"+uniqueId+componentId+"Div");
RootPanel.get("Grid"+uniqueId+componentId+"head").add(gridTtlPanel);
RootPanel.get("Grid"+uniqueId+componentId+"Div").add(flexTable);
this.focusOnDiv("Grid"+uniqueId+componentId+"Div");
/*Add uniqueId to Grid by Dhanendra on date 10-11-2015*/
/*Ended code for Dyanamic Div and New CSS By Dhanendra 01-07-15*/
......@@ -500,10 +612,10 @@ public class GraphComponent extends Composite
count++;
}
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,"");
/*Add uniqueId to Grid by Dhanendra on date 10-11-2015*/
this.createOuterDiv(gridGroupName+uniqueId+"Grid",type,null);
this.createOuterDiv(gridGroupName+uniqueId+"Grid",type,null, "chartContainer");
idList.add(gridGroupName+uniqueId+"GridDiv");
/*End uniqueId to Grid by Dhanendra on date 10-11-2015*/
......@@ -553,7 +665,7 @@ public class GraphComponent extends Composite
gridTitleLbl = new Label(gridComponantTitleName);
/*Add uniqueId to Grid by Dhanendra on date 10-11-2015*/
this.createOuterDiv("Grid"+uniqueId+componentId,type,gridCssName);
this.createOuterDiv("Grid"+uniqueId+componentId,type,gridCssName, "chartContainer");
idList.add("Grid"+uniqueId+componentId+"Div");
RootPanel.get("Grid"+uniqueId+componentId+"head").add(gridTitleLbl);
RootPanel.get("Grid"+uniqueId+componentId+"Div").add(flexTable);
......@@ -590,7 +702,7 @@ public class GraphComponent extends Composite
if (graphJson != null && graphJson.size() > 0)
{
/*Start Added Code by Dhanendra for Dyanmic Div By Dhanendra on 11-03-2016*/
this.createOuterDiv("Map"+uniqueId+componentId,type,groupCssTypeNameList.get(0));
this.createOuterDiv("Map"+uniqueId+componentId,type,groupCssTypeNameList.get(0), "chartContainer");
idList.add("Map"+uniqueId+componentId+"Div");
Label componantTtl=null;
componantTtl = new Label(componantTitlNameList.get(0));
......@@ -658,7 +770,7 @@ public class GraphComponent extends Composite
{
/*Start Added Code by Dhanendra for Dyanmic Div By Dhanendra on 11-03-2016*/
this.createOuterDiv("Map"+uniqueId+componentId,type,groupCssTypeNameList.get(0));
this.createOuterDiv("Map"+uniqueId+componentId,type,groupCssTypeNameList.get(0), "chartContainer");
idList.add("Map"+uniqueId+componentId+"Div");
Label componantTtl=null;
componantTtl = new Label(componantTitlNameList.get(0));
......@@ -709,8 +821,16 @@ public class GraphComponent extends Composite
{
//RootPanel.get("chartContainer"+componentId).clear();
graphDtlList = graphDataMap.get(graphNo);
String currentID = "Card"+uniqueId+componentId+"Div";
/* Add parameterList,filterList to buildCard Method By Dhanendra on date 01-04-2016*/
SimplePanel panel = new CardBuilder().buildCard(graphDtlList, jsonObjFrGraph, dtSrouce,parameterList,filterList);
SimplePanel panel = new CardBuilder().buildCard(graphDtlList, jsonObjFrGraph, dtSrouce,parameterList,filterList,currentID);
pageOpenContainer.putIdListInMap(currentID, childID);
exportDynamicMethod();
//RootPanel.get("chartContainer"+componentId).add(panel);
/*Added code for Dyanamic Div and New CSS By Dhanendra 13-07-15*/
......@@ -722,6 +842,9 @@ public class GraphComponent extends Composite
Image gridTtlImg = new Image("FusionChart/images/"+gridIconName);
HorizontalPanel gridTtlPanel = new HorizontalPanel();
if(cellVal.trim().length()>0)
{
gridComponantTitleName = ""+componantTitlNameList.get(0)+": "+cellVal;
......@@ -730,18 +853,56 @@ public class GraphComponent extends Composite
{
gridComponantTitleName = ""+componantTitlNameList.get(0);
}
if(!childID.equalsIgnoreCase(""))
{
gridComponantTitleName = gridComponantTitleName + " : " + parameterList.get(parameterList.size()-2);
}
gridCssName = ""+groupCssTypeNameList.get(0);
gridTitleLbl = new Label(gridComponantTitleName);
gridTtlImg.setStyleName("componantTtlImg");
gridTitleLbl.setStyleName("componantTtl");
gridTtlPanel.add(gridTtlImg);
gridTtlPanel.add(gridTitleLbl);
gridTtlPanel.setCellWidth( gridTtlImg, "2%" );
final Label closeButton = new Label("x");
closeButton.setStyleName("closeButtonStyle");
closeButton.getElement().setId("Card"+uniqueId+componentId+"Div");
closeButton.addClickHandler(new ClickHandler()
{
@Override
public void onClick(ClickEvent event)
{
pageOpenContainer.closeLinkedMetadataDiv(closeButton);
}
});
if(!childID.equalsIgnoreCase(""))
{
gridTtlPanel.add(closeButton);
gridTtlPanel.setCellHorizontalAlignment(closeButton, HasHorizontalAlignment.ALIGN_RIGHT);
gridTtlPanel.setCellWidth( closeButton, "2%" );
}
/*Add uniqueId to Card by Dhanendra on date 10-11-2015*/
this.createOuterDiv("Card"+uniqueId+componentId,type,gridCssName);
//this.createOuterDiv("Card"+uniqueId+componentId,type,gridCssName, "chartContainer");
if(childID.equalsIgnoreCase(""))
{
CommonUtils.printOnConsole("In if(childID.equalsIgnoreCase())");
this.createOuterDiv("Card"+uniqueId+componentId,type,gridCssName, "chartContainer");
}
else
{
CommonUtils.printOnConsole("In else childID = "+childID);
this.createOuterDiv("Card"+uniqueId+componentId,type,gridCssName, childID);
//this.createOuterDiv("Card"+uniqueId+componentId,type,"outerChartContainerPos1of1ChildDivs",childID);
}
idList.add("Card"+uniqueId+componentId+"Div");
RootPanel.get("Card"+uniqueId+componentId+"head").add(gridTtlPanel);
RootPanel.get("Card"+uniqueId+componentId+"Div").add(panel);
this.focusOnDiv("Card"+uniqueId+componentId+"Div");
/*End uniqueId to Card by Dhanendra on date 10-11-2015*/
......@@ -791,7 +952,7 @@ public class GraphComponent extends Composite
}
if (graphJson != null && graphJson.size() > 0)
{
this.createOuterDiv("Gantt" +uniqueId+ componentId, type, gridCssName);
this.createOuterDiv("Gantt" +uniqueId+ componentId, type, gridCssName, "chartContainer");
idList.add("Gantt"+uniqueId+componentId+"Div");
this.createGnttChart(graphJson.toString(), "Gantt"+uniqueId+componentId +"Div", height, width);
}
......@@ -825,13 +986,14 @@ public class GraphComponent extends Composite
}
if (graphJson != null && graphJson.size() > 0)
{
this.createOuterDiv("Gauge"+uniqueId+componentId, type, gridCssName);
this.createOuterDiv("Gauge"+uniqueId+componentId, type, gridCssName, "chartContainer");
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);
......@@ -1097,7 +1259,7 @@ public class GraphComponent extends Composite
}/*end Code for display Dashboard one by one in one page by Dhanendra*/
else // loop for simple graph
{
graphJson = ChartCreator.buildChartData(graphDtlList, jsonObjFrGraph, dtSrouce,parameterList,filterList);
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 )
{
......@@ -1208,7 +1370,7 @@ public class GraphComponent extends Composite
filtrGridJSN = new JSONObject();
if(gridGroupName.length() == 0)
{
flexTable = data.jsonToArrayList(gridNGraphMeataDataMap, jsonObjFrGraph,dtSrouce,componentId,parameterList, filterList,firstIndex);
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);
HorizontalPanel gridTtlPanel = new HorizontalPanel();
......@@ -1327,7 +1489,7 @@ public class GraphComponent extends Composite
//RootPanel.get("chartContainer"+componentId).clear();
graphDtlList = graphDataMap.get(graphNo);
/* Add parameterList,filterList to buildCard Method By Dhanendra on date 01-04-2016*/
SimplePanel panel = new CardBuilder().buildCard(graphDtlList, jsonObjFrGraph, dtSrouce,parameterList,filterList);
SimplePanel panel = new CardBuilder().buildCard(graphDtlList, jsonObjFrGraph, dtSrouce,parameterList,filterList,"");
//RootPanel.get("chartContainer"+componentId).add(panel);
/*Added code for Dyanamic Div and New CSS By Dhanendra 13-07-15*/
......@@ -1404,10 +1566,11 @@ public class GraphComponent extends Composite
}-*/;
/*Add Code for create dyanamic div by Dhanendra for one by one report display*/
private native void createOuterDiv(String outerDivId, String type, String cssName)
/*Add parentId Parameter to createOuterDiv Method by Dhanendra on date 16-09-2016*/
private native void createOuterDiv(String outerDivId, String type, String cssName, String parentId)
/*-{
try {
$wnd.outerDiv(outerDivId,type,cssName);
$wnd.outerDiv(outerDivId,type,cssName,parentId);
} catch (e) {
alert("Excpeiton :: GraphComponent : createOuterDiv [" + e.message + "]");
}
......@@ -1444,23 +1607,44 @@ public class GraphComponent extends Composite
}-*/;
/**End Added new Method by sachin on 10 Aug 2015 **/
/** End Native Method */
/*Added by Chetan Mahajan [For adding drill down report bellow the parent report] req id:S16EBAS003 on 08-AUG-2016 Start */
private static native void clearDivContainer(String ChartId)
/*-{
try {
$wnd.clearDivOnCloseButton(ChartId);
} catch (e) {
CommonUtils.printOnConsole("Exception :: GraphComponent : clearDivOnCloseButton [" + e.message + "]");
}
}-*/;
private native void focusOnDiv(String focusDivID)
/*-{
try {
$wnd.focusOnDivJSNI(focusDivID);
} catch (e) {
CommonUtils.printOnConsole("Exception :: GraphComponent : focusOnDiv [" + e.message + "]");
}
}-*/;
/*Added by Chetan Mahajan [For adding drill down report bellow the parent report] req id:S16EBAS003 on 08-AUG-2016 End*/
/** End Native Method */
/*Add childID Parameter to method by Dhanendra on date 16-09-2016*/
@SuppressWarnings("unchecked")
public void getData(final Callback<JSONObject, String> callback, ArrayList<String> parameterList)
public void getData(final Callback<JSONObject, String> callback, ArrayList<String> parameterList,String childID,JSONObject metaDataJsnObj)
{
this.parameterList=parameterList;
this.jsonObjMetaData = metaDataJsnObj;
String viewOptionSelectd = parameterList.get(parameterList.size()-1);
dataDtl = new MetaDataDtl();
gridNGraphMeataDataMap = dataDtl.getGridNMapMetData(jsonObjMetaData,viewOptionSelectd,parameterList);
gridNGraphMeataDataMap = dataDtl.getGridNMapMetData(jsonObjMetaData,viewOptionSelectd,parameterList);
final LinkedHashMap<String, ArrayList<String>> datsSourceDtlMap = (LinkedHashMap) gridNGraphMeataDataMap.get("datSrc");
getDataMap(datsSourceDtlMap,parameterList);
getDataMap(datsSourceDtlMap,parameterList,childID);
}
public void getDataMap(final LinkedHashMap<String, ArrayList<String>> datsSourceDtlMap,final ArrayList<String> parameterList)
/*Add childID Parameter to method by Dhanendra on date 16-09-2016*/
public void getDataMap(final LinkedHashMap<String, ArrayList<String>> datsSourceDtlMap,final ArrayList<String> parameterList, final String childID)
{
final ArrayList<FilterInfo> filterList = new MetaDataDtl().getFilters(jsonObjMetaData);
final LinkedHashMap<String, JSONObject> componentDataMap = new LinkedHashMap<String, JSONObject>();
......@@ -1520,6 +1704,7 @@ public class GraphComponent extends Composite
}
/*ended by swati - if no filters are present in meta data xml*/
/** 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);
......@@ -1546,8 +1731,11 @@ public class GraphComponent extends Composite
RootPanel.get("chartContainer").clear();
}
if (componentDataMap.size() == datsSourceDtlMap.size())
{
buildChart(componentDataMap,parameterList,filterList);
{
/*Add childID Parameter to method by Dhanendra on date 16-09-2016*/
buildChart(componentDataMap,parameterList,filterList,childID);
/*End childID Parameter to method by Dhanendra on date 16-09-2016*/
/*added by sachin for smart filter 12 may 2015*/
/*Add idList Parameter in SmartFiltrCreator method by Dhanendra on Date 23-11-2015*/
mainContainer.add(new SmartFiltrCreator(datsSourceDtlMap, componentDataMap, jsonObjMetaData, parameterList,filterList,idList));
......@@ -1850,11 +2038,11 @@ public class GraphComponent extends Composite
CustomGrid data = new CustomGrid(8);
filtrGridJSN = new JSONObject();
filtrGridJSN.put("1", dataJson);
flexTable = data.jsonToArrayList(dataDtl.getGridNMapMetData(jsonObjMetaData,parameterList.get(parameterList.size()-1),parameterList), filtrGridJSN,"1",""+compId,parameterList, filterList,firstIndex);
flexTable = data.jsonToArrayList(dataDtl.getGridNMapMetData(jsonObjMetaData,parameterList.get(parameterList.size()-1),parameterList), filtrGridJSN,"1",""+compId,parameterList, filterList,firstIndex,"");
/*Add uniqueId to groupName by Dhanendra on date 10-11-2015*/
this.clearContainer(groupName+uniqueId+"Grid");
this.createOuterDiv(groupName+uniqueId+"Grid",type,null);
this.createOuterDiv(groupName+uniqueId+"Grid",type,null, "chartContainer");
idList.add(groupName+uniqueId+"GridDiv");
RootPanel.get(gridGroupName+uniqueId+"Gridhead").add(gridLblVal);
RootPanel.get(groupName+uniqueId+"GridDiv").add(flexTable);
......@@ -1901,7 +2089,7 @@ public class GraphComponent extends Composite
Label refreshDateTime = new Label(dateformat);
/*add uniqueId to groupname by dhanendra on date 09-11-2015 */
this.createOuterDiv(groupName+uniqueId,"G",null);
this.createOuterDiv(groupName+uniqueId,"G",null, "chartContainer");
idList.add(groupName+uniqueId+"Div");
/*End uniqueId to groupname by dhanendra on date 09-11-2015 */
......@@ -2008,7 +2196,7 @@ public class GraphComponent extends Composite
}
dataCnt++;
graphJson = ChartCreator.buildChartData(graphDtlList, mainDataJson, multGrph,parameterList,filterList);
graphJson = ChartCreator.buildChartData(graphDtlList, mainDataJson, multGrph,parameterList,filterList,"");
if(graphJson.size()==0 )
{
graphJson.put("chart", new JSONString(""));
......@@ -2100,5 +2288,19 @@ public class GraphComponent extends Composite
/*End code for interlink for wms3pl dashboard by Dhanendra */
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 */
/*End this method to open a new window to display a grid from click on last hierachey by Dhanendra on date 16-10-2015 */
/*Add Method for dill-down dashboard in same page by Dhanendra on date 20-09-2016*/
public native void exportDynamicMethod()
/*-{
$wnd.getModuleLoad = $entry(this.@ibase.client.GraphComponent::displayLinkedChart(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;));
}-*/;
public void displayLinkedChart( String linkMetadaname, String linkUri, final String currentID)
{
SamePageOpenContainer pageOpenContainer = new SamePageOpenContainer();
pageOpenContainer.getFrameJSONData(linkMetadaname, linkUri, currentID);
}
/*End Method for dill-down dashboard in same page by Dhanendra on date 20-09-2016*/
}
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