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;
import java.io.File;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import org.apache.commons.io.FileUtils;
......@@ -17,12 +19,10 @@ import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import ibase.dashboard.common.hibernate.bean.Employee;
import ibase.dashboard.common.hibernate.bean.Pophelp;
import ibase.dashboard.common.hibernate.utility.HibernateUtil;
import ibase.utility.CommonConstants;
import ibase.utility.E12GenericUtility;
import javassist.bytecode.Descriptor.Iterator;
public class DashboardUtil
{
......@@ -87,6 +87,8 @@ public class DashboardUtil
try
{
if(dashboardConfig.has("view")) {
JSONObject view =dashboardConfig.optJSONObject("view");
JSONArray viewArray =new JSONArray();
if(view != null)
......@@ -141,16 +143,20 @@ public class DashboardUtil
System.out.println("viewArray in else if>>>>> === "+viewArray);
popHelpFunction.put("view", viewArray);
}
System.out.println("popHelpFunction type === "+popHelpFunction);
if(dashboardConfig.has("page_title")) {
String page_title= dashboardConfig.getString("page_title");
System.out.println("page_title ::::"+page_title);
if(page_title.length()>0)
{
popHelpFunction.put("page_title", page_title);
}
}
Object datasourceVal=dashboardConfig.get("datasource");
if(dashboardConfig.has("datasource")) {
Object datasourceVal=dashboardConfig.opt("datasource");
JSONArray datasource=new JSONArray();
System.out.println("datasourceVal ::::"+datasourceVal);
if(datasourceVal instanceof JSONArray) {
......@@ -164,6 +170,7 @@ public class DashboardUtil
System.out.println("datasource obj::::"+datasource);
popHelpFunction.put("datasource", datasource);
}
}
if(dashboardConfig.has("filters")) {
JSONObject filters= dashboardConfig.getJSONObject("filters");
......@@ -343,15 +350,28 @@ public class DashboardUtil
filter =new JSONArray();
List<String> systemOption = new ArrayList<String>();
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);
System.out.println("filter>>>>>> "+i+" "+fil);
String colName=fil.optString("col_name");
String modName=fil.optString("mod_name");
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);
JSONObject popHelpData = new JSONObject();
if(type.equalsIgnoreCase("1")) {
System.out.println("Inside if processDashboardFilter::::");
fil=processPophelpData(colName, modName,fil);
......@@ -407,6 +427,7 @@ public class DashboardUtil
filter.put("auto_fil_len", checkNull(pophelpData.getAutoFillLen()));
filter.put("help_option", checkNull(pophelpData.getHelpOption()));
filter.put("multi_option", checkNull(pophelpData.getMultiOpt()));
filter.put("key_string", checkNull(pophelpData.getSqlInput()));
}
else {
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