Commit b869d436 authored by dkasliwal's avatar dkasliwal

Added code for Interlink from Stack Chart and parentAxix for bar chart and...

Added code for Interlink  from Stack Chart and parentAxix for bar chart and add tag showsum in metadata for stack chart .


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@98518 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 62c5cec4
......@@ -404,6 +404,7 @@ public class ChartCreator
mapValuList = allDataMap.get(keyString);
jsnStringKey = new JSONString("label");
dataStringKey = new JSONString("value");
dataStringValue = new JSONString(mapValuList.get(0));
String value = mapValuList.get(1).replace("{", "");
value = value.replace("}", "");
String[] tempArray = value.split(",");
......@@ -423,7 +424,86 @@ public class ChartCreator
if(!barChartMap.containsKey(jsnStringKey))
{
barChartMap.put(dataStringKey, new JSONString(tempArr[1]));
//barChartMap.put(new JSONString("link"), new JSONString("#"));
linkStringKey = new JSONString("link");
/*started code link in stack by swati 10 aug 2015*/
String temp = Window.Location.getHref();
String prevUrl = temp.substring(temp.indexOf('&'), temp.length());
String period =parameterList.get(1);
String url=Window.Location.getParameter("titleName");
String prdFilter="";
int cnt1=0;
String propertyStr="";
for (FilterInfo filterInfo : filterList)
{
if(cnt1==0)
{
propertyStr = "&"+filterInfo.getFieldName()+"@"+parameterList.get(cnt1+1);
}
else
{
propertyStr = propertyStr+"&"+filterInfo.getFieldName()+"@"+parameterList.get(cnt1+1);
}
cnt1++;
}
if(prdFilterName.length()>0)
{
prdFilter=prdFilterName;
}
if(url=="undefined" || url.equals("undefined") || url.equalsIgnoreCase("undefined"))
{
url="&titleName@"+(FilterCreator.title).get(0);
}
else
{
url="&titleName@"+url+":"+(FilterCreator.title).get(0)+(""+jsnStringValue).replace('"', ' ').trim();
}
String linkType=linkTypeList.get(j).trim();
if((prevUrl).trim().length()>1)
{
if(linkType.equalsIgnoreCase("n"))
{
if(linkLMetadataList.get(j).trim().contains("/"))
{
linkStringValue=new JSONString(linkType+"-"+linkLMetadataList.get(j)+propertyStr+prevUrl.replace('=', '@')+"&"+prdFilter+"@"+period+url+"&"+yAxisColunList.get(j)+"@"+(""+dataStringValue).replace('"', ' ').trim()+"&"+xAxisColunList.get(0)+"@"+(""+jsnStringValue).replace('"', ' ').trim());
}else {
linkStringValue=new JSONString(linkType+"-"+"/ibase/dwh/GwtDashboardPage.html?metadataname@"+linkLMetadataList.get(j)+propertyStr+prevUrl.replace('=', '@')+"&"+prdFilter+"@"+period+url+"&"+yAxisColunList.get(j)+"@"+(""+dataStringValue).replace('"', ' ').trim()+"&"+xAxisColunList.get(0)+"@"+(""+jsnStringValue).replace('"', ' ').trim());
}
}
else if(linkType.equalsIgnoreCase("p"))
{
if(linkLMetadataList.get(j).trim().contains("/"))
{
linkStringValue=new JSONString(linkType+"-detailsPopUp,"+linkedProperties+"-"+linkLMetadataList.get(j)+propertyStr+prevUrl.replace('=', '@')+"&"+prdFilter+"@"+period+url+"&"+yAxisColunList.get(j)+"@"+(""+dataStringValue).replace('"', ' ').trim()+"&"+xAxisColunList.get(0)+"@"+(""+jsnStringValue).replace('"', ' ').trim());
}else {
linkStringValue=new JSONString(linkType+"-detailsPopUp,"+linkedProperties+"-/ibase/dwh/GwtDashboardPage.html?metadataname@"+linkLMetadataList.get(j)+propertyStr+prevUrl.replace('=', '@')+"&"+prdFilter+"@"+period+url+"&"+yAxisColunList.get(j)+"@"+(""+dataStringValue).replace('"', ' ').trim()+"&"+xAxisColunList.get(0)+"@"+(""+jsnStringValue).replace('"', ' ').trim());
}
}
}
else
{
if(linkType.equalsIgnoreCase("n"))
{
if(linkLMetadataList.get(j).trim().contains("/"))
{
linkStringValue=new JSONString(linkType+"-"+linkLMetadataList.get(j)+propertyStr+"&"+prdFilter+"@"+period+url+"&"+yAxisColunList.get(j)+"@"+(""+dataStringValue).replace('"', ' ').trim()+"&"+xAxisColunList.get(0)+"@"+(""+jsnStringValue).replace('"', ' ').trim());
}else {
linkStringValue=new JSONString(linkType+"-"+"/ibase/dwh/GwtDashboardPage.html?metadataname@"+linkLMetadataList.get(j)+propertyStr+"&"+prdFilter+"@"+period+url+"&"+yAxisColunList.get(j)+"@"+(""+dataStringValue).replace('"', ' ').trim()+"&"+xAxisColunList.get(0)+"@"+(""+jsnStringValue).replace('"', ' ').trim());
}
}
else if(linkType.equalsIgnoreCase("p"))
{
if(linkLMetadataList.get(j).trim().contains("/"))
{
linkStringValue=new JSONString(linkType+"-detailsPopUp,"+linkedProperties+"-"+linkLMetadataList.get(j)+propertyStr+"&"+prdFilter+"@"+period+url+"&"+yAxisColunList.get(j)+"@"+(""+dataStringValue).replace('"', ' ').trim()+"&"+xAxisColunList.get(0)+"@"+(""+jsnStringValue).replace('"', ' ').trim());
}else {
linkStringValue=new JSONString(linkType+"-detailsPopUp,"+linkedProperties+"-/ibase/dwh/GwtDashboardPage.html?metadataname@"+linkLMetadataList.get(j)+propertyStr+"&"+prdFilter+"@"+period+url+"&"+yAxisColunList.get(j)+"@"+(""+dataStringValue).replace('"', ' ').trim()+"&"+xAxisColunList.get(0)+"@"+(""+jsnStringValue).replace('"', ' ').trim());
}
}
}
//Window.alert("linkStringKey: "+linkStringKey+"\nlinkStringValue:"+linkStringValue);
/*ended code link in stack by swati 10 aug 2015*/
barChartMap.put(linkStringKey, linkStringValue);
}
}
if(! labelList.contains(categoryMap))
......@@ -445,7 +525,6 @@ public class ChartCreator
}
}
barDataVal = JSONParser.parseStrict(barValueList.toString().replace('=', ':'));
barMap.put(new JSONString("data"), barDataVal);
allDataList.add(barMap);
......@@ -1162,27 +1241,7 @@ public class ChartCreator
/******start of code for link to new chart*/
if(linkedMetadataList.get(cnt).trim().length()>0)
{
/*String temp = Window.Location.getHref();
String prevUrl = temp.substring(temp.indexOf('&'), temp.length());
String period =FilterCreator.parameterList.get(1);
String url=Window.Location.getParameter("titleName");
String prdFilter="";
if(GWTDashBoardReport.prdFilterName.length()>0)
{
prdFilter=GWTDashBoardReport.prdFilterName;
}
if(url=="undefined" || url.equals("undefined") || url.equalsIgnoreCase("undefined"))
{
url="&titleName@"+(FilterCreator.title).get(0)+(""+jsnStringValue).replace('"', ' ').trim();
}
else
{
url="&titleName@"+url+":"+(FilterCreator.title).get(0)+(""+jsnStringValue).replace('"', ' ').trim();
}*/
String linkType=linkTypeList.get(cnt).trim();
//if((prevUrl).trim().length()>1)
//{
if(linkType.equalsIgnoreCase("n"))
{
if(linkedMetadataList.get(cnt).trim().contains("/"))
......@@ -1206,29 +1265,8 @@ public class ChartCreator
//linkStringValue=new JSONString(linkType+"-detailsPopUp,"+linkedProperties+"-/ibase/dwh/GwtDashboardPage.html?metadataname@"+linkedMetadataList.get(cnt)+prevUrl.replace('=', '@')+"&"+prdFilter+"@"+period+url+"&"+yAxisColunList.get(seriesCnt)+"@"+(""+dataStringValue).replace('"', ' ').trim()+"&"+xAxisColunList.get(0)+"@"+(""+jsnStringValue).replace('"', ' ').trim());
}
}
/*}
else
{
if(linkType.equalsIgnoreCase("n"))
{
if(linkedMetadataList.get(cnt).trim().contains("/"))
{
linkStringValue=new JSONString(linkType+"-"+linkedMetadataList.get(cnt)+"&"+prdFilter+"@"+period+url+"&"+yAxisColunList.get(seriesCnt)+"@"+(""+dataStringValue).replace('"', ' ').trim()+"&"+xAxisColunList.get(0)+"@"+(""+jsnStringValue).replace('"', ' ').trim());
}else {
linkStringValue=new JSONString(linkType+"-"+"/ibase/dwh/GwtDashboardPage.html?metadataname@"+linkedMetadataList.get(cnt)+"&"+prdFilter+"@"+period+url+"&"+yAxisColunList.get(seriesCnt)+"@"+(""+dataStringValue).replace('"', ' ').trim()+"&"+xAxisColunList.get(0)+"@"+(""+jsnStringValue).replace('"', ' ').trim());
}
}
else if(linkType.equalsIgnoreCase("p"))
{
if(linkedMetadataList.get(cnt).trim().contains("/"))
{
linkStringValue=new JSONString(linkType+"-detailsPopUp,"+linkedProperties+"-"+linkedMetadataList.get(cnt)+"&"+prdFilter+"@"+period+url+"&"+yAxisColunList.get(seriesCnt)+"@"+(""+dataStringValue).replace('"', ' ').trim()+"&"+xAxisColunList.get(0)+"@"+(""+jsnStringValue).replace('"', ' ').trim());
}else {
linkStringValue=new JSONString(linkType+"-detailsPopUp,"+linkedProperties+"-/ibase/dwh/GwtDashboardPage.html?metadataname@"+linkedMetadataList.get(cnt)+"&"+prdFilter+"@"+period+url+"&"+yAxisColunList.get(seriesCnt)+"@"+(""+dataStringValue).replace('"', ' ').trim()+"&"+xAxisColunList.get(0)+"@"+(""+jsnStringValue).replace('"', ' ').trim());
}
}
}*/
/*end of code for link to new chatr*/
/*end of code for link to new chart*/
dataValueJson.put(new JSONString("link"), linkStringValue);
}
dataValueJsonList.add(dataValueJson);
......
package ibase.client;
import java.awt.BufferCapabilities.FlipContents;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Date;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
......@@ -24,7 +22,6 @@ import com.google.gwt.http.client.Response;
import com.google.gwt.json.client.JSONObject;
import com.google.gwt.json.client.JSONParser;
import com.google.gwt.json.client.JSONString;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.Composite;
......@@ -916,7 +913,7 @@ public class GraphComponent extends Composite
JSONObject jsonObjData = new JSONObject();
jsonObjData.put(key, servletJsnObj);
componentDataMap.put(key, jsonObjData);
RootPanel.get("chartContainer").clear();
/*RootPanel.get("chartContainer").clear();*/
}else
{
componentDataMap.put(key, null);
......@@ -1014,7 +1011,7 @@ public class GraphComponent extends Composite
if (!"null".equals(groupVal))
{
groupVal = groupVal.replace('"', ' ');
groupVal = groupVal.replace('"', ' ').trim();
groupVal = groupVal +"@"+ designation;
xAxisVal = "" + fetchRowWiseValJsn.get(xAxixNameList.get(0)).toString().replace('"', ' ');
yAxisVal = Integer.parseInt(fetchRowWiseValJsn.get(yAxixNameList.get(0)).toString().replace('"', ' ').trim());
......@@ -1073,8 +1070,8 @@ public class GraphComponent extends Composite
for (int jsnCnt = 0; jsnCnt < dataJsn.size(); jsnCnt++)
{
fetchRowWiseVal = (JSONObject) dataJsn.get(String.valueOf(jsnCnt));
group = fetchRowWiseVal.get(groupName).toString().replace("\"", "");
//Window.alert("group :"+group);
group = fetchRowWiseVal.get(groupName).toString().replace("\"", "").trim();
if(selcetIndex == null || selcetIndex.equals(""))
{
if(jsnCnt == 0)
......@@ -1084,7 +1081,7 @@ public class GraphComponent extends Composite
}
}else
{
firstValue=selcetIndex;
firstValue = selcetIndex;
firstIndex = firstValue;
}
if(group.equalsIgnoreCase(firstValue))
......@@ -1093,7 +1090,6 @@ public class GraphComponent extends Composite
count++;
}
}
//Window.alert("In Filter Method :"+fltrDataJson);
return fltrDataJson;
}
@SuppressWarnings("unchecked")
......@@ -1177,7 +1173,6 @@ public class GraphComponent extends Composite
}
getClearDiv(groupName);
getDisplayData(fltrAfterDataJson, graphDtlList, groupCssList.get(0), width, height, imageName, refrshMapVal, mainDataJson,groupName,filterList);
}
}else if ("T".equalsIgnoreCase(type))
......@@ -1257,7 +1252,6 @@ public class GraphComponent extends Composite
String[] personArr = null;
String persondesg = "";
for (final String multGrph : mainDataJson.keySet())
{
cnt++;
......
......@@ -208,11 +208,9 @@ public class MetaDataDtl
{
viewNode = viewNodeList.item(viewCtr);
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()) || "grid".equals(viewNode.getNodeName())) && type.equalsIgnoreCase("T"))
{
......@@ -272,11 +270,8 @@ public class MetaDataDtl
{
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());
......@@ -316,11 +311,7 @@ public class MetaDataDtl
/* 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"))
{
......@@ -399,10 +390,7 @@ public class MetaDataDtl
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
*/
/* 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);
......@@ -412,18 +400,13 @@ public class MetaDataDtl
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
*/
/* End By Dhanendra on 04/06/2015 for metadata add new tag */
columnIDList = 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()) || "graph".equals(viewNode.getNodeName())) && type.equalsIgnoreCase("G"))
{
......@@ -451,9 +434,11 @@ public class MetaDataDtl
linkedMetadataList = new ArrayList<String>();
linkTypeList = new ArrayList<String>();
//ended by swati 20dec2014 for linked chart
/*Added By Swati for parent axis */
parentAxisList= new ArrayList<String>();
/*Ended By Swati for parent axis */
/* Add By Dhanedra for metadata change */
groupTypeList = new ArrayList<String>();
componentCssList = new ArrayList<String>();
......@@ -462,6 +447,7 @@ public class MetaDataDtl
groupFltrNameList = new ArrayList<String>();
String componentIconName = "";
/* End By Dhanedra for metadata change */
metaDataMap = new LinkedHashMap<JSONString, JSONString>();
toolTextInfoList = new ArrayList<String>();
......@@ -723,10 +709,7 @@ 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());
......@@ -745,18 +728,22 @@ 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 */
//added show sum property for stack chart to metaDataMap by swati on 18 Aug 2015
if ("showsum".equalsIgnoreCase(chartPropertyNode.getNodeName()))
{
dataStringValue = new JSONString(chartPropertyNode.getChildNodes().item(0).getNodeValue());
jsnStringKey = new JSONString("showSum");
metaDataMap.put(jsnStringKey, dataStringValue);
}
//ended show sum property for stack chart to metaDataMap by swati on 18 Aug 2015
}
}
//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());
......@@ -817,27 +804,28 @@ public class MetaDataDtl
graphDtlList.add(dotThicknessList);
graphDtlList.add(showValList);
graphDtlList.add(chartTypeList);
//added linked chart metadata name to graphdetail list by swati on 22 Dec 2014
graphDtlList.add(linkedMetadataList);
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 */
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 */
graphDtlList.add(toolTextInfoList);
/* End For ToolText By Dhanendra */
/* 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 */
/*Add for Parent Axis by Swati */
graphDtlList.add(parentAxisList);
/*End for Parent Axis by Swati */
......@@ -1229,11 +1217,9 @@ 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
*/
/* Start add code for india map Dhanendra 06/05/2015 */
if (metDtName == "indiamap")
{
brandName = FilterCreator.parameterListDtl.get(2);
......@@ -1296,11 +1282,9 @@ public class MetaDataDtl
{
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()))
......@@ -1461,69 +1445,6 @@ 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('=', ':')); }
*/
/*
* 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('=', ':'));
......@@ -1546,10 +1467,7 @@ public class MetaDataDtl
gridNGraphMeataDataMap.put(graphID, graphMeataDataMap);
gridNGraphMeataDataMap.put("datasource" + graphID, graphDataSourceMap);
}
/**
* End of build metadata for country mao by
* swati 16 April 2015
**/
/** End of build metadata for country map by swati 16 April 2015 **/
//***Start Code for Card (Added by sachin on 1/june/2015)*****\\
......@@ -1624,18 +1542,12 @@ 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))
......@@ -1702,59 +1614,7 @@ public class MetaDataDtl
return gridNGraphMeataDataMap;
}
/*
* 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;
......
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