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>();
...@@ -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);
...@@ -201,10 +202,10 @@ public class ChartCreator ...@@ -201,10 +202,10 @@ 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);
pager.setRangeText(rangeText);
displayPager.setDisplay(this);
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
......
...@@ -18,7 +18,6 @@ import com.google.gwt.user.client.Window; ...@@ -18,7 +18,6 @@ import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.CheckBox; import com.google.gwt.user.client.ui.CheckBox;
import com.google.gwt.user.client.ui.Composite; import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.FlexTable; import com.google.gwt.user.client.ui.FlexTable;
import com.google.gwt.user.client.ui.HTMLPanel;
import com.google.gwt.user.client.ui.HasHorizontalAlignment; import com.google.gwt.user.client.ui.HasHorizontalAlignment;
import com.google.gwt.user.client.ui.HasVerticalAlignment; import com.google.gwt.user.client.ui.HasVerticalAlignment;
import com.google.gwt.user.client.ui.HorizontalPanel; import com.google.gwt.user.client.ui.HorizontalPanel;
...@@ -48,15 +47,17 @@ public class FilterCreator extends Composite ...@@ -48,15 +47,17 @@ public class FilterCreator extends Composite
final HorizontalPanel buttonPanle = new HorizontalPanel(); final HorizontalPanel buttonPanle = new HorizontalPanel();
Image HeadingLableImg = new Image("FusionChart/images/menu_button.png"); Image HeadingLableImg = new Image("FusionChart/images/menu_button.png");
Image openButton = new Image("FusionChart/images/analysis_scope.png"); Image openButton = new Image("FusionChart/images/analysis_scope.png");
String selectedView = "";
String xmlName = ""; String xmlName = "";
public JSONObject metaDataJsnObj = null; public JSONObject metaDataJsnObj = null;
boolean isParameterPrsnt = false; boolean isParameterPrsnt = false;
Label label = null; Label label = null;
ArrayList<String> title = new ArrayList<String>(); ArrayList<String> title = new ArrayList<String>();
ArrayList<String> parameterList = null;
HorizontalPanel headingLableImgPanel = new HorizontalPanel();
public FilterCreator(ArrayList<String> parameterList, JSONObject metaDataJsnObj) public FilterCreator(ArrayList<String> parameterList, JSONObject metaDataJsnObj)
{ {
this.parameterList = parameterList;
xmlName = parameterList.get(0); xmlName = parameterList.get(0);
label = new Label(); label = new Label();
title = new MetaDataDtl().getTitle(metaDataJsnObj); title = new MetaDataDtl().getTitle(metaDataJsnObj);
...@@ -65,21 +66,18 @@ public class FilterCreator extends Composite ...@@ -65,21 +66,18 @@ public class FilterCreator extends Composite
label.setText(title.get(0) + " " + getMonth(parameterList.get(1)) + title.get(1) + getMonth(parameterList.get(2))); label.setText(title.get(0) + " " + getMonth(parameterList.get(1)) + title.get(1) + getMonth(parameterList.get(2)));
} else } else
{ {
//this will depend on client requirement OTC //label.setText(title.get(0) + parameterList.get(2) + "-" + parameterList.get(3));
label.setText(title.get(0) + parameterList.get(2) +"-"+parameterList.get(3)); label.setText(title.get(0) + parameterList.get(1)) ;//+ "-" + parameterList.get(2));
} }
HorizontalPanel headingLableImgPanel = new HorizontalPanel();
HeadingLableImg.setStyleName("filterImage"); HeadingLableImg.setStyleName("filterImage");
// headingLableImgPanel.add(HeadingLableImg); headingLableImgPanel.add(getViewFilter(parameterList, metaDataJsnObj));
headingLableImgPanel.add(getViewFilter(parameterList,metaDataJsnObj));
//CustomGrid cg = new CustomGrid(10);
//headingLableImgPanel.add(cg.showOptionMenu(1));
headingLableImgPanel.add(label); headingLableImgPanel.add(label);
lablePanle.add(headingLableImgPanel); lablePanle.add(headingLableImgPanel);
label.getElement().setId("titleLbl"); label.getElement().setId("titleLbl");
lablePanle.setStylePrimaryName("lablePanleCSS"); lablePanle.setStylePrimaryName("lablePanleCSS");
lablePanle.setCellHorizontalAlignment(label, HasHorizontalAlignment.ALIGN_LEFT); lablePanle.setCellHorizontalAlignment(label, HasHorizontalAlignment.ALIGN_LEFT);
//openButton.setHeight("35px");
openButton.setStyleName("filterImage"); openButton.setStyleName("filterImage");
buttonPanle.add(openButton); buttonPanle.add(openButton);
buttonPanle.setCellHorizontalAlignment(openButton, HasHorizontalAlignment.ALIGN_RIGHT); buttonPanle.setCellHorizontalAlignment(openButton, HasHorizontalAlignment.ALIGN_RIGHT);
...@@ -94,6 +92,8 @@ public class FilterCreator extends Composite ...@@ -94,6 +92,8 @@ public class FilterCreator extends Composite
this.metaDataJsnObj = metaDataJsnObj; this.metaDataJsnObj = metaDataJsnObj;
openButton.addClickHandler(new FilterBtnActionHandler()); openButton.addClickHandler(new FilterBtnActionHandler());
initWidget(vPanel); initWidget(vPanel);
selectedView = parameterList.get(parameterList.size() - 1);
setParameterList(parameterList);
for (int i = 1; i < parameterList.size(); i++) for (int i = 1; i < parameterList.size(); i++)
{ {
...@@ -102,36 +102,31 @@ public class FilterCreator extends Composite ...@@ -102,36 +102,31 @@ public class FilterCreator extends Composite
isParameterPrsnt = true; isParameterPrsnt = true;
} }
} }
if (isParameterPrsnt) if (isParameterPrsnt)
{ {
getMetaDataForFltr(parameterList); getMetaDataForFltr(parameterList);
} }
} }
public void getMetaDataForFltr(final ArrayList<String> parameterList) public ArrayList<String> getParameterList()
{ {
final ArrayList<FilterInfo> filterList = new MetaDataDtl().getFilters(metaDataJsnObj); return parameterList;
//final E12PopupPanel mainPopupPnl = new E12PopupPanel(true); }
final PopupPanel mainPopupPnl=new PopupPanel(true);
/*final DialogBox mainPopupPnl=new DialogBox(true); public void setParameterList(ArrayList<String> parameterList)
mainPopupPnl.setText("Application"); {
*/ this.parameterList = parameterList;
}
public void getMetaDataForFltr(final ArrayList<String> parameterList)
{
final ArrayList<FilterInfo> filterList = new MetaDataDtl().getFilters(metaDataJsnObj);
final PopupPanel mainPopupPnl = new PopupPanel(true);
VerticalPanel homePgFltrPopupVPnl = new VerticalPanel(); VerticalPanel homePgFltrPopupVPnl = new VerticalPanel();
HorizontalPanel finishCancelBtnsHPnl = new HorizontalPanel(); HorizontalPanel finishCancelBtnsHPnl = new HorizontalPanel();
Label headinglable = new Label("Analysis Scope"); Label headinglable = new Label("Analysis Scope");
Image analysisImage = new Image("FusionChart/images/analysis_scope.png"); Image analysisImage = new Image("FusionChart/images/analysis_scope.png");
/*Button cancelBtn = new Button("Cancel");
Button finishBtn = new Button("Finish");*/
Image finishimage = new Image("FusionChart/images/check.png"); Image finishimage = new Image("FusionChart/images/check.png");
Image cancelimage = new Image("FusionChart/images/close.png"); Image cancelimage = new Image("FusionChart/images/close.png");
...@@ -142,8 +137,14 @@ public class FilterCreator extends Composite ...@@ -142,8 +137,14 @@ public class FilterCreator extends Composite
int noOfFiltr = 0; int noOfFiltr = 0;
Label columnNameLbl = null; Label columnNameLbl = null;
popUpHPnl.setSpacing(5); popUpHPnl.setSpacing(5);
if(parameterList.size()<=4)
{
homePgFltrPopupVPnl.setStylePrimaryName("fltrPopupVPnlWidthFixed");
}
else
{
homePgFltrPopupVPnl.setStylePrimaryName("fltrPopupVPnl"); homePgFltrPopupVPnl.setStylePrimaryName("fltrPopupVPnl");
}
for (int scrlPnlCnt = 0; scrlPnlCnt < popUpHPnl.getWidgetCount(); scrlPnlCnt++) for (int scrlPnlCnt = 0; scrlPnlCnt < popUpHPnl.getWidgetCount(); scrlPnlCnt++)
{ {
if (!(popUpHPnl.getWidget(scrlPnlCnt) instanceof Label)) if (!(popUpHPnl.getWidget(scrlPnlCnt) instanceof Label))
...@@ -170,17 +171,15 @@ public class FilterCreator extends Composite ...@@ -170,17 +171,15 @@ public class FilterCreator extends Composite
} }
if (filterInfo.filterType.equals("1")) if (filterInfo.filterType.equals("1"))
{ {
/*columnNameLbl = new Label();
columnNameLbl.setText(filterInfo.getColName());*/
inputTxtBox = new TextBox(); inputTxtBox = new TextBox();
inputTxtBox.setTitle(filterInfo.getColName()); inputTxtBox.setTitle(filterInfo.getColName());
inputTxtBox.setStylePrimaryName("textBoxCss"); inputTxtBox.setStylePrimaryName("textBoxCss");
VerticalPanel outerVPanel = new VerticalPanel(); VerticalPanel outerVPanel = new VerticalPanel();
/*outerVPanel.setHeight("200px");*/ /* outerVPanel.setHeight("200px"); */
HorizontalPanel Hpanel = new HorizontalPanel(); HorizontalPanel Hpanel = new HorizontalPanel();
VerticalPanel Vpanel = new VerticalPanel(); VerticalPanel Vpanel = new VerticalPanel();
columnNameLbl = new Label(""+filterInfo.getColName()); columnNameLbl = new Label("" + filterInfo.getColName());
Vpanel.add(columnNameLbl); Vpanel.add(columnNameLbl);
columnNameLbl.setStyleName("filterHeaderLabel"); columnNameLbl.setStyleName("filterHeaderLabel");
Vpanel.setStyleName("filterHeaderPanel"); Vpanel.setStyleName("filterHeaderPanel");
...@@ -188,7 +187,6 @@ public class FilterCreator extends Composite ...@@ -188,7 +187,6 @@ public class FilterCreator extends Composite
outerVPanel.add(Vpanel); outerVPanel.add(Vpanel);
outerVPanel.add(Hpanel); outerVPanel.add(Hpanel);
if (fltrParmtrArray != null) if (fltrParmtrArray != null)
{ {
for (int arrayCnt = 0; arrayCnt < fltrParmtrArray.length; arrayCnt++) for (int arrayCnt = 0; arrayCnt < fltrParmtrArray.length; arrayCnt++)
...@@ -196,8 +194,9 @@ public class FilterCreator extends Composite ...@@ -196,8 +194,9 @@ public class FilterCreator extends Composite
inputTxtBox.setText(fltrParmtrArray[arrayCnt]); inputTxtBox.setText(fltrParmtrArray[arrayCnt]);
} }
} }
/*popUpHPnl.add(columnNameLbl); /*
popUpHPnl.add(inputTxtBox);*/ * popUpHPnl.add(columnNameLbl); popUpHPnl.add(inputTxtBox);
*/
popUpHPnl.add(outerVPanel); popUpHPnl.add(outerVPanel);
} }
if (filterInfo.filterType.equals("2")) if (filterInfo.filterType.equals("2"))
...@@ -210,8 +209,6 @@ public class FilterCreator extends Composite ...@@ -210,8 +209,6 @@ public class FilterCreator extends Composite
} }
} }
} }
/*cancelBtn.setStylePrimaryName("button red-Btn");
finishBtn.setStylePrimaryName("button green-Btn");*/
headinglable.setStyleName("filterDivHeadingName"); //Dhanendra 12-09-2014 headinglable.setStyleName("filterDivHeadingName"); //Dhanendra 12-09-2014
HorizontalPanel analysispanel = new HorizontalPanel(); HorizontalPanel analysispanel = new HorizontalPanel();
...@@ -224,15 +221,8 @@ public class FilterCreator extends Composite ...@@ -224,15 +221,8 @@ public class FilterCreator extends Composite
finishCancelBtnsHPnl.add(analysispanel); finishCancelBtnsHPnl.add(analysispanel);
HorizontalPanel hpanelforbutton = new HorizontalPanel(); HorizontalPanel hpanelforbutton = new HorizontalPanel();
/*hpanelforbutton.add(finishBtn);
hpanelforbutton.add(cancelBtn);*/
/*finishCancelBtnsHPnl.setCellHorizontalAlignment(finishimage, HasHorizontalAlignment.ALIGN_CENTER);
finishCancelBtnsHPnl.setCellHorizontalAlignment(cancelimage, HasHorizontalAlignment.ALIGN_CENTER);*/
hpanelforbutton.getElement().setAttribute("align", "right"); hpanelforbutton.getElement().setAttribute("align", "right");
finishimage.setHeight("25px"); finishimage.setHeight("25px");
cancelimage.setHeight("25px"); cancelimage.setHeight("25px");
...@@ -243,18 +233,7 @@ public class FilterCreator extends Composite ...@@ -243,18 +233,7 @@ public class FilterCreator extends Composite
finishCancelBtnsHPnl.add(hpanelforbutton); finishCancelBtnsHPnl.add(hpanelforbutton);
/*finishCancelBtnsHPnl.add(finishBtn);
finishCancelBtnsHPnl.add(cancelBtn);*/
/*finishCancelBtnsHPnl.setCellHorizontalAlignment(finishBtn, HasHorizontalAlignment.ALIGN_RIGHT);
finishCancelBtnsHPnl.setCellHorizontalAlignment(cancelBtn, HasHorizontalAlignment.ALIGN_RIGHT);*/
//finishCancelBtnsHPnl.setCellVerticalAlignment(cancelBtn, HasVerticalAlignment.ALIGN_MIDDLE);
finishCancelBtnsHPnl.setStyleName("filterdivHeading"); finishCancelBtnsHPnl.setStyleName("filterdivHeading");
/*finishCancelBtnsHPnl.add(finishBtn);
finishCancelBtnsHPnl.setCellHorizontalAlignment(finishBtn, HasHorizontalAlignment.ALIGN_LEFT);
finishCancelBtnsHPnl.setCellVerticalAlignment(finishBtn, HasVerticalAlignment.ALIGN_MIDDLE);*/
finishCancelBtnsHPnl.setSpacing(2); finishCancelBtnsHPnl.setSpacing(2);
homePgFltrPopupVPnl.add(finishCancelBtnsHPnl); homePgFltrPopupVPnl.add(finishCancelBtnsHPnl);
homePgFltrPopupVPnl.add(popUpHPnl); homePgFltrPopupVPnl.add(popUpHPnl);
...@@ -264,8 +243,6 @@ public class FilterCreator extends Composite ...@@ -264,8 +243,6 @@ public class FilterCreator extends Composite
mainPopupPnl.add(homePgFltrPopupVPnl); mainPopupPnl.add(homePgFltrPopupVPnl);
mainPopupPnl.show(); mainPopupPnl.show();
//cancelBtn.addClickHandler(new ClickHandler()
cancelimage.addClickHandler(new ClickHandler() cancelimage.addClickHandler(new ClickHandler()
{ {
@Override @Override
...@@ -291,38 +268,22 @@ public class FilterCreator extends Composite ...@@ -291,38 +268,22 @@ public class FilterCreator extends Composite
FilterInfo fltrInfo = null; FilterInfo fltrInfo = null;
String colName = ""; String colName = "";
popUpSendDtatList.add(xmlName); popUpSendDtatList.add(xmlName);
//Window.alert("Filter List Size= "+filterList.size());
//Window.alert("popUpHPnl.getWidgetCount()==== "+popUpHPnl.getWidgetCount());
for (int i = 0; i < filterList.size(); i++) for (int i = 0; i < filterList.size(); i++)
{ {
fltrInfo = filterList.get(i); fltrInfo = filterList.get(i);
colName = fltrInfo.getColName(); colName = fltrInfo.getColName();
//Window.alert("colName===: "+colName);
for (int scrlPnlCnt = 0; scrlPnlCnt < popUpHPnl.getWidgetCount(); scrlPnlCnt++) for (int scrlPnlCnt = 0; scrlPnlCnt < popUpHPnl.getWidgetCount(); scrlPnlCnt++)
{ {
if (popUpHPnl.getWidget(scrlPnlCnt) instanceof VerticalPanel) if (popUpHPnl.getWidget(scrlPnlCnt) instanceof VerticalPanel)
{ {
//Window.alert("In VerticalPanel"); VerticalPanel verticalPanel = (VerticalPanel) popUpHPnl.getWidget(scrlPnlCnt);
VerticalPanel verticalPanel=(VerticalPanel)popUpHPnl.getWidget(scrlPnlCnt); if (verticalPanel.getWidget(1) instanceof HorizontalPanel)
//Window.alert("VerticalPanel===: "+verticalPanel.getTitle());
if(verticalPanel.getWidget(1) instanceof HorizontalPanel)
{ {
//Window.alert("In HorizontalPanel"); HorizontalPanel horizontalPanel = (HorizontalPanel) verticalPanel.getWidget(1);
//Window.alert("=verticalPanel.getWidgetCount()="+verticalPanel.getWidgetCount()); if (horizontalPanel.getWidget(0) instanceof ScrollPanel)
HorizontalPanel horizontalPanel=(HorizontalPanel)verticalPanel.getWidget(1);
//Window.alert("horizontalPanel.getWidget(0)===="+horizontalPanel);
//Window.alert("HorizontalPanel===: "+horizontalPanel.getTitle());
if(horizontalPanel.getWidget(0) instanceof ScrollPanel)
{ {
//Window.alert("In scrollPanel");
scrollPnl = (ScrollPanel) horizontalPanel.getWidget(0); scrollPnl = (ScrollPanel) horizontalPanel.getWidget(0);
//Window.alert("scrollPnl.getTitle()======="+scrollPnl.getTitle());
//Window.alert("List==: "+scrollPnl);
StringBuffer selectedChkBoxBuffer = new StringBuffer(); StringBuffer selectedChkBoxBuffer = new StringBuffer();
// add here 21 july14
grid = (FlexTable) scrollPnl.getWidget(); grid = (FlexTable) scrollPnl.getWidget();
row = grid.getRowCount(); row = grid.getRowCount();
for (int rowCnt = 1; rowCnt < row; rowCnt++) for (int rowCnt = 1; rowCnt < row; rowCnt++)
...@@ -332,29 +293,21 @@ public class FilterCreator extends Composite ...@@ -332,29 +293,21 @@ public class FilterCreator extends Composite
{ {
if (selectedChkBoxBuffer.length() != 0) if (selectedChkBoxBuffer.length() != 0)
{ {
selectedChkBoxBuffer.append(", " + grid.getText(rowCnt, 1)); selectedChkBoxBuffer.append("," + grid.getText(rowCnt, 1).trim());
} else } else
{ {
selectedChkBoxBuffer.append(grid.getText(rowCnt, 1)); selectedChkBoxBuffer.append(grid.getText(rowCnt, 1).trim());
} }
//Window.alert("selectedChkBoxBuffer.toString(Value)["+selectedChkBoxBuffer.toString()+"]");
} }
} }
//Window.alert("colName["+colName +"], scrollPnlName["+scrollPnl.getTitle()+"]");
if (scrollPnl.getTitle().equals(colName)) if (scrollPnl.getTitle().equals(colName))
{ {
popUpSendDtatList.add(selectedChkBoxBuffer.toString()); popUpSendDtatList.add(selectedChkBoxBuffer.toString());
//Window.alert("popUpSendDtatList["+popUpSendDtatList+"]");
} }
} else if (horizontalPanel.getWidget(0) instanceof TextBox)
}
else if(horizontalPanel.getWidget(0) instanceof TextBox)
{ {
//Window.alert("In TextBox");
fltrTxtBox = (TextBox) horizontalPanel.getWidget(0); fltrTxtBox = (TextBox) horizontalPanel.getWidget(0);
//Window.alert("scrollPnl.getTitle()======="+fltrTxtBox.getTitle());
//Window.alert("colName["+colName +"], scrollPnlName["+fltrTxtBox.getTitle()+"]");
if (fltrTxtBox.getTitle().equals(colName)) if (fltrTxtBox.getTitle().equals(colName))
{ {
if (!fltrTxtBox.getText().isEmpty()) if (!fltrTxtBox.getText().isEmpty())
...@@ -365,7 +318,7 @@ public class FilterCreator extends Composite ...@@ -365,7 +318,7 @@ public class FilterCreator extends Composite
Window.alert(fltrInfo.getColName() + "Can't Be Empty"); Window.alert(fltrInfo.getColName() + "Can't Be Empty");
} }
} }
}else if (popUpHPnl.getWidget(scrlPnlCnt) instanceof SuggestBox) } else if (popUpHPnl.getWidget(scrlPnlCnt) instanceof SuggestBox)
{ {
suggestBox = (SuggestBox) popUpHPnl.getWidget(scrlPnlCnt); suggestBox = (SuggestBox) popUpHPnl.getWidget(scrlPnlCnt);
...@@ -385,15 +338,15 @@ public class FilterCreator extends Composite ...@@ -385,15 +338,15 @@ public class FilterCreator extends Composite
} }
} }
mainPopupPnl.hide(); mainPopupPnl.hide();
if (title.size() > 1) /*if (title.size() > 1)
{ {
label.setText(title.get(0) + " " + getMonth(popUpSendDtatList.get(1)) + title.get(1) + getMonth(popUpSendDtatList.get(2))); label.setText(title.get(0) + " " + getMonth(popUpSendDtatList.get(1)) + title.get(1) + getMonth(popUpSendDtatList.get(2)));
} else } else
{ {
//this will depend on client requirement OTC label.setText(title.get(0) + popUpSendDtatList.get(2) + "-" + popUpSendDtatList.get(3));
label.setText(title.get(0) + popUpSendDtatList.get(2) +"-"+popUpSendDtatList.get(3)); }*/
} popUpSendDtatList.add(selectedView);
// label.setText(title+" "+getMonth(popUpSendDtatList.get(1))); setParameterList(popUpSendDtatList);
E12DashBoardPage.initaliseGraphNGrid(popUpSendDtatList); E12DashBoardPage.initaliseGraphNGrid(popUpSendDtatList);
} }
}); });
...@@ -401,9 +354,7 @@ public class FilterCreator extends Composite ...@@ -401,9 +354,7 @@ public class FilterCreator extends Composite
public void getPopHelpString(final HorizontalPanel popUpHPnl, final FilterInfo filterInfo, final String[] splitedArray) public void getPopHelpString(final HorizontalPanel popUpHPnl, final FilterInfo filterInfo, final String[] splitedArray)
{ {
String objActionPath = "/ibase/DashboardFilterServlet?FIELDNAME=" + filterInfo.getColNameId() + "&MODNAME=" + filterInfo.getColModuleName(); String objActionPath = "/ibase/DashboardFilterServlet?FIELDNAME=" + filterInfo.getColNameId() + "&MODNAME=" + filterInfo.getColModuleName();
try try
{ {
RequestBuilder reqBuilder = new RequestBuilder(RequestBuilder.POST, objActionPath); RequestBuilder reqBuilder = new RequestBuilder(RequestBuilder.POST, objActionPath);
...@@ -418,7 +369,7 @@ public class FilterCreator extends Composite ...@@ -418,7 +369,7 @@ public class FilterCreator extends Composite
outerVPanel.setHeight("200px"); outerVPanel.setHeight("200px");
HorizontalPanel Hpanel = new HorizontalPanel(); HorizontalPanel Hpanel = new HorizontalPanel();
VerticalPanel Vpanel = new VerticalPanel(); VerticalPanel Vpanel = new VerticalPanel();
Label labelTh = new Label(""+filterInfo.getColName()); Label labelTh = new Label("" + filterInfo.getColName());
Vpanel.add(labelTh); Vpanel.add(labelTh);
labelTh.setStyleName("filterHeaderLabel"); labelTh.setStyleName("filterHeaderLabel");
Vpanel.setStyleName("filterHeaderPanel"); Vpanel.setStyleName("filterHeaderPanel");
...@@ -433,8 +384,7 @@ public class FilterCreator extends Composite ...@@ -433,8 +384,7 @@ public class FilterCreator extends Composite
outerVPanel.setHeight("200px"); outerVPanel.setHeight("200px");
HorizontalPanel Hpanel = new HorizontalPanel(); HorizontalPanel Hpanel = new HorizontalPanel();
VerticalPanel Vpanel = new VerticalPanel(); VerticalPanel Vpanel = new VerticalPanel();
Label labelTh = new Label(""+filterInfo.getColName()); Label labelTh = new Label("" + filterInfo.getColName());
Vpanel.add(labelTh); Vpanel.add(labelTh);
labelTh.setStyleName("filterHeaderLabel"); labelTh.setStyleName("filterHeaderLabel");
Vpanel.setStyleName("filterHeaderPanel"); Vpanel.setStyleName("filterHeaderPanel");
...@@ -442,11 +392,9 @@ public class FilterCreator extends Composite ...@@ -442,11 +392,9 @@ public class FilterCreator extends Composite
outerVPanel.add(Vpanel); outerVPanel.add(Vpanel);
outerVPanel.add(Hpanel); outerVPanel.add(Hpanel);
popUpHPnl.add(outerVPanel); popUpHPnl.add(outerVPanel);
//popUpHPnl.add(popHelpGridRadioBtn(getPopUpDataMap(response.getText()), filterInfo, splitedArray)); //popUpHPnl.add(popHelpGridRadioBtn(getPopUpDataMap(response.getText()), filterInfo, splitedArray));
} }
} }
@Override @Override
public void onError(com.google.gwt.http.client.Request request, Throwable exception) public void onError(com.google.gwt.http.client.Request request, Throwable exception)
{ {
...@@ -546,7 +494,6 @@ public class FilterCreator extends Composite ...@@ -546,7 +494,6 @@ public class FilterCreator extends Composite
} else } else
{ {
flexTable.setText(0, 1, filterInfo.getColDescr()); flexTable.setText(0, 1, filterInfo.getColDescr());
//flexTable.setText(0, 2, filterInfo.getColName());
flexTable.setText(0, 2, "All"); flexTable.setText(0, 2, "All");
flexTable.getCellFormatter().addStyleName(0, 2, "flexTable-cell"); flexTable.getCellFormatter().addStyleName(0, 2, "flexTable-cell");
flexTable.getCellFormatter().setVisible(0, 1, false); flexTable.getCellFormatter().setVisible(0, 1, false);
...@@ -646,10 +593,6 @@ public class FilterCreator extends Composite ...@@ -646,10 +593,6 @@ public class FilterCreator extends Composite
//flexTable.setBorderWidth(1); //flexTable.setBorderWidth(1);
try try
{ {
/*flexTable.setText(0, 1, filterInfo.getColDescr());
flexTable.setText(0, 2, filterInfo.getColName());
flexTable.getCellFormatter().addStyleName(0, 2, "flexTable-cell");
flexTable.getCellFormatter().setVisible(0, 1, false);*/
for (Map.Entry<String, ArrayList<String>> entry : hashMap.entrySet()) for (Map.Entry<String, ArrayList<String>> entry : hashMap.entrySet())
{ {
row = entry.getKey(); row = entry.getKey();
...@@ -801,17 +744,16 @@ public class FilterCreator extends Composite ...@@ -801,17 +744,16 @@ public class FilterCreator extends Composite
return monthInChar; return monthInChar;
} }
@SuppressWarnings("serial") @SuppressWarnings("serial")
public ScrollPanel getViewFilter( final ArrayList<String> parameterList,JSONObject metaDataJsnObj) public ScrollPanel getViewFilter(final ArrayList<String> parameterList, JSONObject metaDataJsnObj)
{ {
final ScrollPanel viewPanel = new ScrollPanel(); final ScrollPanel viewPanel = new ScrollPanel();
String xmlMetadata = null; String xmlMetadata = null;
Document document = null; Document document = null;
NodeList rootNodeList = null; NodeList rootNodeList = null;
Node rootNode = null; Node rootNode = null;
NodeList viewNodeList = null; // NodeList viewNodeList = null;
Node viewNode = null; // Node viewNode = null;
// String view=null; // String view=null;
final String image = "<img align='top' src='FusionChart/images/menu_button.png' height='18px' width='25px'/>"; final String image = "<img align='top' src='FusionChart/images/menu_button.png' height='18px' width='25px'/>";
...@@ -829,8 +771,10 @@ public class FilterCreator extends Composite ...@@ -829,8 +771,10 @@ public class FilterCreator extends Composite
fileMenu.setStyleName("popupMenuBar"); fileMenu.setStyleName("popupMenuBar");
fileMenu.setAnimationEnabled(true); fileMenu.setAnimationEnabled(true);
menu.setStyleName("menuCSS"); menu.setStyleName("menuCSS");
SafeHtml addActivityImagePath = new SafeHtml() { SafeHtml addActivityImagePath = new SafeHtml()
public String asString() { {
public String asString()
{
return image; return image;
} }
}; };
...@@ -843,13 +787,15 @@ public class FilterCreator extends Composite ...@@ -843,13 +787,15 @@ public class FilterCreator extends Composite
if ("view".equals(rootNode.getNodeName())) if ("view".equals(rootNode.getNodeName()))
{ {
final String view = rootNode.getAttributes().getNamedItem("name").getNodeValue(); final String view = rootNode.getAttributes().getNamedItem("name").getNodeValue();
// final String view1 = view; MenuItem actionItem = new MenuItem(view, new Command()
MenuItem actionItem= new MenuItem( view, new Command()
{ {
public void execute() public void execute()
{ {
parameterList.add(view); ArrayList<String> selectedParamList = getParameterList();
E12DashBoardPage.initaliseGraphNGrid(parameterList); selectedView = view;
selectedParamList.remove(parameterList.size()-1);
selectedParamList.add(view);
E12DashBoardPage.initaliseGraphNGrid(selectedParamList);
} }
}); });
fileMenu.addItem(actionItem); fileMenu.addItem(actionItem);
...@@ -859,10 +805,8 @@ public class FilterCreator extends Composite ...@@ -859,10 +805,8 @@ public class FilterCreator extends Composite
menu.addItem(new MenuItem(addActivityImagePath, fileMenu)); menu.addItem(new MenuItem(addActivityImagePath, fileMenu));
viewPanel.add(menu); viewPanel.add(menu);
viewPanel.setStyleName("scrllPnlMenuBar"); viewPanel.setStyleName("scrllPnlMenuBar");
//contextMenuPanel.add(viewPanel);
}
} }
catch (Exception e) } catch (Exception e)
{ {
Window.alert("Exception in Class FilterCreator:getViewFilter():" + e.getMessage()); Window.alert("Exception in Class FilterCreator:getViewFilter():" + e.getMessage());
} }
......
...@@ -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;
}
} }
...@@ -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