Commit 35abdfe9 authored by pborate's avatar pborate

Updated dashboardUtil.java class.

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@182603 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 4b5d044d
...@@ -2,7 +2,9 @@ package ibase.dashboard.common.hibernate.dao; ...@@ -2,7 +2,9 @@ package ibase.dashboard.common.hibernate.dao;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date;
import java.util.List; import java.util.List;
import org.apache.commons.io.FileUtils; import org.apache.commons.io.FileUtils;
...@@ -17,12 +19,10 @@ import org.w3c.dom.NamedNodeMap; ...@@ -17,12 +19,10 @@ import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node; import org.w3c.dom.Node;
import org.w3c.dom.NodeList; import org.w3c.dom.NodeList;
import ibase.dashboard.common.hibernate.bean.Employee;
import ibase.dashboard.common.hibernate.bean.Pophelp; import ibase.dashboard.common.hibernate.bean.Pophelp;
import ibase.dashboard.common.hibernate.utility.HibernateUtil; import ibase.dashboard.common.hibernate.utility.HibernateUtil;
import ibase.utility.CommonConstants; import ibase.utility.CommonConstants;
import ibase.utility.E12GenericUtility; import ibase.utility.E12GenericUtility;
import javassist.bytecode.Descriptor.Iterator;
public class DashboardUtil public class DashboardUtil
{ {
...@@ -87,6 +87,8 @@ public class DashboardUtil ...@@ -87,6 +87,8 @@ public class DashboardUtil
try try
{ {
if(dashboardConfig.has("view")) {
JSONObject view =dashboardConfig.optJSONObject("view"); JSONObject view =dashboardConfig.optJSONObject("view");
JSONArray viewArray =new JSONArray(); JSONArray viewArray =new JSONArray();
if(view != null) if(view != null)
...@@ -141,16 +143,20 @@ public class DashboardUtil ...@@ -141,16 +143,20 @@ public class DashboardUtil
System.out.println("viewArray in else if>>>>> === "+viewArray); System.out.println("viewArray in else if>>>>> === "+viewArray);
popHelpFunction.put("view", viewArray); popHelpFunction.put("view", viewArray);
}
System.out.println("popHelpFunction type === "+popHelpFunction); System.out.println("popHelpFunction type === "+popHelpFunction);
if(dashboardConfig.has("page_title")) {
String page_title= dashboardConfig.getString("page_title"); String page_title= dashboardConfig.getString("page_title");
System.out.println("page_title ::::"+page_title); System.out.println("page_title ::::"+page_title);
if(page_title.length()>0) if(page_title.length()>0)
{ {
popHelpFunction.put("page_title", page_title); popHelpFunction.put("page_title", page_title);
} }
}
Object datasourceVal=dashboardConfig.get("datasource"); if(dashboardConfig.has("datasource")) {
Object datasourceVal=dashboardConfig.opt("datasource");
JSONArray datasource=new JSONArray(); JSONArray datasource=new JSONArray();
System.out.println("datasourceVal ::::"+datasourceVal); System.out.println("datasourceVal ::::"+datasourceVal);
if(datasourceVal instanceof JSONArray) { if(datasourceVal instanceof JSONArray) {
...@@ -164,6 +170,7 @@ public class DashboardUtil ...@@ -164,6 +170,7 @@ public class DashboardUtil
System.out.println("datasource obj::::"+datasource); System.out.println("datasource obj::::"+datasource);
popHelpFunction.put("datasource", datasource); popHelpFunction.put("datasource", datasource);
} }
}
if(dashboardConfig.has("filters")) { if(dashboardConfig.has("filters")) {
JSONObject filters= dashboardConfig.getJSONObject("filters"); JSONObject filters= dashboardConfig.getJSONObject("filters");
...@@ -343,15 +350,28 @@ public class DashboardUtil ...@@ -343,15 +350,28 @@ public class DashboardUtil
filter =new JSONArray(); filter =new JSONArray();
List<String> systemOption = new ArrayList<String>(); List<String> systemOption = new ArrayList<String>();
for(int i = 0, size = filterTemp.length(); i < size; i++){ for(int i = 0, size = filterTemp.length(); i < size; i++){
System.out.println("size>>>>>>"+size); //System.out.println("size>>>>>>"+size);
JSONObject fil= filterTemp.getJSONObject(i); JSONObject fil= filterTemp.getJSONObject(i);
System.out.println("filter>>>>>> "+i+" "+fil); System.out.println("filter>>>>>> "+i+" "+fil);
String colName=fil.optString("col_name"); String colName=fil.optString("col_name");
String modName=fil.optString("mod_name"); String modName=fil.optString("mod_name");
String type=fil.optString("type"); String type=fil.optString("type");
Object defaultValue=fil.opt("default_value");
System.out.println("defaultValue::::"+defaultValue);
if(defaultValue ==null || defaultValue instanceof JSONObject) {
if(type.equalsIgnoreCase("4")) {
System.out.println("Inside if processDashboardFilter 4::::");
fil.put("default_value", new SimpleDateFormat("dd/MM/yyyy").format(new Date()));
}
else {
fil.put("default_value","");
}
}
System.out.println("default value "+fil);
System.out.println("Inside type processDashboardFilter>>>>>>"+type); System.out.println("Inside type processDashboardFilter>>>>>>"+type);
JSONObject popHelpData = new JSONObject(); JSONObject popHelpData = new JSONObject();
if(type.equalsIgnoreCase("1")) { if(type.equalsIgnoreCase("1")) {
System.out.println("Inside if processDashboardFilter::::"); System.out.println("Inside if processDashboardFilter::::");
fil=processPophelpData(colName, modName,fil); fil=processPophelpData(colName, modName,fil);
...@@ -407,6 +427,7 @@ public class DashboardUtil ...@@ -407,6 +427,7 @@ public class DashboardUtil
filter.put("auto_fil_len", checkNull(pophelpData.getAutoFillLen())); filter.put("auto_fil_len", checkNull(pophelpData.getAutoFillLen()));
filter.put("help_option", checkNull(pophelpData.getHelpOption())); filter.put("help_option", checkNull(pophelpData.getHelpOption()));
filter.put("multi_option", checkNull(pophelpData.getMultiOpt())); filter.put("multi_option", checkNull(pophelpData.getMultiOpt()));
filter.put("key_string", checkNull(pophelpData.getSqlInput()));
} }
else { else {
filter.put("is_pophelp", false); filter.put("is_pophelp", false);
......
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