Commit 36b3be19 authored by sbade's avatar sbade

updated all the java files for dashboard with enhanced functionality


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@96772 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 7c740e7d
...@@ -100,9 +100,10 @@ public class ChartCreator ...@@ -100,9 +100,10 @@ public class ChartCreator
} }
} }
int cnt=0;
if (jsonObjGraph != null) if (jsonObjGraph != null)
{ {
cnt++;
allDataMap = new HashMap<String, List<String>>(); allDataMap = new HashMap<String, List<String>>();
barMap = new LinkedHashMap<JSONValue, JSONValue>(); barMap = new LinkedHashMap<JSONValue, JSONValue>();
...@@ -111,7 +112,7 @@ public class ChartCreator ...@@ -111,7 +112,7 @@ public class ChartCreator
allDataList = new ArrayList<LinkedHashMap<JSONValue, JSONValue>>(); allDataList = new ArrayList<LinkedHashMap<JSONValue, JSONValue>>();
try try
{ {
JSONObject jsonObjFrGraph =(JSONObject) jsonObjGraph.get(dataSource); JSONObject jsonObjFrGraph =(JSONObject) jsonObjGraph.get(dataSource);
for (int jsnCnt = 0; jsnCnt < jsonObjFrGraph.size(); jsnCnt++) for (int jsnCnt = 0; jsnCnt < jsonObjFrGraph.size(); jsnCnt++)
{ {
JSONObject fetchRowWiseVal = (JSONObject) jsonObjFrGraph.get(String.valueOf(jsnCnt)); JSONObject fetchRowWiseVal = (JSONObject) jsonObjFrGraph.get(String.valueOf(jsnCnt));
...@@ -131,6 +132,7 @@ public class ChartCreator ...@@ -131,6 +132,7 @@ public class ChartCreator
valueMapSet = allDataMap.keySet(); valueMapSet = allDataMap.keySet();
if(chartTypeList.get(0).trim().equals("bar")) if(chartTypeList.get(0).trim().equals("bar"))
{ {
for (String keyString : valueMapSet) for (String keyString : valueMapSet)
{ {
mapValuList = allDataMap.get(keyString); mapValuList = allDataMap.get(keyString);
...@@ -168,16 +170,15 @@ public class ChartCreator ...@@ -168,16 +170,15 @@ public class ChartCreator
barMap.put(new JSONString("renderas"), new JSONString("Line")); barMap.put(new JSONString("renderas"), new JSONString("Line"));
barMap.put(new JSONString("parentYAxis"), new JSONString("s")); barMap.put(new JSONString("parentYAxis"), new JSONString("s"));
barMap.put(new JSONString("valuePosition"), new JSONString("ABOVE")); barMap.put(new JSONString("valuePosition"), new JSONString("ABOVE"));
}
}else{ else
{
barMap.put(new JSONString("valuePosition"), new JSONString("BELOW")); barMap.put(new JSONString("valuePosition"), new JSONString("BELOW"));
} }
barMap.put(new JSONString("color"), new JSONString(colorInfoList.get(seriesCnt))); barMap.put(new JSONString("color"), new JSONString(colorInfoList.get(seriesCnt)));
barMap.put(new JSONString("data"), barDataVal); barMap.put(new JSONString("data"), barDataVal);
barMap.put(new JSONString("seriesname"), new JSONString(yAxisColumnName.get(seriesCnt))); barMap.put(new JSONString("seriesname"), new JSONString(yAxisColumnName.get(seriesCnt)));
allDataList.add(barMap); allDataList.add(barMap);
} }
categryDataVal = JSONParser.parseStrict(labelList.toString().replace('=', ':')); categryDataVal = JSONParser.parseStrict(labelList.toString().replace('=', ':'));
categryJson.put("category", categryDataVal); categryJson.put("category", categryDataVal);
...@@ -185,14 +186,14 @@ public class ChartCreator ...@@ -185,14 +186,14 @@ public class ChartCreator
graphJson.put("categories", categryJson); graphJson.put("categories", categryJson);
} }
else if(chartTypeList.get(0).trim().equals("pie")) else if(chartTypeList.get(0).trim().equals("pie"))
{ {
for (String keyString : valueMapSet) for (String keyString : valueMapSet)
{ {
mapValuList = allDataMap.get(keyString); mapValuList = allDataMap.get(keyString);
categoryMap = new LinkedHashMap<JSONValue, JSONValue>(); categoryMap = new LinkedHashMap<JSONValue, JSONValue>();
keyString = keyString.replace('"', ' ').trim(); keyString = keyString.replace('"', ' ').trim();
jsnStringValue = new JSONString(keyString); jsnStringValue = new JSONString(keyString);
jsnStringKey = new JSONString("label"); jsnStringKey = new JSONString("label");
categoryMap.put(jsnStringKey, jsnStringValue); categoryMap.put(jsnStringKey, jsnStringValue);
dataStringKey = new JSONString("value"); dataStringKey = new JSONString("value");
...@@ -200,11 +201,11 @@ public class ChartCreator ...@@ -200,11 +201,11 @@ public class ChartCreator
{ {
dataStringValue = new JSONString("" + mapValuList.get(seriesCnt)); dataStringValue = new JSONString("" + mapValuList.get(seriesCnt));
categoryMap.put(dataStringKey, dataStringValue); categoryMap.put(dataStringKey, dataStringValue);
barValueList.add(categoryMap); barValueList.add(categoryMap);
barDataVal = JSONParser.parseStrict(barValueList.toString().replace('=', ':')); barDataVal = JSONParser.parseStrict(barValueList.toString().replace('=', ':'));
} }
graphJson.put("data", barDataVal); graphJson.put("data", barDataVal);
} }
} }
jsonChartVal = JSONParser.parseStrict(metaDataList.toString()); jsonChartVal = JSONParser.parseStrict(metaDataList.toString());
......
...@@ -25,10 +25,14 @@ import com.google.gwt.user.cellview.client.ColumnSortEvent; ...@@ -25,10 +25,14 @@ import com.google.gwt.user.cellview.client.ColumnSortEvent;
import com.google.gwt.user.cellview.client.ColumnSortEvent.ListHandler; import com.google.gwt.user.cellview.client.ColumnSortEvent.ListHandler;
import com.google.gwt.user.cellview.client.E12SimplePager; import com.google.gwt.user.cellview.client.E12SimplePager;
import com.google.gwt.user.cellview.client.Header; import com.google.gwt.user.cellview.client.Header;
import com.google.gwt.user.cellview.client.SimplePager;
import com.google.gwt.user.client.Command; import com.google.gwt.user.client.Command;
import com.google.gwt.user.client.Window; import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.FlexTable; import com.google.gwt.user.client.ui.FlexTable;
import com.google.gwt.user.client.ui.HasHorizontalAlignment; 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.PopupPanel;
import com.google.gwt.view.client.ListDataProvider; import com.google.gwt.view.client.ListDataProvider;
import com.google.gwt.xml.client.Node; import com.google.gwt.xml.client.Node;
...@@ -82,9 +86,12 @@ public class CustomGrid extends AbstractDataGrid<DataGridTableRowModel> ...@@ -82,9 +86,12 @@ public class CustomGrid extends AbstractDataGrid<DataGridTableRowModel>
gridNGraphMeataDataMap.toString().replace('=', ':'); gridNGraphMeataDataMap.toString().replace('=', ':');
HashMap<String, ArrayList<String>> graphDataMap = null; HashMap<String, ArrayList<String>> graphDataMap = null;
HashMap<String, ArrayList<String>> graphSizeMap=null; HashMap<String, ArrayList<String>> graphSizeMap=null;
HashMap<String, ArrayList<String>> graphCaptioneMap=null;
HashMap<String, ArrayList<String>> graphAlignMap = null; HashMap<String, ArrayList<String>> graphAlignMap = null;
ArrayList<String> graphDtlList = new ArrayList<String>(); ArrayList<String> graphDtlList = new ArrayList<String>();
ArrayList<String> graphAlignList=new ArrayList<String>(); ArrayList<String> graphAlignList=new ArrayList<String>();
ArrayList<String> graphCaptionList=new ArrayList<String>();
try try
{ {
graphDataMap=gridNGraphMeataDataMap.get(componentId); graphDataMap=gridNGraphMeataDataMap.get(componentId);
...@@ -117,8 +124,10 @@ public class CustomGrid extends AbstractDataGrid<DataGridTableRowModel> ...@@ -117,8 +124,10 @@ public class CustomGrid extends AbstractDataGrid<DataGridTableRowModel>
graphDataMap =gridNGraphMeataDataMap.get("columnName"+componentId); graphDataMap =gridNGraphMeataDataMap.get("columnName"+componentId);
graphSizeMap =gridNGraphMeataDataMap.get("columnSize"+componentId); graphSizeMap =gridNGraphMeataDataMap.get("columnSize"+componentId);
graphAlignMap =gridNGraphMeataDataMap.get("columnAlign"+componentId); graphAlignMap =gridNGraphMeataDataMap.get("columnAlign"+componentId);
graphCaptioneMap = gridNGraphMeataDataMap.get("componentCaption"+componentId);
for (String graphKey : graphDataMap.keySet()) for (String graphKey : graphDataMap.keySet())
{ {
graphDtlList.clear();
graphDtlList = graphDataMap.get(graphKey); graphDtlList = graphDataMap.get(graphKey);
for(int jDataCtr=0;jDataCtr<graphDtlList.size();jDataCtr++) for(int jDataCtr=0;jDataCtr<graphDtlList.size();jDataCtr++)
{ {
...@@ -127,8 +136,9 @@ public class CustomGrid extends AbstractDataGrid<DataGridTableRowModel> ...@@ -127,8 +136,9 @@ public class CustomGrid extends AbstractDataGrid<DataGridTableRowModel>
graphAlignList.add(""+graphAlignMap.get(graphKey)); graphAlignList.add(""+graphAlignMap.get(graphKey));
} }
} }
graphCaptionList.add(""+graphCaptioneMap.get("componentCaption"+componentId));
flexTable.setStyleName("flexCSS"); flexTable.setStyleName("flexCSS");
flexTable=createTableComponent(dataGridTableRowList,dataGridTableColList,flexTable,graphAlignList); flexTable=createTableComponent(dataGridTableRowList,dataGridTableColList,flexTable,graphAlignList,graphCaptionList);
} catch (Exception e) } catch (Exception e)
{ {
Window.alert(" Exception : DataGrid : jsonToArrayList(): [" + e.getMessage() + "]"); Window.alert(" Exception : DataGrid : jsonToArrayList(): [" + e.getMessage() + "]");
...@@ -143,7 +153,7 @@ public class CustomGrid extends AbstractDataGrid<DataGridTableRowModel> ...@@ -143,7 +153,7 @@ public class CustomGrid extends AbstractDataGrid<DataGridTableRowModel>
* @param dataGridTableRowList * @param dataGridTableRowList
* @return * @return
*/ */
public FlexTable createTableComponent( ArrayList< DataGridTableRowModel> dataGridTableRowList, ArrayList<ColumnInfoBean> dataGridTableColList, FlexTable flexTable,ArrayList<String> graphAlignList) public FlexTable createTableComponent( ArrayList< DataGridTableRowModel> dataGridTableRowList, ArrayList<ColumnInfoBean> dataGridTableColList, FlexTable flexTable,ArrayList<String> graphAlignList,ArrayList<String> graphCaptionList)
{ {
final int noOfRows = dataGridTableRowList.size(); final int noOfRows = dataGridTableRowList.size();
final int noOfColumns = dataGridTableColList.size(); final int noOfColumns = dataGridTableColList.size();
...@@ -152,7 +162,7 @@ public class CustomGrid extends AbstractDataGrid<DataGridTableRowModel> ...@@ -152,7 +162,7 @@ public class CustomGrid extends AbstractDataGrid<DataGridTableRowModel>
//Add by Dnyaneshwar chavan on 07-DEC-2012 [WS2GSUN002 || ] Start //Add by Dnyaneshwar chavan on 07-DEC-2012 [WS2GSUN002 || ] Start
E12CustomColumn firstColumn = null; E12CustomColumn firstColumn = null;
//Add by Dnyaneshwar chavan on 07-DEC-2012 [WS2GSUN002 || ] End //Add by Dnyaneshwar chavan on 07-DEC-2012 [WS2GSUN002 || ] End
String caption ="";
ResizableHeader<DataGridTableRowModel> header=null; ResizableHeader<DataGridTableRowModel> header=null;
try try
{ {
...@@ -215,68 +225,86 @@ public class CustomGrid extends AbstractDataGrid<DataGridTableRowModel> ...@@ -215,68 +225,86 @@ public class CustomGrid extends AbstractDataGrid<DataGridTableRowModel>
this.addColumn(column, header, null); this.addColumn(column, header, null);
} }
caption = graphCaptionList.get(0);
dataProvider.addDataDisplay( this ); dataProvider.addDataDisplay( this );
dataProvider.refresh(); dataProvider.refresh();
this.getColumnSortList().clear(); this.getColumnSortList().clear();
this.getColumnSortList().push( firstColumn ); this.getColumnSortList().push( firstColumn );
this.getColumnSortList().push( firstColumn ); this.getColumnSortList().push( firstColumn );
ColumnSortEvent.fire(this, this.getColumnSortList()); ColumnSortEvent.fire(this, this.getColumnSortList());
} }
catch (Exception e ) catch (Exception e )
{ {
Window.alert("Exception in table "+ e.getMessage()) ; Window.alert("Exception in table "+ e.getMessage()) ;
} }
GridThemes.applyDatagridThemes(); GridThemes.applyDatagridThemes();
E12SimplePager.Resources pagerResources = GWT.create(E12SimplePager.Resources.class); //E12SimplePager.Resources pagerResources = GWT.create(E12SimplePager.Resources.class);
final E12SimplePager pager = new E12SimplePager(E12SimplePager.TextLocation.CENTER, pagerResources, false, 0 , true); //final E12SimplePager pager =new E12SimplePager(E12SimplePager.TextLocation.CENTER, pagerResources, false, 0 , true);
pager.setDisplay(this);
HorizontalPanel excelBtnPnl = new HorizontalPanel();
Button excelBtn = new Button();
excelBtn.setTitle("Excel");
Image excelImg = new Image("FusionChart/images/excel.png");
excelImg.setHeight("20px");
excelBtn.getElement().appendChild(excelImg.getElement());
excelBtnPnl.add(ibase.client.tabletoexcel.TableToExcelClientBuilder.fromTable(flexTable).withWidget(excelBtn).buildExportFormWidget());
SimplePager.Resources displayPagerResources = GWT.create(SimplePager.Resources.class);
final SimplePager displayPager = new SimplePager(SimplePager.TextLocation.CENTER, displayPagerResources, false, 0 , true, excelBtnPnl);
displayPager.setDisplay(this);
pager.setRangeText(rangeText); displayPager.setRangeText(rangeText);
Command setRowCmd = new Command() { Command setRowCmd = new Command() {
@Override @Override
public void execute() { public void execute()
{
try try
{ {
int rowNo= (int)Double.parseDouble( pager.getRangeText().trim() ); int rowNo= (int)Double.parseDouble( displayPager.getRangeText().trim() );
if( rowNo > 0 && rowNo <= noOfRows) if( rowNo > 0 && rowNo <= noOfRows)
{ {
CustomGrid.this.setPageSize( rowNo ); CustomGrid.this.setPageSize( rowNo );
pager.firstPage(); displayPager.firstPage();
dataProvider.refresh(); dataProvider.refresh();
rangeText = pager.getRangeText(); rangeText = displayPager.getRangeText();
pager.setRangeText(pager.getRangeText()); displayPager.setRangeText(displayPager.getRangeText());
} }
else else
{ {
pager.setRangeText("Error"); displayPager.setRangeText("Error");
} }
} }
catch (Exception e) catch (Exception e)
{ {
pager.setRangeText("Error"); displayPager.setRangeText("Error");
} }
} }
}; };
pager.setRangeCommand( setRowCmd ); displayPager.setRangeCommand( setRowCmd );
flexTable.setText(0, 0, caption);
flexTable.setWidget(0, 0, this); flexTable.setWidget(1, 0, this);
flexTable.setWidget(1, 0, pager); flexTable.setWidget(2, 0, displayPager);
flexTable.setHeight( Window.getClientHeight() - 195 + "px" ); flexTable.setHeight( Window.getClientHeight() - 195 + "px" );
//flexTable.setWidth( Window.getClientWidth() -10+ "px" ); //flexTable.setWidth( Window.getClientWidth() -10+ "px" );
//flexTable.setWidth("100% !important"); //flexTable.setWidth("100% !important");
setHeight( Window.getClientHeight() - 207+ "px" ); setHeight( Window.getClientHeight() - 207+ "px" );
setHeight( ( ( Window.getClientHeight() - 207 ))+ "px" ); setHeight( ( ( Window.getClientHeight() - 207 ))+ "px" );
flexTable.getCellFormatter().setStyleName(0 ,0 , "gwt-ScrollTable"); flexTable.getCellFormatter().setStyleName(0 ,0 , "FlexTable-ColumnHeaderCell");
flexTable.getCellFormatter().setStyleName(1 ,0 , "gwt-ScrollTable");
//flexTable.getCellFormatter().setStyleName(1 ,0 , "e12Pager"); //flexTable.getCellFormatter().setStyleName(1 ,0 , "e12Pager");
if( GridThemes.getBrowserVersion() == -1 ) if( GridThemes.getBrowserVersion() == -1 )
{ {
flexTable.getCellFormatter().setStyleName(1 ,0 , "e12Pager"); flexTable.getCellFormatter().setStyleName(2 ,0 , "e12Pager");
} }
else else
{ {
flexTable.getCellFormatter().setStyleName(1 ,0 , "e12Pager-forIE"); flexTable.getCellFormatter().setStyleName(2 ,0 , "e12Pager-forIE");
} }
addStyleName("e12AdvDataGrid-SideBars"); addStyleName("e12AdvDataGrid-SideBars");
...@@ -291,8 +319,7 @@ public class CustomGrid extends AbstractDataGrid<DataGridTableRowModel> ...@@ -291,8 +319,7 @@ public class CustomGrid extends AbstractDataGrid<DataGridTableRowModel>
} }
@Override @Override
public FlexTable createTableComponent( public FlexTable createTableComponent(ArrayList<DataGridTableRowModel> dataGridTableRowList,
ArrayList<DataGridTableRowModel> dataGridTableRowList,
ArrayList<ColumnInfoBean> dataGridTableColList, FlexTable flexTable) ArrayList<ColumnInfoBean> dataGridTableColList, FlexTable flexTable)
{ {
// TODO Auto-generated method stub // TODO Auto-generated method stub
......
...@@ -7,6 +7,10 @@ import com.google.gwt.json.client.JSONObject; ...@@ -7,6 +7,10 @@ import com.google.gwt.json.client.JSONObject;
import com.google.gwt.user.client.Window; import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.HorizontalPanel; import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.RootPanel; import com.google.gwt.user.client.ui.RootPanel;
import com.google.gwt.xml.client.Document;
import com.google.gwt.xml.client.Node;
import com.google.gwt.xml.client.NodeList;
import com.google.gwt.xml.client.XMLParser;
/** /**
* Entry point classes define <code>onModuleLoad()</code>. * Entry point classes define <code>onModuleLoad()</code>.
...@@ -22,6 +26,9 @@ public class GWTDashBoardReport implements EntryPoint ...@@ -22,6 +26,9 @@ public class GWTDashBoardReport implements EntryPoint
public void onModuleLoad() public void onModuleLoad()
{ {
metadataname = Window.Location.getParameter("metadataname") == null ? "" : Window.Location.getParameter("metadataname"); metadataname = Window.Location.getParameter("metadataname") == null ? "" : Window.Location.getParameter("metadataname");
if (metadataname.trim().length() != 0)
{
parameterList.add(metadataname); parameterList.add(metadataname);
E12DashBoardPage.getJsonForFilterData(new Callback<JSONObject, String>() E12DashBoardPage.getJsonForFilterData(new Callback<JSONObject, String>()
{ {
...@@ -36,6 +43,10 @@ public class GWTDashBoardReport implements EntryPoint ...@@ -36,6 +43,10 @@ public class GWTDashBoardReport implements EntryPoint
Window.alert("Exception :: onModuleLoad() [" + result + "]"); Window.alert("Exception :: onModuleLoad() [" + result + "]");
} }
}, metadataname); }, metadataname);
} else
{
Window.alert("Please Enter Metadata name");
}
} }
public void getParameterList(JSONObject metaDataJsnObj) public void getParameterList(JSONObject metaDataJsnObj)
...@@ -71,8 +82,48 @@ public class GWTDashBoardReport implements EntryPoint ...@@ -71,8 +82,48 @@ public class GWTDashBoardReport implements EntryPoint
{ {
parameterList.add(Window.Location.getParameter("metadataname")); 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); RootPanel.get("filterDiv").add(e12DashBoardPage);
} }
public String getDefaultView(JSONObject metaDataJsnObj)
{
String xmlMetadata = null;
Document document = null;
NodeList rootNodeList = null;
Node rootNode = null;
String defaultView = "";
String id = "";
try
{
xmlMetadata = metaDataJsnObj.get("metaData").toString();
xmlMetadata = metaDataJsnObj.get("metaData").toString().replace("\\", "").trim();
xmlMetadata = xmlMetadata.replace('"', ' ').trim();
document = XMLParser.parse(xmlMetadata);
XMLParser.removeWhitespace(document);
if (document != null)
{
rootNodeList = document.getElementsByTagName("Root").item(0).getChildNodes();
for (int rootCtr = 0; rootCtr < rootNodeList.getLength(); rootCtr++)
{
rootNode = rootNodeList.item(rootCtr);
if ("view".equals(rootNode.getNodeName()))
{
id = rootNode.getAttributes().getNamedItem("id").getNodeValue();
if (id.equalsIgnoreCase("1"))
{
defaultView = rootNode.getAttributes().getNamedItem("name").getNodeValue();
break;
}
}
}
}
} catch (Exception e)
{
Window.alert("Exception in Class GWTDashBoardReport:()getDefaultView" + e.getMessage());
}
return defaultView;
}
} }
...@@ -64,7 +64,7 @@ public class GraphComponent extends Composite ...@@ -64,7 +64,7 @@ public class GraphComponent extends Composite
} }
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public void buildChart(final LinkedHashMap<String, JSONObject> dataMap) public void buildChart(final LinkedHashMap<String, JSONObject> dataMap)
{ {
JSONObject jsonObjFrGraph = null; JSONObject jsonObjFrGraph = null;
String height = null; String height = null;
String width = null; String width = null;
...@@ -166,10 +166,10 @@ public class GraphComponent extends Composite ...@@ -166,10 +166,10 @@ public class GraphComponent extends Composite
/*Button pdFBtn = new Button("Export To PDF"); /*Button pdFBtn = new Button("Export To PDF");
pdFBtn.setTitle("PDF"); pdFBtn.setTitle("PDF");
horizontalPnl.add(ibase.client.tabletoexcel.TableToExcelClientBuilder.fromTable(flexTable).withWidget(pdFBtn).buildExportFormWidget());*/ horizontalPnl.add(ibase.client.tabletoexcel.TableToExcelClientBuilder.fromTable(flexTable).withWidget(pdFBtn).buildExportFormWidget());*/
horizontalPnl.add(ibase.client.tabletoexcel.TableToExcelClientBuilder.fromTable(flexTable).withWidget(excelBtn).buildExportFormWidget()); //horizontalPnl.add(ibase.client.tabletoexcel.TableToExcelClientBuilder.fromTable(flexTable).withWidget(excelBtn).buildExportFormWidget());
//End Block for Export to excel and PDF formate //End Block for Export to excel and PDF formate
RootPanel.get("chartContainer"+componentId).add(flexTable); RootPanel.get("chartContainer"+componentId).add(flexTable);
RootPanel.get("chartContainer"+componentId).add(horizontalPnl); //RootPanel.get("chartContainer"+componentId).add(horizontalPnl);
} }
} }
} }
...@@ -187,6 +187,7 @@ public class GraphComponent extends Composite ...@@ -187,6 +187,7 @@ public class GraphComponent extends Composite
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public void getData(final Callback<JSONObject, String> callback, ArrayList<String> parameterList) public void getData(final Callback<JSONObject, String> callback, ArrayList<String> parameterList)
{ {
this.parameterList=parameterList;
String viewOptionSelectd = parameterList.get(parameterList.size()-1); String viewOptionSelectd = parameterList.get(parameterList.size()-1);
MetaDataDtl dataDtl = new MetaDataDtl(); MetaDataDtl dataDtl = new MetaDataDtl();
ArrayList<FilterInfo> filterList = new ArrayList<FilterInfo>(); ArrayList<FilterInfo> filterList = new ArrayList<FilterInfo>();
...@@ -197,10 +198,9 @@ public class GraphComponent extends Composite ...@@ -197,10 +198,9 @@ public class GraphComponent extends Composite
public void getDataMap(final LinkedHashMap<String, ArrayList<String>> datsSourceDtlMap) public void getDataMap(final LinkedHashMap<String, ArrayList<String>> datsSourceDtlMap)
{ {
int count=0; final LinkedHashMap<String, JSONObject> componentDataMap = new LinkedHashMap<String, JSONObject>();
for (Map.Entry<String, ArrayList<String>> entry : datsSourceDtlMap.entrySet()) for (Map.Entry<String, ArrayList<String>> entry : datsSourceDtlMap.entrySet())
{ {
count++;
final String key = entry.getKey(); final String key = entry.getKey();
List<String> values = entry.getValue(); List<String> values = entry.getValue();
String dbDataSource = values.get(0); String dbDataSource = values.get(0);
...@@ -259,7 +259,10 @@ public class GraphComponent extends Composite ...@@ -259,7 +259,10 @@ public class GraphComponent extends Composite
{ {
objActionPath = "/ibase/" + servletname + "?salesperson=" + parameterList.get(1) + "&month=" + parameterList.get(2) + "&year=" + parameterList.get(3) + "&dataSourceName=" + dbDataSource + "&reportName="+page; objActionPath = "/ibase/" + servletname + "?salesperson=" + parameterList.get(1) + "&month=" + parameterList.get(2) + "&year=" + parameterList.get(3) + "&dataSourceName=" + dbDataSource + "&reportName="+page;
} }
else if (page.equals("customerinfo"))
{
objActionPath = "/ibase/" + servletname + "?custCode=" + parameterList.get(1) + "&prdCode=" + parameterList.get(2) + "&dataSourceName=" + dbDataSource+"&reportName="+page;
}
//end Add dashboard mapping for OTC dashboard on dated 15-oct-2004 //end Add dashboard mapping for OTC dashboard on dated 15-oct-2004
...@@ -278,10 +281,10 @@ public class GraphComponent extends Composite ...@@ -278,10 +281,10 @@ public class GraphComponent extends Composite
JSONObject servletJsnObj = (JSONObject) JSONParser.parseStrict(response.getText()); JSONObject servletJsnObj = (JSONObject) JSONParser.parseStrict(response.getText());
JSONObject jsonObjData = new JSONObject(); JSONObject jsonObjData = new JSONObject();
jsonObjData.put(key, servletJsnObj); jsonObjData.put(key, servletJsnObj);
dataMap.put(key, jsonObjData); componentDataMap.put(key, jsonObjData);
if (dataMap.size() == datsSourceDtlMap.size()) if (componentDataMap.size() == datsSourceDtlMap.size())
{ {
buildChart(dataMap); buildChart(componentDataMap);
} }
} }
} else } else
......
...@@ -59,6 +59,7 @@ public class MetaDataDtl ...@@ -59,6 +59,7 @@ public class MetaDataDtl
LinkedHashMap<String, ArrayList<String>> gridMeataDataMap = null; LinkedHashMap<String, ArrayList<String>> gridMeataDataMap = null;
LinkedHashMap<String, ArrayList<String>> gridNameDataMap = null; LinkedHashMap<String, ArrayList<String>> gridNameDataMap = null;
LinkedHashMap<String, String> gridSizeDataMap = null; LinkedHashMap<String, String> gridSizeDataMap = null;
LinkedHashMap<String, String> gridCaptionDataMap = null;
LinkedHashMap<String, String> gridAlignDataMap = null; LinkedHashMap<String, String> gridAlignDataMap = null;
LinkedHashMap<String, String> typeGridMap= null; LinkedHashMap<String, String> typeGridMap= null;
LinkedHashMap<String, String> typeGraphMap= null; LinkedHashMap<String, String> typeGraphMap= null;
...@@ -108,6 +109,7 @@ public class MetaDataDtl ...@@ -108,6 +109,7 @@ public class MetaDataDtl
gridMeataDataMap = new LinkedHashMap<String, ArrayList<String>>(); gridMeataDataMap = new LinkedHashMap<String, ArrayList<String>>();
gridNameDataMap = new LinkedHashMap<String, ArrayList<String>>(); gridNameDataMap = new LinkedHashMap<String, ArrayList<String>>();
gridSizeDataMap = new LinkedHashMap<String, String>(); gridSizeDataMap = new LinkedHashMap<String, String>();
gridCaptionDataMap= new LinkedHashMap<String, String>();
gridAlignDataMap = new LinkedHashMap<String, String>(); gridAlignDataMap = new LinkedHashMap<String, String>();
divIdGrpMap= new LinkedHashMap<String, String>(); divIdGrpMap= new LinkedHashMap<String, String>();
componentTypeMap = new LinkedHashMap<String, String>(); componentTypeMap = new LinkedHashMap<String, String>();
...@@ -141,22 +143,25 @@ public class MetaDataDtl ...@@ -141,22 +143,25 @@ public class MetaDataDtl
if ("view".equals(rootNode.getNodeName())) if ("view".equals(rootNode.getNodeName()))
{ {
viewNodeList = rootNode.getChildNodes(); viewNodeList = rootNode.getChildNodes();
if(viewOptionSelectd.equals(rootNode.getAttributes().getNamedItem("name").getNodeValue())) if(!viewOptionSelectd.equals(rootNode.getAttributes().getNamedItem("name").getNodeValue()))
{
}
if( viewOptionSelectd !=null && viewOptionSelectd.equals(rootNode.getAttributes().getNamedItem("name").getNodeValue()))
{ {
for (int viewCtr = 0; viewCtr < viewNodeList.getLength(); viewCtr++) for (int viewCtr = 0; viewCtr < viewNodeList.getLength(); viewCtr++)
{ {
viewNode = viewNodeList.item(viewCtr); viewNode = viewNodeList.item(viewCtr);
if ("grid".equals(viewNode.getNodeName())) if ("grid".equals(viewNode.getNodeName()))
{ {
gridNameDataMap=new LinkedHashMap<String, ArrayList<String>>();
gridNameDataMap=new LinkedHashMap<String, ArrayList<String>>();
gridMeataDataMap=new LinkedHashMap<String, ArrayList<String>>(); gridMeataDataMap=new LinkedHashMap<String, ArrayList<String>>();
gridSizeDataMap=new LinkedHashMap<String, String>(); gridSizeDataMap=new LinkedHashMap<String, String>();
gridCaptionDataMap=new LinkedHashMap<String, String>();
gridAlignDataMap=new LinkedHashMap<String, String>(); gridAlignDataMap=new LinkedHashMap<String, String>();
typeGridMap = new LinkedHashMap<String, String>(); typeGridMap = new LinkedHashMap<String, String>();
gridDataSourceMap= new LinkedHashMap<String, String>(); gridDataSourceMap= new LinkedHashMap<String, String>();
gridCompTypeMap = new LinkedHashMap<String, String>(); gridCompTypeMap = new LinkedHashMap<String, String>();
graphID = viewNode.getAttributes().getNamedItem("id").getNodeValue(); graphID = viewNode.getAttributes().getNamedItem("id").getNodeValue();
dataSource = viewNode.getAttributes().getNamedItem("datasource").getNodeValue(); dataSource = viewNode.getAttributes().getNamedItem("datasource").getNodeValue();
type= viewNode.getAttributes().getNamedItem("type").getNodeValue(); type= viewNode.getAttributes().getNamedItem("type").getNodeValue();
...@@ -164,13 +169,20 @@ public class MetaDataDtl ...@@ -164,13 +169,20 @@ public class MetaDataDtl
typeGridMap.put("type"+graphID, type); typeGridMap.put("type"+graphID, type);
gridNodeList = viewNode.getChildNodes(); gridNodeList = viewNode.getChildNodes();
String componentType = ""; String componentType = "";
String componentCaption="";
for (int gridCtr = 0; gridCtr < gridNodeList.getLength(); gridCtr++) for (int gridCtr = 0; gridCtr < gridNodeList.getLength(); gridCtr++)
{ {
columnGrpNode = gridNodeList.item(gridCtr); columnGrpNode = gridNodeList.item(gridCtr);
if (columnGrpNode.getNodeName().equals("component_type")) if (columnGrpNode.getNodeName().equals("component_type"))
{ {
componentType = columnGrpNode.getChildNodes().item(0).getNodeValue(); componentType = columnGrpNode.getChildNodes().item(0).getNodeValue();
} else }
else if (columnGrpNode.getNodeName().equals("component_caption"))
{
componentCaption = columnGrpNode.getChildNodes().item(0).getNodeValue();
}
else
{ {
columnGrpId = columnGrpNode.getAttributes().getNamedItem("id").getNodeValue(); columnGrpId = columnGrpNode.getAttributes().getNamedItem("id").getNodeValue();
columnGrpNodeList = columnGrpNode.getChildNodes(); columnGrpNodeList = columnGrpNode.getChildNodes();
...@@ -213,18 +225,20 @@ public class MetaDataDtl ...@@ -213,18 +225,20 @@ public class MetaDataDtl
gridAlignDataMap.put(title, columnAlign); gridAlignDataMap.put(title, columnAlign);
} }
} }
gridCaptionDataMap.put("componentCaption"+graphID,componentCaption );
gridCompTypeMap.put("buildComponent"+graphID, componentType); gridCompTypeMap.put("buildComponent"+graphID, componentType);
gridNGraphMeataDataMap.put("componentType"+graphID, gridCompTypeMap); gridNGraphMeataDataMap.put("componentType"+graphID, gridCompTypeMap);
gridNGraphMeataDataMap.put(graphID, gridMeataDataMap); gridNGraphMeataDataMap.put(graphID, gridMeataDataMap);
gridNGraphMeataDataMap.put("columnName"+graphID, gridNameDataMap); gridNGraphMeataDataMap.put("columnName"+graphID, gridNameDataMap);
gridNGraphMeataDataMap.put("columnSize"+graphID, gridSizeDataMap); gridNGraphMeataDataMap.put("columnSize"+graphID, gridSizeDataMap);
gridNGraphMeataDataMap.put("componentCaption"+graphID, gridCaptionDataMap);
gridNGraphMeataDataMap.put("columnAlign"+graphID, gridAlignDataMap); gridNGraphMeataDataMap.put("columnAlign"+graphID, gridAlignDataMap);
gridNGraphMeataDataMap.put("type"+graphID, typeGridMap); gridNGraphMeataDataMap.put("type"+graphID, typeGridMap);
gridNGraphMeataDataMap.put("datasource"+graphID, gridDataSourceMap); gridNGraphMeataDataMap.put("datasource"+graphID, gridDataSourceMap);
columnIDList.clear();
columnNameList.clear();
} }
if ("graph".equals(viewNode.getNodeName())) if ("graph".equals(viewNode.getNodeName()))
{ {
...@@ -328,7 +342,7 @@ public class MetaDataDtl ...@@ -328,7 +342,7 @@ public class MetaDataDtl
} }
if (flag.equals("false")) if (flag.equals("false"))
{ {
metaDataMap.put(new JSONString("lineAlpha"), new JSONString("1")); //metaDataMap.put(new JSONString("lineAlpha"), new JSONString("1"));
metaDataMap.put(new JSONString("anchorBorderThickness"), new JSONString("3")); metaDataMap.put(new JSONString("anchorBorderThickness"), new JSONString("3"));
} }
} }
...@@ -547,6 +561,7 @@ public class MetaDataDtl ...@@ -547,6 +561,7 @@ public class MetaDataDtl
public ArrayList<String> getTitle(JSONObject jsonObjMetadata) public ArrayList<String> getTitle(JSONObject jsonObjMetadata)
{ {
Document document = null; Document document = null;
String xmlMetadata = null; String xmlMetadata = null;
Node rootNode = null; Node rootNode = null;
......
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