summaryrefslogtreecommitdiffstats
path: root/ecomp-sdk/epsdk-analytics/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'ecomp-sdk/epsdk-analytics/src/main')
-rw-r--r--ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/AntBuild.java3
-rw-r--r--ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/config/ConfigLoader.java4
-rw-r--r--ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/controller/Action.java1
-rw-r--r--ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/controller/ActionHandler.java172
-rw-r--r--ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/controller/WizardSequence.java40
-rw-r--r--ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/controller/WizardSequenceCrossTab.java1
-rw-r--r--ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/controller/WizardSequenceDashboard.java1
-rw-r--r--ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/error/UserAccessException.java2
-rw-r--r--ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/gmap/map/ColorProperties.java26
-rw-r--r--ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/gmap/map/GMapProperties.java2
-rw-r--r--ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/gmap/map/MapConstant.java3
-rw-r--r--ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/gmap/map/NovaMap.java4
-rw-r--r--ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/gmap/map/layer/SwingLayer.java27
-rw-r--r--ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/runtime/ChartJSON.java116
-rw-r--r--ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/runtime/ChartJSONHelper.java79
-rw-r--r--ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/runtime/ChartWebRuntime.java34
-rw-r--r--ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/util/AppConstants.java2
-rw-r--r--ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/util/XSSFilter.java33
-rw-r--r--ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/view/ColumnHeader.java5
-rw-r--r--ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/view/ColumnHeaderRow.java4
-rw-r--r--ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/view/CrossTabColumnValues.java1
-rw-r--r--ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/view/DataValue.java2
-rw-r--r--ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/view/HtmlFormatter.java4
-rw-r--r--ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/view/ReportData.java45
24 files changed, 23 insertions, 588 deletions
diff --git a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/AntBuild.java b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/AntBuild.java
index 3e106ab9..7f1c7433 100644
--- a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/AntBuild.java
+++ b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/AntBuild.java
@@ -65,9 +65,6 @@ public class AntBuild {
URL manifestUrl = new URL("jar:" + classContainer + "!/META-INF/MANIFEST.MF");
Manifest manifest = new Manifest(manifestUrl.openStream());
- //JarFile jar = new JarFile("../lib/raptor_classes.jar");
- //Manifest manifest = jar.getManifest();
-
Attributes attribs = manifest.getMainAttributes();
Iterator it = attribs.entrySet().iterator();
while(it.hasNext()) {
diff --git a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/config/ConfigLoader.java b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/config/ConfigLoader.java
index a21400ca..de62b738 100644
--- a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/config/ConfigLoader.java
+++ b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/config/ConfigLoader.java
@@ -49,8 +49,6 @@ import org.onap.portalsdk.analytics.controller.ActionMapping;
import org.onap.portalsdk.analytics.util.Log;
public class ConfigLoader {
- // public static final String RAPTOR_ACTION_MAP =
- // "raptor_action_map.properties";
private static final String P_FILE_EXTENSION = ".properties";
@@ -189,8 +187,6 @@ public class ConfigLoader {
ActionMapping actionMapping = new ActionMapping();
String pLine = null;
- // BufferedReader pFile = new BufferedReader(new
- // InputStreamReader(servletContext.getResourceAsStream(internalFilesPath+RAPTOR_ACTION_MAP)));
BufferedReader pFile = new BufferedReader(new StringReader(raptorActionMapString));
while ((pLine = pFile.readLine()) != null)
if (pLine.trim().length() > 0)
diff --git a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/controller/Action.java b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/controller/Action.java
index a3a5c60f..81ed950b 100644
--- a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/controller/Action.java
+++ b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/controller/Action.java
@@ -63,7 +63,6 @@ public class Action extends org.onap.portalsdk.analytics.RaptorObject {
Action a = new Action();
StringTokenizer st = new StringTokenizer(configFileEntry, "| \t", false);
- // if(st.hasMoreTokens())
a.setAction(st.nextToken());
a.setControllerClass(st.nextToken());
a.setControllerMethod(st.nextToken());
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 0846efda..1cc75b5e 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
@@ -488,11 +488,9 @@ public class ActionHandler extends org.onap.portalsdk.analytics.RaptorObject {
request.getSession().setAttribute(AppConstants.SI_DASHBOARD_REP_ID, reportID);
// get dashboard HTML from report runtime. getListOfReportsFromDashBoardHTML
String strHTML = rr.getDashboardLayoutHTML();
- //System.out.println("StrHTML " + strHTML);
// call getListOfReportsFromDashBoardHTML returns HashMap
TreeMap treeMap = getListOfReportsFromDashBoardHTML(strHTML);
- //System.out.println("Size " + hashMap.size());
Set set = treeMap.entrySet();
String value = "";
@@ -566,30 +564,21 @@ public class ActionHandler extends org.onap.portalsdk.analytics.RaptorObject {
if(buildReportdata) {
reportDataMap.put(new Integer(entry.getKey().toString()), rd);
reportChartDataMap.put(new Integer(entry.getKey().toString()), ds);
- //reportDisplayTypeMap.put(new Integer(entry.getKey().toString()), entry.getValue().toString().substring(0,1));
}
}
- /*if(widthFlag ==1) request.getSession().setAttribute("extendedWidth", "Y");
- else request.getSession().removeAttribute("extendedWidth");
- if(heightFlag ==1) request.getSession().setAttribute("extendedHeight", "Y");
- else request.getSession().removeAttribute("extendedHeight");
- */
request.getSession().setAttribute(AppConstants.SI_DASHBOARD_REPORTRUNTIME_MAP, new TreeMap(reportsRuntimeMap));
request.getSession().setAttribute(AppConstants.SI_REPORT_RUNTIME, rr); //changing session to request
if(buildReportdata) {
request.getSession().setAttribute(AppConstants.SI_DASHBOARD_DISPLAYTYPE_MAP, new TreeMap(reportDisplayTypeMap));
request.getSession().setAttribute(AppConstants.SI_DASHBOARD_REPORTDATA_MAP, new TreeMap(reportDataMap));
request.getSession().setAttribute(AppConstants.SI_DASHBOARD_CHARTDATA_MAP, new TreeMap(reportChartDataMap));
- }
- //request.setAttribute(AppConstants.SI_REPORT_RUNTIME, rr1);
- //return nextPage;
+ }
} else {
// Ends
-// debugLogger.debug("Action Handler *****************" + new java.util.Date()+ " " + isGoBackAction);
ReportHandler rh = new ReportHandler();
//rr = null; // COMMENT THIS LINE
boolean resetParams = AppUtils.getRequestFlag(request,
@@ -608,42 +597,18 @@ public class ActionHandler extends org.onap.portalsdk.analytics.RaptorObject {
}
return nextPage;
}
-
- /*if (isGoBackAction) {
-// debugLogger.debug("Report back in action handler " + ((ReportRuntime) request.getSession().getAttribute(
-// AppConstants.SI_REPORT_RUN_BACKUP))!=null?((ReportRuntime) request.getSession().getAttribute(
-// AppConstants.SI_REPORT_RUN_BACKUP)).getReportID():((ReportRuntime) request.getSession().getAttribute(
-// AppConstants.SI_REPORT_RUN_BACKUP)));
- rr = null;
- rr = getReportRuntimeFromBackup(request);
- if (rr == null)
- throw new Exception("[ActionHandler.reportRun] Report backup not found");
- reportID = rr.getReportID();
- } else {*/
logger.debug(EELFLoggerDelegate.debugLogger, ("Ocurring during Schedule "));
//TODO differentiate Schedule with other actions
-// if(isEmailAttachment) {
-//
-// } else {
-//
-// }
+
rr = rh.loadReportRuntime(request, reportID);
//setParamValues called for Drilldown to display formfield
- //rr.setParamValues(request, false,true);
//} // else
ArrayList aL = (ArrayList)request.getSession().getAttribute(AppConstants.DRILLDOWN_REPORTS_LIST);
ReportRuntime aLR = null;
if(aL != null) {
-// for (int i = 1; i < aL.size(); i++) {
-// aLR = (ReportRuntime) aL.get(i);
-// if (!aLR.getReportID().equals(reportID)) {
-// request.setAttribute(AppConstants.RI_SHOW_BACK_BTN, "Y");
-// }
-// }
-// if(reportID.equals(reportIDFromSession)) {
aLR = (ReportRuntime) aL.get(0);
if (aLR!=null && !aLR.getReportID().equals(reportID)) {
request.setAttribute(AppConstants.RI_SHOW_BACK_BTN, "Y");
@@ -683,7 +648,6 @@ public class ActionHandler extends org.onap.portalsdk.analytics.RaptorObject {
String limit = nvl(request.getParameter("download_limit"),"1000");
downloadLimit = Integer.parseInt(limit);
}
- //if (action.startsWith("mobile")) rr.setPageSize(5);
long reportTime = System.currentTimeMillis();
if (!rr.getReportType().equals(AppConstants.RT_HIVE))
rd = rr.loadReportData(pageNo, userId, downloadLimit,request,false /*download*/);
@@ -692,12 +656,9 @@ public class ActionHandler extends org.onap.portalsdk.analytics.RaptorObject {
logger.debug(EELFLoggerDelegate.debugLogger, ("[DEBUG MESSAGE FROM RAPTOR] ------->Time Taken for the loading report data --- " + (System.currentTimeMillis() - reportTime)));
ReportData rd_whole = null;
boolean hideReportMap = rr.isDisplayOptionHideMap()||AppUtils.getRequestNvlValue(request, "noMap").equals("Y");
-/* if (Globals.getMapAllowedYN().equals("Y") && !hideReportMap && rr.getReportMap()!=null){
- rd_whole = rr.loadReportData(-1, userId, downloadLimit,request);
- }
-*/
+
+
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 sqlWhole = rr.getReportDataSQL(userId, downloadLimit, request);
request.setAttribute(AppConstants.RI_REPORT_SQL_WHOLE, sqlWhole);
@@ -742,7 +703,6 @@ public class ActionHandler extends org.onap.portalsdk.analytics.RaptorObject {
rr.logReportExecutionTime(userId, String.valueOf(totalTime),AppConstants.RLA_DOWNLOAD_TEXT, formFields);
} else {
- //rr.logReportRun(userId, String.valueOf(totalTime),formFields);
if(rd!=null && !action.equals("report.run.container"))
rr.logReportExecutionTime(userId, String.valueOf(totalTime),AppConstants.RLA_EXECUTION_TIME, formFields);
}
@@ -751,12 +711,6 @@ public class ActionHandler extends org.onap.portalsdk.analytics.RaptorObject {
rr.logReportExecutionTimeFromLogList(userId, String.valueOf(totalTime),formFields);
}
-/* if((String) request.getSession().getAttribute(AppConstants.SI_DASHBOARD_REP_ID)!=null) {
- reportID = (String) request.getSession().getAttribute(AppConstants.SI_DASHBOARD_REP_ID);
- ReportRuntime rrDash = rh1.loadReportRuntime(request, reportID, true, 1);
- request.getSession().setAttribute(AppConstants.SI_REPORT_RUNTIME, rrDash);
- }
-*/
if(rr.isDrillDownURLInPopupPresent()) {
request.getSession().setAttribute(PARENT+rr.getReportID()+"_rr", rr);
request.getSession().setAttribute(PARENT+rr.getReportID()+"_rd", rd);
@@ -798,8 +752,6 @@ public class ActionHandler extends org.onap.portalsdk.analytics.RaptorObject {
ReportJSONRuntime reportJSONRuntime = rr.createReportJSONRuntime(request, rd);
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 = "";
@@ -829,8 +781,6 @@ public class ActionHandler extends org.onap.portalsdk.analytics.RaptorObject {
errorJSONRuntime.setErrormessage(e.getMessage());
errorJSONRuntime.setStacktrace(getStackTrace(e));
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 = "";
@@ -853,8 +803,6 @@ public class ActionHandler extends org.onap.portalsdk.analytics.RaptorObject {
errorJSONRuntime.setErrormessage(ex.getMessage());
errorJSONRuntime.setStacktrace(getStackTrace(ex));
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 = "";
@@ -865,7 +813,6 @@ public class ActionHandler extends org.onap.portalsdk.analytics.RaptorObject {
}
return jsonInString;
}
- //nextPage = (new ErrorHandler()).processFatalError(request, e);
} catch (Exception t) {
logger.error(EELFLoggerDelegate.errorLogger,t.getMessage(), t);
@@ -879,8 +826,6 @@ public class ActionHandler extends org.onap.portalsdk.analytics.RaptorObject {
errorJSONRuntime.setErrormessage(t.toString());
errorJSONRuntime.setStacktrace(getStackTrace(t));
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 = "";
@@ -893,7 +838,6 @@ public class ActionHandler extends org.onap.portalsdk.analytics.RaptorObject {
return jsonInString;
}
- //return nextPage;
} // reportRun
public static String getStackTrace(Throwable aThrowable) {
@@ -1141,17 +1085,6 @@ public class ActionHandler extends org.onap.portalsdk.analytics.RaptorObject {
/****Remove Report Data from Session when Javascript throw error on onSubmit***/
public String removeReportDataFromSession (HttpServletRequest request, String nextPage) {
HttpSession session = request.getSession(false);
-/* if (session.getAttribute(AppConstants.RI_REPORT_DATA)!=null)
- request.getSession().removeAttribute(AppConstants.RI_REPORT_DATA);
- if (request.getAttribute(AppConstants.RI_REPORT_DATA)!=null)
- request.removeAttribute(AppConstants.RI_REPORT_DATA);
- if (session.getAttribute(AppConstants.RI_CHART_DATA)!=null)
- request.getSession().removeAttribute(AppConstants.RI_CHART_DATA);
- if (request.getAttribute(AppConstants.RI_CHART_DATA)!=null)
- request.removeAttribute(AppConstants.RI_CHART_DATA);
-*/ /*if (session.getAttribute(AppConstants.SI_REPORT_RUNTIME)!=null)
- request.getSession().removeAttribute(AppConstants.SI_REPORT_RUNTIME);*/
- //request.setAttribute(AppConstants.RI_RESET_ACTION, "Y");
return nextPage;
} // processScheduleDelete
@@ -1216,10 +1149,6 @@ public class ActionHandler extends org.onap.portalsdk.analytics.RaptorObject {
ReportDefinition rdef = (ReportDefinition) request.getSession().getAttribute(
AppConstants.SI_REPORT_DEFINITION);
WizardSequence ws = rdef.getWizardSequence();
- //debugLogger.debug("Step Count " + ws.getStepCount());
- //debugLogger.debug("Dashboard " + ((ws instanceof WizardSequenceDashboard) ? ws.getStepCount(): "Not a Dashboard"));
- //debugLogger.debug("GO TO STEP LENGTH " + goToStep.length());
- //debugLogger.debug("NumDash Cols in Action Handler " + AppUtils.getRequestNvlValue(request, "numDashCols"));
if (goToStep.length() > 0)
ws.performGoToStep(goToStep);
else
@@ -1236,7 +1165,6 @@ public class ActionHandler extends org.onap.portalsdk.analytics.RaptorObject {
} // reportWizard
public String refreshCache ( HttpServletRequest request, String nextPage ) {
- //DataCache.refreshReportTableSources();
removeVariablesFromSession(request);
DataCache.refreshAll();
Globals.getAppUtils().resetUserCache();
@@ -1249,8 +1177,6 @@ public class ActionHandler extends org.onap.portalsdk.analytics.RaptorObject {
ReportDefinition rdef = ReportDefinition.createBlank(request);
request.getSession().setAttribute(AppConstants.SI_REPORT_DEFINITION, rdef);
- // request.setAttribute(AppConstants.RI_CUR_STEP,
- // AppConstants.WS_DEFINITION);
DataCache.refreshReportTableSources();
request.getSession().removeAttribute("remoteDB");
} catch (RaptorException e) {
@@ -1293,8 +1219,6 @@ public class ActionHandler extends org.onap.portalsdk.analytics.RaptorObject {
rdef.getWizardSequence().performGoToStep(AppConstants.WS_DEFINITION);
request.getSession().setAttribute(AppConstants.SI_REPORT_DEFINITION, rdef);
- // request.setAttribute(AppConstants.RI_CUR_STEP,
- // AppConstants.WS_DEFINITION);
} catch (RaptorException e) {
nextPage = (new ErrorHandler()).processFatalError(request, e);
}
@@ -1325,12 +1249,10 @@ public class ActionHandler extends org.onap.portalsdk.analytics.RaptorObject {
ReportLoader.deleteReportRecord(reportID);
return "{\"deleted\":true}";
- //nextPage = reportSearchExecute(request, nextPage);
} catch (RaptorException e) {
nextPage = (new ErrorHandler()).processFatalError(request, e);
}
- //return nextPage;
return "{\"deleted\":false}";
} // reportDelete
@@ -1419,7 +1341,6 @@ public class ActionHandler extends org.onap.portalsdk.analytics.RaptorObject {
lookup = new IdNameSql(-1,SQL,lu.getDefaultSQL());
lookup.setOldSql(oldSQL);
}
- //lookup.loadData("0");
}
if(lookup instanceof IdNameSql) ((IdNameSql)lookup).setDataSizeUsedinPopup(-3); // -3 indicates to run the count sql for pagination.
}
@@ -1611,8 +1532,6 @@ public class ActionHandler extends org.onap.portalsdk.analytics.RaptorObject {
request.setAttribute("msg_align", " align=center");
request.setAttribute(AppConstants.RI_PAGE_TITLE, "Test Scheduler Condition");
- // request.setAttribute(AppConstants.RI_PAGE_SUBTITLE, ...);
- //String query = "SELECT 1 FROM DUAL WHERE EXISTS (" + sql + ")";
String query = Globals.getTestSchedCondPopup();
query = query.replace("[sql]", sql);
@@ -1622,13 +1541,6 @@ public class ActionHandler extends org.onap.portalsdk.analytics.RaptorObject {
String remoteDbPrefix = (remoteDb != null && !remoteDb.equalsIgnoreCase("null")) ? remoteDb
: rdef.getDBInfo();
ds = ConnectionUtils.getDataSet(sql, remoteDbPrefix);
- // if ( (remoteDbPrefix!=null) &&
- // (!remoteDbPrefix.equals(AppConstants.DB_LOCAL))) {
- // Globals.getRDbUtils().setDBPrefix(remoteDbPrefix);
- // ds = RemDbUtils.executeQuery(query);
- // }
- // else
- // ds = DbUtils.executeQuery(query);
if (ds.getRowCount() == 0)
request
.setAttribute(AppConstants.RI_FORMATTED_SQL,
@@ -1638,7 +1550,6 @@ public class ActionHandler extends org.onap.portalsdk.analytics.RaptorObject {
.setAttribute(AppConstants.RI_FORMATTED_SQL,
"<br><b>Condition satisfied</b> - email notification will be send.<br><br>");
} catch (Exception e) {
- // nextPage = (new ErrorHandler()).processFatalError(request, e);
request.setAttribute(AppConstants.RI_FORMATTED_SQL, "<br><b>SQL ERROR</b> "
+ e.getMessage() + "<br>Email notification will NOT be send.<br><br>");
}
@@ -1669,13 +1580,6 @@ public class ActionHandler extends org.onap.portalsdk.analytics.RaptorObject {
FormFieldType fft = (FormFieldType) iter.next();
String fieldId = fft.getFieldId();
String fieldDisplay = rdef.getFormFieldDisplayName(fft);
- /*
- * if(paramValues.isParameterMultiValue(fieldId))
- * generatedSQL = Utils.replaceInString(generatedSQL,
- * fieldDisplay, nvl(formatListValue((String)
- * paramValues.get(fieldId), null, false, false, null),
- * "NULL")); else
- */
sql = Utils.replaceInString(sql, fieldDisplay, "NULL");
} // for
} // if
@@ -1699,25 +1603,13 @@ public class ActionHandler extends org.onap.portalsdk.analytics.RaptorObject {
}
if(session != null ) {
for (int i = 0; i < sessionParameters.length; i++) {
- //if(!sessionParameters[i].startsWith("ff"))
- //sql = Utils.replaceInString(sql, "[" + sessionParameters[i].toUpperCase()+"]", (String)session.getAttribute(sessionParameters[i].toUpperCase()) );
- //else {
logger.debug(EELFLoggerDelegate.debugLogger, (" Session " + " sessionParameters[i] " + sessionParameters[i] + " " + (String)session.getAttribute(sessionParameters[i])));
sql = Utils.replaceInString(sql, "[" + sessionParameters[i].toUpperCase()+"]", (String)session.getAttribute(sessionParameters[i]) );
- //}
}
}
logger.debug(EELFLoggerDelegate.debugLogger, ("After testRunSQL " + sql));
ds = ConnectionUtils.getDataSet(sql, remoteDbPrefix, true);
- // if ( (remoteDbPrefix!=null) &&
- // (!remoteDbPrefix.equals(AppConstants.DB_LOCAL))) {
- // Globals.getRDbUtils().setDBPrefix(remoteDbPrefix);
- // ds = RemDbUtils.executeQuery(sql,
- // Globals.getDefaultPageSize()+1);
- // }
- // else
- // ds = DbUtils.executeQuery(sql, Globals.getDefaultPageSize()+1);
if (chkFormFieldSQL && ds.getRowCount() > 0) {
String id = ds.getString(0, "id");
String name = ds.getString(0, "name");
@@ -1783,12 +1675,6 @@ public class ActionHandler extends org.onap.portalsdk.analytics.RaptorObject {
if(isFromSchedule) {
String reportID = null;
String report_email_sent_log_id = AppUtils.getRequestValue(request, "log_id");
- /*String query = "Select user_id, rep_id from CR_REPORT_EMAIL_SENT_LOG" +
- " where rownum = 1" +
- " and gen_key='"+pdfAttachmentKey.trim()+"'" +
- " and log_id ="+report_email_sent_log_id.trim() +
- " and (sysdate - sent_date) < 1 ";*/
-
String query = Globals.getDownloadAllEmailSent();
query = query.replace("[pdfAttachmentKey.trim()]", pdfAttachmentKey.trim());
query = query.replace("[report_email_sent_log_id.trim()]", report_email_sent_log_id.trim());
@@ -1813,7 +1699,6 @@ public class ActionHandler extends org.onap.portalsdk.analytics.RaptorObject {
String d_sql = Globals.getDownloadAllGenKey();
d_sql = d_sql.replace("[pdfAttachmentKey]", pdfAttachmentKey);
- //ds = DbUtils.executeQuery("select schedule_id from cr_report_email_sent_log u where U.GEN_KEY = '"+ pdfAttachmentKey + "'");
ds = DbUtils.executeQuery(d_sql);
for (int i = 0; i < ds.getRowCount(); i++) {
@@ -1824,13 +1709,9 @@ public class ActionHandler extends org.onap.portalsdk.analytics.RaptorObject {
String fileName = FilenameUtils.normalize(rr.getReportID()+"_"+userId+"_"+timestamp);
boolean flag = false;
logger.debug(EELFLoggerDelegate.debugLogger, (""+Utils.isDownloadFileExists(rr.getReportID()+"_"+userId+"_"+dateStr)));
- // if(Utils.isDownloadFileExists(rr.getReportID()+"_"+userId+"_"+dateStr)) {
- // flag = true;
- // }
if(flag){
String strFileName = Utils.getLatestDownloadableFile(rr.getReportID()+"_"+userId+"_"+dateStr);
- //debugLogger.debug("File Name " + strFileName);
StringBuffer messageBuffer = new StringBuffer("");
messageBuffer.append("Download data file using the following link<BR>");
messageBuffer.append("<a href=\"" + request.getContextPath() + "/raptor/dwnld/data/" +
@@ -1867,8 +1748,6 @@ public class ActionHandler extends org.onap.portalsdk.analytics.RaptorObject {
logger.debug(EELFLoggerDelegate.debugLogger, ("************************"));
logger.debug(EELFLoggerDelegate.debugLogger, (rr.parseReportSQL(rr.getWholeSQL())));
xmlOut.println(rr.parseReportSQL(rr.getWholeSQL()));
- //xmlOut.println("******************");
- //xmlOut.println(rr.getWholeSQL());
xmlOut.flush();
xmlOut.close();
} catch (IOException e) {logger.error(EELFLoggerDelegate.errorLogger,e.getMessage(), e);}
@@ -1885,7 +1764,6 @@ public class ActionHandler extends org.onap.portalsdk.analytics.RaptorObject {
logger.debug(EELFLoggerDelegate.debugLogger, ("Command " + command));
Process downloadProcess = runtime.exec(command.toString());
logger.debug(EELFLoggerDelegate.debugLogger, ("Command Executed "));
- //Connection connection = DbUtils.getConnection();
Enumeration enum1 = rr.getParamKeys();
String value = "";
String paramStr = "";
@@ -1902,26 +1780,9 @@ public class ActionHandler extends org.onap.portalsdk.analytics.RaptorObject {
StringBuffer retrieveUserEmailQry = null;
ArrayList userEmailList = new ArrayList();
if(nvl(scheduleId).length()>0) {
- /*retrieveUserEmailQry = new StringBuffer();
- retrieveUserEmailQry.append(" SELECT ");
- retrieveUserEmailQry.append(" au.user_id ");
- retrieveUserEmailQry.append(" FROM ");
- retrieveUserEmailQry.append(" (SELECT rs.schedule_id, rs.rep_id FROM cr_report_schedule rs WHERE rs.enabled_yn='Y' AND rs.run_date IS NOT NULL ");
- retrieveUserEmailQry.append(" AND rs.schedule_id = " + scheduleId + " ) x, cr_report r, app_user au ");
- retrieveUserEmailQry.append(" WHERE ");
- retrieveUserEmailQry.append("x.rep_id = r.rep_id ");
- retrieveUserEmailQry.append(" AND au.user_id IN (SELECT rsu.user_id FROM cr_report_schedule_users rsu WHERE rsu.schedule_id = x.schedule_id and rsu.schedule_id = " + scheduleId );
- retrieveUserEmailQry.append(" UNION ");
- retrieveUserEmailQry.append(" SELECT ur.user_id FROM fn_user_role ur ");
- retrieveUserEmailQry.append(" WHERE ur.role_id IN ");
- retrieveUserEmailQry.append(" (SELECT rsu2.role_id FROM cr_report_schedule_users rsu2 ");
- retrieveUserEmailQry.append(" WHERE rsu2.schedule_id = x.schedule_id and ");
- retrieveUserEmailQry.append(" rsu2.schedule_id = "+ scheduleId + ")) ");*/
String r_sql = Globals.getDownloadAllRetrieve();
r_sql = r_sql.replace("[scheduleId]", scheduleId);
-
- // DataSet ds = DbUtils.executeQuery(retrieveUserEmailQry.toString());
DataSet ds = DbUtils.executeQuery(r_sql);
for (int i = 0; i < ds.getRowCount(); i++) {
@@ -1929,7 +1790,6 @@ public class ActionHandler extends org.onap.portalsdk.analytics.RaptorObject {
}
}
- // String insertQry = "insert into cr_report_dwnld_log (user_id,rep_id,file_name,dwnld_start_time,filter_params) values (?,?,?,?,?)";
String insertQry = Globals.getDownloadAllInsert();
@@ -1962,30 +1822,6 @@ public class ActionHandler extends org.onap.portalsdk.analytics.RaptorObject {
} catch (Exception ex) {
throw new RaptorException (ex);
}
- //DbUtils.commitTransaction(connection);
- //DbUtils.clearConnection(connection);
-
-
-
-// debugLogger.debug("|"+downloadProcess.toString() + "|");
-// if (downloadProcess == null)
-// throw new Exception("unable to create a process for command:" +
-// command);
-// int retCode= 1;
-// try {
-// retCode= downloadProcess.waitFor();
-// } catch (InterruptedException e){
-// e.printStackTrace();
-// }
-// debugLogger.debug("retCode " + retCode);
-// Process child = rtime.exec("/bin/bash");
-// BufferedWriter outCommand = new BufferedWriter(new
-// OutputStreamWriter(child.getOutputStream()));
-// outCommand.write(Globals.getShellScriptName());
-// outCommand.flush();
-// int retCode = child.waitFor();
-// debugLogger.debug("RetCode " + retCode);
- //request.setAttribute(MESSAGE, "Shell Script is running in the background. You'll get an email once it is done");
}
return nextPage;
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/model/runtime/ChartJSON.java b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/runtime/ChartJSON.java
index cbb06c77..f3066f96 100644
--- a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/runtime/ChartJSON.java
+++ b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/runtime/ChartJSON.java
@@ -33,7 +33,6 @@
*
* ============LICENSE_END============================================
*
- *
*/
package org.onap.portalsdk.analytics.model.runtime;
@@ -43,15 +42,7 @@ 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;
}
@@ -153,24 +144,6 @@ public class ChartJSON {
private String secondaryAxisLabel;
private String minRange;
private String maxRange;
- //private int topMargin;
- //private int bottomMargin;
- //private int leftMargin;
- //private int rightMargin;
-
- /*private boolean showMaxMin;
- private boolean showLegend;
- private boolean showControls;
- private String topMargin;
- private String bottomMargin;
- private String leftMargin;
- private String rightMargin;
- private String subType;
- private boolean stacked;
- private boolean horizontalBar;
- private boolean barRealTimeAxis;
- private boolean barReduceXAxisLabels;
- private boolean timeAxis;*/
public String getReportID() {
return reportID;
@@ -268,85 +241,7 @@ public class ChartJSON {
public void setShowTitle(boolean showTitle) {
this.showTitle = showTitle;
}
- /*public boolean isShowMaxMin() {
- return showMaxMin;
- }
- public void setShowMaxMin(boolean showMaxMin) {
- this.showMaxMin = showMaxMin;
- }
- public boolean isShowLegend() {
- return showLegend;
- }
- public void setShowLegend(boolean showLegend) {
- this.showLegend = showLegend;
- }
- public boolean isShowControls() {
- return showControls;
- }
- public void setShowControls(boolean showControls) {
- this.showControls = showControls;
- }
- public String getTopMargin() {
- return topMargin;
- }
- public void setTopMargin(String topMargin) {
- this.topMargin = topMargin;
- }
- public String getBottomMargin() {
- return bottomMargin;
- }
- public void setBottomMargin(String bottomMargin) {
- this.bottomMargin = bottomMargin;
- }
- public String getLeftMargin() {
- return leftMargin;
- }
- public void setLeftMargin(String leftMargin) {
- this.leftMargin = leftMargin;
- }
- public String getRightMargin() {
- return rightMargin;
- }
- public void setRightMargin(String rightMargin) {
- this.rightMargin = rightMargin;
- }
-
- public String getSubType() {
- return subType;
- }
- public void setSubType(String subType) {
- this.subType = subType;
- }
- public boolean isStacked() {
- return stacked;
- }
- public void setStacked(boolean stacked) {
- this.stacked = stacked;
- }
- public boolean isHorizontalBar() {
- return horizontalBar;
- }
- public void setHorizontalBar(boolean horizontalBar) {
- this.horizontalBar = horizontalBar;
- }
- public boolean isBarRealTimeAxis() {
- return barRealTimeAxis;
- }
- public void setBarRealTimeAxis(boolean barRealTimeAxis) {
- this.barRealTimeAxis = barRealTimeAxis;
- }
- public boolean isBarReduceXAxisLabels() {
- return barReduceXAxisLabels;
- }
- public void setBarReduceXAxisLabels(boolean barReduceXAxisLabels) {
- this.barReduceXAxisLabels = barReduceXAxisLabels;
- }
- public boolean isTimeAxis() {
- return timeAxis;
- }
- public void setTimeAxis(boolean timeAxis) {
- this.timeAxis = timeAxis;
- }*/
+
public ChartTypeJSON getChartTypeJSON() {
return chartTypeJSON;
}
@@ -398,12 +293,6 @@ public class ChartJSON {
public void setMaxRange(String maxRange) {
this.maxRange = maxRange;
}
- /*public ArrayList<Row> getRowList() {
- return rowList;
- }
- public void setRowList(ArrayList<Row> rowList) {
- this.rowList = rowList;
- }*/
public ArrayList<ArrayList<Row>> getWholeList() {
return wholeList;
@@ -411,8 +300,7 @@ public class ChartJSON {
public void setWholeList(ArrayList<ArrayList<Row>> wholeList) {
this.wholeList = wholeList;
}
- //private ArrayList<ColumnHeader> reportDataColumns;
- //private ArrayList<Map<String,Object>> reportDataRows;
+
public ArrayList<ChartColumnJSON> getChartColumnJSONList() {
return chartColumnJSONList;
}
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 0caca218..268b20cc 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
@@ -302,7 +302,6 @@ public class ChartJSONHelper {
public String generateJSON(ReportRuntime reportRuntime,Map<String, String> chartOptionsMap, HttpServletRequest request, boolean showData) throws RaptorException {
- //String width, String height, boolean animation, String rotateLabels, boolean staggerLabels, boolean showMaxMin, boolean showLegend, boolean showControls, String topMargin, String bottomMargin, boolean showTitle, String subType
String userId = AppUtils.getUserID(request);
String width = chartOptionsMap.get("width");
String height = chartOptionsMap.get("height");
@@ -343,7 +342,6 @@ public class ChartJSONHelper {
List l = reportRuntime.getAllColumns();
List lGroups = reportRuntime.getAllChartGroups();
HashMap mapYAxis = reportRuntime.getAllChartYAxis(reportRuntime.getReportParamValues());
- //ReportParamValues reportParamValues = reportRuntime.getReportParamValues();
String chartLeftAxisLabel = reportRuntime.getFormFieldFilled(nvl(reportRuntime.getChartLeftAxisLabel()));
String chartRightAxisLabel = reportRuntime.getFormFieldFilled(nvl(reportRuntime.getChartRightAxisLabel()));
@@ -391,7 +389,6 @@ public class ChartJSONHelper {
ds = ConnectionUtils.getDataSet(reportSQL, dbInfo);
}
} catch (RaptorException ex) {
- //throw new RaptorException("Error while loading chart data", ex);
logger.error(EELFLoggerDelegate.debugLogger, ("********************************************************************************"));
logger.error(EELFLoggerDelegate.debugLogger, (chartType.toUpperCase()+" - " + "Report ID : " + reportRuntime.getReportID() + " ERROR THROWN FOR GIVEN QUERY "));
logger.error(EELFLoggerDelegate.debugLogger, ("QUERY - " + reportRuntime.getWholeSQL()));
@@ -400,7 +397,6 @@ public class ChartJSONHelper {
}
if(ds==null) {
- //displayChart = false;
if(chartType.equals(AppConstants.GT_ANNOTATION_CHART))
ds = new DataSet();
else
@@ -468,19 +464,11 @@ public class ChartJSONHelper {
categoryAxisJSON.setValue(dct.getColId());
chartJSON.setCategoryAxisJSON(categoryAxisJSON);
}
- //allColumns
- //.add(new Item(dct.getColId(), dct.getDisplayName()));
}
- //chartJSON.setCategoryAxis(categoryAxis);
- //chartJSON.set
List<DataColumnType> chartValueCols = reportRuntime.getChartValueColumnsList(AppConstants.CHART_ALL_COLUMNS, null);
DataColumnType dct_RangeAxis = null;
- //int noChart = 0;
- //if(chartValueCols.size()<=0) {
- //chartValueCols.addAll(reportCols);
- //noChart = 1;
- //}
+
if(chartValueCols.size() <= 0) {
chartValueCols = reportCols;
}
@@ -617,8 +605,6 @@ public class ChartJSONHelper {
chartTypeJSON.setValue(chartType);
chartJSON.setChartTypeJSON(chartTypeJSON);
}
- //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 = "";
@@ -681,14 +667,10 @@ public class ChartJSONHelper {
//Add order by clause
Pattern re1 = Pattern.compile("(^[\r\n]*|([\\s]))[Oo][Rr][Dd][Ee][Rr](.*?[^\r\n]*)[Bb][Yy]",Pattern.DOTALL);
- //Pattern re1 = Pattern.compile("order(.*?[^\r\n]*)by", Pattern.DOTALL);
Matcher matcher = re1.matcher(reportSQL);
- //Pattern re1 = Pattern.compile("(^[\r\n]*|([\\s]))[Oo][Rr][Dd][Ee][Rr][Tt](.*?[^\r\n]*)[Bb][Yy]",Pattern.DOTALL);
- //int startPoint = sql.length()-30;
reportSQL = reportSQL + " ";
reportSQL = Pattern.compile("(^[\r\n]*|([\\s]))[Ss][Ee][Ll][Ee][Cc][Tt]([\r\n]*|[\\s]*)",Pattern.DOTALL).matcher(reportSQL).replaceAll(" SELECT ");
- //reportSQL = Pattern.compile("(^[\r\n]*|([\\s]))[Ff][Rr][Oo][Mm]([\r\n]*|[\\s]*)",Pattern.DOTALL).matcher(reportSQL).replaceAll(" FROM ");
reportSQL = Pattern.compile("(^[\r\n]*|([\\s]))[Ww][Hh][Ee][Rr][Ee]([\r\n]*|[\\s]*)",Pattern.DOTALL).matcher(reportSQL).replaceAll(" WHERE ");
reportSQL = Pattern.compile("(^[\r\n]*|([\\s]))[Ww][Hh][Ee][Nn]([\r\n]*|[\\s]*)",Pattern.DOTALL).matcher(reportSQL).replaceAll(" WHEN ");
reportSQL = Pattern.compile("(^[\r\n]*|([\\s]))[Aa][Nn][Dd]([\r\n]*|[\\s]*)",Pattern.DOTALL).matcher(reportSQL).replaceAll(" AND ");
@@ -724,13 +706,9 @@ public class ChartJSONHelper {
formfield_value = AppUtils.getRequestNvlValue(request, fieldId);
String paramValue = nvl(formfield_value);
if(paramValue.length()>0) {
- /*sql = Utils.replaceInString(sql, "'" + fieldDisplay + "'", nvl(
- paramValue, "NULL"));*/
reportSQL = Utils.replaceInString(reportSQL, fieldDisplay, nvl(
paramValue, "NULL"));
}
- /*sql = Utils.replaceInString(sql, "'" + fieldDisplay + "'", nvl(
- paramValue, "NULL"));*/
reportSQL = Utils.replaceInString(reportSQL, "'" + fieldDisplay + "'", nvl(
paramValue, "NULL"));
reportSQL = Utils.replaceInString(reportSQL, fieldDisplay , nvl(
@@ -739,7 +717,6 @@ public class ChartJSONHelper {
}
logger.debug(EELFLoggerDelegate.debugLogger, ("SQL " + reportSQL));
String legendCol = "1 a";
- // String valueCol = "1";
StringBuffer groupCol = new StringBuffer();
StringBuffer seriesCol = new StringBuffer();
StringBuffer valueCols = new StringBuffer();
@@ -749,8 +726,6 @@ public class ChartJSONHelper {
String colName = getColumnSelectStr(dc, request);
if (nvl(dc.getColOnChart()).equals(AppConstants.GC_LEGEND))
legendCol = getSelectExpr(dc, colName)+" " + dc.getColId();
- // if(dc.getChartSeq()>0)
- // valueCol = "NVL("+colName+", 0) "+dc.getColId();
if ((!nvl(dc.getColOnChart()).equals(AppConstants.GC_LEGEND))
&& (dc.getChartSeq()!=null && dc.getChartSeq().intValue() <= 0) && dc.isGroupBreak()) {
groupCol.append(", ");
@@ -760,18 +735,9 @@ public class ChartJSONHelper {
for (Iterator iter = reportCols.iterator(); iter.hasNext();) {
DataColumnType dc = (DataColumnType) iter.next();
if(dc.isChartSeries()!=null && dc.isChartSeries().booleanValue()) {
- //System.out.println("*****************, "+ " " +getColumnSelectStr(dc, paramValues)+ " "+ getSelectExpr(dc,getColumnSelectStr(dc, paramValues)));
seriesCol.append(", "+ getSelectExpr(dc,getColumnSelectStr(dc, request))+ " " + dc.getColId());
}
}
-
- /*for (Iterator iter = reportCols.iterator(); iter.hasNext();) {
- DataColumnType dc = (DataColumnType) iter.next();
- if(!dc.isChartSeries() && !(nvl(dc.getColOnChart()).equals(AppConstants.GC_LEGEND))) {
- //System.out.println("*****************, "+ " " +getColumnSelectStr(dc, paramValues)+ " "+ getSelectExpr(dc,getColumnSelectStr(dc, paramValues)));
- seriesCol.append(", "+ formatChartColumn(getSelectExpr(dc,getColumnSelectStr(dc, paramValues)))+ " " + dc.getColId());
- }
- }*/
for (Iterator iter = chartValueCols.iterator(); iter.hasNext();) {
DataColumnType dc = (DataColumnType) iter.next();
@@ -794,7 +760,6 @@ public class ChartJSONHelper {
seriesCol.append("," + (AppUtils.nvl(paramValue).length()>0? paramValue:"null") + " " + dc.getColId());
} else {
- //valueCols.append(", NVL(" + formatChartColumn(colName) + ",0) " + dc.getColId());
seriesCol.append("," + (AppUtils.nvl(paramValue).length()>0? paramValue:formatChartColumn(colName)) + " " + dc.getColId());
}
} // for
@@ -803,7 +768,6 @@ public class ChartJSONHelper {
DataColumnType dc = (DataColumnType) iter.next();
String colName = dc.getDisplayName();
String colValue = getColumnSelectStr(dc, request);
- //String colName = getColumnSelectStr(dc, formGrid);
if(colName.equals(AppConstants.RI_CHART_TOTAL_COL))
seriesCol.append(", " + AppConstants.RI_CHART_TOTAL_COL + " " + AppConstants.RI_CHART_TOTAL_COL );
if (colName.equals(AppConstants.RI_CHART_COLOR))
@@ -816,45 +780,14 @@ public class ChartJSONHelper {
seriesCol.append(", " + AppConstants.RI_CHART_MARKER_TEXT_LEFT + " " + AppConstants.RI_CHART_MARKER_TEXT_LEFT );
if(colName.equals(AppConstants.RI_CHART_MARKER_TEXT_RIGHT))
seriesCol.append(", " + AppConstants.RI_CHART_MARKER_TEXT_RIGHT + " " + AppConstants.RI_CHART_MARKER_TEXT_RIGHT );
- //if(colName.equals(AppConstants.RI_ANOMALY_TEXT))
- //seriesCol.append(", " + AppConstants.RI_ANOMALY_TEXT + " " + AppConstants.RI_ANOMALY_TEXT );
}
-
- //debugLogger.debug("ReportSQL Chart " + reportSQL );
- /*for (Iterator iter = chartValueCols.iterator(); iter.hasNext();) {
- DataColumnType dc = (DataColumnType) iter.next();
- String colName = getColumnSelectStr(dc, paramValues);
- //valueCols.append(", NVL(" + formatChartColumn(colName) + ",0) " + dc.getColId());
- valueCols.append("," + formatChartColumn(colName) + " " + dc.getColId());
- } // for
- for (Iterator iter = reportCols.iterator(); iter.hasNext();) {
- DataColumnType dc = (DataColumnType) iter.next();
- String colName = getColumnSelectStr(dc, paramValues);
- //if(colName.equals(AppConstants.RI_CHART_TOTAL_COL) || colName.equals(AppConstants.RI_CHART_COLOR)) {
- if(colName.equals(AppConstants.RI_CHART_TOTAL_COL))
- valueCols.append(", " + AppConstants.RI_CHART_TOTAL_COL + " " + AppConstants.RI_CHART_TOTAL_COL );
- if (colName.equals(AppConstants.RI_CHART_COLOR))
- valueCols.append(", " + AppConstants.RI_CHART_COLOR + " " + AppConstants.RI_CHART_COLOR );
- if (colName.equals(AppConstants.RI_CHART_INCLUDE))
- valueCols.append(", " + AppConstants.RI_CHART_INCLUDE + " " + AppConstants.RI_CHART_INCLUDE );
- //}
- }*/
+
String final_sql = "";
reportSQL = Utils.replaceInString(reportSQL, " from ", " FROM ");
reportSQL = Utils.replaceInString(reportSQL, " From ", " FROM ");
reportSQL = Utils.replaceInString(reportSQL, " select ", " SELECT ");
reportSQL = Utils.replaceInString(reportSQL, " union ", " UNION ");
- //reportSQL = reportSQL.replaceAll("[\\s]*\\(", "(");
-// if(reportSQL.indexOf("UNION") != -1) {
-// if(reportSQL.indexOf("FROM(")!=-1)
-// final_sql += " "+reportSQL.substring(reportSQL.indexOf("FROM(") );
-// else if (reportSQL.indexOf("FROM (")!=-1)
-// final_sql += " "+reportSQL.substring(reportSQL.indexOf("FROM (") );
-// //TODO ELSE THROW ERROR
-// }
-// else {
-// final_sql += " "+reportSQL.substring(reportSQL.toUpperCase().indexOf(" FROM "));
-// }
+
int pos = 0;
int pos_first_select = 0;
int pos_dup_select = 0;
@@ -863,11 +796,10 @@ public class ChartJSONHelper {
if (reportSQL.indexOf("FROM", pos)!=-1) {
pos = reportSQL.indexOf("FROM", pos);
pos_dup_select = reportSQL.lastIndexOf("SELECT",pos);
- pos_first_select = reportSQL.indexOf("SELECT");//,pos);
+ pos_first_select = reportSQL.indexOf("SELECT");
logger.debug(EELFLoggerDelegate.debugLogger, ("pos_select " + pos_first_select + " " + pos_dup_select));
if(pos_dup_select > pos_first_select) {
logger.debug(EELFLoggerDelegate.debugLogger, ("********pos_dup_select ********" + pos_dup_select));
- //pos_dup_select1 = pos_dup_select;
pos_prev_select = pos_first_select;
pos_last_select = pos_dup_select;
while (pos_last_select > pos_prev_select) {
@@ -891,9 +823,6 @@ public class ChartJSONHelper {
} // generateChartSQL
private String getColumnSelectStr(DataColumnType dc, HttpServletRequest request) {
- //String colName = dc.isCalculated() ? dc.getColName()
- // : ((nvl(dc.getTableId()).length() > 0) ? (dc.getTableId() + "." + dc
- // .getColName()) : dc.getColName());
String colName = dc.getColName();
String paramValue = null;
//if (dc.isCalculated()) {
diff --git a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/runtime/ChartWebRuntime.java b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/runtime/ChartWebRuntime.java
index d10cd1c4..63aef767 100644
--- a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/runtime/ChartWebRuntime.java
+++ b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/runtime/ChartWebRuntime.java
@@ -115,12 +115,8 @@ public class ChartWebRuntime implements Serializable {
logger.error(EELFLoggerDelegate.errorLogger, "RaptorException occurred in generateChart",ex);
}
List roleList = getRolesCommaSeperated(request);
- // final Map<String, Object> params = new HashMap<String, Object>();
params.put("user_id", user_id);
params.put("role_list", roleList);
- // params.put("public_yn", "Y");
-
- // String action = request.getParameter(AppConstants.RI_ACTION);
String reportID = AppUtils.getRequestValue(request, AppConstants.RI_REPORT_ID);
ReportHandler rh = new ReportHandler();
@@ -131,9 +127,6 @@ public class ChartWebRuntime implements Serializable {
if (rr.getReportType().equals(AppConstants.RT_HIVE)) {
String sql = rr.getReportSQL();
rr.setWholeSQL(sql);
- // if(genReportData)
- // reportData = rr.loadHiveLinearReportData(rr.getWholeSQL(),user_id.toString(),
- // 10000,request);
} else {
if (genReportData)
reportData = rr.loadReportData(0, user_id.toString(), 10000, request,
@@ -247,16 +240,6 @@ public class ChartWebRuntime implements Serializable {
? AppUtils.getRequestNvlValue(request, "precision")
: "2";
- /*
- * boolean animation = AppUtils.getRequestFlag(request, "animation"); boolean staggerLabels
- * = AppUtils.getRequestFlag(request, "staggerLabels"); boolean showMaxMin =
- * (showMaxMinStr.length()<=0)?false:Boolean.parseBoolean(showMaxMinStr); boolean
- * showControls = (showControlsStr.length()<=0)?true:Boolean.parseBoolean(showControlsStr);
- * boolean showLegend =
- * (showLegendStr.length()<=0)?true:Boolean.parseBoolean(showLegendStr); boolean showTitle =
- * (showTitleStr.length()<=0)?true:Boolean.parseBoolean(showTitleStr); boolean stacked =
- * (stackedStr.length()<=0)?true:Boolean.parseBoolean(stackedStr);
- */
// Add all options to Map
chartOptionsMap.put("width", width);
chartOptionsMap.put("height", height);
@@ -293,17 +276,12 @@ public class ChartWebRuntime implements Serializable {
reportRuntime.getChartType();
return drawD3Charts(chartOptionsMap, request);
- // drawD3Charts();
- } else /* if (action.equals("chart.json")) */ {
+ } else{
reportRuntime.getChartType();
return returnChartJSON(chartOptionsMap, request, showData);
- } /*
- * else {
- *
- * return ("Internal Error Occurred."); }
- */
+ }
}
@@ -441,14 +419,6 @@ public class ChartWebRuntime implements Serializable {
}
-
- /*
- * public void drawD3Charts(HashMap<String,String> chartOptionsMap) {
- * drawD3Charts(chartOptionsMap);
- *
- * }
- */
-
public String drawD3Charts(Map<String, String> chartOptionsMap, HttpServletRequest request) {
ChartD3Helper chartHelper = new ChartD3Helper(reportRuntime);
diff --git a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/util/AppConstants.java b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/util/AppConstants.java
index dc90de77..1806db77 100644
--- a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/util/AppConstants.java
+++ b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/util/AppConstants.java
@@ -6,7 +6,7 @@
* ===================================================================
*
* Unless otherwise specified, all software contained herein is licensed
- * under the Apache License, Version 2.0 (the "License");
+ * under the Apache License, Version 2.0 (the "License");
* you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
*
diff --git a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/util/XSSFilter.java b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/util/XSSFilter.java
index a1c8358a..f20b2116 100644
--- a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/util/XSSFilter.java
+++ b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/util/XSSFilter.java
@@ -43,26 +43,6 @@ package org.onap.portalsdk.analytics.util;
* This class is used to filter javascript tags to avoid XSS attacks.
*/
public class XSSFilter {
-
- // private static String[] filterChars = { "<", ">", "<", ">", "\"", "\\", "0x" };
-// private static String[] replacementChars = { " ", " ", " ", " ", "'", "/", "0 x" };
-
-/* public static synchronized String filterRequest(String param) {
- String value = param;
-
- if (param != null) {
-
- for (int i = 0; i < filterChars.length; i++) {
- value = filterCharacters(filterChars[i], replacementChars[i],
- value);
- }
-
- }
-
- return value;
-
- }
-*/
public static synchronized String filterRequestOnlyScript(String param) {
String value = "";
@@ -83,19 +63,6 @@ public class XSSFilter {
return value;
}
-
-// private static synchronized String filterCharacters(String originalChar, String newChar,
-// String param) {
-// StringBuffer sb = new StringBuffer(param);
-//
-// for (int position = param.toLowerCase().indexOf(originalChar); position >= 0;) {
-// sb.replace(position, position + originalChar.length(), newChar);
-// param = sb.toString();
-// position = param.toLowerCase().indexOf(originalChar);
-// }
-//
-// return sb.toString();
-// }
public static void main (String args[]) {
String value = XSSFilter.filterRequest("<s\nC\nr\nI\np\nT\n>\na\nl\ne\nr\nt\n('sundar');</SCRIPT>javascript:alert('Sundar');");
diff --git a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/view/ColumnHeader.java b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/view/ColumnHeader.java
index 1b56bdff..765ba3c5 100644
--- a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/view/ColumnHeader.java
+++ b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/view/ColumnHeader.java
@@ -97,11 +97,6 @@ public class ColumnHeader extends org.onap.portalsdk.analytics.RaptorObject impl
setColSpan(colSpan);
} // ColumnHeader
- //public ColumnHeader(String columnTitle, String columnWidth, int colSpan, String linkColId) {
- //this(columnTitle, columnWidth, colSpan);
- //setLinkColId(linkColId);
- //} // ColumnHeader
-
public ColumnHeader(String columnTitle, String columnWidth, String alignment, int colSpan, String linkColId) {
this(columnTitle, columnWidth, colSpan);
setAlignment(alignment);
diff --git a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/view/ColumnHeaderRow.java b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/view/ColumnHeaderRow.java
index 2f3a2cf1..f9b71ffa 100644
--- a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/view/ColumnHeaderRow.java
+++ b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/view/ColumnHeaderRow.java
@@ -101,10 +101,6 @@ public class ColumnHeaderRow extends Vector {
return (s == null) ? "" : s;
}
-// private String nvl(String s, String sDefault) {
-// return nvl(s).equals("") ? sDefault : s;
-// }
-
public String getAlignment() {
return alignment;
}
diff --git a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/view/CrossTabColumnValues.java b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/view/CrossTabColumnValues.java
index 4b94c8d4..9a017a8b 100644
--- a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/view/CrossTabColumnValues.java
+++ b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/view/CrossTabColumnValues.java
@@ -52,7 +52,6 @@ public class CrossTabColumnValues extends org.onap.portalsdk.analytics.RaptorObj
throws RaptorException {
this.colId = colId;
DataSet ds = ConnectionUtils.getDataSet(loadValuesSQL, dbInfo);
- // DataSet ds = DbUtils.executeQuery(loadValuesSQL);
columnValues = new Vector(ds.getRowCount());
for (int i = 0; i < ds.getRowCount(); i++)
columnValues.add(ds.getString(i, 0));
diff --git a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/view/DataValue.java b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/view/DataValue.java
index 401da422..e8c1993e 100644
--- a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/view/DataValue.java
+++ b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/view/DataValue.java
@@ -213,8 +213,6 @@ public class DataValue extends org.onap.portalsdk.analytics.RaptorObject impleme
return getDisplayValueHtml();
else
return getFormattedLink(getValueHtml());
- // return getFormattedValue("<a
- // href=\""+drillDownURL+"\">"+getValueHtml()+"</a>");
} // getDisplayValueLinkHtml
public String getAlignmentHtml() {
diff --git a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/view/HtmlFormatter.java b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/view/HtmlFormatter.java
index 7b5f548b..b1997a2b 100644
--- a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/view/HtmlFormatter.java
+++ b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/view/HtmlFormatter.java
@@ -157,8 +157,6 @@ public class HtmlFormatter extends RaptorObject {
sb.append("font-style:italic;");
if (isUnderline())
sb.append("text-decoration:underline;");
- // if(getBgColor().length()>0)
- // sb.append("background-color:"+getBgColor()+";");
if (getFontColor().length() > 0)
sb.append("color:" + getFontColor() + ";");
if (getFontFace().length() > 0)
@@ -207,8 +205,6 @@ public class HtmlFormatter extends RaptorObject {
sb.append("font-style:italic;");
if (isUnderline())
sb.append("text-decoration:underline;");
- // if(getBgColor().length()>0)
- // sb.append("background-color:"+getBgColor()+";");
if (getFontColor().length() > 0)
sb.append("color:" + getFontColor() + ";");
if (getFontFace().length() > 0)
diff --git a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/view/ReportData.java b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/view/ReportData.java
index fd87f4cb..a0c35e0c 100644
--- a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/view/ReportData.java
+++ b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/view/ReportData.java
@@ -157,11 +157,6 @@ public class ReportData extends org.onap.portalsdk.analytics.RaptorObject implem
r++;
} // for
-/* for (reportDataRows.resetNext(); reportDataRows.hasNext();) {
- DataRow dr = reportDataRows.getNext();
- dr.addDataValue(colIdx, new DataValue());
- } // for
- */
for(int j = 0; j < dataList.size(); j++) {
DataRow dr = (DataRow) dataList.get(j);
dr.addDataValue(colIdx, new DataValue());
@@ -183,11 +178,9 @@ public class ReportData extends org.onap.portalsdk.analytics.RaptorObject implem
try {
boolean nameFound = false;
- // String prevColName = null;
Vector prevColNames = new Vector();
int columnSort = -1;
for (int r = 0; r < colNameValues.size(); r++) {
- //String colName = (String) colNameValues.get(r);
String colName = ((DataValue) colNameValues.get(r)).getDisplayValue();
Integer colSortName = null;
if(colNameSortValues!=null)
@@ -266,9 +259,6 @@ public class ReportData extends org.onap.portalsdk.analytics.RaptorObject implem
for (c = 0; c < getDataColumnCount(); c++) {
dr.addDataValue(new DataValue());
}
-
- //reportDataRows.addDataRow(rowIdx, dr);
- //dr.setRowNum(dataList.size()==0?1:dataList.size());
dataList.add(rowIdx, dr);
} // insertRow
@@ -288,7 +278,6 @@ public class ReportData extends org.onap.portalsdk.analytics.RaptorObject implem
boolean nameFound = false;
Vector prevRowNames = new Vector();
for (int c = 0; c < rowNameValues.size(); c++) {
- //String rowName = (String) rowNameValues.get(c);
String rowName = ((DataValue) rowNameValues.get(c)).getDisplayValue();
RowHeaderCol rhc = reportRowHeaderCols.getRowHeaderCol(c);
@@ -341,7 +330,6 @@ public class ReportData extends org.onap.portalsdk.analytics.RaptorObject implem
int colIdx = findColumnIdx(colNameValues, colNameSortValues, crossTabOrderManager, true, dataList);
if ((rowIdx >= 0) && (colIdx >= 0)) {
- //DataRow dr = reportDataRows.getDataRow(rowIdx);
DataRow dr = (DataRow)dataList.get(rowIdx);
dr.setRowValues(rowNameValues);
dr.setDataValue(colIdx, value);
@@ -435,11 +423,9 @@ public class ReportData extends org.onap.portalsdk.analytics.RaptorObject implem
public void addRowNumbers(int pageNo, List dataList) {
pageNo = 0;
- //int startRowNum = ((pageNo < 0) ? 0 : pageNo) * pageSize + 1;
int startRowNum = 0;
RowHeaderCol rhc = new RowHeaderCol();
reportRowHeaderCols.addRowHeaderCol(0, rhc);
- //rhc.setColumnWidth("5%");
for (int r = 0; r < dataList.size(); r++) {
rhc.add(new RowHeader(startRowNum + r+""));
((DataRow)dataList.get(r)).setRowNum(r);
@@ -477,17 +463,13 @@ public class ReportData extends org.onap.portalsdk.analytics.RaptorObject implem
reportColumnHeaderRows.addColumnHeaderRow(chr);
chr.setRowHeight("30");
} // if
- /*ColumnHeader ch = new ColumnHeader(displayName, (displayWidth > 100) ? "10%" : (""
- + displayWidth + "%"), alignment, 1, isRuntimeColSortDisabled ? null : colId);
- */
+
ColumnHeader ch = new ColumnHeader(displayName, displayWidthInPxls, alignment, 1, isRuntimeColSortDisabled ? null : colId);
ch.setGroupLevel(level);
ch.setStartGroup(start);
ch.setColSpanGroup(colspan);
ch.setColId(colId);
ch.setSortable(sortable);
- //chr.addColumnHeader(new ColumnHeader(displayName, (displayWidth > 100) ? "10%" : (""
- // + displayWidth + "%"), 1, isRuntimeColSortDisabled ? null : colId));
if (displayName != "Hidden") {
@@ -529,7 +511,6 @@ public class ReportData extends org.onap.portalsdk.analytics.RaptorObject implem
} // for
int row = 0;
for (reportDataRows.resetNext(); reportDataRows.hasNext();) {
- //reportDataRows.getNext().getDataValue(colIdx).setVisible(newVisible);
DataRow dr = reportDataRows.getNext();
if(colIdx < dr.getDataValueList().size()) {
DataValue dv = dr.getDataValue(colIdx);
@@ -718,25 +699,16 @@ public class ReportData extends org.onap.portalsdk.analytics.RaptorObject implem
DataValue dataValue = new DataValue();
String totalValue = tVal.getTotalValue();
- // if(colDisplayTotal.length()>0&&(!
- // colDisplayTotal.equals(AppConstants.TOTAL_SUM_ID)))
- // totalValue =
- // nvl(AppConstants.TOTAL_FUNCTIONS.getNameById(colDisplayTotal))+":
- // "+totalValue;
dataValue.setDisplayValue(totalValue);
//added below statement for displaying in excel as number
dataValue.setDisplayTotal("SUM(");
dataValue.setAlignment(totalsAlignment);
dataValue.setBold(true);
totalsDataRow.setDataValue(colIdx, dataValue);
-
- //totalsDataRow.addDataValue(dataValue);
} // if
} // for
- //reportDataRows.addDataRow(totalsDataRow);
- //dr.setRowValues(rowNameValues);
Vector rowNameValues = new Vector();
for (int i=0; i < reportRowHeaderCols.size(); i++) {
if(i==0) {
@@ -745,9 +717,7 @@ public class ReportData extends org.onap.portalsdk.analytics.RaptorObject implem
dataValue.setAlignment("center");
dataValue.setDisplayValue("Total");
rowNameValues.add(dataValue);
- //rowNameValues.add("Total");
} else {
- //rowNameValues.add("");
DataValue dataValue = new DataValue();
dataValue.setDisplayValue("");
rowNameValues.add(dataValue);
@@ -757,7 +727,6 @@ public class ReportData extends org.onap.portalsdk.analytics.RaptorObject implem
totalsDataRow.setRowValues(rowNameValues);
totalsDataRow.setRowNum(dataList.size());
dataList.add(totalsDataRow);
- //reportRowHeaderCols.getNext().addRowHeader(new RowHeader("", "30", 1, 0));
} // setColumnDataTotalsCrossTab
public void setRowDataTotalsCrossTab(Vector rowDataTotals, String totalsAlignment,
@@ -792,11 +761,6 @@ public class ReportData extends org.onap.portalsdk.analytics.RaptorObject implem
DataValue dataValue = new DataValue();
String totalValue = tVal.getTotalValue();
- // if(rowDisplayTotal.length()>0&&(!
- // rowDisplayTotal.equals(AppConstants.TOTAL_SUM_ID)))
- // totalValue =
- // nvl(AppConstants.TOTAL_FUNCTIONS.getNameById(rowDisplayTotal))+":
- // "+totalValue;
dataValue.setDisplayValue(totalValue);
//added below statement for displaying in excel as number
dataValue.setDisplayTotal("SUM(");
@@ -813,20 +777,13 @@ public class ReportData extends org.onap.portalsdk.analytics.RaptorObject implem
String displayTotal, List dataList) {
DataValue dataValue = new DataValue();
- // if(displayTotal.length()>0&&(!
- // displayTotal.equals(AppConstants.TOTAL_SUM_ID)))
- // totalValue =
- // nvl(AppConstants.TOTAL_FUNCTIONS.getNameById(displayTotal))+":
- // "+totalValue;
dataValue.setDisplayValue(totalValue);
//added below statement for displaying in excel as number
dataValue.setDisplayTotal("SUM(");
dataValue.setAlignment(totalAlignment);
dataValue.setBold(true);
- //int colIdx = getDataColumnCount() - 1;
int rowIdx = getDataRowCount() - 1;
- //reportDataRows.getDataRow(rowIdx).getDataValueList().add(colIdx, dataValue);
DataRow dr = (DataRow)dataList.get(rowIdx);
dr.addDataValue(dr.getDataValueList().size(), dataValue);
} // setGrandTotalCrossTab