Commit 105cf137 authored by vvengurlekar's avatar vvengurlekar

subtitle for card added,

in drop down 0th index item will be selected default,
in checkbox all checkbox will be selected default,
On load month , year gst_status and gst_number will be set in title
new property showontitleindex added


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@106203 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 67ec3b66
......@@ -5,6 +5,7 @@ import java.util.ArrayList;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.json.client.JSONObject;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.HasHorizontalAlignment;
import com.google.gwt.user.client.ui.HorizontalPanel;
......@@ -432,4 +433,52 @@ public class CardBuilder
pageOpenContainer.getFrameJSONData(linkMetadaname, url, parentId);
}
/*End code for open a dill down level dashboard in same page by dhanendra on date 09-03-2017*/
//Added by varsha to set subtitle on card on dated 10 July 17
public static double getCardSubTitleSummary(JSONObject jsonObjFrGraph ,String dataSrc,ArrayList<String> subTitleIDList,ArrayList<String> subTitleNameList)
{
double subTitleValTotal = 0.0;
if(jsonObjFrGraph!=null)
{
try
{
JSONObject jsonObjGraph =(JSONObject) jsonObjFrGraph.get(dataSrc);
for (int jsnCnt = 0; jsnCnt < jsonObjGraph.size(); jsnCnt++)
{
JSONObject fetchRowWiseVal = (JSONObject) jsonObjGraph.get(String.valueOf(jsnCnt));
if(fetchRowWiseVal!=null)
{
for (int xCnt = 0; xCnt < subTitleIDList.size(); xCnt++)
{
if(fetchRowWiseVal.get(subTitleIDList.get(xCnt))!=null)
{
CommonUtils.printOnConsole("subTitleValTotal Value : "+checkNumber(fetchRowWiseVal.get(subTitleIDList.get(xCnt)).toString().replace('"', ' ').trim()));
subTitleValTotal = subTitleValTotal + Math.round(Double.parseDouble(checkNumber(fetchRowWiseVal.get(subTitleIDList.get(xCnt)).toString().replace('"', ' ').trim())));
}
}
}
}
}catch (Exception e)
{
Window.alert(" Exception :: subTitleValTotal CustomGrid [" + e.getMessage() + "]");
}
}
CommonUtils.printOnConsole("subTitleValTotal Value : "+subTitleValTotal);
return subTitleValTotal;
}
public static String checkNumber(String str)
{
if (str == null || str.length()<=0)
{
return "0";
}
else
{
return str.trim();
}
}
}
......@@ -484,7 +484,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);
for (int colNo = 0; colNo < columnCnt + 1; colNo++)
{
if (colNo == 0)
......@@ -1066,9 +1067,18 @@ public class FilterCreator extends Composite
{
//popUpSendDtatList.add(""+fltrListBox.getSelectedIndex());
//popUpSendDtatListDtl.add(fltrListBox.getItemText(fltrListBox.getSelectedIndex()));
popUpSendDtatList.add(""+fltrListBox.getValue(fltrListBox.getSelectedIndex()));
popUpSendDtatListDtl.add(fltrListBox.getValue(fltrListBox.getSelectedIndex()));
//Added by varsha to set pophelp index title on filter submit on dated 10 July 17
if(fltrInfo.getShowOnTitleIndex().equalsIgnoreCase("1"))
{
popUpSendDtatList.add(""+fltrListBox.getValue(fltrListBox.getSelectedIndex()));
popUpSendDtatListDtl.add(fltrListBox.getValue(fltrListBox.getSelectedIndex()));
}
else
{
popUpSendDtatList.add(""+fltrListBox.getValue(fltrListBox.getSelectedIndex()));
popUpSendDtatListDtl.add(fltrListBox.getItemText(fltrListBox.getSelectedIndex()));
}
//Ended by varsha to set default check on all checkbox on dated 10 July 17
} else
{
......@@ -1129,7 +1139,7 @@ public class FilterCreator extends Composite
title = new MetaDataDtl().getTitle(metaDataJsnObj);
/** Start : to add multiple parameter in title date: 12/June/2015 **/
for (FilterInfo filterInfo : filterList)
{
if ("1".equals(filterInfo.getShowOnTitle()))
......@@ -1157,7 +1167,7 @@ public class FilterCreator extends Composite
}
reportHeading = fltrNameNDataBfr.toString();
/** End : to add multiple parameter in title **/
CommonUtils.printOnConsole("In filter submit title set reportHeading: "+reportHeading);
if (metadatName == "halolmfgmonth")
{
temp = parameterList.get(2);
......@@ -1166,6 +1176,7 @@ public class FilterCreator extends Composite
titleLbl.setText(temp + " " + title.get(0) + " : " + getMonth(parameterList.get(1)) + title.get(1) + getMonth(parameterList.get(2)));
} else if (title.size() == 1 && (subTitle == "undefined") || (subTitle.equals("undefined")) || (subTitle.equalsIgnoreCase("undefined")))
{
titleLbl.setText(temp + " " + title.get(0) + " : " + getMonth(parameterList.get(1)));
}
//if(subTitle.trim().length()>0)
......@@ -1196,12 +1207,22 @@ public class FilterCreator extends Composite
}
} else
{
if (title.size() > 1)
{
titleLbl.setText(title.get(0) + " - " + getMonth(reportHeading) + title.get(1) + getMonth(parameterList.get(2)));
} else if (title.size() == 1 && (subTitle == "undefined") || (subTitle.equals("undefined")) || (subTitle.equalsIgnoreCase("undefined")))
{
titleLbl.setText(title.get(0) + " - " + getMonth(parameterList.get(1)));
//titleLbl.setText(title.get(0) + " - " + getMonth(parameterList.get(1))); commented by varsha v on 10 july 17
//Added by varsha to set title on filter submit after drilldown closed on dated 10 July 17
if(reportHeading.length()>0)
{
titleLbl.setText(title.get(0) + " - " + getMonth(reportHeading));
}
else
{
titleLbl.setText(title.get(0) + " - " + getMonth(parameterList.get(1)));
}
}
//if(subTitle.trim().length()>0)
else if ((title.size() == 1 && (subTitle != "") || (!subTitle.equals("")) || (!subTitle.equalsIgnoreCase(""))))
......@@ -1325,7 +1346,7 @@ public class FilterCreator extends Composite
valueList = entry.getValue();
dropDownBox.addItem(""+valueList.get(1));
dropDownBox.setVisibleItemCount(1);
dropDownBox.setSelectedIndex(1);
dropDownBox.setSelectedIndex(0); // to select default 0th index item by varsha v. on 10/07/17
dropDownBox.setValue(cnt,""+valueList.get(0));
//dropDownBox.setItemSelected(1, true);
cnt++;
......
......@@ -70,6 +70,16 @@ public class FilterInfo
{
this.showOnTitle = showOntitle;
}
//Added by varsha to set index code as title on dated 10 July 17
public String getShowOnTitleIndex()
{
return showOnTitleIndex;
}
public void setShowOnTitleIndex(String showOnTitleIndex)
{
this.showOnTitleIndex = showOnTitleIndex;
}
//Ended by varsha to set index code as title on dated 10 July 17
public String getMandatory()
{
return mandatory;
......@@ -92,6 +102,7 @@ public class FilterInfo
String fieldName = "";
String modName = "";
String showOnTitle = "";
String showOnTitleIndex = "";
String mandatory = "";
String filtrType= "";
......
package ibase.client;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
......@@ -74,7 +75,11 @@ public class GWTDashBoardReport implements EntryPoint
public void getParameterList(JSONObject metaDataJsnObj)
{
Date date = new Date();
Date date = new Date();
//1
SimpleDateFormat simpleDateFormat= new SimpleDateFormat("MMMM");
String currentMonth = simpleDateFormat.format(date);
//1
MetaDataDtl dataDtl = new MetaDataDtl();
filterList =dataDtl.getFilters(metaDataJsnObj);
int year=0;
......@@ -118,6 +123,28 @@ public class GWTDashBoardReport implements EntryPoint
{
parameterList.add(Window.Location.getParameter(filterInfo.getFieldName()) == null ? monthYear : Window.Location.getParameter(filterInfo.getFieldName()));
}
/* add code for current month and year by Birendra Pandey */
//Added by varsha for adding current_month, current_year, GST_status and GST_Number in card on 10 July 17
else if(filterInfo.getColId().equals("CURRENT_MONTH"))
{
parameterList.add(Window.Location.getParameter(filterInfo.getFieldName()) == null ? currentMonth : Window.Location.getParameter(filterInfo.getFieldName()));
}
else if(filterInfo.getColId().equals("CURRENT_YEAR"))
{
parameterList.add(Window.Location.getParameter(filterInfo.getFieldName()) == null ? year+"" : Window.Location.getParameter(filterInfo.getFieldName()));
}
else if(filterInfo.getFieldName().equals("GST_STATUS"))
{
parameterList.add(Window.Location.getParameter(filterInfo.getFieldName()) == null ? filterInfo.getDefaultValue() : Window.Location.getParameter(filterInfo.getFieldName()));
}
else if(filterInfo.getFieldName().equals("GST_NUMBER"))
{
parameterList.add(Window.Location.getParameter(filterInfo.getFieldName()) == null ? filterInfo.getDefaultValue() : Window.Location.getParameter(filterInfo.getFieldName()));
}
/* End add code for current month and year by Birendra Pandey */
//Ended by varsha for adding current_month, current_year, GST_status and GST_Number in card on 10 July 17
/*End code for current prd code by dhanendra on 06-10-2015 */
else
{
......
......@@ -157,6 +157,10 @@ public class GraphComponent extends Composite
ArrayList<String> componantTitlNameList = null;
ArrayList<String> groupCssTypeNameList = null;
ArrayList<String> refreshComponantIdList = null;
//Added by varsha for card subtitle in card on 10 July 17
ArrayList<String> subTitleIDList = null;
ArrayList<String> subTitleNameList = null;
//Ended by varsha for card subtitle in card on 10 July 17
JSONObject fltrDataJson = null;
ArrayList<String> gridRefCompontList = null;
HashMap<String, HashMap<String, String>> groupTypeMap = null;
......@@ -1388,6 +1392,8 @@ public class GraphComponent extends Composite
/**start of card build method by sachin 10 July 2015**/
if ("CARD".equalsIgnoreCase(type))
{
//Added by varsha for card subtitle in card on 10 July 17
boolean isCardCompSubTitle = false;
for (String graphNo : graphDataMap.keySet())
{
//RootPanel.get("chartContainer"+componentId).clear();
......@@ -1407,10 +1413,23 @@ public class GraphComponent extends Composite
/*Added code for Dyanamic Div and New CSS By Dhanendra 13-07-15*/
componantTitlNameList = new ArrayList<String>();
groupCssTypeNameList = new ArrayList<String>();
//Added by varsha for card subtitle in card on 10 July 17
subTitleIDList = new ArrayList<String>();
subTitleNameList = new ArrayList<String>();
//Ended by varsha for card subtitle in card on 10 July 17
componantTitlNameList = (ArrayList<String>) graphDtlList.get(1);
groupCssTypeNameList = (ArrayList<String>) graphDtlList.get(2);
gridIconName = ""+graphDtlList.get(7);
//Added by varsha for card subtitle in card on 10 July 17
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();
......@@ -1462,7 +1481,24 @@ public class GraphComponent extends Composite
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);
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
final Label closeButton = new Label("x");
closeButton.setStyleName("closeButtonStyle");
closeButton.getElement().setId("Card"+uniqueId+componentId+"Div");
......
......@@ -1712,6 +1712,10 @@ public class MetaDataDtl
ArrayList<String> heightList = new ArrayList<String>();
ArrayList<String> widthList = new ArrayList<String>();
ArrayList<String> layoutList = new ArrayList<String>();
//Added by varsha for card subtitle in card on 10 July 17
ArrayList<String> subTitleIDList = new ArrayList<String>();
ArrayList<String> subTitleNameList = new ArrayList<String>();
//Ended by varsha for card subtitle in card on 10 July 17
metaDataList = new ArrayList<String>();
graphDtlList = new ArrayList<String>();
componentCssList = new ArrayList<String>();
......@@ -1789,7 +1793,34 @@ public class MetaDataDtl
{
panelView=(graphDataNode.getChildNodes().item(0).getNodeValue());
}
//Added by varsha for card subtitle in card on 10 July 17
if ("column_group".equalsIgnoreCase(childNodeName))
{
columnGrpId = graphDataNode.getAttributes().getNamedItem("id").getNodeValue();
if(columnGrpId.equalsIgnoreCase("component_subtitle"))
{
columnGrpNodeList = graphDataNode.getChildNodes();
subTitleIDList = new ArrayList<String>();
subTitleNameList = new ArrayList<String>();
for (int colmnCtr = 0; colmnCtr < columnGrpNodeList.getLength(); colmnCtr++)
{
colGrpTitlNode = columnGrpNodeList.item(colmnCtr);
if ("columns".equals(colGrpTitlNode.getNodeName()))
{
columsNodeList = colGrpTitlNode.getChildNodes();
for (int colCtr = 0; colCtr < columsNodeList.getLength(); colCtr++)
{
columnNode = columsNodeList.item(colCtr);
columnName = columnNode.getChildNodes().item(0).getNodeValue();
columnID = columnNode.getAttributes().getNamedItem("id").getNodeValue();
subTitleIDList.add(columnID);
subTitleNameList.add(columnName);
}
}
}
}
}
//Ended by varsha for card subtitle in card on 10 July 17
/* End display_panel tag in metadata by Swati on 16-05-2016 */
}
......@@ -1836,14 +1867,21 @@ public class MetaDataDtl
graphDtlList.add(groupFltrNameList);
graphDtlList.add(componentIconName);
graphDtlList.add(linkMetaDataName);
graphDtlList.add(panelView); // added panel view in list
graphDtlList.add(panelView);// added panel view in list
//Added code by Varsha V. on 6 july for component subtitle
graphDtlList.add(subTitleIDList);
graphDtlList.add(subTitleNameList);
//Ended code by Varsha V. on 6 july for component subtitle
conuter++;
gridNGraphMeataDataMap.put("type" + graphID, typeGraphMap);
graphMeataDataMap.put("graph" + conuter, graphDtlList);
gridNGraphMeataDataMap.put(graphID, graphMeataDataMap);
gridNGraphMeataDataMap.put("datasource" + graphID, graphDataSourceMap);
//Added by varsha for card subtitle in card on 10 July 17
subTitleIDList = new ArrayList<String>();
subTitleNameList = new ArrayList<String>();
//Ended by varsha for card subtitle in card on 10 July 17
}
//***End Code for Card (Added by sachin on 1-jully-2015)*****\\
//***Start Code for Gantt Chart (Added by sachin on 4-08-15)*****\\
......@@ -2037,6 +2075,12 @@ public class MetaDataDtl
{
filterInfo.setShowOnTitle(columNode.getChildNodes().item(0).getNodeValue());
}
//Added by varsha for filter on 10 July 17
if ("show_ontitle_index".equals(columNode.getNodeName()))
{
filterInfo.setShowOnTitleIndex(columNode.getChildNodes().item(0).getNodeValue());
}
//Added by varsha for filter on 10 July 17
if ("mandatory".equals(columNode.getNodeName()))
{
filterInfo.setMandatory(columNode.getChildNodes().item(0).getNodeValue());
......
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