Upgraded few artifacts as part of Security fixes 14/112614/1
authorjz385p <jegadeesh.babu@att.com>
Mon, 14 Sep 2020 13:24:59 +0000 (18:54 +0530)
committerjz385p <jegadeesh.babu@att.com>
Mon, 14 Sep 2020 13:25:43 +0000 (18:55 +0530)
Security fixes

Issue-ID: PORTAL-945
Change-Id: Idd2341b05289e9d5040cb7d619fd69b03243a6cd
Signed-off-by: jz385p <jegadeesh.babu@att.com>
ecomp-sdk/epsdk-analytics/pom.xml
ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/ReportHandler.java
ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/util/ExcelColorDef.java
ecomp-sdk/epsdk-core/pom.xml

index 768b7d8..7789fbf 100644 (file)
                <dependency>
                        <groupId>org.apache.poi</groupId>
                        <artifactId>poi</artifactId>
-                       <version>3.17</version>
+                       <version>4.1.2</version>
                        <exclusions>
                                <exclusion>
                                        <groupId>commons-logging</groupId>
                <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>
                <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>
index d8dd930..b8f3284 100644 (file)
@@ -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;
index af97949..8d07333 100644 (file)
@@ -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) {
index 753f0d8..b65801c 100644 (file)
                <dependency>
                        <groupId>org.apache.poi</groupId>
                        <artifactId>poi</artifactId>
-                       <version>3.17</version>
+                       <version>4.1.2</version>
                        <exclusions>
                                <exclusion>
                                        <groupId>commons-logging</groupId>
                <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>
                <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>