Commit 3b7933b5 authored by vvengurlekar's avatar vvengurlekar

1.pagetitle format changed for GST dahboard and also added page subtitle for...

1.pagetitle format changed for GST dahboard and also added page subtitle for GST on basis of xml tag <show_ontitle_index>
2. filter display layout changed
3.for card if iconName is not present then component panel will not created
4.For pie component subtitle will be added by defining prefix and postfix in xml
5.For grid layout changed i.e. alignment set for table hearder and also removed column left and right border


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@106523 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 6cf99c3d
......@@ -27,6 +27,7 @@ import com.google.gwt.dom.client.TableRowElement;
import com.google.gwt.dom.client.TableSectionElement;
import com.google.gwt.json.client.JSONObject;
import com.google.gwt.json.client.JSONValue;
import com.google.gwt.safehtml.shared.SafeHtml;
import com.google.gwt.user.cellview.client.ColumnSortEvent;
import com.google.gwt.user.cellview.client.ColumnSortEvent.ListHandler;
import com.google.gwt.user.cellview.client.Header;
......@@ -245,6 +246,9 @@ public class CustomGrid extends AbstractDataGrid<DataGridTableRowModel>
//Add by Dnyaneshwar chavan on 07-DEC-2012 [WS2GSUN002 || ] End
String caption ="";
ResizableHeader<DataGridTableRowModel> header=null;
//Added by Varsha V. for changing alignment for table header
SafeHtml htmlColumnHeader = null;
//Ended by Varsha V. for changing alignment for table header
try
{
E12CustomTextCell.isValidate = false;
......@@ -275,14 +279,44 @@ public class CustomGrid extends AbstractDataGrid<DataGridTableRowModel>
if(graphAlignList.get(i).trim().equalsIgnoreCase("left"))
{
column.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT);
//Added by Varsha V. for changing alignment for table header
htmlColumnHeader = new SafeHtml() {
@Override
public String asString() {
// TODO Auto-generated method stub
return "<p style=\"text-align:left;\">"+colName+"</p>";
}
};
//Ended by Varsha V. for changing alignment for table header
}
else if(graphAlignList.get(i).trim().equalsIgnoreCase("right"))
{
column.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_RIGHT);
//Added by Varsha V. for changing alignment for table header
htmlColumnHeader = new SafeHtml() {
@Override
public String asString() {
// TODO Auto-generated method stub
return "<p style=\"text-align:right; padding-right: 10px;\">"+colName+"</p>";
}
};
//Ended by Varsha V. for changing alignment for table header
}
else if(graphAlignList.get(i).trim().equalsIgnoreCase("center"))
{
column.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
//Added by Varsha V. for changing alignment for table header
htmlColumnHeader = new SafeHtml() {
@Override
public String asString() {
// TODO Auto-generated method stub
return "<p style=\"text-align:center;\">"+colName+"</p>";
}
};
//Ended by Varsha V. for changing alignment for table header
}
/*if ( i == 0 ) // commented for onload sorting
{
......@@ -321,6 +355,9 @@ public class CustomGrid extends AbstractDataGrid<DataGridTableRowModel>
}
});
this.setColumnWidth( column, width +"px" );
//Added by Varsha V. for removing left right border of column
column.setCellStyleNames("removeBorderForGrid");
//Ended by Varsha V. for removing left right border of column
header = new ResizableHeader<DataGridTableRowModel>(colName, this, column ) {
@Override
public String getValue() {
......@@ -333,7 +370,10 @@ public class CustomGrid extends AbstractDataGrid<DataGridTableRowModel>
return "";
}
};
this.addColumn(column, header, null);
//Added and commented by Varsha V. for changing alignment for table header
//this.addColumn(column, header, null);
this.addColumn(column, htmlColumnHeader, null);
//Added and commented by Varsha V. for changing alignment for table header
}
caption = graphCaptionList.get(0);
dataProvider.addDataDisplay( this );
......@@ -452,12 +492,15 @@ public class CustomGrid extends AbstractDataGrid<DataGridTableRowModel>
}
}
//flexTable.setHeight( Window.getClientHeight() - 240 + "px" );
flexTable.setHeight("280px");
setHeight("280px");
flexTable.setHeight("270px"); //changed by Varsha V. for grid height
setHeight("270px"); //changed by Varsha V. for grid height
/*setHeight( Window.getClientHeight() - 207+ "px" );*/
/*setHeight( ( ( Window.getClientHeight() - 250 ))+ "px" );*/
addStyleName("e12AdvDataGrid-SideBars");
Element theaderGrid = getTableHeadElement();
//Added by Varsha V. for setting id for table header
theaderGrid.setAttribute("id", "removeBorderGrid");
//Added by Varsha V. for setting id for table header
return flexTable;
}
......
......@@ -32,7 +32,6 @@ import com.google.gwt.user.client.ui.MenuBar;
import com.google.gwt.user.client.ui.MenuItem;
import com.google.gwt.user.client.ui.PopupPanel;
import com.google.gwt.user.client.ui.RadioButton;
import com.google.gwt.user.client.ui.RootPanel;
import com.google.gwt.user.client.ui.ScrollPanel;
import com.google.gwt.user.client.ui.TextBox;
import com.google.gwt.user.client.ui.VerticalPanel;
......@@ -59,7 +58,10 @@ public class FilterCreator extends Composite
public static ArrayList<String> title = new ArrayList<String>();
public static ArrayList<String> parameterList = null;
public static ArrayList<String> parameterListDtl = null;
//Added by Varsha V for adding subtitle for GST dashboard
Label subTitleLbl = null;
VerticalPanel headingLablePanel = new VerticalPanel();
//Ended by Varsha V for adding subtitle for GST dashboard
public FilterCreator(ArrayList<String> parameterList, JSONObject metaDataJsnObj, String childID)
{
/*Add code for set ParameterList and metaDataJsnObj By Dhanendra on date 14-10-2016*/
......@@ -82,6 +84,9 @@ public class FilterCreator extends Composite
this.parameterList = parameterList;
this.parameterListDtl = parameterList;
titleLbl = new Label();
//Added by Varsha V for adding subtitle for GST dashboard
subTitleLbl = new Label();
//Ended by Varsha V for adding subtitle for GST dashboard
setTitleOnFilterSubmit(parameterList, metaDataJsnObj);
xmlName = parameterList.get(0);
headingLblImg.setStyleName("filterImage");
......@@ -90,11 +95,19 @@ public class FilterCreator extends Composite
{
headingLableImgPanel.add(getViewFilter(parameterList, metaDataJsnObj));
}*/
headingLableImgPanel.add(titleLbl);
//Added changes by Varsha V for adding subtitle for GST dashboard
headingLablePanel.add(titleLbl);
headingLablePanel.add(subTitleLbl);
headingLableImgPanel.add(headingLablePanel);
//Ended by Varsha V for adding subtitle for GST dashboard
lablePnl.add(headingLableImgPanel);
titleLbl.getElement().setId("titleLbl");
lablePnl.setStylePrimaryName("lablePanleCSS");
lablePnl.setCellHorizontalAlignment(titleLbl, HasHorizontalAlignment.ALIGN_LEFT);
//Added changes by Varsha V for adding subtitle for GST dashboard
subTitleLbl.getElement().setId("subTitleLbl");
lablePnl.setCellHorizontalAlignment(subTitleLbl, HasHorizontalAlignment.ALIGN_LEFT);
//Ended by Varsha V for adding subtitle for GST dashboard
openFltrImg.setStyleName("filterImage");
fltrImgPnl.add(openFltrImg);
/*Menu Bar Move to left side panel to right side By Dhanendra on date 20-02-2017*/
......@@ -104,7 +117,9 @@ public class FilterCreator extends Composite
}
/*End Bar Move to left side panel to right side By Dhanendra on date 20-02-2017*/
fltrImgPnl.setCellHorizontalAlignment(openFltrImg, HasHorizontalAlignment.ALIGN_RIGHT);
fltrImgPnl.setStylePrimaryName("vPanelCSS");
//Added changes by Varsha V for changing filter display type
fltrImgPnl.setStylePrimaryName("vfilterPanelCSS");
//Added changes by Varsha V for changing filter display type
horizontlPnl.setWidth("100%");
/*fltrImgPnl.setWidth("100%");*/
lablePnl.setWidth("100%");
......@@ -484,8 +499,8 @@ public class FilterCreator extends Composite
//flexTable.setBorderWidth(1);
flexTable.setStyleName("flexTable");
final CheckBox selectAllChkBox = new CheckBox();
//Added by varsha to set default check on all checkbox on dated 10 July 17
selectAllChkBox.setValue(true);
//Added by varsha to set default uncheck on all checkbox on dated 10 July 17
//selectAllChkBox.setValue(true);
for (int colNo = 0; colNo < columnCnt + 1; colNo++)
{
if (colNo == 0)
......@@ -1123,6 +1138,10 @@ public class FilterCreator extends Composite
String temp = "";
String subTitle = "";
StringBuffer fltrNameNDataBfr = new StringBuffer();
//Added by Varsha V. for subtitle for GST
StringBuffer subFltrNameNDataBfr = new StringBuffer();
String subReportHeading = "";
//Ended by Varsha V. for subtitle for GST
String reportHeading = "";
String filtrEntrdData = "";
String filterDescr = "";
......@@ -1139,7 +1158,63 @@ public class FilterCreator extends Composite
title = new MetaDataDtl().getTitle(metaDataJsnObj);
/** Start : to add multiple parameter in title date: 12/June/2015 **/
//Added by Varsha V. for GST title and subtitle
if (metadatName == "gst")
{
for (FilterInfo filterInfo : filterList)
{
if ("1".equals(filterInfo.getShowOnTitle()))
{
filterDescr = filterInfo.getColDescr().trim() + " ";
/*Add change parameter list variable for display description on title by Dhanendra on date 14-02-2017*/
//filtrEntrdData = getMonth(parameterList.get(count + 1));
filtrEntrdData = getMonth(getParameterListDtl().get(count + 1));
/*End change parameter list variable for display description on title by Dhanendra on date 14-02-2017*/
if (fltrNameNDataBfr.length() > 0)
{
if (filtrEntrdData.length() > 0)
{
fltrNameNDataBfr.append(" " + filtrEntrdData);
}
} else
{
if (filtrEntrdData.length() > 0)
{
fltrNameNDataBfr.append( filtrEntrdData);
}
}
}
if ("1".equals(filterInfo.getShowOnTitleIndex()))
{
filterDescr = filterInfo.getColDescr().trim() + " : ";
/*Add change parameter list variable for display description on title by Dhanendra on date 14-02-2017*/
//filtrEntrdData = getMonth(parameterList.get(count + 1));
filtrEntrdData = getMonth(getParameterListDtl().get(count + 1));
/*End change parameter list variable for display description on title by Dhanendra on date 14-02-2017*/
if (subFltrNameNDataBfr.length() > 0)
{
if (filtrEntrdData.length() > 0)
{
subFltrNameNDataBfr.append(", " + filterDescr + filtrEntrdData);
}
} else
{
if (filtrEntrdData.length() > 0)
{
subFltrNameNDataBfr.append(filterDescr + filtrEntrdData);
}
}
}
count++;
}
reportHeading = fltrNameNDataBfr.toString();
subReportHeading = subFltrNameNDataBfr.toString();
//Window.alert("reportHeading: "+reportHeading);
}//Ended by Varsha V. for GST title and subtitle
else
{
for (FilterInfo filterInfo : filterList)
{
if ("1".equals(filterInfo.getShowOnTitle()))
......@@ -1148,6 +1223,7 @@ public class FilterCreator extends Composite
/*Add change parameter list variable for display description on title by Dhanendra on date 14-02-2017*/
//filtrEntrdData = getMonth(parameterList.get(count + 1));
filtrEntrdData = getMonth(getParameterListDtl().get(count + 1));
/*End change parameter list variable for display description on title by Dhanendra on date 14-02-2017*/
if (fltrNameNDataBfr.length() > 0)
{
......@@ -1166,6 +1242,9 @@ public class FilterCreator extends Composite
count++;
}
reportHeading = fltrNameNDataBfr.toString();
}
/** End : to add multiple parameter in title **/
CommonUtils.printOnConsole("In filter submit title set reportHeading: "+reportHeading);
if (metadatName == "halolmfgmonth")
......@@ -1235,8 +1314,18 @@ public class FilterCreator extends Composite
{
/*add condition for remove onload - */
if(reportHeading.length()>0)
{
//Added by Varsha V. for GST speific title and subtitile
if(metadatName.equalsIgnoreCase("gst"))
{
titleLbl.setText(title.get(0) + " " + getMonth(reportHeading));//+ "-" + parameterList.get(2));
subTitleLbl.setText(""+getMonth(subReportHeading));
}
else
{
titleLbl.setText(title.get(0) + " - " + getMonth(reportHeading));//+ "-" + parameterList.get(2));
}
//Ended by Varsha V. for GST speific title and subtitile
}else
{
titleLbl.setText(title.get(0));
......
......@@ -148,7 +148,6 @@ public class GWTDashBoardReport implements EntryPoint
/*End code for current prd code by dhanendra on 06-10-2015 */
else
{
parameterList.add(Window.Location.getParameter(filterInfo.getFieldName()) == null ? "" : Window.Location.getParameter(filterInfo.getFieldName()));
}
}
......
......@@ -67,6 +67,7 @@ public class GraphComponent extends Composite
static ArrayList<String> idList = new ArrayList<String>();
HashMap<String, ArrayList<String>> graphCaptioneMap=null;
ArrayList<String> graphCaptionList= new ArrayList<String>();
int counter = 0;
/**
* This constructor initializes the graphcontainer
*
......@@ -696,6 +697,26 @@ public class GraphComponent extends Composite
String currentID = "Graph"+uniqueId+componentId+"Div";
CommonUtils.printOnConsole("dataJsn for jsonObjFrGraph :"+jsonObjFrGraph);
//Added code by varsha v. for prefix and postfix currency comp subtitle
String subTitleColumn = "";
String[] subTitleArray = new String[2];
List<String> subTitleColumnName = null;
for (int i = 0; i < graphDtlList.size(); i++)
{
if (i == 27)
{
subTitleColumnName = (ArrayList<String>)graphDtlList.get(i);
}
}
for(int i = 0; i < subTitleColumnName.size(); i++)
{
subTitleColumn = subTitleColumnName.get(i);
if(subTitleColumn.contains("-"))
{
subTitleArray = subTitleColumn.split("-");
}
}
//Ended code by varsha v. for prefix and postfix currency comp subtitle
graphJson = ChartCreator.buildChartData(graphDtlList, jsonObjFrGraph, dtSrouce,parameterList,filterList,currentID,null);
double summaryValue = ChartCreator.getSubTitleSummary(graphDtlList, jsonObjFrGraph, dtSrouce);
CommonUtils.printOnConsole("summaryValue :"+summaryValue);
......@@ -805,13 +826,50 @@ public class GraphComponent extends Composite
if(isCompSubTitle)
{
Label subTitleValLabel = new Label(NumberFormat.getInstance().format(summaryValue));
Label subTitleINRLabel = new Label("INR");
Label subTitleINRLabel = new Label(subTitleArray[0]);
subTitleValLabel.setStyleName("titleValLabel");
subTitleINRLabel.setStyleName("titleValINRLabel");
HorizontalPanel subTitlePanel = new HorizontalPanel();
subTitlePanel.setStyleName("titleValPanel");
//Added code by varsha v. for prefix and postfix currency comp subtitle
if(subTitleArray.length>1)
{
if(subTitleArray[0].equalsIgnoreCase("#"))
{
if(subTitleArray[1].equalsIgnoreCase("prefix"))
{
subTitleValLabel = new Label(subTitleArray[0]+" "+NumberFormat.getInstance().format(summaryValue));
subTitleValLabel.setStyleName("titleValLabel");
subTitlePanel.add(subTitleValLabel);
}
else
{
subTitleValLabel = new Label(NumberFormat.getInstance().format(summaryValue)+" "+subTitleArray[0]);
subTitleValLabel.setStyleName("titleValLabel");
subTitlePanel.add(subTitleValLabel);
}
}
else
{
if(subTitleArray[1].equalsIgnoreCase("prefix"))
{
subTitlePanel.add(subTitleINRLabel);
subTitlePanel.add(subTitleValLabel);
}
else
{
subTitlePanel.add(subTitleValLabel);
subTitlePanel.add(subTitleINRLabel);
}
}
}
else
{
subTitlePanel.add(subTitleValLabel);
subTitlePanel.add(subTitleINRLabel);
}
//Ended code by varsha v. for prefix and postfix currency comp subtitle
subTitlePanel.setCellVerticalAlignment(subTitleINRLabel, HasVerticalAlignment.ALIGN_MIDDLE);
mainPanel.add(subTitlePanel);
......@@ -966,10 +1024,10 @@ public class GraphComponent extends Composite
HorizontalPanel gridTtlPanel = new HorizontalPanel();
if(!childID.equalsIgnoreCase(""))
{
gridComponantTitleName = gridComponantTitleName+ " : " +parameterList.get(parameterList.size()-2);
gridComponantTitleName = gridComponantTitleName+ " : " +parameterList.get(parameterList.size()-2).replace("%20"," ");
}else if(cellVal.trim().length()>0)
{
gridComponantTitleName = gridComponantTitleName+ " : " +parameterList.get(parameterList.size()-2);
gridComponantTitleName = gridComponantTitleName+ " : " +parameterList.get(parameterList.size()-2).replace("%20"," ");
}
//Added code for displaying refresh icon and date on dashboard by Varsha on 19/01/2017
......@@ -1421,7 +1479,12 @@ public class GraphComponent extends Composite
componantTitlNameList = (ArrayList<String>) graphDtlList.get(1);
groupCssTypeNameList = (ArrayList<String>) graphDtlList.get(2);
gridIconName = ""+graphDtlList.get(7);
//Added by varsa v. for dispaying card without card panel on basis of icon
gridCssName = ""+groupCssTypeNameList.get(0).trim();
HorizontalPanel mainPanel = new HorizontalPanel();
mainPanel.setStyleName("mainPanel");
if(gridIconName.length()>2)
{
//Added by varsha for card subtitle in card on 10 July 17
subTitleIDList = (ArrayList<String>) graphDtlList.get(10);
subTitleNameList = (ArrayList<String>) graphDtlList.get(11);
......@@ -1447,7 +1510,6 @@ public class GraphComponent extends Composite
dateHPanel.add(refreshDateTime);
dateHPanel.add(refreshImg);
if(cellVal.trim().length()>0)
{
gridComponantTitleName = ""+componantTitlNameList.get(0)+": "+cellVal;
......@@ -1456,13 +1518,13 @@ public class GraphComponent extends Composite
{
gridComponantTitleName = ""+componantTitlNameList.get(0);
}
String appendStringtoTitle = parameterList.get(parameterList.size()-2).replace("%20", " ");
if(!childID.equalsIgnoreCase(""))
{
gridComponantTitleName = gridComponantTitleName + " : " + parameterList.get(parameterList.size()-2);
gridComponantTitleName = gridComponantTitleName + " : " + appendStringtoTitle;
}
gridCssName = ""+groupCssTypeNameList.get(0);
gridTitleLbl = new Label(gridComponantTitleName);
gridTtlImg.setStyleName("componantTtlImg");
gridTitleLbl.setStyleName("componantTtl");
......@@ -1470,8 +1532,7 @@ public class GraphComponent extends Composite
gridTtlPanel.add(gridTitleLbl);
gridTtlPanel.setCellWidth( gridTtlImg, "2%" );*/
HorizontalPanel mainPanel = new HorizontalPanel();
mainPanel.setStyleName("mainPanel");
VerticalPanel verticalPanel = new VerticalPanel();
verticalPanel.add(gridTitleLbl);
verticalPanel.add(dateHPanel);
......@@ -1498,7 +1559,9 @@ public class GraphComponent extends Composite
subTitlePanel.setCellVerticalAlignment(subTitleINRLabel, HasVerticalAlignment.ALIGN_MIDDLE);
mainPanel.add(subTitlePanel);
}
}
//Ended by varsha for card subtitle in card on 10 July 17
//Added by varsa v. for dispaying card without card panel on basis of icon
final Label closeButton = new Label("x");
closeButton.setStyleName("closeButtonStyle");
closeButton.getElement().setId("Card"+uniqueId+componentId+"Div");
......
......@@ -2568,4 +2568,46 @@ public class MetaDataDtl
return graphDtlList;
}
/*End New Bubble Chart using Chart.js by Dhanendra on date 16-01-17*/
public String getDataSource(JSONObject jsonObjMetadata)
{
Document document = null;
String xmlMetadata = null;
Node rootNode = null;
NodeList rootNodeList = null;
String dataSourceName = "";
if (jsonObjMetadata != null)
{
xmlMetadata = jsonObjMetadata.get("metaData").toString();
xmlMetadata = jsonObjMetadata.get("metaData").toString().replace("\\", "").trim();
xmlMetadata = xmlMetadata.replace('"', ' ').trim();
try
{
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 ("datasource".equals(rootNode.getNodeName()))
{
dataSourceName = rootNode.getAttributes().getNamedItem("driverName").getNodeValue();
if(dataSourceName.length()>1)
{
break;
}
}
}
}
} catch (Exception e)
{
Window.alert(" Exception :: :: getDataSource New() :: MetaDataDtl [" + e.getMessage() + "]");
}
}
CommonUtils.printOnConsole("================dataSourceName: "+dataSourceName);
return dataSourceName;
}
}
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