summaryrefslogtreecommitdiffstats
path: root/ecomp-sdk/epsdk-analytics/src
diff options
context:
space:
mode:
Diffstat (limited to 'ecomp-sdk/epsdk-analytics/src')
-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/model/runtime/ChartD3Helper.java104
-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/view/ReportData.java45
9 files changed, 23 insertions, 535 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/model/runtime/ChartD3Helper.java b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/runtime/ChartD3Helper.java
index ff8094fd..dd063554 100644
--- a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/runtime/ChartD3Helper.java
+++ b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/runtime/ChartD3Helper.java
@@ -278,13 +278,11 @@ public class ChartD3Helper {
}
}
- //Object uniqueElements [] = ts.toArray();
- //SortedSet s = Collections.synchronizedSortedSet(ts);
uniqueElements = ts.toArray();
} else {
DataColumnType dct = null;
List yTextSeries = reportRuntime.getChartDisplayNamesList(AppConstants.CHART_ALL_COLUMNS, formValues);
- //if(columnValuesList.size() == 1) {
+
for (Iterator iter = l.iterator(); iter.hasNext();) {
dct = (DataColumnType) iter.next();
@@ -307,19 +305,10 @@ public class ChartD3Helper {
chartLeftAxisLabel = (chartLeftAxisLabel.indexOf("|")!=-1)?chartLeftAxisLabel.substring(0,chartLeftAxisLabel.indexOf("|")):"";
}
columnMap.put(dct.getDisplayName(), dct.getColId());
- /*
- ts.add(dct.getDisplayName());
- if(nvl(chartLeftAxisLabel).length()<=0) {
- chartLeftAxisLabel = nvl(dct.getYAxis());
- chartLeftAxisLabel = (chartLeftAxisLabel.indexOf("|")!=-1)?chartLeftAxisLabel.substring(0,chartLeftAxisLabel.indexOf("|")):"";
- }
- columnMap.put(dct.getDisplayName(), dct.getColId());
- */
}
}
}
- //SortedSet s = Collections.synchronizedSortedSet(ts);
uniqueElements = ts.toArray();
}
@@ -373,13 +362,10 @@ public class ChartD3Helper {
wholeScript.append("<script src=\""+ chartScriptsPath +"d3/js/tooltip.js\"></script> \n");
wholeScript.append("<script src=\""+ chartScriptsPath +"d3/js/utils.js\"></script> \n");
wholeScript.append("<script src=\""+ chartScriptsPath +"d3/js/models/axis.min.js\"></script> \n");
- //wholeScript.append("<script src=\""+ AppUtils.getBaseFolderURL() +"d3/js/models/discreteBar.js\"></script> \n");
- //wholeScript.append("<script src=\""+ AppUtils.getBaseFolderURL() +"d3/js/models/discreteBarChart.js\"></script> \n");
wholeScript.append("<script src=\""+ chartScriptsPath +"d3/js/models/multiChart.js\"></script> \n");
//json
wholeScript.append("<script> \n");
wholeScript.append("historicalBarChart = [ \n");
- //wholeScript.append("{ \n");
// data
ArrayList dataSeries = new ArrayList();
@@ -453,7 +439,6 @@ public class ChartD3Helper {
//continue;
flagNoDate = 1;
int pos = 0;
- //if(!((String)uniqueElementsList.get(i)).equals(dateStr)) {
for (int f=0 ; f< uniqueXAxisElements.length; f++) {
if(uniqueXAxisElements[f].equals(dateStr)){
pos = f ;
@@ -462,10 +447,9 @@ public class ChartD3Helper {
}
dateStrList.add("'"+dateStr+"'");
- //uniqueElement = (String)uniqueElements[j];
try {
YAXISNUM = Integer.parseInt(ds.getString(i, columnMap.get((hasCustomizedChartColor?(uniqueElement.indexOf("|")!=-1?uniqueElement.substring(0, uniqueElement.indexOf("|")):uniqueElement):uniqueElement))));
- //if(MAXNUM < YAXISNUM) MAXNUM = YAXISNUM;
+
if(MAXDOUBLENUM < YAXISNUM)
MAXDOUBLENUM = YAXISNUM;
} catch (NumberFormatException ex) {
@@ -571,7 +555,6 @@ public class ChartD3Helper {
//continue;
flagNoDate = 1;
int pos = 0;
- //if(!((String)uniqueElementsList.get(i)).equals(dateStr)) {
for (int f=0 ; f< uniqueXAxisElements.length; f++) {
if(uniqueXAxisElements[f].equals(dateStr)){
pos = f ;
@@ -622,7 +605,6 @@ public class ChartD3Helper {
}
dataSeriesOverAllMap.put(uniqueElements[j], dataSeriesStrMap);
} else {
- //date = MMDDYYYYFormat.parse(ds.getString(i, 1), new ParsePosition(0));
if(!barRealTimeAxis) { // true - non-time
if(!dateStrList.contains(new Long(date.getTime()).toString())) {
dateStrList.add(new Long(date.getTime()).toString());
@@ -652,8 +634,6 @@ public class ChartD3Helper {
//flagNull = 1;
}
- //if(ds.getString(i, 2).equals(uniqueElements[j])) {
- // dateStrList.add("'"+dateStr+"'");
HashMap<String, String> dataMap = dataSeriesMap.get((String) uniqueElements[j]);
if(logScale) {
dataMap.put(date.getTime()+"", (flagNull == 0 ? (YAXISDOUBLENUM>0?new Double(Math.log10(YAXISDOUBLENUM)).toString():new Double(Math.log10(new Double(YAXISNUM>0?YAXISNUM:1).doubleValue())).toString()): "null"));
@@ -662,9 +642,7 @@ public class ChartD3Helper {
dataMap.remove(date.getTime());
}
dataMap.put(date.getTime()+"", (flagNull == 0 ? (YAXISDOUBLENUM>0?new Double(YAXISDOUBLENUM).toString():new Integer(YAXISNUM).toString()): "null"));
- //System.out
- // .println(dataMap + " " + dataSeriesMap);
- //}
+
}
} else if (AppUtils.nvl(ds.getString(i, 2)).length()<=0) {
@@ -681,7 +659,6 @@ public class ChartD3Helper {
}
}
}
- // dataSeriesOverAllMap.put(uniqueElements[j], dataSeriesMap);
}
}
@@ -719,19 +696,13 @@ public class ChartD3Helper {
Long endDate = Long.parseLong((String) dateElements[dateElements.length-1]);
java.util.Date date1 = null;
//first value
- date1 = new java.util.Date(initialDate.longValue());
- /* DateFormat formatter = new SimpleDateFormat("MM/dd/yyyy HH:mm:ss Z");
- System.out.println(formatter.format(new java.util.Date(initialDate.longValue())));
- */ //initialDate = initialDate + HOUR;
-
+ date1 = new java.util.Date(initialDate.longValue());
dateStrBuf.append(initialDate+",");
sortSet.add(""+initialDate);
// DateUtils.
while ( initialDate <= endDate) {
- //System.out.println("********** " + df.format(initialDate));
- //date1 = new java.util.Date(initialDate.longValue() * 1000);
date1 = new java.util.Date(initialDate.longValue());
if(formatFlag==HOURFLAG)
date1 = DateUtils.addHours(date1, 1);
@@ -749,13 +720,7 @@ public class ChartD3Helper {
dateStrBuf.append(initialDate+",");
sortSet.add(""+initialDate);
}
- //DateUtils.addHours(date1, 1);
- }
- //DateFormat df = DateFormat.getDateTimeInstance(DateFormat.FULL, DateFormat.FULL);
- //df.setTimeZone(TimeZone.getTimeZone("UTC"));
- //java.util.Date date1 = new java.util.Date(initialDate.longValue() * 1000);
- //java.util.Date d = df.
- //for ()
+ }
}
}
dateStrBuf.deleteCharAt(dateStrBuf.length()-1);
@@ -1230,16 +1195,7 @@ public class ChartD3Helper {
}
}
- /*StringBuffer dataSeries1 = new StringBuffer("");
- dataSeries1.append(" { key: \"Series1\",values: [");
- StringBuffer dataSeries2 = new StringBuffer("");
- dataSeries2.append(" { key: \"Series2\", values: [");
- StringBuffer dataSeries3 = new StringBuffer("");
- dataSeries3.append(" { key: \"Series3\", values: [");
- */
-
- //long minTime = 1000000000000000L;
int MAXNUM = 0;
double MAXDOUBLENUM = 0.0;
int YAXISNUM = 0;
@@ -1449,17 +1405,9 @@ public class ChartD3Helper {
}
}
- // ((StringBuffer) dataSeries.get(j)).append ("{ \"x\":" + minTime + " , \"y\":" + 0 +"}, ");
}
-/* if(ds.getString(i, 2).equals("Series1")) {
- dataSeries1.append("[ " + date.getTime() + " , " + ds.getString(i, 3) +"], ");
- } else if (ds.getString(i, 2).equals("Series2")) {
- dataSeries2.append("[ " + date.getTime() + " , " + ds.getString(i, 3) +"], ");
- } else if (ds.getString(i, 2).equals("Series3")) {
- dataSeries3.append("[ " + date.getTime() + " , " + ds.getString(i, 3) +"], ");
- }
-*/ }
+ }
for (int i = 0; i < uniqueRevElements.length; i++) {
StringBuffer strBuf = ((StringBuffer) dataSeries.get(i));
@@ -1475,10 +1423,8 @@ public class ChartD3Helper {
for (int i = 0; i < uniqueRevElements.length; i++) {
wholeScript.append((StringBuffer)dataSeries.get(i));
}
-/* wholeScript.append(dataSeries1);
- wholeScript.append(dataSeries2);
- wholeScript.append(dataSeries3);
-*/ wholeScript.append("];\n");
+
+ wholeScript.append("];\n");
/* Sorting is commented out.*/
StringBuffer dateStrBuf = new StringBuffer("");
@@ -1911,12 +1857,7 @@ public class ChartD3Helper {
columnValues.add(AppUtils.nvls(ds.getString(i, columnIndex), "null"));
}
}
-/* actual = ds.getString(i, "actual");
- //forecast = ds.getString(i, "forecast");
- upperBound = ds.getString(i, "upperBound");
- lowerBound = ds.getString(i, "lowerBound");
-
-*/ if(!timeCharts)
+ if(!timeCharts)
anomalyText = ds.getString(i, "anomaly_text");
//dataStrBuf.append(" [new Date(moment(\""+dateStr+"\")),"+ actual /*+","+ forecast*/+","+ lowerBound +","+ upperBound +"],\n");
dataStrBuf.append(" [new Date(moment(\""+dateStr+"\"))");
@@ -1952,9 +1893,7 @@ public class ChartD3Helper {
}
}
-
- //if(!timeCharts)
- //anomalyRec = anomalyRec - 1;
+
minDate = maxDate - (new Long(reportRuntime.getZoomIn()).longValue()*60*60*1000);
System.out.println(new java.util.Date(maxDate) + " " + new java.util.Date(minDate) + " " + reportRuntime.getZoomIn());
@@ -1965,7 +1904,6 @@ public class ChartD3Helper {
wholeScript.append("<!DOCTYPE html>\n");
wholeScript.append("<html>\n");
wholeScript.append(" <head>\n");
- //wholeScript.append("<meta http-equiv=\"X-UA-Compatible\" content=\"IE=EmulateIE7; IE=EmulateIE9\">\n");
wholeScript.append("<meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\" />\n");
wholeScript.append("<script type=\"text/javascript\" src=\""+ chartScriptsPath +"dy3/js/dygraph-combined.js\"></script>\n");
wholeScript.append("<script type=\"text/javascript\" src=\""+ chartScriptsPath +"dy3/js/moment.min.js\"></script>\n");
@@ -2185,8 +2123,6 @@ public class ChartD3Helper {
if(!timeCharts) {
wholeScript.append(" function nameAnnotation(ann) { \n");
wholeScript.append(" return ann.shortText; \n");
- //wholeScript.append(" var m = moment(ann.x);\n");
- //wholeScript.append(" return \"(\" + ann.series + \", \" + m.format(\"YYYY-MM-DD HH\"); + \")\"; \n");
wholeScript.append(" }\n");
wholeScript.append(" anns = [];\n");
}
@@ -2195,9 +2131,6 @@ public class ChartD3Helper {
wholeScript.append(" g = new Dygraph(\n");
wholeScript.append(" document.getElementById(\"div_g"+reportRuntime.getReportID()+"\"),\n");
//data here
- /*wholeScript.append(" [\n");
- wholeScript.append(dataStrBuf.toString());
- wholeScript.append(" ],\n");*/
wholeScript.append(" data , \n");
wholeScript.append(" {\n");
@@ -2242,16 +2175,8 @@ public class ChartD3Helper {
wholeScript.append(" var minutes = d.getMinutes();\n");
wholeScript.append(" var seconds = d.getSeconds();\n");
wholeScript.append(" var wholeString = Dygraph.zeropad(month)+'/'+Dygraph.zeropad(day);\n");
- // wholeScript.append(" if(hour >= 0 && minutes > 0 && seconds > 0) {\n");
- //wholeScript.append(" wholeString += ' ' + Dygraph.zeropad(hour) + ':'+Dygraph.zeropad(minutes)+':'+Dygraph.zeropad(seconds);\n");
- //wholeScript.append(" } else if (hour >= 0 && minutes > 0 && seconds == 0) {\n");
if(AppUtils.nvl(reportRuntime.getTimeAxisType()).length()==0 || AppUtils.nvl(reportRuntime.getTimeAxisType()).equals("hourly"))
wholeScript.append(" wholeString += ' ' + Dygraph.zeropad(hour) + ':'+Dygraph.zeropad(minutes);\n");
- //wholeScript.append(" } else if (hour >= 0 && (minutes >= 0 && seconds > 0)) {\n");
- //wholeScript.append(" wholeString += ' ' + Dygraph.zeropad(hour) + ':'+Dygraph.zeropad(minutes)+':'+Dygraph.zeropad(seconds);\n");
- //wholeScript.append(" } else if (hour >= 0) { \n");
- //wholeScript.append(" wholeString += ' ' + Dygraph.zeropad(hour); \n");
- //wholeScript.append(" } \n");
wholeScript.append(" return wholeString; \n");
wholeScript.append(" },\n");
wholeScript.append(" ticker: function (a, b, pixels, opts, dygraph, vals) { \n ");
@@ -2280,15 +2205,6 @@ public class ChartD3Helper {
wholeScript.append(" touchstart : newDygraphTouchstart,\n");
wholeScript.append(" touchend : Dygraph.defaultInteractionModel.touchend,\n");
wholeScript.append(" touchmove : Dygraph.defaultInteractionModel.touchmove\n");
- //wholeScript.append(" 'dblclick' : dblClickV3,\n");
- //wholeScript.append(" 'mousewheel' : scrollV3\n");
-
- /*wholeScript.append(" 'mousedown' : downV3,\n");
- wholeScript.append(" 'mousemove' : moveV3,\n");
- wholeScript.append(" 'mouseup' : upV3,\n");
- wholeScript.append(" 'click' : clickV3,\n");
- wholeScript.append(" 'dblclick' : dblClickV3,\n");
- wholeScript.append(" 'mousewheel' : scrollV3\n");*/
wholeScript.append("},\n");
/*wholeScript.append(" zoomCallback: function(minDate, maxDate, yRanges) { \n");
if(AppUtils.nvl(reportRuntime.getTimeAxisType()).equals("daily")) {
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/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