diff options
author | Indrijeet kumar <indriku1@in.ibm.com> | 2020-06-01 09:05:18 +0530 |
---|---|---|
committer | Indrijeet kumar <indriku1@in.ibm.com> | 2020-06-01 09:05:23 +0530 |
commit | 51659fe2ff1143463790c1e2a5667bf3c8d6e9a9 (patch) | |
tree | aeb05db3a0449f97dcf9e0c6f72e49c49144a7e2 /ecomp-sdk | |
parent | 273ccf87b2609ed82fe681e2211fc402f799307f (diff) |
lowered code smells in PdfReportHandler.java
Lowered code smells in PdfReportHandler.java
Issue-ID: PORTAL-813
Change-Id: I2733993757903ff6ff0a9113a244be0b5921a228
Signed-off-by: Indrijeet Kumar <indriku1@in.ibm.com>
Diffstat (limited to 'ecomp-sdk')
-rw-r--r-- | ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/pdf/PdfReportHandler.java | 60 |
1 files changed, 4 insertions, 56 deletions
diff --git a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/pdf/PdfReportHandler.java b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/pdf/PdfReportHandler.java index 1ff21200..f3aad70f 100644 --- a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/pdf/PdfReportHandler.java +++ b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/pdf/PdfReportHandler.java @@ -533,7 +533,6 @@ public class PdfReportHandler extends org.onap.portalsdk.analytics.RaptorObject{ if(i%2 ==0) document.newPage(); cellValue.setImage(image); - //table.getDefaultCell().setHorizontalAlignment(Rectangle.ALIGN_CENTER); table.addCell(cellValue); document.add(table); } @@ -580,7 +579,6 @@ public class PdfReportHandler extends org.onap.portalsdk.analytics.RaptorObject{ final String FILENOTFOUNDEXCEPTION_MSG = "FileNotFoundException in generateNewImage"; final String IOEXCEPTION_MSG = "IOException in generateNewImage"; try { - //ReportRuntime rr = (ReportRuntime) request.getSession().getAttribute(AppConstants.SI_REPORT_RUNTIME); DataSet ds = null; if(request.getSession().getAttribute(AppConstants.RI_CHART_DATA)!=null) { ds = (DataSet) request.getSession().getAttribute(AppConstants.RI_CHART_DATA); @@ -601,7 +599,6 @@ public class PdfReportHandler extends org.onap.portalsdk.analytics.RaptorObject{ additionalChartOptionsMap.put("lastSeriesALineChart", new Boolean(rr.isLastSeriesALineChart())); } else if (chartType.equals(AppConstants.GT_LINE)) { additionalChartOptionsMap.put("chartOrientation", new Boolean((AppUtils.getRequestNvlValue(request, "chartOrientation").length()>0?AppUtils.getRequestNvlValue(request, "chartOrientation").equals("vertical"):rr.isVerticalOrientation())) ); - //additionalChartOptionsMap.put("secondaryChartRenderer", AppUtils.getRequestNvlValue(request, "secondaryChartRenderer").length()>0? AppUtils.getRequestNvlValue(request, "secondaryChartRenderer"):rr.getSecondaryChartRenderer()); additionalChartOptionsMap.put("chartDisplay", new Boolean(AppUtils.getRequestNvlValue(request, "chartDisplay").length()>0? AppUtils.getRequestNvlValue(request, "chartDisplay").equals("3D"):rr.isChartDisplayIn3D())); additionalChartOptionsMap.put("lastSeriesABarChart", new Boolean(rr.isLastSeriesABarChart())); } else if (chartType.equals(AppConstants.GT_TIME_DIFFERENCE_CHART)) { @@ -726,31 +723,8 @@ public class PdfReportHandler extends org.onap.portalsdk.analytics.RaptorObject{ String chartTitle = Globals.getDisplayChartTitle()? rr.getReportName():""; chartTitle = rr.getFormFieldFilled(chartTitle); - filename = null; /*(String) ChartGen.generateChart( chartType, - request.getSession(), - ds, - legendColumnName, - chartLeftAxisLabel, - chartRightAxisLabel, - (chartType.equals(AppConstants.GT_PIE_MULTIPLE))?rr.getChartDisplayNamesList(AppConstants.CHART_ALL_COLUMNS, formValues):rr.getChartDisplayNamesList(AppConstants.CHART_NEWCHART_COLUMNS, formValues).subList(i, i+1), - (chartType.equals(AppConstants.GT_PIE_MULTIPLE))?rr.getChartColumnColorsList(AppConstants.CHART_ALL_COLUMNS, formValues):rr.getChartColumnColorsList(AppConstants.CHART_NEWCHART_COLUMNS, formValues).subList(i, i+1), - (chartType.equals(AppConstants.GT_PIE_MULTIPLE))?rr.getChartValueColumnAxisList(AppConstants.CHART_ALL_COLUMNS, formValues):rr.getChartValueColumnAxisList(AppConstants.CHART_NEWCHART_COLUMNS, formValues).subList(i, i+1), - "", - chartTitle, - null, - rr.getChartWidthAsInt(), - rr.getChartHeightAsInt(), - rr.getChartValueColumnsList(AppConstants.CHART_NEWCHART_COLUMNS, formValues).subList(i,i+1), - rr.hasSeriesColumn(), - //rr.isChartMultiSeries(), - rr.isMultiSeries(), - rr.getAllColumns(), - downloadFileName, - totalOnChart, - AppConstants.WEB_VERSION, - additionalChartOptionsMap, - true - );*/ + filename = null; + try { Image image = Image.getInstance(downloadFileName); images.add(image); @@ -769,9 +743,6 @@ public class PdfReportHandler extends org.onap.portalsdk.analytics.RaptorObject{ } } /** second rest of the columns are merged to one single chart - sundar**/ - // System.out.println(" rr.getChartDisplayNamesList(AppConstants.CHART_WITHOUT_NEWCHART_COLUMNS) " + rr.getChartDisplayNamesList(AppConstants.CHART_WITHOUT_NEWCHART_COLUMNS)); - // System.out.println(" rr.getChartValueColumnAxisList(AppConstants.CHART_WITHOUT_NEWCHART_COLUMNS) " + rr.getChartValueColumnAxisList(AppConstants.CHART_WITHOUT_NEWCHART_COLUMNS)); - // System.out.println(" rr.getChartValueColumnsList(AppConstants.CHART_WITHOUT_NEWCHART_COLUMNS) " + rr.getChartValueColumnsList(AppConstants.CHART_WITHOUT_NEWCHART_COLUMNS)); if((!(lGroups!=null && lGroups.size() > 0))) { @@ -780,31 +751,8 @@ public class PdfReportHandler extends org.onap.portalsdk.analytics.RaptorObject{ String chartTitle = Globals.getDisplayChartTitle()? rr.getReportName():""; chartTitle = rr.getFormFieldFilled(chartTitle); - filename = null; /*(String) ChartGen.generateChart( chartType, - request.getSession(), - ds, - legendColumnName, - chartLeftAxisLabel, - chartRightAxisLabel, - rr.getChartDisplayNamesList(AppConstants.CHART_WITHOUT_NEWCHART_COLUMNS, formValues), - rr.getChartColumnColorsList(AppConstants.CHART_WITHOUT_NEWCHART_COLUMNS, formValues), - rr.getChartValueColumnAxisList(AppConstants.CHART_WITHOUT_NEWCHART_COLUMNS, formValues), - "", - chartTitle, - null, - rr.getChartWidthAsInt(), - rr.getChartHeightAsInt(), - rr.getChartValueColumnsList(AppConstants.CHART_WITHOUT_NEWCHART_COLUMNS, formValues), - rr.hasSeriesColumn(), - //rr.isChartMultiSeries(), - rr.isMultiSeries(), - rr.getAllColumns(), - downloadFileName, - totalOnChart, - AppConstants.WEB_VERSION, - additionalChartOptionsMap, - true - );*/ + filename = null; + try { Image image = Image.getInstance(downloadFileName); images.add(image); |