Commit 1058cb4a authored by sbade's avatar sbade

updated source code for proper funciotning of old and new structured metadata xmls


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@98398 ce508802-f39f-4f6c-b175-0d175dae99d5
parent f59ef28e
......@@ -879,7 +879,7 @@ public class FilterCreator extends Composite
//if(!"CUST_CODE_SUNUSA".equalsIgnoreCase(colNameId))
if ("Y".equalsIgnoreCase(mandatotyFilter))
{
Window.alert(fltrInfo.getColName() + "Can't Be Empty");
Window.alert(fltrInfo.getColDescr() + " Can't Be Empty");
Window.setTitle(windowTitle);
isFilterNotSelected = true;
} else
......@@ -906,7 +906,7 @@ public class FilterCreator extends Composite
//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.getColDescr() + " Can't Be Empty");
Window.setTitle(windowTitle);
isFilterNotSelected = true;
} else
......@@ -932,7 +932,7 @@ public class FilterCreator extends Composite
fltrDateBox.hideDatePicker();
} else
{
Window.alert(fltrInfo.getColName() + "Can't Be Empty");
Window.alert(fltrInfo.getColDescr() + "Can't Be Empty");
Window.setTitle(windowTitle);
isFilterNotSelected = true;
}
......@@ -948,7 +948,6 @@ public class FilterCreator extends Composite
{
if (bulletList.getWidget(j) instanceof ListItem)
{
listItem = (ListItem) bulletList.getWidget(j);
if (listItem.getWidget(0) instanceof Paragraph)
{
......@@ -963,7 +962,6 @@ public class FilterCreator extends Composite
selectedChkBoxBuffer.append(paragraph.getText().trim());
selectedChkBoxBufferDtl.append(paragraph.getText().trim());
}
}
}
}
......@@ -977,7 +975,7 @@ public class FilterCreator extends Composite
//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.getColDescr() + "Can't Be Empty");
Window.setTitle(windowTitle);
isFilterNotSelected = true;
} else
......
......@@ -10,7 +10,6 @@ import java.util.LinkedHashMap;
import com.google.gwt.json.client.JSONObject;
import com.google.gwt.json.client.JSONString;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.RootPanel;
import com.google.gwt.xml.client.Document;
import com.google.gwt.xml.client.Node;
import com.google.gwt.xml.client.NodeList;
......@@ -31,7 +30,7 @@ public class MetaDataDtl
}
@SuppressWarnings("unchecked")
public HashMap<String, HashMap> getGridNMapMetData(JSONObject jsonObjMetadata,String viewOptionSelectd,ArrayList<String> parameterList)
public HashMap<String, HashMap> getGridNMapMetData(JSONObject jsonObjMetadata, String viewOptionSelectd, ArrayList<String> parameterList)
{
Document document = null;
ArrayList<String> metaDataList = null;
......@@ -96,7 +95,7 @@ public class MetaDataDtl
Node rootNode = null;
NodeList rootNodeList = null;
ArrayList graphDtlList = null;
ArrayList<String> groupCssTypeList=null;
ArrayList<String> groupCssTypeList = null;
NodeList graphNodeList = null;
String attributeName = "";
String graphID = "";
......@@ -109,13 +108,13 @@ public class MetaDataDtl
String lineVisibleDtl = "";
String dotThicknessDtl = "";
//add on 20dec2014 by swati linkedchart
NodeList pupUpOptNodeList=null;
Node popUpNode=null;
ArrayList<String> linkedMetadataList=null;
ArrayList<String> linkTypeList=null;
String linkedProperties="";
String linkedMetadataName="";
String linkTypeName="";
NodeList pupUpOptNodeList = null;
Node popUpNode = null;
ArrayList<String> linkedMetadataList = null;
ArrayList<String> linkTypeList = null;
String linkedProperties = "";
String linkedMetadataName = "";
String linkTypeName = "";
//end on 20dec2014 by swati for linkedchart
//add on dated 9 july 201041
Node chartPropertyNode = null;
......@@ -132,25 +131,25 @@ public class MetaDataDtl
NodeList columnNodeList = null;
// ended for heat map
/*Start For countrymap maxvalue dynamic pass throw query 24/04/2015*/
ArrayList<NodeList> colorNodeList= null;
/*End For countrymap maxvalue dynamic pass throw query 24/04/2015*/
/* Start For countrymap maxvalue dynamic pass throw query 24/04/2015 */
ArrayList<NodeList> colorNodeList = null;
/* End For countrymap maxvalue dynamic pass throw query 24/04/2015 */
/*Add By Dhanendra On 04/06/2015*/
/* Add By Dhanendra On 04/06/2015 */
LinkedHashMap<String, String> gridGroupDataMap = null;
LinkedHashMap<String, String> gridComponantTtlDataMap = null;
LinkedHashMap<String, String> gridGroupCSSDataMap = null;
LinkedHashMap<String, String> gridGroupIconDataMap= null;
LinkedHashMap<String, String> gridGroupIconDataMap = null;
LinkedHashMap<String, ArrayList<String>> gridRefCompontDataMap = null;
ArrayList<String> groupTypeList=null;
ArrayList<String> componantTitlList=null;
ArrayList<String> componentCssList=null;
ArrayList<String> groupTypeList = null;
ArrayList<String> componantTitlList = null;
ArrayList<String> componentCssList = null;
ArrayList<String> groupFltrNameList = null;
NodeList groupFilterNodeList = null;
Node groupFilterNode = null;
ArrayList<String> toolTextInfoList = null;
String tooltextDtl = "";
/*End By Dhanendra On 04/06/2015*/
/* End By Dhanendra On 04/06/2015 */
if (jsonObjMetadata != null)
{
......@@ -191,69 +190,73 @@ public class MetaDataDtl
}
String columnsize = "";
String columnAlign = "";
String dataSource="";
String dataSource = "";
if ("view".equals(rootNode.getNodeName()))
{
viewNodeList = rootNode.getChildNodes();
if(!viewOptionSelectd.equals(rootNode.getAttributes().getNamedItem("name").getNodeValue()))
if (!viewOptionSelectd.equals(rootNode.getAttributes().getNamedItem("name").getNodeValue()))
{
}
if( viewOptionSelectd !=null && viewOptionSelectd.equals(rootNode.getAttributes().getNamedItem("name").getNodeValue()))
if (viewOptionSelectd != null && viewOptionSelectd.equals(rootNode.getAttributes().getNamedItem("name").getNodeValue()))
{
for (int viewCtr = 0; viewCtr < viewNodeList.getLength(); viewCtr++)
{
viewNode = viewNodeList.item(viewCtr);
type= viewNode.getAttributes().getNamedItem("type").getNodeValue();
type = viewNode.getAttributes().getNamedItem("type").getNodeValue();
//if ("grid".equals(viewNode.getNodeName()))
/*change grid to component as per KB Sir Instruction by Dhanendra*/
/*
* change grid to component as per KB Sir
* Instruction by Dhanendra
*/
//if ("grid".equals(viewNode.getNodeName()))
if ("component".equals(viewNode.getNodeName()) && type.equalsIgnoreCase("T"))
if (("component".equals(viewNode.getNodeName()) || "grid".equals(viewNode.getNodeName())) && type.equalsIgnoreCase("T"))
{
gridNameDataMap=new LinkedHashMap<String, ArrayList<String>>();
gridMeataDataMap=new LinkedHashMap<String, ArrayList<String>>();
gridSizeDataMap=new LinkedHashMap<String, String>();
gridCaptionDataMap=new LinkedHashMap<String, String>();
gridAlignDataMap=new LinkedHashMap<String, String>();
gridNameDataMap = new LinkedHashMap<String, ArrayList<String>>();
gridMeataDataMap = new LinkedHashMap<String, ArrayList<String>>();
gridSizeDataMap = new LinkedHashMap<String, String>();
gridCaptionDataMap = new LinkedHashMap<String, String>();
gridAlignDataMap = new LinkedHashMap<String, String>();
typeGridMap = new LinkedHashMap<String, String>();
gridDataSourceMap= new LinkedHashMap<String, String>();
gridDataSourceMap = new LinkedHashMap<String, String>();
gridCompTypeMap = new LinkedHashMap<String, String>();
//Added By Prashant Chavan 09-Mar-15 [for Link On Grid] Start
gridMetaLinkDataMap = new LinkedHashMap<String, String>();;
gridMetaLinkDataMap = new LinkedHashMap<String, String>();
;
//Added By Prashant Chavan 09-Mar-15 [for Link On Grid] End
/*Added By Dhanendra*/
/* Added By Dhanendra */
gridRefCompontDataMap = new LinkedHashMap<String, ArrayList<String>>();
/*Ended By Dhanendra*/
gridLinkFormatMap=new LinkedHashMap<String, String>();
/* Ended By Dhanendra */
gridLinkFormatMap = new LinkedHashMap<String, String>();
graphID = viewNode.getAttributes().getNamedItem("id").getNodeValue();
dataSource = viewNode.getAttributes().getNamedItem("datasource").getNodeValue();
type= viewNode.getAttributes().getNamedItem("type").getNodeValue();
gridDataSourceMap.put("datasource"+graphID, dataSource);
typeGridMap.put("type"+graphID, type);
type = viewNode.getAttributes().getNamedItem("type").getNodeValue();
gridDataSourceMap.put("datasource" + graphID, dataSource);
typeGridMap.put("type" + graphID, type);
gridNodeList = viewNode.getChildNodes();
String componentType = "";
String componentCaption="";
String componentCaption = "";
//Added By Prashant Chavan 09-Mar-15 [for Link On Grid] Start
String linkMetadata="";
String linkMetadata = "";
//Added By Prashant Chavan 09-Mar-15 [for Link On Grid] End
String linkFormat="";
String filterDisplay="";
String linkFormat = "";
String filterDisplay = "";
/*Add By Dhanedra for metadata change*/
/* Add By Dhanedra for metadata change */
groupFltrNameList = new ArrayList<String>();
String groupType ="";
String componentCssName ="";
String groupType = "";
String componentCssName = "";
String componentIconName="";
String componantTitl ="";
String componentIconName = "";
String componantTitl = "";
gridGroupDataMap = new LinkedHashMap<String, String>();
gridComponantTtlDataMap = new LinkedHashMap<String, String>();
gridGroupCSSDataMap = new LinkedHashMap<String, String>();
gridGroupIconDataMap = new LinkedHashMap<String, String>();
/*End By Dhanedra for metadata change*/
/* End By Dhanedra for metadata change */
for (int gridCtr = 0; gridCtr < gridNodeList.getLength(); gridCtr++)
{
......@@ -261,29 +264,28 @@ public class MetaDataDtl
if (columnGrpNode.getNodeName().equals("component_type"))
{
componentType = columnGrpNode.getChildNodes().item(0).getNodeValue();
}
else if (columnGrpNode.getNodeName().equals("component_caption"))
} else if (columnGrpNode.getNodeName().equals("component_caption"))
{
componentCaption = columnGrpNode.getChildNodes().item(0).getNodeValue();
}
/*Start Add new metadata tag for Compliance Report by Dhanendra on 25May2015 */
/*
* Start Add new metadata tag for
* Compliance Report by Dhanendra on
* 25May2015
*/
else if (columnGrpNode.getNodeName().equals("group"))
{
groupType = (columnGrpNode.getChildNodes().item(0).getNodeValue());
}
else if (columnGrpNode.getNodeName().equals("ComponentTitle"))
} else if (columnGrpNode.getNodeName().equals("ComponentTitle"))
{
componantTitl = (columnGrpNode.getChildNodes().item(0).getNodeValue());
}
else if (columnGrpNode.getNodeName().equals("component_css"))
} else if (columnGrpNode.getNodeName().equals("component_css"))
{
componentCssName = (columnGrpNode.getChildNodes().item(0).getNodeValue());
}
else if (columnGrpNode.getNodeName().equals("component_icon"))
} else if (columnGrpNode.getNodeName().equals("component_icon"))
{
componentIconName = (columnGrpNode.getChildNodes().item(0).getNodeValue());
}
else if (columnGrpNode.getNodeName().equals("groupFilter"))
} else if (columnGrpNode.getNodeName().equals("groupFilter"))
{
groupFilterNodeList = columnGrpNode.getChildNodes();
for (int j = 0; j < groupFilterNodeList.getLength(); j++)
......@@ -305,12 +307,16 @@ public class MetaDataDtl
}
}
}
/*Add By Dhanendra */
gridRefCompontDataMap.put("refreshCompont"+graphID, groupFltrNameList);
/*End By Dhanendra*/
/* Add By Dhanendra */
gridRefCompontDataMap.put("refreshCompont" + graphID, groupFltrNameList);
/* End By Dhanendra */
}
/*End Add new metadata tag for Compliance Report by Dhanendra on 25May2015 */
/*
* End Add new metadata tag for
* Compliance Report by Dhanendra on
* 25May2015
*/
else if (columnGrpNode.getNodeName().equals("link_format"))
{
......@@ -318,10 +324,9 @@ public class MetaDataDtl
filterDisplay = columnGrpNode.getAttributes().getNamedItem("filterdisplay").getNodeValue();
//if(linkFormat.trim().length()>0 && filterDisplay.trim().length()>0)
//{
linkFormat = linkFormat+"@"+filterDisplay;
linkFormat = linkFormat + "@" + filterDisplay;
//}
}
else
} else
{
columnGrpId = columnGrpNode.getAttributes().getNamedItem("id").getNodeValue();
columnGrpNodeList = columnGrpNode.getChildNodes();
......@@ -374,48 +379,57 @@ public class MetaDataDtl
}
}
gridCaptionDataMap.put("componentCaption"+graphID,componentCaption );
gridCaptionDataMap.put("componentCaption" + graphID, componentCaption);
gridCompTypeMap.put("buildComponent"+graphID, componentType);
gridNGraphMeataDataMap.put("componentType"+graphID, gridCompTypeMap);
gridCompTypeMap.put("buildComponent" + graphID, componentType);
gridNGraphMeataDataMap.put("componentType" + graphID, gridCompTypeMap);
gridNGraphMeataDataMap.put(graphID, gridMeataDataMap);
gridNGraphMeataDataMap.put("columnName"+graphID, gridNameDataMap);
gridNGraphMeataDataMap.put("columnSize"+graphID, gridSizeDataMap);
gridNGraphMeataDataMap.put("componentCaption"+graphID, gridCaptionDataMap);
gridNGraphMeataDataMap.put("columnAlign"+graphID, gridAlignDataMap);
gridNGraphMeataDataMap.put("type"+graphID, typeGridMap);
gridNGraphMeataDataMap.put("datasource"+graphID, gridDataSourceMap);
gridNGraphMeataDataMap.put("columnName" + graphID, gridNameDataMap);
gridNGraphMeataDataMap.put("columnSize" + graphID, gridSizeDataMap);
gridNGraphMeataDataMap.put("componentCaption" + graphID, gridCaptionDataMap);
gridNGraphMeataDataMap.put("columnAlign" + graphID, gridAlignDataMap);
gridNGraphMeataDataMap.put("type" + graphID, typeGridMap);
gridNGraphMeataDataMap.put("datasource" + graphID, gridDataSourceMap);
//Added By Prashant Chavan on 09-Mar-15 [Link Metadata for Grid] Start
gridNGraphMeataDataMap.put("linkFormatType"+graphID, gridLinkFormatMap);
gridNGraphMeataDataMap.put("metadataNameLink"+graphID, gridMetaLinkDataMap);
gridNGraphMeataDataMap.put("linkFormatType" + graphID, gridLinkFormatMap);
gridNGraphMeataDataMap.put("metadataNameLink" + graphID, gridMetaLinkDataMap);
//Added By Prashant Chavan on 09-Mar-15 [Link Metadata for Grid] Start
/*Add By Dhanendra on 04/06/2015 for metadata add new tag*/
gridGroupDataMap.put("groupName"+graphID, groupType);
gridComponantTtlDataMap.put("componantTitle"+graphID, componantTitl);
gridGroupCSSDataMap.put("cssName"+graphID, componentCssName);
gridGroupIconDataMap.put("iconName"+graphID, componentIconName);
gridNGraphMeataDataMap.put("groupName"+graphID, gridGroupDataMap);
gridNGraphMeataDataMap.put("componantTitle"+graphID, gridComponantTtlDataMap);
gridNGraphMeataDataMap.put("cssName"+graphID, gridGroupCSSDataMap);
gridNGraphMeataDataMap.put("iconName"+graphID, gridGroupIconDataMap);
gridNGraphMeataDataMap.put("refreshCompont"+graphID, gridRefCompontDataMap);
/*End By Dhanendra on 04/06/2015 for metadata add new tag*/
/*
* Add By Dhanendra on 04/06/2015 for
* metadata add new tag
*/
gridGroupDataMap.put("groupName" + graphID, groupType);
gridComponantTtlDataMap.put("componantTitle" + graphID, componantTitl);
gridGroupCSSDataMap.put("cssName" + graphID, componentCssName);
gridGroupIconDataMap.put("iconName" + graphID, componentIconName);
gridNGraphMeataDataMap.put("groupName" + graphID, gridGroupDataMap);
gridNGraphMeataDataMap.put("componantTitle" + graphID, gridComponantTtlDataMap);
gridNGraphMeataDataMap.put("cssName" + graphID, gridGroupCSSDataMap);
gridNGraphMeataDataMap.put("iconName" + graphID, gridGroupIconDataMap);
gridNGraphMeataDataMap.put("refreshCompont" + graphID, gridRefCompontDataMap);
/*
* End By Dhanendra on 04/06/2015 for
* metadata add new tag
*/
columnIDList = new ArrayList<String>();
columnNameList= new ArrayList<String>();
columnNameList = new ArrayList<String>();
}
/*change Graph to component as per KB Sir Instruction by Dhanendra*/
/*
* change Graph to component as per KB Sir
* Instruction by Dhanendra
*/
//if ("component".equals(viewNode.getNodeName()))
if ("component".equals(viewNode.getNodeName()) && type.equalsIgnoreCase("G"))
if (("component".equals(viewNode.getNodeName()) || "graph".equals(viewNode.getNodeName())) && type.equalsIgnoreCase("G"))
{
typeGraphMap= new LinkedHashMap<String, String>();
graphDataSourceMap= new LinkedHashMap<String, String>();
typeGraphMap = new LinkedHashMap<String, String>();
graphDataSourceMap = new LinkedHashMap<String, String>();
graphID = viewNode.getAttributes().getNamedItem("id").getNodeValue();
type= viewNode.getAttributes().getNamedItem("type").getNodeValue();
type = viewNode.getAttributes().getNamedItem("type").getNodeValue();
dataSource = viewNode.getAttributes().getNamedItem("datasource").getNodeValue();
graphDataSourceMap.put("datasource"+graphID, dataSource);
typeGraphMap.put("type"+graphID, type);
graphDataSourceMap.put("datasource" + graphID, dataSource);
typeGraphMap.put("type" + graphID, type);
graphDtlList = new ArrayList<String>();
xAxisColunList = new ArrayList<String>();
yAxisColunList = new ArrayList<String>();
......@@ -430,18 +444,18 @@ public class MetaDataDtl
graphMeataDataMap = new HashMap<String, ArrayList<Object>>();
graphNodeList = viewNode.getChildNodes();
//added by swati 20dec2014 for linked chart
linkedMetadataList= new ArrayList<String>();
linkedMetadataList = new ArrayList<String>();
linkTypeList = new ArrayList<String>();
//ended by swati 20dec2014 for linked chart
/*Add By Dhanedra for metadata change*/
/* Add By Dhanedra for metadata change */
groupTypeList = new ArrayList<String>();
componentCssList = new ArrayList<String>();
componantTitlList = new ArrayList<String>();
groupTypeList = new ArrayList<String>();
groupFltrNameList = new ArrayList<String>();
String componentIconName = "";
/*End By Dhanedra for metadata change*/
/* End By Dhanedra for metadata change */
toolTextInfoList = new ArrayList<String>();
......@@ -449,9 +463,11 @@ public class MetaDataDtl
{
graphDataNode = graphNodeList.item(i);
childNodeName = graphDataNode.getNodeName();
if ("column_group".equalsIgnoreCase(childNodeName))
{
attributeName = graphDataNode.getAttributes().getNamedItem("id").getNodeValue();
if ("x_axis".equalsIgnoreCase(attributeName))
{
xAxsisNodeList = graphDataNode.getChildNodes();
......@@ -508,19 +524,31 @@ public class MetaDataDtl
colorDtl = columnNode.getAttributes().getNamedItem("color").getNodeValue();
colorInfoList.add(colorDtl);
/*add code for Tooltext by Dhanendra On 30-06-15*/
if(columnNode.getAttributes().getNamedItem("tooltext")!=null)
/*
* add code for
* Tooltext by
* Dhanendra On
* 30-06-15
*/
if (columnNode.getAttributes().getNamedItem("tooltext") != null)
{
tooltextDtl = columnNode.getAttributes().getNamedItem("tooltext").getNodeValue();
toolTextInfoList.add(tooltextDtl);
}
/*End code for Tooltext by Dhanendra On 30-06-15*/
/*
* End code for
* Tooltext by
* Dhanendra On
* 30-06-15
*/
if (columnNode.getAttributes().getNamedItem("linevisibility") != null)
{
lineVisibleDtl = columnNode.getAttributes().getNamedItem("linevisibility").getNodeValue();
if (!lineVisibleDtl.trim().equals("0"))
if (lineVisibleDtl.trim().equals("0"))
{
flag = "true";
metaDataMap.put(new JSONString("lineAlpha"), new JSONString("1"));
metaDataMap.put(new JSONString("anchorBorderThickness"), new JSONString("3"));
}
lineVisibleList.add(lineVisibleDtl);
}
......@@ -537,12 +565,13 @@ public class MetaDataDtl
linkTypeList.add(linkTypeName);
//added linked chart metadata name to graphdetail list by swati on 24 Dec 2014
}
if (flag.equals("false"))
/*if (flag.equals("false"))
{
metaDataMap.put(new JSONString("lineAlpha"), new JSONString("1"));
metaDataMap.put(new JSONString("anchorBorderThickness"), new JSONString("3"));
}*/
}
}
Window.alert("metaDataMap: "+metaDataMap);
//added by swati "placevaluesinside": "1",rotatevalues
if ("left_yaxis_title".equals(yAxsisNode.getNodeName()))
{
......@@ -572,21 +601,20 @@ public class MetaDataDtl
{
dataStringValue = new JSONString(chartPropertyNode.getChildNodes().item(0).getNodeValue());
jsnStringKey = new JSONString("caption");
if(metDtName=="halolmfgmonth")
if (metDtName == "halolmfgmonth")
{
String temp = parameterList.get(2);
dataStringValue = new JSONString(temp+" "+chartPropertyNode.getChildNodes().item(0).getNodeValue()+" ("+getCurrentDate()+")");
dataStringValue = new JSONString(temp + " " + chartPropertyNode.getChildNodes().item(0).getNodeValue() + " (" + getCurrentDate() + ")");
}
metaDataMap.put(jsnStringKey, dataStringValue);
}
if ("slantlabels".equals(chartPropertyNode.getNodeName()))
{
if(("0").equals(chartPropertyNode.getChildNodes().item(0).getNodeValue()))
if (("0").equals(chartPropertyNode.getChildNodes().item(0).getNodeValue()))
{
metaDataMap.put(new JSONString("labelDisplay"), new JSONString(""));
}
else if(("1").equals(chartPropertyNode.getChildNodes().item(0).getNodeValue()))
} else if (("1").equals(chartPropertyNode.getChildNodes().item(0).getNodeValue()))
{
metaDataMap.put(new JSONString("labelDisplay"), new JSONString("Rotate"));
}
......@@ -688,7 +716,10 @@ public class MetaDataDtl
jsnStringKey = new JSONString("exportAction");
metaDataMap.put(jsnStringKey, dataStringValue);
}
/* add tag for chart by Dhanendra on 16Jun2015*/
/*
* add tag for chart by
* Dhanendra on 16Jun2015
*/
if ("pieradius".equals(chartPropertyNode.getNodeName()))
{
dataStringValue = new JSONString(chartPropertyNode.getChildNodes().item(0).getNodeValue());
......@@ -707,11 +738,18 @@ public class MetaDataDtl
jsnStringKey = new JSONString("showPercentValues");
metaDataMap.put(jsnStringKey, dataStringValue);
}
/* End tag for chart by Dhanendra on 16Jun2015*/
/*
* End tag for chart by
* Dhanendra on 16Jun2015
*/
}
}
//end swati for chart properties
/*Start Add new metadata tag for Compliance Report by Dhanendra on 25May2015 */
/*
* Start Add new metadata tag for
* Compliance Report by Dhanendra on
* 25May2015
*/
if ("group".equalsIgnoreCase(childNodeName))
{
groupTypeList.add(graphDataNode.getChildNodes().item(0).getNodeValue());
......@@ -750,14 +788,24 @@ public class MetaDataDtl
}
}
}
/*End Add new metadata tag for Compliance Report by Dhanendra on 25May2015 */
/*
* End Add new metadata tag for
* Compliance Report by Dhanendra on
* 25May2015
*/
/*Add componentIcon tag in metadata by Dhanendra on 01-07-2015*/
/*
* Add componentIcon tag in metadata
* by Dhanendra on 01-07-2015
*/
if ("component_icon".equalsIgnoreCase(childNodeName))
{
componentIconName = (graphDataNode.getChildNodes().item(0).getNodeValue());
}
/*End componentIcon tag in metadata by Dhanendra on 01-07-2015*/
/*
* End componentIcon tag in metadata
* by Dhanendra on 01-07-2015
*/
}
metaDataList.add(metaDataMap.toString().replace('=', ':'));
......@@ -777,48 +825,59 @@ public class MetaDataDtl
graphDtlList.add(linkedProperties);
graphDtlList.add(linkTypeList);
//ended linked chart metadata name to graphdetail list by swati on 22 Dec 2014
/*Add Group to graphdetail list by Dhanendra on 25 May 2015 */
/*
* Add Group to graphdetail list by
* Dhanendra on 25 May 2015
*/
graphDtlList.add(groupTypeList);
graphDtlList.add(componantTitlList);
graphDtlList.add(componentCssList);
graphDtlList.add(groupFltrNameList);
/*Ended Group to graphdetail list by Dhanendra on 25 May 2015 */
/*Add For ToolText By Dhanendra*/
/*
* Ended Group to graphdetail list by
* Dhanendra on 25 May 2015
*/
/* Add For ToolText By Dhanendra */
graphDtlList.add(toolTextInfoList);
/*End For ToolText By Dhanendra*/
/* End For ToolText By Dhanendra */
/*Add For componentIcon By Dhanendra on 01-07-15*/
/*
* Add For componentIcon By Dhanendra on
* 01-07-15
*/
graphDtlList.add(componentIconName);
/*End For componentIcon By Dhanendra on 01-07-15*/
/*
* End For componentIcon By Dhanendra on
* 01-07-15
*/
conuter++;
gridNGraphMeataDataMap.put("type"+graphID, typeGraphMap);
gridNGraphMeataDataMap.put("type" + graphID, typeGraphMap);
graphMeataDataMap.put("graph" + conuter, graphDtlList);
gridNGraphMeataDataMap.put(graphID, graphMeataDataMap);
gridNGraphMeataDataMap.put("datasource"+graphID, graphDataSourceMap);
gridNGraphMeataDataMap.put("datasource" + graphID, graphDataSourceMap);
}
if ("heatmap".equals(viewNode.getNodeName()))
{
typeGraphMap= new LinkedHashMap<String, String>();
graphDataSourceMap= new LinkedHashMap<String, String>();
typeGraphMap = new LinkedHashMap<String, String>();
graphDataSourceMap = new LinkedHashMap<String, String>();
graphID = viewNode.getAttributes().getNamedItem("id").getNodeValue();
type= viewNode.getAttributes().getNamedItem("type").getNodeValue();
type = viewNode.getAttributes().getNamedItem("type").getNodeValue();
dataSource = viewNode.getAttributes().getNamedItem("datasource").getNodeValue();
graphDataSourceMap.put("datasource"+graphID, dataSource);
typeGraphMap.put("type"+graphID, type);
graphDataSourceMap.put("datasource" + graphID, dataSource);
typeGraphMap.put("type" + graphID, type);
graphDtlList = new ArrayList<String>();
rowIdList = new ArrayList<String>();
rowNameList = new ArrayList<String>();
columnIdList = new ArrayList<String>();
ArrayList<String> showValueList= new ArrayList<String>();
ArrayList<String> showValueList = new ArrayList<String>();
ArrayList<String> tlLabelList= new ArrayList<String>();
ArrayList<String> trLabelList= new ArrayList<String>();
ArrayList<String> blLabelList= new ArrayList<String>();
ArrayList<String> brLabelList= new ArrayList<String>();
linkedMetadataList= new ArrayList<String>();
ArrayList<String> tlLabelList = new ArrayList<String>();
ArrayList<String> trLabelList = new ArrayList<String>();
ArrayList<String> blLabelList = new ArrayList<String>();
ArrayList<String> brLabelList = new ArrayList<String>();
linkedMetadataList = new ArrayList<String>();
colorRangeList = new ArrayList<String>();
columnNameList = new ArrayList<String>();
metaDataList = new ArrayList<String>();
......@@ -916,12 +975,22 @@ public class MetaDataDtl
metaDataMap.put(jsnStringKey, dataStringValue);
}
/*
if ("legendpadding".equals(chartPropertyNode.getNodeName()))
{
dataStringValue = new JSONString(chartPropertyNode.getChildNodes().item(0).getNodeValue());
jsnStringKey = new JSONString("legendpadding");
metaDataMap.put(jsnStringKey, dataStringValue);
} */
* if
* ("legendpadding".equals
* (chartPropertyNode
* .getNodeName())) {
* dataStringValue = new
* JSONString
* (chartPropertyNode
* .getChildNodes
* ().item(0).getNodeValue
* ()); jsnStringKey = new
* JSONString
* ("legendpadding");
* metaDataMap
* .put(jsnStringKey,
* dataStringValue); }
*/
if ("canvasborderalpha".equals(chartPropertyNode.getNodeName()))
{
dataStringValue = new JSONString(chartPropertyNode.getChildNodes().item(0).getNodeValue());
......@@ -961,7 +1030,6 @@ public class MetaDataDtl
metaDataMap.put(jsnStringKey, dataStringValue);
}
if ("xAxisLabelsOnTop".equals(chartPropertyNode.getNodeName()))
{
dataStringValue = new JSONString(chartPropertyNode.getChildNodes().item(0).getNodeValue());
......@@ -969,7 +1037,6 @@ public class MetaDataDtl
metaDataMap.put(jsnStringKey, dataStringValue);
}
if ("showplotborder".equals(chartPropertyNode.getNodeName()))
{
dataStringValue = new JSONString(chartPropertyNode.getChildNodes().item(0).getNodeValue());
......@@ -1106,32 +1173,35 @@ public class MetaDataDtl
graphDtlList.add(blLabelList);
graphDtlList.add(linkedMetadataList);
conuter++;
gridNGraphMeataDataMap.put("type"+graphID, typeGraphMap);
gridNGraphMeataDataMap.put("type" + graphID, typeGraphMap);
graphMeataDataMap.put("graph" + conuter, graphDtlList);
gridNGraphMeataDataMap.put(graphID, graphMeataDataMap);
gridNGraphMeataDataMap.put("datasource"+graphID, graphDataSourceMap);
gridNGraphMeataDataMap.put("datasource" + graphID, graphDataSourceMap);
}
/**Start of build metadata for country map chart by swati 16 April 2015**/
/**
* Start of build metadata for country map
* chart by swati 16 April 2015
**/
if ("countrymap".equals(viewNode.getNodeName()))
{
typeGraphMap= new LinkedHashMap<String, String>();
graphDataSourceMap= new LinkedHashMap<String, String>();
typeGraphMap = new LinkedHashMap<String, String>();
graphDataSourceMap = new LinkedHashMap<String, String>();
graphID = viewNode.getAttributes().getNamedItem("id").getNodeValue();
type= viewNode.getAttributes().getNamedItem("type").getNodeValue();
type = viewNode.getAttributes().getNamedItem("type").getNodeValue();
dataSource = viewNode.getAttributes().getNamedItem("datasource").getNodeValue();
graphDataSourceMap.put("datasource"+graphID, dataSource);
typeGraphMap.put("type"+graphID, type);
graphDataSourceMap.put("datasource" + graphID, dataSource);
typeGraphMap.put("type" + graphID, type);
graphDtlList = new ArrayList<String>();
columnIdList = new ArrayList<String>();
columnNameList = new ArrayList<String>();
linkedMetadataList= new ArrayList<String>();
linkedMetadataList = new ArrayList<String>();
linkTypeList = new ArrayList<String>();
ArrayList<String> toptoolTipList= new ArrayList<String>();
ArrayList<String> bottomToolTipList= new ArrayList<String>();
ArrayList<String> showLabelList= new ArrayList<String>();
ArrayList<String> hovercolorList= new ArrayList<String>();
ArrayList<String> tooltextList= new ArrayList<String>();
ArrayList<String> toptoolTipList = new ArrayList<String>();
ArrayList<String> bottomToolTipList = new ArrayList<String>();
ArrayList<String> showLabelList = new ArrayList<String>();
ArrayList<String> hovercolorList = new ArrayList<String>();
ArrayList<String> tooltextList = new ArrayList<String>();
colorRangeList = new ArrayList<String>();
metaDataList = new ArrayList<String>();
graphMeataDataMap = new HashMap<String, ArrayList<Object>>();
......@@ -1176,67 +1246,78 @@ public class MetaDataDtl
{
dataStringValue = new JSONString(chartPropertyNode.getChildNodes().item(0).getNodeValue());
jsnStringKey = new JSONString("caption");
/*Start add code for india map Dhanendra 06/05/2015*/
if(metDtName=="indiamap")
/*
* Start add code for
* india map Dhanendra
* 06/05/2015
*/
if (metDtName == "indiamap")
{
brandName = FilterCreator.parameterListDtl.get(2);
divisionName = FilterCreator.parameterListDtl.get(3);
if(brandName.length()==0 && brandName.equals(""))
if (brandName.length() == 0 && brandName.equals(""))
{
brandName = "All";
}
if(divisionName.length()==0 && divisionName.equals(""))
if (divisionName.length() == 0 && divisionName.equals(""))
{
divisionName = "All";
}
brandNameArr = brandName.split(",");
divisionNameArr = divisionName.split(",");
for(int cnt=0; cnt<brandNameArr.length; cnt++)
for (int cnt = 0; cnt < brandNameArr.length; cnt++)
{
if(cnt<2)
if (cnt < 2)
{
if(cnt==0)
if (cnt == 0)
{
brandNameStr.append(brandNameArr[cnt]);
}else{
} else
{
brandNameStr.append(",");
brandNameStr.append(brandNameArr[cnt]);
}
}
}
if(brandNameArr.length>2)
if (brandNameArr.length > 2)
{
brandNameStr.append("...");
}
for(int cnt=0; cnt<divisionNameArr.length; cnt++)
for (int cnt = 0; cnt < divisionNameArr.length; cnt++)
{
if(cnt<2)
if (cnt < 2)
{
if(cnt==0)
if (cnt == 0)
{
divisionNameStr.append(divisionNameArr[cnt]);
}else{
} else
{
divisionNameStr.append(",");
divisionNameStr.append(divisionNameArr[cnt]);
}
}
}
if(divisionNameArr.length>2)
if (divisionNameArr.length > 2)
{
divisionNameStr.append("...");
}
}
if(brandName.length()==0 && divisionName.length()==0)
if (brandName.length() == 0 && divisionName.length() == 0)
{
dataStringValue = new JSONString(chartPropertyNode.getChildNodes().item(0).getNodeValue()+" Brand : "+brandName + " And Division : "+ divisionName);
}else{
dataStringValue = new JSONString(chartPropertyNode.getChildNodes().item(0).getNodeValue()+" Brand : "+brandNameStr + " And Division : "+ divisionNameStr);
dataStringValue = new JSONString(chartPropertyNode.getChildNodes().item(0).getNodeValue() + " Brand : " + brandName + " And Division : " + divisionName);
} else
{
dataStringValue = new JSONString(chartPropertyNode.getChildNodes().item(0).getNodeValue() + " Brand : " + brandNameStr + " And Division : " + divisionNameStr);
}
/*End add code for india map Dhanendra 06/05/2015*/
/*
* End add code for
* india map Dhanendra
* 06/05/2015
*/
metaDataMap.put(jsnStringKey, dataStringValue);
}
if ("bgcolor".equals(chartPropertyNode.getNodeName()))
......@@ -1397,33 +1478,69 @@ public class MetaDataDtl
colorNodeList = new ArrayList<NodeList>();
columnNodeList = graphDataNode.getChildNodes();
colorNodeList.add(columnNodeList);
/*Start This code is write in Chart Creator for max value set from sql by dhanendra on 24/04/2015*/
/*for (int j = 0; j < columnNodeList.getLength(); j++)
{
colorDataMap = new LinkedHashMap<JSONString, JSONString>();
columnNode = columnNodeList.item(j);
if (columnNode.getAttributes().getNamedItem("code") != null)
{
dataStringValue = new JSONString(columnNode.getAttributes().getNamedItem("code").getNodeValue());
jsnStringKey = new JSONString("code");
colorDataMap.put(jsnStringKey, dataStringValue);
}
if (columnNode.getAttributes().getNamedItem("maxvalue") != null)
{
dataStringValue = new JSONString(columnNode.getAttributes().getNamedItem("maxvalue").getNodeValue());
jsnStringKey = new JSONString("maxvalue");
colorDataMap.put(jsnStringKey, dataStringValue);
}
if (columnNode.getAttributes().getNamedItem("label") != null)
{
dataStringValue = new JSONString(columnNode.getAttributes().getNamedItem("label").getNodeValue());
jsnStringKey = new JSONString("displayvalue");
colorDataMap.put(jsnStringKey, dataStringValue);
}
colorList.add(colorDataMap.toString().replace('=', ':'));
}*/
/*
* Start This code is write in
* Chart Creator for max value
* set from sql by dhanendra on
* 24/04/2015
*/
/*
* for (int j = 0; j <
* columnNodeList.getLength();
* j++) { colorDataMap = new
* LinkedHashMap<JSONString,
* JSONString>(); columnNode =
* columnNodeList.item(j); if
* (columnNode
* .getAttributes().getNamedItem
* ("code") != null) {
* dataStringValue = new
* JSONString
* (columnNode.getAttributes
* ().getNamedItem
* ("code").getNodeValue());
* jsnStringKey = new
* JSONString("code");
* colorDataMap
* .put(jsnStringKey,
* dataStringValue); } if
* (columnNode
* .getAttributes().getNamedItem
* ("maxvalue") != null) {
* dataStringValue = new
* JSONString
* (columnNode.getAttributes
* ().getNamedItem
* ("maxvalue").getNodeValue());
* jsnStringKey = new
* JSONString("maxvalue");
* colorDataMap
* .put(jsnStringKey,
* dataStringValue); } if
* (columnNode
* .getAttributes().getNamedItem
* ("label") != null) {
* dataStringValue = new
* JSONString
* (columnNode.getAttributes
* ().getNamedItem
* ("label").getNodeValue());
* jsnStringKey = new
* JSONString("displayvalue");
* colorDataMap
* .put(jsnStringKey,
* dataStringValue); }
* colorList.
* add(colorDataMap.toString
* ().replace('=', ':')); }
*/
/*End This code is write in Chart Creator for max value set from sql by dhanendra on 24/04/2015*/
/*
* End This code is write in
* Chart Creator for max value
* set from sql by dhanendra on
* 24/04/2015
*/
}
}
metaDataList.add(metaDataMap.toString().replace('=', ':'));
......@@ -1431,7 +1548,7 @@ public class MetaDataDtl
graphDtlList.add(columnIdList);
graphDtlList.add(columnNameList);
graphDtlList.add(colorRangeList);
/*graphDtlList.add(colorList);*/
/* graphDtlList.add(colorList); */
graphDtlList.add(colorNodeList);
graphDtlList.add(toptoolTipList);
graphDtlList.add(bottomToolTipList);
......@@ -1441,12 +1558,15 @@ public class MetaDataDtl
graphDtlList.add(hovercolorList);
graphDtlList.add(tooltextList);
conuter++;
gridNGraphMeataDataMap.put("type"+graphID, typeGraphMap);
gridNGraphMeataDataMap.put("type" + graphID, typeGraphMap);
graphMeataDataMap.put("graph" + conuter, graphDtlList);
gridNGraphMeataDataMap.put(graphID, graphMeataDataMap);
gridNGraphMeataDataMap.put("datasource"+graphID, graphDataSourceMap);
gridNGraphMeataDataMap.put("datasource" + graphID, graphDataSourceMap);
}
/**End of build metadata for country mao by swati 16 April 2015**/
/**
* End of build metadata for country mao by
* swati 16 April 2015
**/
//***Start Code for Card (Added by sachin on 1/june/2015)*****\\
......@@ -1463,7 +1583,7 @@ public class MetaDataDtl
typeGraphMap.put("type" + graphID, type);
graphNodeList = viewNode.getChildNodes();
metaDataMap=new LinkedHashMap<JSONString, JSONString>();
metaDataMap = new LinkedHashMap<JSONString, JSONString>();
ArrayList<String> heightList = new ArrayList<String>();
ArrayList<String> widthList = new ArrayList<String>();
......@@ -1521,40 +1641,52 @@ public class MetaDataDtl
}
}
}
/*Add componentIcon tag in metadata by Dhanendra on 01-07-2015*/
/*
* Add componentIcon tag in metadata
* by Dhanendra on 01-07-2015
*/
if ("component_icon".equalsIgnoreCase(childNodeName))
{
componentIconName = (graphDataNode.getChildNodes().item(0).getNodeValue());
}
/*End componentIcon tag in metadata by Dhanendra on 01-07-2015*/
/*
* End componentIcon tag in metadata
* by Dhanendra on 01-07-2015
*/
}
if ("groupFilter".equalsIgnoreCase(childNodeName))
{/*
groupFilterNodeList = graphDataNode.getChildNodes();
for (int j = 0; j < groupFilterNodeList.getLength(); j++)
{
groupFilterNode = groupFilterNodeList.item(j);
if ("autoFilter".equals(groupFilterNode.getNodeName()))
{
dataStringValue = new JSONString(groupFilterNode.getChildNodes().item(0).getNodeValue());
jsnStringKey = new JSONString("autoFilter");
metaDataMap.put(jsnStringKey, dataStringValue);
}
if ("refreshComponents".equals(groupFilterNode.getNodeName()))
{
groupFilterNodeList = groupFilterNode.getChildNodes();
for (int colCtr = 0; colCtr < groupFilterNodeList.getLength(); colCtr++)
{
columnNode = groupFilterNodeList.item(colCtr);
groupFltrNameList.add(columnNode.getChildNodes().item(0).getNodeValue());
}
* groupFilterNodeList =
* graphDataNode.getChildNodes(); for
* (int j = 0; j <
* groupFilterNodeList.getLength(); j++)
* { groupFilterNode =
* groupFilterNodeList.item(j); if
* ("autoFilter"
* .equals(groupFilterNode.getNodeName
* ())) { dataStringValue = new
* JSONString
* (groupFilterNode.getChildNodes
* ().item(0).getNodeValue());
* jsnStringKey = new
* JSONString("autoFilter");
* metaDataMap.put(jsnStringKey,
* dataStringValue); } if
* ("refreshComponents"
* .equals(groupFilterNode
* .getNodeName())) {
* groupFilterNodeList =
* groupFilterNode.getChildNodes(); for
* (int colCtr = 0; colCtr <
* groupFilterNodeList.getLength();
* colCtr++) { columnNode =
* groupFilterNodeList.item(colCtr);
* groupFltrNameList
* .add(columnNode.getChildNodes
* ().item(0).getNodeValue()); } } }
*/
}
}*/
}
//metaDataList.add(metaDataMap.toString().replace('=', ':'));
graphDtlList.add(groupTypeList);
......@@ -1584,11 +1716,63 @@ public class MetaDataDtl
}
}
gridNGraphMeataDataMap.put("datSrc", datsSourceDtlMap);
//Window.alert("gridNGraphMeataDataMap:"+gridNGraphMeataDataMap);
return gridNGraphMeataDataMap;
}
/*public ArrayList<FilterInfo> getFilters(JSONObject jsonObjMetadata)
/*
* public ArrayList<FilterInfo> getFilters(JSONObject jsonObjMetadata) {
* Document document = null; String xmlMetadata = null; Node rootNode =
* null; NodeList rootNodeList = null; NodeList filtrNodeList = null;
* NodeList fltrDtlNodeList = null; Node columNode = null;
* ArrayList<FilterInfo> fltrDtlList = new ArrayList<FilterInfo>(); ;
* FilterInfo filterInfo = null;
*
* 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 ("filters".equals(rootNode.getNodeName()))
* { filtrNodeList = rootNode.getChildNodes(); for (int fltrCtr = 0; fltrCtr
* < filtrNodeList.getLength(); fltrCtr++) { fltrDtlNodeList =
* filtrNodeList.item(fltrCtr).getChildNodes(); filterInfo = new
* FilterInfo();
*
* filterInfo.setFiltertype(filtrNodeList.item(fltrCtr).getAttributes().
* getNamedItem("type").getNodeValue()); for (int dtlCnt = 0; dtlCnt <
* fltrDtlNodeList.getLength(); dtlCnt++) { columNode =
* fltrDtlNodeList.item(dtlCnt); if
* ("col_title".equals(columNode.getNodeName())) { //
* fltrDtlList.add(columNode.getChildNodes().item(0).getNodeValue());
* filterInfo.setColTitle(columNode.getChildNodes().item(0).getNodeValue());
* } if ("col_name".equals(columNode.getNodeName())) { //
* fltrDtlList.add(columNode.getChildNodes().item(0).getNodeValue());
*
* filterInfo.setColName(columNode.getChildNodes().item(0).getNodeValue());
* filterInfo
* .setColNameId(columNode.getAttributes().getNamedItem("id").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(columNode.getAttributes().getNamedItem("headingDisplay")!=null) {
* filterInfo
* .setHeadingDisplay(columNode.getAttributes().getNamedItem("headingDisplay"
* ).getNodeValue()); } } if ("col_descr".equals(columNode.getNodeName())) {
* filterInfo.setColDescr(columNode.getChildNodes().item(0).getNodeValue());
* // fltrDtlList.add(columNode.getChildNodes().item(0).getNodeValue()); } }
* fltrDtlList.add(filterInfo); } } } } } catch (Exception e) {
* Window.alert(" Exception :: :: getFilters() :: MetaDataDtl [" +
* e.getMessage() + "]"); } } return fltrDtlList; }
*/
public ArrayList<FilterInfo> getFilters(JSONObject jsonObjMetadata)
{
Document document = null;
String xmlMetadata = null;
......@@ -1597,7 +1781,7 @@ public class MetaDataDtl
NodeList filtrNodeList = null;
NodeList fltrDtlNodeList = null;
Node columNode = null;
ArrayList<FilterInfo> fltrDtlList = new ArrayList<FilterInfo>(); ;
ArrayList<FilterInfo> fltrDtlList = new ArrayList<FilterInfo>();
FilterInfo filterInfo = null;
if (jsonObjMetadata != null)
......@@ -1618,148 +1802,94 @@ public class MetaDataDtl
if ("filters".equals(rootNode.getNodeName()))
{
filtrNodeList = rootNode.getChildNodes();
for (int fltrCtr = 0; fltrCtr < filtrNodeList.getLength(); fltrCtr++)
{
fltrDtlNodeList = filtrNodeList.item(fltrCtr).getChildNodes();
filterInfo = new FilterInfo();
filterInfo.setFiltertype(filtrNodeList.item(fltrCtr).getAttributes().getNamedItem("type").getNodeValue());
filterInfo.setFiltrType(filtrNodeList.item(fltrCtr).getAttributes().getNamedItem("type").getNodeValue());
if (fltrDtlNodeList.getLength() == 3)
{
for (int dtlCnt = 0; dtlCnt < fltrDtlNodeList.getLength(); dtlCnt++)
{
columNode = fltrDtlNodeList.item(dtlCnt);
if ("col_title".equals(columNode.getNodeName()))
{
// fltrDtlList.add(columNode.getChildNodes().item(0).getNodeValue());
filterInfo.setColTitle(columNode.getChildNodes().item(0).getNodeValue());
}
if ("col_name".equals(columNode.getNodeName()))
{
// fltrDtlList.add(columNode.getChildNodes().item(0).getNodeValue());
filterInfo.setColDescr(columNode.getChildNodes().item(0).getNodeValue());
filterInfo.setDefaultValue("");
filterInfo.setColId("");
filterInfo.setColName(columNode.getChildNodes().item(0).getNodeValue());
filterInfo.setColNameId(columNode.getAttributes().getNamedItem("id").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(columNode.getAttributes().getNamedItem("headingDisplay")!=null)
if (columNode.getAttributes().getNamedItem("name") != null)
{
filterInfo.setHeadingDisplay(columNode.getAttributes().getNamedItem("headingDisplay").getNodeValue());
}
filterInfo.setColName(columNode.getAttributes().getNamedItem("name").getNodeValue());
}
if ("col_descr".equals(columNode.getNodeName()))
if (columNode.getAttributes().getNamedItem("id") != null)
{
filterInfo.setColDescr(columNode.getChildNodes().item(0).getNodeValue());
// fltrDtlList.add(columNode.getChildNodes().item(0).getNodeValue());
}
filterInfo.setFieldName(columNode.getAttributes().getNamedItem("id").getNodeValue());
}
fltrDtlList.add(filterInfo);
if (columNode.getAttributes().getNamedItem("moduleName") != null)
{
filterInfo.setModName(columNode.getAttributes().getNamedItem("moduleName").getNodeValue());
}
if (columNode.getAttributes().getNamedItem("headingDisplay") != null)
{
filterInfo.setShowOnTitle(columNode.getAttributes().getNamedItem("headingDisplay").getNodeValue());
}
if (columNode.getAttributes().getNamedItem("mandatory") != null)
{
filterInfo.setMandatory(columNode.getAttributes().getNamedItem("mandatory").getNodeValue());
}
}
} catch (Exception e)
{
Window.alert(" Exception :: :: getFilters() :: MetaDataDtl [" + e.getMessage() + "]");
}
}
return fltrDtlList;
}*/
public ArrayList<FilterInfo> getFilters(JSONObject jsonObjMetadata)
{
Document document = null;
String xmlMetadata = null;
Node rootNode = null;
NodeList rootNodeList = null;
NodeList filtrNodeList = null;
NodeList fltrDtlNodeList = null;
Node columNode = null;
ArrayList<FilterInfo> fltrDtlList = new ArrayList<FilterInfo>(); ;
FilterInfo filterInfo = null;
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 ("filters".equals(rootNode.getNodeName()))
{
filtrNodeList = rootNode.getChildNodes();
for (int fltrCtr = 0; fltrCtr < filtrNodeList.getLength(); fltrCtr++)
else
{
fltrDtlNodeList = filtrNodeList.item(fltrCtr).getChildNodes();
filterInfo = new FilterInfo();
filterInfo.setFiltrType(filtrNodeList.item(fltrCtr).getAttributes().getNamedItem("type").getNodeValue());
for (int dtlCnt = 0; dtlCnt < fltrDtlNodeList.getLength(); dtlCnt++)
{
columNode = fltrDtlNodeList.item(dtlCnt);
if ("default_value".equals(columNode.getNodeName()))
{
// fltrDtlList.add(columNode.getChildNodes().item(0).getNodeValue());
filterInfo.setDefaultValue(columNode.getChildNodes().item(0).getNodeValue());
}
if ("col_name".equals(columNode.getNodeName()))
{
filterInfo.setColName(columNode.getChildNodes().item(0).getNodeValue());
/*// fltrDtlList.add(columNode.getChildNodes().item(0).getNodeValue());
filterInfo.setColName(columNode.getChildNodes().item(0).getNodeValue());
filterInfo.setColNameId(columNode.getAttributes().getNamedItem("id").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()))
{
filterInfo.setColDescr(columNode.getChildNodes().item(0).getNodeValue());
// fltrDtlList.add(columNode.getChildNodes().item(0).getNodeValue());
}
if ("col_id".equals(columNode.getNodeName()))
{
filterInfo.setColId(columNode.getChildNodes().item(0).getNodeValue());
// fltrDtlList.add(columNode.getChildNodes().item(0).getNodeValue());
}
if ("field_name".equals(columNode.getNodeName()))
{
filterInfo.setFieldName(columNode.getChildNodes().item(0).getNodeValue());
// fltrDtlList.add(columNode.getChildNodes().item(0).getNodeValue());
}
if ("mod_name".equals(columNode.getNodeName()))
{
filterInfo.setModName(columNode.getChildNodes().item(0).getNodeValue());
// fltrDtlList.add(columNode.getChildNodes().item(0).getNodeValue());
}
if ("show_ontitle".equals(columNode.getNodeName()))
{
filterInfo.setShowOnTitle(columNode.getChildNodes().item(0).getNodeValue());
// fltrDtlList.add(columNode.getChildNodes().item(0).getNodeValue());
}
if ("mandatory".equals(columNode.getNodeName()))
{
filterInfo.setMandatory(columNode.getChildNodes().item(0).getNodeValue());
// fltrDtlList.add(columNode.getChildNodes().item(0).getNodeValue());
}
}
}
fltrDtlList.add(filterInfo);
......@@ -1801,10 +1931,12 @@ public class MetaDataDtl
if ("page_title".equals(rootNode.getNodeName()))
{
pageTitle.add(rootNode.getChildNodes().item(0).getNodeValue());
/*if(rootNode.getAttributes().getNamedItem("titleparam").getNodeValue()!=null)
{
pageTitle.add(rootNode.getAttributes().getNamedItem("titleparam").getNodeValue());
}*/
/*
* if(rootNode.getAttributes().getNamedItem("titleparam"
* ).getNodeValue()!=null) {
* pageTitle.add(rootNode.getAttributes
* ().getNamedItem("titleparam").getNodeValue()); }
*/
}
if ("sub_title".equals(rootNode.getNodeName()))
{
......@@ -1818,16 +1950,17 @@ public class MetaDataDtl
}
}
return pageTitle;
}
public boolean isFiltrHide(JSONObject jsonObjMetadata)
{
boolean showFilter=false;
boolean showFilter = false;
Document document = null;
String xmlMetadata = null;
Node rootNode = null;
NodeList rootNodeList = null;
String fiterValue="";
String fiterValue = "";
if (jsonObjMetadata != null)
{
xmlMetadata = jsonObjMetadata.get("metaData").toString();
......@@ -1845,7 +1978,10 @@ public class MetaDataDtl
rootNode = rootNodeList.item(rootCtr);
if ("filters".equals(rootNode.getNodeName()))
{
fiterValue=rootNode.getAttributes().getNamedItem("display").getNodeValue();
if (rootNode.getAttributes().getNamedItem("display") != null)
{
fiterValue = rootNode.getAttributes().getNamedItem("display").getNodeValue();
}
}
}
}
......@@ -1854,16 +1990,16 @@ public class MetaDataDtl
Window.alert(" Exception :: :: isFiltrHide() :: MetaDataDtl [" + e.getMessage() + "]");
}
}
if("Y".equalsIgnoreCase(fiterValue))
if ("Y".equalsIgnoreCase(fiterValue))
{
showFilter=true;
showFilter = true;
}
return showFilter;
}
public String getCurrentDate()
{
String currDate="";
String currDate = "";
DateFormat dateFor = new SimpleDateFormat("dd/MM/yyyy");
Date date = new Date();
currDate = dateFor.format(date);
......
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