diff options
-rw-r--r-- | ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/runtime/FormatProcessor.java | 48 |
1 files changed, 5 insertions, 43 deletions
diff --git a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/runtime/FormatProcessor.java b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/runtime/FormatProcessor.java index 0805b22c..62bf4335 100644 --- a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/runtime/FormatProcessor.java +++ b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/runtime/FormatProcessor.java @@ -134,9 +134,6 @@ public class FormatProcessor extends RaptorObject { + origValue.substring(3, 5); try { - // DataSet ds = DbUtils.executeQuery("SELECT TO_CHAR(TO_DATE('" + origValue + "', '" - // + dateFormat + "'), 'YYYY-MM-DD') val FROM DUAL"); - String sql = Globals.getGenerateSqlVisualDual(); DataSet ds = DbUtils.executeQuery("SELECT TO_CHAR(TO_DATE('" + origValue + "', '" + dateFormat + "'), 'YYYY-MM-DD') val"+sql); @@ -166,8 +163,6 @@ public class FormatProcessor extends RaptorObject { beforeDecimalPoint = false; else if (c == '-' && integerValue.length() == 0) isNegative = true; - // else - // if(c=='0'||c=='1'||c=='2'||c=='3'||c=='4'||c=='5'||c=='6'||c=='7'||c=='8'||c=='9') else if (Character.isDigit(c)) if (beforeDecimalPoint) integerValue.append(c); @@ -276,8 +271,6 @@ public class FormatProcessor extends RaptorObject { if( anyFormatter == null ) anyFormatter = formatter; - // String sValue = convertValue(dv.getDisplayValue()); - //if (sValue.length() > 0) { for (Iterator iter = semaphore.getFormatList().getFormat().iterator(); iter .hasNext();) { FormatType fmt = (FormatType) iter.next(); @@ -311,42 +304,16 @@ public class FormatProcessor extends RaptorObject { valueMatched = isEqual(sValue, formatterValue) || isLessThan(sValue, formatterValue); } - //s_logger.debug("SYSOUT " + " " +sValue +" " +fmt.getBgColor() + " " + fmt.getLessThanValue()+ " " +valueMatched); if (fmt.getLessThanValue().length() > 0 && valueMatched) { formatter = (HtmlFormatter) formatters.get(fmt.getFormatId()); formatter.setFormatId(fmt.getFormatId()); formatModified = true; - //dv.setFormatId(fmt.getFormatId()); - //dr.setFormatId(fmt.getFormatId()); - //break; - } else { // if + } else { if(!formatModified) formatter = anyFormatter; - //if(!((formatter!=null && formatter!=anyFormatter) || (defaultFormatter!=null && formatter!=defaultFormatter))) - // formatter = anyFormatter; - //formatter.setFormatId(anyFormatter.getFormatId()); } - /*else if ((fmt.getLessThanValue().length() <= 0) - && (fmt.getFormatId().length() > 0)) { - formatter = (HtmlFormatter) formatters.get(fmt.getFormatId()); - System.out.println("---------------lesser "+ fmt.getFormatId()+ " " + fmt.getBgColor()); - dv.setFormatId(fmt.getFormatId()); - dr.setFormatId(fmt.getFormatId()); - // break; - } // else if*/ - } // for - /*} else { - for (Iterator iter = semaphore.getFormatList().getFormat().iterator(); iter - .hasNext();) { - FormatType fmt = (FormatType) iter.next(); - if(fmt.getLessThanValue().length()<=0 && fmt.getExpression().length()<=0 && !fmt.isBold() && !fmt.isItalic() && !fmt.isUnderline() && fmt.getFontSize().equals("11")) { - formatter = defaultFormatter; - } else - formatter = anyFormatter; } - - //formatter.setFormatId(anyFormatter.getFormatId()); - } */ + if(formatter != null) { if (semaphore.getSemaphoreType().equals(AppConstants.ST_ROW)) { @@ -356,17 +323,14 @@ public class FormatProcessor extends RaptorObject { dr.setRowFormatter(formatter); dr.setFormatId(formatter.getFormatId()); // This is added for excel download - //if (!formatter.equals(defaultFormatter)) { dr.setRowFormat(true); - //} } } else { if(nvl(targetColId).length()>0) { if(targetDataValue!=null) { targetDataValue.setCellFormatter(formatter); - targetDataValue.setFormatId(formatter.getFormatId()); - //if (!formatter.equals(defaultFormatter)) { + targetDataValue.setFormatId(formatter.getFormatId()); targetDataValue.setCellFormat(true); int count = 0; for (dr.resetNext(); dr.hasNext();) { @@ -383,12 +347,10 @@ public class FormatProcessor extends RaptorObject { } else { dv.setCellFormatter(formatter); - dv.setFormatId(formatter.getFormatId()); - //if (!formatter.equals(defaultFormatter)) { + dv.setFormatId(formatter.getFormatId()); dv.setCellFormat(true); - //} } - }// else + } } } // setHtmlFormatters |