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; ...@@ -27,6 +27,7 @@ import com.google.gwt.dom.client.TableRowElement;
import com.google.gwt.dom.client.TableSectionElement; import com.google.gwt.dom.client.TableSectionElement;
import com.google.gwt.json.client.JSONObject; import com.google.gwt.json.client.JSONObject;
import com.google.gwt.json.client.JSONValue; 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;
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.Header; import com.google.gwt.user.cellview.client.Header;
...@@ -245,6 +246,9 @@ public class CustomGrid extends AbstractDataGrid<DataGridTableRowModel> ...@@ -245,6 +246,9 @@ public class CustomGrid extends AbstractDataGrid<DataGridTableRowModel>
//Add by Dnyaneshwar chavan on 07-DEC-2012 [WS2GSUN002 || ] End //Add by Dnyaneshwar chavan on 07-DEC-2012 [WS2GSUN002 || ] End
String caption =""; String caption ="";
ResizableHeader<DataGridTableRowModel> header=null; 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 try
{ {
E12CustomTextCell.isValidate = false; E12CustomTextCell.isValidate = false;
...@@ -275,14 +279,44 @@ public class CustomGrid extends AbstractDataGrid<DataGridTableRowModel> ...@@ -275,14 +279,44 @@ public class CustomGrid extends AbstractDataGrid<DataGridTableRowModel>
if(graphAlignList.get(i).trim().equalsIgnoreCase("left")) if(graphAlignList.get(i).trim().equalsIgnoreCase("left"))
{ {
column.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_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")) else if(graphAlignList.get(i).trim().equalsIgnoreCase("right"))
{ {
column.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_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")) else if(graphAlignList.get(i).trim().equalsIgnoreCase("center"))
{ {
column.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_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 /*if ( i == 0 ) // commented for onload sorting
{ {
...@@ -321,6 +355,9 @@ public class CustomGrid extends AbstractDataGrid<DataGridTableRowModel> ...@@ -321,6 +355,9 @@ public class CustomGrid extends AbstractDataGrid<DataGridTableRowModel>
} }
}); });
this.setColumnWidth( column, width +"px" ); 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 ) { header = new ResizableHeader<DataGridTableRowModel>(colName, this, column ) {
@Override @Override
public String getValue() { public String getValue() {
...@@ -333,7 +370,10 @@ public class CustomGrid extends AbstractDataGrid<DataGridTableRowModel> ...@@ -333,7 +370,10 @@ public class CustomGrid extends AbstractDataGrid<DataGridTableRowModel>
return ""; 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); caption = graphCaptionList.get(0);
dataProvider.addDataDisplay( this ); dataProvider.addDataDisplay( this );
...@@ -452,12 +492,15 @@ public class CustomGrid extends AbstractDataGrid<DataGridTableRowModel> ...@@ -452,12 +492,15 @@ public class CustomGrid extends AbstractDataGrid<DataGridTableRowModel>
} }
} }
//flexTable.setHeight( Window.getClientHeight() - 240 + "px" ); //flexTable.setHeight( Window.getClientHeight() - 240 + "px" );
flexTable.setHeight("280px"); flexTable.setHeight("270px"); //changed by Varsha V. for grid height
setHeight("280px"); setHeight("270px"); //changed by Varsha V. for grid height
/*setHeight( Window.getClientHeight() - 207+ "px" );*/ /*setHeight( Window.getClientHeight() - 207+ "px" );*/
/*setHeight( ( ( Window.getClientHeight() - 250 ))+ "px" );*/ /*setHeight( ( ( Window.getClientHeight() - 250 ))+ "px" );*/
addStyleName("e12AdvDataGrid-SideBars"); 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; return flexTable;
} }
......
...@@ -32,7 +32,6 @@ import com.google.gwt.user.client.ui.MenuBar; ...@@ -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.MenuItem;
import com.google.gwt.user.client.ui.PopupPanel; import com.google.gwt.user.client.ui.PopupPanel;
import com.google.gwt.user.client.ui.RadioButton; 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.ScrollPanel;
import com.google.gwt.user.client.ui.TextBox; import com.google.gwt.user.client.ui.TextBox;
import com.google.gwt.user.client.ui.VerticalPanel; import com.google.gwt.user.client.ui.VerticalPanel;
...@@ -59,7 +58,10 @@ public class FilterCreator extends Composite ...@@ -59,7 +58,10 @@ public class FilterCreator extends Composite
public static ArrayList<String> title = new ArrayList<String>(); public static ArrayList<String> title = new ArrayList<String>();
public static ArrayList<String> parameterList = null; public static ArrayList<String> parameterList = null;
public static ArrayList<String> parameterListDtl = 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) public FilterCreator(ArrayList<String> parameterList, JSONObject metaDataJsnObj, String childID)
{ {
/*Add code for set ParameterList and metaDataJsnObj By Dhanendra on date 14-10-2016*/ /*Add code for set ParameterList and metaDataJsnObj By Dhanendra on date 14-10-2016*/
...@@ -82,6 +84,9 @@ public class FilterCreator extends Composite ...@@ -82,6 +84,9 @@ public class FilterCreator extends Composite
this.parameterList = parameterList; this.parameterList = parameterList;
this.parameterListDtl = parameterList; this.parameterListDtl = parameterList;
titleLbl = new Label(); 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); setTitleOnFilterSubmit(parameterList, metaDataJsnObj);
xmlName = parameterList.get(0); xmlName = parameterList.get(0);
headingLblImg.setStyleName("filterImage"); headingLblImg.setStyleName("filterImage");
...@@ -90,11 +95,19 @@ public class FilterCreator extends Composite ...@@ -90,11 +95,19 @@ public class FilterCreator extends Composite
{ {
headingLableImgPanel.add(getViewFilter(parameterList, metaDataJsnObj)); 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); lablePnl.add(headingLableImgPanel);
titleLbl.getElement().setId("titleLbl"); titleLbl.getElement().setId("titleLbl");
lablePnl.setStylePrimaryName("lablePanleCSS"); lablePnl.setStylePrimaryName("lablePanleCSS");
lablePnl.setCellHorizontalAlignment(titleLbl, HasHorizontalAlignment.ALIGN_LEFT); 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"); openFltrImg.setStyleName("filterImage");
fltrImgPnl.add(openFltrImg); fltrImgPnl.add(openFltrImg);
/*Menu Bar Move to left side panel to right side By Dhanendra on date 20-02-2017*/ /*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 ...@@ -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*/ /*End Bar Move to left side panel to right side By Dhanendra on date 20-02-2017*/
fltrImgPnl.setCellHorizontalAlignment(openFltrImg, HasHorizontalAlignment.ALIGN_RIGHT); 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%"); horizontlPnl.setWidth("100%");
/*fltrImgPnl.setWidth("100%");*/ /*fltrImgPnl.setWidth("100%");*/
lablePnl.setWidth("100%"); lablePnl.setWidth("100%");
...@@ -484,8 +499,8 @@ public class FilterCreator extends Composite ...@@ -484,8 +499,8 @@ public class FilterCreator extends Composite
//flexTable.setBorderWidth(1); //flexTable.setBorderWidth(1);
flexTable.setStyleName("flexTable"); flexTable.setStyleName("flexTable");
final CheckBox selectAllChkBox = new CheckBox(); final CheckBox selectAllChkBox = new CheckBox();
//Added by varsha to set default check on all checkbox on dated 10 July 17 //Added by varsha to set default uncheck on all checkbox on dated 10 July 17
selectAllChkBox.setValue(true); //selectAllChkBox.setValue(true);
for (int colNo = 0; colNo < columnCnt + 1; colNo++) for (int colNo = 0; colNo < columnCnt + 1; colNo++)
{ {
if (colNo == 0) if (colNo == 0)
...@@ -1123,6 +1138,10 @@ public class FilterCreator extends Composite ...@@ -1123,6 +1138,10 @@ public class FilterCreator extends Composite
String temp = ""; String temp = "";
String subTitle = ""; String subTitle = "";
StringBuffer fltrNameNDataBfr = new StringBuffer(); 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 reportHeading = "";
String filtrEntrdData = ""; String filtrEntrdData = "";
String filterDescr = ""; String filterDescr = "";
...@@ -1139,33 +1158,93 @@ public class FilterCreator extends Composite ...@@ -1139,33 +1158,93 @@ public class FilterCreator extends Composite
title = new MetaDataDtl().getTitle(metaDataJsnObj); title = new MetaDataDtl().getTitle(metaDataJsnObj);
/** Start : to add multiple parameter in title date: 12/June/2015 **/ /** Start : to add multiple parameter in title date: 12/June/2015 **/
//Added by Varsha V. for GST title and subtitle
for (FilterInfo filterInfo : filterList) if (metadatName == "gst")
{ {
if ("1".equals(filterInfo.getShowOnTitle())) for (FilterInfo filterInfo : filterList)
{ {
filterDescr = filterInfo.getColDescr().trim() + " : "; if ("1".equals(filterInfo.getShowOnTitle()))
/*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) 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
{ {
fltrNameNDataBfr.append(", " + filterDescr + filtrEntrdData); if (filtrEntrdData.length() > 0)
{
fltrNameNDataBfr.append( filtrEntrdData);
}
} }
} else }
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()))
{ {
if (filtrEntrdData.length() > 0) 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)
{ {
fltrNameNDataBfr.append(filterDescr + filtrEntrdData); if (filtrEntrdData.length() > 0)
{
fltrNameNDataBfr.append(", " + filterDescr + filtrEntrdData);
}
} else
{
if (filtrEntrdData.length() > 0)
{
fltrNameNDataBfr.append(filterDescr + filtrEntrdData);
}
} }
} }
count++;
} }
count++; reportHeading = fltrNameNDataBfr.toString();
} }
reportHeading = fltrNameNDataBfr.toString();
/** End : to add multiple parameter in title **/ /** End : to add multiple parameter in title **/
CommonUtils.printOnConsole("In filter submit title set reportHeading: "+reportHeading); CommonUtils.printOnConsole("In filter submit title set reportHeading: "+reportHeading);
if (metadatName == "halolmfgmonth") if (metadatName == "halolmfgmonth")
...@@ -1236,7 +1315,17 @@ public class FilterCreator extends Composite ...@@ -1236,7 +1315,17 @@ public class FilterCreator extends Composite
/*add condition for remove onload - */ /*add condition for remove onload - */
if(reportHeading.length()>0) if(reportHeading.length()>0)
{ {
titleLbl.setText(title.get(0) + " - " + getMonth(reportHeading));//+ "-" + parameterList.get(2)); //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 }else
{ {
titleLbl.setText(title.get(0)); titleLbl.setText(title.get(0));
......
...@@ -75,7 +75,7 @@ public class GWTDashBoardReport implements EntryPoint ...@@ -75,7 +75,7 @@ public class GWTDashBoardReport implements EntryPoint
public void getParameterList(JSONObject metaDataJsnObj) public void getParameterList(JSONObject metaDataJsnObj)
{ {
Date date = new Date(); Date date = new Date();
//1 //1
SimpleDateFormat simpleDateFormat= new SimpleDateFormat("MMMM"); SimpleDateFormat simpleDateFormat= new SimpleDateFormat("MMMM");
String currentMonth = simpleDateFormat.format(date); String currentMonth = simpleDateFormat.format(date);
...@@ -148,7 +148,6 @@ public class GWTDashBoardReport implements EntryPoint ...@@ -148,7 +148,6 @@ public class GWTDashBoardReport implements EntryPoint
/*End code for current prd code by dhanendra on 06-10-2015 */ /*End code for current prd code by dhanendra on 06-10-2015 */
else else
{ {
parameterList.add(Window.Location.getParameter(filterInfo.getFieldName()) == null ? "" : Window.Location.getParameter(filterInfo.getFieldName())); parameterList.add(Window.Location.getParameter(filterInfo.getFieldName()) == null ? "" : Window.Location.getParameter(filterInfo.getFieldName()));
} }
} }
......
...@@ -67,6 +67,7 @@ public class GraphComponent extends Composite ...@@ -67,6 +67,7 @@ public class GraphComponent extends Composite
static ArrayList<String> idList = new ArrayList<String>(); static ArrayList<String> idList = new ArrayList<String>();
HashMap<String, ArrayList<String>> graphCaptioneMap=null; HashMap<String, ArrayList<String>> graphCaptioneMap=null;
ArrayList<String> graphCaptionList= new ArrayList<String>(); ArrayList<String> graphCaptionList= new ArrayList<String>();
int counter = 0;
/** /**
* This constructor initializes the graphcontainer * This constructor initializes the graphcontainer
* *
...@@ -696,6 +697,26 @@ public class GraphComponent extends Composite ...@@ -696,6 +697,26 @@ public class GraphComponent extends Composite
String currentID = "Graph"+uniqueId+componentId+"Div"; String currentID = "Graph"+uniqueId+componentId+"Div";
CommonUtils.printOnConsole("dataJsn for jsonObjFrGraph :"+jsonObjFrGraph); 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); graphJson = ChartCreator.buildChartData(graphDtlList, jsonObjFrGraph, dtSrouce,parameterList,filterList,currentID,null);
double summaryValue = ChartCreator.getSubTitleSummary(graphDtlList, jsonObjFrGraph, dtSrouce); double summaryValue = ChartCreator.getSubTitleSummary(graphDtlList, jsonObjFrGraph, dtSrouce);
CommonUtils.printOnConsole("summaryValue :"+summaryValue); CommonUtils.printOnConsole("summaryValue :"+summaryValue);
...@@ -805,13 +826,50 @@ public class GraphComponent extends Composite ...@@ -805,13 +826,50 @@ public class GraphComponent extends Composite
if(isCompSubTitle) if(isCompSubTitle)
{ {
Label subTitleValLabel = new Label(NumberFormat.getInstance().format(summaryValue)); Label subTitleValLabel = new Label(NumberFormat.getInstance().format(summaryValue));
Label subTitleINRLabel = new Label("INR"); Label subTitleINRLabel = new Label(subTitleArray[0]);
subTitleValLabel.setStyleName("titleValLabel"); subTitleValLabel.setStyleName("titleValLabel");
subTitleINRLabel.setStyleName("titleValINRLabel"); subTitleINRLabel.setStyleName("titleValINRLabel");
HorizontalPanel subTitlePanel = new HorizontalPanel(); HorizontalPanel subTitlePanel = new HorizontalPanel();
subTitlePanel.setStyleName("titleValPanel"); subTitlePanel.setStyleName("titleValPanel");
subTitlePanel.add(subTitleValLabel); //Added code by varsha v. for prefix and postfix currency comp subtitle
subTitlePanel.add(subTitleINRLabel); 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); subTitlePanel.setCellVerticalAlignment(subTitleINRLabel, HasVerticalAlignment.ALIGN_MIDDLE);
mainPanel.add(subTitlePanel); mainPanel.add(subTitlePanel);
...@@ -966,10 +1024,10 @@ public class GraphComponent extends Composite ...@@ -966,10 +1024,10 @@ public class GraphComponent extends Composite
HorizontalPanel gridTtlPanel = new HorizontalPanel(); HorizontalPanel gridTtlPanel = new HorizontalPanel();
if(!childID.equalsIgnoreCase("")) 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) }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 //Added code for displaying refresh icon and date on dashboard by Varsha on 19/01/2017
...@@ -1078,7 +1136,7 @@ public class GraphComponent extends Composite ...@@ -1078,7 +1136,7 @@ public class GraphComponent extends Composite
this.focusOnDiv("Grid"+uniqueId+componentId+"Div"); this.focusOnDiv("Grid"+uniqueId+componentId+"Div");
} }
/*Add uniqueId to Grid by Dhanendra on date 10-11-2015*/ /*Add uniqueId to Grid by Dhanendra on date 10-11-2015*/
/*Ended code for Dyanamic Div and New CSS By Dhanendra 01-07-15*/ /*Ended code for Dyanamic Div and New CSS By Dhanendra 01-07-15*/
/*RootPanel.get("chartContainer"+componentId).clear(); /*RootPanel.get("chartContainer"+componentId).clear();
...@@ -1421,84 +1479,89 @@ public class GraphComponent extends Composite ...@@ -1421,84 +1479,89 @@ public class GraphComponent extends Composite
componantTitlNameList = (ArrayList<String>) graphDtlList.get(1); componantTitlNameList = (ArrayList<String>) graphDtlList.get(1);
groupCssTypeNameList = (ArrayList<String>) graphDtlList.get(2); groupCssTypeNameList = (ArrayList<String>) graphDtlList.get(2);
gridIconName = ""+graphDtlList.get(7); gridIconName = ""+graphDtlList.get(7);
//Added by varsa v. for dispaying card without card panel on basis of icon
//Added by varsha for card subtitle in card on 10 July 17 gridCssName = ""+groupCssTypeNameList.get(0).trim();
subTitleIDList = (ArrayList<String>) graphDtlList.get(10);
subTitleNameList = (ArrayList<String>) graphDtlList.get(11);
if(!subTitleIDList.isEmpty())
{
isCardCompSubTitle = true;
}
//Ended by varsha for card subtitle in card on 10 July 17
Image gridTtlImg = new Image("FusionChart/images/"+gridIconName);
HorizontalPanel gridTtlPanel = new HorizontalPanel();
final Image refreshImg = new Image("FusionChart/images/refresh.png");
refreshImg.setStyleName("refreshIcon");
SimpleDateFormat dispDateTimeFormat = new SimpleDateFormat("dd-MMM-yyyy HH:mm:ss");
Date date = new Date();
String strDate = dispDateTimeFormat.format(date);
String dateformat = getTimeSince(strDate);
Label refreshDateTime = new Label("Refreshed "+dateformat);
final HorizontalPanel dateHPanel = new HorizontalPanel();
refreshDateTime.setStyleName("refreshDateTime");
dateHPanel.setStyleName("refreshDatePanel");
dateHPanel.add(refreshDateTime);
dateHPanel.add(refreshImg);
if(cellVal.trim().length()>0)
{
gridComponantTitleName = ""+componantTitlNameList.get(0)+": "+cellVal;
}
else
{
gridComponantTitleName = ""+componantTitlNameList.get(0);
}
if(!childID.equalsIgnoreCase(""))
{
gridComponantTitleName = gridComponantTitleName + " : " + parameterList.get(parameterList.size()-2);
}
gridCssName = ""+groupCssTypeNameList.get(0);
gridTitleLbl = new Label(gridComponantTitleName);
gridTtlImg.setStyleName("componantTtlImg");
gridTitleLbl.setStyleName("componantTtl");
/*gridTtlPanel.add(gridTtlImg);
gridTtlPanel.add(gridTitleLbl);
gridTtlPanel.setCellWidth( gridTtlImg, "2%" );*/
HorizontalPanel mainPanel = new HorizontalPanel(); HorizontalPanel mainPanel = new HorizontalPanel();
mainPanel.setStyleName("mainPanel"); mainPanel.setStyleName("mainPanel");
VerticalPanel verticalPanel = new VerticalPanel(); if(gridIconName.length()>2)
verticalPanel.add(gridTitleLbl);
verticalPanel.add(dateHPanel);
gridTtlPanel.add(verticalPanel);
HorizontalPanel horizontalPanel = new HorizontalPanel();
horizontalPanel.add(gridTtlImg);
horizontalPanel.setCellVerticalAlignment(gridTtlImg, HasVerticalAlignment.ALIGN_MIDDLE);
horizontalPanel.add(gridTtlPanel);
mainPanel.add(horizontalPanel);
//Added by varsha for card subtitle in card on 10 July 17
if(isCardCompSubTitle)
{ {
//double summaryValue = data.getSubTitleSummary(jsonObjFrGraph, dtSrouce, gridComponantSubTitle); //Added by varsha for card subtitle in card on 10 July 17
double summaryValue = CardBuilder.getCardSubTitleSummary(jsonObjFrGraph, dtSrouce, subTitleIDList, subTitleNameList); subTitleIDList = (ArrayList<String>) graphDtlList.get(10);
subTitleNameList = (ArrayList<String>) graphDtlList.get(11);
if(!subTitleIDList.isEmpty())
{
isCardCompSubTitle = true;
}
//Ended by varsha for card subtitle in card on 10 July 17
Image gridTtlImg = new Image("FusionChart/images/"+gridIconName);
HorizontalPanel gridTtlPanel = new HorizontalPanel();
final Image refreshImg = new Image("FusionChart/images/refresh.png");
refreshImg.setStyleName("refreshIcon");
SimpleDateFormat dispDateTimeFormat = new SimpleDateFormat("dd-MMM-yyyy HH:mm:ss");
Date date = new Date();
String strDate = dispDateTimeFormat.format(date);
String dateformat = getTimeSince(strDate);
Label refreshDateTime = new Label("Refreshed "+dateformat);
final HorizontalPanel dateHPanel = new HorizontalPanel();
refreshDateTime.setStyleName("refreshDateTime");
dateHPanel.setStyleName("refreshDatePanel");
dateHPanel.add(refreshDateTime);
dateHPanel.add(refreshImg);
if(cellVal.trim().length()>0)
{
gridComponantTitleName = ""+componantTitlNameList.get(0)+": "+cellVal;
}
else
{
gridComponantTitleName = ""+componantTitlNameList.get(0);
}
String appendStringtoTitle = parameterList.get(parameterList.size()-2).replace("%20", " ");
if(!childID.equalsIgnoreCase(""))
{
gridComponantTitleName = gridComponantTitleName + " : " + appendStringtoTitle;
}
gridTitleLbl = new Label(gridComponantTitleName);
gridTtlImg.setStyleName("componantTtlImg");
gridTitleLbl.setStyleName("componantTtl");
/*gridTtlPanel.add(gridTtlImg);
gridTtlPanel.add(gridTitleLbl);
gridTtlPanel.setCellWidth( gridTtlImg, "2%" );*/
Label subTitleValLabel = new Label(NumberFormat.getInstance().format(summaryValue));
Label subTitleINRLabel = new Label("INR"); VerticalPanel verticalPanel = new VerticalPanel();
subTitleValLabel.setStyleName("titleValLabel"); verticalPanel.add(gridTitleLbl);
subTitleINRLabel.setStyleName("titleValINRLabel"); verticalPanel.add(dateHPanel);
HorizontalPanel subTitlePanel = new HorizontalPanel(); gridTtlPanel.add(verticalPanel);
subTitlePanel.setStyleName("titleValPanel"); HorizontalPanel horizontalPanel = new HorizontalPanel();
subTitlePanel.add(subTitleValLabel); horizontalPanel.add(gridTtlImg);
subTitlePanel.add(subTitleINRLabel); horizontalPanel.setCellVerticalAlignment(gridTtlImg, HasVerticalAlignment.ALIGN_MIDDLE);
subTitlePanel.setCellVerticalAlignment(subTitleINRLabel, HasVerticalAlignment.ALIGN_MIDDLE); horizontalPanel.add(gridTtlPanel);
mainPanel.add(subTitlePanel); mainPanel.add(horizontalPanel);
//Added by varsha for card subtitle in card on 10 July 17
if(isCardCompSubTitle)
{
//double summaryValue = data.getSubTitleSummary(jsonObjFrGraph, dtSrouce, gridComponantSubTitle);
double summaryValue = CardBuilder.getCardSubTitleSummary(jsonObjFrGraph, dtSrouce, subTitleIDList, subTitleNameList);
Label subTitleValLabel = new Label(NumberFormat.getInstance().format(summaryValue));
Label subTitleINRLabel = new Label("INR");
subTitleValLabel.setStyleName("titleValLabel");
subTitleINRLabel.setStyleName("titleValINRLabel");
HorizontalPanel subTitlePanel = new HorizontalPanel();
subTitlePanel.setStyleName("titleValPanel");
subTitlePanel.add(subTitleValLabel);
subTitlePanel.add(subTitleINRLabel);
subTitlePanel.setCellVerticalAlignment(subTitleINRLabel, HasVerticalAlignment.ALIGN_MIDDLE);
mainPanel.add(subTitlePanel);
}
} }
//Ended by varsha for card subtitle in card on 10 July 17 //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"); final Label closeButton = new Label("x");
closeButton.setStyleName("closeButtonStyle"); closeButton.setStyleName("closeButtonStyle");
closeButton.getElement().setId("Card"+uniqueId+componentId+"Div"); closeButton.getElement().setId("Card"+uniqueId+componentId+"Div");
......
...@@ -2568,4 +2568,46 @@ public class MetaDataDtl ...@@ -2568,4 +2568,46 @@ public class MetaDataDtl
return graphDtlList; return graphDtlList;
} }
/*End New Bubble Chart using Chart.js by Dhanendra on date 16-01-17*/ /*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