diff options
Diffstat (limited to 'ecomp-sdk/epsdk-analytics/src/main/java')
11 files changed, 13 insertions, 124 deletions
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/util/HtmlStripper.java b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/util/HtmlStripper.java index 63a4f5f0..544f65e2 100644 --- a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/util/HtmlStripper.java +++ b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/util/HtmlStripper.java @@ -33,7 +33,7 @@ * * ============LICENSE_END============================================ * - * + * */ package org.onap.portalsdk.analytics.util; @@ -55,7 +55,6 @@ public class HtmlStripper extends RaptorObject// this function can be accessed p for (int i = 0; i < s.length(); i++) { // while c is not last character c = s.charAt(i); - //System.out.println("444 Character " + (char)c + " int " + c); if ((char) c == TXT_END_TAG) { // if char == '>' text following // it and not HTML tag @@ -64,17 +63,9 @@ public class HtmlStripper extends RaptorObject// this function can be accessed p // if char == '<' tag is // following not text inText = false; - } /*else if ((char)c == '\n') { - System.out.println("new line " + (char)c + " int " + c); - inText = false; - }*/ /*else if ((char) c == '&') { - // if char == '&' chars following - // are not text - inText = false; - }*/ + } else if (inText) { // if text write char to "text.txt" - //System.out.println("444444 Adding " + (char)c + " int " + c); if (c >= 32 && c <= 122) { if(c==32 || (c>32 && c<=47) || ( c>=58 && c<=64 )) { if (c == 45) { @@ -93,14 +84,10 @@ public class HtmlStripper extends RaptorObject// this function can be accessed p } } } - //System.out.println("\n\nFinished processing: " + s + "\n\n"); - //System.out.println("\n\nThe processed String : " + sbuf.toString() + "\n\n"); return sbuf.toString(); } public String stripHtml(String s) { - - //System.out.println("Starting to process: " + s + "\n\n"); // prints s = nvl(s); StringBuffer sbuf = new StringBuffer(); int c; @@ -116,14 +103,7 @@ public class HtmlStripper extends RaptorObject// this function can be accessed p // if char == '<' tag is // following not text inText = false; - } /*else if ((char)c == '\n') { - System.out.println("new line " + (char)c + " int " + c); - inText = false; - }*/ /*else if ((char) c == '&') { - // if char == '&' chars following - // are not text - inText = false; - }*/ + } else if (inText) { // if text write char to "text.txt" if (c >= 32 && c <= 122) { @@ -131,8 +111,6 @@ public class HtmlStripper extends RaptorObject// this function can be accessed p } } } - //System.out.println("\n\nFinished processing: " + s + "\n\n"); - //System.out.println("\n\nThe processed String : " + sbuf.toString() + "\n\n"); int pos = 0 ; while(sbuf.indexOf(" ")!=-1) { pos = sbuf.indexOf(" "); @@ -145,7 +123,6 @@ public class HtmlStripper extends RaptorObject// this function can be accessed p public String stripCSVHtml (String s) { String s1 = stripHtml(s); - //s1 = Utils.replaceInString(s1, "\"", "\"\""); s1 = s1.replaceAll("\"", "\"\""); return s1; } diff --git a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/util/RemDbInfo.java b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/util/RemDbInfo.java index 56e117f3..9d78b39a 100644 --- a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/util/RemDbInfo.java +++ b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/util/RemDbInfo.java @@ -63,7 +63,7 @@ public class RemDbInfo { Globals.getDbUtils(); ds = DbUtils.executeQuery(query); - String dbId = "", desc = "", dbType = "", connectionUrl = "", username = "", password = "", driver_class = ""; + String dbId = "", desc = "", dbType = "", connectionUrl = "", username = "", password = "", driver_class = ""; if(ds.getRowCount() > 0) { for (int i = 0; i < ds.getRowCount(); i++) { |