summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIndrijeet kumar <indriku1@in.ibm.com>2020-05-28 19:50:57 +0530
committerIndrijeet kumar <indriku1@in.ibm.com>2020-05-28 19:51:04 +0530
commit7a5b3d791b7b5a17e3f8ef9d84f42f892209bb22 (patch)
treee2db741bc9e8cb90a57c7c5001f720a4ec9b30b3
parent273ccf87b2609ed82fe681e2211fc402f799307f (diff)
Removed unwanted codes
Removed unwanted codes Issue-ID: PORTAL-813 Change-Id: I508b7af3633f5aee6d1230cfdd5f4d08e4e40e39 Signed-off-by: Indrijeet Kumar <indriku1@in.ibm.com>
-rw-r--r--ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/gmap/node/Node.java29
-rw-r--r--ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/DataCache.java5
-rw-r--r--ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/ReportHandler.java28
-rw-r--r--ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/ReportLoader.java5
-rw-r--r--ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/base/IdNameSql.java2
-rw-r--r--ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/base/ReportSecurity.java2
6 files changed, 4 insertions, 67 deletions
diff --git a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/gmap/node/Node.java b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/gmap/node/Node.java
index 4764ef50..ced3d79b 100644
--- a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/gmap/node/Node.java
+++ b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/gmap/node/Node.java
@@ -73,39 +73,11 @@ public class Node {
nodeInfo.setDeleteable(nodeParam.isDeleteable());
nodeInfo.initializeAttributes(nodeParam.getNodeAttributes());
- //if (nodeCollection.getNode(nodeInfo.getNodeID()+""+nodeInfo.getNodeType()) == null) {
nodeCollection.addNode(nodeInfo);
nodeIDSet.add(nodeParam.getNodeID());
-/* }
- else {
- return nodeCollection.getNode(nodeType);
- }
-*/
return nodeInfo;
}
-
- /**
- *
- */
-/* public void updateNumberT1(String currentYearMonth) {
- ArrayList<NodeInfo> nodeCollection = this.nodeCollection.getNodeCollection();
-
- for (NodeInfo nodeInfo : nodeCollection) {
- nodeInfo.setAttribute(NodeInfo.NUMBER_OF_T1_KEY, nodeInfo.getAttribute(currentYearMonth));
- }
- }
-*/
-/* public Set<Integer> getUniqueNumberT1(String currentYearMonth) {
- ArrayList<NodeInfo> nodeCollection = this.nodeCollection.getNodeCollection();
- Set<Integer> numberT1Set = new TreeSet<Integer>();
- for (NodeInfo nodeInfo : nodeCollection) {
- numberT1Set.add(Integer.parseInt(nodeInfo.getAttribute(currentYearMonth).toString()));
- }
-
- return numberT1Set;
- }
-*/
public void updateNumberT1(String currentYearMonth) {
HashMap<String,NodeInfo> hashMap = this.nodeCollection.getNodeCollection();
Set set = hashMap.entrySet();
@@ -145,7 +117,6 @@ public class Node {
int nodeSize = map.getShapeWidth();
HashMap<String,NodeInfo> hashMap = nodeCollection.getNodeCollection();
Set set = hashMap.entrySet();
- //ArrayList<NodeInfo> list = nodeCollection.getNodeCollection();
for (Iterator iterator = set.iterator(); iterator.hasNext();) {
Map.Entry entry = (Map.Entry) iterator.next();
diff --git a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/DataCache.java b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/DataCache.java
index 41a5ae20..084fbe1b 100644
--- a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/DataCache.java
+++ b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/DataCache.java
@@ -103,7 +103,7 @@ public class DataCache extends org.onap.portalsdk.analytics.RaptorObject {
for (int i = 0; i < ds.getRowCount(); i++)
publicReportIdNames
.add(new IdNameValue(ds.getString(i, 0), ds.getString(i, 1)));
- } // catch(Exception e) {}
+ }
return publicReportIdNames;
} // getPublicReportIdNames
@@ -137,7 +137,7 @@ public class DataCache extends org.onap.portalsdk.analytics.RaptorObject {
for (int i = 0; i < ds.getRowCount(); i++)
privateReportIdNames
.add(new IdNameValue(ds.getString(i, 0), ds.getString(i, 1)));
- } // catch(Exception e) {}
+ }
return privateReportIdNames;
} // getPrivateAccessibleReportIdNames
@@ -241,7 +241,6 @@ public class DataCache extends org.onap.portalsdk.analytics.RaptorObject {
if (dBInfo != null && !dBInfo.equals(AppConstants.DB_LOCAL)){
String d_sql = Globals.grabTheReportTableIf();
d_sql = d_sql.replace("[dBInfo]", dBInfo);
- //query.append( " ts.SOURCE_DB= '" + dBInfo + "'");
query.append(d_sql);
}
else{
diff --git a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/ReportHandler.java b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/ReportHandler.java
index 12842f50..d8dd9304 100644
--- a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/ReportHandler.java
+++ b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/ReportHandler.java
@@ -301,7 +301,6 @@ public class ReportHandler extends org.onap.portalsdk.analytics.RaptorObject {
if (nvl(fmt.getFontSize()).length() > 0) {
try {
- // cellFont.setFontHeight((short) (Integer.parseInt(fmt.getFontSize()) / 0.05));
cellFont.setFontHeight((short) (FONT_SIZE / 0.05));
} catch (NumberFormatException e) {
cellFont.setFontHeight((short) (FONT_SIZE / 0.05));// 10
@@ -360,7 +359,6 @@ public class ReportHandler extends org.onap.portalsdk.analytics.RaptorObject {
styleValue.setBorderTop(BorderStyle.THIN);
styleValue.setBorderLeft(BorderStyle.THIN);
styleValue.setBorderRight(BorderStyle.THIN);
- // styleValue.setFillForegroundColor(HSSFColor.YELLOW.index);
styleValue.setFillPattern(fillPattern.NO_FILL);
styleValue.setFont(fontDefault);
XSSFCell cell = null;
@@ -2220,9 +2218,6 @@ public class ReportHandler extends org.onap.portalsdk.analytics.RaptorObject {
rowNum += 2;
paintExcelFooter(wb, rowNum, col, sheet);
}
- // response.setContentType("application/vnd.ms-excel");
- // response.setHeader("Content-disposition", "attachment;filename=download_all_"
- // + user_id + ".xls");
wb.write(xlsOut);
xlsOut.flush();
}
@@ -2790,7 +2785,6 @@ public class ReportHandler extends org.onap.portalsdk.analytics.RaptorObject {
sheetRef = sheet.getPackagePart().getPartName().getName();
wb.write(os);
os.flush();
- // wb = null;
}
} else {
@@ -2807,11 +2801,9 @@ public class ReportHandler extends org.onap.portalsdk.analytics.RaptorObject {
sheet.getPrintSetup().setLandscape(false);
else
sheet.getPrintSetup().setLandscape(true);
- // sheet = wb.getSheet(getSheetName());
sheetRef = sheet.getPackagePart().getPartName().getName();
wb.write(os);
os.flush();
- // wb = null;
}
}
@@ -3402,7 +3394,6 @@ public class ReportHandler extends org.onap.portalsdk.analytics.RaptorObject {
}
if (requestFlag == 2 && !rDisplayContent) {
- // System.out.println("In Request Flag ");
request.getSession().setAttribute(AppConstants.SI_REPORT_RUNTIME, rr);
rr.setParamValues(request, false, false);
} else if (requestFlag == 1) {
@@ -3598,7 +3589,6 @@ public class ReportHandler extends org.onap.portalsdk.analytics.RaptorObject {
styleDefault.setBorderTop(BorderStyle.THIN);
styleDefault.setBorderLeft(BorderStyle.THIN);
styleDefault.setBorderRight(BorderStyle.THIN);
- // styleDefault.setFillForegroundColor(HSSFColor.YELLOW.index);
styleDefault.setFillPattern(fillPattern.NO_FILL);
styleDefault.setFont(fontDefault);
ArrayList semColumnList = new ArrayList();
@@ -3995,7 +3985,6 @@ public class ReportHandler extends org.onap.portalsdk.analytics.RaptorObject {
.getIndex());
}
} else {
- // styleDefault.setDataFormat(HSSFDataFormat.getBuiltinFormat("#,##0.00"));
String tempStr = value.trim();
if ((tempStr.indexOf(",")) != -1) {
tempStr = tempStr.replaceAll(",", "");
@@ -4803,7 +4792,6 @@ public class ReportHandler extends org.onap.portalsdk.analytics.RaptorObject {
styles.get(nvl(/* dv.getFormatId() */"", "date")).getIndex());
} else {
- /* cell.getCellStyle().setDataFormat((short)0); */
if (styleRowCell != null)
sw.createCell(cellNum, Utils.excelEncode(value), styleRowCell.getIndex());
else if (styleCell != null)
@@ -5153,7 +5141,6 @@ public class ReportHandler extends org.onap.portalsdk.analytics.RaptorObject {
if (!Globals.customizeFormFieldInfo() || customizedParamInfo.length() <= 0) {
for (Iterator iter = paramsList.iterator(); iter.hasNext();) {
IdNameValue value = (IdNameValue) iter.next();
- // System.out.println("\"" + value.getId() + " = " + value.getName() + "\"");
if (nvl(value.getId()).trim().length() > 0 && (!nvl(value.getId()).trim().equals("BLANK"))) {
paramSeq += 1;
if (paramSeq <= 1) {
@@ -5194,14 +5181,13 @@ public class ReportHandler extends org.onap.portalsdk.analytics.RaptorObject {
for (int k = 0; k < p.size(); ++k) {
if (p.get(k) instanceof Paragraph)
s = ((Paragraph) p.get(k)).toString();
- else { /* if ((p.get(k) instanceof PdfPTable)) */
+ else {
pdfTable = ((PdfPTable) p.get(k));
}
// todo: Logic for parsing pdfTable should be added after upgrading to iText 5.0.0
s = s.replaceAll(",", "|");
s = s.replaceAll("~", ",");
if (s.indexOf(":") != -1) {
- // System.out.println("|"+s+"|");
row = sheet.createRow(++rowNum);
cell = row.createCell((short) 0);
sheet.addMergedRegion(new CellRangeAddress(rowNum, rowNum, s1, s2));
@@ -5223,10 +5209,7 @@ public class ReportHandler extends org.onap.portalsdk.analytics.RaptorObject {
value = st.nextToken();
if (nvl(value).endsWith("]"))
value = nvl(value).substring(0, nvl(value).length() - 1);
- } /*
- * else if(name != null && name.length() > 0) { value = st.nextToken();
- * if(value.endsWith("]]"))value = value.substring(0, value.length()-1); }
- */
+ }
if (name != null && name.trim().length() > 0) {
row = sheet.createRow((short) ++rowNum);
cellNum = 0;
@@ -5237,7 +5220,6 @@ public class ReportHandler extends org.onap.portalsdk.analytics.RaptorObject {
cell = row.createCell((short) cellNum);
cell.setCellValue(value.trim());
cell.setCellStyle(styleValue);
- // strBuf.append(name.trim()+": "+ value.trim()+"\n");
}
/*
* if(token.endsWith(":") && (value!=null && value.trim().length()<=0) && (name!=null &&
@@ -5252,7 +5234,6 @@ public class ReportHandler extends org.onap.portalsdk.analytics.RaptorObject {
*/ }
int cw = 0;
cw = name.trim().length() + 12;
- // if(i!=cellWidth.size()-1)
if (sheet.getColumnWidth((short) 0) < (short) name.trim().length())
sheet.setColumnWidth((short) 0, (short) name.trim().length());
if (sheet.getColumnWidth((short) 1) < (short) value.trim().length())
@@ -5431,7 +5412,6 @@ public class ReportHandler extends org.onap.portalsdk.analytics.RaptorObject {
logger.error(EELFLoggerDelegate.errorLogger, "SQLException occured", ex);
}
}
- // csvOut.flush();
} else {
boolean firstPass = true;
int numberOfColumns = 0;
@@ -5446,7 +5426,6 @@ public class ReportHandler extends org.onap.portalsdk.analytics.RaptorObject {
numberOfColumns++;
csvOut.print("<TD bgColor=\"8F9381\">" + rhc.getColumnTitle() + "</TD>");
}
- // csvOut.print(",");
} // for
for (chr.resetNext(); chr.hasNext();) {
@@ -5455,8 +5434,6 @@ public class ReportHandler extends org.onap.portalsdk.analytics.RaptorObject {
if (firstPass)
numberOfColumns++;
csvOut.print("<TD bgColor=\"8F9381\">" + ch.getColumnTitle() + "</TD>");
- // for (int i = 1; i < ch.getColSpan(); i++)
- // csvOut.print(",");
}
} // for
firstPass = false;
@@ -5487,7 +5464,6 @@ public class ReportHandler extends org.onap.portalsdk.analytics.RaptorObject {
csvOut.println("</TR>");
} // for
- // csvOut.flush();
} else {
csvOut.println("<TR><TD COLSPAN=\"" + numberOfColumns + "\">No Data Found</TD></TR>");
}
diff --git a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/ReportLoader.java b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/ReportLoader.java
index 687b9c4d..a92d5244 100644
--- a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/ReportLoader.java
+++ b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/ReportLoader.java
@@ -174,7 +174,6 @@ public class ReportLoader extends org.onap.portalsdk.analytics.RaptorObject {
ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE)) {
stmt.setInt(1, Integer.parseInt(reportID));
try (ResultSet rs = stmt.executeQuery()) {
- // Writer out = null;
/*
* if(Globals.isWeblogicServer()) { java.sql.Clob clob = null; if (rs.next()) clob = rs.getClob(1);
* else throw new RaptorException("Report " + reportID + NOT_FOUND_IN_DB);
@@ -365,9 +364,6 @@ public class ReportLoader extends org.onap.portalsdk.analytics.RaptorObject {
public static String getReportOwnerID(String reportID) throws RaptorException {
- // String sql = "SELECT nvl(cr.owner_id, cr.create_id) owner FROM cr_report cr WHERE rep_id
- // = ?";
-
String sql = Globals.getTheReportOwnerId();
Connection connection = DbUtils.getConnection();
@@ -924,7 +920,6 @@ public class ReportLoader extends org.onap.portalsdk.analytics.RaptorObject {
}
public static String getTemplateFile(String reportId) throws RaptorException {
- // String query = "select template_file from cr_report_template_map where report_id = " + reportId;
String query = Globals.getTheTemplateFile();
query = query.replace("[reportId]", reportId);
String templateFile = "";
diff --git a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/base/IdNameSql.java b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/base/IdNameSql.java
index 1ef28a26..78c288ee 100644
--- a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/base/IdNameSql.java
+++ b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/base/IdNameSql.java
@@ -188,7 +188,6 @@ public class IdNameSql extends IdNameList {
public void loadUserData(int pageNo, String searchString, String dbInfo, String userId) throws RaptorException {
if(userId!=null) {
String sql = Utils.replaceInString(getSql(), "[LOGGED_USERID]", userId);
- //String defaultSQL = "";
if(defaultSQL!=null && (defaultSQL.trim().toLowerCase().startsWith("select")) ) {
defaultSQL = Utils.replaceInString(getDefaultSQL(), "[LOGGED_USERID]", userId);
setDefaultSQL(defaultSQL);
@@ -339,7 +338,6 @@ public class IdNameSql extends IdNameList {
}
} else {
- //pageNo = 0;
if(pageNo!= -2) {
queryPop = new StringBuffer("");
queryPop.append("SELECT count(*) num_rows FROM ("+ Globals.getReportSqlForFormfield() +" FROM (" + sql
diff --git a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/base/ReportSecurity.java b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/base/ReportSecurity.java
index 4e1ddb7e..5da6c563 100644
--- a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/base/ReportSecurity.java
+++ b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/base/ReportSecurity.java
@@ -108,7 +108,6 @@ public class ReportSecurity extends org.onap.portalsdk.analytics.RaptorObject {
} catch (Exception e) {
String eMsg = "ReportSecurity.ReportSecurity: Unable to load report record details. Exception: "
+ e.getMessage();
- //Log.write(eMsg);
logger.debug(EELFLoggerDelegate.debugLogger, ("[EXCEPTION ENCOUNTERED IN RAPTOR] "+eMsg));
throw new RuntimeException(eMsg);
}
@@ -324,7 +323,6 @@ public class ReportSecurity extends org.onap.portalsdk.analytics.RaptorObject {
if(userID == null)
userID = AppUtils.getUserID(request);
if(userID != null) {
- //userID = AppUtils.getUserID(request);
if (nvl(reportID).equals("-1"))
return;