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>
int count=0;
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())
{
graphDtlList = graphDataMap.get(graphKey);
......@@ -249,16 +250,9 @@ public class CustomGrid extends AbstractDataGrid<DataGridTableRowModel>
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);
displayPager.setRangeText(rangeText);
Command setRowCmd = new Command() {
@Override
......@@ -287,14 +281,49 @@ public class CustomGrid extends AbstractDataGrid<DataGridTableRowModel>
}
};
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(2, 0, displayPager);
flexTable.setHeight( Window.getClientHeight() - 195 + "px" );
//flexTable.setWidth( Window.getClientWidth() -10+ "px" );
//flexTable.setWidth("100% !important");
setHeight( Window.getClientHeight() - 207+ "px" );
setHeight( ( ( Window.getClientHeight() - 207 ))+ "px" );
flexTable.getCellFormatter().setStyleName(0 ,0 , "FlexTable-ColumnHeaderCell");
flexTable.getCellFormatter().setStyleName(1 ,0 , "gwt-ScrollTable");
//flexTable.getCellFormatter().setStyleName(1 ,0 , "e12Pager");
......@@ -305,7 +334,7 @@ public class CustomGrid extends AbstractDataGrid<DataGridTableRowModel>
else
{
flexTable.getCellFormatter().setStyleName(2 ,0 , "e12Pager-forIE");
}
}*/
addStyleName("e12AdvDataGrid-SideBars");
return flexTable;
......
......@@ -72,7 +72,10 @@ public class FilterCreator extends Composite
HeadingLableImg.setStyleName("filterImage");
headingLableImgPanel.add(getViewFilter(parameterList, metaDataJsnObj));
if(getViewFilter(parameterList, metaDataJsnObj)!=null)
{
headingLableImgPanel.add(getViewFilter(parameterList, metaDataJsnObj));
}
headingLableImgPanel.add(label);
lablePanle.add(headingLableImgPanel);
label.getElement().setId("titleLbl");
......@@ -137,11 +140,11 @@ public class FilterCreator extends Composite
int noOfFiltr = 0;
Label columnNameLbl = null;
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");
}
......@@ -747,17 +750,18 @@ public class FilterCreator extends Composite
@SuppressWarnings("serial")
public ScrollPanel getViewFilter(final ArrayList<String> parameterList, JSONObject metaDataJsnObj)
{
final ScrollPanel viewPanel = new ScrollPanel();
ScrollPanel viewPanel = null;
String xmlMetadata = null;
Document document = null;
NodeList rootNodeList = null;
Node rootNode = null;
int count = 0;
// NodeList viewNodeList = null;
// Node viewNode = null;
// String view=null;
final String image = "<img align='top' src='FusionChart/images/menu_button.png' height='18px' width='25px'/>";
viewPanel.setWidth("100%");
MenuBar menu = new MenuBar();
try
{
......@@ -786,6 +790,7 @@ public class FilterCreator extends Composite
rootNode = rootNodeList.item(rootCtr);
if ("view".equals(rootNode.getNodeName()))
{
count++;
final String view = rootNode.getAttributes().getNamedItem("name").getNodeValue();
MenuItem actionItem = new MenuItem(view, new Command()
{
......@@ -802,14 +807,19 @@ public class FilterCreator extends Composite
actionItem.setStyleName("popupMenuItem");
}
}
if(count>1){
viewPanel = new ScrollPanel();
viewPanel.setWidth("100%");
menu.addItem(new MenuItem(addActivityImagePath, fileMenu));
viewPanel.add(menu);
viewPanel.setStyleName("scrllPnlMenuBar");
}
}
} catch (Exception e)
{
Window.alert("Exception in Class FilterCreator:getViewFilter():" + e.getMessage());
}
return viewPanel;
}
}
......@@ -93,6 +93,8 @@ public class GraphComponent extends Composite
}
idList = new ArrayList<String>();
}
/*if(dataMap.toString().length()>20) //if loop for no data found alert
{*/ // for only OTC
for (String componentId : gridNGraphMeataDataMap.keySet())
{
jsonObjFrGraph=new JSONObject();
......@@ -151,7 +153,9 @@ public class GraphComponent extends Composite
//End Block for Export to excel and PDF formate
scrlPanel.add(flexTable);
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);
} else if("DataGrid".equalsIgnoreCase(component))
......@@ -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)
......@@ -191,7 +199,7 @@ public class GraphComponent extends Composite
String viewOptionSelectd = parameterList.get(parameterList.size()-1);
MetaDataDtl dataDtl = new MetaDataDtl();
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");
getDataMap(datsSourceDtlMap);
}
......@@ -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;
}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"))
{
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
{
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"))
{
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);
try
......@@ -276,8 +286,8 @@ public class GraphComponent extends Composite
{
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 jsonObjData = new JSONObject();
jsonObjData.put(key, servletJsnObj);
......
......@@ -186,10 +186,10 @@ public class MetaDataDtl
{
columnGrpId = columnGrpNode.getAttributes().getNamedItem("id").getNodeValue();
columnGrpNodeList = columnGrpNode.getChildNodes();
columnIDList = new ArrayList<String>();
columnNameList = new ArrayList<String>();
for (int colmnCtr = 0; colmnCtr < columnGrpNodeList.getLength(); colmnCtr++)
{
columnIDList = new ArrayList<String>();
columnNameList = new ArrayList<String>();
colGrpTitlNode = columnGrpNodeList.item(colmnCtr);
if ("col_group_title".equals(colGrpTitlNode.getNodeName()))
{
......@@ -224,8 +224,6 @@ public class MetaDataDtl
gridSizeDataMap.put(title, columnsize);
gridAlignDataMap.put(title, columnAlign);
}
}
gridCaptionDataMap.put("componentCaption"+graphID,componentCaption );
gridCompTypeMap.put("buildComponent"+graphID, componentType);
......@@ -237,8 +235,8 @@ public class MetaDataDtl
gridNGraphMeataDataMap.put("columnAlign"+graphID, gridAlignDataMap);
gridNGraphMeataDataMap.put("type"+graphID, typeGridMap);
gridNGraphMeataDataMap.put("datasource"+graphID, gridDataSourceMap);
columnIDList.clear();
columnNameList.clear();
columnIDList = new ArrayList<String>();
columnNameList= new ArrayList<String>();
}
if ("graph".equals(viewNode.getNodeName()))
{
......@@ -484,6 +482,7 @@ public class MetaDataDtl
}
}
gridNGraphMeataDataMap.put("datSrc", datsSourceDtlMap);
// Window.alert("gridNGraphMeataDataMap:"+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