Commit 02c240fc authored by sbade's avatar sbade

updated code for mandatory filter field and dynamic url for servlet.


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@96941 ce508802-f39f-4f6c-b175-0d175dae99d5
parent bc408c3a
...@@ -127,9 +127,7 @@ public class ChartCreator ...@@ -127,9 +127,7 @@ public class ChartCreator
currentvalue = (fetchRowWiseVal.get(yAxisColunList.get(yCnt)).toString().replace('"', ' ').trim()); currentvalue = (fetchRowWiseVal.get(yAxisColunList.get(yCnt)).toString().replace('"', ' ').trim());
valueList.add(currentvalue); valueList.add(currentvalue);
} }
allDataMap.put(key, valueList); allDataMap.put(key, valueList);
key = ""; key = "";
} }
valueMapSet = allDataMap.keySet(); valueMapSet = allDataMap.keySet();
......
...@@ -103,22 +103,23 @@ public class CustomGrid extends AbstractDataGrid<DataGridTableRowModel> ...@@ -103,22 +103,23 @@ public class CustomGrid extends AbstractDataGrid<DataGridTableRowModel>
graphDtlList = graphDataMap.get(graphKey); graphDtlList = graphDataMap.get(graphKey);
jsonEachRow = new JSONObject(); jsonEachRow = new JSONObject();
jsonEachRow = (JSONObject)jsonObjData.get(""+jRowCtr); jsonEachRow = (JSONObject)jsonObjData.get(""+jRowCtr);
// Window.alert("jsonEachRow:"+jsonEachRow);
count=rowData.size(); count=rowData.size();
for(int jDataCtr=0;jDataCtr<graphDtlList.size();jDataCtr++) for(int jDataCtr=0;jDataCtr<graphDtlList.size();jDataCtr++)
{ {
if(jsonEachRow.get(graphDtlList.get(jDataCtr))!=null)
{
celldata = new E12CustomTextCell.CellData((""+jsonEachRow.get(""+graphDtlList.get(jDataCtr))).replace('"', ' ')); celldata = new E12CustomTextCell.CellData((""+jsonEachRow.get(""+graphDtlList.get(jDataCtr))).replace('"', ' '));
celldata.setMandatory(true); celldata.setMandatory(true);
celldata.setOriginalText("Cell"+jDataCtr); celldata.setOriginalText("Cell"+jDataCtr);
celldata.setName(""+(graphDtlList.get(jDataCtr)).replace('"', ' ')); celldata.setName(""+(graphDtlList.get(jDataCtr)).replace('"', ' '));
rowData.put(count, celldata); rowData.put(count, celldata);
count++; count++;
}
} }
} }
rowDataGrid = new DataGridTableRowModel(rowData); rowDataGrid = new DataGridTableRowModel(rowData);
dataGridTableRowList.add(rowDataGrid); dataGridTableRowList.add(rowDataGrid);
} }
ColumnInfoBean columnInfoBean=null; ColumnInfoBean columnInfoBean=null;
graphDataMap =gridNGraphMeataDataMap.get("columnName"+componentId); graphDataMap =gridNGraphMeataDataMap.get("columnName"+componentId);
...@@ -157,7 +158,6 @@ public class CustomGrid extends AbstractDataGrid<DataGridTableRowModel> ...@@ -157,7 +158,6 @@ public class CustomGrid extends AbstractDataGrid<DataGridTableRowModel>
{ {
final int noOfRows = dataGridTableRowList.size(); final int noOfRows = dataGridTableRowList.size();
final int noOfColumns = dataGridTableColList.size(); final int noOfColumns = dataGridTableColList.size();
dataProvider.setList( dataGridTableRowList ); dataProvider.setList( dataGridTableRowList );
//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;
...@@ -176,8 +176,7 @@ public class CustomGrid extends AbstractDataGrid<DataGridTableRowModel> ...@@ -176,8 +176,7 @@ public class CustomGrid extends AbstractDataGrid<DataGridTableRowModel>
final ListHandler<DataGridTableRowModel> sortHandler = new ListHandler<DataGridTableRowModel>( dataProvider.getList()) final ListHandler<DataGridTableRowModel> sortHandler = new ListHandler<DataGridTableRowModel>( dataProvider.getList())
{ {
@Override @Override
public void onColumnSort(ColumnSortEvent event) public void onColumnSort(ColumnSortEvent event) {
{
super.onColumnSort(event); super.onColumnSort(event);
dataProvider.refresh(); dataProvider.refresh();
} }
...@@ -252,7 +251,6 @@ public class CustomGrid extends AbstractDataGrid<DataGridTableRowModel> ...@@ -252,7 +251,6 @@ public class CustomGrid extends AbstractDataGrid<DataGridTableRowModel>
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);
Label labelNoDataFound = new Label("No Data Found");
Command setRowCmd = new Command() { Command setRowCmd = new Command() {
@Override @Override
public void execute() public void execute()
...@@ -284,16 +282,7 @@ public class CustomGrid extends AbstractDataGrid<DataGridTableRowModel> ...@@ -284,16 +282,7 @@ public class CustomGrid extends AbstractDataGrid<DataGridTableRowModel>
if(caption.trim().length()!=0) if(caption.trim().length()!=0)
{ {
flexTable.setText(0, 0, caption); flexTable.setText(0, 0, caption);
if(noOfRows<=0)
{
flexTable.setWidget(1, 0, labelNoDataFound);
}else
{
flexTable.setWidget(1, 0, this); flexTable.setWidget(1, 0, this);
}
//flexTable.setWidget(1, 0, this);
flexTable.setWidget(2, 0, displayPager); flexTable.setWidget(2, 0, displayPager);
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");
...@@ -307,17 +296,9 @@ public class CustomGrid extends AbstractDataGrid<DataGridTableRowModel> ...@@ -307,17 +296,9 @@ public class CustomGrid extends AbstractDataGrid<DataGridTableRowModel>
flexTable.getCellFormatter().setStyleName(2 ,0 , "e12Pager-forIE"); flexTable.getCellFormatter().setStyleName(2 ,0 , "e12Pager-forIE");
} }
}else
{
if(noOfRows<=0)
{
flexTable.setWidget(0, 0, labelNoDataFound);
}else }else
{ {
flexTable.setWidget(0, 0, this); flexTable.setWidget(0, 0, this);
}
//flexTable.setWidget(0, 0, this);
flexTable.setWidget(1, 0, displayPager); flexTable.setWidget(1, 0, displayPager);
flexTable.getCellFormatter().setStyleName(0 ,0 , "gwt-ScrollTable"); flexTable.getCellFormatter().setStyleName(0 ,0 , "gwt-ScrollTable");
...@@ -331,18 +312,15 @@ public class CustomGrid extends AbstractDataGrid<DataGridTableRowModel> ...@@ -331,18 +312,15 @@ public class CustomGrid extends AbstractDataGrid<DataGridTableRowModel>
} }
} }
/*flexTable.setHeight( Window.getClientHeight() - 195 + "px" ); flexTable.setHeight( Window.getClientHeight() - 240 + "px" );
setHeight( Window.getClientHeight() - 240+ "px" ); flexTable.setHeight("320px");
setHeight( ( ( Window.getClientHeight() - 250 ))+ "px" );*/ setHeight("320px");
flexTable.setHeight("330px");
setHeight("330px"); /*setHeight( Window.getClientHeight() - 207+ "px" );*/
/*setHeight( ( ( Window.getClientHeight() - 250 ))+ "px" );*/
/*flexTable.setHeight( Window.getClientHeight() - 225 + "px" ); addStyleName("e12AdvDataGrid-SideBars");
setHeight( Window.getClientHeight() - 207+ "px" );
setHeight( ( ( Window.getClientHeight() - 215 ))+ "px" );*/
//flexTable.setHeight("320px");
//setHeight( ( ( Window.getClientHeight() - 350 ))+ "px" );
//addStyleName("e12AdvDataGrid-SideBars");
return flexTable; return flexTable;
} }
......
...@@ -245,8 +245,13 @@ public class FilterCreator extends Composite ...@@ -245,8 +245,13 @@ public class FilterCreator extends Composite
mainPopupPnl.setPopupPosition(100, 60); mainPopupPnl.setPopupPosition(100, 60);
mainPopupPnl.getElement().setId("filterMainOuterDiv"); mainPopupPnl.getElement().setId("filterMainOuterDiv");
mainPopupPnl.add(homePgFltrPopupVPnl); mainPopupPnl.add(homePgFltrPopupVPnl);
//mainPopupPnl.show();
/* stat--added new code to hide empty filter onload dated : 03-Dec-2014*/
if(popUpHPnl.getWidgetCount()!=0)
{
mainPopupPnl.show(); mainPopupPnl.show();
}
/* End-- added new code to hide empty filter onload*/
cancelimage.addClickHandler(new ClickHandler() cancelimage.addClickHandler(new ClickHandler()
{ {
@Override @Override
...@@ -593,7 +598,7 @@ public class FilterCreator extends Composite ...@@ -593,7 +598,7 @@ public class FilterCreator extends Composite
parameterValue = paramtrArray[paramtrCnt]; parameterValue = paramtrArray[paramtrCnt];
if (parameterValue.trim().equalsIgnoreCase(colData.trim())) if (parameterValue.trim().equalsIgnoreCase(colData.trim()))
{ {
RadioButton radioBtnOnLod = (RadioButton) flexTable.getWidget(Integer.parseInt(row) + 1, 0); RadioButton radioBtnOnLod = (RadioButton)flexTable.getWidget(Integer.parseInt(row) + 1, 0);
radioBtnOnLod.setValue(true); radioBtnOnLod.setValue(true);
} }
} }
...@@ -821,6 +826,7 @@ public class FilterCreator extends Composite ...@@ -821,6 +826,7 @@ public class FilterCreator extends Composite
private void getFltrSelectedData(ArrayList<FilterInfo> filterList, PopupPanel mainPopupPnl) private void getFltrSelectedData(ArrayList<FilterInfo> filterList, PopupPanel mainPopupPnl)
{ {
boolean isFilterNotSelected = false; boolean isFilterNotSelected = false;
int row = 0; int row = 0;
FlexTable grid = null; FlexTable grid = null;
...@@ -838,12 +844,13 @@ public class FilterCreator extends Composite ...@@ -838,12 +844,13 @@ public class FilterCreator extends Composite
HorizontalPanel horizontalPanel = null; HorizontalPanel horizontalPanel = null;
VerticalPanel verticalPanel = null; VerticalPanel verticalPanel = null;
String colNameId = ""; String colNameId = "";
String mandatotyFilter = "";
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();
colNameId = fltrInfo.getColNameId(); colNameId = fltrInfo.getColNameId();
mandatotyFilter = fltrInfo.getMandatory();
for (int scrlPnlCnt = 0; scrlPnlCnt < popUpHPnl.getWidgetCount(); scrlPnlCnt++) for (int scrlPnlCnt = 0; scrlPnlCnt < popUpHPnl.getWidgetCount(); scrlPnlCnt++)
{ {
...@@ -875,21 +882,21 @@ public class FilterCreator extends Composite ...@@ -875,21 +882,21 @@ public class FilterCreator extends Composite
} }
if (scrollPnl.getTitle().equals(colName)) if (scrollPnl.getTitle().equals(colName))
{ {
//if (selectedChkBoxBuffer.toString().trim().length() != 0) if (selectedChkBoxBuffer.toString().trim().length() != 0)
if (selectedChkBoxBuffer.toString()!= null) //if (selectedChkBoxBuffer.toString()!= null)
{ {
popUpSendDtatList.add(selectedChkBoxBuffer.toString()); popUpSendDtatList.add(selectedChkBoxBuffer.toString());
} else } else
{ {
if(!"CUST_CODE_SUNUSA".equalsIgnoreCase(colNameId) && !"CUST_CODE_DLV".equalsIgnoreCase(colNameId))
//if(!"CUST_CODE_SUNUSA".equalsIgnoreCase(colNameId))
if("Y".equalsIgnoreCase(mandatotyFilter))
{ {
Window.alert(fltrInfo.getColName() + "Can't Be Empty"); Window.alert(fltrInfo.getColName() + "Can't Be Empty");
Window.setTitle(windowTitle); Window.setTitle(windowTitle);
isFilterNotSelected = true; isFilterNotSelected = true;
} }
} }
} }
} else if (horizontalPanel.getWidget(0) instanceof TextBox) } else if (horizontalPanel.getWidget(0) instanceof TextBox)
...@@ -897,14 +904,14 @@ public class FilterCreator extends Composite ...@@ -897,14 +904,14 @@ public class FilterCreator extends Composite
fltrTxtBox = (TextBox) horizontalPanel.getWidget(0); fltrTxtBox = (TextBox) horizontalPanel.getWidget(0);
if (fltrTxtBox.getTitle().equals(colName)) if (fltrTxtBox.getTitle().equals(colName))
{ {
//if (!fltrTxtBox.getText().isEmpty()) if (!fltrTxtBox.getText().isEmpty())
if (fltrTxtBox.getText()!=null) //if (fltrTxtBox.getText()!=null)
{ {
popUpSendDtatList.add(fltrTxtBox.getText()); popUpSendDtatList.add(fltrTxtBox.getText());
} else } else
{ {
//if(!"CUST_CODE_SUNUSA".equalsIgnoreCase(colNameId) && !"CUST_CODE_DLV".equalsIgnoreCase(colNameId))
if(!"CUST_CODE_SUNUSA".equalsIgnoreCase(colNameId) && !"CUST_CODE_DLV".equalsIgnoreCase(colNameId)) if("Y".equalsIgnoreCase(mandatotyFilter))
{ {
Window.alert(fltrInfo.getColName() + "Can't Be Empty"); Window.alert(fltrInfo.getColName() + "Can't Be Empty");
Window.setTitle(windowTitle); Window.setTitle(windowTitle);
...@@ -938,19 +945,14 @@ public class FilterCreator extends Composite ...@@ -938,19 +945,14 @@ public class FilterCreator extends Composite
} }
} }
} }
//if (selectedChkBoxBuffer.toString().trim().length() != 0) if (selectedChkBoxBuffer.toString().trim().length() != 0)
if (selectedChkBoxBuffer.toString()!= null) //if (selectedChkBoxBuffer.toString()!= null)
{ {
popUpSendDtatList.add(selectedChkBoxBuffer.toString()); popUpSendDtatList.add(selectedChkBoxBuffer.toString());
} else } else
{ {
/*if(!"CUST_CODE_SUNUSA".equalsIgnoreCase(colNameId) || !"CUST_CODE_DLV".equalsIgnoreCase(colNameId)) //if(!"CUST_CODE_SUNUSA".equalsIgnoreCase(colNameId) && !"CUST_CODE_DLV".equalsIgnoreCase(colNameId))
{ if("Y".equalsIgnoreCase(mandatotyFilter))
Window.alert(fltrInfo.getColName() + "Can't Be Empty");
Window.setTitle(windowTitle);
isFilterNotSelected = true;
}*/
if(!"CUST_CODE_SUNUSA".equalsIgnoreCase(colNameId) && !"CUST_CODE_DLV".equalsIgnoreCase(colNameId))
{ {
Window.alert(fltrInfo.getColName() + "Can't Be Empty"); Window.alert(fltrInfo.getColName() + "Can't Be Empty");
Window.setTitle(windowTitle); Window.setTitle(windowTitle);
...@@ -961,11 +963,9 @@ public class FilterCreator extends Composite ...@@ -961,11 +963,9 @@ public class FilterCreator extends Composite
} }
} }
} }
} }
} }
if (!isFilterNotSelected) if (!isFilterNotSelected)
{ {
Window.setTitle(""); Window.setTitle("");
......
...@@ -22,6 +22,9 @@ public class FilterInfo ...@@ -22,6 +22,9 @@ public class FilterInfo
String colNameId = ""; String colNameId = "";
String colModuleName = ""; String colModuleName = "";
String filterType = ""; String filterType = "";
String mandatory = "";
String name = "";
public String getColTitle() public String getColTitle()
{ {
...@@ -93,4 +96,23 @@ public class FilterInfo ...@@ -93,4 +96,23 @@ public class FilterInfo
this.colModuleName = colModuleName; this.colModuleName = colModuleName;
} }
public String getMandatory()
{
return mandatory;
}
public void setMandatory(String mandatory)
{
this.mandatory = mandatory;
}
public String getName()
{
return name;
}
public void setName(String name)
{
this.name = name;
}
} }
package ibase.client; package ibase.client;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedHashMap; import java.util.LinkedHashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -14,19 +15,20 @@ import com.google.gwt.http.client.RequestException; ...@@ -14,19 +15,20 @@ import com.google.gwt.http.client.RequestException;
import com.google.gwt.http.client.Response; import com.google.gwt.http.client.Response;
import com.google.gwt.json.client.JSONObject; import com.google.gwt.json.client.JSONObject;
import com.google.gwt.json.client.JSONParser; import com.google.gwt.json.client.JSONParser;
import com.google.gwt.user.client.Element;
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.Button;
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.HorizontalPanel; import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.RootPanel; import com.google.gwt.user.client.ui.RootPanel;
import com.google.gwt.user.client.ui.ScrollPanel; import com.google.gwt.user.client.ui.ScrollPanel;
import com.google.gwt.user.client.ui.SimplePanel; import com.google.gwt.user.client.ui.SimplePanel;
import com.google.gwt.user.client.ui.SplitLayoutPanel; import com.google.gwt.user.client.ui.SplitLayoutPanel;
import com.google.gwt.user.client.ui.VerticalPanel; import com.google.gwt.user.client.ui.VerticalPanel;
//import com.googlecode.gwtTableToExcel.client.TableToExcelClientBuilder;
import com.google.gwt.user.client.ui.Widget;
/** /**
* *
...@@ -48,12 +50,12 @@ public class GraphComponent extends Composite ...@@ -48,12 +50,12 @@ public class GraphComponent extends Composite
final LinkedHashMap<String, JSONObject> dataMap = new LinkedHashMap<String, JSONObject>(); final LinkedHashMap<String, JSONObject> dataMap = new LinkedHashMap<String, JSONObject>();
ArrayList<String> parameterList = null; ArrayList<String> parameterList = null;
ArrayList<String> idList = new ArrayList<String>(); ArrayList<String> idList = new ArrayList<String>();
HashMap<String, ArrayList<String>> graphCaptioneMap=null;
ArrayList<String> graphCaptionList= new ArrayList<String>();
/** /**
* This constructor initializes the graph container * This constructor initializes the graphcontainer
* *
*/ */
public GraphComponent(ArrayList<String> parameterList, JSONObject metaDataJsnObj) public GraphComponent(ArrayList<String> parameterList, JSONObject metaDataJsnObj)
{ {
this.jsonObjMetaData = metaDataJsnObj; this.jsonObjMetaData = metaDataJsnObj;
...@@ -73,13 +75,33 @@ public class GraphComponent extends Composite ...@@ -73,13 +75,33 @@ public class GraphComponent extends Composite
HashMap<String, ArrayList<String>> graphDataMap = null; HashMap<String, ArrayList<String>> graphDataMap = null;
HashMap<String, HashMap<String, String>> componentTypeMap = null; HashMap<String, HashMap<String, String>> componentTypeMap = null;
HashMap<String, HashMap<String, String>> datasourceMap = null; HashMap<String, HashMap<String, String>> datasourceMap = null;
HashMap<String, String> componentMap = null; ScrollPanel scrlPanel = null;
FlexTable flexTable = null;
String caption = "";
JSONObject graphJson = null; JSONObject graphJson = null;
final String componentType = "componentType"; final String componentType = "componentType";
String compType = ""; String compType = "";
String component =""; String component ="";
HashMap<String, ArrayList<String>> graphTypeMap = null; HashMap<String, ArrayList<String>> graphTypeMap = null;
String dtSrouce=""; String dtSrouce="";
/** Add Code By Dhanendra for No Data Found Msg **/
String parameter="";
boolean isParameter = false;
for (int i = 0; i < parameterList.size(); i++)
{
if(i<parameterList.size()-1 && i!=0)
{
parameter = parameterList.get(i);
if(parameter.trim().length() !=0)
{
isParameter = true;
}
}
}
/** End Code By Dhanendra for No Data Found Msg **/
if (idList.size() > 0) if (idList.size() > 0)
{ {
for (int i = 0; i < idList.size(); i++) for (int i = 0; i < idList.size(); i++)
...@@ -97,6 +119,9 @@ public class GraphComponent extends Composite ...@@ -97,6 +119,9 @@ public class GraphComponent extends Composite
{*/ // for only OTC {*/ // for only OTC
for (String componentId : gridNGraphMeataDataMap.keySet()) for (String componentId : gridNGraphMeataDataMap.keySet())
{ {
jsonObjFrGraph=new JSONObject(); jsonObjFrGraph=new JSONObject();
if(isNumeric(componentId)) if(isNumeric(componentId))
{ {
...@@ -131,12 +156,18 @@ public class GraphComponent extends Composite ...@@ -131,12 +156,18 @@ public class GraphComponent extends Composite
} }
} }
} }
else if("T".equalsIgnoreCase(type) && jsonObjFrGraph != null) else if("T".equalsIgnoreCase(type))
{ {
if(jsonObjFrGraph != null)
{
RootPanel.get("chartContainer"+componentId).clear(); RootPanel.get("chartContainer"+componentId).clear();
//RootPanel.get().clear(); //RootPanel.get().clear();
ScrollPanel scrlPanel = new ScrollPanel(); scrlPanel = new ScrollPanel();
FlexTable flexTable = new FlexTable(); flexTable = new FlexTable();
if ("FlexTable".equalsIgnoreCase(component)) if ("FlexTable".equalsIgnoreCase(component))
{ {
...@@ -154,6 +185,7 @@ public class GraphComponent extends Composite ...@@ -154,6 +185,7 @@ public class GraphComponent extends Composite
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(scrlPanel);
RootPanel.get("chartContainer"+componentId).add(horizontalPnl); RootPanel.get("chartContainer"+componentId).add(horizontalPnl);
...@@ -162,18 +194,42 @@ public class GraphComponent extends Composite ...@@ -162,18 +194,42 @@ public class GraphComponent extends Composite
flexTable = new FlexTable(); flexTable = new FlexTable();
CustomGrid data = new CustomGrid(10); CustomGrid data = new CustomGrid(10);
flexTable = data.jsonToArrayList(gridNGraphMeataDataMap, jsonObjFrGraph,dtSrouce,componentId); flexTable = data.jsonToArrayList(gridNGraphMeataDataMap, jsonObjFrGraph,dtSrouce,componentId);
//This Block for Export to excel and PDF formate
HorizontalPanel horizontalPnl = new HorizontalPanel();
Button excelBtn = new Button("Export To Excel"); Button excelBtn = new Button("Export To Excel");
excelBtn.setTitle("Excel"); excelBtn.setTitle("Excel");
/*Button pdFBtn = new Button("Export To PDF");
pdFBtn.setTitle("PDF");
horizontalPnl.add(ibase.client.tabletoexcel.TableToExcelClientBuilder.fromTable(flexTable).withWidget(pdFBtn).buildExportFormWidget());*/
//horizontalPnl.add(ibase.client.tabletoexcel.TableToExcelClientBuilder.fromTable(flexTable).withWidget(excelBtn).buildExportFormWidget());
//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);
} }
}
/** Start Code By Dhanendra for No Data Found Msg - 08 Dec 2014 **/
else
{
RootPanel.get("chartContainer"+componentId).clear();
if(isParameter)
{
flexTable = new FlexTable();
graphCaptionList.clear();
graphCaptioneMap = gridNGraphMeataDataMap.get("componentCaption"+componentId);
graphCaptionList.add(""+graphCaptioneMap.get("componentCaption"+componentId));
caption = graphCaptionList.get(0);
Label labelNoDataFound = new Label("No Data Found");
if(caption !=null && caption.trim().length()>0)
{
flexTable.setText(0, 0, caption);
flexTable.setWidget(1, 0, labelNoDataFound);
flexTable.getCellFormatter().setStyleName(0 ,0 , "FlexTable-ColumnHeaderCell");
flexTable.getCellFormatter().setStyleName(1 ,0 , "gwt-ScrollTable");
}else
{
flexTable.setWidget(0, 0, labelNoDataFound);
flexTable.getCellFormatter().setStyleName(0 ,0 , "gwt-ScrollTable");
}
flexTable.setStyleName("flexCSS");
RootPanel.get("chartContainer"+componentId).add(flexTable);
}
}
/** End Code By Dhanendra for No Data Found Msg **/
} }
} }
} }
...@@ -206,6 +262,7 @@ public class GraphComponent extends Composite ...@@ -206,6 +262,7 @@ public class GraphComponent extends Composite
public void getDataMap(final LinkedHashMap<String, ArrayList<String>> datsSourceDtlMap) public void getDataMap(final LinkedHashMap<String, ArrayList<String>> datsSourceDtlMap)
{ {
final LinkedHashMap<String, JSONObject> componentDataMap = new LinkedHashMap<String, JSONObject>(); final LinkedHashMap<String, JSONObject> componentDataMap = new LinkedHashMap<String, JSONObject>();
ArrayList<FilterInfo> filterList = new MetaDataDtl().getFilters(jsonObjMetaData);
for (Map.Entry<String, ArrayList<String>> entry : datsSourceDtlMap.entrySet()) for (Map.Entry<String, ArrayList<String>> entry : datsSourceDtlMap.entrySet())
{ {
final String key = entry.getKey(); final String key = entry.getKey();
...@@ -214,53 +271,52 @@ public class GraphComponent extends Composite ...@@ -214,53 +271,52 @@ public class GraphComponent extends Composite
String servletname = values.get(1); String servletname = values.get(1);
String objActionPath = ""; String objActionPath = "";
String page = parameterList.get(0); String page = parameterList.get(0);
String append=""; FilterInfo filterInfo = null;
/****Start Add For SUN Dashboard****/
if (page.equals("sales")) /** Start Added New code By sachin for Creating Dynamic Url For Report on 04/12/14**/
objActionPath = "/ibase/" + servletname;
int cnt=0;
for (int i = 0; i < filterList.size(); i++)
{ {
objActionPath = "/ibase/" + servletname + "?month=" + parameterList.get(1) + "&dataSourceName=" + dbDataSource; cnt++;
} filterInfo = filterList.get(i);
else if (page.equals("expense")) if(i==0)
{ {
objActionPath = "/ibase/" + servletname + "?month=" + parameterList.get(1) + "&dataSourceName=" + dbDataSource; objActionPath=objActionPath + "?" + filterInfo.getName()+"="+parameterList.get(cnt);
}
else if (page.equals("topbrand")) }else
{ {
objActionPath = "/ibase/" + servletname + "?topNos=" + parameterList.get(1) + "&month=" + parameterList.get(2) + "&dataSourceName=" + dbDataSource; objActionPath=objActionPath + "&" + filterInfo.getName()+"="+parameterList.get(cnt);
} }
else if (page.equals("recall"))
{
objActionPath = "/ibase/" + servletname + "?lastMonth=" + parameterList.get(1) + "&dataSourceName=" + dbDataSource;
} }
else if (page.equals("rcp")) objActionPath=objActionPath+"&dataSourceName=" + dbDataSource + "&reportName="+page;
/** End Added New code By sachin for Creating Dynamic Url For Report on 04/12/14**/
/*if (page.equals("sales"))
{ {
objActionPath = "/ibase/" + servletname + "?dataSourceName=" + dbDataSource + "&days=" + parameterList.get(1); objActionPath = "/ibase/" + servletname + "?month=" + parameterList.get(1) + "&dataSourceName=" + dbDataSource;
} } else if (page.equals("expense"))
else if (page.equals("qc"))
{ {
objActionPath = "/ibase/" + servletname + "?geoLocation=" + parameterList.get(1) + "&month=" + parameterList.get(2) + "&dataSourceName=" + dbDataSource; objActionPath = "/ibase/" + servletname + "?month=" + parameterList.get(1) + "&dataSourceName=" + dbDataSource;
} } else if (page.equals("topbrand"))
else if (page.equals("bspl")) {
objActionPath = "/ibase/" + servletname + "?topNos=" + parameterList.get(1) + "&month=" + parameterList.get(2) + "&dataSourceName=" + dbDataSource;
} else if (page.equals("bspl"))
{ {
objActionPath = "/ibase/" + servletname + "?sitecode=" + parameterList.get(1) + "&acctprd=" + parameterList.get(2) + "&prdfrom=" + parameterList.get(3) + "&prdto=" + parameterList.get(4) + "&formatcode=" + parameterList.get(5) + "&reporttype=" + parameterList.get(6) + "&dataSourceName=" + dbDataSource; objActionPath = "/ibase/" + servletname + "?sitecode=" + parameterList.get(1) + "&acctprd=" + parameterList.get(2) + "&prdfrom=" + parameterList.get(3) + "&prdto=" + parameterList.get(4) + "&formatcode=" + parameterList.get(5) + "&reporttype=" + parameterList.get(6) + "&dataSourceName=" + dbDataSource;
} } else if (page.equals("msrscore"))
else if (page.equals("msrscore"))
{ {
objActionPath = "/ibase/" + servletname + "?territory=" + parameterList.get(1) + "&salesperson=" + parameterList.get(2) + "&month=" + parameterList.get(3) + "&year=" + parameterList.get(4) + "&dataSourceName=" + dbDataSource; objActionPath = "/ibase/" + servletname + "?territory=" + parameterList.get(1) + "&salesperson=" + parameterList.get(2) + "&month=" + parameterList.get(3) + "&year=" + parameterList.get(4) + "&dataSourceName=" + dbDataSource;
} } else if (page.equals("dqsa"))
else if (page.equals("dqsa"))
{ {
objActionPath = "/ibase/" + servletname + "?&dataSourceName=" + dbDataSource+ "&reportName="+page; objActionPath = "/ibase/" + servletname + "?&dataSourceName=" + dbDataSource+ "&reportName="+page;
} }
else if (page.equals("customerinfo"))
{
objActionPath = "/ibase/" + servletname + "?custCode=" + parameterList.get(1) + "&prdCode=" + parameterList.get(2) + "&dataSourceName=" + dbDataSource+"&reportName="+page;
}
else if (page.equals("ordershipment"))
{
objActionPath = "/ibase/" + servletname + "?lastMonth=" + parameterList.get(1)+"&siteCode=" + parameterList.get(2) + "&custCode=" + parameterList.get(3) + "&custCodeDlv=" + parameterList.get(4) +"&dataSourceName=" + dbDataSource+"&reportName="+page;
}
/****End Add For SUN Dashboard****/
// start Add dashboard mapping for OTC dashboard on dated 15-oct-2004 // start Add dashboard mapping for OTC dashboard on dated 15-oct-2004
...@@ -283,7 +339,31 @@ public class GraphComponent extends Composite ...@@ -283,7 +339,31 @@ public class GraphComponent extends Composite
} }
//end Add dashboard mapping for OTC dashboard on dated 15-oct-2004 //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;
}
else if (page.equals("ordershipment"))
{
objActionPath = "/ibase/" + servletname + "?lastMonth=" + parameterList.get(1)+"&siteCode=" + parameterList.get(2) + "&custCode=" + parameterList.get(3) + "&custCodeDlv=" + parameterList.get(4) +"&dataSourceName=" + dbDataSource+"&reportName="+page;
}
End For SUN Dashboard
Start Add For MFG SUN Dashboard
else if (page.equals("recall"))
{
objActionPath = "/ibase/" + servletname + "?lastMonth=" + parameterList.get(1) + "&dataSourceName=" + dbDataSource;
}
else if (page.equals("rcp"))
{
objActionPath = "/ibase/" + servletname + "?lastMonth=" + parameterList.get(1) + "&dataSourceName=" + dbDataSource;
}
else if (page.equals("qc"))
{
objActionPath = "/ibase/" + servletname + "?geoLocation=" + parameterList.get(1) + "&lastMonth=" + parameterList.get(2) + "&dataSourceName=" + dbDataSource;
}*/
/*END For MFG SUN Dashboard*/
RequestBuilder reqBuilder = new RequestBuilder(RequestBuilder.POST, objActionPath); RequestBuilder reqBuilder = new RequestBuilder(RequestBuilder.POST, objActionPath);
try try
{ {
...@@ -294,17 +374,24 @@ public class GraphComponent extends Composite ...@@ -294,17 +374,24 @@ public class GraphComponent extends Composite
{ {
if (STATUS_CODE_OK == response.getStatusCode()) if (STATUS_CODE_OK == response.getStatusCode())
{ {
if (response.getText().trim().length() > 2) //if code is relese to OTC then Comment this if condition Dhanendra 07Nov2014 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);
componentDataMap.put(key, jsonObjData); componentDataMap.put(key, jsonObjData);
}else
{
componentDataMap.put(key, null);
RootPanel.get("chartContainer"+key).clear();
}
if (componentDataMap.size() == datsSourceDtlMap.size()) if (componentDataMap.size() == datsSourceDtlMap.size())
{ {
buildChart(componentDataMap); buildChart(componentDataMap);
} }
}
} else } else
{ {
Window.alert("Responce for getData null"); Window.alert("Responce for getData null");
...@@ -321,11 +408,12 @@ public class GraphComponent extends Composite ...@@ -321,11 +408,12 @@ public class GraphComponent extends Composite
{ {
e.printStackTrace(); e.printStackTrace();
} }
} }
} }
public boolean isNumeric(String s) {
public boolean isNumeric(String s) {
return s.matches("[-+]?\\d*\\.?\\d+"); return s.matches("[-+]?\\d*\\.?\\d+");
} }
} }
...@@ -538,6 +538,11 @@ public class MetaDataDtl ...@@ -538,6 +538,11 @@ public class MetaDataDtl
filterInfo.setColName(columNode.getChildNodes().item(0).getNodeValue()); filterInfo.setColName(columNode.getChildNodes().item(0).getNodeValue());
filterInfo.setColNameId(columNode.getAttributes().getNamedItem("id").getNodeValue()); filterInfo.setColNameId(columNode.getAttributes().getNamedItem("id").getNodeValue());
filterInfo.setColModuleName(columNode.getAttributes().getNamedItem("moduleName").getNodeValue()); filterInfo.setColModuleName(columNode.getAttributes().getNamedItem("moduleName").getNodeValue());
/*Add Dhanendra For 2 Attribute in Metaxml 8Dec2014*/
filterInfo.setName(columNode.getAttributes().getNamedItem("name").getNodeValue());
filterInfo.setMandatory(columNode.getAttributes().getNamedItem("mandatory").getNodeValue());
/*End Dhanendra For 2 Attribute in Metaxml 8Dec2014*/
} }
if ("col_descr".equals(columNode.getNodeName())) if ("col_descr".equals(columNode.getNodeName()))
{ {
......
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