diff options
Diffstat (limited to 'ecomp-sdk')
4 files changed, 27 insertions, 27 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 7e76c46f..f76d58df 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 @@ -254,8 +254,8 @@ public class ActionHandler extends org.onap.portalsdk.analytics.RaptorObject { downloadLimit = Globals.getCSVDownloadLimit(); if(rr!=null && rr.getReportType().equals(AppConstants.RT_LINEAR)) { - String sql_whole = rr.getReportDataSQL(userId, downloadLimit, request); - request.setAttribute(AppConstants.RI_REPORT_SQL_WHOLE, sql_whole); + String sqlWhole = rr.getReportDataSQL(userId, downloadLimit, request); + request.setAttribute(AppConstants.RI_REPORT_SQL_WHOLE, sqlWhole); } else if(rr!=null && rr.getReportType().equals(AppConstants.RT_CROSSTAB)) { rd = rr.loadReportData(-1, userId, downloadLimit,request, false); /* TODO: should be changed to true */ request.getSession().setAttribute(AppConstants.RI_REPORT_DATA, rd); @@ -683,11 +683,11 @@ public class ActionHandler extends org.onap.portalsdk.analytics.RaptorObject { request.getSession().setAttribute(AppConstants.RI_REPORT_DATA, rd); //if (Globals.getMapAllowedYN().equals("Y") && !hideReportMap && (rr.getReportMap()!=null && rr.getReportMap().getLatColumn()!=null && rr.getReportMap().getLongColumn()!=null)) { if(rr!=null && rr.getReportType().equals(AppConstants.RT_LINEAR)) { - String sql_whole = rr.getReportDataSQL(userId, downloadLimit, request); - request.setAttribute(AppConstants.RI_REPORT_SQL_WHOLE, sql_whole); + String sqlWhole = rr.getReportDataSQL(userId, downloadLimit, request); + request.setAttribute(AppConstants.RI_REPORT_SQL_WHOLE, sqlWhole); } else if(rr.getReportType().equals(AppConstants.RT_HIVE)) { - String sql_whole = rr.getReportSQL(); - request.setAttribute(AppConstants.RI_REPORT_SQL_WHOLE, sql_whole); + String sqlWhole = rr.getReportSQL(); + request.setAttribute(AppConstants.RI_REPORT_SQL_WHOLE, sqlWhole); } if (!rr.getReportType().equals(AppConstants.RT_HIVE)) { long currentChartTime = System.currentTimeMillis(); diff --git a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/pdf/PageEvent.java b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/pdf/PageEvent.java index 5b8ae4db..59bbed32 100644 --- a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/pdf/PageEvent.java +++ b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/pdf/PageEvent.java @@ -69,8 +69,9 @@ class PageEvent extends PdfPageEventHelper { private PdfBean pb; private int pageNo = 0; - private int omit_page_count = 0; - private int DEFAULT_LOGO_SIZE = 100; + private int omitPageCount = 0; + private int defaultLogoSize = 100; + private static String nLogo = "<no logo>"; public PageEvent(PdfBean pb) { this.pb = pb; @@ -79,10 +80,10 @@ class PageEvent extends PdfPageEventHelper { private int getHowManyLogos(){ int howManyLogos = 0; - if(AppUtils.isNotEmpty(pb.getLogo1Url()) && !pb.getLogo1Url().equalsIgnoreCase("<no logo>")) + if(AppUtils.isNotEmpty(pb.getLogo1Url()) && !pb.getLogo1Url().equalsIgnoreCase(nLogo)) howManyLogos ++; - if(AppUtils.isNotEmpty(pb.getLogo2Url()) && !pb.getLogo2Url().equalsIgnoreCase("<no logo>")) + if(AppUtils.isNotEmpty(pb.getLogo2Url()) && !pb.getLogo2Url().equalsIgnoreCase(nLogo)) howManyLogos ++; return howManyLogos; @@ -121,16 +122,16 @@ class PageEvent extends PdfPageEventHelper { PdfPTable foot = new PdfPTable(widths); - if(AppUtils.isNotEmpty(pb.getLogo1Url()) && !pb.getLogo1Url().equalsIgnoreCase("<no logo>")) - addLogo(foot, font, pb.getLogo1Url().substring(pb.getLogo1Url().indexOf("|") + 1).trim(), Cell.ALIGN_LEFT, pb.getLogo1Size() == null ? DEFAULT_LOGO_SIZE : pb.getLogo1Size()); + if(AppUtils.isNotEmpty(pb.getLogo1Url()) && !pb.getLogo1Url().equalsIgnoreCase(nLogo)) + addLogo(foot, font, pb.getLogo1Url().substring(pb.getLogo1Url().indexOf("|") + 1).trim(), Cell.ALIGN_LEFT, pb.getLogo1Size() == null ? defaultLogoSize : pb.getLogo1Size()); PdfPCell spacingCell = new PdfPCell(); spacingCell.setBorderColor(Color.WHITE); foot.addCell(spacingCell); //Using logo1 size for now - use logo2 size if it is required to deal it separately. - if(AppUtils.isNotEmpty(pb.getLogo2Url()) && !pb.getLogo2Url().equalsIgnoreCase("<no logo>")) - addLogo(foot, font, pb.getLogo2Url().substring(pb.getLogo2Url().indexOf("|") + 1).trim(), Cell.ALIGN_RIGHT, pb.getLogo2Size() == null ? DEFAULT_LOGO_SIZE : pb.getLogo2Size()); + if(AppUtils.isNotEmpty(pb.getLogo2Url()) && !pb.getLogo2Url().equalsIgnoreCase(nLogo)) + addLogo(foot, font, pb.getLogo2Url().substring(pb.getLogo2Url().indexOf("|") + 1).trim(), Cell.ALIGN_RIGHT, pb.getLogo2Size() == null ? defaultLogoSize : pb.getLogo2Size()); foot.setTotalWidth(getPageWidth(document)); foot.writeSelectedRows(0, -1, 36, 600, writer.getDirectContent()); @@ -167,19 +168,19 @@ class PageEvent extends PdfPageEventHelper { pageNo++; PdfContentByte cb = writer.getDirectContent(); PdfDestination destination = new PdfDestination(PdfDestination.FITH); - String bookmark = "Data Page " + (pageNo - omit_page_count); + String bookmark = "Data Page " + (pageNo - omitPageCount); if (pageNo == 1) { if (pb.isCoverPageIncluded()) { bookmark = "Cover Page"; - omit_page_count++; + omitPageCount++; } else if (pb.isDisplayChart()) { bookmark = "Chart"; - omit_page_count++; + omitPageCount++; } } if (pageNo == 2 && pb.isCoverPageIncluded() && pb.isDisplayChart()) { bookmark = "Chart"; - omit_page_count++; + omitPageCount++; } PdfOutline outline = new PdfOutline(cb.getRootOutline(), destination, bookmark); diff --git a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/runtime/ReportFormFields.java b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/runtime/ReportFormFields.java index 02a3de4e..7bacd229 100644 --- a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/runtime/ReportFormFields.java +++ b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/runtime/ReportFormFields.java @@ -90,7 +90,7 @@ public class ReportFormFields extends Vector { //Calendar rangeEndDate = fft.getRangeEndDate().toGregorianCalendar(); String rangeStartDateSQL = fft.getRangeStartDateSQL(); String rangeEndDateSQL = fft.getRangeEndDateSQL(); - String user_id = AppUtils.getUserID(request); + String userId = AppUtils.getUserID(request); String multiSelectListSize = fft.getMultiSelectListSize(); //s_logger.debug("ranges are : " + fft.getRangeStartDate() + fft.getRangeEndDate()); @@ -122,9 +122,9 @@ public class ReportFormFields extends Vector { } // } } - fieldSQL = Utils.replaceInString(fieldSQL, "[USERID]", user_id); - fieldSQL = Utils.replaceInString(fieldSQL, "[USER_ID]", user_id); - fieldSQL = Utils.replaceInString(fieldSQL, "[LOGGED_USERID]", user_id); + fieldSQL = Utils.replaceInString(fieldSQL, "[USERID]", userId); + fieldSQL = Utils.replaceInString(fieldSQL, "[USER_ID]", userId); + fieldSQL = Utils.replaceInString(fieldSQL, "[LOGGED_USERID]", userId); } @@ -152,9 +152,9 @@ public class ReportFormFields extends Vector { fieldDefaultSQL = Utils.replaceInString(fieldDefaultSQL, "[" + sessionParameters[i].toUpperCase()+"]", (String)session.getAttribute(sessionParameters[i]) ); } - fieldDefaultSQL = Utils.replaceInString(fieldDefaultSQL, "[USERID]", user_id); - fieldDefaultSQL = Utils.replaceInString(fieldDefaultSQL, "[USER_ID]", user_id); - fieldDefaultSQL = Utils.replaceInString(fieldDefaultSQL, "[LOGGED_USERID]", user_id); + fieldDefaultSQL = Utils.replaceInString(fieldDefaultSQL, "[USERID]", userId); + fieldDefaultSQL = Utils.replaceInString(fieldDefaultSQL, "[USER_ID]", userId); + fieldDefaultSQL = Utils.replaceInString(fieldDefaultSQL, "[LOGGED_USERID]", userId); } //s_logger.debug("fieldSQL After" + fieldSQL); if(rangeStartDateSQL!=null) { diff --git a/ecomp-sdk/epsdk-app-common/src/main/java/org/onap/portalapp/controller/core/ProfileSearchController.java b/ecomp-sdk/epsdk-app-common/src/main/java/org/onap/portalapp/controller/core/ProfileSearchController.java index fdd26bab..ff80d413 100644 --- a/ecomp-sdk/epsdk-app-common/src/main/java/org/onap/portalapp/controller/core/ProfileSearchController.java +++ b/ecomp-sdk/epsdk-app-common/src/main/java/org/onap/portalapp/controller/core/ProfileSearchController.java @@ -56,7 +56,6 @@ import org.onap.portalsdk.core.domain.MenuData; import org.onap.portalsdk.core.domain.User; import org.onap.portalsdk.core.domain.UserApp; import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate; -import org.onap.portalsdk.core.onboarding.exception.PortalAPIException; import org.onap.portalsdk.core.service.FnMenuService; import org.onap.portalsdk.core.service.UserProfileService; import org.onap.portalsdk.core.service.UserService; @@ -134,7 +133,7 @@ public class ProfileSearchController extends RestrictedBaseController { model.put("profileList", mapper.writeValueAsString(profileFinalList)); JsonMessage msg = new JsonMessage(mapper.writeValueAsString(model)); JSONObject j = new JSONObject(msg); - response.setContentType("application/json"); + response.setContentType(APPLICATION_JSON); response.getWriter().write(j.toString()); } catch (Exception e) { logger.error(EELFLoggerDelegate.applicationLogger, "getUserPagination failed", e); |