diff options
8 files changed, 69 insertions, 59 deletions
@@ -6,7 +6,7 @@ lifecycle_state: 'Incubation' project_lead: &onap_portal_ptl name: 'Sunder Tattavarada' email: 'statta@research.att.com' - id: 'statta' + id: 'tattasunder' company: 'ATT' timezone: 'America/New_York' primary_contact: *onap_portal_ptl @@ -34,7 +34,7 @@ committers: - name: 'Sunder Tattavarada' email: 'statta@research.att.com' company: 'ATT' - id: 'statta' + id: 'tattasunder' timezone: 'America/New_York' - name: 'Manoop Talasila' email: 'mt2061@att.com' diff --git a/ecomp-sdk/epsdk-analytics/pom.xml b/ecomp-sdk/epsdk-analytics/pom.xml index 768b7d8b..7789fbf0 100644 --- a/ecomp-sdk/epsdk-analytics/pom.xml +++ b/ecomp-sdk/epsdk-analytics/pom.xml @@ -142,7 +142,7 @@ <dependency> <groupId>org.apache.poi</groupId> <artifactId>poi</artifactId> - <version>3.17</version> + <version>4.1.2</version> <exclusions> <exclusion> <groupId>commons-logging</groupId> @@ -157,7 +157,7 @@ <dependency> <groupId>org.apache.poi</groupId> <artifactId>poi-ooxml</artifactId> - <version>3.17</version> + <version>4.1.2</version> <exclusions> <exclusion> <groupId>commons-logging</groupId> @@ -172,7 +172,7 @@ <dependency> <groupId>org.apache.poi</groupId> <artifactId>poi-scratchpad</artifactId> - <version>3.17</version> + <version>4.1.2</version> <exclusions> <exclusion> <groupId>commons-logging</groupId> diff --git a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/ReportHandler.java b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/ReportHandler.java index d8dd9304..b8f3284c 100644 --- a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/ReportHandler.java +++ b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/ReportHandler.java @@ -214,30 +214,30 @@ public class ReportHandler extends org.onap.portalsdk.analytics.RaptorObject { XSSFCellStyle styleRed = wb.createCellStyle(); styleRed.cloneStyleFrom(styleDefault); - styleRed.setFillForegroundColor((short) HSSFColor.RED.index); + styleRed.setFillForegroundColor((short) HSSFColor.HSSFColorPredefined.RED.getIndex()); styleRed.setFillPattern(fillPattern.SOLID_FOREGROUND); XSSFFont fontRed = wb.createFont(); - fontRed.setColor((short) HSSFColor.WHITE.index); + fontRed.setColor((short) HSSFColor.HSSFColorPredefined.WHITE.getIndex()); fontRed.setFontHeight((short) (FONT_SIZE / 0.05)); fontRed.setFontName(FONT_TAHOMA); styleRed.setFont(fontRed); XSSFCellStyle styleYellow = wb.createCellStyle(); styleYellow.cloneStyleFrom(styleDefault); - styleYellow.setFillForegroundColor((short) HSSFColor.YELLOW.index); + styleYellow.setFillForegroundColor((short) HSSFColor.HSSFColorPredefined.YELLOW.getIndex()); styleYellow.setFillPattern(fillPattern.SOLID_FOREGROUND); XSSFFont fontYellow = wb.createFont(); - fontYellow.setColor((short) HSSFColor.BLACK.index); + fontYellow.setColor((short) HSSFColor.HSSFColorPredefined.BLACK.getIndex()); fontYellow.setFontHeight((short) (FONT_SIZE / 0.05)); fontYellow.setFontName(FONT_TAHOMA); styleYellow.setFont(fontYellow); XSSFCellStyle styleGreen = wb.createCellStyle(); styleGreen.cloneStyleFrom(styleDefault); - styleGreen.setFillForegroundColor((short) HSSFColor.GREEN.index); + styleGreen.setFillForegroundColor((short) HSSFColor.HSSFColorPredefined.GREEN.getIndex()); styleGreen.setFillPattern(fillPattern.SOLID_FOREGROUND); XSSFFont fontGreen = wb.createFont(); - fontGreen.setColor((short) HSSFColor.WHITE.index); + fontGreen.setColor((short) HSSFColor.HSSFColorPredefined.WHITE.getIndex()); fontGreen.setFontHeight((short) (FONT_SIZE / 0.05)); fontGreen.setFontName(FONT_TAHOMA); styleGreen.setFont(fontGreen); @@ -332,7 +332,7 @@ public class ReportHandler extends org.onap.portalsdk.analytics.RaptorObject { short s1 = 0; short s2 = (short) 1; XSSFCellStyle styleName = wb.createCellStyle(); - styleName.setFillForegroundColor(HSSFColor.GREY_25_PERCENT.index); + styleName.setFillForegroundColor(HSSFColor.HSSFColorPredefined.GREY_25_PERCENT.getIndex()); styleName.setAlignment(HorizontalAlignment.CENTER); styleName.setBorderBottom(BorderStyle.THIN); styleName.setBorderTop(BorderStyle.THIN); @@ -342,7 +342,7 @@ public class ReportHandler extends org.onap.portalsdk.analytics.RaptorObject { XSSFFont font = wb.createFont(); font.setFontHeight((short) (FONT_SIZE / 0.05)); font.setFontName(FONT_TAHOMA); - font.setColor(HSSFColor.BLACK.index); + font.setColor(HSSFColor.HSSFColorPredefined.BLACK.getIndex()); font.setBold(true); styleName.setFont(font); @@ -368,7 +368,7 @@ public class ReportHandler extends org.onap.portalsdk.analytics.RaptorObject { XSSFFont fontDescr = wb.createFont(); fontDescr.setFontHeight((short) (FONT_SIZE / 0.05)); // 14 fontDescr.setFontName(FONT_TAHOMA); - fontDescr.setColor(HSSFColor.BLACK.index); + fontDescr.setColor(HSSFColor.HSSFColorPredefined.BLACK.getIndex()); fontDescr.setBold(true); styleDescription.setFont(font); XSSFCell cellDescr = null; @@ -521,7 +521,7 @@ public class ReportHandler extends org.onap.portalsdk.analytics.RaptorObject { XSSFCellStyle styleDate = wb.createCellStyle(); HtmlStripper strip = new HtmlStripper(); XSSFCellStyle styleDataHeader = wb.createCellStyle(); - styleDataHeader.setFillForegroundColor(HSSFColor.GREY_25_PERCENT.index); + styleDataHeader.setFillForegroundColor(HSSFColor.HSSFColorPredefined.GREY_25_PERCENT.getIndex()); styleDataHeader.setFillPattern(fillPattern.SOLID_FOREGROUND); styleDataHeader.setAlignment(HorizontalAlignment.CENTER); styleDataHeader.setBorderBottom(BorderStyle.THIN); @@ -532,7 +532,7 @@ public class ReportHandler extends org.onap.portalsdk.analytics.RaptorObject { font.setFontHeight((short) (FONT_SIZE / 0.05)); font.setFontName(FONT_TAHOMA); font.setBold(true); - font.setColor(HSSFColor.BLACK.index); + font.setColor(HSSFColor.HSSFColorPredefined.BLACK.getIndex()); styleDataHeader.setFont(font); boolean firstPass = true; ArrayList cellWidth = new ArrayList(); @@ -2100,7 +2100,7 @@ public class ReportHandler extends org.onap.portalsdk.analytics.RaptorObject { XSSFFont font = wb.createFont(); font.setFontHeight((short) (FONT_HEADER_TITLE_SIZE / 0.05)); // 14 font.setFontName(FONT_TAHOMA); - font.setColor(HSSFColor.BLACK.index); + font.setColor(HSSFColor.HSSFColorPredefined.BLACK.getIndex()); styleHeader.setFont(font); XSSFCell cell = row.createCell((short) 0); @@ -2118,7 +2118,7 @@ public class ReportHandler extends org.onap.portalsdk.analytics.RaptorObject { XSSFFont fontDescr = wb.createFont(); fontDescr.setFontHeight((short) FONT_HEADER_DESCR_SIZE); fontDescr.setFontName(FONT_TAHOMA); - fontDescr.setColor(HSSFColor.BLACK.index); + fontDescr.setColor(HSSFColor.HSSFColorPredefined.BLACK.getIndex()); styleDescription.setFont(fontDescr); XSSFCell cellDescr = row.createCell((short) 0); cellDescr.setCellValue(reportDescr); @@ -2135,7 +2135,7 @@ public class ReportHandler extends org.onap.portalsdk.analytics.RaptorObject { XSSFFont fontDescr = wb.createFont(); fontDescr.setFontHeight((short) (FONT_SIZE / 0.05)); // 14 fontDescr.setFontName(FONT_TAHOMA); - fontDescr.setColor(HSSFColor.BLACK.index); + fontDescr.setColor(HSSFColor.HSSFColorPredefined.BLACK.getIndex()); fontDescr.setBold(true); styleDescription.setFont(fontDescr); XSSFCell cellDescr = row.createCell((short) 0); @@ -2416,7 +2416,10 @@ public class ReportHandler extends org.onap.portalsdk.analytics.RaptorObject { paintExcelParams(wb, rowNum, col, paramsList, rr.getFormFieldComments(request), sheet, reportTitle, reportDescr); } // if + rowNum = sheet.getLastRowNum(); + if(rowNum<0) + rowNum = 0; final String formattedReportName = new HtmlStripper().stripSpecialCharacters(rr.getReportName()); final String formattedDate = new SimpleDateFormat("MMddyyyyHHmm").format(new Date()); @@ -5088,7 +5091,7 @@ public class ReportHandler extends org.onap.portalsdk.analytics.RaptorObject { HtmlStripper strip = new HtmlStripper(); // Name Style HSSFCellStyle styleName = wb.createCellStyle(); - styleName.setFillForegroundColor(HSSFColor.GREY_25_PERCENT.index); + styleName.setFillForegroundColor(HSSFColor.HSSFColorPredefined.GREY_25_PERCENT.getIndex()); styleName.setAlignment(HorizontalAlignment.CENTER); styleName.setBorderBottom(BorderStyle.THIN); styleName.setBorderTop(BorderStyle.THIN); @@ -5098,7 +5101,7 @@ public class ReportHandler extends org.onap.portalsdk.analytics.RaptorObject { HSSFFont font = wb.createFont(); font.setFontHeight((short) (FONT_SIZE / 0.05)); font.setFontName(FONT_TAHOMA); - font.setColor(HSSFColor.BLACK.index); + font.setColor(HSSFColor.HSSFColorPredefined.BLACK.getIndex()); font.setBold(font.getBold()); styleName.setFont(font); // Data Style @@ -5131,7 +5134,7 @@ public class ReportHandler extends org.onap.portalsdk.analytics.RaptorObject { HSSFFont fontDescr = wb.createFont(); fontDescr.setFontHeight((short) (FONT_HEADER_DESCR_SIZE / 0.05)); fontDescr.setFontName(FONT_TAHOMA); - fontDescr.setColor(HSSFColor.BLACK.index); + fontDescr.setColor(HSSFColor.HSSFColorPredefined.BLACK.getIndex()); fontDescr.setBold(true); styleDescription.setFont(font); XSSFCell cellDescr = null; diff --git a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/base/ReportWrapper.java b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/base/ReportWrapper.java index c5bb9c5b..27ad62f9 100644 --- a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/base/ReportWrapper.java +++ b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/base/ReportWrapper.java @@ -183,10 +183,9 @@ public class ReportWrapper extends org.onap.portalsdk.analytics.RaptorObject imp protected String reportSQLOnlyFirstPart = null; - - public ReportWrapper() { - super(); - } + public ReportWrapper() { + super(); + } private ReportWrapper(CustomReportType cr, String reportID, ReportSecurity reportSecurity) { super(); @@ -246,7 +245,8 @@ public class ReportWrapper extends org.onap.portalsdk.analytics.RaptorObject imp reportSecurity = new ReportSecurity(reportID, ownerID, createID, createDate, updateID, updateDate, cr.isPublic()); - } + } // ReportWrapper + public CustomReportType getCustomReport() { return cr; } @@ -1281,7 +1281,7 @@ public class ReportWrapper extends org.onap.portalsdk.analytics.RaptorObject imp if (cr.getDashBoardReportsNew() == null) addDashboardReportsNew(new ObjectFactory()); } catch (RaptorException ex) { - ex.printStackTrace(); + logger.error(EELFLoggerDelegate.debugLogger, "Exception occured in getDashBoardReportsNew ", ex); } return cr.getDashBoardReportsNew(); } @@ -1940,7 +1940,6 @@ public class ReportWrapper extends org.onap.portalsdk.analytics.RaptorObject imp String chartGroup = chartGroupName.substring(0, chartGroupName.lastIndexOf("|")); int flag = 0; for (Iterator iter = reportCols.iterator(); iter.hasNext();) { - flag = 0; DataColumnType dc = (DataColumnType) iter.next(); flag = getDependsOnFormFieldFlag(dc, formValues); @@ -3169,14 +3168,19 @@ public class ReportWrapper extends org.onap.portalsdk.analytics.RaptorObject imp } } } - if (nvl(fieldValue).length() == 0) + + // End + if (nvl(fieldValue).length() == 0) { + // Does not append filter with missing form + // field argument applyFilter = false; - else if (isMultiValue || "IN".equals(nvl(cf.getExpression())) - || "NOT IN".equals(nvl(cf.getExpression()))) + } else if (isMultiValue || "IN".equals(nvl(cf.getExpression())) + || "NOT IN".equals(nvl(cf.getExpression()))) { curFilter.append(formatListValue(fieldValue, dc, true, usePipeDelimiterOnly)); - else - curFilter.append(formatValue(fieldValue, dc, true, null, fft)); + } else { + curFilter.append(formatValue(fieldValue, dc, true, getColumnTableById(dc.getColId()), fft)); + } } // else curFilter.append(nvl(cf.getCloseBrackets())); @@ -4281,6 +4285,7 @@ public class ReportWrapper extends org.onap.portalsdk.analytics.RaptorObject imp DataSourceList dataSourceList = objFactory.createDataSourceList(); cr.setDataSourceList(dataSourceList); } catch (DatatypeConfigurationException ex) { + logger.error(EELFLoggerDelegate.debugLogger, "Exception occured in createBlankCR ", ex); throw new RaptorException(ex.getMessage(), ex.getCause()); } return cr; diff --git a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/definition/ReportDefinition.java b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/definition/ReportDefinition.java index 16129b98..8b1cc8cb 100644 --- a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/definition/ReportDefinition.java +++ b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/definition/ReportDefinition.java @@ -332,7 +332,7 @@ public class ReportDefinition extends ReportWrapper implements Serializable { DbUtils.commitTransaction(connection); } catch (RaptorException e) { - e.printStackTrace(); + logger.debug(EELFLoggerDelegate.errorLogger, "RaptorException in persistReport", e); DbUtils.rollbackTransaction(connection); throw e; } finally { @@ -664,6 +664,7 @@ public class ReportDefinition extends ReportWrapper implements Serializable { try { dct.getColFilterList().getColFilter().remove(filterPos); } catch (IndexOutOfBoundsException e) { + logger.debug(EELFLoggerDelegate.errorLogger, "IndexOutOfBoundsException in removeColumnFilter", e); } resetCache(true); @@ -796,6 +797,7 @@ public class ReportDefinition extends ReportWrapper implements Serializable { sem.setSemaphoreId(generateNewSemaphoreId()); sem.setSemaphoreName(semaphoreName); } catch (JAXBException ex) { + logger.debug(EELFLoggerDelegate.errorLogger, "JAXBException in addSemaphore", ex); throw new RaptorException(ex.getMessage(), ex.getCause()); } @@ -941,7 +943,7 @@ public class ReportDefinition extends ReportWrapper implements Serializable { fft.setRangeStartDate(DatatypeFactory.newInstance() .newXMLGregorianCalendar(rangeEndDate.YEAR, rangeEndDate.MONTH, rangeEndDate.DAY_OF_WEEK, rangeEndDate.HOUR, rangeEndDate.MINUTE, rangeEndDate.SECOND, rangeEndDate.MILLISECOND, rangeEndDate.ZONE_OFFSET)); } catch (DatatypeConfigurationException ex) { - + logger.debug(EELFLoggerDelegate.errorLogger, "DatatypeConfigurationException in addFormFieldType", ex); } fft.setRangeStartDateSQL(rangeStartDateSQL); diff --git a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/util/ExcelColorDef.java b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/util/ExcelColorDef.java index af979490..8d07333e 100644 --- a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/util/ExcelColorDef.java +++ b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/util/ExcelColorDef.java @@ -47,23 +47,23 @@ public class ExcelColorDef { public static HashMap colors = new HashMap(); public static void initializeExcelColorDef() { - colors.put("#00FFFF",new Short(HSSFColor.AQUA.index)); - colors.put("#000000",new Short(HSSFColor.BLACK.index)); - colors.put("#0000FF",new Short(HSSFColor.BLUE.index)); - colors.put("#FF00FF",new Short(HSSFColor.PINK.index)); - colors.put("#808080",new Short(HSSFColor.GREY_40_PERCENT.index)); - colors.put("#008000",new Short(HSSFColor.BRIGHT_GREEN.index)); - colors.put("#00FF00",new Short(HSSFColor.LIME.index)); - colors.put("#800000",new Short(HSSFColor.MAROON.index)); - colors.put("#000080",new Short(HSSFColor.ROYAL_BLUE.index)); - colors.put("#808000",new Short(HSSFColor.OLIVE_GREEN.index)); - colors.put("#FF9900",new Short(HSSFColor.ORANGE.index)); - colors.put("#800080",new Short(HSSFColor.VIOLET.index)); - colors.put("#FF0000",new Short(HSSFColor.RED.index)); - colors.put("#C0C0C0",new Short(HSSFColor.CORAL.index)); - colors.put("#008080",new Short(HSSFColor.TEAL.index)); - colors.put("#FFFFFF",new Short(HSSFColor.WHITE.index)); - colors.put("#FFFF00",new Short(HSSFColor.YELLOW.index)); + colors.put("#00FFFF",new Short(HSSFColor.HSSFColorPredefined.AQUA.getIndex())); + colors.put("#000000",new Short(HSSFColor.HSSFColorPredefined.BLACK.getIndex())); + colors.put("#0000FF",new Short(HSSFColor.HSSFColorPredefined.BLUE.getIndex())); + colors.put("#FF00FF",new Short(HSSFColor.HSSFColorPredefined.PINK.getIndex())); + colors.put("#808080",new Short(HSSFColor.HSSFColorPredefined.GREY_40_PERCENT.getIndex())); + colors.put("#008000",new Short(HSSFColor.HSSFColorPredefined.BRIGHT_GREEN.getIndex())); + colors.put("#00FF00",new Short(HSSFColor.HSSFColorPredefined.LIME.getIndex())); + colors.put("#800000",new Short(HSSFColor.HSSFColorPredefined.MAROON.getIndex())); + colors.put("#000080",new Short(HSSFColor.HSSFColorPredefined.ROYAL_BLUE.getIndex())); + colors.put("#808000",new Short(HSSFColor.HSSFColorPredefined.OLIVE_GREEN.getIndex())); + colors.put("#FF9900",new Short(HSSFColor.HSSFColorPredefined.ORANGE.getIndex())); + colors.put("#800080",new Short(HSSFColor.HSSFColorPredefined.VIOLET.getIndex())); + colors.put("#FF0000",new Short(HSSFColor.HSSFColorPredefined.RED.getIndex())); + colors.put("#C0C0C0",new Short(HSSFColor.HSSFColorPredefined.CORAL.getIndex())); + colors.put("#008080",new Short(HSSFColor.HSSFColorPredefined.TEAL.getIndex())); + colors.put("#FFFFFF",new Short(HSSFColor.HSSFColorPredefined.WHITE.getIndex())); + colors.put("#FFFF00",new Short(HSSFColor.HSSFColorPredefined.YELLOW.getIndex())); } @@ -72,7 +72,7 @@ public class ExcelColorDef { return ((Short) colors.get(color)).shortValue(); } - return new Short(HSSFColor.WHITE.index).shortValue(); + return new Short(HSSFColor.HSSFColorPredefined.WHITE.getIndex()).shortValue(); } public static void main(String[] args) { diff --git a/ecomp-sdk/epsdk-core/pom.xml b/ecomp-sdk/epsdk-core/pom.xml index 753f0d8e..d44de8dc 100644 --- a/ecomp-sdk/epsdk-core/pom.xml +++ b/ecomp-sdk/epsdk-core/pom.xml @@ -239,7 +239,7 @@ <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-validator</artifactId> - <version>5.2.1.Final</version> + <version>5.4.3.Final</version> </dependency> <!-- Servlet+JSP+JSTL --> <dependency> @@ -523,7 +523,7 @@ <dependency> <groupId>org.apache.poi</groupId> <artifactId>poi</artifactId> - <version>3.17</version> + <version>4.1.2</version> <exclusions> <exclusion> <groupId>commons-logging</groupId> @@ -538,7 +538,7 @@ <dependency> <groupId>org.apache.poi</groupId> <artifactId>poi-ooxml</artifactId> - <version>3.17</version> + <version>4.1.2</version> <exclusions> <exclusion> <groupId>commons-logging</groupId> @@ -553,7 +553,7 @@ <dependency> <groupId>org.apache.poi</groupId> <artifactId>poi-scratchpad</artifactId> - <version>3.17</version> + <version>4.1.2</version> <exclusions> <exclusion> <groupId>commons-logging</groupId> diff --git a/ecomp-sdk/epsdk-workflow/pom.xml b/ecomp-sdk/epsdk-workflow/pom.xml index 00b78621..d07db16f 100644 --- a/ecomp-sdk/epsdk-workflow/pom.xml +++ b/ecomp-sdk/epsdk-workflow/pom.xml @@ -55,7 +55,7 @@ <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-validator</artifactId> - <version>5.2.1.Final</version> + <version>5.4.3.Final</version> </dependency> <dependency> <groupId>org.json</groupId> |