Commit f0c31cb8 authored by sbade's avatar sbade

updated the java files.


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@96789 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 46e609a3
...@@ -100,7 +100,8 @@ public class CustomGrid extends AbstractDataGrid<DataGridTableRowModel> ...@@ -100,7 +100,8 @@ public class CustomGrid extends AbstractDataGrid<DataGridTableRowModel>
int count=0; int count=0;
for(int jRowCtr=0;jRowCtr<jsonObjData.size();jRowCtr++) for(int jRowCtr=0;jRowCtr<jsonObjData.size();jRowCtr++)
{ {
rowData = new HashMap<Integer, E12CustomTextCell.CellData> (); rowData = new HashMap<Integer, E12CustomTextCell.CellData> ();
for (String graphKey : graphDataMap.keySet()) for (String graphKey : graphDataMap.keySet())
{ {
graphDtlList = graphDataMap.get(graphKey); graphDtlList = graphDataMap.get(graphKey);
...@@ -249,16 +250,9 @@ public class CustomGrid extends AbstractDataGrid<DataGridTableRowModel> ...@@ -249,16 +250,9 @@ public class CustomGrid extends AbstractDataGrid<DataGridTableRowModel>
excelImg.setHeight("20px"); excelImg.setHeight("20px");
excelBtn.getElement().appendChild(excelImg.getElement()); excelBtn.getElement().appendChild(excelImg.getElement());
excelBtnPnl.add(ibase.client.tabletoexcel.TableToExcelClientBuilder.fromTable(flexTable).withWidget(excelBtn).buildExportFormWidget()); excelBtnPnl.add(ibase.client.tabletoexcel.TableToExcelClientBuilder.fromTable(flexTable).withWidget(excelBtn).buildExportFormWidget());
SimplePager.Resources displayPagerResources = GWT.create(SimplePager.Resources.class); SimplePager.Resources displayPagerResources = GWT.create(SimplePager.Resources.class);
final SimplePager displayPager = new SimplePager(SimplePager.TextLocation.CENTER, displayPagerResources, false, 0 , true, excelBtnPnl); final SimplePager displayPager = new SimplePager(SimplePager.TextLocation.CENTER, displayPagerResources, false, 0 , true, excelBtnPnl);
displayPager.setDisplay(this); displayPager.setDisplay(this);
displayPager.setRangeText(rangeText); displayPager.setRangeText(rangeText);
Command setRowCmd = new Command() { Command setRowCmd = new Command() {
@Override @Override
...@@ -287,14 +281,49 @@ public class CustomGrid extends AbstractDataGrid<DataGridTableRowModel> ...@@ -287,14 +281,49 @@ public class CustomGrid extends AbstractDataGrid<DataGridTableRowModel>
} }
}; };
displayPager.setRangeCommand( setRowCmd ); displayPager.setRangeCommand( setRowCmd );
flexTable.setText(0, 0, caption);
if(caption.trim().length()!=0)
{
flexTable.setText(0, 0, caption);
flexTable.setWidget(1, 0, this);
flexTable.setWidget(2, 0, displayPager);
flexTable.getCellFormatter().setStyleName(0 ,0 , "FlexTable-ColumnHeaderCell");
flexTable.getCellFormatter().setStyleName(1 ,0 , "gwt-ScrollTable");
if( GridThemes.getBrowserVersion() == -1 )
{
flexTable.getCellFormatter().setStyleName(2 ,0 , "e12Pager");
}
else
{
flexTable.getCellFormatter().setStyleName(2 ,0 , "e12Pager-forIE");
}
}else
{
flexTable.setWidget(0, 0, this);
flexTable.setWidget(1, 0, displayPager);
flexTable.getCellFormatter().setStyleName(0 ,0 , "gwt-ScrollTable");
if( GridThemes.getBrowserVersion() == -1 )
{
flexTable.getCellFormatter().setStyleName(1 ,0 , "e12Pager");
}
else
{
flexTable.getCellFormatter().setStyleName(1 ,0 , "e12Pager-forIE");
}
}
flexTable.setHeight( Window.getClientHeight() - 195 + "px" );
setHeight( Window.getClientHeight() - 207+ "px" );
setHeight( ( ( Window.getClientHeight() - 207 ))+ "px" );
/*flexTable.setText(0, 0, caption);
flexTable.setWidget(1, 0, this); flexTable.setWidget(1, 0, this);
flexTable.setWidget(2, 0, displayPager); flexTable.setWidget(2, 0, displayPager);
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" );
flexTable.getCellFormatter().setStyleName(0 ,0 , "FlexTable-ColumnHeaderCell"); flexTable.getCellFormatter().setStyleName(0 ,0 , "FlexTable-ColumnHeaderCell");
flexTable.getCellFormatter().setStyleName(1 ,0 , "gwt-ScrollTable"); flexTable.getCellFormatter().setStyleName(1 ,0 , "gwt-ScrollTable");
//flexTable.getCellFormatter().setStyleName(1 ,0 , "e12Pager"); //flexTable.getCellFormatter().setStyleName(1 ,0 , "e12Pager");
...@@ -305,7 +334,7 @@ public class CustomGrid extends AbstractDataGrid<DataGridTableRowModel> ...@@ -305,7 +334,7 @@ public class CustomGrid extends AbstractDataGrid<DataGridTableRowModel>
else else
{ {
flexTable.getCellFormatter().setStyleName(2 ,0 , "e12Pager-forIE"); flexTable.getCellFormatter().setStyleName(2 ,0 , "e12Pager-forIE");
} }*/
addStyleName("e12AdvDataGrid-SideBars"); addStyleName("e12AdvDataGrid-SideBars");
return flexTable; return flexTable;
......
...@@ -72,7 +72,10 @@ public class FilterCreator extends Composite ...@@ -72,7 +72,10 @@ public class FilterCreator extends Composite
HeadingLableImg.setStyleName("filterImage"); HeadingLableImg.setStyleName("filterImage");
headingLableImgPanel.add(getViewFilter(parameterList, metaDataJsnObj)); if(getViewFilter(parameterList, metaDataJsnObj)!=null)
{
headingLableImgPanel.add(getViewFilter(parameterList, metaDataJsnObj));
}
headingLableImgPanel.add(label); headingLableImgPanel.add(label);
lablePanle.add(headingLableImgPanel); lablePanle.add(headingLableImgPanel);
label.getElement().setId("titleLbl"); label.getElement().setId("titleLbl");
...@@ -137,11 +140,11 @@ public class FilterCreator extends Composite ...@@ -137,11 +140,11 @@ 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) if((parameterList==null) || (parameterList!=null && parameterList.size()<=4))
{ {
homePgFltrPopupVPnl.setStylePrimaryName("fltrPopupVPnlWidthFixed"); homePgFltrPopupVPnl.setStylePrimaryName("fltrPopupVPnlWidthFixed");
} }
else else
{ {
homePgFltrPopupVPnl.setStylePrimaryName("fltrPopupVPnl"); homePgFltrPopupVPnl.setStylePrimaryName("fltrPopupVPnl");
} }
...@@ -747,17 +750,18 @@ public class FilterCreator extends Composite ...@@ -747,17 +750,18 @@ public class FilterCreator extends Composite
@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(); ScrollPanel viewPanel = null;
String xmlMetadata = null; String xmlMetadata = null;
Document document = null; Document document = null;
NodeList rootNodeList = null; NodeList rootNodeList = null;
Node rootNode = null; Node rootNode = null;
int count = 0;
// 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'/>";
viewPanel.setWidth("100%");
MenuBar menu = new MenuBar(); MenuBar menu = new MenuBar();
try try
{ {
...@@ -786,6 +790,7 @@ public class FilterCreator extends Composite ...@@ -786,6 +790,7 @@ public class FilterCreator extends Composite
rootNode = rootNodeList.item(rootCtr); rootNode = rootNodeList.item(rootCtr);
if ("view".equals(rootNode.getNodeName())) if ("view".equals(rootNode.getNodeName()))
{ {
count++;
final String view = rootNode.getAttributes().getNamedItem("name").getNodeValue(); final String view = rootNode.getAttributes().getNamedItem("name").getNodeValue();
MenuItem actionItem = new MenuItem(view, new Command() MenuItem actionItem = new MenuItem(view, new Command()
{ {
...@@ -802,14 +807,19 @@ public class FilterCreator extends Composite ...@@ -802,14 +807,19 @@ public class FilterCreator extends Composite
actionItem.setStyleName("popupMenuItem"); actionItem.setStyleName("popupMenuItem");
} }
} }
if(count>1){
viewPanel = new ScrollPanel();
viewPanel.setWidth("100%");
menu.addItem(new MenuItem(addActivityImagePath, fileMenu)); menu.addItem(new MenuItem(addActivityImagePath, fileMenu));
viewPanel.add(menu); viewPanel.add(menu);
viewPanel.setStyleName("scrllPnlMenuBar"); viewPanel.setStyleName("scrllPnlMenuBar");
}
} }
} catch (Exception e) } catch (Exception e)
{ {
Window.alert("Exception in Class FilterCreator:getViewFilter():" + e.getMessage()); Window.alert("Exception in Class FilterCreator:getViewFilter():" + e.getMessage());
} }
return viewPanel; return viewPanel;
} }
} }
...@@ -93,6 +93,8 @@ public class GraphComponent extends Composite ...@@ -93,6 +93,8 @@ public class GraphComponent extends Composite
} }
idList = new ArrayList<String>(); idList = new ArrayList<String>();
} }
/*if(dataMap.toString().length()>20) //if loop for no data found alert
{*/ // for only OTC
for (String componentId : gridNGraphMeataDataMap.keySet()) for (String componentId : gridNGraphMeataDataMap.keySet())
{ {
jsonObjFrGraph=new JSONObject(); jsonObjFrGraph=new JSONObject();
...@@ -151,7 +153,9 @@ public class GraphComponent extends Composite ...@@ -151,7 +153,9 @@ public class GraphComponent extends Composite
//End Block for Export to excel and PDF formate //End Block for Export to excel and PDF formate
scrlPanel.add(flexTable); scrlPanel.add(flexTable);
scrlPanel.setStyleName("flextableScrlPnl"); scrlPanel.setStyleName("flextableScrlPnl");
RootPanel.get("chartContainergrid").add(scrlPanel); // RootPanel.get("chartContainergrid").add(scrlPanel);
RootPanel.get("chartContainer"+componentId).add(scrlPanel);
RootPanel.get("chartContainer"+componentId).add(horizontalPnl); RootPanel.get("chartContainer"+componentId).add(horizontalPnl);
} else if("DataGrid".equalsIgnoreCase(component)) } else if("DataGrid".equalsIgnoreCase(component))
...@@ -174,6 +178,10 @@ public class GraphComponent extends Composite ...@@ -174,6 +178,10 @@ public class GraphComponent extends Composite
} }
} }
} }
/*}else
{
Window.alert("No Data Found");
}*/
} }
private native void createChart(String chartData, String containerId, String chartContainer, String width, String height, String imageName) private native void createChart(String chartData, String containerId, String chartContainer, String width, String height, String imageName)
...@@ -191,7 +199,7 @@ public class GraphComponent extends Composite ...@@ -191,7 +199,7 @@ public class GraphComponent extends Composite
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>();
gridNGraphMeataDataMap = dataDtl.getGridNMapMetData(jsonObjMetaData,viewOptionSelectd); gridNGraphMeataDataMap = dataDtl.getGridNMapMetData(jsonObjMetaData,viewOptionSelectd);
final LinkedHashMap<String, ArrayList<String>> datsSourceDtlMap = (LinkedHashMap) gridNGraphMeataDataMap.get("datSrc"); final LinkedHashMap<String, ArrayList<String>> datsSourceDtlMap = (LinkedHashMap) gridNGraphMeataDataMap.get("datSrc");
getDataMap(datsSourceDtlMap); getDataMap(datsSourceDtlMap);
} }
...@@ -251,7 +259,7 @@ public class GraphComponent extends Composite ...@@ -251,7 +259,7 @@ 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("rxsurvey")) }else if (page.equals("rxsurvey"))
{ {
objActionPath = "/ibase/" + servletname + "?salesperson=" + parameterList.get(1) + "&month=" + parameterList.get(2) + "&year=" + parameterList.get(3) + "&brand=" + parameterList.get(4) + "&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("outletsvisit")) }else if (page.equals("outletsvisit"))
{ {
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;
...@@ -259,12 +267,14 @@ public class GraphComponent extends Composite ...@@ -259,12 +267,14 @@ 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;
} }
//end Add dashboard mapping for OTC dashboard on dated 15-oct-2004
/*Start Add For SUN Dashboard*/
else if (page.equals("customerinfo")) else if (page.equals("customerinfo"))
{ {
objActionPath = "/ibase/" + servletname + "?custCode=" + parameterList.get(1) + "&prdCode=" + parameterList.get(2) + "&dataSourceName=" + dbDataSource+"&reportName="+page; 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 For SUN Dashboard*/
RequestBuilder reqBuilder = new RequestBuilder(RequestBuilder.POST, objActionPath); RequestBuilder reqBuilder = new RequestBuilder(RequestBuilder.POST, objActionPath);
try try
...@@ -276,8 +286,8 @@ public class GraphComponent extends Composite ...@@ -276,8 +286,8 @@ public class GraphComponent extends Composite
{ {
if (STATUS_CODE_OK == response.getStatusCode()) if (STATUS_CODE_OK == response.getStatusCode())
{ {
if (response.getText().trim().length() > 2) if (response.getText().trim().length() > 2) //if code is relese to OTC then Comment this if condition Dhanendra 07Nov2014
{ {
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);
......
...@@ -186,10 +186,10 @@ public class MetaDataDtl ...@@ -186,10 +186,10 @@ public class MetaDataDtl
{ {
columnGrpId = columnGrpNode.getAttributes().getNamedItem("id").getNodeValue(); columnGrpId = columnGrpNode.getAttributes().getNamedItem("id").getNodeValue();
columnGrpNodeList = columnGrpNode.getChildNodes(); columnGrpNodeList = columnGrpNode.getChildNodes();
columnIDList = new ArrayList<String>();
columnNameList = new ArrayList<String>();
for (int colmnCtr = 0; colmnCtr < columnGrpNodeList.getLength(); colmnCtr++) for (int colmnCtr = 0; colmnCtr < columnGrpNodeList.getLength(); colmnCtr++)
{ {
columnIDList = new ArrayList<String>();
columnNameList = new ArrayList<String>();
colGrpTitlNode = columnGrpNodeList.item(colmnCtr); colGrpTitlNode = columnGrpNodeList.item(colmnCtr);
if ("col_group_title".equals(colGrpTitlNode.getNodeName())) if ("col_group_title".equals(colGrpTitlNode.getNodeName()))
{ {
...@@ -224,8 +224,6 @@ public class MetaDataDtl ...@@ -224,8 +224,6 @@ public class MetaDataDtl
gridSizeDataMap.put(title, columnsize); gridSizeDataMap.put(title, columnsize);
gridAlignDataMap.put(title, columnAlign); gridAlignDataMap.put(title, columnAlign);
} }
} }
gridCaptionDataMap.put("componentCaption"+graphID,componentCaption ); gridCaptionDataMap.put("componentCaption"+graphID,componentCaption );
gridCompTypeMap.put("buildComponent"+graphID, componentType); gridCompTypeMap.put("buildComponent"+graphID, componentType);
...@@ -237,8 +235,8 @@ public class MetaDataDtl ...@@ -237,8 +235,8 @@ public class MetaDataDtl
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(); columnIDList = new ArrayList<String>();
columnNameList.clear(); columnNameList= new ArrayList<String>();
} }
if ("graph".equals(viewNode.getNodeName())) if ("graph".equals(viewNode.getNodeName()))
{ {
...@@ -484,6 +482,7 @@ public class MetaDataDtl ...@@ -484,6 +482,7 @@ public class MetaDataDtl
} }
} }
gridNGraphMeataDataMap.put("datSrc", datsSourceDtlMap); gridNGraphMeataDataMap.put("datSrc", datsSourceDtlMap);
// Window.alert("gridNGraphMeataDataMap:"+gridNGraphMeataDataMap);
return gridNGraphMeataDataMap; return gridNGraphMeataDataMap;
} }
......
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