summaryrefslogtreecommitdiffstats
path: root/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/runtime/ChartJSONHelper.java
diff options
context:
space:
mode:
Diffstat (limited to 'ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/runtime/ChartJSONHelper.java')
-rw-r--r--ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/runtime/ChartJSONHelper.java254
1 files changed, 119 insertions, 135 deletions
diff --git a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/runtime/ChartJSONHelper.java b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/runtime/ChartJSONHelper.java
index 29cbca18..268b20cc 100644
--- a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/runtime/ChartJSONHelper.java
+++ b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/runtime/ChartJSONHelper.java
@@ -302,7 +302,6 @@ public class ChartJSONHelper {
public String generateJSON(ReportRuntime reportRuntime,Map<String, String> chartOptionsMap, HttpServletRequest request, boolean showData) throws RaptorException {
- //String width, String height, boolean animation, String rotateLabels, boolean staggerLabels, boolean showMaxMin, boolean showLegend, boolean showControls, String topMargin, String bottomMargin, boolean showTitle, String subType
String userId = AppUtils.getUserID(request);
String width = chartOptionsMap.get("width");
String height = chartOptionsMap.get("height");
@@ -343,7 +342,6 @@ public class ChartJSONHelper {
List l = reportRuntime.getAllColumns();
List lGroups = reportRuntime.getAllChartGroups();
HashMap mapYAxis = reportRuntime.getAllChartYAxis(reportRuntime.getReportParamValues());
- //ReportParamValues reportParamValues = reportRuntime.getReportParamValues();
String chartLeftAxisLabel = reportRuntime.getFormFieldFilled(nvl(reportRuntime.getChartLeftAxisLabel()));
String chartRightAxisLabel = reportRuntime.getFormFieldFilled(nvl(reportRuntime.getChartRightAxisLabel()));
@@ -391,7 +389,6 @@ public class ChartJSONHelper {
ds = ConnectionUtils.getDataSet(reportSQL, dbInfo);
}
} catch (RaptorException ex) {
- //throw new RaptorException("Error while loading chart data", ex);
logger.error(EELFLoggerDelegate.debugLogger, ("********************************************************************************"));
logger.error(EELFLoggerDelegate.debugLogger, (chartType.toUpperCase()+" - " + "Report ID : " + reportRuntime.getReportID() + " ERROR THROWN FOR GIVEN QUERY "));
logger.error(EELFLoggerDelegate.debugLogger, ("QUERY - " + reportRuntime.getWholeSQL()));
@@ -400,7 +397,6 @@ public class ChartJSONHelper {
}
if(ds==null) {
- //displayChart = false;
if(chartType.equals(AppConstants.GT_ANNOTATION_CHART))
ds = new DataSet();
else
@@ -417,7 +413,7 @@ public class ChartJSONHelper {
List<DataColumnType> dcList = reportRuntime.getOnlyVisibleColumns();
int countIndex = 0;
- ArrayList<ChartColumnJSON> chartColumnJSONList = new ArrayList<ChartColumnJSON>();
+ ArrayList<ChartColumnJSON> chartColumnJSONList = new ArrayList<>();
for(Iterator iter = dcList.iterator(); iter.hasNext(); ) {
ChartColumnJSON ccJSON = new ChartColumnJSON();
DataColumnType dc = (DataColumnType) iter.next();
@@ -468,23 +464,15 @@ public class ChartJSONHelper {
categoryAxisJSON.setValue(dct.getColId());
chartJSON.setCategoryAxisJSON(categoryAxisJSON);
}
- //allColumns
- //.add(new Item(dct.getColId(), dct.getDisplayName()));
}
- //chartJSON.setCategoryAxis(categoryAxis);
- //chartJSON.set
List<DataColumnType> chartValueCols = reportRuntime.getChartValueColumnsList(AppConstants.CHART_ALL_COLUMNS, null);
DataColumnType dct_RangeAxis = null;
- //int noChart = 0;
- //if(chartValueCols.size()<=0) {
- //chartValueCols.addAll(reportCols);
- //noChart = 1;
- //}
+
if(chartValueCols.size() <= 0) {
chartValueCols = reportCols;
}
- ArrayList<RangeAxisJSON> rangeAxisJSONList = new ArrayList<RangeAxisJSON>();
+ ArrayList<RangeAxisJSON> rangeAxisJSONList = new ArrayList<>();
for (int k = 0; k < chartValueCols.size(); k++) {
dct_RangeAxis = chartValueCols.get(k);
RangeAxisJSON rangeAxisJSON = new RangeAxisJSON();
@@ -577,12 +565,12 @@ public class ChartJSONHelper {
chartJSON.setMaxRange(reportRuntime.getRangeAxisUpperLimit());
if(showData) {
- ArrayList<ArrayList<Row>> wholeList = new ArrayList<ArrayList<Row>>();
+ ArrayList<ArrayList<Row>> wholeList = new ArrayList<>();
- ArrayList<Row> rowList = new ArrayList<Row>();
+ ArrayList<Row> rowList = new ArrayList<>();
if(showData) {
for (int i = 0; i < ds.getRowCount(); i++) {
- rowList = new ArrayList<Row>();
+ rowList = new ArrayList<>();
for (int j = 0; j<ds.getColumnCount(); j++) {
Row row = new Row();
row.setColId(ds.getColumnName(j));
@@ -617,8 +605,6 @@ public class ChartJSONHelper {
chartTypeJSON.setValue(chartType);
chartJSON.setChartTypeJSON(chartTypeJSON);
}
- //mapper.setVisibility(JsonMethod.FIELD, Visibility.ANY);
- //mapper.setVisibilityChecker(mapper.getVisibilityChecker().with(JsonAutoDetect.Visibility.NONE));
mapper.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false);
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
String jsonInString = "";
@@ -681,14 +667,10 @@ public class ChartJSONHelper {
//Add order by clause
Pattern re1 = Pattern.compile("(^[\r\n]*|([\\s]))[Oo][Rr][Dd][Ee][Rr](.*?[^\r\n]*)[Bb][Yy]",Pattern.DOTALL);
- //Pattern re1 = Pattern.compile("order(.*?[^\r\n]*)by", Pattern.DOTALL);
Matcher matcher = re1.matcher(reportSQL);
- //Pattern re1 = Pattern.compile("(^[\r\n]*|([\\s]))[Oo][Rr][Dd][Ee][Rr][Tt](.*?[^\r\n]*)[Bb][Yy]",Pattern.DOTALL);
- //int startPoint = sql.length()-30;
reportSQL = reportSQL + " ";
reportSQL = Pattern.compile("(^[\r\n]*|([\\s]))[Ss][Ee][Ll][Ee][Cc][Tt]([\r\n]*|[\\s]*)",Pattern.DOTALL).matcher(reportSQL).replaceAll(" SELECT ");
- //reportSQL = Pattern.compile("(^[\r\n]*|([\\s]))[Ff][Rr][Oo][Mm]([\r\n]*|[\\s]*)",Pattern.DOTALL).matcher(reportSQL).replaceAll(" FROM ");
reportSQL = Pattern.compile("(^[\r\n]*|([\\s]))[Ww][Hh][Ee][Rr][Ee]([\r\n]*|[\\s]*)",Pattern.DOTALL).matcher(reportSQL).replaceAll(" WHERE ");
reportSQL = Pattern.compile("(^[\r\n]*|([\\s]))[Ww][Hh][Ee][Nn]([\r\n]*|[\\s]*)",Pattern.DOTALL).matcher(reportSQL).replaceAll(" WHEN ");
reportSQL = Pattern.compile("(^[\r\n]*|([\\s]))[Aa][Nn][Dd]([\r\n]*|[\\s]*)",Pattern.DOTALL).matcher(reportSQL).replaceAll(" AND ");
@@ -724,13 +706,9 @@ public class ChartJSONHelper {
formfield_value = AppUtils.getRequestNvlValue(request, fieldId);
String paramValue = nvl(formfield_value);
if(paramValue.length()>0) {
- /*sql = Utils.replaceInString(sql, "'" + fieldDisplay + "'", nvl(
- paramValue, "NULL"));*/
reportSQL = Utils.replaceInString(reportSQL, fieldDisplay, nvl(
paramValue, "NULL"));
}
- /*sql = Utils.replaceInString(sql, "'" + fieldDisplay + "'", nvl(
- paramValue, "NULL"));*/
reportSQL = Utils.replaceInString(reportSQL, "'" + fieldDisplay + "'", nvl(
paramValue, "NULL"));
reportSQL = Utils.replaceInString(reportSQL, fieldDisplay , nvl(
@@ -739,7 +717,6 @@ public class ChartJSONHelper {
}
logger.debug(EELFLoggerDelegate.debugLogger, ("SQL " + reportSQL));
String legendCol = "1 a";
- // String valueCol = "1";
StringBuffer groupCol = new StringBuffer();
StringBuffer seriesCol = new StringBuffer();
StringBuffer valueCols = new StringBuffer();
@@ -749,8 +726,6 @@ public class ChartJSONHelper {
String colName = getColumnSelectStr(dc, request);
if (nvl(dc.getColOnChart()).equals(AppConstants.GC_LEGEND))
legendCol = getSelectExpr(dc, colName)+" " + dc.getColId();
- // if(dc.getChartSeq()>0)
- // valueCol = "NVL("+colName+", 0) "+dc.getColId();
if ((!nvl(dc.getColOnChart()).equals(AppConstants.GC_LEGEND))
&& (dc.getChartSeq()!=null && dc.getChartSeq().intValue() <= 0) && dc.isGroupBreak()) {
groupCol.append(", ");
@@ -760,18 +735,9 @@ public class ChartJSONHelper {
for (Iterator iter = reportCols.iterator(); iter.hasNext();) {
DataColumnType dc = (DataColumnType) iter.next();
if(dc.isChartSeries()!=null && dc.isChartSeries().booleanValue()) {
- //System.out.println("*****************, "+ " " +getColumnSelectStr(dc, paramValues)+ " "+ getSelectExpr(dc,getColumnSelectStr(dc, paramValues)));
seriesCol.append(", "+ getSelectExpr(dc,getColumnSelectStr(dc, request))+ " " + dc.getColId());
}
}
-
- /*for (Iterator iter = reportCols.iterator(); iter.hasNext();) {
- DataColumnType dc = (DataColumnType) iter.next();
- if(!dc.isChartSeries() && !(nvl(dc.getColOnChart()).equals(AppConstants.GC_LEGEND))) {
- //System.out.println("*****************, "+ " " +getColumnSelectStr(dc, paramValues)+ " "+ getSelectExpr(dc,getColumnSelectStr(dc, paramValues)));
- seriesCol.append(", "+ formatChartColumn(getSelectExpr(dc,getColumnSelectStr(dc, paramValues)))+ " " + dc.getColId());
- }
- }*/
for (Iterator iter = chartValueCols.iterator(); iter.hasNext();) {
DataColumnType dc = (DataColumnType) iter.next();
@@ -794,7 +760,6 @@ public class ChartJSONHelper {
seriesCol.append("," + (AppUtils.nvl(paramValue).length()>0? paramValue:"null") + " " + dc.getColId());
} else {
- //valueCols.append(", NVL(" + formatChartColumn(colName) + ",0) " + dc.getColId());
seriesCol.append("," + (AppUtils.nvl(paramValue).length()>0? paramValue:formatChartColumn(colName)) + " " + dc.getColId());
}
} // for
@@ -803,7 +768,6 @@ public class ChartJSONHelper {
DataColumnType dc = (DataColumnType) iter.next();
String colName = dc.getDisplayName();
String colValue = getColumnSelectStr(dc, request);
- //String colName = getColumnSelectStr(dc, formGrid);
if(colName.equals(AppConstants.RI_CHART_TOTAL_COL))
seriesCol.append(", " + AppConstants.RI_CHART_TOTAL_COL + " " + AppConstants.RI_CHART_TOTAL_COL );
if (colName.equals(AppConstants.RI_CHART_COLOR))
@@ -816,45 +780,14 @@ public class ChartJSONHelper {
seriesCol.append(", " + AppConstants.RI_CHART_MARKER_TEXT_LEFT + " " + AppConstants.RI_CHART_MARKER_TEXT_LEFT );
if(colName.equals(AppConstants.RI_CHART_MARKER_TEXT_RIGHT))
seriesCol.append(", " + AppConstants.RI_CHART_MARKER_TEXT_RIGHT + " " + AppConstants.RI_CHART_MARKER_TEXT_RIGHT );
- //if(colName.equals(AppConstants.RI_ANOMALY_TEXT))
- //seriesCol.append(", " + AppConstants.RI_ANOMALY_TEXT + " " + AppConstants.RI_ANOMALY_TEXT );
}
-
- //debugLogger.debug("ReportSQL Chart " + reportSQL );
- /*for (Iterator iter = chartValueCols.iterator(); iter.hasNext();) {
- DataColumnType dc = (DataColumnType) iter.next();
- String colName = getColumnSelectStr(dc, paramValues);
- //valueCols.append(", NVL(" + formatChartColumn(colName) + ",0) " + dc.getColId());
- valueCols.append("," + formatChartColumn(colName) + " " + dc.getColId());
- } // for
- for (Iterator iter = reportCols.iterator(); iter.hasNext();) {
- DataColumnType dc = (DataColumnType) iter.next();
- String colName = getColumnSelectStr(dc, paramValues);
- //if(colName.equals(AppConstants.RI_CHART_TOTAL_COL) || colName.equals(AppConstants.RI_CHART_COLOR)) {
- if(colName.equals(AppConstants.RI_CHART_TOTAL_COL))
- valueCols.append(", " + AppConstants.RI_CHART_TOTAL_COL + " " + AppConstants.RI_CHART_TOTAL_COL );
- if (colName.equals(AppConstants.RI_CHART_COLOR))
- valueCols.append(", " + AppConstants.RI_CHART_COLOR + " " + AppConstants.RI_CHART_COLOR );
- if (colName.equals(AppConstants.RI_CHART_INCLUDE))
- valueCols.append(", " + AppConstants.RI_CHART_INCLUDE + " " + AppConstants.RI_CHART_INCLUDE );
- //}
- }*/
+
String final_sql = "";
reportSQL = Utils.replaceInString(reportSQL, " from ", " FROM ");
reportSQL = Utils.replaceInString(reportSQL, " From ", " FROM ");
reportSQL = Utils.replaceInString(reportSQL, " select ", " SELECT ");
reportSQL = Utils.replaceInString(reportSQL, " union ", " UNION ");
- //reportSQL = reportSQL.replaceAll("[\\s]*\\(", "(");
-// if(reportSQL.indexOf("UNION") != -1) {
-// if(reportSQL.indexOf("FROM(")!=-1)
-// final_sql += " "+reportSQL.substring(reportSQL.indexOf("FROM(") );
-// else if (reportSQL.indexOf("FROM (")!=-1)
-// final_sql += " "+reportSQL.substring(reportSQL.indexOf("FROM (") );
-// //TODO ELSE THROW ERROR
-// }
-// else {
-// final_sql += " "+reportSQL.substring(reportSQL.toUpperCase().indexOf(" FROM "));
-// }
+
int pos = 0;
int pos_first_select = 0;
int pos_dup_select = 0;
@@ -863,11 +796,10 @@ public class ChartJSONHelper {
if (reportSQL.indexOf("FROM", pos)!=-1) {
pos = reportSQL.indexOf("FROM", pos);
pos_dup_select = reportSQL.lastIndexOf("SELECT",pos);
- pos_first_select = reportSQL.indexOf("SELECT");//,pos);
+ pos_first_select = reportSQL.indexOf("SELECT");
logger.debug(EELFLoggerDelegate.debugLogger, ("pos_select " + pos_first_select + " " + pos_dup_select));
if(pos_dup_select > pos_first_select) {
logger.debug(EELFLoggerDelegate.debugLogger, ("********pos_dup_select ********" + pos_dup_select));
- //pos_dup_select1 = pos_dup_select;
pos_prev_select = pos_first_select;
pos_last_select = pos_dup_select;
while (pos_last_select > pos_prev_select) {
@@ -891,9 +823,6 @@ public class ChartJSONHelper {
} // generateChartSQL
private String getColumnSelectStr(DataColumnType dc, HttpServletRequest request) {
- //String colName = dc.isCalculated() ? dc.getColName()
- // : ((nvl(dc.getTableId()).length() > 0) ? (dc.getTableId() + "." + dc
- // .getColName()) : dc.getColName());
String colName = dc.getColName();
String paramValue = null;
//if (dc.isCalculated()) {
@@ -995,7 +924,8 @@ public class ChartJSONHelper {
} else if (filter == 1 && (dc.isCreateInNewChart()==null || !dc.isCreateInNewChart().booleanValue())) {
chartValueCols.add(dc);
}
- else if(filter == 0) chartValueCols.add(dc);
+ else if(filter == 0)
+ chartValueCols.add(dc);
} else chartValueCols.add(dc);
}
// } else
@@ -1067,113 +997,138 @@ public class ChartJSONHelper {
*/
date = MMDDYYYYHHMMSSFormat.parse(dateStr, new ParsePosition(0));
- if(date!=null) formatFlag = SECFLAG;
+ if(date!=null)
+ formatFlag = SECFLAG;
if(date==null) {
date = EEEMMDDYYYYFormat.parse(dateStr, new ParsePosition(0));
- if(date!=null) formatFlag = DAYOFTHEWEEKFLAG;
+ if(date!=null)
+ formatFlag = DAYOFTHEWEEKFLAG;
}
if(date==null) {
date = MMDDYYYYHHMMFormat.parse(dateStr, new ParsePosition(0));
- if(date!=null) formatFlag = MINFLAG;
+ if(date!=null)
+ formatFlag = MINFLAG;
}
if(date==null) {
//MMDDYYYYHHFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
date = MMDDYYYYHHFormat.parse(dateStr, new ParsePosition(0));
- if(date!=null) formatFlag = HOURFLAG;
+ if(date!=null)
+ formatFlag = HOURFLAG;
}
if(date==null) {
date = MMDDYYYYFormat.parse(dateStr, new ParsePosition(0));
- if(date!=null) formatFlag = DAYFLAG;
+ if(date!=null)
+ formatFlag = DAYFLAG;
}
if(date==null) {
date = YYYYMMDDFormat.parse(dateStr, new ParsePosition(0));
- if(date!=null) formatFlag = DAYFLAG;
+ if(date!=null)
+ formatFlag = DAYFLAG;
}
if(date==null) {
date = timestampFormat.parse(dateStr, new ParsePosition(0));
- if(date!=null) formatFlag = SECFLAG;
+ if(date!=null)
+ formatFlag = SECFLAG;
}
if(date==null) {
date = timestampHrFormat.parse(dateStr, new ParsePosition(0));
- if(date!=null) formatFlag = HOURFLAG;
+ if(date!=null)
+ formatFlag = HOURFLAG;
}
if(date==null) {
date = timestampDayFormat.parse(dateStr, new ParsePosition(0));
- if(date!=null) formatFlag = DAYFLAG;
+ if(date!=null)
+ formatFlag = DAYFLAG;
}
if(date==null) {
date = MONYYYYFormat.parse(dateStr, new ParsePosition(0));
- if(date!=null) formatFlag = MONTHFLAG;
+ if(date!=null)
+ formatFlag = MONTHFLAG;
}
if(date==null) {
date = MMYYYYFormat.parse(dateStr, new ParsePosition(0));
- if(date!=null) formatFlag = MONTHFLAG;
+ if(date!=null)
+ formatFlag = MONTHFLAG;
}
if(date==null) {
date = MMMMMDDYYYYFormat.parse(dateStr, new ParsePosition(0));
- if(date!=null) formatFlag = DAYFLAG;
+ if(date!=null)
+ formatFlag = DAYFLAG;
}
if(date==null) {
date = MONTHYYYYFormat.parse(dateStr, new ParsePosition(0));
- if(date!=null) formatFlag = MONTHFLAG;
+ if(date!=null)
+ formatFlag = MONTHFLAG;
}
if(date==null) {
date = YYYYMMDDHHMMSSFormat.parse(dateStr, new ParsePosition(0));
- if(date!=null) formatFlag = SECFLAG;
+ if(date!=null)
+ formatFlag = SECFLAG;
}
if(date==null) {
date = YYYYMMDDHHMMFormat.parse(dateStr, new ParsePosition(0));
- if(date!=null) formatFlag = MINFLAG;
+ if(date!=null)
+ formatFlag = MINFLAG;
}
if(date==null) {
date = DDMONYYYYHHMMSSFormat.parse(dateStr, new ParsePosition(0));
- if(date!=null) formatFlag = SECFLAG;
+ if(date!=null)
+ formatFlag = SECFLAG;
}
if(date==null) {
date = DDMONYYYYHHMMFormat.parse(dateStr, new ParsePosition(0));
- if(date!=null) formatFlag = MINFLAG;
+ if(date!=null)
+ formatFlag = MINFLAG;
}
if(date==null) {
date = DDMONYYYYFormat.parse(dateStr, new ParsePosition(0));
- if(date!=null) formatFlag = DAYFLAG;
+ if(date!=null)
+ formatFlag = DAYFLAG;
}
if(date==null) {
date = MMDDYYHHMMSSFormat.parse(dateStr, new ParsePosition(0));
- if(date!=null) formatFlag = SECFLAG;
+ if(date!=null)
+ formatFlag = SECFLAG;
}
if(date==null) {
date = MMDDYYHHMMFormat.parse(dateStr, new ParsePosition(0));
- if(date!=null) formatFlag = MINFLAG;
+ if(date!=null)
+ formatFlag = MINFLAG;
}
if(date==null) {
date = MMDDYYFormat.parse(dateStr, new ParsePosition(0));
- if(date!=null) formatFlag = DAYFLAG;
+ if(date!=null)
+ formatFlag = DAYFLAG;
}
if(date==null) {
date = timestampFormat1.parse(dateStr, new ParsePosition(0));
- if(date!=null) formatFlag = SECFLAG;
+ if(date!=null)
+ formatFlag = SECFLAG;
}
if(date==null) {
date = MMDDYYYYHHMMZFormat.parse(dateStr, new ParsePosition(0));
- if(date!=null) formatFlag = MINFLAG;
+ if(date!=null)
+ formatFlag = MINFLAG;
}
if(date==null) {
date = YYYYFormat.parse(dateStr, new ParsePosition(0));
/* Some random numbers should not satisfy this year format. */
- if(dateStr.length()>4) date = null;
- if(date!=null) formatFlag = YEARFLAG;
+ if(dateStr.length()>4)
+ date = null;
+ if(date!=null)
+ formatFlag = YEARFLAG;
}
if(date==null)
date = null;
@@ -1230,112 +1185,137 @@ public class ChartJSONHelper {
*/
date = MMDDYYYYHHMMSSFormat.parse(dateStr, new ParsePosition(0));
- if(date!=null) formatFlag = SECFLAG;
+ if(date!=null)
+ formatFlag = SECFLAG;
if(date==null) {
date = EEEMMDDYYYYFormat.parse(dateStr, new ParsePosition(0));
- if(date!=null) formatFlag = DAYOFTHEWEEKFLAG;
+ if(date!=null)
+ formatFlag = DAYOFTHEWEEKFLAG;
}
if(date==null) {
date = MMDDYYYYHHMMFormat.parse(dateStr, new ParsePosition(0));
- if(date!=null) formatFlag = MINFLAG;
+ if(date!=null)
+ formatFlag = MINFLAG;
}
if(date==null) {
//MMDDYYYYHHFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
date = MMDDYYYYHHFormat.parse(dateStr, new ParsePosition(0));
- if(date!=null) formatFlag = HOURFLAG;
+ if(date!=null)
+ formatFlag = HOURFLAG;
}
if(date==null) {
date = MMDDYYYYFormat.parse(dateStr, new ParsePosition(0));
- if(date!=null) formatFlag = DAYFLAG;
+ if(date!=null)
+ formatFlag = DAYFLAG;
}
if(date==null) {
date = YYYYMMDDFormat.parse(dateStr, new ParsePosition(0));
- if(date!=null) formatFlag = DAYFLAG;
+ if(date!=null)
+ formatFlag = DAYFLAG;
}
if(date==null) {
date = timestampFormat.parse(dateStr, new ParsePosition(0));
- if(date!=null) formatFlag = SECFLAG;
+ if(date!=null)
+ formatFlag = SECFLAG;
}
if(date==null) {
date = timestampHrFormat.parse(dateStr, new ParsePosition(0));
- if(date!=null) formatFlag = HOURFLAG;
+ if(date!=null)
+ formatFlag = HOURFLAG;
}
if(date==null) {
date = timestampDayFormat.parse(dateStr, new ParsePosition(0));
- if(date!=null) formatFlag = DAYFLAG;
+ if(date!=null)
+ formatFlag = DAYFLAG;
}
if(date==null) {
date = MONYYYYFormat.parse(dateStr, new ParsePosition(0));
- if(date!=null) formatFlag = MONTHFLAG;
+ if(date!=null)
+ formatFlag = MONTHFLAG;
}
if(date==null) {
date = MMYYYYFormat.parse(dateStr, new ParsePosition(0));
- if(date!=null) formatFlag = MONTHFLAG;
+ if(date!=null)
+ formatFlag = MONTHFLAG;
}
if(date==null) {
date = MMMMMDDYYYYFormat.parse(dateStr, new ParsePosition(0));
- if(date!=null) formatFlag = DAYFLAG;
+ if(date!=null)
+ formatFlag = DAYFLAG;
}
if(date==null) {
date = MONTHYYYYFormat.parse(dateStr, new ParsePosition(0));
- if(date!=null) formatFlag = MONTHFLAG;
+ if(date!=null)
+ formatFlag = MONTHFLAG;
}
if(date==null) {
date = YYYYMMDDHHMMSSFormat.parse(dateStr, new ParsePosition(0));
- if(date!=null) formatFlag = SECFLAG;
+ if(date!=null)
+ formatFlag = SECFLAG;
}
if(date==null) {
date = YYYYMMDDHHMMFormat.parse(dateStr, new ParsePosition(0));
- if(date!=null) formatFlag = MINFLAG;
+ if(date!=null)
+ formatFlag = MINFLAG;
}
if(date==null) {
date = DDMONYYYYHHMMSSFormat.parse(dateStr, new ParsePosition(0));
- if(date!=null) formatFlag = SECFLAG;
+ if(date!=null)
+ formatFlag = SECFLAG;
}
if(date==null) {
date = DDMONYYYYHHMMFormat.parse(dateStr, new ParsePosition(0));
- if(date!=null) formatFlag = MINFLAG;
+ if(date!=null)
+ formatFlag = MINFLAG;
}
if(date==null) {
date = DDMONYYYYFormat.parse(dateStr, new ParsePosition(0));
- if(date!=null) formatFlag = DAYFLAG;
+ if(date!=null)
+ formatFlag = DAYFLAG;
}
if(date==null) {
date = MMDDYYHHMMSSFormat.parse(dateStr, new ParsePosition(0));
- if(date!=null) formatFlag = SECFLAG;
+ if(date!=null)
+ formatFlag = SECFLAG;
}
if(date==null) {
date = MMDDYYHHMMFormat.parse(dateStr, new ParsePosition(0));
- if(date!=null) formatFlag = MINFLAG;
+ if(date!=null)
+ formatFlag = MINFLAG;
}
if(date==null) {
date = MMDDYYFormat.parse(dateStr, new ParsePosition(0));
- if(date!=null) formatFlag = DAYFLAG;
+ if(date!=null)
+ formatFlag = DAYFLAG;
}
if(date==null) {
date = timestampFormat1.parse(dateStr, new ParsePosition(0));
- if(date!=null) formatFlag = SECFLAG;
+ if(date!=null)
+ formatFlag = SECFLAG;
}
if(date==null) {
date = MMDDYYYYHHMMZFormat.parse(dateStr, new ParsePosition(0));
- if(date!=null) formatFlag = MINFLAG;
+ if(date!=null)
+ formatFlag = MINFLAG;
}
if(date==null) {
date = YYYYFormat.parse(dateStr, new ParsePosition(0));
/* Some random numbers should not satisfy this year format. */
- if(dateStr.length()>4) date = null;
- if(date!=null) formatFlag = YEARFLAG;
+ if(dateStr.length()>4)
+ date = null;
+ if(date!=null)
+ formatFlag = YEARFLAG;
}
if(date==null)
date = null;
@@ -1362,8 +1342,10 @@ public class ChartJSONHelper {
public boolean getBooleanValue(String s, Boolean defaultValue) {
s = nvl(s);
- if(s.length()<=0 && defaultValue!=null) return defaultValue.booleanValue();
- else if(s.length()<=0) return false;
+ if(s.length()<=0 && defaultValue!=null)
+ return defaultValue.booleanValue();
+ else if(s.length()<=0)
+ return false;
else {
if(s.toUpperCase().startsWith("Y") || s.toLowerCase().equals("true"))
return true;
@@ -1468,7 +1450,8 @@ public class ChartJSONHelper {
value.append("(");
}
for(int j = 0 ; j < vals.length; j++) {
- if(isMultiValue) value.append("'");
+ if(isMultiValue)
+ value.append("'");
try {
if(vals[j] !=null && vals[j].length() > 0) {
vals[j] = Utils.oracleSafe(vals[j]);
@@ -1483,7 +1466,8 @@ public class ChartJSONHelper {
}
- if(isMultiValue) value.append("'");
+ if(isMultiValue)
+ value.append("'");
if(j != vals.length -1) {
value.append(",");