diff options
Diffstat (limited to 'ecomp-sdk/epsdk-analytics/src/main')
23 files changed, 35 insertions, 507 deletions
diff --git a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/controller/ActionHandler.java b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/controller/ActionHandler.java index 1cc75b5e..b660ca95 100644 --- a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/controller/ActionHandler.java +++ b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/controller/ActionHandler.java @@ -613,7 +613,6 @@ public class ActionHandler extends org.onap.portalsdk.analytics.RaptorObject { if (aLR!=null && !aLR.getReportID().equals(reportID)) { request.setAttribute(AppConstants.RI_SHOW_BACK_BTN, "Y"); } -// } } if(rDisplayContent) @@ -1829,29 +1828,6 @@ public class ActionHandler extends org.onap.portalsdk.analytics.RaptorObject { public String getChildDropDown(HttpServletRequest request, String nextPage) throws RaptorRuntimeException { if(request.getParameter("firstTime") != null) { return nextPage; } - - /*ReportRuntime rr = (ReportRuntime) request.getSession().getAttribute( - AppConstants.SI_REPORT_RUNTIME); - - String c_master = request.getParameter("c_master"); - java.util.HashMap valuesMap = Globals.getRequestParamtersMap(request); - request.setAttribute("c_master", c_master); - - int idx = 0; - ReportFormFields rff = rr.getReportFormFields(); - FormField ff = null; - for(rff.resetNext(); rff.hasNext(); idx++) { - ff = rff.getNext(); - - - if(ff.getDependsOn() != null && ff.getDependsOn().trim() != "") - { - String val = request.getParameter(ff.getFieldName()); - request.setAttribute(ff.getFieldName(), ff.getHtml(val, valuesMap, rr)); - } - - } - */ return nextPage; } @@ -1940,20 +1916,16 @@ public class ActionHandler extends org.onap.portalsdk.analytics.RaptorObject { colNames.append(dc.getColId()); if (dc.isVisible()) { //TODO: Drilldown URL - //sql = reportRuntime.parseReportSQLForDrillDownParams(sql, dc, request); } } DataSet ds = null; - // try { String dbInfo = reportRuntime.getDBInfo(); if(maxRows == 1) sql += " limit "+ maxRows; System.out.println("SQL getReportData()- " + sql); ds = ConnectionUtils.getDataSet(sql, dbInfo); int totalRows = 0; - /*if (reportRuntime.getReportDataSize() < 0) {*/ - //String countSQL = "SELECT count(*) FROM (" + sql + ") x"; String dbType = ""; if (dbInfo!=null && (!dbInfo.equals(AppConstants.DB_LOCAL))) { @@ -1966,18 +1938,12 @@ public class ActionHandler extends org.onap.portalsdk.analytics.RaptorObject { } totalRows = ds.getRowCount(); - /*}*/ ReportData rd = new ReportData(0, true); if(totalRows > 0) { // Already defined changed for modifying request parameters - //List reportCols = getAllColumns(); Vector visibleCols = new Vector(reportCols.size()); Vector formatProcessors = new Vector(reportCols.size()); - - // ColumnHeaderRow chr = new ColumnHeaderRow(); - // rd.reportColumnHeaderRows.addColumnHeaderRow(chr); - // chr.setRowHeight("30"); int count =0 ; /* ADDED */ @@ -1993,7 +1959,6 @@ public class ActionHandler extends org.onap.portalsdk.analytics.RaptorObject { for(int i = 0 ; i < rff.size(); i++) { fieldDisplayName = "["+((FormField)rff.getFormField(i)).getFieldDisplayName()+"]"; fieldValue = ""; - //if(dct.getOriginalDisplayName()==null) dct.setOriginalDisplayName(dct.getDisplayName()); if (dct.getDependsOnFormField().equals(fieldDisplayName)) { fieldValue = nvl(request.getParameter(((FormField)rff.getFormField(i)).getFieldName())); @@ -2028,7 +1993,6 @@ public class ActionHandler extends org.onap.portalsdk.analytics.RaptorObject { } if (dc.isVisible()) { visibleCols.add(count,dc); - //if(dc.getColId().startsWith("group")) { for (int d = 0; d < reportCols.size(); d++) { if(reportCols.get(d)!=null) { DataColumnType dct1 = (DataColumnType) reportCols.get(d); @@ -2038,21 +2002,17 @@ public class ActionHandler extends org.onap.portalsdk.analytics.RaptorObject { } } } - //} VisualManager visualManager = reportRuntime.getVisualManager(); rd.createColumn(dc.getColId(), dc.getDisplayName(), dc.getDisplayWidthInPxls(),dc.getDisplayHeaderAlignment(), visualManager.isColumnVisible(dc.getColId()), visualManager .getSortByColId().equals(dc.getColId()) ? visualManager .getSortByAscDesc() : null, true, dc.getLevel()!=null?dc.getLevel():0, dc.getStart()!=null?dc.getStart():0, dc.getColspan()!=null?dc.getColspan():0, dc.isIsSortable()!=null?dc.isIsSortable():false); - // chr.addColumnHeader(new ColumnHeader(dc.getDisplayName(), - // (dc.getDisplayWidth()>100)?"10%":(""+dc.getDisplayWidth()+"%"))); } // if else { visibleCols.add(count,null); rd.createColumn(dc.getColId(), AppConstants.HIDDEN, dc.getDisplayWidthInPxls(), dc.getDisplayHeaderAlignment(), false, null,false,dc.getLevel()!=null?dc.getLevel():0, dc.getStart()!=null?dc.getStart():0, dc.getColspan()!=null?dc.getColspan():0, dc.isIsSortable()!=null?dc.isIsSortable():false); -// formatProcessors.add(count,null); } count++; } // for @@ -2097,7 +2057,6 @@ public class ActionHandler extends org.onap.portalsdk.analytics.RaptorObject { } if (dv.getDisplayValue().length() == 0) { - //dv.setDisplayValue("[NULL]"); dv.setDisplayValue(""); } } // if @@ -2116,34 +2075,18 @@ public class ActionHandler extends org.onap.portalsdk.analytics.RaptorObject { dv.setVisible(true); dv.setAlignment(dct.getDisplayAlignment()); dv.setDisplayTotal(dct.getDisplayTotal()); - dv.setDisplayName(dct.getDisplayName()); - -// if (nvl(dct.getDrillDownURL()).length() > 0) { - -// if(dv.getDisplayValue().length() > 0) { - //TODO: Below Drilldown URL -// dv.setDrillDownURL(reportRuntime.parseDrillDownURL(r, /* c, */ds, dct,request, childReportFormFields)); -// dv.setDrillDowninPoPUp(dct.isDrillinPoPUp()); -// } -// -// if (dv.getDisplayValue().length() == 0) { -// //dv.setDisplayValue("[NULL]"); -// dv.setDisplayValue(""); -// } -// } // if + dv.setDisplayName(dct.getDisplayName()); } else { dv.setVisible(false); dv.setHidden(true); } - //System.out.println("in Linear report b4" + dr.getFormatId() + dr.getBgColorHtml() + dv.getDisplayValue()); if(dr.getFormatId()!=null) ((FormatProcessor) formatProcessors.get(c)).setHtmlFormatters(dv, dr, true); else ((FormatProcessor) formatProcessors.get(c)).setHtmlFormatters(dv, dr, false); - //System.out.println("in Linear report After" + dr.getFormatId() + dr.getBgColorHtml() + dv.getDisplayValue()); } // if reportCols } // for reportDataList.add(dr); @@ -2151,7 +2094,6 @@ public class ActionHandler extends org.onap.portalsdk.analytics.RaptorObject { rd.setReportDataList(reportDataList); //Only if rownumber options is needed - //rd.addRowNumbers(pageNo, getPageSize()); DataRow colDataTotalsLinear = null; if (colDataTotalsLinear == null) colDataTotalsLinear = reportRuntime.generateColumnDataTotalsLinear(new ArrayList(reportCols), AppUtils.getUserID(request), @@ -2171,8 +2113,6 @@ public class ActionHandler extends org.onap.portalsdk.analytics.RaptorObject { if(rr!=null) { ReportJSONRuntime reportJSONRuntime = rr.createFormFieldJSONRuntime(request); ObjectMapper mapper = new ObjectMapper(); - //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 = ""; diff --git a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/controller/WizardProcessor.java b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/controller/WizardProcessor.java index 8605f208..f1c7cf48 100644 --- a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/controller/WizardProcessor.java +++ b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/controller/WizardProcessor.java @@ -540,7 +540,6 @@ public class WizardProcessor extends org.onap.portalsdk.analytics.RaptorObject { joinTableExpr = joinExpr.replaceAll("\\["+tableName+"\\]", tableId); joinTableExpr = joinTableExpr.replaceAll("\\["+joinTableName+"\\]", joinTableId); -// debugLogger.debug("joinExpr : "+joinExpr+"\njoinTableExpr : "+ joinTableExpr); } rdef.addDataSourceType(new ObjectFactory(), tableId, tableName, AppUtils @@ -584,7 +583,7 @@ public class WizardProcessor extends org.onap.portalsdk.analytics.RaptorObject { if (reportUpdated) rdef.resetCache(true); - return true; // reportUpdated; + return true; // reportUpdated } // processTableEdit @@ -614,7 +613,7 @@ public class WizardProcessor extends org.onap.portalsdk.analytics.RaptorObject { if(currColumn!=null) { tableId = currColumn.getTableId(); - colName = currColumn.getDbColName(); // currColumn.getColName(); + colName = currColumn.getDbColName(); dataType = currColumn.getDbColType(); } } else { @@ -746,7 +745,6 @@ public class WizardProcessor extends org.onap.portalsdk.analytics.RaptorObject { int colGroupColSpanInt = 0; if(level > 0) { try { - //startColGroupInt = Integer.parseInt(startColGroup); colGroupColSpanInt = Integer.parseInt(colGroupColSpan); } catch (NumberFormatException ex) { @@ -786,7 +784,6 @@ public class WizardProcessor extends org.onap.portalsdk.analytics.RaptorObject { currColumn.setCrossTabValue(crossTabValue); currColumn.setDependsOnFormField(dependsOnFormField); currColumn.setDisplayName(displayName); - //currColumn.setOriginalDisplayName(displayName); if (displayWidth > 0) currColumn.setDisplayWidth(displayWidth); @@ -801,20 +798,15 @@ public class WizardProcessor extends org.onap.portalsdk.analytics.RaptorObject { if(drillDownPopUp) { rdef.setDrillDownURLInPopupPresent(true); } - /*if(targetColumn!=null) { - currColumn.setSemaphoreId(null); - targetColumn.setSemaphoreId(semaphoreId); - } else */ + currColumn.setSemaphoreId(semaphoreId); currColumn.setGroupBreak(isGroupBreak); logger.debug(EELFLoggerDelegate.debugLogger, (" ------------ Display Total ---------- "+ displayTotal)); currColumn.setDisplayTotal(displayTotal); - //if (currColumn.getDrillDownURL() == null || currColumn.getDrillDownURL().length() == 0) currColumn.setVisible(isVisible); currColumn.setIsSortable(isSortable); currColumn.setNowrap(nowrap); - //else - // currColumn.setVisible(true); + if (rdef.getReportDefType().equals(AppConstants.RD_SQL_BASED)) { if(colType!=null) currColumn.setColType(colType); @@ -831,7 +823,6 @@ public class WizardProcessor extends org.onap.portalsdk.analytics.RaptorObject { currColumn.setColName(colNameValue); if (displayFormat != null) currColumn.setColFormat(displayFormat); - //currColumn.setVisible(isVisible); currColumn.setCalculated(exprFormula.length() > 0); rdef.adjustColumnType(currColumn); @@ -1011,9 +1002,7 @@ public class WizardProcessor extends org.onap.portalsdk.analytics.RaptorObject { SimpleDateFormat dtf = new SimpleDateFormat("MM/dd/yyyy"); end = Calendar.getInstance(); end.setTime(dtf.parse(rangeEndDate)); - }/* - * if(fieldHelp.length()>255) fieldHelp = fieldHelp.substring(0, 255); - */ + } boolean reportUpdated = false; @@ -1067,8 +1056,6 @@ public class WizardProcessor extends org.onap.portalsdk.analytics.RaptorObject { } else { currField.setRangeEndDate(null); } - /*currField.setRangeEndDate(DatatypeFactory.newInstance() - .newXMLGregorianCalendar(end));*/ } catch (DatatypeConfigurationException ex) { } @@ -1232,15 +1219,6 @@ public class WizardProcessor extends org.onap.portalsdk.analytics.RaptorObject { try { String s_sql = Globals.getProcessFilterAddEdit(); s_sql = s_sql.replace("[argValue]", argValue); - /*DataSet ds = DbUtils.executeQuery("SELECT " - + (currColType.equals(AppConstants.CT_NUMBER) ? ("TO_NUMBER('" - + argValue + "')") - : (currColType.equals(AppConstants.CT_DATE) ? ("TO_DATE('" - + argValue - + "', '" - + nvl(currColumn.getColFormat(), - AppConstants.DEFAULT_DATE_FORMAT) + "')") - : ("'" + argValue + "'"))) + " FROM dual");*/ DataSet ds = DbUtils.executeQuery("SELECT " + (currColType.equals(AppConstants.CT_NUMBER) ? ("TO_NUMBER('" @@ -1275,9 +1253,7 @@ public class WizardProcessor extends org.onap.portalsdk.analytics.RaptorObject { currFilter.setJoinCondition(AppUtils.getRequestValue(request, "filterJoin")); currFilter.setOpenBrackets(AppUtils.getRequestValue(request, "openBrackets")); currFilter.setExpression(filterExpr); - // if(argType!=null) currFilter.setArgType(argType); - // if(argValue!=null) currFilter.setArgValue(argValue); currFilter .setCloseBrackets(AppUtils.getRequestValue(request, "closeBrackets")); @@ -1485,7 +1461,6 @@ public class WizardProcessor extends org.onap.portalsdk.analytics.RaptorObject { String chartType = AppUtils.getRequestNvlValue(request, "chartType"); String chartTypeFixed = AppUtils.getRequestValue(request, "chartTypeFixed"); String legendColId = AppUtils.getRequestNvlValue(request, "legendCol"); - // String valueColId = AppUtils.getRequestNvlValue(request, "valueCol"); String leftAxisLabel = AppUtils.getRequestValue(request, "leftAxisLabel"); String rightAxisLabel = AppUtils.getRequestValue(request, "rightAxisLabel"); String chartWidth = XSSFilter.filterRequest(AppUtils.getRequestNvlValue(request, "chartWidth")); @@ -1551,11 +1526,8 @@ public class WizardProcessor extends org.onap.portalsdk.analytics.RaptorObject { multiplePieOrder = AppUtils.getRequestNvlValue(request, "multiplePieOrder"); multiplePieLabelDisplay = AppUtils.getRequestNvlValue(request, "multiplePieLabelDisplay"); chartDisplay = AppUtils.getRequestNvlValue(request, "chartDisplay"); - //if(AppUtils.getRequestNvlValue(request, "multiplePieOrderInRunPage").length()>0) multiplePieOrderInRunPage = AppUtils.getRequestNvlValue(request,"multiplePieOrderInRunPage").equals("Y"); - //if(AppUtils.getRequestNvlValue(request, "multiplePieLabelDisplayInRunPage").length()>0) multiplePieLabelDisplayInRunPage = AppUtils.getRequestNvlValue(request,"multiplePieLabelDisplayInRunPage").equals("Y"); - //if(AppUtils.getRequestNvlValue(request, "chartDisplayInRunPage").length()>0) chartDisplayInRunPage = AppUtils.getRequestNvlValue(request,"chartDisplayInRunPage").equals("Y"); if(rdef.getChartAdditionalOptions()!=null) { rdef.setChartMultiplePieOrder(multiplePieOrder+(multiplePieOrderInRunPage?"|Y":"")); @@ -1581,11 +1553,8 @@ public class WizardProcessor extends org.onap.portalsdk.analytics.RaptorObject { chartOrientation = AppUtils.getRequestNvlValue(request, "chartOrientation"); secondaryChartRenderer = AppUtils.getRequestNvlValue(request, "secondaryChartRenderer"); chartDisplay = AppUtils.getRequestNvlValue(request, "chartDisplay"); - //if(AppUtils.getRequestNvlValue(request, "chartOrientationInRunPage").length()>0) chartOrientationInRunPage = AppUtils.getRequestNvlValue(request,"chartOrientationInRunPage").equals("Y"); - //if(AppUtils.getRequestNvlValue(request, "secondaryChartRendererInRunPage").length()>0) secondaryChartRendererInRunPage = AppUtils.getRequestNvlValue(request,"secondaryChartRendererInRunPage").equals("Y"); - //if(AppUtils.getRequestNvlValue(request, "chartDisplayInRunPage").length()>0) chartDisplayInRunPage = AppUtils.getRequestNvlValue(request,"chartDisplayInRunPage").equals("Y"); rdef.setChartOrientation(chartOrientation+(chartOrientationInRunPage?"|Y":"")); rdef.setSecondaryChartRenderer(secondaryChartRenderer+(secondaryChartRendererInRunPage?"|Y":"")); @@ -1597,11 +1566,8 @@ public class WizardProcessor extends org.onap.portalsdk.analytics.RaptorObject { chartOrientation = AppUtils.getRequestNvlValue(request, "chartOrientation"); secondaryChartRenderer = AppUtils.getRequestNvlValue(request, "secondaryChartRenderer"); chartDisplay = AppUtils.getRequestNvlValue(request, "chartDisplay"); - //if(AppUtils.getRequestNvlValue(request, "chartOrientationInRunPage").length()>0) chartOrientationInRunPage = AppUtils.getRequestNvlValue(request,"chartOrientationInRunPage").equals("Y"); - //if(AppUtils.getRequestNvlValue(request, "secondaryChartRendererInRunPage").length()>0) secondaryChartRendererInRunPage = AppUtils.getRequestNvlValue(request,"secondaryChartRendererInRunPage").equals("Y"); - //if(AppUtils.getRequestNvlValue(request, "chartDisplayInRunPage").length()>0) chartDisplayInRunPage = AppUtils.getRequestNvlValue(request,"chartDisplayInRunPage").equals("Y"); rdef.setChartOrientation(chartOrientation+(chartOrientationInRunPage?"|Y":"")); rdef.setSecondaryChartRenderer(secondaryChartRenderer+(secondaryChartRendererInRunPage?"|Y":"")); @@ -1636,11 +1602,6 @@ public class WizardProcessor extends org.onap.portalsdk.analytics.RaptorObject { rdef.setChartLegendDisplay(chartLegendDisplay+(showLegendDisplayOptionsInRunPage?"|Y":"")); rdef.setChartToolTips(AppUtils.getRequestNvlValue(request,"hideTooltips")); rdef.setDomainAxisValuesAsString(AppUtils.getRequestNvlValue(request,"keepAsString")); - - //System.out.println("KeepAsString " + AppUtils.getRequestNvlValue(request,"keepAsString")); - //System.out.println("From ReportDef " + rdef.keepDomainAxisValueInChartAsString()); - // boolean reportUpdated = (! - // chartType.equals(nvl(rdef.getChartType()))); rdef.setChartType(chartType); rdef.setChartTypeFixed(nvl(chartTypeFixed, "N")); if (nvl(leftAxisLabel).length()>0) @@ -1664,22 +1625,11 @@ public class WizardProcessor extends org.onap.portalsdk.analytics.RaptorObject { DataColumnType dct = (DataColumnType) iter.next(); if (dct.getColId().equals(legendColId)) { - // reportUpdated = reportUpdated||(! - // nvl(dct.getColOnChart()).equals(AppConstants.GC_LEGEND)); dct.setColOnChart(AppConstants.GC_LEGEND); } else { - // reportUpdated = - // reportUpdated||nvl(dct.getColOnChart()).equals(AppConstants.GC_LEGEND); dct.setColOnChart(null); } - - /* - * if(dct.getColId().equals(valueColId)) { reportUpdated = - * reportUpdated||(dct.getChartSeq()<=0); dct.setChartSeq(1); } - * else { reportUpdated = reportUpdated||(dct.getChartSeq()>0); - */ dct.setChartSeq(-1); - /* } */ } // for int idx = 1; @@ -1690,7 +1640,6 @@ public class WizardProcessor extends org.onap.portalsdk.analytics.RaptorObject { String yAxis = AppUtils.getRequestNvlValue(request, "yAxis"); for (Iterator iterator = columns.iterator(); iterator.hasNext();) { DataColumnType alldct = (DataColumnType) iterator.next(); - //debugLogger.debug("**********In " + chartSeries + " " + alldct.getColId()); alldct.setChartSeries((chartSeries.equals(alldct.getColId()))?true : false); } @@ -1719,7 +1668,6 @@ public class WizardProcessor extends org.onap.portalsdk.analytics.RaptorObject { String yAxis = AppUtils.getRequestNvlValue(request, "yAxis"); for (Iterator iterator = columns.iterator(); iterator.hasNext();) { DataColumnType alldct = (DataColumnType) iterator.next(); - //debugLogger.debug("**********In " + chartSeries + " " + alldct.getColId()); alldct.setChartSeries((chartSeries.equals(alldct.getColId()))?true : false); } String drillDownReportId = AppUtils.getRequestNvlValue(request, "drillDownReport"); @@ -1766,7 +1714,6 @@ public class WizardProcessor extends org.onap.portalsdk.analytics.RaptorObject { String chartSeries = AppUtils.getRequestNvlValue(request, "chartSeries"); for (Iterator iterator = columns.iterator(); iterator.hasNext();) { DataColumnType alldct = (DataColumnType) iterator.next(); - //debugLogger.debug("**********In " + chartSeries + " " + alldct.getColId()); alldct.setChartSeries((chartSeries.equals(alldct.getColId()))?true : false); } @@ -1774,7 +1721,6 @@ public class WizardProcessor extends org.onap.portalsdk.analytics.RaptorObject { String chartSeries = AppUtils.getRequestNvlValue(request, "chartSeries"); for (Iterator iterator = columns.iterator(); iterator.hasNext();) { DataColumnType alldct = (DataColumnType) iterator.next(); - //debugLogger.debug("**********In " + chartSeries + " " + alldct.getColId()); alldct.setChartSeries((chartSeries.equals(alldct.getColId()))?true : false); } }else if(chartType.equals(AppConstants.GT_STACKED_HORIZ_BAR) || chartType.equals(AppConstants.GT_STACKED_VERT_BAR) @@ -1782,28 +1728,24 @@ public class WizardProcessor extends org.onap.portalsdk.analytics.RaptorObject { String chartSeries = AppUtils.getRequestNvlValue(request, "chartSeries"); for (Iterator iterator = columns.iterator(); iterator.hasNext();) { DataColumnType alldct = (DataColumnType) iterator.next(); - //debugLogger.debug("**********In " + chartSeries + " " + alldct.getColId()); alldct.setChartSeries((chartSeries.equals(alldct.getColId()))?true : false); } }else if(chartType.equals(AppConstants.GT_LINE)) { String chartSeries = AppUtils.getRequestNvlValue(request, "chartSeries"); for (Iterator iterator = columns.iterator(); iterator.hasNext();) { DataColumnType alldct = (DataColumnType) iterator.next(); - //debugLogger.debug("**********In " + chartSeries + " " + alldct.getColId()); alldct.setChartSeries((chartSeries.equals(alldct.getColId()))?true : false); } } else if (chartType.equals(AppConstants.GT_TIME_DIFFERENCE_CHART)) { String chartSeries = AppUtils.getRequestNvlValue(request, "chartSeries"); for (Iterator iterator = columns.iterator(); iterator.hasNext();) { DataColumnType alldct = (DataColumnType) iterator.next(); - //debugLogger.debug("**********In " + chartSeries + " " + alldct.getColId()); alldct.setChartSeries((chartSeries.equals(alldct.getColId()))?true : false); } } else if (chartType.equals(AppConstants.GT_COMPARE_PREVYEAR_CHART)) { String chartSeries = AppUtils.getRequestNvlValue(request, "chartSeries"); for (Iterator iterator = columns.iterator(); iterator.hasNext();) { DataColumnType alldct = (DataColumnType) iterator.next(); - //debugLogger.debug("**********In " + chartSeries + " " + alldct.getColId()); alldct.setChartSeries((chartSeries.equals(alldct.getColId()))?true : false); } @@ -1858,7 +1800,6 @@ public class WizardProcessor extends org.onap.portalsdk.analytics.RaptorObject { } for (int i = 1; i < Math.max(valueColsCount, 1) + 1; i++) { - //debugLogger.debug("********** " + chartSeries); if(i==1) { /* Range Axis is resetted before adding */ for (Iterator iterator = columns.iterator(); iterator.hasNext();) { @@ -1883,11 +1824,7 @@ public class WizardProcessor extends org.onap.portalsdk.analytics.RaptorObject { String chartGroup = XSSFilter.filterRequestOnlyScript(AppUtils.getRequestNvlValue(request, "chartGroup" + valueColId + "Axis")); String yAxisGroup = ""; yAxisGroup = XSSFilter.filterRequestOnlyScript(AppUtils.getRequestNvlValue(request, "YAxisLabel" + valueColId)); - //debugLogger.debug("^^^^^^^^^^^^^^^^^Chart Group " + chartGroup); - //if(chartType.equals(AppConstants.GT_TIME_SERIES)) { - // debugLogger.debug("**********Outer If " + chartSeries); - //} - + if (valueColId.length() > 0 && (!valueColId.equals(removeColId))) { DataColumnType dct = rdef.getColumnById(valueColId); dct.setChartSeq(idx++); @@ -1906,9 +1843,7 @@ public class WizardProcessor extends org.onap.portalsdk.analytics.RaptorObject { else if (chartType.equals(AppConstants.GT_BAR_3D)) dct.setYAxis(nvl(yAxisGroup)+"|"+valueColId); else dct.setYAxis(""); - //} - //else - //dct.setCreateInNewChart(false); + } else if (valueColId.length() > 0 && (valueColId.equals(removeColId))) {// if DataColumnType dct = rdef.getColumnById(valueColId); dct.setChartSeq(-1); @@ -1941,7 +1876,7 @@ public class WizardProcessor extends org.onap.portalsdk.analytics.RaptorObject { } // if } // for - return true; // reportUpdated; + return true; // reportUpdated } // processChart public boolean processAdhocSchedule(HttpServletRequest request, String action) @@ -1993,7 +1928,6 @@ public class WizardProcessor extends org.onap.portalsdk.analytics.RaptorObject { reportSchedule.addEmailToUser(loggedInUserId, (AppUtils.getUserName(loggedInUserId).length()>0?AppUtils.getUserName(loggedInUserId):(AppUtils.getUserLoginId(loggedInUserId).length()>0?AppUtils.getUserLoginId(loggedInUserId):loggedInUserId) )); } if (action.equals(AppConstants.WA_ADD_USER)) { - //String userId = AppUtils.getRequestNvlValue(request, "schedEmailAdd"); String userName = AppUtils.getUserName(userId); if (Globals.getUseLoginIdInSchedYN().equals("Y")){ String userLoginId = AppUtils.getUserLoginId(userId); @@ -2018,7 +1952,6 @@ public class WizardProcessor extends org.onap.portalsdk.analytics.RaptorObject { reportSchedule.removeEmailToUser( AppUtils.getRequestNvlValue(request, AppConstants.RI_DETAIL_ID)); else if (action.equals(AppConstants.WA_ADD_ROLE)) { - //String roleId = AppUtils.getRequestNvlValue(request, "schedEmailAddRole"); String roleName = AppUtils.getRoleName(roleId); if (roleId.length() > 0 && roleName != null) reportSchedule.addEmailToRole(roleId, roleName); @@ -2183,8 +2116,6 @@ public class WizardProcessor extends org.onap.portalsdk.analytics.RaptorObject { System.out.println(" #$%#$%#$% -- address col = " + addressColumn); String dataColumn = XSSFilter.filterRequestOnlyScript(AppUtils.getRequestNvlValue(request, "dataColumn0")); String legendColumn = XSSFilter.filterRequestOnlyScript(AppUtils.getRequestNvlValue(request, "legendColumn")); - //String legendDisplayName = XSSFilter.filterRequestOnlyScript(AppUtils.getRequestNvlValue(request, "dataHeaderL")); - //if(nvl(legendDisplayName).length()<=0) legendDisplayName = legendColumn; String color = XSSFilter.filterRequestOnlyScript(AppUtils.getRequestNvlValue(request, "markerColor0")); String isMapAllowed = XSSFilter.filterRequestOnlyScript(AppUtils.getRequestNvlValue(request, "isMapAllowed")); String useDefaultSize = XSSFilter.filterRequestOnlyScript(AppUtils.getRequestNvlValue(request, "useDefaultSize")); @@ -2215,7 +2146,6 @@ public class WizardProcessor extends org.onap.portalsdk.analytics.RaptorObject { repMap.setHeight(height.trim()); repMap.setWidth(width.trim()); repMap.setLegendColumn(legendColumn); - //repMap.setLegendDisplayName(legendDisplayName); Marker m = new ObjectFactory().createMarker(); m.setAddressColumn(addressColumn); diff --git a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/controller/WizardSequence.java b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/controller/WizardSequence.java index cbf3ee63..5c2d0c4a 100644 --- a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/controller/WizardSequence.java +++ b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/controller/WizardSequence.java @@ -43,7 +43,6 @@ import org.onap.portalsdk.analytics.model.definition.ReportDefinition; import org.onap.portalsdk.analytics.util.AppConstants; public class WizardSequence extends Vector { - // private String currentStep = AppConstants.WS_DEFINITION; private int currentStepIdx = 0; private String currentSubStep = ""; @@ -84,20 +83,10 @@ public class WizardSequence extends Vector { throw new IndexOutOfBoundsException(); } // getStepIndex - /* - * private String getInitialStep() { return getStep(0); } // getInitialStep - * - * private String getFinalStep() { return getStep(getStepCount()-1); } // - * getFinalStep - */ private boolean isInitialStep(int index) { return (index == 0); } // isInitialStep - /* - * private boolean isInitialStep(String step) { return - * isInitialStep(getStepIndex(step)); } // isInitialStep - */ private boolean isFinalStep(int index) { if (index == 0) return false; @@ -105,37 +94,14 @@ public class WizardSequence extends Vector { return (index == (getStepCount() - 1)); } // isFinalStep - /* - * private boolean isFinalStep(String step) { return - * isFinalStep(getStepIndex(step)); } // isFinalStep - */ - private int getNextStepIndex(int index) { return (index == (getStepCount() - 1)) ? index : (index + 1); } // getNextStep - /* - * private String getNextStep(String step) { return - * getStep(getNextStepIndex(getStepIndex(step))); } // getNextStep - * - * private String getNextStep(String step, String subStep) { - * if(subStep.length()>0) return step; - * - * return getNextStep(step); } // getNextStep - */ private int getPrevStepIndex(int index) { return (index == 0) ? index : (index - 1); } // getPrevStepIndex - /* - * private String getPrevStep(String step) { return - * getStep(getPrevStepIndex(getStepIndex(step))); } // getPrevStep - * - * private String getPrevStep(String step, String subStep) { - * if(subStep.length()>0) return step; - * - * return getPrevStep(step); } // getPrevStep - */ // ***************************************************** public int getStepCount() { return size(); @@ -165,8 +131,9 @@ public class WizardSequence extends Vector { if (action.equals(AppConstants.WA_BACK)) if (currentSubStep.length() > 0) currentSubStep = ""; - else + else{ currentStepIdx = getPrevStepIndex(currentStepIdx); + } else if (action.equals(AppConstants.WA_NEXT)) { if (currentSubStep.length() > 0) currentSubStep = ""; @@ -178,10 +145,11 @@ public class WizardSequence extends Vector { && (rdef.getDataSourceList().getDataSource().size() == 0)) currentSubStep = AppConstants.WSS_ADD; else if (getCurrentStep().equals(AppConstants.WS_COLUMNS) - && (rdef.getAllColumns().size() == 0)) + && (rdef.getAllColumns().size() == 0)){ currentSubStep = (rdef.getReportType().equals( AppConstants.RT_CROSSTAB) ? AppConstants.WSS_ADD : AppConstants.WSS_ADD_MULTI); + } } } else if (action.equals(AppConstants.WA_EDIT) || action.equals(AppConstants.WA_ADD) || action.equals(AppConstants.WA_ADD_MULTI) diff --git a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/controller/WizardSequenceCrossTab.java b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/controller/WizardSequenceCrossTab.java index d649db43..76b2a9e4 100644 --- a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/controller/WizardSequenceCrossTab.java +++ b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/controller/WizardSequenceCrossTab.java @@ -51,7 +51,6 @@ public class WizardSequenceCrossTab extends WizardSequence { add(AppConstants.WS_FILTERS); add(AppConstants.WS_JAVASCRIPT); add(AppConstants.WS_USER_ACCESS); - //add(AppConstants.WS_SCHEDULE); if (userIsAuthorizedToSeeLog) if (Globals.getEnableReportLog()) add(AppConstants.WS_REPORT_LOG); diff --git a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/controller/WizardSequenceDashboard.java b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/controller/WizardSequenceDashboard.java index 2c7f3f89..42ebc41c 100644 --- a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/controller/WizardSequenceDashboard.java +++ b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/controller/WizardSequenceDashboard.java @@ -46,7 +46,6 @@ public class WizardSequenceDashboard extends WizardSequence { super(); add(AppConstants.WS_USER_ACCESS); - //add(AppConstants.WS_SCHEDULE); if (userIsAuthorizedToSeeLog) if (Globals.getEnableReportLog()) add(AppConstants.WS_REPORT_LOG); diff --git a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/error/UserAccessException.java b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/error/UserAccessException.java index 46232ba2..571bb11e 100644 --- a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/error/UserAccessException.java +++ b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/error/UserAccessException.java @@ -44,8 +44,6 @@ public class UserAccessException extends RaptorRuntimeException { } // UserAccessException public UserAccessException(String reportID, String userName, String accessType) { - //super("User " + userName + " does NOT have " + accessType + " permission for report " - // + reportID); super("Access denied. Please contact Administrator"); } // UserAccessException diff --git a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/gmap/map/ColorProperties.java b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/gmap/map/ColorProperties.java index 6e1d7e24..225fa9ea 100644 --- a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/gmap/map/ColorProperties.java +++ b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/gmap/map/ColorProperties.java @@ -55,38 +55,12 @@ public class ColorProperties { } public void setColor(String type, String color) { - //colorProperties.put(type + "_COLOR", color); String[] rgb = color.split(","); colorProperties.put(type + "_COLOR", new Color(Integer.parseInt(rgb[0]), Integer.parseInt(rgb[1]), Integer.parseInt(rgb[2]))); } -// public void setColor(String type, int number, String color) { -// Object object = colorProperties.get(type + ":" + number + "_COLOR"); -// -// if (object != null) { -// Color oldColor = (Color) object; -// -// if (!color.equals(oldColor.getRed() + "," + oldColor.getGreen() + "," + oldColor.getBlue())) { -// String[] rgb = color.split(","); -// colorProperties.put(type + ":" + number + "_COLOR", -// new Color(Integer.parseInt(rgb[0]), Integer.parseInt(rgb[1]), -// Integer.parseInt(rgb[2]))); -// } -// } -// else { -// String[] rgb = color.split(","); -// colorProperties.put(type + ":" + number + "_COLOR", -// new Color(Integer.parseInt(rgb[0]), Integer.parseInt(rgb[1]), -// Integer.parseInt(rgb[2]))); -// } -// } - -// public Color getColor(String type, int number) { -// return (Color) colorProperties.get(type + ":" + number + "_COLOR"); -// } - public Color getColor(String type) { return (Color) colorProperties.get(type + "_COLOR"); } diff --git a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/gmap/map/GMapProperties.java b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/gmap/map/GMapProperties.java index 6954f635..ba2a41be 100644 --- a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/gmap/map/GMapProperties.java +++ b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/gmap/map/GMapProperties.java @@ -40,7 +40,7 @@ package org.onap.portalsdk.analytics.gmap.map; import org.onap.portalsdk.analytics.system.Globals; public class GMapProperties { - + public static String getProjectFolder() { return Globals.getProjectFolder(); } diff --git a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/gmap/map/MapConstant.java b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/gmap/map/MapConstant.java index bcbdb8e2..ccd1e2f2 100644 --- a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/gmap/map/MapConstant.java +++ b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/gmap/map/MapConstant.java @@ -38,7 +38,8 @@ package org.onap.portalsdk.analytics.gmap.map; public class MapConstant { - public static final String CURSOR = "CURSOR"; + + public static final String CURSOR = "CURSOR"; public static final String FILLED_TRIANGLE = "FILLED TRIANGLE"; public static final String FILLED_SQUARE = "FILLED SQUARE"; public static final String FILLED_CIRCLE = "FILLED CIRCLE"; diff --git a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/gmap/map/NovaMap.java b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/gmap/map/NovaMap.java index 6473bc6f..794acead 100644 --- a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/gmap/map/NovaMap.java +++ b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/gmap/map/NovaMap.java @@ -166,9 +166,6 @@ public class NovaMap { ; } - // && (1200*meter2pixel[zoom]) > Wmeter - // && (700*meter2pixel[zoom]) > Hmeter; - return zoom + MapConstant.ZOOM_MIN - 1; } @@ -411,7 +408,6 @@ public class NovaMap { } ArrayList imageArr = new ArrayList(); - // if(showLegend) layer.paintLegend(g2Legend); g2d.dispose(); if (showLegend && g2Legend != null) diff --git a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/gmap/map/layer/SwingLayer.java b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/gmap/map/layer/SwingLayer.java index ae6237ca..6473c8d0 100644 --- a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/gmap/map/layer/SwingLayer.java +++ b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/gmap/map/layer/SwingLayer.java @@ -108,7 +108,6 @@ public class SwingLayer { System.out.println("swing layer interrupted"); return false; } - //System.out.println("%%%%%%%getImage. no of T1%%%%%%" + nodeInfo.getAttribute("x_sequence")); point = map.getPixelPos(nodeInfo.geoCoordinate.latitude, nodeInfo.geoCoordinate.longitude); @@ -175,30 +174,19 @@ public class SwingLayer { g2d.setColor(Color.BLACK); g2d.drawString("M", shape.x + width2 / 2, shape.y); } - -// if (map.containsShowLabelList(nodeInfo.getNodeType())) { -// g2d.setColor(Color.BLACK); -// FontMetrics metrics = g2d.getFontMetrics(); -// int x = shape.x - metrics.stringWidth(nodeInfo.getID()) / 2; -// int y = shape.y + width2 * 4 / 3; -// g2d.drawString(nodeInfo.getID(), x, y); -// } } String legendName = ""; int baseY = 0; - baseY = (20*showListArr.length) + 20;//+5; + baseY = (20*showListArr.length) + 20; int baseX = 0; if(map.isShowLegend()) { for (int i = showListArr.length-1; i>=0; i--) { legendName = (String)showListArr[i]; - //for(int i = 0; i < showListArr.length; i++ ) { if(i == showListArr.length-1){ textWidth = (textWidth<="Legend".length())?"Legend".length():textWidth; g2Legend.setColor(Color.WHITE); - //g2d.draw(new Rectangle2D.Double((int) bounds.getMaxX()*0.1, (int) bounds.getMaxY()*0.75*showListArr.length, (int) bounds.getMaxX()*0.75, (int) bounds.getMaxY()*0.75)); - g2Legend.fill3DRect((int)(0), (int)(0), (int) bounds.getWidth() , (int)(baseY) , true); // (int)(bounds.getMaxX()*0.9)- (int)(bounds.getMaxX()*0.25) - //if(i == 0){ + g2Legend.fill3DRect((int)(0), (int)(0), (int) bounds.getWidth() , (int)(baseY) , true); g2Legend.setColor(Color.BLACK); g2Legend.setFont(NovaMap.HEADER_FONT); g2Legend.drawString("Legend", (int) (10), 10); @@ -214,15 +202,6 @@ public class SwingLayer { } } -/* g2d.drawString("0", (int) bounds.getMaxX()/2+20 + width+10, 0); - g2d.drawString("50", (int) bounds.getMaxX()/2+20 + width+10, 50); - g2d.drawString("100", (int) bounds.getMaxX()/2+20 + width+10, 100); - g2d.drawString("200", (int) bounds.getMaxX()/2+20 + width+10, 200); - g2d.drawString("400", (int) bounds.getMaxX()/2+20 + width+10, 400); - g2d.drawString("600", (int) bounds.getMaxX()/2+20 + width+10, 600); -*/ -// g2d.setFont(NovaMap.TEXT_FONT); -// g2d.setColor(Color.BLACK); if(nvl(map.getDataLoaded()).trim().length() > 0) { g2d.setColor(Color.WHITE); g2d.fill3DRect(new Double(bounds.getMinX()).intValue(), new Double(bounds.getMaxY()).intValue()-30, (int) bounds.getWidth() , (int)(30) , true); // (int)(bounds.getMaxX()*0.9)- (int)(bounds.getMaxX()*0.25) @@ -230,8 +209,6 @@ public class SwingLayer { g2d.setFont(NovaMap.HEADER_FONT); g2d.drawString(Globals.getUserDefinedMessageForMemoryLimitReached() + " "+ map.getDataLoaded()+ " were downloaded to Map.", new Double(bounds.getMinX()).intValue()+80, new Double(bounds.getMaxY()).intValue()-15); } - - //g2d.drawString("Hello", new Double(bounds.getMinX()).intValue()+20, new Double(bounds.getMaxY()).intValue()-50); FontMetrics metrics = g2d.getFontMetrics(); for (int i = 0; i < visibleLabel.size(); i++) { diff --git a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/gmap/node/Node.java b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/gmap/node/Node.java index 4764ef50..ced3d79b 100644 --- a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/gmap/node/Node.java +++ b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/gmap/node/Node.java @@ -73,39 +73,11 @@ public class Node { nodeInfo.setDeleteable(nodeParam.isDeleteable()); nodeInfo.initializeAttributes(nodeParam.getNodeAttributes()); - //if (nodeCollection.getNode(nodeInfo.getNodeID()+""+nodeInfo.getNodeType()) == null) { nodeCollection.addNode(nodeInfo); nodeIDSet.add(nodeParam.getNodeID()); -/* } - else { - return nodeCollection.getNode(nodeType); - } -*/ return nodeInfo; } - - /** - * - */ -/* public void updateNumberT1(String currentYearMonth) { - ArrayList<NodeInfo> nodeCollection = this.nodeCollection.getNodeCollection(); - - for (NodeInfo nodeInfo : nodeCollection) { - nodeInfo.setAttribute(NodeInfo.NUMBER_OF_T1_KEY, nodeInfo.getAttribute(currentYearMonth)); - } - } -*/ -/* public Set<Integer> getUniqueNumberT1(String currentYearMonth) { - ArrayList<NodeInfo> nodeCollection = this.nodeCollection.getNodeCollection(); - Set<Integer> numberT1Set = new TreeSet<Integer>(); - for (NodeInfo nodeInfo : nodeCollection) { - numberT1Set.add(Integer.parseInt(nodeInfo.getAttribute(currentYearMonth).toString())); - } - - return numberT1Set; - } -*/ public void updateNumberT1(String currentYearMonth) { HashMap<String,NodeInfo> hashMap = this.nodeCollection.getNodeCollection(); Set set = hashMap.entrySet(); @@ -145,7 +117,6 @@ public class Node { int nodeSize = map.getShapeWidth(); HashMap<String,NodeInfo> hashMap = nodeCollection.getNodeCollection(); Set set = hashMap.entrySet(); - //ArrayList<NodeInfo> list = nodeCollection.getNodeCollection(); for (Iterator iterator = set.iterator(); iterator.hasNext();) { Map.Entry entry = (Map.Entry) iterator.next(); diff --git a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/DataCache.java b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/DataCache.java index 41a5ae20..084fbe1b 100644 --- a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/DataCache.java +++ b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/DataCache.java @@ -103,7 +103,7 @@ public class DataCache extends org.onap.portalsdk.analytics.RaptorObject { for (int i = 0; i < ds.getRowCount(); i++) publicReportIdNames .add(new IdNameValue(ds.getString(i, 0), ds.getString(i, 1))); - } // catch(Exception e) {} + } return publicReportIdNames; } // getPublicReportIdNames @@ -137,7 +137,7 @@ public class DataCache extends org.onap.portalsdk.analytics.RaptorObject { for (int i = 0; i < ds.getRowCount(); i++) privateReportIdNames .add(new IdNameValue(ds.getString(i, 0), ds.getString(i, 1))); - } // catch(Exception e) {} + } return privateReportIdNames; } // getPrivateAccessibleReportIdNames @@ -241,7 +241,6 @@ public class DataCache extends org.onap.portalsdk.analytics.RaptorObject { if (dBInfo != null && !dBInfo.equals(AppConstants.DB_LOCAL)){ String d_sql = Globals.grabTheReportTableIf(); d_sql = d_sql.replace("[dBInfo]", dBInfo); - //query.append( " ts.SOURCE_DB= '" + dBInfo + "'"); query.append(d_sql); } else{ 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 12842f50..d8dd9304 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 @@ -301,7 +301,6 @@ public class ReportHandler extends org.onap.portalsdk.analytics.RaptorObject { if (nvl(fmt.getFontSize()).length() > 0) { try { - // cellFont.setFontHeight((short) (Integer.parseInt(fmt.getFontSize()) / 0.05)); cellFont.setFontHeight((short) (FONT_SIZE / 0.05)); } catch (NumberFormatException e) { cellFont.setFontHeight((short) (FONT_SIZE / 0.05));// 10 @@ -360,7 +359,6 @@ public class ReportHandler extends org.onap.portalsdk.analytics.RaptorObject { styleValue.setBorderTop(BorderStyle.THIN); styleValue.setBorderLeft(BorderStyle.THIN); styleValue.setBorderRight(BorderStyle.THIN); - // styleValue.setFillForegroundColor(HSSFColor.YELLOW.index); styleValue.setFillPattern(fillPattern.NO_FILL); styleValue.setFont(fontDefault); XSSFCell cell = null; @@ -2220,9 +2218,6 @@ public class ReportHandler extends org.onap.portalsdk.analytics.RaptorObject { rowNum += 2; paintExcelFooter(wb, rowNum, col, sheet); } - // response.setContentType("application/vnd.ms-excel"); - // response.setHeader("Content-disposition", "attachment;filename=download_all_" - // + user_id + ".xls"); wb.write(xlsOut); xlsOut.flush(); } @@ -2790,7 +2785,6 @@ public class ReportHandler extends org.onap.portalsdk.analytics.RaptorObject { sheetRef = sheet.getPackagePart().getPartName().getName(); wb.write(os); os.flush(); - // wb = null; } } else { @@ -2807,11 +2801,9 @@ public class ReportHandler extends org.onap.portalsdk.analytics.RaptorObject { sheet.getPrintSetup().setLandscape(false); else sheet.getPrintSetup().setLandscape(true); - // sheet = wb.getSheet(getSheetName()); sheetRef = sheet.getPackagePart().getPartName().getName(); wb.write(os); os.flush(); - // wb = null; } } @@ -3402,7 +3394,6 @@ public class ReportHandler extends org.onap.portalsdk.analytics.RaptorObject { } if (requestFlag == 2 && !rDisplayContent) { - // System.out.println("In Request Flag "); request.getSession().setAttribute(AppConstants.SI_REPORT_RUNTIME, rr); rr.setParamValues(request, false, false); } else if (requestFlag == 1) { @@ -3598,7 +3589,6 @@ public class ReportHandler extends org.onap.portalsdk.analytics.RaptorObject { styleDefault.setBorderTop(BorderStyle.THIN); styleDefault.setBorderLeft(BorderStyle.THIN); styleDefault.setBorderRight(BorderStyle.THIN); - // styleDefault.setFillForegroundColor(HSSFColor.YELLOW.index); styleDefault.setFillPattern(fillPattern.NO_FILL); styleDefault.setFont(fontDefault); ArrayList semColumnList = new ArrayList(); @@ -3995,7 +3985,6 @@ public class ReportHandler extends org.onap.portalsdk.analytics.RaptorObject { .getIndex()); } } else { - // styleDefault.setDataFormat(HSSFDataFormat.getBuiltinFormat("#,##0.00")); String tempStr = value.trim(); if ((tempStr.indexOf(",")) != -1) { tempStr = tempStr.replaceAll(",", ""); @@ -4803,7 +4792,6 @@ public class ReportHandler extends org.onap.portalsdk.analytics.RaptorObject { styles.get(nvl(/* dv.getFormatId() */"", "date")).getIndex()); } else { - /* cell.getCellStyle().setDataFormat((short)0); */ if (styleRowCell != null) sw.createCell(cellNum, Utils.excelEncode(value), styleRowCell.getIndex()); else if (styleCell != null) @@ -5153,7 +5141,6 @@ public class ReportHandler extends org.onap.portalsdk.analytics.RaptorObject { if (!Globals.customizeFormFieldInfo() || customizedParamInfo.length() <= 0) { for (Iterator iter = paramsList.iterator(); iter.hasNext();) { IdNameValue value = (IdNameValue) iter.next(); - // System.out.println("\"" + value.getId() + " = " + value.getName() + "\""); if (nvl(value.getId()).trim().length() > 0 && (!nvl(value.getId()).trim().equals("BLANK"))) { paramSeq += 1; if (paramSeq <= 1) { @@ -5194,14 +5181,13 @@ public class ReportHandler extends org.onap.portalsdk.analytics.RaptorObject { for (int k = 0; k < p.size(); ++k) { if (p.get(k) instanceof Paragraph) s = ((Paragraph) p.get(k)).toString(); - else { /* if ((p.get(k) instanceof PdfPTable)) */ + else { pdfTable = ((PdfPTable) p.get(k)); } // todo: Logic for parsing pdfTable should be added after upgrading to iText 5.0.0 s = s.replaceAll(",", "|"); s = s.replaceAll("~", ","); if (s.indexOf(":") != -1) { - // System.out.println("|"+s+"|"); row = sheet.createRow(++rowNum); cell = row.createCell((short) 0); sheet.addMergedRegion(new CellRangeAddress(rowNum, rowNum, s1, s2)); @@ -5223,10 +5209,7 @@ public class ReportHandler extends org.onap.portalsdk.analytics.RaptorObject { value = st.nextToken(); if (nvl(value).endsWith("]")) value = nvl(value).substring(0, nvl(value).length() - 1); - } /* - * else if(name != null && name.length() > 0) { value = st.nextToken(); - * if(value.endsWith("]]"))value = value.substring(0, value.length()-1); } - */ + } if (name != null && name.trim().length() > 0) { row = sheet.createRow((short) ++rowNum); cellNum = 0; @@ -5237,7 +5220,6 @@ public class ReportHandler extends org.onap.portalsdk.analytics.RaptorObject { cell = row.createCell((short) cellNum); cell.setCellValue(value.trim()); cell.setCellStyle(styleValue); - // strBuf.append(name.trim()+": "+ value.trim()+"\n"); } /* * if(token.endsWith(":") && (value!=null && value.trim().length()<=0) && (name!=null && @@ -5252,7 +5234,6 @@ public class ReportHandler extends org.onap.portalsdk.analytics.RaptorObject { */ } int cw = 0; cw = name.trim().length() + 12; - // if(i!=cellWidth.size()-1) if (sheet.getColumnWidth((short) 0) < (short) name.trim().length()) sheet.setColumnWidth((short) 0, (short) name.trim().length()); if (sheet.getColumnWidth((short) 1) < (short) value.trim().length()) @@ -5431,7 +5412,6 @@ public class ReportHandler extends org.onap.portalsdk.analytics.RaptorObject { logger.error(EELFLoggerDelegate.errorLogger, "SQLException occured", ex); } } - // csvOut.flush(); } else { boolean firstPass = true; int numberOfColumns = 0; @@ -5446,7 +5426,6 @@ public class ReportHandler extends org.onap.portalsdk.analytics.RaptorObject { numberOfColumns++; csvOut.print("<TD bgColor=\"8F9381\">" + rhc.getColumnTitle() + "</TD>"); } - // csvOut.print(","); } // for for (chr.resetNext(); chr.hasNext();) { @@ -5455,8 +5434,6 @@ public class ReportHandler extends org.onap.portalsdk.analytics.RaptorObject { if (firstPass) numberOfColumns++; csvOut.print("<TD bgColor=\"8F9381\">" + ch.getColumnTitle() + "</TD>"); - // for (int i = 1; i < ch.getColSpan(); i++) - // csvOut.print(","); } } // for firstPass = false; @@ -5487,7 +5464,6 @@ public class ReportHandler extends org.onap.portalsdk.analytics.RaptorObject { csvOut.println("</TR>"); } // for - // csvOut.flush(); } else { csvOut.println("<TR><TD COLSPAN=\"" + numberOfColumns + "\">No Data Found</TD></TR>"); } diff --git a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/ReportLoader.java b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/ReportLoader.java index 687b9c4d..a92d5244 100644 --- a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/ReportLoader.java +++ b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/ReportLoader.java @@ -174,7 +174,6 @@ public class ReportLoader extends org.onap.portalsdk.analytics.RaptorObject { ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE)) { stmt.setInt(1, Integer.parseInt(reportID)); try (ResultSet rs = stmt.executeQuery()) { - // Writer out = null; /* * if(Globals.isWeblogicServer()) { java.sql.Clob clob = null; if (rs.next()) clob = rs.getClob(1); * else throw new RaptorException("Report " + reportID + NOT_FOUND_IN_DB); @@ -365,9 +364,6 @@ public class ReportLoader extends org.onap.portalsdk.analytics.RaptorObject { public static String getReportOwnerID(String reportID) throws RaptorException { - // String sql = "SELECT nvl(cr.owner_id, cr.create_id) owner FROM cr_report cr WHERE rep_id - // = ?"; - String sql = Globals.getTheReportOwnerId(); Connection connection = DbUtils.getConnection(); @@ -924,7 +920,6 @@ public class ReportLoader extends org.onap.portalsdk.analytics.RaptorObject { } public static String getTemplateFile(String reportId) throws RaptorException { - // String query = "select template_file from cr_report_template_map where report_id = " + reportId; String query = Globals.getTheTemplateFile(); query = query.replace("[reportId]", reportId); String templateFile = ""; diff --git a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/base/IdNameSql.java b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/base/IdNameSql.java index 1ef28a26..78c288ee 100644 --- a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/base/IdNameSql.java +++ b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/base/IdNameSql.java @@ -188,7 +188,6 @@ public class IdNameSql extends IdNameList { public void loadUserData(int pageNo, String searchString, String dbInfo, String userId) throws RaptorException { if(userId!=null) { String sql = Utils.replaceInString(getSql(), "[LOGGED_USERID]", userId); - //String defaultSQL = ""; if(defaultSQL!=null && (defaultSQL.trim().toLowerCase().startsWith("select")) ) { defaultSQL = Utils.replaceInString(getDefaultSQL(), "[LOGGED_USERID]", userId); setDefaultSQL(defaultSQL); @@ -339,7 +338,6 @@ public class IdNameSql extends IdNameList { } } else { - //pageNo = 0; if(pageNo!= -2) { queryPop = new StringBuffer(""); queryPop.append("SELECT count(*) num_rows FROM ("+ Globals.getReportSqlForFormfield() +" FROM (" + sql diff --git a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/base/ReportSecurity.java b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/base/ReportSecurity.java index 4e1ddb7e..5da6c563 100644 --- a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/base/ReportSecurity.java +++ b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/base/ReportSecurity.java @@ -108,7 +108,6 @@ public class ReportSecurity extends org.onap.portalsdk.analytics.RaptorObject { } catch (Exception e) { String eMsg = "ReportSecurity.ReportSecurity: Unable to load report record details. Exception: " + e.getMessage(); - //Log.write(eMsg); logger.debug(EELFLoggerDelegate.debugLogger, ("[EXCEPTION ENCOUNTERED IN RAPTOR] "+eMsg)); throw new RuntimeException(eMsg); } @@ -324,7 +323,6 @@ public class ReportSecurity extends org.onap.portalsdk.analytics.RaptorObject { if(userID == null) userID = AppUtils.getUserID(request); if(userID != null) { - //userID = AppUtils.getUserID(request); if (nvl(reportID).equals("-1")) return; diff --git a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/definition/DrillDownParamDef.java b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/definition/DrillDownParamDef.java index fc2184fc..97a87abb 100644 --- a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/definition/DrillDownParamDef.java +++ b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/definition/DrillDownParamDef.java @@ -106,24 +106,4 @@ public class DrillDownParamDef extends RaptorObject { return valFieldId; } - private void setFieldName(String fieldName) { - this.fieldName = fieldName; - } - - private void setValType(String valType) { - this.valType = valType; - } - - private void setValValue(String valValue) { - this.valValue = valValue; - } - - private void setValColId(String valColId) { - this.valColId = valColId; - } - - private void setValFieldId(String valFieldId) { - this.valFieldId = valFieldId; - } - } // DrillDownParamDef diff --git a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/definition/ReportSchedule.java b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/definition/ReportSchedule.java index d6a4fb47..4a5aa77e 100644 --- a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/definition/ReportSchedule.java +++ b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/definition/ReportSchedule.java @@ -571,12 +571,7 @@ public class ReportSchedule extends RaptorObject implements Serializable{ while(sql.indexOf(fieldDisplay) > 0) { re1 = Pattern.compile("(^[\r\n]|[\\s])AND(.*?[^\r\n]*)"+ "\\["+fft.getFieldName()+ "\\](.*?)\\s", Pattern.DOTALL); -/* posFormField = sql.indexOf(fieldDisplay); - posAnd = sql.lastIndexOf("and", posFormField); - if(posAnd < 0) posAnd = 0; - else if (posAnd > 2) posAnd = posAnd - 2; - matcher = re1.matcher(sql); -*/ + posFormField = sql.indexOf(fieldDisplay); int posSelectField = sql.lastIndexOf("SELECT ", posFormField); int whereField = sql.indexOf(" WHERE" , posSelectField); @@ -612,12 +607,7 @@ public class ReportSchedule extends RaptorObject implements Serializable{ if(index >= 0 && matcher.find(index-30)) { sql = sql.replace(matcher.group(), " WHERE 1=1 "); } - } /*else { - replaceValue = formatListValue("", Utils - .oracleSafe(nvl(paramValues.getParamValue(fieldId))), null, false, - true, null, paramValues.getParamBaseSQL(fieldId)); - sql = Utils.replaceInString(sql, fieldDisplay, replaceValue); - }*/ + } } } @@ -1162,11 +1152,6 @@ public class ReportSchedule extends RaptorObject implements Serializable{ int len = 0; char[] buffer = new char[512]; try(Reader in = new InputStreamReader(clob.getAsciiStream())) { - // if(obj instanceof oracle.sql.CLOB) { - // in = ((oracle.sql.CLOB) obj).getCharacterStream(); - // } else if (obj instanceof weblogic.jdbc.wrapper.Clob) { - // in = ((weblogic.jdbc.base.BaseClob) obj).getCharacterStream(); - // } while ((len = in.read(buffer)) != -1) sb.append(buffer, 0, len); } catch(Exception e) { @@ -1183,20 +1168,6 @@ public class ReportSchedule extends RaptorObject implements Serializable{ else throw new RaptorException("Schedule ID " + scheduleId + " not found in the database"); } else { - /*oracle.sql.CLOB clob = null; - if (rs.next()) - clob = (oracle.sql.CLOB) rs.getObject(1); - else - throw new RuntimeException("Schedule ID " + scheduleId + " not found in the database"); - int len = 0; - char[] buffer = new char[512]; - Reader in = null; - if(clob!=null) { - in = clob.getCharacterStream(); - while ((len = in.read(buffer)) != -1) - sb.append(buffer, 0, len); - in.close(); - }*/ throw new RaptorException("only maria db support for this "); } @@ -1210,7 +1181,6 @@ public class ReportSchedule extends RaptorObject implements Serializable{ condition_sql = ds.getString(0,0); } return condition_sql; - //throw new ReportSQLException (ex.getMessage(), ex.getCause()); } catch (RaptorException e) { DbUtils.rollbackTransaction(connection); throw e; @@ -1253,42 +1223,17 @@ public class ReportSchedule extends RaptorObject implements Serializable{ stmt.setString(1,scheduleId); rs = stmt.executeQuery(); Writer out = null; - /*if(Globals.isWeblogicServer()) { - java.sql.Clob clob = null; - if (rs.next()) - clob = rs.getClob(1); - else - throw new RuntimeException("Schedule ID " + scheduleId + " not found in the database"); - - if (clob.length() > conditional_sql.length()) - clob.truncate(0); - //clob.trim(reportXML.length()); - out = ((weblogic.jdbc.vendor.oracle.OracleThinClob)clob).getCharacterOutputStream(); - } else*/ if (Globals.isPostgreSQL() || Globals.isMySQL()) { if (rs.next()) { rs.updateString(1,conditional_sql); rs.updateRow(); - //sb.append(rs.getString(1)); } else throw new RaptorException("Schedule ID " + scheduleId + " not found in the database"); - } else {/* - oracle.sql.CLOB clob = null; - if (rs.next()) - clob = (oracle.sql.CLOB) rs.getObject(1); - else - throw new RuntimeException("Schedule ID " + scheduleId + " not found in the database"); - - if (clob.length() > conditional_sql.length()) - clob.trim(conditional_sql.length()); - out = clob.getCharacterOutputStream();*/ + } else { throw new RaptorException("only maria db support for this "); } - //out.write(conditional_sql); - //out.flush(); - //out.close(); } catch (RaptorException ex) { if(ex.getMessage().indexOf("invalid identifier")!= -1) { try { diff --git a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/runtime/ChartD3Helper.java b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/runtime/ChartD3Helper.java index dd063554..0934e35c 100644 --- a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/runtime/ChartD3Helper.java +++ b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/runtime/ChartD3Helper.java @@ -436,7 +436,7 @@ public class ChartD3Helper { } uniqueElement = (String)uniqueElements[j]; if(date==null) { - //continue; + //continue flagNoDate = 1; int pos = 0; for (int f=0 ; f< uniqueXAxisElements.length; f++) { @@ -461,7 +461,6 @@ public class ChartD3Helper { } catch (NumberFormatException ex1) { flagNull = 1; } - //flagNull = 1; } /* For Non-date type value enclose with double quotes */ @@ -506,7 +505,6 @@ public class ChartD3Helper { flagNull = 1; } - //flagNull = 1; } HashMap<String, String> dataMap = dataSeriesMap.get((String) uniqueElements[j]); if(logScale) { @@ -518,7 +516,6 @@ public class ChartD3Helper { } - //} } } for(int kI = 0; kI < uniqueElements.length; kI++) { @@ -544,7 +541,6 @@ public class ChartD3Helper { YAXISNUM = 0; YAXISDOUBLENUM = 0.0; flagNull= 0; - //flagSecondNull = 0; dateStr = ds.getString(i, 1); if(timeAxis) { date = getDateFromDateStr(dateStr); @@ -552,7 +548,7 @@ public class ChartD3Helper { } uniqueElement = (String)uniqueElements[j]; if(date==null) { - //continue; + //continue flagNoDate = 1; int pos = 0; for (int f=0 ; f< uniqueXAxisElements.length; f++) { @@ -579,7 +575,6 @@ public class ChartD3Helper { flagNull = 1; } - //flagNull = 1; } if(logScale) { @@ -631,7 +626,6 @@ public class ChartD3Helper { flagNull = 1; } - //flagNull = 1; } HashMap<String, String> dataMap = dataSeriesMap.get((String) uniqueElements[j]); @@ -727,19 +721,16 @@ public class ChartD3Helper { } if(timeAxis) { - //if(!barRealTimeAxis) { // false - non-time Object[] dateAllElements = (Object[]) sortSet.toArray(); for (int i = 0; i < uniqueElements.length; i++) { HashMap<String, String> dataMap = dataSeriesMap.get((String)uniqueElements[i]); for (int j=0; j<dateAllElements.length;j++) { - //if(strBuf.toString().indexOf((String) dateAllElements[j]) == -1) { if(!dataMap.containsKey((String) dateAllElements[j])) { dataMap.put((String) dateAllElements[j], "null"); } } } - //} } String valueStr = ""; for (int i = 0; i < uniqueElements.length; i++) { @@ -782,10 +773,8 @@ public class ChartD3Helper { wholeScript.append("nv.addGraph(function() { \n"); if(horizontalBar /*&& flagNoDate == 1*/) wholeScript.append(" chart = nv.models.multiBarHorizontalChart() \n"); - else /*if (flagNoDate == 1)*/ + else wholeScript.append(" chart = nv.models.multiBarChart() \n"); - /*else - wholeScript.append(" var chart = nv.models.multiBarTimeSeriesChart() \n");*/ wholeScript.append(" .margin({top: "+ topMargin +", right: "+ rightMargin +", bottom: "+ bottomMargin +", left: " + leftMargin +"}) \n"); if(showLegend) { @@ -797,7 +786,6 @@ public class ChartD3Helper { wholeScript.append(" .reduceXTicks(true) \n "); else if (!horizontalBar) { wholeScript.append(" .reduceXTicks(false) \n "); - //wholeScript.append(" chart.lines1.forceY(["+(nvl(reportRuntime.getRangeAxisLowerLimit()).length()<=0?"0":reportRuntime.getRangeAxisLowerLimit()) +", "+ (nvl(reportRuntime.getRangeAxisUpperLimit()).length()<=0?UPPER_RANGE:reportRuntime.getRangeAxisUpperLimit()) + "]); \n" + double UPPER_RANGE = 0; if(Math.ceil((MAXDOUBLENUM+(MAXDOUBLENUM*25/100))/100) * 100 >= 1) { UPPER_RANGE = Math.ceil(MAXDOUBLENUM+(MAXDOUBLENUM*25/100)); @@ -884,10 +872,7 @@ public class ChartD3Helper { } if(nvl(chartRightAxisLabel).length() > 0) { - //if(flagNoDate == 1) wholeScript.append(" chart.yAxis\n"); - //else - // wholeScript.append(" chart.yAxis1\n"); if(logScale) { wholeScript.append(" .logScale(true)\n "); } else { @@ -896,16 +881,10 @@ public class ChartD3Helper { wholeScript.append(" .axisLabel('" + chartLeftAxisLabel + "') \n" + " .tickFormat(d3.format(',.0f')); \n"); - /*" chart.yAxis2\n " + - " .axisLabel('" + chartRightAxisLabel + "') \n" + - " .tickFormat(d3.format(',.0f')); \n");*/ } else { - //if(flagNoDate == 1) wholeScript.append(" chart.yAxis\n"); - //else - // wholeScript.append(" chart.yAxis1\n"); if(logScale) { wholeScript.append(" .logScale(true)\n "); } else { @@ -921,7 +900,6 @@ public class ChartD3Helper { wholeScript.append(" .tickFormat(d3.format(',."+MAXNUMDECIMALPLACES+"f')); \n"); else wholeScript.append(" .tickFormat(d3.format(',." + precision + "f')); \n"); - //" .tickFormat(d3.format(',.0f')); \n"); } wholeScript.append(" d3.select('#chart"+reportRuntime.getReportID()+" svg') \n" + " .datum(historicalBarChart) \n" ); @@ -934,7 +912,6 @@ public class ChartD3Helper { "return chart; \n" + "}); \n"); wholeScript.append("function redraw() { \n"); - //wholeScript.append(" nv.utils.windowResize(chart.update); \n"); wholeScript.append(" d3.select('#chart"+reportRuntime.getReportID()+" svg') \n") ; wholeScript.append(" .datum(historicalBarChart) \n"); wholeScript.append(" .transition().duration(500) \n"); @@ -971,7 +948,6 @@ public class ChartD3Helper { int flag = 0; flag = hasCategoryAxis?1:0; String uniqueElements [] = null; - //TreeSet ts = new TreeSet(); ArrayList ts = new ArrayList<String>(); HashMap<String, String> columnMap = new HashMap(); //check timeAxis @@ -1020,7 +996,6 @@ public class ChartD3Helper { catStr.append("|"+color); } } catch (ArrayIndexOutOfBoundsException ex) { - //System.out.println("No Chart Color"); } if(catStr.length()>0) { @@ -1030,15 +1005,11 @@ public class ChartD3Helper { } } - //Object uniqueElements [] = ts.toArray(); - //SortedSet s = Collections.synchronizedSortedSet(ts); - //uniqueElements = (String[]) ts.toArray(); DataColumnType dct = null; List yTextSeries = reportRuntime.getChartDisplayNamesList(AppConstants.CHART_ALL_COLUMNS, formValues); if(yTextSeries.size()==1) { for (Iterator iter = l.iterator(); iter.hasNext();) { dct = (DataColumnType) iter.next(); - //System.out.println(dct.getDisplayName() + " " + yText); if(!(nvl(dct.getColOnChart()).equals(AppConstants.GC_LEGEND))) { if(nvl(chartLeftAxisLabel).length()<=0) { chartLeftAxisLabel = nvl(dct.getYAxis()); @@ -1054,11 +1025,9 @@ public class ChartD3Helper { DataColumnType dct = null; List yTextSeries = reportRuntime.getChartDisplayNamesList(AppConstants.CHART_ALL_COLUMNS, formValues); - //if(columnValuesList.size() == 1) { int dctIndex = 0; for (Iterator iter = l.iterator(); iter.hasNext();) { dct = (DataColumnType) iter.next(); - //System.out.println(dct.getDisplayName() + " " + yText); if(!(nvl(dct.getColOnChart()).equals(AppConstants.GC_LEGEND))) { if(yTextSeries.contains((String)dct.getDisplayName())) { if(nvl(dct.getChartColor()).length()>0) @@ -1096,10 +1065,8 @@ public class ChartD3Helper { } - //SortedSet s = Collections.synchronizedSortedSet(ts); Object tempArray[] = ts.toArray(); uniqueElements = Arrays.copyOf(tempArray, tempArray.length, String[].class); - //uniqueElements = (String[]) ts.toArray(); } @@ -1151,29 +1118,20 @@ public class ChartD3Helper { wholeScript.append("<script src=\""+ chartScriptsPath +"d3/js/d3.v3.min.js\"></script>\n"); wholeScript.append("<script src=\""+ chartScriptsPath +"d3/js/nv.d3.min.js\"></script> \n"); wholeScript.append("<script src=\""+ chartScriptsPath +"d3/js/models/axis.min.js\"></script> \n"); - //wholeScript.append("<script src=\""+ AppUtils.getBaseFolderURL() +"d3/js/models/cumulativeLineChart.js\"></script> \n"); - //if(multipleSeries) - //wholeScript.append("<script src=\""+ AppUtils.getBaseFolderURL() +"d3/js/models/multiChart.js\"></script> \n"); //json wholeScript.append("<script> \n"); wholeScript.append("historicalBarChart = [ \n"); - //wholeScript.append("{ \n"); ArrayList dataSeries = new ArrayList(); String uniqueElement = ""; String [] uniqueRevElements = null; //Added to make sure order appears same as legend - /*if(nvl(subType).length() > 0 && subType.equals("area")) { - uniqueRevElements = reverse((String[])uniqueElements); - } else {*/ uniqueRevElements = (String[])uniqueElements; - //} int RIGHTAXISSERIES = 0; for (int i = 0; i < uniqueRevElements.length; i++) { - //element.substring(element.indexOf("|")+1) uniqueElement = (String)uniqueRevElements[i]; if(multipleSeries && (nvl(chartRightAxisLabel).length() > 0)) { if(nvl(subType).length() > 0 && subType.equals("area")) { @@ -1188,7 +1146,6 @@ public class ChartD3Helper { dataSeries.add(new StringBuffer(" { \"type\":\"line\", \"key\": \""+ ((uniqueElement.indexOf("|") != -1)?uniqueElement.substring(0, uniqueElement.indexOf("|")):uniqueElement) +"\", \"yAxis\": \""+(1)+"\","+ (hasCustomizedChartColor && (uniqueElement.lastIndexOf("|") != -1) ?("\"color\": \""+uniqueElement.substring(uniqueElement.lastIndexOf("|")+1) + "\","):"")+" \"values\": [")); } RIGHTAXISSERIES = dataSeries.size()-1; - //dataSeries.add(new StringBuffer(" { \"type\":\"line\", \"key\": \""+ ((DataColumnType)columnMap.get(i)).getDisplayName() +"\", \"yAxis\": \""+(i+1)+"\", \"values\": [")); } else { dataSeries.add(new StringBuffer(" { \"type\":\"line\", \"key\": \""+ ((uniqueElement.indexOf("|")!= -1)?uniqueElement.substring(0, uniqueElement.indexOf("|")):uniqueElement) +"\", \"yAxis\": \""+(1)+"\","+ (hasCustomizedChartColor && (uniqueElement.lastIndexOf("|") != -1)?("\"color\": \""+uniqueElement.substring(uniqueElement.lastIndexOf("|")+1) + "\","):"")+"\"values\": [")); @@ -1222,10 +1179,6 @@ public class ChartD3Helper { if(date==null && timeAxis) continue; - - //if(ds.getString(i, 2).equals(uniqueElements[j])) { - //if(minTime > date.getTime()) - // minTime = date.getTime(); uniqueElement = (String)uniqueRevElements[j]; try { YAXISNUM = Integer.parseInt(ds.getString(i, columnMap.get(((hasCustomizedChartColor||nvl(chartRightAxisLabel).length()>0) && (uniqueElement.lastIndexOf("|") != -1)?uniqueElement.substring(0, uniqueElement.lastIndexOf("|")):uniqueElement)))); @@ -1291,16 +1244,12 @@ public class ChartD3Helper { date = getDateFromDateStr(dateStr); ((StringBuffer) dataSeries.get(j)).append ("{ \"x\":" + date.getTime() + " , \"y\":" + null +"}, "); } - //((StringBuffer) dataSeries.get(j)).append ("{ \"x\":" + date.getTime() + " , \"y\":" + null +"}, "); } } } - - - //} + } - //((StringBuffer) dataSeries.get(j)).append ("{ \"x\":" + minTime + " , \"y\":" + 0 +"}, "); } } else { @@ -1320,10 +1269,8 @@ public class ChartD3Helper { continue; uniqueElement = (String)uniqueRevElements[j]; - //date = MMDDYYYYFormat.parse(ds.getString(i, 1), new ParsePosition(0)); if(ds.getString(i, 2).equals(((hasCustomizedChartColor||nvl(chartRightAxisLabel).length()>0) && (uniqueElement.lastIndexOf("|") != -1) ?uniqueElement.substring(0, uniqueElement.lastIndexOf("|")):uniqueElement))) { - //if(minTime > date.getTime()) - // minTime = date.getTime(); + try { YAXISNUM = Integer.parseInt(ds.getString(i, 3)); if(MAXDOUBLENUM < YAXISNUM) @@ -1429,7 +1376,6 @@ public class ChartD3Helper { /* Sorting is commented out.*/ StringBuffer dateStrBuf = new StringBuffer(""); if(dateList.size()>0) { - //SortedSet<String> s = Collections.synchronizedSortedSet(dateList); Object[] dateElements = (Object[]) dateList.toArray(); String element = ""; @@ -1442,8 +1388,6 @@ public class ChartD3Helper { wholeScript.append(" var chart;\n"); wholeScript.append("nv.addGraph(function() { \n"); - //" var chart = nv.models.cumulativeLineChart() \n" + nv.models.lineWithFocusChart() -// " chart = nv.models.lineChart() \n" + if(nvl(subType).length() > 0 && subType.equals("area")) { wholeScript.append(" chart = nv.models.stackedAreaChart() \n"); if(showControls) { 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 268b20cc..797333cc 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 @@ -825,7 +825,6 @@ public class ChartJSONHelper { private String getColumnSelectStr(DataColumnType dc, HttpServletRequest request) { String colName = dc.getColName(); String paramValue = null; - //if (dc.isCalculated()) { if (reportRuntime.getFormFieldList() != null) { for (Iterator iter = reportRuntime.getFormFieldList().getFormField().iterator(); iter.hasNext();) { FormFieldType fft = (FormFieldType) iter.next(); @@ -835,8 +834,6 @@ public class ChartJSONHelper { formfield_value = AppUtils.getRequestNvlValue(request, fieldId); paramValue = nvl(formfield_value); if(paramValue.length()>0) { - /*sql = Utils.replaceInString(sql, "'" + fieldDisplay + "'", nvl( - paramValue, "NULL"));*/ colName = Utils.replaceInString(colName, "'" + fieldDisplay + "'", "'"+nvl( paramValue, "NULL")+"'"); colName = Utils.replaceInString(colName, fieldDisplay, nvl( @@ -844,8 +841,7 @@ public class ChartJSONHelper { } } return colName; - } - //} + } return colName; } // getColumnSelectStr @@ -873,7 +869,6 @@ public class ChartJSONHelper { colName = colName.trim(); colName = Utils.replaceInString(colName, "TO_CHAR", "to_char"); colName = Utils.replaceInString(colName, "to_number", "TO_NUMBER"); - //reportSQL = reportSQL.replaceAll("[\\s]*\\(", "("); colName = colName.replaceAll(",[\\s]*\\(", ",("); StringBuffer colNameBuf = new StringBuffer(colName); int pos = 0, posFormatStart = 0, posFormatEnd = 0; @@ -890,14 +885,11 @@ public class ChartJSONHelper { colNameBuf.insert(pos, " TO_NUMBER ( CR_RAPTOR.SAFE_TO_NUMBER ("); pos = colNameBuf.indexOf("to_char"); colNameBuf.replace(pos, pos+7, "TO_CHAR"); - //colName = Utils.replaceInString(colNameBuf.toString(), "to_char", " TO_NUMBER ( CR_RAPTOR.SAFE_TO_NUMBER ( TO_CHAR "); logger.debug(EELFLoggerDelegate.debugLogger, ("After adding to_number " + colNameBuf.toString())); - //posFormatStart = colNameBuf.lastIndexOf(",'")+1; posFormatStart = colNameBuf.indexOf(",'", pos)+1; posFormatEnd = colNameBuf.indexOf(")",posFormatStart); logger.debug(EELFLoggerDelegate.debugLogger, (posFormatStart + " " + posFormatEnd + " "+ pos)); format = colNameBuf.substring(posFormatStart, posFormatEnd); - //posFormatEnd = colNameBuf.indexOf(")",posFormatEnd); colNameBuf.insert(posFormatEnd+1, " ," + format + ") , "+ format + ")"); logger.debug(EELFLoggerDelegate.debugLogger, ("colNameBuf " + colNameBuf.toString())); } @@ -914,7 +906,6 @@ public class ChartJSONHelper { for (Iterator iter = reportCols.iterator(); iter.hasNext();) { flag = 0; DataColumnType dc = (DataColumnType) iter.next(); -// if(filter == 2 || filter == 1) { flag = reportRuntime.getDependsOnFormFieldFlag(dc, formValues); if( (dc.getChartSeq()!=null && dc.getChartSeq()> 0) && flag == 0 && !(nvl(dc.getColOnChart()).equals(AppConstants.GC_LEGEND))) { @@ -928,8 +919,6 @@ public class ChartJSONHelper { chartValueCols.add(dc); } else chartValueCols.add(dc); } -// } else -// chartValueCols.add(dc); } // for Collections.sort(chartValueCols, new ChartSeqComparator()); return chartValueCols; @@ -985,16 +974,6 @@ public class ChartJSONHelper { final int MILLISECFLAG = 7; final int DAYOFTHEWEEKFLAG = 8; final int FLAGDATE = 9; - /*int yearFlag = 1; - int monthFlag = 2; - int dayFlag = 3; - int hourFlag = 4; - int minFlag = 5; - int secFlag = 6; - int milliSecFlag = 7; - int dayoftheweekFlag = 8; - int flagDate = 10; - */ date = MMDDYYYYHHMMSSFormat.parse(dateStr, new ParsePosition(0)); if(date!=null) @@ -1010,7 +989,6 @@ public class ChartJSONHelper { formatFlag = MINFLAG; } if(date==null) { - //MMDDYYYYHHFormat.setTimeZone(TimeZone.getTimeZone("UTC")); date = MMDDYYYYHHFormat.parse(dateStr, new ParsePosition(0)); if(date!=null) formatFlag = HOURFLAG; @@ -1173,16 +1151,6 @@ public class ChartJSONHelper { final int MILLISECFLAG = 7; final int DAYOFTHEWEEKFLAG = 8; final int FLAGDATE = 9; - /*int yearFlag = 1; - int monthFlag = 2; - int dayFlag = 3; - int hourFlag = 4; - int minFlag = 5; - int secFlag = 6; - int milliSecFlag = 7; - int dayoftheweekFlag = 8; - int flagDate = 10; - */ date = MMDDYYYYHHMMSSFormat.parse(dateStr, new ParsePosition(0)); if(date!=null) @@ -1198,7 +1166,6 @@ public class ChartJSONHelper { formatFlag = MINFLAG; } if(date==null) { - //MMDDYYYYHHFormat.setTimeZone(TimeZone.getTimeZone("UTC")); date = MMDDYYYYHHFormat.parse(dateStr, new ParsePosition(0)); if(date!=null) formatFlag = HOURFLAG; @@ -1371,8 +1338,6 @@ public class ChartJSONHelper { private void clearReportRuntimeBackup(HttpServletRequest request) { - //Session sess = Sessions.getCurrent(true)getCurrent(); - //HttpSession session = (HttpSession)sess.getNativeSession(); HttpSession session = request.getSession(); session.removeAttribute(AppConstants.DRILLDOWN_REPORTS_LIST); request.removeAttribute(AppConstants.DRILLDOWN_INDEX); @@ -1477,8 +1442,6 @@ public class ChartJSONHelper { value.append(")"); } } - - //value = value.substring(0 , value.length()); valuesMap.put(fieldNameMap.get(formField), value.toString()); value = new StringBuffer(""); diff --git a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/util/HtmlStripper.java b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/util/HtmlStripper.java index 63a4f5f0..544f65e2 100644 --- a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/util/HtmlStripper.java +++ b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/util/HtmlStripper.java @@ -33,7 +33,7 @@ * * ============LICENSE_END============================================ * - * + * */ package org.onap.portalsdk.analytics.util; @@ -55,7 +55,6 @@ public class HtmlStripper extends RaptorObject// this function can be accessed p for (int i = 0; i < s.length(); i++) { // while c is not last character c = s.charAt(i); - //System.out.println("444 Character " + (char)c + " int " + c); if ((char) c == TXT_END_TAG) { // if char == '>' text following // it and not HTML tag @@ -64,17 +63,9 @@ public class HtmlStripper extends RaptorObject// this function can be accessed p // if char == '<' tag is // following not text inText = false; - } /*else if ((char)c == '\n') { - System.out.println("new line " + (char)c + " int " + c); - inText = false; - }*/ /*else if ((char) c == '&') { - // if char == '&' chars following - // are not text - inText = false; - }*/ + } else if (inText) { // if text write char to "text.txt" - //System.out.println("444444 Adding " + (char)c + " int " + c); if (c >= 32 && c <= 122) { if(c==32 || (c>32 && c<=47) || ( c>=58 && c<=64 )) { if (c == 45) { @@ -93,14 +84,10 @@ public class HtmlStripper extends RaptorObject// this function can be accessed p } } } - //System.out.println("\n\nFinished processing: " + s + "\n\n"); - //System.out.println("\n\nThe processed String : " + sbuf.toString() + "\n\n"); return sbuf.toString(); } public String stripHtml(String s) { - - //System.out.println("Starting to process: " + s + "\n\n"); // prints s = nvl(s); StringBuffer sbuf = new StringBuffer(); int c; @@ -116,14 +103,7 @@ public class HtmlStripper extends RaptorObject// this function can be accessed p // if char == '<' tag is // following not text inText = false; - } /*else if ((char)c == '\n') { - System.out.println("new line " + (char)c + " int " + c); - inText = false; - }*/ /*else if ((char) c == '&') { - // if char == '&' chars following - // are not text - inText = false; - }*/ + } else if (inText) { // if text write char to "text.txt" if (c >= 32 && c <= 122) { @@ -131,8 +111,6 @@ public class HtmlStripper extends RaptorObject// this function can be accessed p } } } - //System.out.println("\n\nFinished processing: " + s + "\n\n"); - //System.out.println("\n\nThe processed String : " + sbuf.toString() + "\n\n"); int pos = 0 ; while(sbuf.indexOf(" ")!=-1) { pos = sbuf.indexOf(" "); @@ -145,7 +123,6 @@ public class HtmlStripper extends RaptorObject// this function can be accessed p public String stripCSVHtml (String s) { String s1 = stripHtml(s); - //s1 = Utils.replaceInString(s1, "\"", "\"\""); s1 = s1.replaceAll("\"", "\"\""); return s1; } diff --git a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/util/RemDbInfo.java b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/util/RemDbInfo.java index 56e117f3..9d78b39a 100644 --- a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/util/RemDbInfo.java +++ b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/util/RemDbInfo.java @@ -63,7 +63,7 @@ public class RemDbInfo { Globals.getDbUtils(); ds = DbUtils.executeQuery(query); - String dbId = "", desc = "", dbType = "", connectionUrl = "", username = "", password = "", driver_class = ""; + String dbId = "", desc = "", dbType = "", connectionUrl = "", username = "", password = "", driver_class = ""; if(ds.getRowCount() > 0) { for (int i = 0; i < ds.getRowCount(); i++) { |