summaryrefslogtreecommitdiffstats
path: root/ecomp-sdk/epsdk-analytics
diff options
context:
space:
mode:
authorLorraine Welch <lb2391@att.com>2020-05-20 22:00:45 +0000
committerGerrit Code Review <gerrit@onap.org>2020-05-20 22:00:45 +0000
commitb2ea97adc19f8e1f5e1e869c42eda6e906fdb24a (patch)
tree3a8162c12979b1fdf4aadb7b9e0f640e96b867d2 /ecomp-sdk/epsdk-analytics
parentd17ef055f03f5957bf192fbdb464c21a402be9f1 (diff)
parenteaafe3611362288742ef9d2f12a551c72dfa3502 (diff)
Merge "smell removed in ReportformFields & ReportJSONRunt"
Diffstat (limited to 'ecomp-sdk/epsdk-analytics')
-rw-r--r--ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/runtime/ReportFormFields.java25
-rw-r--r--ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/runtime/ReportJSONRuntime.java36
2 files changed, 4 insertions, 57 deletions
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 7bacd229..e50d465e 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
@@ -86,15 +86,12 @@ public class ReportFormFields extends Vector {
String visible = nvl(fft.getVisible(),"Y");
String dependsOn = nvl(fft.getDependsOn(), "");
Calendar rangeStartDate = (fft.getRangeStartDate()==null)?null:fft.getRangeStartDate().toGregorianCalendar();
- Calendar rangeEndDate = (fft.getRangeEndDate()==null)?null:fft.getRangeEndDate().toGregorianCalendar();
- //Calendar rangeEndDate = fft.getRangeEndDate().toGregorianCalendar();
+ Calendar rangeEndDate = (fft.getRangeEndDate()==null)?null:fft.getRangeEndDate().toGregorianCalendar();
String rangeStartDateSQL = fft.getRangeStartDateSQL();
String rangeEndDateSQL = fft.getRangeEndDateSQL();
String userId = AppUtils.getUserID(request);
String multiSelectListSize = fft.getMultiSelectListSize();
-
- //s_logger.debug("ranges are : " + fft.getRangeStartDate() + fft.getRangeEndDate());
- //s_logger.debug("fieldSQL B4" + fieldSQL);
+
if(fieldSQL!=null) {
for (int i = 0; i < reqParameters.length; i++) {
if(!reqParameters[i].startsWith("ff") && (request.getParameter(reqParameters[i].toUpperCase())!=null && request.getParameter(reqParameters[i].toUpperCase()).length() > 0))
@@ -104,7 +101,6 @@ public class ReportFormFields extends Vector {
}
for (int i = 0; i < scheduleSessionParameters.length; i++) {
- //s_logger.debug(" Session " + " scheduleSessionParameters[i] " + scheduleSessionParameters[i].toUpperCase() + " " + request.getParameter(scheduleSessionParameters[i]));
if(request.getParameter(scheduleSessionParameters[i])!=null && request.getParameter(scheduleSessionParameters[i]).trim().length()>0 )
fieldSQL = Utils.replaceInString(fieldSQL, "[" + scheduleSessionParameters[i].toUpperCase()+"]", ESAPI.encoder().encodeForSQL( SecurityCodecUtil.getCodec(), request.getParameter(scheduleSessionParameters[i]) ));
if(request.getAttribute(scheduleSessionParameters[i])!=null && ((String)request.getAttribute(scheduleSessionParameters[i])).trim().length()>0 )
@@ -113,14 +109,9 @@ public class ReportFormFields extends Vector {
}
for (int i = 0; i < sessionParameters.length; i++) {
- //if(!sessionParameters[i].startsWith("ff"))
- //fieldSQL = Utils.replaceInString(fieldSQL, "[" + sessionParameters[i].toUpperCase()+"]", (String)session.getAttribute(sessionParameters[i].toUpperCase()) );
- //else {
if (session.getAttribute(sessionParameters[i])!=null && ((String)session.getAttribute(sessionParameters[i])).length() > 0) {
- //s_logger.debug(" Session " + " sessionParameters[i] " + sessionParameters[i] + " " + (String)session.getAttribute(sessionParameters[i]));
fieldSQL = Utils.replaceInString(fieldSQL, "[" + sessionParameters[i].toUpperCase()+"]", (String)session.getAttribute(sessionParameters[i]) );
}
- // }
}
fieldSQL = Utils.replaceInString(fieldSQL, "[USERID]", userId);
fieldSQL = Utils.replaceInString(fieldSQL, "[USER_ID]", userId);
@@ -136,7 +127,6 @@ public class ReportFormFields extends Vector {
fieldDefaultSQL = Utils.replaceInString(fieldDefaultSQL, "[" + reqParameters[i].toUpperCase()+"]", ESAPI.encoder().encodeForSQL( SecurityCodecUtil.getCodec(), request.getParameter(reqParameters[i]) ));
}
for (int i = 0; i < scheduleSessionParameters.length; i++) {
- //s_logger.debug(" Session " + " scheduleSessionParameters[i] " + scheduleSessionParameters[i].toUpperCase() + " " + request.getParameter(scheduleSessionParameters[i]));
if(request.getParameter(scheduleSessionParameters[i])!=null && request.getParameter(scheduleSessionParameters[i]).trim().length()>0 )
fieldDefaultSQL = Utils.replaceInString(fieldDefaultSQL, "[" + scheduleSessionParameters[i].toUpperCase()+"]", ESAPI.encoder().encodeForSQL( SecurityCodecUtil.getCodec(), request.getParameter(scheduleSessionParameters[i]) ));
if(request.getAttribute(scheduleSessionParameters[i])!=null && ((String)request.getAttribute(scheduleSessionParameters[i])).trim().length()>0 )
@@ -145,9 +135,6 @@ public class ReportFormFields extends Vector {
}
for (int i = 0; i < sessionParameters.length; i++) {
- //if(!sessionParameters[i].startsWith("ff"))
- //fieldDefaultSQL = Utils.replaceInString(fieldDefaultSQL, "[" + sessionParameters[i].toUpperCase()+"]", (String)session.getAttribute(sessionParameters[i].toUpperCase()) );
- //else
if (session.getAttribute(sessionParameters[i])!=null && ((String)session.getAttribute(sessionParameters[i])).length() > 0)
fieldDefaultSQL = Utils.replaceInString(fieldDefaultSQL, "[" + sessionParameters[i].toUpperCase()+"]", (String)session.getAttribute(sessionParameters[i]) );
}
@@ -156,7 +143,6 @@ public class ReportFormFields extends Vector {
fieldDefaultSQL = Utils.replaceInString(fieldDefaultSQL, "[USER_ID]", userId);
fieldDefaultSQL = Utils.replaceInString(fieldDefaultSQL, "[LOGGED_USERID]", userId);
}
- //s_logger.debug("fieldSQL After" + fieldSQL);
if(rangeStartDateSQL!=null) {
for (int i = 0; i < reqParameters.length; i++) {
if(!reqParameters[i].startsWith("ff") && (request.getParameter(reqParameters[i].toUpperCase())!=null && request.getParameter(reqParameters[i].toUpperCase()).length() > 0))
@@ -217,9 +203,8 @@ public class ReportFormFields extends Vector {
String lColFormat = null;
if (rw.getReportDefType().equals(AppConstants.RD_SQL_BASED)) {
String colId = nvl(fft.getColId());
- lTableName = ReportWrapper.getSQLBasedFFTColTableName(colId); // colId.substring(0,
- // colId.indexOf('.'));
- lColumnName = ReportWrapper.getSQLBasedFFTColColumnName(colId); // colId.substring(colId.lastIndexOf('.')+1);
+ lTableName = ReportWrapper.getSQLBasedFFTColTableName(colId);
+ lColumnName = ReportWrapper.getSQLBasedFFTColColumnName(colId);
lColumnType = AppConstants.CT_CHAR;
try {
lColumnType = nvl(DataCache.getReportTableDbColumnType(lTableName,
@@ -249,8 +234,6 @@ public class ReportFormFields extends Vector {
if (lColumnType.equals(AppConstants.CT_DATE))
selectVal = "TO_CHAR(" + selectVal + ", '"
+ AppConstants.DEFAULT_DATE_FORMAT + "')";
- // DataSet ds = DbUtils.executeQuery("SELECT
- // "+selectVal+" FROM "+lTableName);
DataSet ds = ConnectionUtils.getDataSet("SELECT " + selectVal
+ " FROM " + lTableName, rw.getDBInfo());
if (ds.getRowCount() > 0)
diff --git a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/runtime/ReportJSONRuntime.java b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/runtime/ReportJSONRuntime.java
index d3d44ac3..de5c892b 100644
--- a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/runtime/ReportJSONRuntime.java
+++ b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/runtime/ReportJSONRuntime.java
@@ -406,48 +406,12 @@ import org.onap.portalsdk.analytics.view.ColumnHeader;
}*/
-/*class Row {
- private String displayValue;
- private String dataType;
- private String colId;
- private boolean visible;
-
-
- public boolean isVisible() {
- return visible;
- }
- public void setVisible(boolean visible) {
- this.visible = visible;
- }
- public String getDisplayValue() {
- return displayValue;
- }
- public void setDisplayValue(String displayValue) {
- this.displayValue = displayValue;
- }
- public String getDataType() {
- return dataType;
- }
- public void setDataType(String dataType) {
- this.dataType = dataType;
- }
- public String getColId() {
- return colId;
- }
- public void setColId(String colId) {
- this.colId = colId;
- }
-
-
-}*/
class FormFieldJSON {
private String fieldId;
private String fieldDisplayName;
private String fieldType;
private String validationType;
private boolean required;
- //private String defaultValue;
-
private Calendar rangeStartDate;
private Calendar rangeEndDate;
private String multiSelectListSize;