diff options
author | st782s <statta@research.att.com> | 2017-11-22 11:41:10 -0500 |
---|---|---|
committer | Sunder Tattavarada <statta@research.att.com> | 2017-11-28 20:24:36 +0000 |
commit | ed07ebfbce4031ef4dfbd2f42147f6a7b351aeb8 (patch) | |
tree | ee4a6e53f01f15057f32b86f271c9b6d02b25615 | |
parent | 418d7273d6d8f6fed2698df89c9910be8498a677 (diff) |
Harden code
Issue-ID: PORTAL-145,PORTAL-119
Harden code to address SQL injecton, XSS vulnerabilities; Separate
docker images for portal, sdk app and DMaaPBC ui
Change-Id: I85fad4d3fcee3243207b8f0dfe21beaa41602204
Signed-off-by: st782s <statta@research.att.com>
42 files changed, 8062 insertions, 6322 deletions
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 ba455899..c4f411f7 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 @@ -858,13 +858,13 @@ public class ActionHandler extends org.onap.portalsdk.analytics.RaptorObject { try { jsonInString = mapper.writerWithDefaultPrettyPrinter().writeValueAsString(reportJSONRuntime); } catch (Exception ex) { - ex.printStackTrace(); + logger.error(EELFLoggerDelegate.errorLogger,"reportRun", ex); } return jsonInString; } catch (RaptorException e) { try { - e.printStackTrace(); + logger.error(EELFLoggerDelegate.errorLogger,"reportRun", e); if(rr!=null) { // when user tries report they don't have access this should not throw exception that's why this if is added. if(isEmailAttachment) @@ -885,7 +885,7 @@ public class ActionHandler extends org.onap.portalsdk.analytics.RaptorObject { try { jsonInString = mapper.writerWithDefaultPrettyPrinter().writeValueAsString(errorJSONRuntime); } catch (Exception ex) { - ex.printStackTrace(); + logger.error(EELFLoggerDelegate.errorLogger,"reportRun", ex); } return jsonInString; @@ -904,13 +904,13 @@ public class ActionHandler extends org.onap.portalsdk.analytics.RaptorObject { try { jsonInString = mapper.writerWithDefaultPrettyPrinter().writeValueAsString(errorJSONRuntime); } catch (Exception ex1) { - ex1.printStackTrace(); + logger.error(EELFLoggerDelegate.errorLogger,ex.getMessage(), ex); } return jsonInString; } //nextPage = (new ErrorHandler()).processFatalError(request, e); } catch (Exception t) { - t.printStackTrace(); + logger.error(EELFLoggerDelegate.errorLogger,t.getMessage(), t); ErrorJSONRuntime errorJSONRuntime = new ErrorJSONRuntime(); errorJSONRuntime.setErrormessage(t.toString()); errorJSONRuntime.setStacktrace(getStackTrace(t)); @@ -923,7 +923,7 @@ public class ActionHandler extends org.onap.portalsdk.analytics.RaptorObject { try { jsonInString = mapper.writerWithDefaultPrettyPrinter().writeValueAsString(errorJSONRuntime); } catch (Exception ex) { - ex.printStackTrace(); + logger.error(EELFLoggerDelegate.errorLogger,ex.getMessage(), ex); } return jsonInString; @@ -1035,7 +1035,7 @@ public class ActionHandler extends org.onap.portalsdk.analytics.RaptorObject { jsonInString = mapper.writerWithDefaultPrettyPrinter().writeValueAsString(quickLinks); } catch (Exception e) { - e.printStackTrace(); + logger.error(EELFLoggerDelegate.errorLogger,e.getMessage(), e); } return jsonInString; } @@ -1071,7 +1071,7 @@ public class ActionHandler extends org.onap.portalsdk.analytics.RaptorObject { nextPage = (new ErrorHandler()).processFatalError(request, new RaptorSchedularException(message)); } - } catch(Exception ex) { ex.printStackTrace();} + } catch(Exception ex) { logger.error(EELFLoggerDelegate.errorLogger,ex.getMessage(), ex);} return nextPage; } @@ -1102,7 +1102,7 @@ public class ActionHandler extends org.onap.portalsdk.analytics.RaptorObject { return nextPage; } - } catch (Exception ex) { ex.printStackTrace();} + } catch (Exception ex) { logger.error(EELFLoggerDelegate.errorLogger,ex.getMessage(), ex);} if(reportSchedule == null) reportSchedule = new ReportSchedule(reportID, scheduleID, AppUtils.getUserID(request), request); String formFields = ""; formFields = reportSchedule.getFormFields(); @@ -1139,17 +1139,17 @@ public class ActionHandler extends org.onap.portalsdk.analytics.RaptorObject { (new ErrorHandler()).processError(request, ve); } catch (RaptorException e) { nextPage = (new ErrorHandler()).processFatalError(request, e); - e.printStackTrace(); + logger.error(EELFLoggerDelegate.errorLogger,e.getMessage(), e); try { DbUtils.rollbackTransaction(connection); - } catch (Exception e1) {e1.printStackTrace();} + } catch (Exception e1) {logger.error(EELFLoggerDelegate.errorLogger,e1.getMessage(), e1);} } catch (Exception t) { - t.printStackTrace(); + logger.error(EELFLoggerDelegate.errorLogger,t.getMessage(), t); } finally { try { DbUtils.clearConnection(connection); - } catch (Exception e1) {e1.printStackTrace();} + } catch (Exception e1) {logger.error(EELFLoggerDelegate.errorLogger,e1.getMessage(), e1);} } request.setAttribute("schedule_only", "Y"); //request.getSession().removeAttribute(AppConstants.SI_REPORT_SCHEDULE); @@ -1236,17 +1236,17 @@ public class ActionHandler extends org.onap.portalsdk.analytics.RaptorObject { (new ErrorHandler()).processError(request, ve); } catch (RaptorException e) { nextPage = (new ErrorHandler()).processFatalError(request, e); - e.printStackTrace(); + logger.error(EELFLoggerDelegate.errorLogger,e.getMessage(), e); try { DbUtils.rollbackTransaction(connection); - } catch (Exception e1) {e1.printStackTrace();} + } catch (Exception e1) {logger.error(EELFLoggerDelegate.errorLogger,e1.getMessage(), e1);} } catch (Exception t) { - t.printStackTrace(); + logger.error(EELFLoggerDelegate.errorLogger,t.getMessage(), t); } finally { try { DbUtils.clearConnection(connection); - } catch (Exception e1) {e1.printStackTrace();} + } catch (Exception e1) {logger.error(EELFLoggerDelegate.errorLogger,e1.getMessage(), e1);} } } request.setAttribute(AppConstants.RI_REPORT_ID, myScheduleRepID); @@ -1282,7 +1282,7 @@ public class ActionHandler extends org.onap.portalsdk.analytics.RaptorObject { } catch (RaptorException e) { nextPage = (new ErrorHandler()).processFatalError(request, e); } catch (Exception t) { - t.printStackTrace(); + logger.error(EELFLoggerDelegate.errorLogger,t.getMessage(), t); } return nextPage; @@ -1491,7 +1491,7 @@ public class ActionHandler extends org.onap.portalsdk.analytics.RaptorObject { if(dataSizeForPopUp >= 0) request.getSession().setAttribute(AppConstants.SI_DATA_SIZE_FOR_TEXTFIELD_POPUP, ""+dataSizeForPopUp); } catch (RaptorException e) { - e.printStackTrace(); + logger.error(EELFLoggerDelegate.errorLogger,e.getMessage(), e); nextPage = (new ErrorHandler()).processFatalError(request, e); } return nextPage; @@ -1920,7 +1920,7 @@ public class ActionHandler extends org.onap.portalsdk.analytics.RaptorObject { xmlOut.println(allColumnsBuffer.toString()); xmlOut.flush(); xmlOut.close(); - } catch (IOException e) {e.printStackTrace();} + } catch (IOException e) {logger.error(EELFLoggerDelegate.errorLogger,e.getMessage(), e);} try { PrintWriter xmlOut = new PrintWriter(new BufferedWriter(new FileWriter(new File(whole_fileName)))); logger.debug(EELFLoggerDelegate.debugLogger, ("**************************")); @@ -1933,7 +1933,7 @@ public class ActionHandler extends org.onap.portalsdk.analytics.RaptorObject { //xmlOut.println(rr.getWholeSQL()); xmlOut.flush(); xmlOut.close(); - } catch (IOException e) {e.printStackTrace();} + } catch (IOException e) {logger.error(EELFLoggerDelegate.errorLogger,e.getMessage(), e);} StringBuffer command = new StringBuffer(Globals.getShellScriptDir() + AppConstants.SHELL_SCRIPTS_DIR); if(nvl(emailId).length()>0) { @@ -2419,7 +2419,7 @@ public class ActionHandler extends org.onap.portalsdk.analytics.RaptorObject { try { jsonInString = mapper.writerWithDefaultPrettyPrinter().writeValueAsString(reportJSONRuntime); } catch (Exception ex) { - ex.printStackTrace(); + logger.error(EELFLoggerDelegate.errorLogger,ex.getMessage(), ex); } return jsonInString; 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 38db8eaf..c96a72db 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 @@ -56,82 +56,85 @@ import org.onap.portalsdk.analytics.gmap.line.LineInfo; import org.onap.portalsdk.analytics.gmap.map.layer.SwingLayer; import org.onap.portalsdk.analytics.gmap.node.Node; import org.onap.portalsdk.analytics.gmap.node.NodeInfo; +import org.onap.portalsdk.analytics.system.fusion.adapter.FusionAdapter; +import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate; public class NovaMap { + + private static final EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(NovaMap.class); + private static int[] shapeWidth; - + public static final Font TEXT_FONT = new Font("sans-serif", Font.BOLD, 12); - public static final Font HEADER_FONT = new Font("sans-serif", Font.ITALIC+Font.BOLD, 12); - + public static final Font HEADER_FONT = new Font("sans-serif", Font.ITALIC + Font.BOLD, 12); + private HashSet<String> showList; private ArrayList<SwingLayer> swingLayers; private AffineTransform transform; - + private Node node; private Line line; private ColorProperties colorProperties; - + private Rectangle2D defaultBoundary; - + private int zoomLevel; - + private String currentYearMonth; - + private String dataLoaded = ""; - + /** * size in screen pixel */ private Rectangle boundingBox; - + /** * size in pixel web mercator projection */ private Rectangle2D mapArea; - + /** * size in longitude latitude */ private Rectangle2D geoArea; - - public static double[] meter2pixel; - + + public static double[] meter2pixel; + private boolean showLegend = false; - + static { initShapeWidth(); initMeter2Pixel(); } - - private static void initMeter2Pixel() { - meter2pixel = new double[MapConstant.ZOOM_MAX - MapConstant.ZOOM_MIN+1]; - meter2pixel[0] = 156543.04/2; - for(int i=1; i<meter2pixel.length; ++i) - meter2pixel[i] = meter2pixel[i-1]/2; - } - + + private static void initMeter2Pixel() { + meter2pixel = new double[MapConstant.ZOOM_MAX - MapConstant.ZOOM_MIN + 1]; + meter2pixel[0] = 156543.04 / 2; + for (int i = 1; i < meter2pixel.length; ++i) + meter2pixel[i] = meter2pixel[i - 1] / 2; + } + private static void initShapeWidth() { - // ZOOM_MAX+1 is added to below line because of ArrayIndexOutOfException. This is Suggested by Hendra Tuty. - Sundar - shapeWidth = new int[MapConstant.ZOOM_MAX]; + // ZOOM_MAX+1 is added to below line because of ArrayIndexOutOfException. This + // is Suggested by Hendra Tuty. - Sundar + shapeWidth = new int[MapConstant.ZOOM_MAX]; int width = 0; for (int i = 0; i < shapeWidth.length; i++) { if (i < 5) { - } - else if (i == 5) { + } else if (i == 5) { width = 4; - } - else if (i > 4 && i < 10) { + } else if (i > 4 && i < 10) { width += 2; - } - else { + } else { width++; } shapeWidth[i] = width; } } - + public NovaMap() { boundingBox = new Rectangle(); mapArea = new Rectangle2D.Double(); @@ -139,106 +142,93 @@ public class NovaMap { showList = new HashSet<String>(); swingLayers = new ArrayList<SwingLayer>(); } - - - - public int getBestZoomLevel(double Latitude1, double Longitude1, - double Latitude2, double Longitude2, - double height, double width) { - - if (height==0) - height=700; - if (width==0) - width=1200; - - double lat1 = Math.min(Latitude1, Latitude1); - double CosLat = Math.cos(Math.toRadians(lat1)); - double Wmeter = getDistance( - lat1, Longitude1, - lat1, Longitude2)/CosLat; - double Hmeter = getDistance( - Latitude1, Longitude1, - Latitude2, Longitude1)/CosLat; + + public int getBestZoomLevel(double Latitude1, double Longitude1, double Latitude2, double Longitude2, double height, + double width) { + + if (height == 0) + height = 700; + if (width == 0) + width = 1200; + + double lat1 = Math.min(Latitude1, Latitude1); + double CosLat = Math.cos(Math.toRadians(lat1)); + double Wmeter = getDistance(lat1, Longitude1, lat1, Longitude2) / CosLat; + double Hmeter = getDistance(Latitude1, Longitude1, Latitude2, Longitude1) / CosLat; int zoom = 0; - if(Latitude1 == Latitude2 && Longitude1 == Longitude2) + if (Latitude1 == Latitude2 && Longitude1 == Longitude2) zoom = 15; if (zoom <= 0) { - for(; - zoom < meter2pixel.length - && (width*meter2pixel[zoom]) > Wmeter - && (height*meter2pixel[zoom]) > Hmeter; - ++zoom) ; + for (; zoom < meter2pixel.length && (width * meter2pixel[zoom]) > Wmeter + && (height * meter2pixel[zoom]) > Hmeter; ++zoom) + ; } -// && (1200*meter2pixel[zoom]) > Wmeter -// && (700*meter2pixel[zoom]) > Hmeter; + // && (1200*meter2pixel[zoom]) > Wmeter + // && (700*meter2pixel[zoom]) > Hmeter; - return zoom + MapConstant.ZOOM_MIN-1; + return zoom + MapConstant.ZOOM_MIN - 1; } - public static double getDistance(double Latitude1, double Longitude1, - double Latitude2, double Longitude2) { + public static double getDistance(double Latitude1, double Longitude1, double Latitude2, double Longitude2) { Latitude1 = Math.toRadians(Latitude1); Longitude1 = Math.toRadians(Longitude1); Latitude2 = Math.toRadians(Latitude2); Longitude2 = Math.toRadians(Longitude2); final double R = 6371.0; // earth's mean radius in km - double dSinLat05 = Math.sin( (Latitude2 - Latitude1)/2 ); - double dSinLong05 = Math.sin( (Longitude2 - Longitude1)/2 ); - double a = dSinLat05 * dSinLat05 + - Math.cos(Latitude1) * Math.cos(Latitude2) * dSinLong05 * dSinLong05; - double c = (0==a || 1==a) - ? 0 - : 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1.0-a)); - return R * c * 1000.0; //in meters - } - + double dSinLat05 = Math.sin((Latitude2 - Latitude1) / 2); + double dSinLong05 = Math.sin((Longitude2 - Longitude1) / 2); + double a = dSinLat05 * dSinLat05 + Math.cos(Latitude1) * Math.cos(Latitude2) * dSinLong05 * dSinLong05; + double c = (0 == a || 1 == a) ? 0 : 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1.0 - a)); + return R * c * 1000.0; // in meters + } + public Rectangle getBoundingBox() { return boundingBox; } - + public void setBoundingBox(int width, int height) { boundingBox.setSize(width, height); } - + public void setNode(Node node) { this.node = node; } - + public Node getNode() { return node; } - + public void setLine(Line line) { this.line = line; } - + public Line getLine() { return line; } - + public void setColorProperties(ColorProperties colorProperties) { this.colorProperties = colorProperties; } - + public ColorProperties getColorProperties() { return colorProperties; } - + public void setZoomLevel(int zoomLevel) { this.zoomLevel = zoomLevel; } - + public int getZoomLevel() { return zoomLevel; } - - public void addShowList(String type) { + + public void addShowList(String type) { showList.add(type.toUpperCase()); } - + public void addShowList(String type, int number) { showList.add(type.toUpperCase() + ":" + number); } @@ -246,15 +236,15 @@ public class NovaMap { public void removeShowList(String type) { showList.remove(type.toUpperCase()); } - + public void removeShowList(String type, int number) { showList.remove(type.toUpperCase() + ":" + number); } - + public void clearShowList() { showList.clear(); } - + public HashSet getShowList() { return showList; } @@ -262,74 +252,70 @@ public class NovaMap { public boolean containsShowList(String type) { return showList.contains(type.toUpperCase()); } - + public boolean containsShowList(String type, int number) { return showList.contains(type.toUpperCase() + ":" + number); } - + public int getShowListSize() { return showList.size(); } - + public void addSwingLayer(SwingLayer swingLayer) { swingLayers.add(swingLayer); } - + public void removeSwingLayer(SwingLayer swingLayer) { swingLayers.remove(swingLayer); } - + public void clearSwingLayers() { swingLayers.clear(); } - + public ArrayList<SwingLayer> getSwingLayers() { return swingLayers; } - + public int getShapeWidth() { - return shapeWidth[getZoomLevel()>=22?21:(getZoomLevel()<=8 ? 8:getZoomLevel())]; + return shapeWidth[getZoomLevel() >= 22 ? 21 : (getZoomLevel() <= 8 ? 8 : getZoomLevel())]; } - + public Point2D getPixelPos(double latitude, double longitude) { double sinLatitude = Math.sin(Math.toRadians(latitude)); - return new Point2D.Double( - ((longitude + 180.0) / 360.0) * 256.0 * (1<<zoomLevel), - ( 0.5 - Math.log((1.0+sinLatitude)/(1.0-sinLatitude)) - /(4.0*Math.PI) )*256.0*(1<<zoomLevel) - ); + return new Point2D.Double(((longitude + 180.0) / 360.0) * 256.0 * (1 << zoomLevel), + (0.5 - Math.log((1.0 + sinLatitude) / (1.0 - sinLatitude)) / (4.0 * Math.PI)) * 256.0 + * (1 << zoomLevel)); } - + private boolean checkTransform(Rectangle2D geoArea) { System.out.println("%%%%%%map.checkTransform start"); if (!this.geoArea.equals(geoArea)) { Point2D point1 = getPixelPos(geoArea.getMinY(), geoArea.getMinX()); Point2D point2 = getPixelPos(geoArea.getMaxY(), geoArea.getMaxX()); - mapArea.setRect(point1.getX(), point2.getY(), - boundingBox.getWidth(), boundingBox.getHeight()); + mapArea.setRect(point1.getX(), point2.getY(), boundingBox.getWidth(), boundingBox.getHeight()); this.geoArea.setRect(geoArea); resetTransform(boundingBox, mapArea); System.out.println("%%%%%%map.checkTransform end 1"); return true; } - + System.out.println("%%%%%%map.checkTransform end 2"); return false; } - + private void resetTransform(Rectangle boundingBox, Rectangle2D mapArea) { System.out.println("%%%%%%map.resetTransform start"); - if (mapArea == null || boundingBox.getWidth() == 0 || boundingBox.getHeight() == 0 ) { + if (mapArea == null || boundingBox.getWidth() == 0 || boundingBox.getHeight() == 0) { System.out.println("%%%%%%map.resetTransform end 1"); return; } - transform = new AffineTransform(mapArea.getWidth() / boundingBox.getWidth(), - 0.0, 0.0, mapArea.getHeight() / boundingBox.getHeight(), - mapArea.getMinX(), mapArea.getMinY()); - System.out.println("%%%%%%map.resetTransform end 2"); + transform = new AffineTransform(mapArea.getWidth() / boundingBox.getWidth(), 0.0, 0.0, + mapArea.getHeight() / boundingBox.getHeight(), mapArea.getMinX(), mapArea.getMinY()); + System.out.println("%%%%%%map.resetTransform end 2"); } - + protected AffineTransform getTransform() { if (transform != null) { return new AffineTransform(transform); @@ -337,40 +323,39 @@ public class NovaMap { return null; } - - public Point2D getScreenPointFromPixel(double xPixel, double yPixel) { + + public Point2D getScreenPointFromPixel(double xPixel, double yPixel) { try { return getTransform().inverseTransform(new Point2D.Double(xPixel, yPixel), null); - } catch (NoninvertibleTransformException e) { - // TODO Auto-generated catch block - e.printStackTrace(); + } catch (NoninvertibleTransformException ex) { + logger.error(EELFLoggerDelegate.errorLogger, "getScreenPointFromPixel () failed ", ex); } return null; } - + public Point2D getScreenPointFromLonLat(double longitude, double latitude) { Point2D point = getPixelPos(latitude, longitude); return getScreenPointFromPixel(point.getX(), point.getY()); } - + public Point2D getLonLatFromPixel(int x1, int y1) { double x = (double) x1 / 256; double y = (double) y1 / 256; - double lon = -180; // x + double lon = -180; // x double lonWidth = 360; // width 360 - //double lat = -90; // y - //double latHeight = 180; // height 180 - double lat = -1; + // double lat = -90; // y + // double latHeight = 180; // height 180 + double lat = -1; double latHeight = 2; int tilesAtThisZoom = 1 << getZoomLevel(); - lonWidth = 360.0 / tilesAtThisZoom; - lon = -180 + (x * lonWidth); + lonWidth = 360.0 / tilesAtThisZoom; + lon = -180 + (x * lonWidth); latHeight = -2.0 / tilesAtThisZoom; - lat = 1 + (y * latHeight); - + lat = 1 + (y * latHeight); + // convert lat and latHeight to degrees in a transverse mercator projection // note that in fact the coordinates go from about -85 to +85 not -90 to 90! latHeight += lat; @@ -379,37 +364,38 @@ public class NovaMap { lat = (2 * Math.atan(Math.exp(Math.PI * lat))) - (Math.PI / 2); lat *= (180 / Math.PI); - + latHeight -= lat; if (lonWidth < 0) { - lon = lon + lonWidth; + lon = lon + lonWidth; lonWidth = -lonWidth; } if (latHeight < 0) { - lat = lat + latHeight; + lat = lat + latHeight; latHeight = -latHeight; } return new Point2D.Double(lon, lat + latHeight); } - + public ArrayList getImage(final HttpServletRequest request, Rectangle2D geoArea) { - Object showListArr[] = ((HashSet)getShowList()).toArray(); + Object showListArr[] = ((HashSet) getShowList()).toArray(); BufferedImage image = new BufferedImage(boundingBox.width, boundingBox.height, BufferedImage.TYPE_INT_ARGB); final Graphics2D g2d = image.createGraphics(); - // LEGEND INFO + // LEGEND INFO BufferedImage legendImage = null; Graphics2D g2Legend = null; - if(showLegend) { - legendImage = new BufferedImage(boundingBox.width, (int)(20*showListArr.length) + 20, BufferedImage.TYPE_INT_ARGB); + if (showLegend) { + legendImage = new BufferedImage(boundingBox.width, (int) (20 * showListArr.length) + 20, + BufferedImage.TYPE_INT_ARGB); g2Legend = legendImage.createGraphics(); g2Legend.setBackground(Color.WHITE); } checkTransform(geoArea); - + boolean swingLayerPainted = false; Object object = request.getAttribute("server_process_interrupted"); @@ -424,29 +410,28 @@ public class NovaMap { } ArrayList imageArr = new ArrayList(); - //if(showLegend) layer.paintLegend(g2Legend); - + // if(showLegend) layer.paintLegend(g2Legend); + g2d.dispose(); - if(showLegend && g2Legend != null) + if (showLegend && g2Legend != null) g2Legend.dispose(); object = request.getAttribute("server_process_interrupted"); - + if (object != null && ((Boolean) object)) { System.out.println("interrupted"); return imageArr; - } - else if (!swingLayerPainted) { + } else if (!swingLayerPainted) { System.out.println("not painted"); return imageArr; } - + imageArr.add(image); - if(g2Legend!=null) { + if (g2Legend != null) { imageArr.add(legendImage); } return imageArr; } - + public Object singleLeftClick(double longitude, double latitude, Rectangle2D geoArea) { System.out.println("%%%%%%map.singleLeftClick start"); System.out.println("%%%%%%map.singleLeftClick check transform start"); @@ -455,33 +440,21 @@ public class NovaMap { Point2D screenPoint = getScreenPointFromLonLat(longitude, latitude); System.out.println("%%%%%%map.singleLeftClick getting nodeExist array "); ArrayList<NodeInfo> existNodeInfo = node.nodeExist(screenPoint); - + if (existNodeInfo == null) { ArrayList<LineInfo> existLineInfo = line.lineExist(screenPoint); - + if (existLineInfo == null) { - - } - else { + + } else { System.out.println("%%%%%%map.singleLeftClick end 1"); return existLineInfo; } - } - else { -// if (existNodeInfo.size() == 1) { -// NodeInfo nodeInfo = existNodeInfo.get(0); -// node.getNodeCollection().clearSelectedNode(); -// node.getNodeCollection().addSelectedNode(nodeInfo.getID(), nodeInfo.getLegendID()); -// return getSelectedImage(geoArea); -// } -// else { -// return existNodeInfo; -// } - + } else { System.out.println("%%%%%%map.singleLeftClick end 2"); return existNodeInfo; } - + System.out.println("%%%%%%map.singleLeftClick end 3"); return null; } @@ -501,7 +474,7 @@ public class NovaMap { public void setDefaultBoundary(Rectangle2D defaultBoundary) { this.defaultBoundary = defaultBoundary; } - + public boolean isShowLegend() { return showLegend; } @@ -517,5 +490,5 @@ public class NovaMap { public void setDataLoaded(String dataLoaded) { this.dataLoaded = dataLoaded; } - + } diff --git a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/pdf/PageEvent.java b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/pdf/PageEvent.java index 296df6df..3335699a 100644 --- a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/pdf/PageEvent.java +++ b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/pdf/PageEvent.java @@ -44,6 +44,7 @@ import java.net.MalformedURLException; import org.onap.portalsdk.analytics.system.AppUtils; import org.onap.portalsdk.analytics.system.Globals; +import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate; import com.lowagie.text.BadElementException; import com.lowagie.text.Cell; @@ -63,6 +64,9 @@ import com.lowagie.text.pdf.PdfPageEventHelper; import com.lowagie.text.pdf.PdfWriter; class PageEvent extends PdfPageEventHelper { + + private static final EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(PageEvent.class); + private PdfBean pb; private int pageNo = 0; private int omit_page_count = 0; @@ -228,17 +232,11 @@ class PageEvent extends PdfPageEventHelper { Image img = null; try { img = Image.getInstance(pb.getFullWebContextPath() + AppUtils.getImgFolderURL() + File.separator + imgSrc); - } catch (BadElementException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - img = null; - } catch (MalformedURLException e) { - // TODO Auto-generated catch block - e.printStackTrace(); + } catch (BadElementException | MalformedURLException e) { + logger.error(EELFLoggerDelegate.errorLogger,"addLogo() failed ", e); img = null; - } catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); + } catch (IOException e) { + logger.error(EELFLoggerDelegate.errorLogger,e.getMessage(), e); } if(img == null){ diff --git a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/runtime/FormField.java b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/runtime/FormField.java index 7884e61f..7da22187 100644 --- a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/runtime/FormField.java +++ b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/runtime/FormField.java @@ -80,12 +80,17 @@ import org.onap.portalsdk.analytics.model.base.IdNameSql; import org.onap.portalsdk.analytics.model.base.IdNameValue; import org.onap.portalsdk.analytics.system.AppUtils; import org.onap.portalsdk.analytics.system.ConnectionUtils; +import org.onap.portalsdk.analytics.system.ExecuteQuery; import org.onap.portalsdk.analytics.system.Globals; import org.onap.portalsdk.analytics.util.DataSet; import org.onap.portalsdk.analytics.util.Utils; import org.onap.portalsdk.analytics.xmlobj.JavascriptItemType; +import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate; public class FormField extends org.onap.portalsdk.analytics.RaptorObject implements Serializable { + + private static final EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(FormField.class); + private static final String HTML_FORM = "formd"; private String fieldName = null; @@ -97,21 +102,21 @@ public class FormField extends org.onap.portalsdk.analytics.RaptorObject impleme private String validationType = VT_NONE; private boolean required = false; - + public boolean hasPredefinedList = false; private String defaultValue = null; - + private Calendar rangeStartDate = null; - + private Calendar rangeEndDate = null; - + private String rangeStartDateSQL = null; - + private String rangeEndDateSQL = null; - + private String fieldDefaultSQL = null; - + private String multiSelectListSize = null; private String helpText = null; @@ -119,16 +124,16 @@ public class FormField extends org.onap.portalsdk.analytics.RaptorObject impleme private IdNameList lookupList = null; private String dbInfo = null; - - private String userId = null; - - private boolean visible = true; - - private String dependsOn = null; - - private boolean triggerOtherFormFields = false; - - private boolean triggerThisFormfield = false; + + private String userId = null; + + private boolean visible = true; + + private String dependsOn = null; + + private boolean triggerOtherFormFields = false; + + private boolean triggerThisFormfield = false; // Form field types public static final String FFT_TEXT_W_POPUP = "TEXT_WITH_POPUP"; @@ -148,19 +153,19 @@ public class FormField extends org.onap.portalsdk.analytics.RaptorObject impleme public static final String FFT_LIST_MULTI = "LIST_MULTI_SELECT"; public static final String FFT_HIDDEN = "HIDDEN"; - - public static final String FFT_BLANK = "BLANK"; - + + public static final String FFT_BLANK = "BLANK"; + // Validation types public static final String VT_NONE = "NONE"; public static final String VT_DATE = "DATE"; - - public static final String VT_TIMESTAMP_HR = "TIMESTAMP_HR"; - public static final String VT_TIMESTAMP_MIN = "TIMESTAMP_MIN"; + public static final String VT_TIMESTAMP_HR = "TIMESTAMP_HR"; - public static final String VT_TIMESTAMP_SEC = "TIMESTAMP_SEC"; + public static final String VT_TIMESTAMP_MIN = "TIMESTAMP_MIN"; + + public static final String VT_TIMESTAMP_SEC = "TIMESTAMP_SEC"; public static final String VT_INT = "INTEGER"; @@ -173,95 +178,99 @@ public class FormField extends org.onap.portalsdk.analytics.RaptorObject impleme public static final String VT_FLOAT_POSITIVE = "POSITIVE_FLOAT"; public static final String VT_FLOAT_NON_NEGATIVE = "NON_NEGATIVE_FLOAT"; - - private FormField(String fieldName, String fieldDisplayName, String fieldType, - String validationType, boolean required, String defaultValue, String helpText, boolean visible, String dependsOn, Calendar rangeStartDate, Calendar rangeEndDate, - String rangeStartDateSQL, String rangeEndDateSQL, String multiSelectListSize ) { - //super(); - this (fieldName,fieldDisplayName,fieldType,validationType,required,defaultValue,helpText, dependsOn, rangeStartDate, rangeEndDate, rangeStartDateSQL, rangeEndDateSQL, multiSelectListSize); - setVisible(visible); + + private FormField(String fieldName, String fieldDisplayName, String fieldType, String validationType, + boolean required, String defaultValue, String helpText, boolean visible, String dependsOn, + Calendar rangeStartDate, Calendar rangeEndDate, String rangeStartDateSQL, String rangeEndDateSQL, + String multiSelectListSize) { + // super(); + this(fieldName, fieldDisplayName, fieldType, validationType, required, defaultValue, helpText, dependsOn, + rangeStartDate, rangeEndDate, rangeStartDateSQL, rangeEndDateSQL, multiSelectListSize); + setVisible(visible); } // FormField - private FormField(String fieldName, String fieldDisplayName, String fieldType, - String validationType, boolean required, String defaultValue, String helpText, String dependsOn, Calendar rangeStartDate, Calendar rangeEndDate, - String rangeStartDateSQL, String rangeEndDateSQL, String multiSelectListSize ) { - super(); - setFieldName(fieldName); - setFieldDisplayName(fieldDisplayName); - setFieldType(nvl(fieldType, FFT_TEXT)); - setValidationType(validationType); - setRequired(required); - setDefaultValue(defaultValue); - setHelpText(helpText); - setDependsOn(dependsOn); - setRangeStartDate(rangeStartDate); - setRangeEndDate(rangeEndDate); - setRangeStartDateSQL(rangeStartDateSQL); - setRangeEndDateSQL(rangeEndDateSQL); - setMultiSelectListSize(multiSelectListSize); - } - public FormField(String fieldName, String fieldDisplayName, String fieldType, - String validationType, boolean required, String defaultValue, String helpText, - List predefinedValues, boolean visible, String dependsOn, Calendar rangeStartDate, Calendar rangeEndDate, - String rangeStartDateSQL, String rangeEndDateSQL, String multiSelectListSize) { - this(fieldName, fieldDisplayName, fieldType, validationType, required, defaultValue, - helpText,visible, dependsOn, rangeStartDate, rangeEndDate, rangeStartDateSQL, rangeEndDateSQL, multiSelectListSize); + private FormField(String fieldName, String fieldDisplayName, String fieldType, String validationType, + boolean required, String defaultValue, String helpText, String dependsOn, Calendar rangeStartDate, + Calendar rangeEndDate, String rangeStartDateSQL, String rangeEndDateSQL, String multiSelectListSize) { + super(); + setFieldName(fieldName); + setFieldDisplayName(fieldDisplayName); + setFieldType(nvl(fieldType, FFT_TEXT)); + setValidationType(validationType); + setRequired(required); + setDefaultValue(defaultValue); + setHelpText(helpText); + setDependsOn(dependsOn); + setRangeStartDate(rangeStartDate); + setRangeEndDate(rangeEndDate); + setRangeStartDateSQL(rangeStartDateSQL); + setRangeEndDateSQL(rangeEndDateSQL); + setMultiSelectListSize(multiSelectListSize); + } + + public FormField(String fieldName, String fieldDisplayName, String fieldType, String validationType, + boolean required, String defaultValue, String helpText, List predefinedValues, boolean visible, + String dependsOn, Calendar rangeStartDate, Calendar rangeEndDate, String rangeStartDateSQL, + String rangeEndDateSQL, String multiSelectListSize) { + this(fieldName, fieldDisplayName, fieldType, validationType, required, defaultValue, helpText, visible, + dependsOn, rangeStartDate, rangeEndDate, rangeStartDateSQL, rangeEndDateSQL, multiSelectListSize); if (predefinedValues != null) setPredefinedListLookup(predefinedValues); } // FormField - public FormField(String fieldName, String fieldDisplayName, String fieldType, - String validationType, boolean required, String defaultValue, String helpText, - String lookupSql, boolean visible, String dependsOn, Calendar rangeStartDate, Calendar rangeEndDate, - String rangeStartDateSQL, String rangeEndDateSQL, String multiSelectListSize ) { - this(fieldName, fieldDisplayName, fieldType, validationType, required, defaultValue, - helpText,visible, dependsOn, rangeStartDate, rangeEndDate, rangeStartDateSQL, rangeEndDateSQL, multiSelectListSize); - if (defaultValue!=null && defaultValue.length()>10 && defaultValue.substring(0,10).trim().toLowerCase().startsWith("select")) { - setFieldDefaultSQL(defaultValue); - setDefaultValue(""); - } - setLookupList(new IdNameSql(lookupSql,defaultValue)); + public FormField(String fieldName, String fieldDisplayName, String fieldType, String validationType, + boolean required, String defaultValue, String helpText, String lookupSql, boolean visible, String dependsOn, + Calendar rangeStartDate, Calendar rangeEndDate, String rangeStartDateSQL, String rangeEndDateSQL, + String multiSelectListSize) { + this(fieldName, fieldDisplayName, fieldType, validationType, required, defaultValue, helpText, visible, + dependsOn, rangeStartDate, rangeEndDate, rangeStartDateSQL, rangeEndDateSQL, multiSelectListSize); + if (defaultValue != null && defaultValue.length() > 10 + && defaultValue.substring(0, 10).trim().toLowerCase().startsWith("select")) { + setFieldDefaultSQL(defaultValue); + setDefaultValue(""); + } + setLookupList(new IdNameSql(lookupSql, defaultValue)); } // FormField - public FormField(String fieldName, String fieldDisplayName, String fieldType, - String validationType, boolean required, String defaultValue, String helpText, - String dbTableName, String dbIdField, String dbNameField, String dbSortByField, boolean visible, String dependsOn, Calendar rangeStartDate, Calendar rangeEndDate, + public FormField(String fieldName, String fieldDisplayName, String fieldType, String validationType, + boolean required, String defaultValue, String helpText, String dbTableName, String dbIdField, + String dbNameField, String dbSortByField, boolean visible, String dependsOn, Calendar rangeStartDate, + Calendar rangeEndDate, String rangeStartDateSQL, String rangeEndDateSQL, String multiSelectListSize) { + this(fieldName, fieldDisplayName, fieldType, validationType, required, defaultValue, helpText, dbTableName, + dbIdField, dbNameField, dbSortByField, dependsOn, rangeStartDate, rangeEndDate, rangeStartDateSQL, + rangeEndDateSQL, multiSelectListSize); + setVisible(visible); + } + + public FormField(String fieldName, String fieldDisplayName, String fieldType, String validationType, + boolean required, String defaultValue, String helpText, String dbTableName, String dbIdField, + String dbNameField, String dbSortByField, String dependsOn, Calendar rangeStartDate, Calendar rangeEndDate, String rangeStartDateSQL, String rangeEndDateSQL, String multiSelectListSize) { - this(fieldName, fieldDisplayName, fieldType, validationType, required, defaultValue, - helpText,dbTableName,dbIdField,dbNameField,dbSortByField, dependsOn, rangeStartDate, rangeEndDate, rangeStartDateSQL, rangeEndDateSQL, multiSelectListSize); - setVisible(visible); - } - - public FormField(String fieldName, String fieldDisplayName, String fieldType, - String validationType, boolean required, String defaultValue, String helpText, - String dbTableName, String dbIdField, String dbNameField, String dbSortByField, String dependsOn, - Calendar rangeStartDate, Calendar rangeEndDate, - String rangeStartDateSQL, String rangeEndDateSQL, String multiSelectListSize ) { - this(fieldName, fieldDisplayName, fieldType, validationType, required, defaultValue, - helpText,dependsOn, rangeStartDate, rangeEndDate, rangeStartDateSQL, rangeEndDateSQL, multiSelectListSize); - //if(dependsOn !=null){ this.dependsOn = dependsOn; }else { this.dependsOn = "" - if (defaultValue!=null && defaultValue.length()>10 && defaultValue.substring(0,10).trim().toLowerCase().startsWith("select")) { - setFieldDefaultSQL(defaultValue); - setDefaultValue(""); - if(fieldType.equals(FFT_TEXT)) - setLookupList(new IdNameLookup(dbTableName, dbIdField, dbNameField, dbSortByField,defaultValue,true)); - else - setLookupList(new IdNameLookup(dbTableName, dbIdField, dbNameField, dbSortByField,defaultValue,false)); - } - else { - if(fieldType.equals(FFT_TEXT)) - setLookupList(new IdNameLookup(dbTableName, dbIdField, dbNameField, dbSortByField, true)); - else - setLookupList(new IdNameLookup(dbTableName, dbIdField, dbNameField, dbSortByField, false)); - } - - this.setRangeStartDate(rangeStartDate); - this.setRangeEndDate(rangeEndDate); - this.setRangeStartDateSQL(rangeStartDateSQL); - this.setRangeEndDateSQL(rangeEndDateSQL); - + this(fieldName, fieldDisplayName, fieldType, validationType, required, defaultValue, helpText, dependsOn, + rangeStartDate, rangeEndDate, rangeStartDateSQL, rangeEndDateSQL, multiSelectListSize); + // if(dependsOn !=null){ this.dependsOn = dependsOn; }else { this.dependsOn = "" + if (defaultValue != null && defaultValue.length() > 10 + && defaultValue.substring(0, 10).trim().toLowerCase().startsWith("select")) { + setFieldDefaultSQL(defaultValue); + setDefaultValue(""); + if (fieldType.equals(FFT_TEXT)) + setLookupList(new IdNameLookup(dbTableName, dbIdField, dbNameField, dbSortByField, defaultValue, true)); + else + setLookupList( + new IdNameLookup(dbTableName, dbIdField, dbNameField, dbSortByField, defaultValue, false)); + } else { + if (fieldType.equals(FFT_TEXT)) + setLookupList(new IdNameLookup(dbTableName, dbIdField, dbNameField, dbSortByField, true)); + else + setLookupList(new IdNameLookup(dbTableName, dbIdField, dbNameField, dbSortByField, false)); + } + + this.setRangeStartDate(rangeStartDate); + this.setRangeEndDate(rangeEndDate); + this.setRangeStartDateSQL(rangeStartDateSQL); + this.setRangeEndDateSQL(rangeEndDateSQL); + } // FormField - private void setPredefinedListLookup(List predefinedValues) { IdNameList lookup = new IdNameList(); @@ -269,7 +278,7 @@ public class FormField extends org.onap.portalsdk.analytics.RaptorObject impleme String value = (String) iter.next(); lookup.addValue(value, value); } // for - setHasPredefinedList(true); + setHasPredefinedList(true); setLookupList(lookup); } // setPredefinedListLookup @@ -337,26 +346,28 @@ public class FormField extends org.onap.portalsdk.analytics.RaptorObject impleme this.lookupList = lookupList; } - public void setDefaultList(IdNameList lookupList) { - this.lookupList = lookupList; - } - + public void setDefaultList(IdNameList lookupList) { + this.lookupList = lookupList; + } + public String getBaseSQL() { return (lookupList == null) ? null : lookupList.getBaseSQL(); } // getBaseSQL public String getBaseWholeSQL() { return (lookupList == null) ? null : lookupList.getBaseWholeSQL(); - } // getBaseWholeSQL - + } // getBaseWholeSQL + public String getBaseWholeReadonlySQL() { return (lookupList == null) ? null : lookupList.getBaseWholeReadonlySQL(); } // getBaseWholeReadonlySQL - + public String getBaseSQLForPDFExcel() { - return (lookupList == null) ? null : lookupList.getBaseSQLForPDFExcel(getFieldType().equals(FFT_LIST_MULTI)||getFieldType().equals(FFT_CHECK_BOX)?true:false); + return (lookupList == null) ? null + : lookupList.getBaseSQLForPDFExcel( + getFieldType().equals(FFT_LIST_MULTI) || getFieldType().equals(FFT_CHECK_BOX) ? true : false); } // getBaseSQLForPDFExcel - + public String getDisplayNameHtml() { if (nvl(helpText).length() > 0) return "<a title=\"" + helpText + "\">" + fieldDisplayName + "</a>"; @@ -364,1454 +375,1562 @@ public class FormField extends org.onap.portalsdk.analytics.RaptorObject impleme return fieldDisplayName; } // getDisplayNameHtml - /*public String getHtml() throws RaptorRuntimeException { - return getHtml("" , null, null, false); - } // getHtml*/ - - public String getHtml(String fieldValue, HashMap formValues, ReportRuntime rr)throws RaptorRuntimeException { - return getHtml(fieldValue,formValues, rr, false); + /* + * public String getHtml() throws RaptorRuntimeException { return getHtml("" , + * null, null, false); } // getHtml + */ + + public String getHtml(String fieldValue, HashMap formValues, ReportRuntime rr) throws RaptorRuntimeException { + return getHtml(fieldValue, formValues, rr, false); } - + public String getHelpLink(String fieldName) { - //return "<a href=\"#\" onclick=\"javascript:ShowContent('" + fieldName + "_div')\"><img src=\""+AppUtils.getBaseFolderURL()+"images/quickhelp_dk.gif\" width=\"12\" height=\"12\" alt=\"\" border=\"0\" class=\"qh-element\" /></a>"; - return ((getHelpText()!=null && getHelpText().length()>0)? "tooltipText=\""+ getHelpText()+"\">": ">"); - //return ((getHelpText()!=null && getHelpText().length()>0)? "<img src=\"static/fusion/raptor/images/quickhelp_lt.gif\" tooltipText=\""+ getHelpText() + "\"/>": ""); + // return "<a href=\"#\" onclick=\"javascript:ShowContent('" + fieldName + + // "_div')\"><img src=\""+AppUtils.getBaseFolderURL()+"images/quickhelp_dk.gif\" + // width=\"12\" height=\"12\" alt=\"\" border=\"0\" class=\"qh-element\" + // /></a>"; + return ((getHelpText() != null && getHelpText().length() > 0) ? "tooltipText=\"" + getHelpText() + "\">" : ">"); + // return ((getHelpText()!=null && getHelpText().length()>0)? "<img + // src=\"static/fusion/raptor/images/quickhelp_lt.gif\" tooltipText=\""+ + // getHelpText() + "\"/>": ""); } - - + public String getCallableAfterChainingJavascript(String fieldName, ReportRuntime rr) { JavascriptItemType javascriptItemType = null; StringBuffer callJavascriptText = new StringBuffer(""); - if(rr.getJavascriptList()!=null) { + if (rr.getJavascriptList() != null) { for (Iterator iter = rr.getJavascriptList().getJavascriptItem().iterator(); iter.hasNext();) { - javascriptItemType = (JavascriptItemType)iter.next(); - if(javascriptItemType.getFieldId().equals(fieldName)) { - if(nvl(javascriptItemType.getCallText()).toLowerCase().startsWith("afterchaining")) - callJavascriptText.append(" "+javascriptItemType.getCallText()); + javascriptItemType = (JavascriptItemType) iter.next(); + if (javascriptItemType.getFieldId().equals(fieldName)) { + if (nvl(javascriptItemType.getCallText()).toLowerCase().startsWith("afterchaining")) + callJavascriptText.append(" " + javascriptItemType.getCallText()); } } } - return callJavascriptText.toString()+" "; + return callJavascriptText.toString() + " "; } + public String getCallableJavascript(String fieldName, ReportRuntime rr) { JavascriptItemType javascriptItemType = null; StringBuffer callJavascriptText = new StringBuffer(""); - if(rr.getJavascriptList()!=null) { + if (rr.getJavascriptList() != null) { for (Iterator iter = rr.getJavascriptList().getJavascriptItem().iterator(); iter.hasNext();) { - javascriptItemType = (JavascriptItemType)iter.next(); - if(javascriptItemType.getFieldId().equals(fieldName)) { - if(!nvl(javascriptItemType.getCallText()).toLowerCase().startsWith("afterchaining")) - callJavascriptText.append(" "+javascriptItemType.getCallText()); + javascriptItemType = (JavascriptItemType) iter.next(); + if (javascriptItemType.getFieldId().equals(fieldName)) { + if (!nvl(javascriptItemType.getCallText()).toLowerCase().startsWith("afterchaining")) + callJavascriptText.append(" " + javascriptItemType.getCallText()); } } } - return callJavascriptText.toString()+" "; + return callJavascriptText.toString() + " "; } - + public String getCallableOnChangeJavascript(String fieldName, ReportRuntime rr) { - String callText = getCallableJavascript(fieldName, rr); - if(callText != null && callText.trim().toLowerCase().indexOf("onchange")>=0) { - Pattern re1 = Pattern.compile("\\=(.*?)\\)"); - Matcher matcher = re1.matcher(callText); - while (matcher.find()) { - callText = matcher.group(); - if(callText!=null && callText.startsWith("=\"")) { - callText = callText.substring(2); - } else if (callText!=null) - callText = callText.substring(1); - } - callText = callText.replaceAll("this", "documentForm."+fieldName); - } else callText = null; - return callText; - } - - public String getAjaxHtml(String fieldValue, HashMap formValues, ReportRuntime rr, boolean inSchedule) throws RaptorRuntimeException { - fieldValue = nvl(fieldValue, defaultValue); - String readOnly = "ff_readonly"; - try { - if(fieldValue !=null && fieldValue.length() > 0) - fieldValue = java.net.URLDecoder.decode(fieldValue, "UTF-8"); - } catch (UnsupportedEncodingException ex) {} - catch (IllegalArgumentException ex1){} - catch (Exception ex2){} - if (fieldType.equals(FFT_COMBO_BOX)) { - StringBuffer sb = new StringBuffer(); - //System.out.println("COMBO BOX " + fieldName); - String oldSQL = ""; - if (!required) - sb.append("obj.options[obj.options.length] = new Option('-->select value<--','');"); + String callText = getCallableJavascript(fieldName, rr); + if (callText != null && callText.trim().toLowerCase().indexOf("onchange") >= 0) { + Pattern re1 = Pattern.compile("\\=(.*?)\\)"); + Matcher matcher = re1.matcher(callText); + while (matcher.find()) { + callText = matcher.group(); + if (callText != null && callText.startsWith("=\"")) { + callText = callText.substring(2); + } else if (callText != null) + callText = callText.substring(1); + } + callText = callText.replaceAll("this", "documentForm." + fieldName); + } else + callText = null; + return callText; + } + + public String getAjaxHtml(String fieldValue, HashMap formValues, ReportRuntime rr, boolean inSchedule) + throws RaptorRuntimeException { + fieldValue = nvl(fieldValue, defaultValue); + String readOnly = "ff_readonly"; + try { + if (fieldValue != null && fieldValue.length() > 0) + fieldValue = java.net.URLDecoder.decode(fieldValue, "UTF-8"); + } catch (UnsupportedEncodingException ex) { + } catch (IllegalArgumentException ex1) { + } catch (Exception ex2) { + } + if (fieldType.equals(FFT_COMBO_BOX)) { + StringBuffer sb = new StringBuffer(); + // System.out.println("COMBO BOX " + fieldName); + String oldSQL = ""; + if (!required) + sb.append("obj.options[obj.options.length] = new Option('-->select value<--','');"); + + IdNameList lookup = getLookupList(); + try { + if (!hasPredefinedList) { + // if(dependsOn != null && dependsOn != "") { + // if(dependsOn != null && dependsOn != "" ) { + IdNameSql lu = (IdNameSql) lookup; + String SQL = ""; + SQL = lu.getSql(); + /* + * if(nvl(fieldValue,"").length()<=0) SQL = lu.getSql(); else SQL = + * lu.getBaseSQLForPDFExcel(false); + */ + // System.out.println("FORMFIELD 6666667 First" + ((IdNameSql)lookup).getSql()); + oldSQL = lu.getSql(); + // SQL = Utils.replaceInString(SQL, "[VALUE]", fieldValue); + if (formValues != null) { + Set set = formValues.entrySet(); + String value = ""; + for (Iterator iter = set.iterator(); iter.hasNext();) { + Map.Entry entry = (Entry) iter.next(); + value = (String) entry.getValue(); + if (inSchedule) { + try { + value = java.net.URLDecoder.decode(Utils.oracleSafe(value), "UTF-8"); + } catch (UnsupportedEncodingException ex) { - IdNameList lookup = getLookupList(); - try { - if(!hasPredefinedList) { - //if(dependsOn != null && dependsOn != "") { - //if(dependsOn != null && dependsOn != "" ) { - IdNameSql lu = (IdNameSql) lookup; - String SQL = ""; - SQL = lu.getSql(); - /*if(nvl(fieldValue,"").length()<=0) - SQL = lu.getSql(); - else - SQL = lu.getBaseSQLForPDFExcel(false); - */ - //System.out.println("FORMFIELD 6666667 First" + ((IdNameSql)lookup).getSql()); - oldSQL = lu.getSql(); - //SQL = Utils.replaceInString(SQL, "[VALUE]", fieldValue); - if(formValues != null) { - Set set = formValues.entrySet(); - String value = ""; - for(Iterator iter = set.iterator(); iter.hasNext(); ) { - Map.Entry entry = (Entry) iter.next(); - value = (String) entry.getValue(); - if(inSchedule) { - try { - value = java.net.URLDecoder.decode(Utils.oracleSafe(value), "UTF-8"); - } catch (UnsupportedEncodingException ex) { - - } - } - if (value!=null && (value.length() <=0 || value.equals("NULL"))) { - value = "NULL"; - SQL = Utils.replaceInString(SQL, "'["+entry.getKey()+"]'", value); - SQL = Utils.replaceInString(SQL, "["+entry.getKey()+"]", value); - } else { - SQL = Utils.replaceInString(SQL, "["+entry.getKey()+"]", value); - } } - lookup = new IdNameSql(-1,SQL,lu.getDefaultSQL()); } - //} - lookupList = lookup; - - //} + if (value != null && (value.length() <= 0 || value.equals("NULL"))) { + value = "NULL"; + SQL = Utils.replaceInString(SQL, "'[" + entry.getKey() + "]'", value); + SQL = Utils.replaceInString(SQL, "[" + entry.getKey() + "]", value); + } else { + SQL = Utils.replaceInString(SQL, "[" + entry.getKey() + "]", value); + } + } + lookup = new IdNameSql(-1, SQL, lu.getDefaultSQL()); + } + // } + lookupList = lookup; + + // } try { lookup.loadUserData(0, "", getDbInfo(), getUserId()); - } catch (Exception e ){ e.printStackTrace(); //throw new RaptorRuntimeException(e); + } catch (Exception e) { + logger.error(EELFLoggerDelegate.errorLogger, "getAjaxHtml() failed ", e); } - } - lookup.trimToSize(); - - String selectedValue = ""; - int count = 0; - for (lookup.resetNext(); lookup.hasNext();) { - IdNameValue value = lookup.getNext(); - if(value != null && value.getId() != null && value.getName() != null ) { - /*if (count == 0 && required) { - selectedValue = value.getId(); - count++; - } else if (nvl(fieldValue).length()>0){ - if (fieldValue != null && fieldValue.equals(value.getId())){ - selectedValue = value.getId(); - } - count++; - } else { - count++; - } */ - if (count == 0) { - if(required){ - selectedValue = value.getId(); - } - count++; - } - sb.append("obj.options[obj.options.length] = new Option('" + Utils.singleQuoteEncode(value.getName())+"','"+Utils.singleQuoteEncode(value.getId())+"');"); - if ((fieldValue != null && fieldValue.equals(value.getId()))){ - sb.append("obj.options[obj.options.length-1].selected=true;"); + } + lookup.trimToSize(); + + String selectedValue = ""; + int count = 0; + for (lookup.resetNext(); lookup.hasNext();) { + IdNameValue value = lookup.getNext(); + if (value != null && value.getId() != null && value.getName() != null) { + /* + * if (count == 0 && required) { selectedValue = value.getId(); count++; } else + * if (nvl(fieldValue).length()>0){ if (fieldValue != null && + * fieldValue.equals(value.getId())){ selectedValue = value.getId(); } count++; + * } else { count++; } + */ + if (count == 0) { + if (required) { selectedValue = value.getId(); } - if(value.isReadOnly()) - sb.append("obj.disabled=true;"); - else - sb.append("obj.disabled=false;"); - + count++; } - } // for - if (formValues.containsKey(fieldDisplayName)){ - formValues.remove(fieldDisplayName); + sb.append("obj.options[obj.options.length] = new Option('" + + Utils.singleQuoteEncode(value.getName()) + "','" + + Utils.singleQuoteEncode(value.getId()) + "');"); + if ((fieldValue != null && fieldValue.equals(value.getId()))) { + sb.append("obj.options[obj.options.length-1].selected=true;"); + selectedValue = value.getId(); + } + if (value.isReadOnly()) + sb.append("obj.disabled=true;"); + else + sb.append("obj.disabled=false;"); + } - formValues.put(fieldDisplayName, selectedValue); - } catch (Exception e) { - //throw new RaptorRuntimeException(e); + } // for + if (formValues.containsKey(fieldDisplayName)) { + formValues.remove(fieldDisplayName); } - if(!hasPredefinedList) { - if(oldSQL != null && !oldSQL.equals("")) { - ((IdNameSql)lookup).setSQL(oldSQL); - } + formValues.put(fieldDisplayName, selectedValue); + } catch (Exception e) { + // throw new RaptorRuntimeException(e); + } + if (!hasPredefinedList) { + if (oldSQL != null && !oldSQL.equals("")) { + ((IdNameSql) lookup).setSQL(oldSQL); } - //System.out.println("FORMFIELD 6666667 " + ((IdNameSql)lookup).getSql()); - if( isVisible()) - return sb.toString(); - else return ""; - } else if (fieldType.equals(FFT_LIST_MULTI)) { - StringBuffer sb = new StringBuffer(); - String oldSQL = ""; + } + // System.out.println("FORMFIELD 6666667 " + ((IdNameSql)lookup).getSql()); + if (isVisible()) + return sb.toString(); + else + return ""; + } else if (fieldType.equals(FFT_LIST_MULTI)) { + StringBuffer sb = new StringBuffer(); + String oldSQL = ""; + + fieldValue = '|' + fieldValue + '|'; + IdNameList lookup = getLookupList(); + try { + if (!hasPredefinedList) { + // if(dependsOn != null && dependsOn != "") { + // if(dependsOn != null && dependsOn != "" ) { + IdNameSql lu = (IdNameSql) lookup; + String SQL = ""; + SQL = lu.getSql(); + /* + * if(nvl(fieldValue,"").length()<=0) SQL = lu.getSql(); else SQL = + * lu.getBaseSQLForPDFExcel(false); SQL = Utils.replaceInString(SQL, "[VALUE]", + * fieldValue); + */ + oldSQL = lu.getSql(); + if (formValues != null) { + Set set = formValues.entrySet(); + String value = ""; + for (Iterator iter = set.iterator(); iter.hasNext();) { + Map.Entry entry = (Entry) iter.next(); + value = (String) entry.getValue(); + if (inSchedule) { // ('1347') + try { + value = java.net.URLDecoder.decode(value, "UTF-8"); + } catch (UnsupportedEncodingException ex) { - fieldValue = '|' + fieldValue + '|'; - IdNameList lookup = getLookupList(); - try { - if(!hasPredefinedList) { - //if(dependsOn != null && dependsOn != "") { - //if(dependsOn != null && dependsOn != "" ) { - IdNameSql lu = (IdNameSql) lookup; - String SQL = ""; - SQL = lu.getSql(); - /*if(nvl(fieldValue,"").length()<=0) - SQL = lu.getSql(); - else - SQL = lu.getBaseSQLForPDFExcel(false); - SQL = Utils.replaceInString(SQL, "[VALUE]", fieldValue); - */ - oldSQL = lu.getSql(); - if(formValues != null) { - Set set = formValues.entrySet(); - String value = ""; - for(Iterator iter = set.iterator(); iter.hasNext(); ) { - Map.Entry entry = (Entry) iter.next(); - value = (String) entry.getValue(); - if(inSchedule) { //('1347') - try { - value = java.net.URLDecoder.decode(value, "UTF-8"); - } catch (UnsupportedEncodingException ex) { - - } - } - SQL = Utils.replaceInString(SQL, "["+entry.getKey()+"]", value); } - lookup = new IdNameSql(-1,SQL,lu.getDefaultSQL()); } - //} - lookupList = lookup; - //} - - lookup.loadUserData(0, "", getDbInfo(),getUserId()); + SQL = Utils.replaceInString(SQL, "[" + entry.getKey() + "]", value); + } + lookup = new IdNameSql(-1, SQL, lu.getDefaultSQL()); } + // } + lookupList = lookup; + // } - for (lookup.resetNext(); lookup.hasNext();) { - IdNameValue value = lookup.getNext(); - sb.append("obj.options[obj.options.length] = new Option('" + Utils.singleQuoteEncode(value.getName()) +"','"+Utils.singleQuoteEncode(value.getId())+"');"); - if (fieldValue.indexOf('|' + value.getId() + '|') >= 0) - sb.append("obj.options[obj.options.length-1].selected=true;"); - if(value.isReadOnly()) - sb.append("obj.disabled=true;"); - else - sb.append("obj.disabled=false;"); + lookup.loadUserData(0, "", getDbInfo(), getUserId()); + } - } // for + for (lookup.resetNext(); lookup.hasNext();) { + IdNameValue value = lookup.getNext(); + sb.append( + "obj.options[obj.options.length] = new Option('" + Utils.singleQuoteEncode(value.getName()) + + "','" + Utils.singleQuoteEncode(value.getId()) + "');"); + if (fieldValue.indexOf('|' + value.getId() + '|') >= 0) + sb.append("obj.options[obj.options.length-1].selected=true;"); + if (value.isReadOnly()) + sb.append("obj.disabled=true;"); + else + sb.append("obj.disabled=false;"); - // lookup.clearData(); - } catch (Exception e) { - //throw new RaptorRuntimeException(e); - } - if(!hasPredefinedList) { - if(oldSQL != null && !oldSQL.equals("")) { - ((IdNameSql)lookup).setSQL(oldSQL); - } + } // for + + // lookup.clearData(); + } catch (Exception e) { + // throw new RaptorRuntimeException(e); + } + if (!hasPredefinedList) { + if (oldSQL != null && !oldSQL.equals("")) { + ((IdNameSql) lookup).setSQL(oldSQL); } - if(isVisible()) - return sb.toString(); - else - return ""; - } else if (fieldType.equals(FFT_TEXT_W_POPUP)) { - //System.out.println("TEXT POPUP " + fieldName); - String oldSQL = ""; - IdNameValue idNamevalue = null; - String fieldDefValue=""; - String fieldDefDisplay=""; - try { - IdNameList lookup = getLookupList(); - if(dependsOn != null && dependsOn != "" ) { - IdNameSql lu = (IdNameSql) lookup; - String SQL = getBaseWholeSQL(); - if(SQL.toLowerCase().indexOf(readOnly) != -1) { - SQL = getBaseWholeReadonlySQL(); - } - oldSQL = lu.getSql(); - if(formValues != null) { - Set set = formValues.entrySet(); - String value = ""; - for(Iterator iter = set.iterator(); iter.hasNext(); ) { - Map.Entry entry = (Entry) iter.next(); - value = (String) entry.getValue(); - if(inSchedule) { - try { - value = java.net.URLDecoder.decode(Utils.oracleSafe(value), "UTF-8"); - } catch (UnsupportedEncodingException ex) { - - } - } - SQL = Utils.replaceInString(SQL, "["+entry.getKey()+"]", value); -// if(SQL.indexOf("'"+"["+entry.getKey()+"]"+"'")!=-1) { - if(SQL.indexOf("'"+"["+entry.getKey()+"]"+"'")!=-1 || SQL.indexOf("'"+"["+entry.getKey())!=-1 || SQL.indexOf(entry.getKey()+"]"+"'")!=-1 - || SQL.indexOf("'%"+"["+entry.getKey()+"]"+"%'")!=-1 || SQL.indexOf("'%"+"["+entry.getKey())!=-1 || SQL.indexOf(entry.getKey()+"]"+"%'")!=-1 - || SQL.indexOf("'_"+"["+entry.getKey()+"]"+"_'")!=-1 || SQL.indexOf("'_"+"["+entry.getKey())!=-1 || SQL.indexOf(entry.getKey()+"]"+"_'")!=-1 - || SQL.indexOf("'%_"+"["+entry.getKey()+"]"+"_%'")!=-1 || SQL.indexOf("'%_"+"["+entry.getKey())!=-1 || SQL.indexOf(entry.getKey()+"]"+"_%'")!=-1) { - - SQL = Utils.replaceInString(SQL, "["+entry.getKey()+"]", nvl( - value, "NULL")); - } else { - // Added to prevent SQL Injection - if(SQL.indexOf("["+entry.getKey()+"]")!=-1) { - try { - double vD = Double.parseDouble(value); - SQL = Utils.replaceInString(SQL, "["+entry.getKey()+"]", nvl( - value, "NULL")); - } catch (NumberFormatException ex) { - throw new UserDefinedException("Expected number, Given String for the form field \"" + "["+entry.getKey()+"]"+"\""); - } - } - } - } - if(getFieldDefaultSQL()!=null && (fieldValue == null || fieldValue.trim().equalsIgnoreCase("null")|| fieldValue.trim().length()<=0)) - lookup = new IdNameSql(-1,SQL,lu.getDefaultSQL()); - else - lookup = new IdNameSql(-1,SQL,null); - } + } + if (isVisible()) + return sb.toString(); + else + return ""; + } else if (fieldType.equals(FFT_TEXT_W_POPUP)) { + // System.out.println("TEXT POPUP " + fieldName); + String oldSQL = ""; + IdNameValue idNamevalue = null; + String fieldDefValue = ""; + String fieldDefDisplay = ""; + try { + IdNameList lookup = getLookupList(); + if (dependsOn != null && dependsOn != "") { + IdNameSql lu = (IdNameSql) lookup; + String SQL = getBaseWholeSQL(); + if (SQL.toLowerCase().indexOf(readOnly) != -1) { + SQL = getBaseWholeReadonlySQL(); } - //lookupList = lookup; - - if(getFieldDefaultSQL()!=null && (fieldValue == null || fieldValue.trim().equalsIgnoreCase("null")|| fieldValue.trim().length()<=0)) { - lookup.loadUserData(0, "", getDbInfo(), getUserId()); - for (lookup.resetNext(); lookup.hasNext();) { - idNamevalue = lookup.getNext(); - break; - - } - if(idNamevalue!=null){ - fieldDefValue = nvl(idNamevalue.getId()); - fieldDefDisplay = nvl(idNamevalue.getName()); - } - } else { - try { - // -2 indicates to run the whole sql for matching value - lookup.loadUserData(-2, "", getDbInfo(), getUserId()); - lookup.trimToSize(); - for (lookup.resetNext(); lookup.hasNext();) { - IdNameValue value = lookup.getNext(); - if(value != null && value.getId() != null && value.getName() != null ) { - fieldDefValue = nvl(value.getId()); - if (fieldValue != null && fieldValue.equals(value.getId())) { - fieldDefDisplay = nvl(value.getName()); - break; - } - else { - fieldDefValue = ""; - fieldDefDisplay = ""; - } - } - } - if (fieldDefDisplay == null || fieldDefDisplay.length()<=0) { - fieldDefDisplay = nvl(fieldDefValue); - } - - if(oldSQL != null && !oldSQL.equals("") && lookup!=null) { - ((IdNameSql)lookup).setSQL(oldSQL); - } - - } catch (Exception e) { - //throw new RaptorRuntimeException(e); - } - - - //----- END ---// - - - if(getFieldDefaultSQL()!=null && (fieldValue == null || fieldValue.trim().equalsIgnoreCase("null")|| fieldValue.length()<=0)) { - fieldDefValue = nvl((idNamevalue!=null)?idNamevalue.getId():""); - fieldDefDisplay = nvl((idNamevalue!=null)?idNamevalue.getName():""); - } else { - if(fieldValue == null || fieldValue.trim().equalsIgnoreCase("null")|| fieldValue.length()<=0) fieldValue=""; - fieldDefValue = nvl(fieldDefValue); - fieldDefDisplay = nvl(fieldDefDisplay); - } - - } - }catch(Exception e) { //throw new RaptorRuntimeException(e); - } - if(isVisible()) { - /* return "<input type=text class=\"text\" size=30 maxlength=50 id=\"" + fieldName +"\" name=\"" + fieldName + "\" value=\"" - + nvl(fieldDefValue) + "\">\n" + "<a href=\"javascript:showArgPopupNew('" - + fieldName + "', 'document.formd." + fieldName - + "')\"><img border=0 src=\"" + AppUtils.getImgFolderURL() - + "shareicon.gif\" " + getHelpLink(fieldName); - */ - return "obj.value=\""+Utils.singleQuoteEncode(nvl(fieldDefValue))+"\";"; - - } else - return ""; - } else if (fieldType.equals(FFT_HIDDEN) || fieldType.equals(FFT_TEXT) || fieldType.equals(FFT_TEXTAREA) ) { - StringBuffer sb = new StringBuffer(); - String oldSQL = ""; - try { - IdNameList lookup = getLookupList(); - //if(dependsOn != null && dependsOn != "") { - //if(dependsOn != null && dependsOn != "" ) { - IdNameSql lu = (IdNameSql) lookup; - String SQL = lu.getSql(); - //System.out.println("SQL HIDDEN 1 " + SQL); - oldSQL = lu.getSql(); - if(formValues != null) { - Set set = formValues.entrySet(); - String value = ""; - for(Iterator iter = set.iterator(); iter.hasNext(); ) { - Map.Entry entry = (Entry) iter.next(); - value = (String) entry.getValue(); - if(value == null || value.trim().length()<=0) { - value = "NULL"; + oldSQL = lu.getSql(); + if (formValues != null) { + Set set = formValues.entrySet(); + String value = ""; + for (Iterator iter = set.iterator(); iter.hasNext();) { + Map.Entry entry = (Entry) iter.next(); + value = (String) entry.getValue(); + if (inSchedule) { + try { + value = java.net.URLDecoder.decode(Utils.oracleSafe(value), "UTF-8"); + } catch (UnsupportedEncodingException ex) { + + } + } + SQL = Utils.replaceInString(SQL, "[" + entry.getKey() + "]", value); + // if(SQL.indexOf("'"+"["+entry.getKey()+"]"+"'")!=-1) { + if (SQL.indexOf("'" + "[" + entry.getKey() + "]" + "'") != -1 + || SQL.indexOf("'" + "[" + entry.getKey()) != -1 + || SQL.indexOf(entry.getKey() + "]" + "'") != -1 + || SQL.indexOf("'%" + "[" + entry.getKey() + "]" + "%'") != -1 + || SQL.indexOf("'%" + "[" + entry.getKey()) != -1 + || SQL.indexOf(entry.getKey() + "]" + "%'") != -1 + || SQL.indexOf("'_" + "[" + entry.getKey() + "]" + "_'") != -1 + || SQL.indexOf("'_" + "[" + entry.getKey()) != -1 + || SQL.indexOf(entry.getKey() + "]" + "_'") != -1 + || SQL.indexOf("'%_" + "[" + entry.getKey() + "]" + "_%'") != -1 + || SQL.indexOf("'%_" + "[" + entry.getKey()) != -1 + || SQL.indexOf(entry.getKey() + "]" + "_%'") != -1) { + + SQL = Utils.replaceInString(SQL, "[" + entry.getKey() + "]", nvl(value, "NULL")); + } else { + // Added to prevent SQL Injection + if (SQL.indexOf("[" + entry.getKey() + "]") != -1) { + try { + double vD = Double.parseDouble(value); + SQL = Utils.replaceInString(SQL, "[" + entry.getKey() + "]", + nvl(value, "NULL")); + } catch (NumberFormatException ex) { + throw new UserDefinedException( + "Expected number, Given String for the form field \"" + "[" + + entry.getKey() + "]" + "\""); } - if(inSchedule) { - try { - value = java.net.URLDecoder.decode(value, "UTF-8"); - } catch (UnsupportedEncodingException ex) { - - } - } - //System.out.println("HIDDEN " + "["+entry.getKey()+"]" + "-" + value); - SQL = Utils.replaceInString(SQL, "["+entry.getKey()+"]", value); } - - lookup = new IdNameSql(-1,SQL,lu.getDefaultSQL()); } - //System.out.println("SQL HIDDEN 2 " + SQL); - //} - lookupList = lookup; - //} - if(nvl(fieldValue).length()>0 && (dependsOn == null || dependsOn.length()<=0)) { - sb.append((fieldValue!=null)?"obj.value=\""+nvl(fieldValue)+"\";":""); - } else if (lookup != null) { - lookup.loadUserData(0, "", getDbInfo(), getUserId()); - int iCnt = 0; - for (lookup.resetNext(); lookup.hasNext(); iCnt++) { - IdNameValue value = lookup.getNext(); - //System.out.println("HIDDEN " + value.getId() + " " + value.getName()); - sb.append((value!=null)?"obj.value=\""+nvl(value.getId())+"\";":""); - if(value.isReadOnly()) - sb.append("obj.disabled=true;"); - else - sb.append("obj.disabled=false;"); - break; - } // for - if(lookup.size()<=0) { - sb.append("obj.value=\"\""); - } - } else { - sb.append((fieldValue!=null)?"obj.value=\""+Utils.singleQuoteEncode(nvl(fieldValue))+"\";":""); + if (getFieldDefaultSQL() != null && (fieldValue == null + || fieldValue.trim().equalsIgnoreCase("null") || fieldValue.trim().length() <= 0)) + lookup = new IdNameSql(-1, SQL, lu.getDefaultSQL()); + else + lookup = new IdNameSql(-1, SQL, null); } - if(oldSQL != null && !oldSQL.equals("")) { - ((IdNameSql)lookup).setSQL(oldSQL); - } - // lookup.clearData(); - } catch (Exception e) { - //throw new RaptorRuntimeException(e); } - //if(isVisible()) - return sb.toString() ; - } else if (fieldType.equals(FFT_LIST_BOX)) { - StringBuffer sb = new StringBuffer(); - //System.out.println("COMBO BOX " + fieldName); - String oldSQL = ""; - if (!required) - sb.append("obj.options[obj.options.length] = new Option('-->select value<--','');"); + // lookupList = lookup; - IdNameList lookup = getLookupList(); - try { - if(!hasPredefinedList) { - //if(dependsOn != null && dependsOn != "") { - //if(dependsOn != null && dependsOn != "" ) { - IdNameSql lu = (IdNameSql) lookup; - String SQL = ""; - SQL = lu.getSql(); - /*if(nvl(fieldValue,"").length()<=0) - SQL = lu.getSql(); - else - SQL = lu.getBaseSQLForPDFExcel(false); - */ - //System.out.println("FORMFIELD 6666667 First" + ((IdNameSql)lookup).getSql()); - oldSQL = lu.getSql(); - //SQL = Utils.replaceInString(SQL, "[VALUE]", fieldValue); - if(formValues != null) { - Set set = formValues.entrySet(); - String value = ""; - for(Iterator iter = set.iterator(); iter.hasNext(); ) { - Map.Entry entry = (Entry) iter.next(); - value = (String) entry.getValue(); - if(inSchedule) { - try { - value = java.net.URLDecoder.decode(Utils.oracleSafe(value), "UTF-8"); - } catch (UnsupportedEncodingException ex) { - - } - } - if (value!=null && (value.length() <=0 || value.equals("NULL"))) { - value = "NULL"; - SQL = Utils.replaceInString(SQL, "'["+entry.getKey()+"]'", value); - SQL = Utils.replaceInString(SQL, "["+entry.getKey()+"]", value); - } else { - SQL = Utils.replaceInString(SQL, "["+entry.getKey()+"]", value); - } + if (getFieldDefaultSQL() != null && (fieldValue == null || fieldValue.trim().equalsIgnoreCase("null") + || fieldValue.trim().length() <= 0)) { + lookup.loadUserData(0, "", getDbInfo(), getUserId()); + for (lookup.resetNext(); lookup.hasNext();) { + idNamevalue = lookup.getNext(); + break; + + } + if (idNamevalue != null) { + fieldDefValue = nvl(idNamevalue.getId()); + fieldDefDisplay = nvl(idNamevalue.getName()); + } + } else { + try { + // -2 indicates to run the whole sql for matching value + lookup.loadUserData(-2, "", getDbInfo(), getUserId()); + lookup.trimToSize(); + for (lookup.resetNext(); lookup.hasNext();) { + IdNameValue value = lookup.getNext(); + if (value != null && value.getId() != null && value.getName() != null) { + fieldDefValue = nvl(value.getId()); + if (fieldValue != null && fieldValue.equals(value.getId())) { + fieldDefDisplay = nvl(value.getName()); + break; + } else { + fieldDefValue = ""; + fieldDefDisplay = ""; } - lookup = new IdNameSql(-1,SQL,lu.getDefaultSQL()); } - //} - lookupList = lookup; - - //} - try { - lookup.loadUserData(0, "", getDbInfo(), getUserId()); - } catch (Exception e ){ e.printStackTrace(); //throw new RaptorRuntimeException(e); + } + if (fieldDefDisplay == null || fieldDefDisplay.length() <= 0) { + fieldDefDisplay = nvl(fieldDefValue); + } + + if (oldSQL != null && !oldSQL.equals("") && lookup != null) { + ((IdNameSql) lookup).setSQL(oldSQL); + } + + } catch (Exception e) { + // throw new RaptorRuntimeException(e); } + + // ----- END ---// + + if (getFieldDefaultSQL() != null && (fieldValue == null + || fieldValue.trim().equalsIgnoreCase("null") || fieldValue.length() <= 0)) { + fieldDefValue = nvl((idNamevalue != null) ? idNamevalue.getId() : ""); + fieldDefDisplay = nvl((idNamevalue != null) ? idNamevalue.getName() : ""); + } else { + if (fieldValue == null || fieldValue.trim().equalsIgnoreCase("null") + || fieldValue.length() <= 0) + fieldValue = ""; + fieldDefValue = nvl(fieldDefValue); + fieldDefDisplay = nvl(fieldDefDisplay); } - lookup.trimToSize(); - - String selectedValue = ""; - int count = 0; - for (lookup.resetNext(); lookup.hasNext();) { + + } + } catch (Exception e) { // throw new RaptorRuntimeException(e); + } + if (isVisible()) { + /* + * return "<input type=text class=\"text\" size=30 maxlength=50 id=\"" + + * fieldName +"\" name=\"" + fieldName + "\" value=\"" + nvl(fieldDefValue) + + * "\">\n" + "<a href=\"javascript:showArgPopupNew('" + fieldName + + * "', 'document.formd." + fieldName + "')\"><img border=0 src=\"" + + * AppUtils.getImgFolderURL() + "shareicon.gif\" " + getHelpLink(fieldName); + */ + return "obj.value=\"" + Utils.singleQuoteEncode(nvl(fieldDefValue)) + "\";"; + + } else + return ""; + } else if (fieldType.equals(FFT_HIDDEN) || fieldType.equals(FFT_TEXT) || fieldType.equals(FFT_TEXTAREA)) { + StringBuffer sb = new StringBuffer(); + String oldSQL = ""; + try { + IdNameList lookup = getLookupList(); + // if(dependsOn != null && dependsOn != "") { + // if(dependsOn != null && dependsOn != "" ) { + IdNameSql lu = (IdNameSql) lookup; + String SQL = lu.getSql(); + // System.out.println("SQL HIDDEN 1 " + SQL); + oldSQL = lu.getSql(); + if (formValues != null) { + Set set = formValues.entrySet(); + String value = ""; + for (Iterator iter = set.iterator(); iter.hasNext();) { + Map.Entry entry = (Entry) iter.next(); + value = (String) entry.getValue(); + if (value == null || value.trim().length() <= 0) { + value = "NULL"; + } + if (inSchedule) { + try { + value = java.net.URLDecoder.decode(value, "UTF-8"); + } catch (UnsupportedEncodingException ex) { + + } + } + // System.out.println("HIDDEN " + "["+entry.getKey()+"]" + "-" + value); + SQL = Utils.replaceInString(SQL, "[" + entry.getKey() + "]", value); + } + + lookup = new IdNameSql(-1, SQL, lu.getDefaultSQL()); + } + // System.out.println("SQL HIDDEN 2 " + SQL); + // } + lookupList = lookup; + // } + if (nvl(fieldValue).length() > 0 && (dependsOn == null || dependsOn.length() <= 0)) { + sb.append((fieldValue != null) ? "obj.value=\"" + nvl(fieldValue) + "\";" : ""); + } else if (lookup != null) { + lookup.loadUserData(0, "", getDbInfo(), getUserId()); + int iCnt = 0; + for (lookup.resetNext(); lookup.hasNext(); iCnt++) { IdNameValue value = lookup.getNext(); - if(value != null && value.getId() != null && value.getName() != null ) { - /*if (count == 0 && required) { - selectedValue = value.getId(); - count++; - } else if (nvl(fieldValue).length()>0){ - if (fieldValue != null && fieldValue.equals(value.getId())){ - selectedValue = value.getId(); + // System.out.println("HIDDEN " + value.getId() + " " + value.getName()); + sb.append((value != null) ? "obj.value=\"" + nvl(value.getId()) + "\";" : ""); + if (value.isReadOnly()) + sb.append("obj.disabled=true;"); + else + sb.append("obj.disabled=false;"); + break; + } // for + if (lookup.size() <= 0) { + sb.append("obj.value=\"\""); + + } + } else { + sb.append((fieldValue != null) ? "obj.value=\"" + Utils.singleQuoteEncode(nvl(fieldValue)) + "\";" + : ""); + } + if (oldSQL != null && !oldSQL.equals("")) { + ((IdNameSql) lookup).setSQL(oldSQL); + } + // lookup.clearData(); + } catch (Exception e) { + // throw new RaptorRuntimeException(e); + } + // if(isVisible()) + return sb.toString(); + } else if (fieldType.equals(FFT_LIST_BOX)) { + StringBuffer sb = new StringBuffer(); + // System.out.println("COMBO BOX " + fieldName); + String oldSQL = ""; + if (!required) + sb.append("obj.options[obj.options.length] = new Option('-->select value<--','');"); + + IdNameList lookup = getLookupList(); + try { + if (!hasPredefinedList) { + // if(dependsOn != null && dependsOn != "") { + // if(dependsOn != null && dependsOn != "" ) { + IdNameSql lu = (IdNameSql) lookup; + String SQL = ""; + SQL = lu.getSql(); + /* + * if(nvl(fieldValue,"").length()<=0) SQL = lu.getSql(); else SQL = + * lu.getBaseSQLForPDFExcel(false); + */ + // System.out.println("FORMFIELD 6666667 First" + ((IdNameSql)lookup).getSql()); + oldSQL = lu.getSql(); + // SQL = Utils.replaceInString(SQL, "[VALUE]", fieldValue); + if (formValues != null) { + Set set = formValues.entrySet(); + String value = ""; + for (Iterator iter = set.iterator(); iter.hasNext();) { + Map.Entry entry = (Entry) iter.next(); + value = (String) entry.getValue(); + if (inSchedule) { + try { + value = java.net.URLDecoder.decode(Utils.oracleSafe(value), "UTF-8"); + } catch (UnsupportedEncodingException ex) { + } - count++; + } + if (value != null && (value.length() <= 0 || value.equals("NULL"))) { + value = "NULL"; + SQL = Utils.replaceInString(SQL, "'[" + entry.getKey() + "]'", value); + SQL = Utils.replaceInString(SQL, "[" + entry.getKey() + "]", value); } else { - count++; - } */ - if (count == 0) { - if(required){ - selectedValue = value.getId(); - } - count++; + SQL = Utils.replaceInString(SQL, "[" + entry.getKey() + "]", value); } - sb.append("obj.options[obj.options.length] = new Option('" + Utils.singleQuoteEncode(value.getName())+"','"+Utils.singleQuoteEncode(value.getId())+"');"); - if ((fieldValue != null && fieldValue.equals(value.getId()))){ - sb.append("obj.options[obj.options.length-1].selected=true;"); + } + lookup = new IdNameSql(-1, SQL, lu.getDefaultSQL()); + } + // } + lookupList = lookup; + + // } + try { + lookup.loadUserData(0, "", getDbInfo(), getUserId()); + } catch (Exception e) { + logger.error(EELFLoggerDelegate.errorLogger, "getAjaxHtml () failed", e); + + } + } + lookup.trimToSize(); + + String selectedValue = ""; + int count = 0; + for (lookup.resetNext(); lookup.hasNext();) { + IdNameValue value = lookup.getNext(); + if (value != null && value.getId() != null && value.getName() != null) { + /* + * if (count == 0 && required) { selectedValue = value.getId(); count++; } else + * if (nvl(fieldValue).length()>0){ if (fieldValue != null && + * fieldValue.equals(value.getId())){ selectedValue = value.getId(); } count++; + * } else { count++; } + */ + if (count == 0) { + if (required) { selectedValue = value.getId(); } - if(value.isReadOnly()) - sb.append("obj.disabled=true;"); - else - sb.append("obj.disabled=false;"); - + count++; } - } // for - if (formValues.containsKey(fieldDisplayName)){ - formValues.remove(fieldDisplayName); + sb.append("obj.options[obj.options.length] = new Option('" + + Utils.singleQuoteEncode(value.getName()) + "','" + + Utils.singleQuoteEncode(value.getId()) + "');"); + if ((fieldValue != null && fieldValue.equals(value.getId()))) { + sb.append("obj.options[obj.options.length-1].selected=true;"); + selectedValue = value.getId(); + } + if (value.isReadOnly()) + sb.append("obj.disabled=true;"); + else + sb.append("obj.disabled=false;"); + } - formValues.put(fieldDisplayName, selectedValue); - } catch (Exception e) { - //throw new RaptorRuntimeException(e); + } // for + if (formValues.containsKey(fieldDisplayName)) { + formValues.remove(fieldDisplayName); } - if(!hasPredefinedList) { - if(oldSQL != null && !oldSQL.equals("")) { - ((IdNameSql)lookup).setSQL(oldSQL); - } + formValues.put(fieldDisplayName, selectedValue); + } catch (Exception e) { + // throw new RaptorRuntimeException(e); + } + if (!hasPredefinedList) { + if (oldSQL != null && !oldSQL.equals("")) { + ((IdNameSql) lookup).setSQL(oldSQL); } - //System.out.println("FORMFIELD 6666667 " + ((IdNameSql)lookup).getSql()); - if( isVisible()) - return sb.toString(); - else return ""; - } + } + // System.out.println("FORMFIELD 6666667 " + ((IdNameSql)lookup).getSql()); + if (isVisible()) + return sb.toString(); + else + return ""; + } - return ""; + return ""; } - - public String getHtml(String fieldValue, HashMap formValues, ReportRuntime rr, boolean inSchedule) throws RaptorRuntimeException { - fieldValue = nvl(fieldValue, defaultValue); - int MILLIS_IN_DAY = 1000 * 60 * 60 * 24; - String readOnlyInSql = "ff_readonly"; - boolean readOnly = false; - try { - if(fieldValue !=null && fieldValue.length() > 0) - fieldValue = java.net.URLDecoder.decode(fieldValue, "UTF-8"); - } catch (UnsupportedEncodingException ex) {} - catch (IllegalArgumentException ex1){} - catch (Exception ex2){} - //System.out.println(fieldName + " " + fieldType + " " + fieldValue); - if (fieldType.equals(FFT_TEXT_W_POPUP)) { - //System.out.println("TEXT POPUP " + fieldName); - String oldSQL = ""; - IdNameValue idNamevalue = null; - String fieldDefValue=""; - String fieldDefDisplay=""; - IdNameList lookup = null; - try { - lookup = getLookupList(); - if(!hasPredefinedList) { - if(dependsOn != null && dependsOn != "" ) { - IdNameSql lu = (IdNameSql) lookup; - String SQL = getBaseWholeSQL(); - if(SQL.toLowerCase().indexOf(readOnlyInSql) != -1) { - SQL = getBaseWholeReadonlySQL(); - } - oldSQL = lu.getSql(); - if(formValues != null) { + + public String getHtml(String fieldValue, HashMap formValues, ReportRuntime rr, boolean inSchedule) + throws RaptorRuntimeException { + fieldValue = nvl(fieldValue, defaultValue); + int MILLIS_IN_DAY = 1000 * 60 * 60 * 24; + String readOnlyInSql = "ff_readonly"; + boolean readOnly = false; + try { + if (fieldValue != null && fieldValue.length() > 0) + fieldValue = java.net.URLDecoder.decode(fieldValue, "UTF-8"); + } catch (UnsupportedEncodingException ex) { + } catch (IllegalArgumentException ex1) { + } catch (Exception ex2) { + } + // System.out.println(fieldName + " " + fieldType + " " + fieldValue); + if (fieldType.equals(FFT_TEXT_W_POPUP)) { + // System.out.println("TEXT POPUP " + fieldName); + String oldSQL = ""; + IdNameValue idNamevalue = null; + String fieldDefValue = ""; + String fieldDefDisplay = ""; + IdNameList lookup = null; + try { + lookup = getLookupList(); + if (!hasPredefinedList) { + if (dependsOn != null && dependsOn != "") { + IdNameSql lu = (IdNameSql) lookup; + String SQL = getBaseWholeSQL(); + if (SQL.toLowerCase().indexOf(readOnlyInSql) != -1) { + SQL = getBaseWholeReadonlySQL(); + } + oldSQL = lu.getSql(); + if (formValues != null) { Set set = formValues.entrySet(); String value = ""; - for(Iterator iter = set.iterator(); iter.hasNext(); ) { + for (Iterator iter = set.iterator(); iter.hasNext();) { Map.Entry entry = (Entry) iter.next(); value = (String) entry.getValue(); - SQL = Utils.replaceInString(SQL, "["+entry.getKey()+"]", value); -// if(SQL.indexOf("'"+"["+entry.getKey()+"]"+"'")!=-1) { - if(SQL.indexOf("'"+"["+entry.getKey()+"]"+"'")!=-1 || SQL.indexOf("'"+"["+entry.getKey())!=-1 || SQL.indexOf(entry.getKey()+"]"+"'")!=-1 - || SQL.indexOf("'%"+"["+entry.getKey()+"]"+"%'")!=-1 || SQL.indexOf("'%"+"["+entry.getKey())!=-1 || SQL.indexOf(entry.getKey()+"]"+"%'")!=-1 - || SQL.indexOf("'_"+"["+entry.getKey()+"]"+"_'")!=-1 || SQL.indexOf("'_"+"["+entry.getKey())!=-1 || SQL.indexOf(entry.getKey()+"]"+"_'")!=-1 - || SQL.indexOf("'%_"+"["+entry.getKey()+"]"+"_%'")!=-1 || SQL.indexOf("'%_"+"["+entry.getKey())!=-1 || SQL.indexOf(entry.getKey()+"]"+"_%'")!=-1) { - - SQL = Utils.replaceInString(SQL, "["+entry.getKey()+"]", nvl( - value, "NULL")); + SQL = Utils.replaceInString(SQL, "[" + entry.getKey() + "]", value); + // if(SQL.indexOf("'"+"["+entry.getKey()+"]"+"'")!=-1) { + if (SQL.indexOf("'" + "[" + entry.getKey() + "]" + "'") != -1 + || SQL.indexOf("'" + "[" + entry.getKey()) != -1 + || SQL.indexOf(entry.getKey() + "]" + "'") != -1 + || SQL.indexOf("'%" + "[" + entry.getKey() + "]" + "%'") != -1 + || SQL.indexOf("'%" + "[" + entry.getKey()) != -1 + || SQL.indexOf(entry.getKey() + "]" + "%'") != -1 + || SQL.indexOf("'_" + "[" + entry.getKey() + "]" + "_'") != -1 + || SQL.indexOf("'_" + "[" + entry.getKey()) != -1 + || SQL.indexOf(entry.getKey() + "]" + "_'") != -1 + || SQL.indexOf("'%_" + "[" + entry.getKey() + "]" + "_%'") != -1 + || SQL.indexOf("'%_" + "[" + entry.getKey()) != -1 + || SQL.indexOf(entry.getKey() + "]" + "_%'") != -1) { + + SQL = Utils.replaceInString(SQL, "[" + entry.getKey() + "]", nvl(value, "NULL")); } else { // Added to prevent SQL Injection - if(SQL.indexOf("["+entry.getKey()+"]")!=-1) { + if (SQL.indexOf("[" + entry.getKey() + "]") != -1) { try { double vD = Double.parseDouble(value); - SQL = Utils.replaceInString(SQL, "["+entry.getKey()+"]", nvl( - value, "NULL")); - } catch (NumberFormatException ex) { - throw new UserDefinedException("Expected number, Given String for the form field \"" + "["+entry.getKey()+"]"+"\""); - } + SQL = Utils.replaceInString(SQL, "[" + entry.getKey() + "]", + nvl(value, "NULL")); + } catch (NumberFormatException ex) { + throw new UserDefinedException( + "Expected number, Given String for the form field \"" + "[" + + entry.getKey() + "]" + "\""); + } } } + } + if (getFieldDefaultSQL() != null && (fieldValue == null + || fieldValue.trim().equalsIgnoreCase("null") || fieldValue.trim().length() <= 0)) + lookup = new IdNameSql(-1, SQL, lu.getDefaultSQL()); + else + lookup = new IdNameSql(-1, SQL, null); + } + } + // lookupList = lookup; + + if (getFieldDefaultSQL() != null && (fieldValue == null + || fieldValue.trim().equalsIgnoreCase("null") || fieldValue.trim().length() <= 0)) { + lookup.loadUserData(0, "", getDbInfo(), getUserId()); + for (lookup.resetNext(); lookup.hasNext();) { + idNamevalue = lookup.getNext(); + break; + + } + fieldDefValue = nvl(idNamevalue.getId()); + fieldDefDisplay = nvl(idNamevalue.getName()); + } else { + try { + // -2 indicates to run the whole sql for matching value + lookup.loadUserData(-2, "", getDbInfo(), getUserId()); + } catch (Exception e) { + // throw new RaptorRuntimeException(e); + } + + lookup.trimToSize(); + for (lookup.resetNext(); lookup.hasNext();) { + IdNameValue value = lookup.getNext(); + if (value != null && value.getId() != null && value.getName() != null) { + fieldDefValue = nvl(value.getId()); + if (fieldValue != null && fieldValue.equals(value.getId())) { + fieldDefDisplay = nvl(value.getName()); + break; + } else { + fieldDefValue = ""; + fieldDefDisplay = ""; } - if(getFieldDefaultSQL()!=null && (fieldValue == null || fieldValue.trim().equalsIgnoreCase("null")|| fieldValue.trim().length()<=0)) - lookup = new IdNameSql(-1,SQL,lu.getDefaultSQL()); - else - lookup = new IdNameSql(-1,SQL,null); + } + } + if (fieldDefDisplay == null || fieldDefDisplay.length() <= 0) { + fieldDefDisplay = nvl(fieldDefValue); + } + + // ----- END ---// + + if (getFieldDefaultSQL() != null && (fieldValue == null + || fieldValue.trim().equalsIgnoreCase("null") || fieldValue.length() <= 0)) { + fieldDefValue = nvl((idNamevalue != null) ? idNamevalue.getId() : ""); + fieldDefDisplay = nvl((idNamevalue != null) ? idNamevalue.getName() : ""); + } else { + if (fieldValue == null || fieldValue.trim().equalsIgnoreCase("null") + || fieldValue.length() <= 0) + fieldValue = ""; + fieldDefValue = nvl(fieldDefValue); + fieldDefDisplay = nvl(fieldDefDisplay); + } + + } + } else { + lookup.trimToSize(); + for (lookup.resetNext(); lookup.hasNext();) { + IdNameValue value = lookup.getNext(); + if (value != null && value.getId() != null && value.getName() != null) { + fieldDefValue = nvl(value.getId()); + if (fieldValue != null && fieldValue.equals(value.getId())) { + fieldDefDisplay = nvl(value.getName()); + break; + } else { + fieldDefValue = ""; + fieldDefDisplay = ""; + } + } + } + if (fieldDefDisplay == null || fieldDefDisplay.length() <= 0) { + fieldDefDisplay = nvl(fieldDefValue); } } - //lookupList = lookup; - - if(getFieldDefaultSQL()!=null && (fieldValue == null || fieldValue.trim().equalsIgnoreCase("null")|| fieldValue.trim().length()<=0)) { - lookup.loadUserData(0, "", getDbInfo(), getUserId()); - for (lookup.resetNext(); lookup.hasNext();) { - idNamevalue = lookup.getNext(); - break; - - } - fieldDefValue = nvl(idNamevalue.getId()); - fieldDefDisplay = nvl(idNamevalue.getName()); - } else { - try { - // -2 indicates to run the whole sql for matching value - lookup.loadUserData(-2, "", getDbInfo(), getUserId()); - } catch (Exception e) { - //throw new RaptorRuntimeException(e); - } - - lookup.trimToSize(); - for (lookup.resetNext(); lookup.hasNext();) { - IdNameValue value = lookup.getNext(); - if(value != null && value.getId() != null && value.getName() != null ) { - fieldDefValue = nvl(value.getId()); - if (fieldValue != null && fieldValue.equals(value.getId())) { - fieldDefDisplay = nvl(value.getName()); - break; - } - else { - fieldDefValue = ""; - fieldDefDisplay = ""; - } - } - } - if (fieldDefDisplay == null || fieldDefDisplay.length()<=0) { - fieldDefDisplay = nvl(fieldDefValue); - } - - - - //----- END ---// - - - if(getFieldDefaultSQL()!=null && (fieldValue == null || fieldValue.trim().equalsIgnoreCase("null")|| fieldValue.length()<=0)) { - fieldDefValue = nvl((idNamevalue!=null)?idNamevalue.getId():""); - fieldDefDisplay = nvl((idNamevalue!=null)?idNamevalue.getName():""); - } else { - if(fieldValue == null || fieldValue.trim().equalsIgnoreCase("null")|| fieldValue.length()<=0) fieldValue=""; - fieldDefValue = nvl(fieldDefValue); - fieldDefDisplay = nvl(fieldDefDisplay); - } - - } - } else { - lookup.trimToSize(); - for (lookup.resetNext(); lookup.hasNext();) { - IdNameValue value = lookup.getNext(); - if(value != null && value.getId() != null && value.getName() != null ) { - fieldDefValue = nvl(value.getId()); - if (fieldValue != null && fieldValue.equals(value.getId())) { - fieldDefDisplay = nvl(value.getName()); - break; - } - else { - fieldDefValue = ""; - fieldDefDisplay = ""; - } - } - } - if (fieldDefDisplay == null || fieldDefDisplay.length()<=0) { - fieldDefDisplay = nvl(fieldDefValue); - } - } - }catch(Exception e) { //throw new RaptorRuntimeException(e); - } - - if(!hasPredefinedList) { - if(oldSQL != null && !oldSQL.equals("")) { - ((IdNameSql)lookup).setSQL(oldSQL); - } + } catch (Exception e) { // throw new RaptorRuntimeException(e); + } + + if (!hasPredefinedList) { + if (oldSQL != null && !oldSQL.equals("")) { + ((IdNameSql) lookup).setSQL(oldSQL); + } } - - if(isVisible()) { - /* return "<input type=text class=\"text\" size=30 maxlength=50 id=\"" + fieldName +"\" name=\"" + fieldName + "\" value=\"" - + nvl(fieldDefValue) + "\">\n" + "<a href=\"javascript:showArgPopupNew('" - + fieldName + "', 'document.formd." + fieldName - + "')\"><img border=0 src=\"" + AppUtils.getImgFolderURL() - + "shareicon.gif\" " + getHelpLink(fieldName); - */ - String progress = "<div id=\""+fieldName+"_content\" style=\"display:none;width:100%;height:100%;align:center;\"> <img src=\""+AppUtils.getImgFolderURL()+"progress.gif\" border=\"0\" alt=\"Loading, please wait...\" /></div> "; - - return progress+"<input type=\"text\" class=\"text\" name=\""+getFieldName()+"_display\" readonly=true value=\""+ fieldDefDisplay +"\""+ getCallableJavascript(getFieldName(), rr) + getHelpLink(fieldName) + " \n " - +"<input type=\"hidden\" name=\""+getFieldName()+"\" value=\""+nvl(fieldDefValue)+"\"/> \n \n" - + "<a href=\"javascript:showArgPopupNew('" - + fieldName + "', 'document.formd." + fieldName - + "')\"><img border=0 src=\"" + AppUtils.getImgFolderURL() - + "shareicon.gif\" " + getHelpLink(fieldName); - - } else - return ""; + + if (isVisible()) { + /* + * return "<input type=text class=\"text\" size=30 maxlength=50 id=\"" + + * fieldName +"\" name=\"" + fieldName + "\" value=\"" + nvl(fieldDefValue) + + * "\">\n" + "<a href=\"javascript:showArgPopupNew('" + fieldName + + * "', 'document.formd." + fieldName + "')\"><img border=0 src=\"" + + * AppUtils.getImgFolderURL() + "shareicon.gif\" " + getHelpLink(fieldName); + */ + String progress = "<div id=\"" + fieldName + + "_content\" style=\"display:none;width:100%;height:100%;align:center;\"> <img src=\"" + + AppUtils.getImgFolderURL() + + "progress.gif\" border=\"0\" alt=\"Loading, please wait...\" /></div> "; + + return progress + "<input type=\"text\" class=\"text\" name=\"" + getFieldName() + + "_display\" readonly=true value=\"" + fieldDefDisplay + "\"" + + getCallableJavascript(getFieldName(), rr) + getHelpLink(fieldName) + " \n " + + "<input type=\"hidden\" name=\"" + getFieldName() + "\" value=\"" + nvl(fieldDefValue) + + "\"/> \n \n" + "<a href=\"javascript:showArgPopupNew('" + fieldName + + "', 'document.formd." + fieldName + "')\"><img border=0 src=\"" + AppUtils.getImgFolderURL() + + "shareicon.gif\" " + getHelpLink(fieldName); + + } else + return ""; } else if (fieldType.equals(FFT_TEXT)) { - IdNameValue value = null; - String strValue = ""; - boolean avail_ReadOnly = false; - try { - IdNameList lookup = getLookupList(); - IdNameSql lu = null; - String valueSQL = ""; - String oldSQL = ""; - if(lookup instanceof IdNameSql) { - lu = (IdNameSql) lookup; - if(lu.getSql().length() > 0) { - valueSQL = lu.getSql(); - avail_ReadOnly = (valueSQL.toLowerCase().indexOf(readOnlyInSql)!=-1); - //System.out.println("OLD SQL TEXT" + valueSQL); - //oldSQL = lu.getSql(); - if(formValues != null) { + IdNameValue value = null; + String strValue = ""; + boolean avail_ReadOnly = false; + try { + IdNameList lookup = getLookupList(); + IdNameSql lu = null; + String valueSQL = ""; + String oldSQL = ""; + if (lookup instanceof IdNameSql) { + lu = (IdNameSql) lookup; + if (lu.getSql().length() > 0) { + valueSQL = lu.getSql(); + avail_ReadOnly = (valueSQL.toLowerCase().indexOf(readOnlyInSql) != -1); + // System.out.println("OLD SQL TEXT" + valueSQL); + // oldSQL = lu.getSql(); + if (formValues != null) { Set set = formValues.entrySet(); String value1 = ""; - for(Iterator iter = set.iterator(); iter.hasNext(); ) { + for (Iterator iter = set.iterator(); iter.hasNext();) { Map.Entry entry = (Entry) iter.next(); value1 = (String) entry.getValue(); - if (value1.length() <=0) { + if (value1.length() <= 0) { value1 = "NULL"; - valueSQL = Utils.replaceInString(valueSQL, "'["+entry.getKey()+"]'", value1); - valueSQL = Utils.replaceInString(valueSQL, "["+entry.getKey()+"]", value1); - } else { - valueSQL = Utils.replaceInString(valueSQL, "["+entry.getKey()+"]", value1); + valueSQL = Utils.replaceInString(valueSQL, "'[" + entry.getKey() + "]'", value1); + valueSQL = Utils.replaceInString(valueSQL, "[" + entry.getKey() + "]", value1); + } else { + valueSQL = Utils.replaceInString(valueSQL, "[" + entry.getKey() + "]", value1); } } // should be value one. - //lookup = new IdNameSql(-1,valueSQL,lu.getDefaultSQL()); - } - } - //lookupList = lookup; - //System.out.println("8888888 88 " + valueSQL); - } - if(valueSQL!=null && valueSQL.length()>0) { - DataSet ds = ConnectionUtils.getDataSet(valueSQL.toString(), dbInfo); - strValue = ds.getString(0,1); - if(avail_ReadOnly) readOnly = ds.getString(0, 2).toUpperCase().startsWith("Y")||ds.getString(0, 2).toUpperCase().startsWith("T");; - } - }catch(Exception e) { //throw new RaptorRuntimeException(e); - } - String returnString = ""; - String timestamp ="", timestamphr = "", timestampmin = "", timestampsec = ""; - - returnString = "<input type=text class=\"text\" size="+(validationType.equals(VT_DATE)?"10":"30") +" maxlength=50 id=\"" + fieldName +"\" name=\"" - + fieldName + "\" id='"+ fieldName + "' " - + (((validationType.equals(VT_DATE)||validationType.equals(VT_TIMESTAMP_HR) ||validationType.equals(VT_TIMESTAMP_MIN) ||validationType.equals(VT_TIMESTAMP_SEC))&& !inSchedule) ? "" : "") - + getCallableJavascript(getFieldName(), rr) + " " + (readOnly?" readonly ":" ") + " value=\""; - - - /*if(getFieldDefaultSQL()!=null) - returnString += nvl(value.getId()); - else - returnString += fieldValue; - */ - if(fieldValue!=null && fieldValue.length()>0 && (!(fieldValue.toUpperCase().indexOf("SELECT ")!= -1 && fieldValue.toUpperCase().indexOf("FROM")!= -1)) ) { - if(validationType.startsWith("TIMESTAMP")) { - returnString += nvl((fieldValue!=null)?fieldValue.split(" ")[0]:""); - if(fieldValue!=null && fieldValue.length()>0) { - timestamp = (fieldValue.split(" ").length > 1)?fieldValue.split(" ")[1]:""; - String timestampArr[] = timestamp.split(":"); - if((timestampArr.length == 1) || (timestampArr.length == 2) || (timestampArr.length == 3)) - timestamphr = timestampArr[0]; - if((timestampArr.length == 2) || (timestampArr.length == 3)) - timestampmin = timestampArr[1]; - if(timestampArr.length == 3) - timestampsec = timestampArr[2]; + // lookup = new IdNameSql(-1,valueSQL,lu.getDefaultSQL()); } - - } else returnString += fieldValue; - - } else if(getFieldDefaultSQL()!=null) { - - if(validationType.startsWith("TIMESTAMP")) { - returnString += nvl((strValue.length()>0)?strValue.split(" ")[0]:""); - if(strValue.length()>0) { - timestamp = (strValue.split(" ").length > 1)?strValue.split(" ")[1]:""; - String timestampArr[] = timestamp.split(":"); - if((timestampArr.length == 1) || (timestampArr.length == 2) || (timestampArr.length == 3)) - timestamphr = timestampArr[0]; - if((timestampArr.length == 2) || (timestampArr.length == 3)) - timestampmin = timestampArr[1]; - if(timestampArr.length == 3) + } + // lookupList = lookup; + // System.out.println("8888888 88 " + valueSQL); + } + if (valueSQL != null && valueSQL.length() > 0) { + DataSet ds = ConnectionUtils.getDataSet(valueSQL.toString(), dbInfo); + strValue = ds.getString(0, 1); + if (avail_ReadOnly) + readOnly = ds.getString(0, 2).toUpperCase().startsWith("Y") + || ds.getString(0, 2).toUpperCase().startsWith("T"); + ; + } + } catch (Exception e) { // throw new RaptorRuntimeException(e); + } + String returnString = ""; + String timestamp = "", timestamphr = "", timestampmin = "", timestampsec = ""; + + returnString = "<input type=text class=\"text\" size=" + (validationType.equals(VT_DATE) ? "10" : "30") + + " maxlength=50 id=\"" + fieldName + "\" name=\"" + fieldName + "\" id='" + fieldName + "' " + + (((validationType.equals(VT_DATE) || validationType.equals(VT_TIMESTAMP_HR) + || validationType.equals(VT_TIMESTAMP_MIN) || validationType.equals(VT_TIMESTAMP_SEC)) + && !inSchedule) ? "" : "") + + getCallableJavascript(getFieldName(), rr) + " " + (readOnly ? " readonly " : " ") + " value=\""; + + /* + * if(getFieldDefaultSQL()!=null) returnString += nvl(value.getId()); else + * returnString += fieldValue; + */ + if (fieldValue != null && fieldValue.length() > 0 && (!(fieldValue.toUpperCase().indexOf("SELECT ") != -1 + && fieldValue.toUpperCase().indexOf("FROM") != -1))) { + if (validationType.startsWith("TIMESTAMP")) { + returnString += nvl((fieldValue != null) ? fieldValue.split(" ")[0] : ""); + if (fieldValue != null && fieldValue.length() > 0) { + timestamp = (fieldValue.split(" ").length > 1) ? fieldValue.split(" ")[1] : ""; + String timestampArr[] = timestamp.split(":"); + if ((timestampArr.length == 1) || (timestampArr.length == 2) || (timestampArr.length == 3)) + timestamphr = timestampArr[0]; + if ((timestampArr.length == 2) || (timestampArr.length == 3)) + timestampmin = timestampArr[1]; + if (timestampArr.length == 3) timestampsec = timestampArr[2]; - } - - } else if (nvl(strValue).length()>0) { - returnString += strValue; - } else - returnString += nvl((value!=null)?value.getId():""); - } else if (nvl(strValue).length()>0) { - returnString += strValue; - } else - returnString += nvl((value!=null)?value.getId():""); - - - /*returnString += "\">" - + (validationType.equals(VT_DATE) ? "\n\t\t\t<a href=\"#\" onClick=\"window.dateField=document." - + HTML_FORM - + "." - + fieldName - + ";calendar=window.open('" - + AppUtils.getRaptorActionURL() - + "popup.calendar','cal','WIDTH=200,HEIGHT=250');return false;\">" - + "\n\t\t\t\t<img src=\"" - + AppUtils.getImgFolderURL() - + "calender_icon.gif\" align=absmiddle border=0 width=20 height=20></a>" - : ""); */ - - SimpleDateFormat dtf = new SimpleDateFormat("MM/dd/yyyy"); - String stRangeText = this.getRangeStartDate() == null ? null : dtf.format(this.getRangeStartDate().getTime()); - String endRangeText = this.getRangeEndDate() == null ? null : dtf.format(this.getRangeEndDate().getTime()); - ///////////////////////// - - //get the date sqls - - //System.out.println("////////////start range date before Start" + this.getRangeStartDateSQL()); - - if (this.getRangeStartDateSQL() != null && this.getRangeStartDateSQL().trim().toLowerCase().startsWith("select")){ - //System.out.println("////////////start range date Starting"); - String SQL = this.getRangeStartDateSQL(); - if(formValues != null) { - Set set = formValues.entrySet(); - String v = ""; - for(Iterator iter = set.iterator(); iter.hasNext(); ) { - Map.Entry entry = (Entry) iter.next(); - v = (String) entry.getValue(); - //System.out.println("///////// key is " + entry.getKey() + " = " + v); - SQL = Utils.replaceInString(SQL, "["+entry.getKey()+"]", v); - } - - } - //System.out.println("////////////start range date sql created" + SQL); - try{ - DataSet ds = ConnectionUtils.getDataSet(SQL.toString(), dbInfo); - //System.out.println("////////////start range date is : " + ds.get(0)); - dtf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - Calendar tStart = Calendar.getInstance(); - tStart.setTime(dtf.parse(ds.getString(0,0))); - dtf = new SimpleDateFormat("MM/dd/yyyy"); - stRangeText = dtf.format(tStart.getTime().getTime()-MILLIS_IN_DAY); - - }catch(Exception e){ - System.out.println("Exception////////// : start range date is : " + e); - } - } - - if (this.getRangeEndDateSQL() != null && this.getRangeEndDateSQL().trim().toLowerCase().startsWith("select")){ - //System.out.println("////////////end range date Starting"); - String SQL = this.getRangeEndDateSQL(); - if(formValues != null) { - Set set = formValues.entrySet(); - String v = ""; - for(Iterator iter = set.iterator(); iter.hasNext(); ) { - Map.Entry entry = (Entry) iter.next(); - v = (String) entry.getValue(); - SQL = Utils.replaceInString(SQL, "["+entry.getKey()+"]", v); - } - - } - try{ - DataSet ds = ConnectionUtils.getDataSet(SQL.toString(), dbInfo); - //System.out.println("////////////end range date is : " + ds.get(0)); - dtf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - Calendar tStart = Calendar.getInstance(); - tStart.setTime(dtf.parse(ds.getString(0,0))); - dtf = new SimpleDateFormat("MM/dd/yyyy"); - //endRangeText = dtf.format(tStart.getTime()); - endRangeText = dtf.format(tStart.getTime().getTime()+MILLIS_IN_DAY); - }catch(Exception e){ - System.out.println("Exception////////// : end range date is : " + e); - } - } - - - ////////////////////// - String calendarOnClickMethodCall = ""; - String timeStampStr = ""; - if (stRangeText == null || endRangeText == null) - calendarOnClickMethodCall = "'oCalendar.select(document." + HTML_FORM + "." + fieldName + ", event,\""+ Globals.getCalendarOutputDateFormat() +"\"); return false;'"; - else - calendarOnClickMethodCall = "'oCalendar=new CalendarPopup(\"calendarDiv\", \"calendarFrame\");oCalendar.setCssPrefix(\"raptor\");oCalendar.addDisabledDates(null, \"" + stRangeText + "\"); oCalendar.addDisabledDates(\"" + endRangeText + "\", null); oCalendar.select(document." + HTML_FORM + "." + fieldName + ", event,\""+ Globals.getCalendarOutputDateFormat() +"\"); return false;'"; - returnString += "\" " + getHelpLink(fieldName) - + (validationType.equals(VT_DATE) || validationType.equals(VT_TIMESTAMP_HR) || validationType.equals(VT_TIMESTAMP_MIN) || validationType.equals(VT_TIMESTAMP_SEC) - ? "\n\t\t\t<img src='" + AppUtils.getImgFolderURL()+ "calender_icon.gif' align=absmiddle border=0 width='20' height='20' onClick=" + calendarOnClickMethodCall + " style='cursor:hand'>" - : ""); - if(validationType.equals(VT_TIMESTAMP_HR) || validationType.equals(VT_TIMESTAMP_MIN) || validationType.equals(VT_TIMESTAMP_SEC) ) { - //Add Hours/Minutes and Seconds. - timeStampStr = " <font class=rtabletext>Hour </font><select id = \""+ fieldName+ "_Hr\" name=\""+ fieldName+ "_Hr\" "+ (readOnly?"disabled":"")+" >"; - int hour = 0; - int t_hr = 0; - try { - hour = Integer.parseInt(nvl(rr.getParamValue(fieldName+"_Hr"),"0")); - if(hour == 0) { - if(inSchedule) hour = Integer.parseInt(nvl(((String)formValues.get(fieldName+"_Hr")),"0")); - } -// System.out.println("Hour =" + hour); - } catch (NumberFormatException ex) { hour = 0; } - try { - t_hr = Integer.parseInt(timestamphr); -// System.out.println("THR =" + t_hr); - } catch (NumberFormatException ex) { t_hr = 0;} - - if(hour <= 0) hour = t_hr; - // System.out.println("Form Values 887 " + formValues); - /*if (formValues.containsKey(fieldDisplayName+"_Hr")){ - formValues.remove(fieldDisplayName+"_Hr"); - formValues.put(fieldDisplayName+"_Hr", hour); + } + } else - formValues.put(fieldDisplayName+"_Hr", hour); - System.out.println("Form Values 887 " + formValues); - */ - - //int t_min = Integer.parseInt(timestampmin); - //int t_sec = Integer.parseInt(timestampsec); - for (int i = 0; i < 24; i++) { - if(i==0) timeStampStr += "<option value=\"" + i + "\""+ ((hour==i)?" selected":"") +">00</option>"; - else if(i<10) timeStampStr += "<option value=\"" + i + "\""+ ((hour==i)?" selected":"") +">" + "0"+i + "</option>"; - else timeStampStr += "<option value=\"" + i + "\""+ ((hour==i)?" selected":"") +">" + i + "</option>"; - - } - timeStampStr += "</select>"; - } - //Minutes - if( validationType.equals(VT_TIMESTAMP_MIN) || validationType.equals(VT_TIMESTAMP_SEC) ) { - int minutes = 0; - int t_min = 0; - try { - minutes = Integer.parseInt(nvl(rr.getParamValue(fieldName+"_Min"),"0")); - if(minutes == 0) { - if(inSchedule) minutes = Integer.parseInt(nvl(((String)formValues.get(fieldName+"_Min")),"0")); - } - } catch (NumberFormatException ex) {minutes = 0;} - try { - t_min = Integer.parseInt(timestampmin); - } catch (NumberFormatException ex) { t_min = 0;} - - if(minutes <= 0) minutes = t_min; - /*if (formValues.containsKey(fieldDisplayName+"_Min")){ - formValues.remove(fieldDisplayName+"_Min"); - formValues.put(fieldDisplayName+"_Min", minutes); + returnString += fieldValue; + + } else if (getFieldDefaultSQL() != null) { + + if (validationType.startsWith("TIMESTAMP")) { + returnString += nvl((strValue.length() > 0) ? strValue.split(" ")[0] : ""); + if (strValue.length() > 0) { + timestamp = (strValue.split(" ").length > 1) ? strValue.split(" ")[1] : ""; + String timestampArr[] = timestamp.split(":"); + if ((timestampArr.length == 1) || (timestampArr.length == 2) || (timestampArr.length == 3)) + timestamphr = timestampArr[0]; + if ((timestampArr.length == 2) || (timestampArr.length == 3)) + timestampmin = timestampArr[1]; + if (timestampArr.length == 3) + timestampsec = timestampArr[2]; + } + + } else if (nvl(strValue).length() > 0) { + returnString += strValue; } else - formValues.put(fieldDisplayName+"_Min", minutes); - */ - timeStampStr += " <font class=rtabletext>Min </font><select id = \""+ fieldName+ "_Min\" name=\""+ fieldName+ "_Min\" "+ (readOnly?"disabled":"")+" >"; - for (int i = 0; i < 60; i++) { - if(i==0) timeStampStr += "<option value=\"" + i + "\""+ ((minutes==i)?" selected":"") +">00</option>"; - else if(i<10) timeStampStr += "<option value=\"" + i + "\""+ ((minutes==i)?" selected":"") +">" + "0"+i + "</option>"; - else timeStampStr += "<option value=\"" + i + "\""+ ((minutes==i)?" selected":"") +">" + i + "</option>"; + returnString += nvl((value != null) ? value.getId() : ""); + } else if (nvl(strValue).length() > 0) { + returnString += strValue; + } else + returnString += nvl((value != null) ? value.getId() : ""); + + /* + * returnString += "\">" + (validationType.equals(VT_DATE) ? + * "\n\t\t\t<a href=\"#\" onClick=\"window.dateField=document." + HTML_FORM + + * "." + fieldName + ";calendar=window.open('" + AppUtils.getRaptorActionURL() + + * "popup.calendar','cal','WIDTH=200,HEIGHT=250');return false;\">" + + * "\n\t\t\t\t<img src=\"" + AppUtils.getImgFolderURL() + + * "calender_icon.gif\" align=absmiddle border=0 width=20 height=20></a>" : ""); + */ + + SimpleDateFormat dtf = new SimpleDateFormat("MM/dd/yyyy"); + String stRangeText = this.getRangeStartDate() == null ? null + : dtf.format(this.getRangeStartDate().getTime()); + String endRangeText = this.getRangeEndDate() == null ? null : dtf.format(this.getRangeEndDate().getTime()); + ///////////////////////// + + // get the date sqls + + // System.out.println("////////////start range date before Start" + + // this.getRangeStartDateSQL()); + + if (this.getRangeStartDateSQL() != null + && this.getRangeStartDateSQL().trim().toLowerCase().startsWith("select")) { + // System.out.println("////////////start range date Starting"); + String SQL = this.getRangeStartDateSQL(); + if (formValues != null) { + Set set = formValues.entrySet(); + String v = ""; + for (Iterator iter = set.iterator(); iter.hasNext();) { + Map.Entry entry = (Entry) iter.next(); + v = (String) entry.getValue(); + // System.out.println("///////// key is " + entry.getKey() + " = " + v); + SQL = Utils.replaceInString(SQL, "[" + entry.getKey() + "]", v); + } + } - timeStampStr += "</select>"; - } - //Seconds - if( validationType.equals(VT_TIMESTAMP_SEC) ) { - int seconds = 0; - int t_sec = 0; - try { - seconds = Integer.parseInt(nvl(rr.getParamValue(fieldName+"_Sec"),"0")); - if(seconds == 0) { - if(inSchedule) seconds = Integer.parseInt(nvl(((String)formValues.get(fieldName+"_Sec")),"0")); - } - } catch (NumberFormatException ex) {seconds = 0;} - try { - t_sec = Integer.parseInt(timestampsec); - } catch (NumberFormatException ex) { t_sec = 0;} - - if(seconds <= 0) seconds = t_sec; - /*if (formValues.containsKey(fieldDisplayName+"_Sec")){ - formValues.remove(fieldDisplayName+"_Sec"); - formValues.put(fieldDisplayName+"_Sec", seconds); - } else - formValues.put(fieldDisplayName+"_Sec", seconds); - */ - timeStampStr += " <font class=rtabletext>Sec </font><select id = \""+ fieldName+ "_Sec\" name=\""+ fieldName+ "_Sec\" "+ (readOnly?"disabled":"")+" >"; - for (int i = 0; i < 60; i++) { - if(i==0) timeStampStr += "<option value=\"" + i + "\""+ ((seconds==i)?" selected":"") +">00</option>"; - else if(i<10) timeStampStr += "<option value=\"" + i + "\""+ ((seconds==i)?" selected":"") +">" + "0"+i + "</option>"; - else timeStampStr += "<option value=\"" + i + "\""+ ((seconds==i)?" selected":"") +">" + i + "</option>"; + // System.out.println("////////////start range date sql created" + SQL); + try { + DataSet ds = ConnectionUtils.getDataSet(SQL.toString(), dbInfo); + // System.out.println("////////////start range date is : " + ds.get(0)); + dtf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + Calendar tStart = Calendar.getInstance(); + tStart.setTime(dtf.parse(ds.getString(0, 0))); + dtf = new SimpleDateFormat("MM/dd/yyyy"); + stRangeText = dtf.format(tStart.getTime().getTime() - MILLIS_IN_DAY); + + } catch (Exception e) { + System.out.println("Exception////////// : start range date is : " + e); + } + } + + if (this.getRangeEndDateSQL() != null + && this.getRangeEndDateSQL().trim().toLowerCase().startsWith("select")) { + // System.out.println("////////////end range date Starting"); + String SQL = this.getRangeEndDateSQL(); + if (formValues != null) { + Set set = formValues.entrySet(); + String v = ""; + for (Iterator iter = set.iterator(); iter.hasNext();) { + Map.Entry entry = (Entry) iter.next(); + v = (String) entry.getValue(); + SQL = Utils.replaceInString(SQL, "[" + entry.getKey() + "]", v); + } + + } + try { + DataSet ds = ConnectionUtils.getDataSet(SQL.toString(), dbInfo); + // System.out.println("////////////end range date is : " + ds.get(0)); + dtf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + Calendar tStart = Calendar.getInstance(); + tStart.setTime(dtf.parse(ds.getString(0, 0))); + dtf = new SimpleDateFormat("MM/dd/yyyy"); + // endRangeText = dtf.format(tStart.getTime()); + endRangeText = dtf.format(tStart.getTime().getTime() + MILLIS_IN_DAY); + } catch (Exception e) { + System.out.println("Exception////////// : end range date is : " + e); + } + } + + ////////////////////// + String calendarOnClickMethodCall = ""; + String timeStampStr = ""; + if (stRangeText == null || endRangeText == null) + calendarOnClickMethodCall = "'oCalendar.select(document." + HTML_FORM + "." + fieldName + ", event,\"" + + Globals.getCalendarOutputDateFormat() + "\"); return false;'"; + else + calendarOnClickMethodCall = "'oCalendar=new CalendarPopup(\"calendarDiv\", \"calendarFrame\");oCalendar.setCssPrefix(\"raptor\");oCalendar.addDisabledDates(null, \"" + + stRangeText + "\"); oCalendar.addDisabledDates(\"" + endRangeText + + "\", null); oCalendar.select(document." + HTML_FORM + "." + fieldName + ", event,\"" + + Globals.getCalendarOutputDateFormat() + "\"); return false;'"; + returnString += "\" " + getHelpLink(fieldName) + + (validationType.equals(VT_DATE) || validationType.equals(VT_TIMESTAMP_HR) || validationType + .equals(VT_TIMESTAMP_MIN) || validationType.equals(VT_TIMESTAMP_SEC) ? "\n\t\t\t<img src='" + + AppUtils.getImgFolderURL() + + "calender_icon.gif' align=absmiddle border=0 width='20' height='20' onClick=" + + calendarOnClickMethodCall + " style='cursor:hand'>" : ""); + if (validationType.equals(VT_TIMESTAMP_HR) || validationType.equals(VT_TIMESTAMP_MIN) + || validationType.equals(VT_TIMESTAMP_SEC)) { + // Add Hours/Minutes and Seconds. + timeStampStr = " <font class=rtabletext>Hour </font><select id = \"" + fieldName + "_Hr\" name=\"" + + fieldName + "_Hr\" " + (readOnly ? "disabled" : "") + " >"; + int hour = 0; + int t_hr = 0; + try { + hour = Integer.parseInt(nvl(rr.getParamValue(fieldName + "_Hr"), "0")); + if (hour == 0) { + if (inSchedule) + hour = Integer.parseInt(nvl(((String) formValues.get(fieldName + "_Hr")), "0")); + } + // System.out.println("Hour =" + hour); + } catch (NumberFormatException ex) { + hour = 0; + } + try { + t_hr = Integer.parseInt(timestamphr); + // System.out.println("THR =" + t_hr); + } catch (NumberFormatException ex) { + t_hr = 0; + } + + if (hour <= 0) + hour = t_hr; + // System.out.println("Form Values 887 " + formValues); + /* + * if (formValues.containsKey(fieldDisplayName+"_Hr")){ + * formValues.remove(fieldDisplayName+"_Hr"); + * formValues.put(fieldDisplayName+"_Hr", hour); } else + * formValues.put(fieldDisplayName+"_Hr", hour); + * System.out.println("Form Values 887 " + formValues); + */ + + // int t_min = Integer.parseInt(timestampmin); + // int t_sec = Integer.parseInt(timestampsec); + for (int i = 0; i < 24; i++) { + if (i == 0) + timeStampStr += "<option value=\"" + i + "\"" + ((hour == i) ? " selected" : "") + + ">00</option>"; + else if (i < 10) + timeStampStr += "<option value=\"" + i + "\"" + ((hour == i) ? " selected" : "") + ">" + "0" + i + + "</option>"; + else + timeStampStr += "<option value=\"" + i + "\"" + ((hour == i) ? " selected" : "") + ">" + i + + "</option>"; + + } + timeStampStr += "</select>"; + } + // Minutes + if (validationType.equals(VT_TIMESTAMP_MIN) || validationType.equals(VT_TIMESTAMP_SEC)) { + int minutes = 0; + int t_min = 0; + try { + minutes = Integer.parseInt(nvl(rr.getParamValue(fieldName + "_Min"), "0")); + if (minutes == 0) { + if (inSchedule) + minutes = Integer.parseInt(nvl(((String) formValues.get(fieldName + "_Min")), "0")); + } + } catch (NumberFormatException ex) { + minutes = 0; + } + try { + t_min = Integer.parseInt(timestampmin); + } catch (NumberFormatException ex) { + t_min = 0; + } + + if (minutes <= 0) + minutes = t_min; + /* + * if (formValues.containsKey(fieldDisplayName+"_Min")){ + * formValues.remove(fieldDisplayName+"_Min"); + * formValues.put(fieldDisplayName+"_Min", minutes); } else + * formValues.put(fieldDisplayName+"_Min", minutes); + */ + timeStampStr += " <font class=rtabletext>Min </font><select id = \"" + fieldName + "_Min\" name=\"" + + fieldName + "_Min\" " + (readOnly ? "disabled" : "") + " >"; + for (int i = 0; i < 60; i++) { + if (i == 0) + timeStampStr += "<option value=\"" + i + "\"" + ((minutes == i) ? " selected" : "") + + ">00</option>"; + else if (i < 10) + timeStampStr += "<option value=\"" + i + "\"" + ((minutes == i) ? " selected" : "") + ">" + "0" + + i + "</option>"; + else + timeStampStr += "<option value=\"" + i + "\"" + ((minutes == i) ? " selected" : "") + ">" + i + + "</option>"; + } + timeStampStr += "</select>"; + } + // Seconds + if (validationType.equals(VT_TIMESTAMP_SEC)) { + int seconds = 0; + int t_sec = 0; + try { + seconds = Integer.parseInt(nvl(rr.getParamValue(fieldName + "_Sec"), "0")); + if (seconds == 0) { + if (inSchedule) + seconds = Integer.parseInt(nvl(((String) formValues.get(fieldName + "_Sec")), "0")); + } + } catch (NumberFormatException ex) { + seconds = 0; } - timeStampStr += "</select>"; - } - - returnString += timeStampStr; - String checkboxStr = ""; - if(inSchedule && (validationType.equals(VT_DATE) || validationType.equals(VT_TIMESTAMP_HR) || validationType.equals(VT_TIMESTAMP_MIN) || validationType.equals(VT_TIMESTAMP_SEC)) ) { - if(!Globals.isScheduleDateParamAutoIncr()) { - checkboxStr = /*checkboxStr +" "+ */ "<input type=\"checkbox\" name=\""+getFieldName()+"_auto\" value=\"_auto\" checked/>"; - } else { - checkboxStr = /*checkboxStr +" "+ */"<input type=\"hidden\" name=\""+getFieldName()+"_auto\" value=\"_auto\"/>"; - } - /*if(validationType.equals(VT_TIMESTAMP_HR) || validationType.equals(VT_TIMESTAMP_MIN) || validationType.equals(VT_TIMESTAMP_SEC)) { - checkboxStr = checkboxStr +" "+ "<input type=\"hidden\" name=\""+getFieldName()+"_Hr_auto\" value=\"_auto\"/>"; - } - if(validationType.equals(VT_TIMESTAMP_MIN) || validationType.equals(VT_TIMESTAMP_SEC)) { - checkboxStr = checkboxStr +" "+ "<input type=\"hidden\" name=\""+getFieldName()+"_Min_auto\" value=\"_auto\"/>"; - } - if(validationType.equals(VT_TIMESTAMP_SEC)) { - checkboxStr = checkboxStr +" "+ "<input type=\"hidden\" name=\""+getFieldName()+"_Sec_auto\" value=\"_auto\"/>"; - }*/ - } - if(isVisible()) - return returnString+checkboxStr; - else return ""; + try { + t_sec = Integer.parseInt(timestampsec); + } catch (NumberFormatException ex) { + t_sec = 0; + } + + if (seconds <= 0) + seconds = t_sec; + /* + * if (formValues.containsKey(fieldDisplayName+"_Sec")){ + * formValues.remove(fieldDisplayName+"_Sec"); + * formValues.put(fieldDisplayName+"_Sec", seconds); } else + * formValues.put(fieldDisplayName+"_Sec", seconds); + */ + timeStampStr += " <font class=rtabletext>Sec </font><select id = \"" + fieldName + "_Sec\" name=\"" + + fieldName + "_Sec\" " + (readOnly ? "disabled" : "") + " >"; + for (int i = 0; i < 60; i++) { + if (i == 0) + timeStampStr += "<option value=\"" + i + "\"" + ((seconds == i) ? " selected" : "") + + ">00</option>"; + else if (i < 10) + timeStampStr += "<option value=\"" + i + "\"" + ((seconds == i) ? " selected" : "") + ">" + "0" + + i + "</option>"; + else + timeStampStr += "<option value=\"" + i + "\"" + ((seconds == i) ? " selected" : "") + ">" + i + + "</option>"; + } + timeStampStr += "</select>"; + } + + returnString += timeStampStr; + String checkboxStr = ""; + if (inSchedule && (validationType.equals(VT_DATE) || validationType.equals(VT_TIMESTAMP_HR) + || validationType.equals(VT_TIMESTAMP_MIN) || validationType.equals(VT_TIMESTAMP_SEC))) { + if (!Globals.isScheduleDateParamAutoIncr()) { + checkboxStr = /* checkboxStr +" "+ */ "<input type=\"checkbox\" name=\"" + getFieldName() + + "_auto\" value=\"_auto\" checked/>"; + } else { + checkboxStr = /* checkboxStr +" "+ */"<input type=\"hidden\" name=\"" + getFieldName() + + "_auto\" value=\"_auto\"/>"; + } + /* + * if(validationType.equals(VT_TIMESTAMP_HR) || + * validationType.equals(VT_TIMESTAMP_MIN) || + * validationType.equals(VT_TIMESTAMP_SEC)) { checkboxStr = checkboxStr +" "+ + * "<input type=\"hidden\" name=\""+getFieldName() + * +"_Hr_auto\" value=\"_auto\"/>"; } if(validationType.equals(VT_TIMESTAMP_MIN) + * || validationType.equals(VT_TIMESTAMP_SEC)) { checkboxStr = checkboxStr + * +" "+ "<input type=\"hidden\" name=\""+getFieldName() + * +"_Min_auto\" value=\"_auto\"/>"; } + * if(validationType.equals(VT_TIMESTAMP_SEC)) { checkboxStr = checkboxStr + * +" "+ "<input type=\"hidden\" name=\""+getFieldName() + * +"_Sec_auto\" value=\"_auto\"/>"; } + */ + } + if (isVisible()) + return returnString + checkboxStr; + else + return ""; } else if (fieldType.equals(FFT_TEXTAREA)) { - - if(nvl(fieldValue).length()>0) { + + if (nvl(fieldValue).length() > 0) { fieldValue = Pattern.compile("(^[\r\n])|\\([\\']", Pattern.DOTALL).matcher(fieldValue).replaceAll(""); fieldValue = Pattern.compile("[\\']\\)", Pattern.DOTALL).matcher(fieldValue).replaceAll(""); - fieldValue = fieldValue.replaceAll("','",","); // changed from "|" - fieldValue = fieldValue.replaceAll("' , '","\r\n"); + fieldValue = fieldValue.replaceAll("','", ","); // changed from "|" + fieldValue = fieldValue.replaceAll("' , '", "\r\n"); } - - if(isVisible()) - return "<textarea rows=4 cols=30 id=\"" + fieldName +"\" name=\"" + fieldName + "\""+ getCallableJavascript(getFieldName(), rr) + getHelpLink(fieldName) + nvl(fieldValue) - + "</textarea>"; - else - return ""; + + if (isVisible()) + return "<textarea rows=4 cols=30 id=\"" + fieldName + "\" name=\"" + fieldName + "\"" + + getCallableJavascript(getFieldName(), rr) + getHelpLink(fieldName) + nvl(fieldValue) + + "</textarea>"; + else + return ""; } else if (fieldType.equals(FFT_COMBO_BOX)) { StringBuffer sb = new StringBuffer(); - //System.out.println("COMBO BOX " + fieldName); + // System.out.println("COMBO BOX " + fieldName); String oldSQL = ""; IdNameList lookup = getLookupList(); try { - if(!hasPredefinedList) { - //if(dependsOn != null && dependsOn != "") { - //if(dependsOn != null && dependsOn != "" ) { - IdNameSql lu = (IdNameSql) lookup; - String SQL = lu.getSql(); - //System.out.println("FORMFIELD 6666667 First" + ((IdNameSql)lookup).getSql()); - oldSQL = lu.getSql(); - if(formValues != null) { - Set set = formValues.entrySet(); - String value = ""; - for(Iterator iter = set.iterator(); iter.hasNext(); ) { - Map.Entry entry = (Entry) iter.next(); - value = (String) entry.getValue(); - if (value!=null && (value.length() <=0 || value.equals("NULL"))) { - value = "NULL"; - SQL = Utils.replaceInString(SQL, "'["+entry.getKey()+"]'", value); - SQL = Utils.replaceInString(SQL, "["+entry.getKey()+"]", value); - } else { - SQL = Utils.replaceInString(SQL, "["+entry.getKey()+"]", value); - } + if (!hasPredefinedList) { + // if(dependsOn != null && dependsOn != "") { + // if(dependsOn != null && dependsOn != "" ) { + IdNameSql lu = (IdNameSql) lookup; + String SQL = lu.getSql(); + // System.out.println("FORMFIELD 6666667 First" + ((IdNameSql)lookup).getSql()); + oldSQL = lu.getSql(); + if (formValues != null) { + Set set = formValues.entrySet(); + String value = ""; + for (Iterator iter = set.iterator(); iter.hasNext();) { + Map.Entry entry = (Entry) iter.next(); + value = (String) entry.getValue(); + if (value != null && (value.length() <= 0 || value.equals("NULL"))) { + value = "NULL"; + SQL = Utils.replaceInString(SQL, "'[" + entry.getKey() + "]'", value); + SQL = Utils.replaceInString(SQL, "[" + entry.getKey() + "]", value); + } else { + SQL = Utils.replaceInString(SQL, "[" + entry.getKey() + "]", value); } - lookup = new IdNameSql(-1,SQL,lu.getDefaultSQL()); } - //} + lookup = new IdNameSql(-1, SQL, lu.getDefaultSQL()); + } + // } lookupList = lookup; - - - //} - try { - lookup.loadUserData(0, "", getDbInfo(), getUserId()); - } catch (Exception e ){ e.printStackTrace(); //throw new RaptorRuntimeException(e); - } + + // } + try { + lookup.loadUserData(0, "", getDbInfo(), getUserId()); + } catch (Exception e) { + logger.error(EELFLoggerDelegate.errorLogger, "getHtml () failed ", e); + + } } lookup.trimToSize(); - + for (lookup.resetNext(); lookup.hasNext();) { IdNameValue value = lookup.getNext(); readOnly = value.isReadOnly(); break; } - + String selectedValue = ""; int count = 0; - sb.append("<div id=\""+fieldName+"_content\" style=\"display:none;width:100%;height:100%;align:center;\"> <img src=\""+AppUtils.getImgFolderURL()+"progress.gif\" border=\"0\" alt=\"Loading, please wait...\" /></div>"); - sb.append("<select id=\"" + fieldName +"\" name=\""); + sb.append("<div id=\"" + fieldName + + "_content\" style=\"display:none;width:100%;height:100%;align:center;\"> <img src=\"" + + AppUtils.getImgFolderURL() + + "progress.gif\" border=\"0\" alt=\"Loading, please wait...\" /></div>"); + sb.append("<select id=\"" + fieldName + "\" name=\""); sb.append(fieldName); - sb.append("\" "+ (readOnly?"disabled":"")+" size=1 " + getCallableJavascript(getFieldName(), rr) + getHelpLink(fieldName)); + sb.append("\" " + (readOnly ? "disabled" : "") + " size=1 " + getCallableJavascript(getFieldName(), rr) + + getHelpLink(fieldName)); if (!required) sb.append("<option value=\"\">-->select value<--"); - + for (lookup.resetNext(); lookup.hasNext();) { IdNameValue value = lookup.getNext(); - if(value != null && value.getId() != null && value.getName() != null ) { - /*if (count == 0 && required) { - selectedValue = value.getId(); - count++; - } else if (nvl(fieldValue).length()>0){ - if (fieldValue != null && fieldValue.equals(value.getId())){ - selectedValue = value.getId(); - } - count++; - } else { - count++; - } */ + if (value != null && value.getId() != null && value.getName() != null) { + /* + * if (count == 0 && required) { selectedValue = value.getId(); count++; } else + * if (nvl(fieldValue).length()>0){ if (fieldValue != null && + * fieldValue.equals(value.getId())){ selectedValue = value.getId(); } count++; + * } else { count++; } + */ if (count == 0) { - if(required){ - selectedValue = value.getId(); + if (required) { + selectedValue = value.getId(); } count++; } sb.append("<option value=\""); sb.append(value.getId()); - - if (nvl(fieldValue).length()>0) { + + if (nvl(fieldValue).length() > 0) { if (fieldValue.equals(value.getId())) { // || (value.isDefaultValue())) sb.append("\" selected>"); selectedValue = value.getId(); - } - else + } else sb.append("\">"); } else { - if(value!=null && value.isDefaultValue()) { + if (value != null && value.isDefaultValue()) { sb.append("\" selected>"); selectedValue = value.getId(); } else { sb.append("\">"); } } - + sb.append(value.getName()); sb.append("</option>\n"); } } // for - if (formValues.containsKey(fieldDisplayName)){ + if (formValues.containsKey(fieldDisplayName)) { formValues.remove(fieldDisplayName); } - formValues.put(fieldDisplayName, selectedValue); + formValues.put(fieldDisplayName, selectedValue); } catch (Exception e) { - //throw new RaptorRuntimeException(e); + // throw new RaptorRuntimeException(e); } - if(!hasPredefinedList) { - if(oldSQL != null && !oldSQL.equals("")) { - ((IdNameSql)lookup).setSQL(oldSQL); - } + if (!hasPredefinedList) { + if (oldSQL != null && !oldSQL.equals("")) { + ((IdNameSql) lookup).setSQL(oldSQL); + } } - //System.out.println("FORMFIELD 6666667 " + ((IdNameSql)lookup).getSql()); - if(sb.length()<=0) { - sb.append("<div id=\""+fieldName+"_content\" style=\"display:none;width:100%;height:100%;align:center;\"> <img src=\""+AppUtils.getImgFolderURL()+"progress.gif\" border=\"0\" alt=\"Loading, please wait...\" /></div>"); - sb.append("<select id=\"" + fieldName +"\" name=\""); + // System.out.println("FORMFIELD 6666667 " + ((IdNameSql)lookup).getSql()); + if (sb.length() <= 0) { + sb.append("<div id=\"" + fieldName + + "_content\" style=\"display:none;width:100%;height:100%;align:center;\"> <img src=\"" + + AppUtils.getImgFolderURL() + + "progress.gif\" border=\"0\" alt=\"Loading, please wait...\" /></div>"); + sb.append("<select id=\"" + fieldName + "\" name=\""); sb.append(fieldName); - sb.append("\" "+ (readOnly?"disabled":"")+" size=1 " + getCallableJavascript(getFieldName(), rr) + getHelpLink(fieldName)); + sb.append("\" " + (readOnly ? "disabled" : "") + " size=1 " + getCallableJavascript(getFieldName(), rr) + + getHelpLink(fieldName)); } - - sb.append("</select>"); - if( isVisible()) - return sb.toString(); - else return ""; + + sb.append("</select>"); + if (isVisible()) + return sb.toString(); + else + return ""; } else if (fieldType.equals(FFT_LIST_BOX)) { StringBuffer sb = new StringBuffer(); String oldSQL = ""; - IdNameList lookup = null; + IdNameList lookup = null; lookup = getLookupList(); String selectedValue = ""; try { - if(!hasPredefinedList) { - //if(dependsOn != null && dependsOn != "") { - //if(dependsOn != null && dependsOn != "" ) { - IdNameSql lu = (IdNameSql) lookup; - String SQL = lu.getSql(); - oldSQL = lu.getSql(); - if(formValues != null) { - Set set = formValues.entrySet(); - String value = ""; - for(Iterator iter = set.iterator(); iter.hasNext(); ) { - Map.Entry entry = (Entry) iter.next(); - value = (String) entry.getValue(); - SQL = Utils.replaceInString(SQL, "["+entry.getKey()+"]", value); - } - lookup = new IdNameSql(-1,SQL,lu.getDefaultSQL()); + if (!hasPredefinedList) { + // if(dependsOn != null && dependsOn != "") { + // if(dependsOn != null && dependsOn != "" ) { + IdNameSql lu = (IdNameSql) lookup; + String SQL = lu.getSql(); + oldSQL = lu.getSql(); + if (formValues != null) { + Set set = formValues.entrySet(); + String value = ""; + for (Iterator iter = set.iterator(); iter.hasNext();) { + Map.Entry entry = (Entry) iter.next(); + value = (String) entry.getValue(); + SQL = Utils.replaceInString(SQL, "[" + entry.getKey() + "]", value); } - //} - lookupList = lookup; - //} - try { - lookup.loadUserData(0, "", getDbInfo(), getUserId()); - } catch (Exception e ){ e.printStackTrace(); //throw new RaptorRuntimeException(e); - } + lookup = new IdNameSql(-1, SQL, lu.getDefaultSQL()); + } + // } + lookupList = lookup; + // } + try { + lookup.loadUserData(0, "", getDbInfo(), getUserId()); + } catch (Exception e) { + logger.error(EELFLoggerDelegate.errorLogger, "getHtml () failed", e); + + } } lookup.trimToSize(); - + for (lookup.resetNext(); lookup.hasNext();) { IdNameValue value = lookup.getNext(); readOnly = value.isReadOnly(); break; } - + int iCnt = 0; - sb.append("<select id=\"" + fieldName +"\" name=\""); + sb.append("<select id=\"" + fieldName + "\" name=\""); sb.append(fieldName); - sb.append("\" "+ (readOnly?"disabled":"")+" size=4 " + getCallableJavascript(getFieldName(), rr) + getHelpLink(fieldName)); + sb.append("\" " + (readOnly ? "disabled" : "") + " size=4 " + getCallableJavascript(getFieldName(), rr) + + getHelpLink(fieldName)); if (!required) sb.append("<option value=\"\">-->select value<--"); - + for (lookup.resetNext(); lookup.hasNext(); iCnt++) { IdNameValue value = lookup.getNext(); sb.append("<option value=\""); - sb.append((value!=null)?value.getId():""); - if (nvl(fieldValue).length()>0) { - if (fieldValue.equals((value!=null)?value.getId():"") || (fieldValue.equals("") && required && iCnt == 0)) { + sb.append((value != null) ? value.getId() : ""); + if (nvl(fieldValue).length() > 0) { + if (fieldValue.equals((value != null) ? value.getId() : "") + || (fieldValue.equals("") && required && iCnt == 0)) { sb.append("\" selected>"); selectedValue = value.getId(); } else { sb.append("\">"); } } else { - if(value!=null && value.isDefaultValue()) { + if (value != null && value.isDefaultValue()) { sb.append("\" selected>"); selectedValue = value.getId(); } else { sb.append("\">"); } } - if (formValues.containsKey(fieldDisplayName)){ + if (formValues.containsKey(fieldDisplayName)) { formValues.remove(fieldDisplayName); } - formValues.put(fieldDisplayName, selectedValue); - - sb.append((value!=null)?value.getName():""); + formValues.put(fieldDisplayName, selectedValue); + + sb.append((value != null) ? value.getName() : ""); sb.append("</option>\n"); } // for // lookup.clearData(); } catch (Exception e) { - //throw new RaptorRuntimeException(e); + // throw new RaptorRuntimeException(e); } - if(sb.length()<=0) { - sb.append("<select id=\"" + fieldName +"\" name=\""); + if (sb.length() <= 0) { + sb.append("<select id=\"" + fieldName + "\" name=\""); sb.append(fieldName); - sb.append("\" "+ (readOnly?"disabled":"")+" size=4 " + getCallableJavascript(getFieldName(), rr) + getHelpLink(fieldName)); + sb.append("\" " + (readOnly ? "disabled" : "") + " size=4 " + getCallableJavascript(getFieldName(), rr) + + getHelpLink(fieldName)); } - + sb.append("</select>"); - - if(!hasPredefinedList) { - if(oldSQL != null && !oldSQL.equals("")) { - ((IdNameSql)lookup).setSQL(oldSQL); - } + + if (!hasPredefinedList) { + if (oldSQL != null && !oldSQL.equals("")) { + ((IdNameSql) lookup).setSQL(oldSQL); + } } - - if(isVisible()) - return sb.toString(); - else - return ""; + + if (isVisible()) + return sb.toString(); + else + return ""; } else if (fieldType.equals(FFT_HIDDEN)) { StringBuffer sb = new StringBuffer(); String oldSQL = ""; - String progress = "<div id=\""+fieldName+"_content\" style=\"display:none;width:100%;height:100%;align:center;\"> <img src=\""+AppUtils.getImgFolderURL()+"progress.gif\" border=\"0\" alt=\"Loading, please wait...\" /></div> "; - sb.append(progress); - sb.append("<input id=\"" + fieldName +"\" name=\""); + String progress = "<div id=\"" + fieldName + + "_content\" style=\"display:none;width:100%;height:100%;align:center;\"> <img src=\"" + + AppUtils.getImgFolderURL() + + "progress.gif\" border=\"0\" alt=\"Loading, please wait...\" /></div> "; + sb.append(progress); + sb.append("<input id=\"" + fieldName + "\" name=\""); sb.append(fieldName); sb.append("\" type=\"hidden\""); IdNameList lookup = null; - + try { lookup = getLookupList(); - if(lookup != null) { - //if(dependsOn != null && dependsOn != "") { - //if(dependsOn != null && dependsOn != "" ) { - IdNameSql lu = (IdNameSql) lookup; - String SQL = lu.getSql(); - //System.out.println("SQL HIDDEN 1 " + SQL); - oldSQL = lu.getSql(); - if(formValues != null) { - Set set = formValues.entrySet(); - String value = ""; - for(Iterator iter = set.iterator(); iter.hasNext(); ) { - Map.Entry entry = (Entry) iter.next(); - value = (String) entry.getValue(); - //System.out.println("HIDDEN " + "["+entry.getKey()+"]" + "-" + value); - SQL = Utils.replaceInString(SQL, "["+entry.getKey()+"]", value); - } - - lookup = new IdNameSql(-1,SQL,lu.getDefaultSQL()); - } - //System.out.println("SQL HIDDEN 2 " + SQL); - //} - lookupList = lookup; - //} - if(nvl(fieldValue).length()>0 && (dependsOn == null || dependsOn.length()<=0)) { + if (lookup != null) { + // if(dependsOn != null && dependsOn != "") { + // if(dependsOn != null && dependsOn != "" ) { + IdNameSql lu = (IdNameSql) lookup; + String SQL = lu.getSql(); + // System.out.println("SQL HIDDEN 1 " + SQL); + oldSQL = lu.getSql(); + if (formValues != null) { + Set set = formValues.entrySet(); + String value = ""; + for (Iterator iter = set.iterator(); iter.hasNext();) { + Map.Entry entry = (Entry) iter.next(); + value = (String) entry.getValue(); + // System.out.println("HIDDEN " + "["+entry.getKey()+"]" + "-" + value); + SQL = Utils.replaceInString(SQL, "[" + entry.getKey() + "]", value); + } + + lookup = new IdNameSql(-1, SQL, lu.getDefaultSQL()); + } + // System.out.println("SQL HIDDEN 2 " + SQL); + // } + lookupList = lookup; + // } + if (nvl(fieldValue).length() > 0 && (dependsOn == null || dependsOn.length() <= 0)) { sb.append(" value=\""); - sb.append((fieldValue!=null)?fieldValue:""); + sb.append((fieldValue != null) ? fieldValue : ""); sb.append("\">"); - } else if (lookup != null) { + } else if (lookup != null) { lookup.loadUserData(0, "", getDbInfo(), getUserId()); int iCnt = 0; for (lookup.resetNext(); lookup.hasNext(); iCnt++) { IdNameValue value = lookup.getNext(); - //System.out.println("HIDDEN " + value.getId() + " " + value.getName()); + // System.out.println("HIDDEN " + value.getId() + " " + value.getName()); sb.append(" value=\""); - sb.append((value!=null)?value.getId():""); + sb.append((value != null) ? value.getId() : ""); sb.append("\">"); - break; + break; } // for - if(lookup.size()<=0) { + if (lookup.size() <= 0) { sb.append(" value=\""); sb.append("\">"); - + } } else { sb.append(" value=\""); - sb.append((fieldValue!=null)?fieldValue:""); + sb.append((fieldValue != null) ? fieldValue : ""); sb.append("\"/>"); } } else { sb.append(" value=\""); - sb.append((fieldValue!=null)?fieldValue:""); + sb.append((fieldValue != null) ? fieldValue : ""); sb.append("\"/>"); } - if(oldSQL != null && !oldSQL.equals("")) { - ((IdNameSql)lookup).setSQL(oldSQL); - } + if (oldSQL != null && !oldSQL.equals("")) { + ((IdNameSql) lookup).setSQL(oldSQL); + } // lookup.clearData(); } catch (Exception e) { sb.append(" value=\"\"/>"); - //throw new RaptorRuntimeException(e); + // throw new RaptorRuntimeException(e); + } + + if (!hasPredefinedList) { + if (oldSQL != null && !oldSQL.equals("")) { + ((IdNameSql) lookup).setSQL(oldSQL); + } } - - if(!hasPredefinedList) { - if(oldSQL != null && !oldSQL.equals("")) { - ((IdNameSql)lookup).setSQL(oldSQL); - } - } - //if(isVisible()) - return sb.toString() ; - } else if (fieldType.equals(FFT_RADIO_BTN)) { + // if(isVisible()) + return sb.toString(); + } else if (fieldType.equals(FFT_RADIO_BTN)) { StringBuffer sb = new StringBuffer(); if (!required) { - sb.append("<input id=\"" + fieldName +"\" type=radio name=\""); + sb.append("<input id=\"" + fieldName + "\" type=radio name=\""); sb.append(fieldName); sb.append("\" value=\"\""); if (fieldValue.length() == 0) sb.append(" checked"); - //sb.append( getCallableJavascript(getFieldName(), rr) ); - sb.append(getHelpLink(fieldName)+ " Any<br>\n"); + // sb.append( getCallableJavascript(getFieldName(), rr) ); + sb.append(getHelpLink(fieldName) + " Any<br>\n"); } try { IdNameList lookup = getLookupList(); - lookup.loadUserData(0, "", getDbInfo(),getUserId()); + lookup.loadUserData(0, "", getDbInfo(), getUserId()); String selectedValue = ""; int iCnt = 0; for (lookup.resetNext(); lookup.hasNext(); iCnt++) { IdNameValue value = lookup.getNext(); - sb.append("<input id=\"" + fieldName +"\" type=radio name=\""); + sb.append("<input id=\"" + fieldName + "\" type=radio name=\""); sb.append(fieldName); sb.append("\" value=\""); - sb.append((value!=null)?value.getId():""); - if (nvl(fieldValue).length()>0) { - if (fieldValue.equals((value!=null)?value.getId():"") || (fieldValue.equals("") && required && iCnt == 0)) { + sb.append((value != null) ? value.getId() : ""); + if (nvl(fieldValue).length() > 0) { + if (fieldValue.equals((value != null) ? value.getId() : "") + || (fieldValue.equals("") && required && iCnt == 0)) { sb.append("\" checked>"); selectedValue = value.getId(); } else { sb.append("\">"); } } else { - if(value!=null && value.isDefaultValue()) { + if (value != null && value.isDefaultValue()) { sb.append("\" checked>"); selectedValue = value.getId(); } else { sb.append("\">"); } } - sb.append((value!=null)?value.getName():""); + sb.append((value != null) ? value.getName() : ""); sb.append("<br>\n"); } // for - if (formValues.containsKey(fieldDisplayName)){ + if (formValues.containsKey(fieldDisplayName)) { formValues.remove(fieldDisplayName); } - formValues.put(fieldDisplayName, selectedValue); + formValues.put(fieldDisplayName, selectedValue); // lookup.clearData(); } catch (Exception e) { - throw new RaptorRuntimeException(e); + throw new RaptorRuntimeException(e); } - if(isVisible()) - return sb.toString() ; - else - return ""; + if (isVisible()) + return sb.toString(); + else + return ""; } else if (fieldType.equals(FFT_CHECK_BOX)) { StringBuffer sb = new StringBuffer(); fieldValue = '|' + fieldValue + '|'; - int count = 0 ; + int count = 0; try { String selectedValue = ""; IdNameList lookup = getLookupList(); - if(lookup != null) { + if (lookup != null) { lookup.loadUserData(0, "", getDbInfo(), getUserId()); - + for (lookup.resetNext(); lookup.hasNext();) { count++; IdNameValue value = lookup.getNext(); - sb.append("<input id=\"" + fieldName +"\" type=checkbox name=\""); + sb.append("<input id=\"" + fieldName + "\" type=checkbox name=\""); sb.append(fieldName); sb.append("\" value=\""); - sb.append((value!=null)?value.getId():""); - - if (!fieldValue.equals("||")) { - if (fieldValue.indexOf('|' + ((value!=null)?value.getId():"") + '|') >= 0) { // || (value.isDefaultValue())) + sb.append((value != null) ? value.getId() : ""); + + if (!fieldValue.equals("||")) { + if (fieldValue.indexOf('|' + ((value != null) ? value.getId() : "") + '|') >= 0) { // || + // (value.isDefaultValue())) sb.append("\" checked " + getHelpLink(fieldName)); selectedValue = value.getId(); - } - else + } else sb.append("\"" + getHelpLink(fieldName)); } else { - if(value!=null && value.isDefaultValue()) { + if (value != null && value.isDefaultValue()) { sb.append("\" checked " + getHelpLink(fieldName)); selectedValue = value.getId(); } else { sb.append("\"" + getHelpLink(fieldName)); } } - - if(!(/*(value.getName().equals("Y")||value.getName().equals("N")) && */(!lookup.hasNext()) && count == 1)) - sb.append((value!=null)?value.getName():""); + + if (!(/* (value.getName().equals("Y")||value.getName().equals("N")) && */(!lookup.hasNext()) + && count == 1)) + sb.append((value != null) ? value.getName() : ""); sb.append("<br>\n"); } // for - - if (formValues.containsKey(fieldDisplayName)){ + + if (formValues.containsKey(fieldDisplayName)) { formValues.remove(fieldDisplayName); } - formValues.put(fieldDisplayName, selectedValue); + formValues.put(fieldDisplayName, selectedValue); } // lookup.clearData(); } catch (Exception e) { - throw new RaptorRuntimeException(e); + throw new RaptorRuntimeException(e); } - if(isVisible()) - return sb.toString(); - else - return ""; + if (isVisible()) + return sb.toString(); + else + return ""; } else if (fieldType.equals(FFT_LIST_MULTI)) { StringBuffer sb = new StringBuffer(); String oldSQL = ""; @@ -1819,27 +1938,27 @@ public class FormField extends org.onap.portalsdk.analytics.RaptorObject impleme fieldValue = '|' + fieldValue + '|'; IdNameList lookup = getLookupList(); try { - if(!hasPredefinedList) { - //if(dependsOn != null && dependsOn != "") { - //if(dependsOn != null && dependsOn != "" ) { - IdNameSql lu = (IdNameSql) lookup; - String SQL = lu.getSql(); - oldSQL = lu.getSql(); - if(formValues != null) { - Set set = formValues.entrySet(); - String value = ""; - for(Iterator iter = set.iterator(); iter.hasNext(); ) { - Map.Entry entry = (Entry) iter.next(); - value = (String) entry.getValue(); - SQL = Utils.replaceInString(SQL, "["+entry.getKey()+"]", value); - } - lookup = new IdNameSql(-1,SQL,lu.getDefaultSQL()); - } - //} - lookupList = lookup; - //} - - lookup.loadUserData(0, "", getDbInfo(),getUserId()); + if (!hasPredefinedList) { + // if(dependsOn != null && dependsOn != "") { + // if(dependsOn != null && dependsOn != "" ) { + IdNameSql lu = (IdNameSql) lookup; + String SQL = lu.getSql(); + oldSQL = lu.getSql(); + if (formValues != null) { + Set set = formValues.entrySet(); + String value = ""; + for (Iterator iter = set.iterator(); iter.hasNext();) { + Map.Entry entry = (Entry) iter.next(); + value = (String) entry.getValue(); + SQL = Utils.replaceInString(SQL, "[" + entry.getKey() + "]", value); + } + lookup = new IdNameSql(-1, SQL, lu.getDefaultSQL()); + } + // } + lookupList = lookup; + // } + + lookup.loadUserData(0, "", getDbInfo(), getUserId()); } for (lookup.resetNext(); lookup.hasNext();) { IdNameValue value = lookup.getNext(); @@ -1847,64 +1966,73 @@ public class FormField extends org.onap.portalsdk.analytics.RaptorObject impleme break; } - sb.append("<div id=\""+fieldName+"_content\" style=\"display:none;width:100%;height:100%;align:center;\"> <img src=\""+AppUtils.getImgFolderURL()+"progress.gif\" border=\"0\" alt=\"Loading, please wait...\" /></div>"); - sb.append("<select id=\"" + fieldName +"\" name=\""); + sb.append("<div id=\"" + fieldName + + "_content\" style=\"display:none;width:100%;height:100%;align:center;\"> <img src=\"" + + AppUtils.getImgFolderURL() + + "progress.gif\" border=\"0\" alt=\"Loading, please wait...\" /></div>"); + sb.append("<select id=\"" + fieldName + "\" name=\""); sb.append(fieldName); - sb.append("\" "+ (readOnly?"disabled":"")+" size=\""+ multiSelectListSize +"\" multiple " + getCallableJavascript(getFieldName(), rr) + getHelpLink(fieldName)); - + sb.append("\" " + (readOnly ? "disabled" : "") + " size=\"" + multiSelectListSize + "\" multiple " + + getCallableJavascript(getFieldName(), rr) + getHelpLink(fieldName)); + for (lookup.resetNext(); lookup.hasNext();) { IdNameValue value = lookup.getNext(); sb.append("<option value=\""); - sb.append((value!=null)?value.getId():""); - if (!fieldValue.equals("||")) { - if (fieldValue.indexOf('|' + ((value!=null)?value.getId():"") + '|') >= 0) // || (value.isDefaultValue())) + sb.append((value != null) ? value.getId() : ""); + if (!fieldValue.equals("||")) { + if (fieldValue.indexOf('|' + ((value != null) ? value.getId() : "") + '|') >= 0) // || + // (value.isDefaultValue())) sb.append("\" selected>"); else sb.append("\">"); } else { - if(value!=null && value.isDefaultValue()) { + if (value != null && value.isDefaultValue()) { sb.append("\" selected>"); } else { sb.append("\">"); } } - sb.append((value!=null)?value.getName():""); + sb.append((value != null) ? value.getName() : ""); sb.append("</option>\n"); } // for // lookup.clearData(); } catch (Exception e) { - //throw new RaptorRuntimeException(e); + // throw new RaptorRuntimeException(e); } - if(!hasPredefinedList) { - if(oldSQL != null && !oldSQL.equals("")) { - ((IdNameSql)lookup).setSQL(oldSQL); - } + if (!hasPredefinedList) { + if (oldSQL != null && !oldSQL.equals("")) { + ((IdNameSql) lookup).setSQL(oldSQL); + } } - if(sb.length()<=0) { - sb.append("<div id=\""+fieldName+"_content\" style=\"display:none;width:100%;height:100%;align:center;\"> <img src=\""+AppUtils.getImgFolderURL()+"progress.gif\" border=\"0\" alt=\"Loading, please wait...\" /></div>"); - sb.append("<select id=\"" + fieldName +"\" name=\""); + if (sb.length() <= 0) { + sb.append("<div id=\"" + fieldName + + "_content\" style=\"display:none;width:100%;height:100%;align:center;\"> <img src=\"" + + AppUtils.getImgFolderURL() + + "progress.gif\" border=\"0\" alt=\"Loading, please wait...\" /></div>"); + sb.append("<select id=\"" + fieldName + "\" name=\""); sb.append(fieldName); - sb.append("\" "+ (readOnly?"disabled":"")+" size=\""+ multiSelectListSize +"\" multiple " + getCallableJavascript(getFieldName(), rr) + getHelpLink(fieldName)); + sb.append("\" " + (readOnly ? "disabled" : "") + " size=\"" + multiSelectListSize + "\" multiple " + + getCallableJavascript(getFieldName(), rr) + getHelpLink(fieldName)); } sb.append("</select>"); - if(isVisible()) - return sb.toString(); - else - return ""; + if (isVisible()) + return sb.toString(); + else + return ""; } else if (fieldType.equals(FFT_BLANK)) { StringBuffer sb = new StringBuffer(); sb.append(" "); return sb.toString(); } else - throw new org.onap.portalsdk.analytics.error.RaptorRuntimeException("FormField.getHtml: Unsupported form field type"); + throw new org.onap.portalsdk.analytics.error.RaptorRuntimeException( + "FormField.getHtml: Unsupported form field type"); } // getHtml public String getValidateJavaScript() { StringBuffer javaScript = new StringBuffer(); - if (fieldType.equals(FFT_TEXT_W_POPUP) || fieldType.equals(FFT_TEXT) - || fieldType.equals(FFT_TEXTAREA)) { + if (fieldType.equals(FFT_TEXT_W_POPUP) || fieldType.equals(FFT_TEXT) || fieldType.equals(FFT_TEXTAREA)) { if (required) { javaScript.append("\n\tif(document."); javaScript.append(HTML_FORM); @@ -1925,7 +2053,8 @@ public class FormField extends org.onap.portalsdk.analytics.RaptorObject impleme if (!validationType.equals(VT_NONE)) { javaScript.append("\n\tif(! "); - if (validationType.equals(VT_DATE)||validationType.equals(VT_TIMESTAMP_HR)||validationType.equals(VT_TIMESTAMP_MIN)||validationType.equals(VT_TIMESTAMP_SEC)) + if (validationType.equals(VT_DATE) || validationType.equals(VT_TIMESTAMP_HR) + || validationType.equals(VT_TIMESTAMP_MIN) || validationType.equals(VT_TIMESTAMP_SEC)) javaScript.append("checkDate("); else if (validationType.equals(VT_INT)) javaScript.append("checkInteger("); @@ -1944,13 +2073,15 @@ public class FormField extends org.onap.portalsdk.analytics.RaptorObject impleme javaScript.append("."); javaScript.append(fieldName); javaScript.append(".value"); - if (validationType.equals(VT_DATE)||validationType.equals(VT_TIMESTAMP_HR)||validationType.equals(VT_TIMESTAMP_MIN)||validationType.equals(VT_TIMESTAMP_SEC)) + if (validationType.equals(VT_DATE) || validationType.equals(VT_TIMESTAMP_HR) + || validationType.equals(VT_TIMESTAMP_MIN) || validationType.equals(VT_TIMESTAMP_SEC)) javaScript.append(", true"); javaScript.append(")) {\n\t\talert(\""); javaScript.append(fieldDisplayName); javaScript.append(" is not a valid "); - if (validationType.equals(VT_DATE)||validationType.equals(VT_TIMESTAMP_HR)||validationType.equals(VT_TIMESTAMP_MIN)||validationType.equals(VT_TIMESTAMP_SEC)) - javaScript.append("date formatted "+ Globals.getCalendarOutputDateFormat()); + if (validationType.equals(VT_DATE) || validationType.equals(VT_TIMESTAMP_HR) + || validationType.equals(VT_TIMESTAMP_MIN) || validationType.equals(VT_TIMESTAMP_SEC)) + javaScript.append("date formatted " + Globals.getCalendarOutputDateFormat()); else if (validationType.equals(VT_INT)) javaScript.append("integer"); else if (validationType.equals(VT_INT_POSITIVE)) @@ -2022,38 +2153,34 @@ public class FormField extends org.onap.portalsdk.analytics.RaptorObject impleme public String getDbInfo() { return dbInfo; } - - public void setUserId(String userId) { - this.userId = userId; - } - - public String getUserId() { - return userId; - } - - - public String getFieldDefaultSQL() { - - return fieldDefaultSQL; - } - - - public void setFieldDefaultSQL(String fieldDefaultSQL) { - - this.fieldDefaultSQL = fieldDefaultSQL; - } - - - public boolean isVisible() { - - return visible; - } - - - public void setVisible(boolean visible) { - - this.visible = visible; - } + + public void setUserId(String userId) { + this.userId = userId; + } + + public String getUserId() { + return userId; + } + + public String getFieldDefaultSQL() { + + return fieldDefaultSQL; + } + + public void setFieldDefaultSQL(String fieldDefaultSQL) { + + this.fieldDefaultSQL = fieldDefaultSQL; + } + + public boolean isVisible() { + + return visible; + } + + public void setVisible(boolean visible) { + + this.visible = visible; + } public String getDependsOn() { return dependsOn; @@ -2064,7 +2191,7 @@ public class FormField extends org.onap.portalsdk.analytics.RaptorObject impleme } public Calendar getRangeEndDate() { - if(rangeEndDate != null) + if (rangeEndDate != null) rangeEndDate.add(Calendar.DATE, 1); return rangeEndDate; } @@ -2074,8 +2201,8 @@ public class FormField extends org.onap.portalsdk.analytics.RaptorObject impleme } public Calendar getRangeStartDate() { - if(rangeStartDate != null) - rangeStartDate.add(Calendar.DATE, -1); + if (rangeStartDate != null) + rangeStartDate.add(Calendar.DATE, -1); return rangeStartDate; } @@ -2094,7 +2221,7 @@ public class FormField extends org.onap.portalsdk.analytics.RaptorObject impleme public void setMultiSelectListSize(String multiSelectListSize) { this.multiSelectListSize = multiSelectListSize; } - + public String getRangeStartDateSQL() { return rangeStartDateSQL; } @@ -2126,6 +2253,5 @@ public class FormField extends org.onap.portalsdk.analytics.RaptorObject impleme public void setTriggerThisFormfield(boolean triggerThisFormfield) { this.triggerThisFormfield = triggerThisFormfield; } - - + } // FormField diff --git a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/runtime/ReportRuntime.java b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/runtime/ReportRuntime.java index 03c8214d..171dc7c8 100644 --- a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/runtime/ReportRuntime.java +++ b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/runtime/ReportRuntime.java @@ -500,7 +500,7 @@ public class ReportRuntime extends ReportWrapper implements Cloneable, Serializa for (int i = 0; i < scheduleSessionParam.length; i++) { //debugLogger.debug(" scheduleSessionParam[i] " + scheduleSessionParam[i] + " " + request.getParameter(scheduleSessionParam[i]) ); if(request.getParameter(scheduleSessionParam[i])!=null) - paramList.add(new IdNameValue(scheduleSessionParam[i].toUpperCase(), request.getParameter(scheduleSessionParam[i]))); + paramList.add(new IdNameValue(ESAPI.encoder().canonicalize(scheduleSessionParam[i].toUpperCase()), ESAPI.encoder().canonicalize(request.getParameter(scheduleSessionParam[i])))); } } @@ -531,7 +531,7 @@ public class ReportRuntime extends ReportWrapper implements Cloneable, Serializa String scheduleSessionDispParam = scheduleSessionParam[i]; if(nvl(scheduleSessionDispParam).length()>0) { String scheduleSessionDispParamArr[] = scheduleSessionDispParam.split(";"); - paramList.add(new IdNameValue(scheduleSessionDispParamArr[1], nvl(request.getParameter(scheduleSessionDispParamArr[0]),""))); + paramList.add(new IdNameValue(ESAPI.encoder().canonicalize(scheduleSessionDispParamArr[1]), ESAPI.encoder().canonicalize(nvl(request.getParameter(scheduleSessionDispParamArr[0]),"")))); } } } diff --git a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/system/Globals.java b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/system/Globals.java index 04795bf4..2818989c 100644 --- a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/system/Globals.java +++ b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/system/Globals.java @@ -335,7 +335,7 @@ public class Globals extends org.onap.portalsdk.analytics.RaptorObject { } catch (IOException e) { - e.printStackTrace(); + logger.error(EELFLoggerDelegate.errorLogger,e.getMessage(), e); } try { diff --git a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/system/fusion/adapter/FusionAdapter.java b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/system/fusion/adapter/FusionAdapter.java index 3ac51bbe..adfc7d22 100644 --- a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/system/fusion/adapter/FusionAdapter.java +++ b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/system/fusion/adapter/FusionAdapter.java @@ -42,12 +42,16 @@ import java.util.Map; import javax.servlet.ServletContext; +import org.onap.portalsdk.analytics.model.runtime.FormField; import org.onap.portalsdk.core.FusionObject; +import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate; import org.springframework.beans.factory.annotation.Autowired; import com.mchange.v2.c3p0.ComboPooledDataSource; public class FusionAdapter implements FusionObject { + + private static final EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(FusionAdapter.class); public static final String LOCAL_SESSION_FACTORY_KEY = "local"; @@ -76,7 +80,7 @@ public class FusionAdapter implements FusionObject { try { connection = getDataSource().getConnection(); } catch(Exception ex) { - ex.printStackTrace(); + logger.error(EELFLoggerDelegate.errorLogger,ex.getMessage(), ex); } return connection; } @@ -88,7 +92,7 @@ public class FusionAdapter implements FusionObject { try { connection = getDataSourceMap().get(schemaId).getConnection(); } catch (Exception e) { - e.printStackTrace(); + logger.error(EELFLoggerDelegate.errorLogger,e.getMessage(), e); } return connection; @@ -101,7 +105,7 @@ public class FusionAdapter implements FusionObject { conn.close(); } catch (Exception e) { - e.printStackTrace(); + logger.error(EELFLoggerDelegate.errorLogger,e.getMessage(), e); } } diff --git a/ecomp-sdk/epsdk-app-common/db-scripts/EcompSdkDDLMySql_2_1_Common.sql b/ecomp-sdk/epsdk-app-common/db-scripts/EcompSdkDDLMySql_2_1_Common.sql new file mode 100644 index 00000000..551157ff --- /dev/null +++ b/ecomp-sdk/epsdk-app-common/db-scripts/EcompSdkDDLMySql_2_1_Common.sql @@ -0,0 +1,1389 @@ +-- --------------------------------------------------------------------------------------------------------------- +-- This script creates tables in the COMMON version 2.1.0 of the ONAP SDK application database. +-- Additional DDL scripts may be required! +-- +-- Note to database admin: set the MySQL system variable called lower_case_table_names to 1 +-- It can be set 3 different ways: +-- command-line options (Cmd-line), +-- options valid in configuration files (Option file), or +-- server system variables (System Var). +-- +-- When set to 1 table names are stored in lowercase on disk and comparisons are not case sensitive. +-- +-- MySql/MariaDB Version compatibility information +-- +-- bash-4.2$ mysql --version – cluster version +-- mysql Ver 15.1 Distrib 10.1.17-MariaDB, for Linux (x86_64) using readline 5.1 +-- +-- All versions newer or older than these DO NOT necessarily mean they are compatible. +-- --------------------------------------------------------------------------------------------------------------- + +SET FOREIGN_KEY_CHECKS=1; + +CREATE DATABASE IF NOT EXISTS ecomp_sdk; + +USE ecomp_sdk; + +-- ---------- create table SECTION +-- +-- NAME: CR_FAVORITE_REPORTS; TYPE: TABLE +-- +create table cr_favorite_reports ( + USER_ID INTEGER NOT NULL, + REP_ID INTEGER NOT NULL +); + +-- +-- NAME: CR_FILEHIST_LOG; TYPE: TABLE +-- +create table cr_filehist_log ( + SCHEDULE_ID NUMERIC(11,0) NOT NULL, + URL CHARACTER VARYING(4000), + NOTES CHARACTER VARYING(3500), + RUN_TIME TIMESTAMP +); + +-- +-- NAME: CR_FOLDER; TYPE: TABLE +-- +create table cr_folder ( + FOLDER_ID INTEGER NOT NULL, + FOLDER_NAME CHARACTER VARYING(50) NOT NULL, + DESCR CHARACTER VARYING(500), + CREATE_ID INTEGER NOT NULL, + CREATE_DATE TIMESTAMP NOT NULL, + PARENT_FOLDER_ID INTEGER, + PUBLIC_YN CHARACTER VARYING(1) DEFAULT 'N' NOT NULL +); + +-- +-- NAME: CR_FOLDER_ACCESS; TYPE: TABLE +-- +create table cr_folder_access ( + FOLDER_ACCESS_ID NUMERIC(11,0) NOT NULL, + FOLDER_ID NUMERIC(11,0) NOT NULL, + ORDER_NO NUMERIC(11,0) NOT NULL, + ROLE_ID NUMERIC(11,0), + USER_ID NUMERIC(11,0), + READ_ONLY_YN CHARACTER VARYING(1) DEFAULT 'N' NOT NULL +); + +-- +-- NAME: CR_HIST_USER_MAP; TYPE: TABLE +-- +create table cr_hist_user_map ( + HIST_ID INT(11) NOT NULL, + USER_ID INT(11) NOT NULL +); + +-- +-- NAME: CR_LU_FILE_TYPE; TYPE: TABLE +-- +create table cr_lu_file_type ( + LOOKUP_ID NUMERIC(2,0) NOT NULL, + LOOKUP_DESCR CHARACTER VARYING(255) NOT NULL, + ACTIVE_YN CHARACTER(1) DEFAULT 'Y', + ERROR_CODE NUMERIC(11,0) +); + +-- +-- NAME: CR_RAPTOR_ACTION_IMG; TYPE: TABLE +-- +create table cr_raptor_action_img ( + IMAGE_ID CHARACTER VARYING(100) NOT NULL, + IMAGE_LOC CHARACTER VARYING(400) +); + +-- +-- NAME: CR_RAPTOR_PDF_IMG; TYPE: TABLE +-- +create table cr_raptor_pdf_img ( + IMAGE_ID CHARACTER VARYING(100) NOT NULL, + IMAGE_LOC CHARACTER VARYING(400) +); + +-- +-- NAME: CR_REMOTE_SCHEMA_INFO; TYPE: TABLE +-- +create table cr_remote_schema_info ( + SCHEMA_PREFIX CHARACTER VARYING(5) NOT NULL, + SCHEMA_DESC CHARACTER VARYING(75) NOT NULL, + DATASOURCE_TYPE CHARACTER VARYING(100) +); + +-- +-- NAME: CR_REPORT; TYPE: TABLE +-- +create table cr_report ( + REP_ID NUMERIC(11,0) NOT NULL, + TITLE CHARACTER VARYING(100) NOT NULL, + DESCR CHARACTER VARYING(255), + PUBLIC_YN CHARACTER VARYING(1) DEFAULT 'N' NOT NULL, + REPORT_XML TEXT, + CREATE_ID NUMERIC(11,0), + CREATE_DATE TIMESTAMP default now(), + MAINT_ID NUMERIC(11,0), + MAINT_DATE TIMESTAMP DEFAULT NOW(), + MENU_ID CHARACTER VARYING(500), + MENU_APPROVED_YN CHARACTER VARYING(1) DEFAULT 'N' NOT NULL, + OWNER_ID NUMERIC(11,0), + FOLDER_ID INTEGER DEFAULT 0, + DASHBOARD_TYPE_YN CHARACTER VARYING(1) DEFAULT 'N', + DASHBOARD_YN CHARACTER VARYING(1) DEFAULT 'N' +); + +-- +-- NAME: CR_REPORT_ACCESS; TYPE: TABLE +-- +create table cr_report_access ( + REP_ID NUMERIC(11,0) NOT NULL, + ORDER_NO NUMERIC(11,0) NOT NULL, + ROLE_ID NUMERIC(11,0), + USER_ID NUMERIC(11,0), + READ_ONLY_YN CHARACTER VARYING(1) DEFAULT 'N' NOT NULL +); + +-- +-- NAME: CR_REPORT_DWNLD_LOG; TYPE: TABLE +-- +create table cr_report_dwnld_log ( + USER_ID NUMERIC(11,0) NOT NULL, + REP_ID INTEGER NOT NULL, + FILE_NAME CHARACTER VARYING(100) NOT NULL, + DWNLD_START_TIME TIMESTAMP DEFAULT NOW() NOT NULL, + RECORD_READY_TIME TIMESTAMP DEFAULT NOW(), + FILTER_PARAMS CHARACTER VARYING(2000) +); + +-- +-- NAME: CR_REPORT_EMAIL_SENT_LOG; TYPE: TABLE +-- +create table cr_report_email_sent_log ( + LOG_ID INTEGER NOT NULL, + SCHEDULE_ID NUMERIC(11,0), + GEN_KEY CHARACTER VARYING(25) NOT NULL, + REP_ID NUMERIC(11,0) NOT NULL, + USER_ID NUMERIC(11,0), + SENT_DATE TIMESTAMP DEFAULT NOW(), + ACCESS_FLAG CHARACTER VARYING(1) DEFAULT 'Y' NOT NULL, + TOUCH_DATE TIMESTAMP DEFAULT NOW() +); + +-- +-- NAME: CR_REPORT_FILE_HISTORY; TYPE: TABLE +-- +create table cr_report_file_history ( + HIST_ID INT(11) NOT NULL, + SCHED_USER_ID NUMERIC(11,0) NOT NULL, + SCHEDULE_ID NUMERIC(11,0) NOT NULL, + USER_ID NUMERIC(11,0) NOT NULL, + REP_ID NUMERIC(11,0), + RUN_DATE TIMESTAMP, + RECURRENCE CHARACTER VARYING(50), + FILE_TYPE_ID NUMERIC(2,0), + FILE_NAME CHARACTER VARYING(80), + FILE_BLOB BLOB, + FILE_SIZE NUMERIC(11,0), + RAPTOR_URL CHARACTER VARYING(4000), + ERROR_YN CHARACTER(1) DEFAULT 'N', + ERROR_CODE NUMERIC(11,0), + DELETED_YN CHARACTER(1) DEFAULT 'N', + DELETED_BY NUMERIC(38,0) +); + +-- +-- NAME: CR_REPORT_LOG; TYPE: TABLE +-- +create table cr_report_log ( + REP_ID NUMERIC(11,0) NOT NULL, + LOG_TIME TIMESTAMP NOT NULL, + USER_ID NUMERIC(11,0) NOT NULL, + ACTION CHARACTER VARYING(2000) NOT NULL, + ACTION_VALUE CHARACTER VARYING(50), + FORM_FIELDS CHARACTER VARYING(4000) +); + +-- +-- NAME: CR_REPORT_SCHEDULE; TYPE: TABLE +-- +create table cr_report_schedule ( + SCHEDULE_ID NUMERIC(11,0) NOT NULL, + SCHED_USER_ID NUMERIC(11,0) NOT NULL, + REP_ID NUMERIC(11,0) NOT NULL, + ENABLED_YN CHARACTER VARYING(1) NOT NULL, + START_DATE TIMESTAMP DEFAULT NOW(), + END_DATE TIMESTAMP DEFAULT NOW(), + RUN_DATE TIMESTAMP DEFAULT NOW(), + RECURRENCE CHARACTER VARYING(50), + CONDITIONAL_YN CHARACTER VARYING(1) NOT NULL, + CONDITION_SQL CHARACTER VARYING(4000), + NOTIFY_TYPE INTEGER DEFAULT 0, + MAX_ROW INTEGER DEFAULT 1000, + INITIAL_FORMFIELDS CHARACTER VARYING(3500), + PROCESSED_FORMFIELDS CHARACTER VARYING(3500), + FORMFIELDS CHARACTER VARYING(3500), + CONDITION_LARGE_SQL TEXT, + ENCRYPT_YN CHARACTER(1) DEFAULT 'N', + ATTACHMENT_YN CHARACTER(1) DEFAULT 'Y' +); + +-- +-- NAME: CR_REPORT_SCHEDULE_USERS; TYPE: TABLE +-- +create table cr_report_schedule_users ( + SCHEDULE_ID NUMERIC(11,0) NOT NULL, + REP_ID NUMERIC(11,0) NOT NULL, + USER_ID NUMERIC(11,0) NOT NULL, + ROLE_ID NUMERIC(11,0), + ORDER_NO NUMERIC(11,0) NOT NULL +); + +-- +-- NAME: CR_REPORT_TEMPLATE_MAP; TYPE: TABLE +-- +create table cr_report_template_map ( + REPORT_ID INTEGER NOT NULL, + TEMPLATE_FILE CHARACTER VARYING(200) +); + +-- +-- NAME: CR_SCHEDULE_ACTIVITY_LOG; TYPE: TABLE +-- +create table cr_schedule_activity_log ( + SCHEDULE_ID NUMERIC(11,0) NOT NULL, + URL CHARACTER VARYING(4000), + NOTES CHARACTER VARYING(2000), + RUN_TIME TIMESTAMP +); + +-- +-- NAME: CR_TABLE_JOIN; TYPE: TABLE +-- +create table cr_table_join ( + SRC_TABLE_NAME CHARACTER VARYING(30) NOT NULL, + DEST_TABLE_NAME CHARACTER VARYING(30) NOT NULL, + JOIN_EXPR CHARACTER VARYING(500) NOT NULL +); + +-- +-- NAME: CR_TABLE_ROLE; TYPE: TABLE +-- +create table cr_table_role ( + TABLE_NAME CHARACTER VARYING(30) NOT NULL, + ROLE_ID NUMERIC(11,0) NOT NULL +); + +-- +-- NAME: CR_TABLE_SOURCE; TYPE: TABLE +-- +create table cr_table_source ( + TABLE_NAME CHARACTER VARYING(30) NOT NULL, + DISPLAY_NAME CHARACTER VARYING(30) NOT NULL, + PK_FIELDS CHARACTER VARYING(200), + WEB_VIEW_ACTION CHARACTER VARYING(50), + LARGE_DATA_SOURCE_YN CHARACTER VARYING(1) DEFAULT 'N' NOT NULL, + FILTER_SQL CHARACTER VARYING(4000), + SOURCE_DB CHARACTER VARYING(50) +); + +-- +-- NAME: FN_LU_TIMEZONE; TYPE: TABLE +-- +create table fn_lu_timezone ( + TIMEZONE_ID INT(11) NOT NULL, + TIMEZONE_NAME CHARACTER VARYING(100) NOT NULL, + TIMEZONE_VALUE CHARACTER VARYING(100) NOT NULL +); + +create table fn_user ( + USER_ID INT(11) NOT NULL PRIMARY KEY AUTO_INCREMENT, + ORG_ID INT(11), + MANAGER_ID INT(11), + FIRST_NAME CHARACTER VARYING(50), + MIDDLE_NAME CHARACTER VARYING(50), + LAST_NAME CHARACTER VARYING(50), + PHONE CHARACTER VARYING(25), + FAX CHARACTER VARYING(25), + CELLULAR CHARACTER VARYING(25), + EMAIL CHARACTER VARYING(50), + ADDRESS_ID NUMERIC(11,0), + ALERT_METHOD_CD CHARACTER VARYING(10), + HRID CHARACTER VARYING(20), + ORG_USER_ID CHARACTER VARYING(20), + ORG_CODE CHARACTER VARYING(30), + LOGIN_ID CHARACTER VARYING(25), + LOGIN_PWD CHARACTER VARYING(25), + LAST_LOGIN_DATE TIMESTAMP, + ACTIVE_YN CHARACTER VARYING(1) DEFAULT 'Y' NOT NULL, + CREATED_ID INT(11), + CREATED_DATE TIMESTAMP DEFAULT NOW(), + MODIFIED_ID INT(11), + MODIFIED_DATE TIMESTAMP default now(), + IS_INTERNAL_YN CHARACTER(1) DEFAULT 'N' NOT NULL, + ADDRESS_LINE_1 CHARACTER VARYING(100), + ADDRESS_LINE_2 CHARACTER VARYING(100), + CITY CHARACTER VARYING(50), + STATE_CD CHARACTER VARYING(3), + ZIP_CODE CHARACTER VARYING(11), + COUNTRY_CD CHARACTER VARYING(3), + LOCATION_CLLI CHARACTER VARYING(8), + ORG_MANAGER_USERID CHARACTER VARYING(20), + COMPANY CHARACTER VARYING(100), + DEPARTMENT_NAME CHARACTER VARYING(100), + JOB_TITLE CHARACTER VARYING(100), + TIMEZONE INT(11), + DEPARTMENT CHARACTER VARYING(25), + BUSINESS_UNIT CHARACTER VARYING(25), + BUSINESS_UNIT_NAME CHARACTER VARYING(100), + COST_CENTER CHARACTER VARYING(25), + FIN_LOC_CODE CHARACTER VARYING(10), + SILO_STATUS CHARACTER VARYING(10) +); + +-- +-- NAME: FN_ROLE; TYPE: TABLE +-- +create table fn_role ( + ROLE_ID INT(11) NOT NULL PRIMARY KEY AUTO_INCREMENT, + ROLE_NAME CHARACTER VARYING(300) NOT NULL, + ACTIVE_YN CHARACTER VARYING(1) DEFAULT 'Y' NOT NULL, + PRIORITY NUMERIC(4,0) +); + +-- +-- NAME: FN_AUDIT_ACTION; TYPE: TABLE +-- +create table fn_audit_action ( + AUDIT_ACTION_ID INTEGER NOT NULL, + CLASS_NAME CHARACTER VARYING(500) NOT NULL, + METHOD_NAME CHARACTER VARYING(50) NOT NULL, + AUDIT_ACTION_CD CHARACTER VARYING(20) NOT NULL, + AUDIT_ACTION_DESC CHARACTER VARYING(200), + ACTIVE_YN CHARACTER VARYING(1) +); + +-- +-- NAME: FN_AUDIT_ACTION_LOG; TYPE: TABLE +-- +create table fn_audit_action_log ( + AUDIT_LOG_ID INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT, + AUDIT_ACTION_CD CHARACTER VARYING(200), + ACTION_TIME TIMESTAMP, + USER_ID NUMERIC(11,0), + CLASS_NAME CHARACTER VARYING(100), + METHOD_NAME CHARACTER VARYING(50), + SUCCESS_MSG CHARACTER VARYING(20), + ERROR_MSG CHARACTER VARYING(500) +); + +-- +-- NAME: FN_LU_ACTIVITY; TYPE: TABLE +-- +create table fn_lu_activity ( + ACTIVITY_CD CHARACTER VARYING(50) NOT NULL PRIMARY KEY, + ACTIVITY CHARACTER VARYING(50) NOT NULL +); + +-- +-- NAME: FN_AUDIT_LOG; TYPE: TABLE +-- +create table fn_audit_log ( + LOG_ID INT(11) NOT NULL PRIMARY KEY AUTO_INCREMENT, + USER_ID INT(11) NOT NULL, + ACTIVITY_CD CHARACTER VARYING(50) NOT NULL, + AUDIT_DATE TIMESTAMP DEFAULT NOW() NOT NULL, + COMMENTS CHARACTER VARYING(1000), + AFFECTED_RECORD_ID_BK CHARACTER VARYING(500), + AFFECTED_RECORD_ID CHARACTER VARYING(4000), + CONSTRAINT FK_FN_AUDIT_REF_209_FN_USER FOREIGN KEY (USER_ID) REFERENCES FN_USER(USER_ID) +); + +-- +-- NAME: FN_BROADCAST_MESSAGE; TYPE: TABLE +-- +create table fn_broadcast_message ( + MESSAGE_ID INT(11) NOT NULL PRIMARY KEY AUTO_INCREMENT, + MESSAGE_TEXT CHARACTER VARYING(1000) NOT NULL, + MESSAGE_LOCATION_ID NUMERIC(11,0) NOT NULL, + BROADCAST_START_DATE TIMESTAMP NOT NULL DEFAULT NOW(), + BROADCAST_END_DATE TIMESTAMP NOT NULL DEFAULT NOW(), + ACTIVE_YN CHARACTER(1) DEFAULT 'Y' NOT NULL, + SORT_ORDER NUMERIC(4,0) NOT NULL, + BROADCAST_SITE_CD CHARACTER VARYING(50) +); + +-- +-- NAME: FN_CHAT_LOGS; TYPE: TABLE +-- +create table fn_chat_logs ( + CHAT_LOG_ID INTEGER NOT NULL, + CHAT_ROOM_ID INTEGER, + USER_ID INTEGER, + MESSAGE CHARACTER VARYING(1000), + MESSAGE_DATE_TIME TIMESTAMP +); + +-- +-- NAME: FN_CHAT_ROOM; TYPE: TABLE +-- +create table fn_chat_room ( + CHAT_ROOM_ID INTEGER NOT NULL, + NAME CHARACTER VARYING(50) NOT NULL, + DESCRIPTION CHARACTER VARYING(500), + OWNER_ID INTEGER, + CREATED_DATE TIMESTAMP DEFAULT NOW(), + UPDATED_DATE TIMESTAMP DEFAULT NOW() +); + +-- +-- NAME: FN_CHAT_USERS; TYPE: TABLE +-- +create table fn_chat_users ( + CHAT_ROOM_ID INTEGER, + USER_ID INTEGER, + LAST_ACTIVITY_DATE_TIME TIMESTAMP, + CHAT_STATUS CHARACTER VARYING(20), + ID INTEGER NOT NULL +); + +-- +-- NAME: FN_DATASOURCE; TYPE: TABLE +-- +create table fn_datasource ( + ID INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT, + NAME CHARACTER VARYING(50), + DRIVER_NAME CHARACTER VARYING(256), + SERVER CHARACTER VARYING(256), + PORT INTEGER, + USER_NAME CHARACTER VARYING(256), + PASSWORD CHARACTER VARYING(256), + URL CHARACTER VARYING(256), + MIN_POOL_SIZE INTEGER, + MAX_POOL_SIZE INTEGER, + ADAPTER_ID INTEGER, + DS_TYPE CHARACTER VARYING(20) +); + +-- +-- NAME: FN_FUNCTION; TYPE: TABLE +-- +create table fn_function ( + FUNCTION_CD CHARACTER VARYING(30) NOT NULL PRIMARY KEY, + FUNCTION_NAME CHARACTER VARYING(50) NOT NULL +); + +-- +-- NAME: FN_LU_ALERT_METHOD; TYPE: TABLE +-- +create table fn_lu_alert_method ( + ALERT_METHOD_CD CHARACTER VARYING(10) NOT NULL, + ALERT_METHOD CHARACTER VARYING(50) NOT NULL +); + +-- +-- NAME: FN_LU_BROADCAST_SITE; TYPE: TABLE +-- +create table fn_lu_broadcast_site ( + BROADCAST_SITE_CD CHARACTER VARYING(50) NOT NULL, + BROADCAST_SITE_DESCR CHARACTER VARYING(100) +); +-- +-- NAME: FN_LU_MENU_SET; TYPE: TABLE +-- +create table fn_lu_menu_set ( + MENU_SET_CD CHARACTER VARYING(10) NOT NULL PRIMARY KEY, + MENU_SET_NAME CHARACTER VARYING(50) NOT NULL +); + +-- +-- NAME: FN_LU_PRIORITY; TYPE: TABLE +-- +create table fn_lu_priority ( + PRIORITY_ID NUMERIC(11,0) NOT NULL, + PRIORITY CHARACTER VARYING(50) NOT NULL, + ACTIVE_YN CHARACTER(1) NOT NULL, + SORT_ORDER NUMERIC(5,0) +); + +-- +-- NAME: FN_LU_ROLE_TYPE; TYPE: TABLE +-- +create table fn_lu_role_type ( + ROLE_TYPE_ID NUMERIC(11,0) NOT NULL, + ROLE_TYPE CHARACTER VARYING(50) NOT NULL +); +-- +-- NAME: FN_LU_TAB_SET; TYPE: TABLE +-- +create table fn_lu_tab_set ( + TAB_SET_CD CHARACTER VARYING(30) NOT NULL, + TAB_SET_NAME CHARACTER VARYING(50) NOT NULL +); + +-- +-- NAME: FN_MENU; TYPE: TABLE +-- +create table fn_menu ( + MENU_ID INT(11) NOT NULL PRIMARY KEY AUTO_INCREMENT, + LABEL CHARACTER VARYING(100), + PARENT_ID INT(11), + SORT_ORDER NUMERIC(4,0), + ACTION CHARACTER VARYING(200), + FUNCTION_CD CHARACTER VARYING(30), + ACTIVE_YN CHARACTER VARYING(1) DEFAULT 'Y' NOT NULL, + SERVLET CHARACTER VARYING(50), + QUERY_STRING CHARACTER VARYING(200), + EXTERNAL_URL CHARACTER VARYING(200), + TARGET CHARACTER VARYING(25), + MENU_SET_CD CHARACTER VARYING(10) DEFAULT 'APP', + SEPARATOR_YN CHARACTER(1) DEFAULT 'N', + IMAGE_SRC CHARACTER VARYING(100), + CONSTRAINT FK_FN_MENU_REF_196_FN_MENU FOREIGN KEY (PARENT_ID) REFERENCES FN_MENU(MENU_ID), + CONSTRAINT FK_FN_MENU_MENU_SET_CD FOREIGN KEY (MENU_SET_CD) REFERENCES FN_LU_MENU_SET(MENU_SET_CD) +); + +-- +-- NAME: FN_ORG; TYPE: TABLE +-- +create table fn_org ( + ORG_ID INT(11) NOT NULL, + ORG_NAME CHARACTER VARYING(50) NOT NULL, + ACCESS_CD CHARACTER VARYING(10) +); + +-- +-- NAME: FN_RESTRICTED_URL; TYPE: TABLE +-- +create table fn_restricted_url ( + RESTRICTED_URL CHARACTER VARYING(250) NOT NULL, + FUNCTION_CD CHARACTER VARYING(30) NOT NULL +); + +-- +-- NAME: FN_ROLE_COMPOSITE; TYPE: TABLE +-- +create table fn_role_composite ( + PARENT_ROLE_ID INT(11) NOT NULL, + CHILD_ROLE_ID INT(11) NOT NULL, + CONSTRAINT FK_FN_ROLE_COMPOSITE_CHILD FOREIGN KEY (CHILD_ROLE_ID) REFERENCES FN_ROLE(ROLE_ID), + CONSTRAINT FK_FN_ROLE_COMPOSITE_PARENT FOREIGN KEY (PARENT_ROLE_ID) REFERENCES FN_ROLE(ROLE_ID) +); + +-- +-- NAME: FN_ROLE_FUNCTION; TYPE: TABLE +-- +create table fn_role_function ( + ROLE_ID INT(11) NOT NULL, + FUNCTION_CD CHARACTER VARYING(30) NOT NULL, + CONSTRAINT FK_FN_ROLE__REF_198_FN_ROLE FOREIGN KEY (ROLE_ID) REFERENCES FN_ROLE(ROLE_ID) +); + +-- +-- NAME: FN_TAB; TYPE: TABLE +-- +create table fn_tab ( + TAB_CD CHARACTER VARYING(30) NOT NULL, + TAB_NAME CHARACTER VARYING(50) NOT NULL, + TAB_DESCR CHARACTER VARYING(100), + ACTION CHARACTER VARYING(100) NOT NULL, + FUNCTION_CD CHARACTER VARYING(30) NOT NULL, + ACTIVE_YN CHARACTER(1) NOT NULL, + SORT_ORDER NUMERIC(11,0) NOT NULL, + PARENT_TAB_CD CHARACTER VARYING(30), + TAB_SET_CD CHARACTER VARYING(30) +); + +-- +-- NAME: FN_TAB_SELECTED; TYPE: TABLE +-- +create table fn_tab_selected ( + SELECTED_TAB_CD CHARACTER VARYING(30) NOT NULL, + TAB_URI CHARACTER VARYING(40) NOT NULL +); + +-- +-- NAME: FN_USER_PSEUDO_ROLE; TYPE: TABLE +-- +create table fn_user_pseudo_role ( + PSEUDO_ROLE_ID INT(11) NOT NULL, + USER_ID INT(11) NOT NULL +); + +-- +-- NAME: FN_USER_ROLE; TYPE: TABLE +-- +create table fn_user_role ( + USER_ID INT(10) NOT NULL, + ROLE_ID INT(10) NOT NULL, + PRIORITY NUMERIC(4,0), + APP_ID INT(11) DEFAULT 1, + CONSTRAINT FK_FN_USER__REF_172_FN_USER FOREIGN KEY (USER_ID) REFERENCES FN_USER(USER_ID), + CONSTRAINT FK_FN_USER__REF_175_FN_ROLE FOREIGN KEY (ROLE_ID) REFERENCES FN_ROLE(ROLE_ID) +); +-- +-- NAME: SCHEMA_INFO; TYPE: TABLE +-- +create table schema_info ( + SCHEMA_ID CHARACTER VARYING(25) NOT NULL, + SCHEMA_DESC CHARACTER VARYING(75) NOT NULL, + DATASOURCE_TYPE CHARACTER VARYING(100), + CONNECTION_URL VARCHAR(200) NOT NULL, + USER_NAME VARCHAR(45) NOT NULL, + PASSWORD VARCHAR(45) NULL DEFAULT NULL, + DRIVER_CLASS VARCHAR(100) NOT NULL, + MIN_POOL_SIZE INT NOT NULL, + MAX_POOL_SIZE INT NOT NULL, + IDLE_CONNECTION_TEST_PERIOD INT NOT NULL + +); + +-- ---------------------------------------------------------- +-- NAME: FN_APP; TYPE: TABLE +-- ---------------------------------------------------------- +create table fn_app ( + APP_ID int(11) PRIMARY KEY NOT NULL AUTO_INCREMENT, + APP_NAME varchar(100) NOT NULL DEFAULT '?', + APP_IMAGE_URL varchar(256) DEFAULT NULL, + APP_DESCRIPTION varchar(512) DEFAULT NULL, + APP_NOTES varchar(4096) DEFAULT NULL, + APP_URL varchar(256) DEFAULT NULL, + APP_ALTERNATE_URL varchar(256) DEFAULT NULL, + APP_REST_ENDPOINT varchar(2000) DEFAULT NULL, + ML_APP_NAME varchar(50) NOT NULL DEFAULT '?', + ML_APP_ADMIN_ID varchar(7) NOT NULL DEFAULT '?', + MOTS_ID int(11) DEFAULT NULL, + APP_PASSWORD varchar(256) NOT NULL DEFAULT '?', + OPEN char(1) DEFAULT 'N', + ENABLED char(1) DEFAULT 'Y', + THUMBNAIL mediumblob, + APP_USERNAME varchar(50), + UEB_KEY VARCHAR(256) DEFAULT NULL, + UEB_SECRET VARCHAR(256) DEFAULT NULL, + UEB_TOPIC_NAME VARCHAR(256) DEFAULT NULL + +); + +-- ---------------------------------------------------------- +-- NAME: FN_FN_WORKFLOW; TYPE: TABLE +-- ---------------------------------------------------------- +create table fn_workflow ( + id mediumint(9) NOT NULL AUTO_INCREMENT, + name varchar(20) NOT NULL, + description varchar(500) DEFAULT NULL, + run_link varchar(300) DEFAULT NULL, + suspend_link varchar(300) DEFAULT NULL, + modified_link varchar(300) DEFAULT NULL, + active_yn varchar(300) DEFAULT NULL, + created varchar(300) DEFAULT NULL, + created_by int(11) DEFAULT NULL, + modified varchar(300) DEFAULT NULL, + modified_by int(11) DEFAULT NULL, + workflow_key varchar(50) DEFAULT NULL, + PRIMARY KEY (id), + UNIQUE KEY name (name) +); + +-- ---------------------------------------------------------- +-- NAME: FN_SCHEDULE_WORKFLOWS; TYPE: TABLE +-- ---------------------------------------------------------- +create table fn_schedule_workflows ( + id_schedule_workflows bigint(25) PRIMARY KEY NOT NULL AUTO_INCREMENT, + workflow_server_url varchar(45) DEFAULT NULL, + workflow_key varchar(45) NOT NULL, + workflow_arguments varchar(45) DEFAULT NULL, + startDateTimeCron varchar(45) DEFAULT NULL, + endDateTime TIMESTAMP DEFAULT NOW(), + start_date_time TIMESTAMP DEFAULT NOW(), + recurrence varchar(45) DEFAULT NULL + ); + +-- For demo reporting application add : demo_bar_chart, demo_bar_chart_inter, demo_line_chart, demo_pie_chart and demo_util_chart +-- demo_scatter_chart, demo_scatter_plot +-- ---------------------------------------------------------- +-- NAME: DEMO_BAR_CHART; TYPE: TABLE +-- ---------------------------------------------------------- +create table demo_bar_chart ( + label varchar(20), + value numeric(25,15) + ); + +-- ---------------------------------------------------------- +-- NAME: DEMO_BAR_CHART_INTER; TYPE: TABLE +-- ---------------------------------------------------------- +create table demo_bar_chart_inter ( + spam_date date, + num_rpt_sources numeric(10,0), + num_det_sources numeric(10,0) + ); + +-- ---------------------------------------------------------- +-- NAME: DEMO_LINE_CHART; TYPE: TABLE +-- ---------------------------------------------------------- +create table demo_line_chart ( + series varchar(20), + log_date date, + data_value numeric(10,5) + ); + +-- ---------------------------------------------------------- +-- NAME: DEMO_PIE_CHART; TYPE: TABLE +-- ---------------------------------------------------------- +create table demo_pie_chart ( + legend varchar(20), + data_value numeric(10,5) + ); + +-- ---------------------------------------------------------- +-- NAME: DEMO_UTIL_CHART; TYPE: TABLE +-- ---------------------------------------------------------- +create table demo_util_chart ( + traffic_date date, + util_perc numeric(10,5) + ); + +-- ---------------------------------------------------------- +-- NAME: DEMO_SCATTER_CHART; TYPE: TABLE +-- ---------------------------------------------------------- +create table demo_scatter_chart ( + rainfall numeric(10,2), + key_value varchar(20), + measurements numeric(10,2) +); + +-- ---------------------------------------------------------- +-- NAME: DEMO_SCATTER_PLOT; TYPE: TABLE +-- ---------------------------------------------------------- +create table demo_scatter_plot +( + SERIES VARCHAR(20), + VALUEX numeric(25,15), + VALUEY numeric(25,15) +); + +-- ---------------------------------------------------------- +-- NAME: FN_QZ_JOB_DETAILS; TYPE: TABLE +-- ---------------------------------------------------------- +create table fn_qz_job_details ( +SCHED_NAME VARCHAR(120) NOT NULL, +JOB_NAME VARCHAR(200) NOT NULL, +JOB_GROUP VARCHAR(200) NOT NULL, +DESCRIPTION VARCHAR(250) NULL, +JOB_CLASS_NAME VARCHAR(250) NOT NULL, +IS_DURABLE VARCHAR(1) NOT NULL, +IS_NONCONCURRENT VARCHAR(1) NOT NULL, +IS_UPDATE_DATA VARCHAR(1) NOT NULL, +REQUESTS_RECOVERY VARCHAR(1) NOT NULL, +JOB_DATA BLOB NULL, +PRIMARY KEY (SCHED_NAME,JOB_NAME,JOB_GROUP) +); + +-- ---------------------------------------------------------- +-- NAME: FN_QZ_TRIGGERS; TYPE: TABLE +-- ---------------------------------------------------------- +create table fn_qz_triggers ( +SCHED_NAME VARCHAR(120) NOT NULL, +TRIGGER_NAME VARCHAR(200) NOT NULL, +TRIGGER_GROUP VARCHAR(200) NOT NULL, +JOB_NAME VARCHAR(200) NOT NULL, +JOB_GROUP VARCHAR(200) NOT NULL, +DESCRIPTION VARCHAR(250) NULL, +NEXT_FIRE_TIME BIGINT(13) NULL, +PREV_FIRE_TIME BIGINT(13) NULL, +PRIORITY INTEGER NULL, +TRIGGER_STATE VARCHAR(16) NOT NULL, +TRIGGER_TYPE VARCHAR(8) NOT NULL, +START_TIME BIGINT(13) NOT NULL, +END_TIME BIGINT(13) NULL, +CALENDAR_NAME VARCHAR(200) NULL, +MISFIRE_INSTR SMALLINT(2) NULL, +JOB_DATA BLOB NULL, +PRIMARY KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP), +FOREIGN KEY (SCHED_NAME,JOB_NAME,JOB_GROUP) +REFERENCES FN_QZ_JOB_DETAILS(SCHED_NAME,JOB_NAME,JOB_GROUP) +); + +-- ---------------------------------------------------------- +-- NAME: FN_QZ_SIMPLE_TRIGGERS; TYPE: TABLE +-- ---------------------------------------------------------- +create table fn_qz_simple_triggers ( +SCHED_NAME VARCHAR(120) NOT NULL, +TRIGGER_NAME VARCHAR(200) NOT NULL, +TRIGGER_GROUP VARCHAR(200) NOT NULL, +REPEAT_COUNT BIGINT(7) NOT NULL, +REPEAT_INTERVAL BIGINT(12) NOT NULL, +TIMES_TRIGGERED BIGINT(10) NOT NULL, +PRIMARY KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP), +FOREIGN KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP) +REFERENCES FN_QZ_TRIGGERS(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP) +); + +-- ---------------------------------------------------------- +-- NAME: FN_QZ_CRON_TRIGGERS; TYPE: TABLE +-- ---------------------------------------------------------- +create table fn_qz_cron_triggers ( +SCHED_NAME VARCHAR(120) NOT NULL, +TRIGGER_NAME VARCHAR(200) NOT NULL, +TRIGGER_GROUP VARCHAR(200) NOT NULL, +CRON_EXPRESSION VARCHAR(120) NOT NULL, +TIME_ZONE_ID VARCHAR(80), +PRIMARY KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP), +FOREIGN KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP) +REFERENCES FN_QZ_TRIGGERS(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP) +); + +-- ---------------------------------------------------------- +-- NAME: FN_QZ_SIMPROP_TRIGGERS; TYPE: TABLE +-- ---------------------------------------------------------- +create table fn_qz_simprop_triggers + ( + SCHED_NAME VARCHAR(120) NOT NULL, + TRIGGER_NAME VARCHAR(200) NOT NULL, + TRIGGER_GROUP VARCHAR(200) NOT NULL, + STR_PROP_1 VARCHAR(512) NULL, + STR_PROP_2 VARCHAR(512) NULL, + STR_PROP_3 VARCHAR(512) NULL, + INT_PROP_1 INT NULL, + INT_PROP_2 INT NULL, + LONG_PROP_1 BIGINT NULL, + LONG_PROP_2 BIGINT NULL, + DEC_PROP_1 NUMERIC(13,4) NULL, + DEC_PROP_2 NUMERIC(13,4) NULL, + BOOL_PROP_1 VARCHAR(1) NULL, + BOOL_PROP_2 VARCHAR(1) NULL, + PRIMARY KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP), + FOREIGN KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP) + REFERENCES FN_QZ_TRIGGERS(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP) +); + +-- ---------------------------------------------------------- +-- NAME: FN_QZ_BLOB_TRIGGERS; TYPE: TABLE +-- ---------------------------------------------------------- +create table fn_qz_blob_triggers ( +SCHED_NAME VARCHAR(120) NOT NULL, +TRIGGER_NAME VARCHAR(200) NOT NULL, +TRIGGER_GROUP VARCHAR(200) NOT NULL, +BLOB_DATA BLOB NULL, +PRIMARY KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP), +INDEX (SCHED_NAME,TRIGGER_NAME, TRIGGER_GROUP), +FOREIGN KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP) +REFERENCES FN_QZ_TRIGGERS(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP) +); + +-- ---------------------------------------------------------- +-- NAME: FN_QZ_CALENDARS; TYPE: TABLE +-- ---------------------------------------------------------- +create table fn_qz_calendars ( +SCHED_NAME VARCHAR(120) NOT NULL, +CALENDAR_NAME VARCHAR(200) NOT NULL, +CALENDAR BLOB NOT NULL, +PRIMARY KEY (SCHED_NAME,CALENDAR_NAME) +); + +-- ---------------------------------------------------------- +-- NAME: FN_QZ_PAUSED_TRIGGER_GRPS; TYPE: TABLE +-- ---------------------------------------------------------- +create table fn_qz_paused_trigger_grps ( +SCHED_NAME VARCHAR(120) NOT NULL, +TRIGGER_GROUP VARCHAR(200) NOT NULL, +PRIMARY KEY (SCHED_NAME,TRIGGER_GROUP) +); + +-- ---------------------------------------------------------- +-- NAME: FN_QZ_FIRED_TRIGGERS; TYPE: TABLE +-- ---------------------------------------------------------- +create table fn_qz_fired_triggers ( +SCHED_NAME VARCHAR(120) NOT NULL, +ENTRY_ID VARCHAR(95) NOT NULL, +TRIGGER_NAME VARCHAR(200) NOT NULL, +TRIGGER_GROUP VARCHAR(200) NOT NULL, +INSTANCE_NAME VARCHAR(200) NOT NULL, +FIRED_TIME BIGINT(13) NOT NULL, +SCHED_TIME BIGINT(13) NOT NULL, +PRIORITY INTEGER NOT NULL, +STATE VARCHAR(16) NOT NULL, +JOB_NAME VARCHAR(200) NULL, +JOB_GROUP VARCHAR(200) NULL, +IS_NONCONCURRENT VARCHAR(1) NULL, +REQUESTS_RECOVERY VARCHAR(1) NULL, +PRIMARY KEY (SCHED_NAME,ENTRY_ID) +); + +-- ---------------------------------------------------------- +-- NAME: FN_QZ_SCHEDULER_STATE; TYPE: TABLE +-- ---------------------------------------------------------- +create table fn_qz_scheduler_state ( +SCHED_NAME VARCHAR(120) NOT NULL, +INSTANCE_NAME VARCHAR(200) NOT NULL, +LAST_CHECKIN_TIME BIGINT(13) NOT NULL, +CHECKIN_INTERVAL BIGINT(13) NOT NULL, +PRIMARY KEY (SCHED_NAME,INSTANCE_NAME) +); + +-- ---------------------------------------------------------- +-- NAME: FN_QZ_LOCKS; TYPE: TABLE +-- ---------------------------------------------------------- +create table fn_qz_locks ( +SCHED_NAME VARCHAR(120) NOT NULL, +LOCK_NAME VARCHAR(40) NOT NULL, +PRIMARY KEY (SCHED_NAME,LOCK_NAME) +); + +-- +-- name: rcloudinvocation; type: table +-- +create table rcloudinvocation ( + id varchar(128) not null primary key, + created timestamp not null, + userinfo varchar(2048) not null, + notebookid varchar(128) not null, + parameters varchar(2048) default null, + tokenreaddate timestamp null +); + +-- +-- name: rcloudnotebook; type: table +-- +create table rcloudnotebook ( + notebookname varchar(128) not null primary key, + notebookid varchar(128) not null +); + +-- +-- Name: fn_lu_message_location; Type: TABLE +-- + +CREATE TABLE fn_lu_message_location ( + message_location_id numeric(11,0) NOT NULL, + message_location_descr character varying(30) NOT NULL +); + +-- ------------------ CREATE VIEW SECTION +-- +-- NAME: V_URL_ACCESS; TYPE: VIEW +-- +CREATE VIEW v_url_access AS + SELECT DISTINCT M.ACTION AS URL, + M.FUNCTION_CD + FROM FN_MENU M + WHERE (M.ACTION IS NOT NULL) +UNION + SELECT DISTINCT T.ACTION AS URL, + T.FUNCTION_CD + FROM FN_TAB T + WHERE (T.ACTION IS NOT NULL) +UNION + SELECT R.RESTRICTED_URL AS URL, + R.FUNCTION_CD + FROM FN_RESTRICTED_URL R; + +-- ------------------ ALTER TABLE ADD CONSTRAINT PRIMARY KEY SECTION +-- +-- NAME: CR_FAVORITE_REPORTS_USER_IDREP_ID; TYPE: CONSTRAINT +-- +alter table cr_favorite_reports + add constraint cr_favorite_reports_user_idrep_id primary key (user_id, rep_id); +-- +-- NAME: CR_FOLDER_FOLDER_ID; TYPE: CONSTRAINT +-- +alter table cr_folder + add constraint cr_folder_folder_id primary key (folder_id); +-- +-- NAME: CR_FOLDER_ACCESS_FOLDER_ACCESS_ID; TYPE: CONSTRAINT +-- +alter table cr_folder_access + add constraint cr_folder_access_folder_access_id primary key (folder_access_id); +-- +-- NAME: CR_HIST_USER_MAP_HIST_IDUSER_ID; TYPE: CONSTRAINT +-- +alter table cr_hist_user_map + add constraint cr_hist_user_map_hist_iduser_id primary key (hist_id, user_id); +-- +-- NAME: CR_LU_FILE_TYPE_LOOKUP_ID; TYPE: CONSTRAINT +-- +alter table cr_lu_file_type + add constraint cr_lu_file_type_lookup_id primary key (lookup_id); +-- +-- NAME: CR_RAPTOR_ACTION_IMG_IMAGE_ID; TYPE: CONSTRAINT +-- +alter table cr_raptor_action_img + add constraint cr_raptor_action_img_image_id primary key (image_id); +-- +-- NAME: CR_RAPTOR_PDF_IMG_IMAGE_ID; TYPE: CONSTRAINT +-- +alter table cr_raptor_pdf_img + add constraint cr_raptor_pdf_img_image_id primary key (image_id); +-- +-- NAME: CR_REMOTE_SCHEMA_INFO_SCHEMA_PREFIX; TYPE: CONSTRAINT +-- +alter table cr_remote_schema_info + add constraint cr_remote_schema_info_schema_prefix primary key (schema_prefix); +-- +-- NAME: CR_REPORT_REP_ID; TYPE: CONSTRAINT +-- +alter table cr_report + add constraint cr_report_rep_id primary key (rep_id); +-- +-- NAME: CR_REPORT_ACCESS_REP_IDORDER_NO; TYPE: CONSTRAINT +-- +alter table cr_report_access + add constraint cr_report_access_rep_idorder_no primary key (rep_id, order_no); +-- +-- NAME: CR_REPORT_EMAIL_SENT_LOG_LOG_ID; TYPE: CONSTRAINT +-- +alter table cr_report_email_sent_log + add constraint cr_report_email_sent_log_log_id primary key (log_id); +-- +-- NAME: CR_REPORT_FILE_HISTORY_HIST_ID; TYPE: CONSTRAINT +-- +alter table cr_report_file_history + add constraint cr_report_file_history_hist_id primary key (hist_id); +-- +-- NAME: CR_REPORT_SCHEDULE_SCHEDULE_ID; TYPE: CONSTRAINT +-- +alter table cr_report_schedule + add constraint cr_report_schedule_schedule_id primary key (schedule_id); +-- +-- NAME: CR_REPORT_SCHEDULE_USERS_SCHEDULE_IDREP_IDUSER_IDORDER_NO; TYPE: CONSTRAINT +-- +alter table cr_report_schedule_users + add constraint cr_report_schedule_users_schedule_idrep_iduser_idorder_no primary key (schedule_id, rep_id, user_id, order_no); +-- +-- NAME: CR_REPORT_TEMPLATE_MAP_REPORT_ID; TYPE: CONSTRAINT +-- +alter table cr_report_template_map + add constraint cr_report_template_map_report_id primary key (report_id); +-- +-- NAME: CR_TABLE_ROLE_TABLE_NAMEROLE_ID; TYPE: CONSTRAINT +-- +alter table cr_table_role + add constraint cr_table_role_table_namerole_id primary key (table_name, role_id); +-- +-- NAME: CR_TABLE_SOURCE_TABLE_NAME; TYPE: CONSTRAINT +-- +alter table cr_table_source + add constraint cr_table_source_table_name primary key (table_name); +-- +-- NAME: FN_AUDIT_ACTION_AUDIT_ACTION_ID; TYPE: CONSTRAINT +-- +alter table fn_audit_action + add constraint fn_audit_action_audit_action_id primary key (audit_action_id); +-- +-- NAME: FN_CHAT_LOGS_CHAT_LOG_ID; TYPE: CONSTRAINT +-- +alter table fn_chat_logs + add constraint fn_chat_logs_chat_log_id primary key (chat_log_id); +-- +-- NAME: FN_CHAT_ROOM_CHAT_ROOM_ID; TYPE: CONSTRAINT +-- +alter table fn_chat_room + add constraint fn_chat_room_chat_room_id primary key (chat_room_id); +-- +-- NAME: FN_CHAT_USERS_ID; TYPE: CONSTRAINT +-- +alter table fn_chat_users + add constraint fn_chat_users_id primary key (id); +-- +-- NAME: FN_LU_ALERT_METHOD_ALERT_METHOD_CD; TYPE: CONSTRAINT +-- +alter table fn_lu_alert_method + add constraint fn_lu_alert_method_alert_method_cd primary key (alert_method_cd); +-- +-- NAME: FN_LU_BROADCAST_SITE_BROADCAST_SITE_CD; TYPE: CONSTRAINT +-- +alter table fn_lu_broadcast_site + add constraint fn_lu_broadcast_site_broadcast_site_cd primary key (broadcast_site_cd); +-- +-- NAME: FN_LU_PRIORITY_PRIORITY_ID; TYPE: CONSTRAINT +-- +alter table fn_lu_priority + add constraint fn_lu_priority_priority_id primary key (priority_id); +-- +-- NAME: FN_LU_ROLE_TYPE_ROLE_TYPE_ID; TYPE: CONSTRAINT +-- +alter table fn_lu_role_type + add constraint fn_lu_role_type_role_type_id primary key (role_type_id); +-- +-- NAME: FN_LU_TAB_SET_TAB_SET_CD; TYPE: CONSTRAINT +-- +alter table fn_lu_tab_set + add constraint fn_lu_tab_set_tab_set_cd primary key (tab_set_cd); +-- +-- NAME: FN_LU_TIMEZONE_TIMEZONE_ID; TYPE: CONSTRAINT +-- +alter table fn_lu_timezone + add constraint fn_lu_timezone_timezone_id primary key (timezone_id); +-- +-- NAME: FN_ORG_ORG_ID; TYPE: CONSTRAINT +-- +alter table fn_org + add constraint fn_org_org_id primary key (org_id); +-- +-- NAME: FN_RESTRICTED_URL_RESTRICTED_URLFUNCTION_CD; TYPE: CONSTRAINT +-- +alter table fn_restricted_url + add constraint fn_restricted_url_restricted_urlfunction_cd primary key (restricted_url, function_cd); +-- +-- NAME: FN_ROLE_COMPOSITE_PARENT_ROLE_IDCHILD_ROLE_ID; TYPE: CONSTRAINT +-- +alter table fn_role_composite + add constraint fn_role_composite_parent_role_idchild_role_id primary key (parent_role_id, child_role_id); +-- +-- NAME: FN_ROLE_FUNCTION_ROLE_IDFUNCTION_CD; TYPE: CONSTRAINT +-- +alter table fn_role_function + add constraint fn_role_function_role_idfunction_cd primary key (role_id, function_cd); +-- +-- NAME: FN_TAB_TAB_CD; TYPE: CONSTRAINT +-- +alter table fn_tab + add constraint fn_tab_tab_cd primary key (tab_cd); +-- +-- NAME: FN_TAB_SELECTED_SELECTED_TAB_CDTAB_URI; TYPE: CONSTRAINT +-- +alter table fn_tab_selected + add constraint fn_tab_selected_selected_tab_cdtab_uri primary key (selected_tab_cd, tab_uri); +-- +-- NAME: FN_USER_PSEUDO_ROLE_PSEUDO_ROLE_IDUSER_ID; TYPE: CONSTRAINT +-- +alter table fn_user_pseudo_role + add constraint fn_user_pseudo_role_pseudo_role_iduser_id primary key (pseudo_role_id, user_id); +-- +-- NAME: FN_USER_ROLE_USER_IDROLE_ID; TYPE: CONSTRAINT +-- +alter table fn_user_role + add constraint fn_user_role_user_idrole_id primary key (user_id, role_id, app_id); +-- +-- Name: fn_lu_message_location_MESSAGE_LOCATION_ID; Type: CONSTRAINT +-- + +ALTER TABLE fn_lu_message_location + ADD CONSTRAINT fn_lu_message_location_MESSAGE_LOCATION_ID PRIMARY KEY (message_location_id); + +-- ------------------ CREATE INDEX SECTION +-- +-- NAME: CR_REPORT_CREATE_IDPUBLIC_YNTITLE; TYPE: INDEX +-- +create index cr_report_create_idpublic_yntitle using btree on cr_report (create_id, public_yn, title); +-- +-- NAME: CR_TABLE_JOIN_DEST_TABLE_NAME; TYPE: INDEX +-- +create index cr_table_join_dest_table_name using btree on cr_table_join (dest_table_name); +-- +-- NAME: CR_TABLE_JOIN_SRC_TABLE_NAME; TYPE: INDEX +-- +create index cr_table_join_src_table_name using btree on cr_table_join (src_table_name); +-- +-- NAME: FN_AUDIT_LOG_ACTIVITY_CD; TYPE: INDEX +-- +create index fn_audit_log_activity_cd using btree on fn_audit_log (activity_cd); +-- +-- NAME: FN_AUDIT_LOG_USER_ID; TYPE: INDEX +-- +create index fn_audit_log_user_id using btree on fn_audit_log (user_id); +-- +-- NAME: FN_ORG_ACCESS_CD; TYPE: INDEX +-- +create index fn_org_access_cd using btree on fn_org (access_cd); +-- +-- NAME: FN_ROLE_FUNCTION_FUNCTION_CD; TYPE: INDEX +-- +create index fn_role_function_function_cd using btree on fn_role_function (function_cd); +-- +-- NAME: FN_ROLE_FUNCTION_ROLE_ID; TYPE: INDEX +-- +create index fn_role_function_role_id using btree on fn_role_function (role_id); +-- +-- NAME: FN_USER_ADDRESS_ID; TYPE: INDEX +-- +create index fn_user_address_id using btree on fn_user (address_id); +-- +-- NAME: FN_USER_ALERT_METHOD_CD; TYPE: INDEX +-- +create index fn_user_alert_method_cd using btree on fn_user (alert_method_cd); +-- +-- NAME: FN_USER_HRID; TYPE: INDEX +-- +create unique index fn_user_hrid using btree on fn_user (hrid); +-- +-- NAME: FN_USER_LOGIN_ID; TYPE: INDEX +-- +create unique index fn_user_login_id using btree on fn_user (login_id); +-- +-- NAME: FN_USER_ORG_ID; TYPE: INDEX +-- +create index fn_user_org_id using btree on fn_user (org_id); +-- +-- NAME: FN_USER_ROLE_ROLE_ID; TYPE: INDEX +-- +create index fn_user_role_role_id using btree on fn_user_role (role_id); +-- +-- NAME: FN_USER_ROLE_USER_ID; TYPE: INDEX +-- +create index fn_user_role_user_id using btree on fn_user_role (user_id); +-- +-- NAME: FK_FN_USER__REF_178_FN_APP_idx; TYPE: INDEX +-- +create index fk_fn_user__ref_178_fn_app_IDX on fn_user_role (app_id); + +-- ---------------------------------------------------------- +-- NAME: QUARTZ TYPE: INDEXES +-- ---------------------------------------------------------- +create index idx_fn_qz_j_req_recovery on fn_qz_job_details(sched_name,requests_recovery); +create index idx_fn_qz_j_grp on fn_qz_job_details(sched_name,job_group); +create index idx_fn_qz_t_j on fn_qz_triggers(sched_name,job_name,job_group); +create index idx_fn_qz_t_jg on fn_qz_triggers(sched_name,job_group); +create index idx_fn_qz_t_c on fn_qz_triggers(sched_name,calendar_name); +create index idx_fn_qz_t_g on fn_qz_triggers(sched_name,trigger_group); +create index idx_fn_qz_t_state on fn_qz_triggers(sched_name,trigger_state); +create index idx_fn_qz_t_n_state on fn_qz_triggers(sched_name,trigger_name,trigger_group,trigger_state); +create index idx_fn_qz_t_n_g_state on fn_qz_triggers(sched_name,trigger_group,trigger_state); +create index idx_fn_qz_t_next_fire_time on fn_qz_triggers(sched_name,next_fire_time); +create index idx_fn_qz_t_nft_st on fn_qz_triggers(sched_name,trigger_state,next_fire_time); +create index idx_fn_qz_t_nft_misfire on fn_qz_triggers(sched_name,misfire_instr,next_fire_time); +create index idx_fn_qz_t_nft_st_misfire on fn_qz_triggers(sched_name,misfire_instr,next_fire_time,trigger_state); +create index idx_fn_qz_t_nft_st_misfire_grp on fn_qz_triggers(sched_name,misfire_instr,next_fire_time,trigger_group,trigger_state); +create index idx_fn_qz_ft_trig_inst_name on fn_qz_fired_triggers(sched_name,instance_name); +create index idx_fn_qz_ft_inst_job_req_rcvry on fn_qz_fired_triggers(sched_name,instance_name,requests_recovery); +create index idx_fn_qz_ft_j_g on fn_qz_fired_triggers(sched_name,job_name,job_group); +create index idx_fn_qz_ft_jg on fn_qz_fired_triggers(sched_name,job_group); +create index idx_fn_qz_ft_t_g on fn_qz_fired_triggers(sched_name,trigger_name,trigger_group); +create index idx_fn_qz_ft_tg on fn_qz_fired_triggers(sched_name,trigger_group); + +-- ------------------ ALTER TABLE ADD CONSTRAINT FOREIGN KEY SECTION +-- +-- NAME: FK_FN_AUDIT_REF_205_FN_LU_AC; TYPE: CONSTRAINT +-- +alter table fn_audit_log + add constraint fk_fn_audit_ref_205_fn_lu_ac foreign key (activity_cd) references fn_lu_activity(activity_cd); +-- +-- NAME: FK_FN_ROLE__REF_201_FN_FUNCT; TYPE: CONSTRAINT +-- +alter table fn_role_function + add constraint fk_fn_role__ref_201_fn_funct foreign key (function_cd) references fn_function(function_cd); +-- +-- NAME: FK_FN_USER__REF_178_FN_APP; TYPE: FK CONSTRAINT +-- +alter table fn_user_role + add constraint fk_fn_user__ref_178_fn_app foreign key (app_id) references fn_app(app_id); +-- +-- NAME: FK_CR_REPOR_REF_14707_CR_REPOR; TYPE: FK CONSTRAINT +-- +alter table cr_report_schedule + add constraint fk_cr_repor_ref_14707_cr_repor foreign key (rep_id) references cr_report(rep_id); +-- +-- NAME: FK_CR_REPOR_REF_14716_CR_REPOR; TYPE: FK CONSTRAINT +-- +alter table cr_report_schedule_users + add constraint fk_cr_repor_ref_14716_cr_repor foreign key (schedule_id) references cr_report_schedule(schedule_id); +-- +-- NAME: FK_CR_REPOR_REF_17645_CR_REPOR; TYPE: FK CONSTRAINT +-- +alter table cr_report_log + add constraint fk_cr_repor_ref_17645_cr_repor foreign key (rep_id) references cr_report(rep_id); +-- +-- NAME: FK_CR_REPOR_REF_8550_CR_REPOR; TYPE: FK CONSTRAINT +-- +alter table cr_report_access + add constraint fk_cr_repor_ref_8550_cr_repor foreign key (rep_id) references cr_report(rep_id); +-- +-- NAME: FK_CR_REPORT_REP_ID; TYPE: FK CONSTRAINT +-- +alter table cr_report_email_sent_log + add constraint fk_cr_report_rep_id foreign key (rep_id) references cr_report(rep_id); +-- +-- NAME: FK_CR_TABLE_REF_311_CR_TAB; TYPE: FK CONSTRAINT +-- +alter table cr_table_join + add constraint fk_cr_table_ref_311_cr_tab foreign key (src_table_name) references cr_table_source(table_name); +-- +-- NAME: FK_CR_TABLE_REF_315_CR_TAB; TYPE: FK CONSTRAINT +-- +alter table cr_table_join + add constraint fk_cr_table_ref_315_cr_tab foreign key (dest_table_name) references cr_table_source(table_name); +-- +-- NAME: FK_CR_TABLE_REF_32384_CR_TABLE; TYPE: FK CONSTRAINT +-- +alter table cr_table_role + add constraint fk_cr_table_ref_32384_cr_table foreign key (table_name) references cr_table_source(table_name); +-- +-- NAME: FK_FN_TAB_FUNCTION_CD; TYPE: FK CONSTRAINT +-- +alter table fn_tab + add constraint fk_fn_tab_function_cd foreign key (function_cd) references fn_function(function_cd); +-- +-- NAME: FK_FN_TAB_SELECTED_TAB_CD; TYPE: FK CONSTRAINT +-- +alter table fn_tab_selected + add constraint fk_fn_tab_selected_tab_cd foreign key (selected_tab_cd) references fn_tab(tab_cd); +-- +-- NAME: FK_FN_TAB_SET_CD; TYPE: FK CONSTRAINT +-- +alter table fn_tab + add constraint fk_fn_tab_set_cd foreign key (tab_set_cd) references fn_lu_tab_set(tab_set_cd); +-- +-- NAME: FK_FN_USER_REF_110_FN_ORG; TYPE: FK CONSTRAINT +-- +alter table fn_user + add constraint fk_fn_user_ref_110_fn_org foreign key (org_id) references fn_org(org_id); +-- +-- NAME: FK_FN_USER_REF_123_FN_LU_AL; TYPE: FK CONSTRAINT +-- +alter table fn_user + add constraint fk_fn_user_ref_123_fn_lu_al foreign key (alert_method_cd) references fn_lu_alert_method(alert_method_cd); +-- +-- NAME: FK_FN_USER_REF_197_FN_USER; TYPE: FK CONSTRAINT +-- +alter table fn_user + add constraint fk_fn_user_ref_197_fn_user foreign key (manager_id) references fn_user(user_id); +-- +-- NAME: FK_FN_USER_REF_198_FN_USER; TYPE: FK CONSTRAINT +-- +alter table fn_user + add constraint fk_fn_user_ref_198_fn_user foreign key (created_id) references fn_user(user_id); +-- +-- NAME: FK_FN_USER_REF_199_FN_USER; TYPE: FK CONSTRAINT +-- +alter table fn_user + add constraint fk_fn_user_ref_199_fn_user foreign key (modified_id) references fn_user(user_id); +-- +-- NAME: FK_PARENT_KEY_CR_FOLDER; TYPE: FK CONSTRAINT +-- +alter table cr_folder + add constraint fk_parent_key_cr_folder foreign key (parent_folder_id) references cr_folder(folder_id); +-- +-- NAME: FK_PSEUDO_ROLE_PSEUDO_ROLE_ID; TYPE: FK CONSTRAINT +-- +alter table fn_user_pseudo_role + add constraint fk_pseudo_role_pseudo_role_id foreign key (pseudo_role_id) references fn_role(role_id); +-- +-- NAME: FK_PSEUDO_ROLE_USER_ID; TYPE: FK CONSTRAINT +-- +alter table fn_user_pseudo_role + add constraint fk_pseudo_role_user_id foreign key (user_id) references fn_user(user_id); +-- +-- NAME: FK_TIMEZONE; TYPE: FK CONSTRAINT +-- +alter table fn_user + add constraint fk_timezone foreign key (timezone) references fn_lu_timezone(timezone_id); +-- +-- NAME: SYS_C0014614; TYPE: FK CONSTRAINT +-- +alter table cr_report_file_history + add constraint sys_c0014614 foreign key (file_type_id) references cr_lu_file_type(lookup_id); +-- +-- NAME: SYS_C0014615; TYPE: FK CONSTRAINT +-- +alter table cr_report_file_history + add constraint sys_c0014615 foreign key (rep_id) references cr_report(rep_id); +-- +-- NAME: SYS_C0014616; TYPE: FK CONSTRAINT +-- +alter table cr_hist_user_map + add constraint sys_c0014616 foreign key (hist_id) references cr_report_file_history(hist_id); +-- +-- NAME: SYS_C0014617; TYPE: FK CONSTRAINT +-- +alter table cr_hist_user_map + add constraint sys_c0014617 foreign key (user_id) references fn_user(user_id); + +commit; diff --git a/ecomp-sdk/epsdk-app-common/db-scripts/EcompSdkDMLMySql_2_1_Common.sql b/ecomp-sdk/epsdk-app-common/db-scripts/EcompSdkDMLMySql_2_1_Common.sql new file mode 100644 index 00000000..18de88fd --- /dev/null +++ b/ecomp-sdk/epsdk-app-common/db-scripts/EcompSdkDMLMySql_2_1_Common.sql @@ -0,0 +1,2853 @@ +-- --------------------------------------------------------------------------------------------------------------- +-- This script populates tables in the COMMON version 2.1.0 of the ONAP SDK application database. +-- Additional DML scripts may be required! +-- --------------------------------------------------------------------------------------------------------------- + +SET FOREIGN_KEY_CHECKS=1; + +USE ecomp_sdk; + +-- fn_function +Insert into fn_function (FUNCTION_CD,FUNCTION_NAME) values ('menu_process','Process List'); +Insert into fn_function (FUNCTION_CD,FUNCTION_NAME) values ('menu_job','Job Menu'); +Insert into fn_function (FUNCTION_CD,FUNCTION_NAME) values ('menu_job_create','Job Create'); +Insert into fn_function (FUNCTION_CD,FUNCTION_NAME) values ('menu_job_designer','Process in Designer view'); +Insert into fn_function (FUNCTION_CD,FUNCTION_NAME) values ('menu_task','Task Menu'); +Insert into fn_function (FUNCTION_CD,FUNCTION_NAME) values ('menu_task_search','Task Search'); +Insert into fn_function (FUNCTION_CD,FUNCTION_NAME) values ('menu_map','Map Menu'); +Insert into fn_function (FUNCTION_CD,FUNCTION_NAME) values ('menu_sample','Sample Pages Menu'); +Insert into fn_function (FUNCTION_CD,FUNCTION_NAME) values ('login','Login'); +Insert into fn_function (FUNCTION_CD,FUNCTION_NAME) values ('menu_home','Home Menu'); +Insert into fn_function (FUNCTION_CD,FUNCTION_NAME) values ('menu_customer','Customer Menu'); +Insert into fn_function (FUNCTION_CD,FUNCTION_NAME) values ('menu_reports','Reports Menu'); +Insert into fn_function (FUNCTION_CD,FUNCTION_NAME) values ('menu_profile','Profile Menu'); +Insert into fn_function (FUNCTION_CD,FUNCTION_NAME) values ('menu_admin','Admin Menu'); +Insert into fn_function (FUNCTION_CD,FUNCTION_NAME) values ('menu_feedback','Feedback Menu'); +Insert into fn_function (FUNCTION_CD,FUNCTION_NAME) values ('menu_help','Help Menu'); +Insert into fn_function (FUNCTION_CD,FUNCTION_NAME) values ('menu_logout','Logout Menu'); +Insert into fn_function (FUNCTION_CD,FUNCTION_NAME) values ('menu_notes','Notes Menu'); +Insert into fn_function (FUNCTION_CD,FUNCTION_NAME) values ('menu_ajax','Ajax Menu'); +Insert into fn_function (FUNCTION_CD,FUNCTION_NAME) values ('menu_customer_create','Customer Create'); +Insert into fn_function (FUNCTION_CD,FUNCTION_NAME) values ('menu_profile_create','Profile Create'); +Insert into fn_function (FUNCTION_CD,FUNCTION_NAME) values ('menu_profile_import','Profile Import'); +Insert into fn_function (FUNCTION_CD,FUNCTION_NAME) values ('menu_tab','Sample Tab Menu'); +Insert into fn_function (FUNCTION_CD,FUNCTION_NAME) values ('view_reports','View Raptor reports'); + +Insert into fn_function (FUNCTION_CD,FUNCTION_NAME) values ('menu_itracker_admin','Itracker Admin/Support menu'); +Insert into fn_function (FUNCTION_CD,FUNCTION_NAME) values ('quantum_bd','Big Data Function'); +Insert into fn_function (FUNCTION_CD,FUNCTION_NAME) values ('1','test role function'); +Insert into fn_function (FUNCTION_CD,FUNCTION_NAME) values ('menu_hiveconfig','Hive Configuration'); +Insert into fn_function (FUNCTION_CD,FUNCTION_NAME) values ('menu_mapreduce_create','Map Reduce Configuration Create'); +Insert into fn_function (FUNCTION_CD,FUNCTION_NAME) values ('menu_mapreduce_search','Map Reduce Configuration Search'); +Insert into fn_function (FUNCTION_CD,FUNCTION_NAME) values ('menu_hiveconfig_search','Hive Configuration Search'); +Insert into fn_function (FUNCTION_CD,FUNCTION_NAME) values ('menu_hiveconfig_create','Hive Configuration Create'); +Insert into fn_function (FUNCTION_CD,FUNCTION_NAME) values ('menu_test','Test Menu'); +Insert into fn_function (FUNCTION_CD,FUNCTION_NAME) values ('menu_doclib','Document Library Menu'); +Insert into fn_function (FUNCTION_CD,FUNCTION_NAME) values ('doclib','Document Library'); +Insert into fn_function (FUNCTION_CD,FUNCTION_NAME) values ('doclib_admin','Document Library Admin'); +Insert into fn_function (FUNCTION_CD,FUNCTION_NAME) values ('menu_concept','CoNCEPT'); +Insert into fn_function (FUNCTION_CD,FUNCTION_NAME) values ('menu_itracker','iTracker Menu'); +Insert into fn_function (FUNCTION_CD,FUNCTION_NAME) values ('menu_mapreduce','Map Reduce Configuration'); + +-- fn_lu_activity +Insert into fn_lu_activity (ACTIVITY_CD,ACTIVITY) values ('add_role','add_role'); +Insert into fn_lu_activity (ACTIVITY_CD,ACTIVITY) values ('remove_role','remove_role'); +Insert into fn_lu_activity (ACTIVITY_CD,ACTIVITY) values ('add_user_role','add_user_role'); +Insert into fn_lu_activity (ACTIVITY_CD,ACTIVITY) values ('remove_user_role','remove_user_role'); +Insert into fn_lu_activity (ACTIVITY_CD,ACTIVITY) values ('add_role_function','add_role_function'); +Insert into fn_lu_activity (ACTIVITY_CD,ACTIVITY) values ('remove_role_function','remove_role_function'); +Insert into fn_lu_activity (ACTIVITY_CD,ACTIVITY) values ('add_child_role','add_child_role'); +Insert into fn_lu_activity (ACTIVITY_CD,ACTIVITY) values ('remove_child_role','remove_child_role'); +Insert into fn_lu_activity (ACTIVITY_CD,ACTIVITY) values ('mobile_login','Mobile Login'); +Insert into fn_lu_activity (ACTIVITY_CD,ACTIVITY) values ('mobile_logout','Mobile Logout'); +Insert into fn_lu_activity (ACTIVITY_CD,ACTIVITY) values ('login','Login'); +Insert into fn_lu_activity (ACTIVITY_CD,ACTIVITY) values ('logout','Logout'); + +-- fn_lu_alert_method +Insert into fn_lu_alert_method (ALERT_METHOD_CD,ALERT_METHOD) values ('PHONE','Phone'); +Insert into fn_lu_alert_method (ALERT_METHOD_CD,ALERT_METHOD) values ('FAX','Fax'); +Insert into fn_lu_alert_method (ALERT_METHOD_CD,ALERT_METHOD) values ('PAGER','Pager'); +Insert into fn_lu_alert_method (ALERT_METHOD_CD,ALERT_METHOD) values ('EMAIL','Email'); +Insert into fn_lu_alert_method (ALERT_METHOD_CD,ALERT_METHOD) values ('SMS','SMS'); + +-- fn_lu_menu_set +Insert into fn_lu_menu_set (MENU_SET_CD,MENU_SET_NAME) values ('APP','Application Menu'); + +-- fn_lu_priority +Insert into fn_lu_priority (PRIORITY_ID,PRIORITY,ACTIVE_YN,SORT_ORDER) values (10,'Low','Y',10); +Insert into fn_lu_priority (PRIORITY_ID,PRIORITY,ACTIVE_YN,SORT_ORDER) values (20,'Normal','Y',20); +Insert into fn_lu_priority (PRIORITY_ID,PRIORITY,ACTIVE_YN,SORT_ORDER) values (30,'High','Y',30); +Insert into fn_lu_priority (PRIORITY_ID,PRIORITY,ACTIVE_YN,SORT_ORDER) values (40,'Urgent','Y',40); +Insert into fn_lu_priority (PRIORITY_ID,PRIORITY,ACTIVE_YN,SORT_ORDER) values (50,'Fatal','Y',50); + +-- fn_lu_tab_set +Insert into fn_lu_tab_set (TAB_SET_CD,TAB_SET_NAME) values ('APP','Application Tabs'); + +-- fn_lu_timezone +Insert into fn_lu_timezone (TIMEZONE_ID,TIMEZONE_NAME,TIMEZONE_VALUE) values (10,'US/Eastern','US/Eastern'); +Insert into fn_lu_timezone (TIMEZONE_ID,TIMEZONE_NAME,TIMEZONE_VALUE) values (20,'US/Central','US/Central'); +Insert into fn_lu_timezone (TIMEZONE_ID,TIMEZONE_NAME,TIMEZONE_VALUE) values (30,'US/Mountain','US/Mountain'); +Insert into fn_lu_timezone (TIMEZONE_ID,TIMEZONE_NAME,TIMEZONE_VALUE) values (40,'US/Arizona','America/Phoenix'); +Insert into fn_lu_timezone (TIMEZONE_ID,TIMEZONE_NAME,TIMEZONE_VALUE) values (50,'US/Pacific','US/Pacific'); +Insert into fn_lu_timezone (TIMEZONE_ID,TIMEZONE_NAME,TIMEZONE_VALUE) values (60,'US/Alaska','US/Alaska'); +Insert into fn_lu_timezone (TIMEZONE_ID,TIMEZONE_NAME,TIMEZONE_VALUE) values (70,'US/Hawaii','US/Hawaii'); + +-- fn_restricted_url +INSERT INTO fn_restricted_url (restricted_url, function_cd) VALUES ('attachment.htm','menu_admin'); +INSERT INTO fn_restricted_url (restricted_url, function_cd) VALUES ('broadcast.htm','menu_admin'); +INSERT INTO fn_restricted_url (restricted_url, function_cd) VALUES ('file_upload.htm','menu_admin'); +INSERT INTO fn_restricted_url (restricted_url, function_cd) VALUES ('job.htm','menu_admin'); +INSERT INTO fn_restricted_url (restricted_url, function_cd) VALUES ('role.htm','menu_admin'); +INSERT INTO fn_restricted_url (restricted_url, function_cd) VALUES ('role_function.htm','menu_admin'); +INSERT INTO fn_restricted_url (restricted_url, function_cd) VALUES ('test.htm','menu_admin'); +INSERT INTO fn_restricted_url (restricted_url, function_cd) VALUES ('async_test.htm','menu_home'); +INSERT INTO fn_restricted_url (restricted_url, function_cd) VALUES ('chatWindow.htm','menu_home'); +INSERT INTO fn_restricted_url (restricted_url, function_cd) VALUES ('contact_list.htm','menu_home'); +INSERT INTO fn_restricted_url (restricted_url, function_cd) VALUES ('customer_dynamic_list.htm','menu_home'); +INSERT INTO fn_restricted_url (restricted_url, function_cd) VALUES ('event.htm','menu_home'); +INSERT INTO fn_restricted_url (restricted_url, function_cd) VALUES ('event_list.htm','menu_home'); +INSERT INTO fn_restricted_url (restricted_url, function_cd) VALUES ('mobile_welcome.htm','menu_home'); +INSERT INTO fn_restricted_url (restricted_url, function_cd) VALUES ('sample_map.htm','menu_home'); +INSERT INTO fn_restricted_url (restricted_url, function_cd) VALUES ('template.jsp','menu_home'); +INSERT INTO fn_restricted_url (restricted_url, function_cd) VALUES ('jbpm_designer.htm','menu_job_create'); +INSERT INTO fn_restricted_url (restricted_url, function_cd) VALUES ('jbpm_drools.htm','menu_job_create'); +INSERT INTO fn_restricted_url (restricted_url, function_cd) VALUES ('process_job.htm','menu_job_create'); +INSERT INTO fn_restricted_url (restricted_url, function_cd) VALUES ('profile.htm','menu_profile_create'); +INSERT INTO fn_restricted_url (restricted_url, function_cd) VALUES ('raptor.htm','menu_reports'); +INSERT INTO fn_restricted_url (restricted_url, function_cd) VALUES ('raptor2.htm','menu_reports'); +INSERT INTO fn_restricted_url (restricted_url, function_cd) VALUES ('raptor_blob_extract.htm','menu_reports'); +INSERT INTO fn_restricted_url (restricted_url, function_cd) VALUES ('raptor_email_attachment.htm','menu_reports'); +INSERT INTO fn_restricted_url (restricted_url, function_cd) VALUES ('raptor_search.htm','menu_reports'); +INSERT INTO fn_restricted_url (restricted_url, function_cd) VALUES ('report_list.htm','menu_reports'); +INSERT INTO fn_restricted_url (restricted_url, function_cd) VALUES ('gauge.htm','menu_tab'); +INSERT INTO fn_restricted_url (restricted_url, function_cd) VALUES ('gmap_controller.htm','menu_tab'); +INSERT INTO fn_restricted_url (restricted_url, function_cd) VALUES ('gmap_frame.htm','menu_tab'); +INSERT INTO fn_restricted_url (restricted_url, function_cd) VALUES ('map.htm','menu_tab'); +INSERT INTO fn_restricted_url (restricted_url, function_cd) VALUES ('map_download.htm','menu_tab'); +INSERT INTO fn_restricted_url (restricted_url, function_cd) VALUES ('map_grid_search.htm','menu_tab'); +INSERT INTO fn_restricted_url (restricted_url, function_cd) VALUES ('sample_animated_map.htm','menu_tab'); +INSERT INTO fn_restricted_url (restricted_url, function_cd) VALUES ('sample_map_2.htm','menu_tab'); +INSERT INTO fn_restricted_url (restricted_url, function_cd) VALUES ('sample_map_3.htm','menu_tab'); +INSERT INTO fn_restricted_url (restricted_url, function_cd) VALUES ('tab2_sub1.htm','menu_tab'); +INSERT INTO fn_restricted_url (restricted_url, function_cd) VALUES ('tab2_sub2_link1.htm','menu_tab'); +INSERT INTO fn_restricted_url (restricted_url, function_cd) VALUES ('tab2_sub2_link2.htm','menu_tab'); +INSERT INTO fn_restricted_url (restricted_url, function_cd) VALUES ('tab2_sub3.htm','menu_tab'); +INSERT INTO fn_restricted_url (restricted_url, function_cd) VALUES ('tab3.htm','menu_tab'); +INSERT INTO fn_restricted_url (restricted_url, function_cd) VALUES ('tab4.htm','menu_tab'); +INSERT INTO fn_restricted_url (restricted_url, function_cd) VALUES ('raptor.htm','view_reports'); +INSERT INTO fn_restricted_url (restricted_url, function_cd) VALUES ('raptor_blob_extract.htm','view_reports'); + +-- fn_role +Insert into fn_role (ROLE_ID,ROLE_NAME,ACTIVE_YN,PRIORITY) values (16,'Standard User','Y',5); +Insert into fn_role (ROLE_ID,ROLE_NAME,ACTIVE_YN,PRIORITY) values (1,'System Administrator','Y',1); + +-- fn_role_composite +Insert into fn_role_composite (PARENT_ROLE_ID,CHILD_ROLE_ID) values (1,16); + +-- fn_role_function +Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (1,'login'); +Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (1,'menu_admin'); +Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (1,'menu_ajax'); +Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (1,'menu_customer'); +Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (1,'menu_customer_create'); +Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (1,'menu_feedback'); +Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (1,'menu_help'); +Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (1,'menu_home'); +Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (1,'menu_job'); +Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (1,'menu_job_create'); +Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (1,'menu_logout'); +Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (1,'menu_notes'); +Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (1,'menu_process'); +Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (1,'menu_profile'); +Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (1,'menu_profile_create'); +Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (1,'menu_profile_import'); +Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (1,'menu_reports'); +Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (1,'menu_sample'); +Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (1,'menu_tab'); +Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (16,'login'); +Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (16,'menu_ajax'); +Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (16,'menu_customer'); +Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (16,'menu_customer_create'); +Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (16,'menu_home'); +Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (16,'menu_logout'); +Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (16,'menu_map'); +Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (16,'menu_profile'); +Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (16,'menu_reports'); +Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (16,'menu_tab'); + +-- fn_tab +Insert into fn_tab (TAB_CD,TAB_NAME,TAB_DESCR,ACTION,FUNCTION_CD,ACTIVE_YN,SORT_ORDER,PARENT_TAB_CD,TAB_SET_CD) values ('TAB2_SUB1_S1','Left Tab 1','Sub - Sub Tab 1 Information','tab2_sub1.htm','menu_tab','Y',10,'TAB2_SUB1','APP'); +Insert into fn_tab (TAB_CD,TAB_NAME,TAB_DESCR,ACTION,FUNCTION_CD,ACTIVE_YN,SORT_ORDER,PARENT_TAB_CD,TAB_SET_CD) values ('TAB1','Tab 1','Tab 1 Information','tab1.htm','menu_tab','Y',10,null,'APP'); +Insert into fn_tab (TAB_CD,TAB_NAME,TAB_DESCR,ACTION,FUNCTION_CD,ACTIVE_YN,SORT_ORDER,PARENT_TAB_CD,TAB_SET_CD) values ('TAB2','Tab 2','Tab 2 Information','tab2_sub1.htm','menu_tab','Y',20,null,'APP'); +Insert into fn_tab (TAB_CD,TAB_NAME,TAB_DESCR,ACTION,FUNCTION_CD,ACTIVE_YN,SORT_ORDER,PARENT_TAB_CD,TAB_SET_CD) values ('TAB3','Tab 3','Tab 3 Information','tab3.htm','menu_tab','Y',30,null,'APP'); +Insert into fn_tab (TAB_CD,TAB_NAME,TAB_DESCR,ACTION,FUNCTION_CD,ACTIVE_YN,SORT_ORDER,PARENT_TAB_CD,TAB_SET_CD) values ('TAB4','Tab 4','Tab 4 Information','tab4.htm','menu_tab','Y',40,null,'APP'); +Insert into fn_tab (TAB_CD,TAB_NAME,TAB_DESCR,ACTION,FUNCTION_CD,ACTIVE_YN,SORT_ORDER,PARENT_TAB_CD,TAB_SET_CD) values ('TAB2_SUB1','Sub Tab 1','Sub Tab 1 Information','tab2_sub1.htm','menu_tab','Y',10,'TAB2','APP'); +Insert into fn_tab (TAB_CD,TAB_NAME,TAB_DESCR,ACTION,FUNCTION_CD,ACTIVE_YN,SORT_ORDER,PARENT_TAB_CD,TAB_SET_CD) values ('TAB2_SUB2','Sub Tab 2','Sub Tab 2 Information','tab2_sub2.htm','menu_tab','Y',20,'TAB2','APP'); +Insert into fn_tab (TAB_CD,TAB_NAME,TAB_DESCR,ACTION,FUNCTION_CD,ACTIVE_YN,SORT_ORDER,PARENT_TAB_CD,TAB_SET_CD) values ('TAB2_SUB3','Sub Tab 3','Sub Tab 3 Information','tab2_sub3.htm','menu_tab','Y',30,'TAB2','APP'); + +-- fn_tab_selected +Insert into fn_tab_selected (SELECTED_TAB_CD,TAB_URI) values ('TAB1','tab1'); +Insert into fn_tab_selected (SELECTED_TAB_CD,TAB_URI) values ('TAB2','tab2_sub1'); +Insert into fn_tab_selected (SELECTED_TAB_CD,TAB_URI) values ('TAB2','tab2_sub2'); +Insert into fn_tab_selected (SELECTED_TAB_CD,TAB_URI) values ('TAB2','tab2_sub3'); +Insert into fn_tab_selected (SELECTED_TAB_CD,TAB_URI) values ('TAB2_SUB1','tab2_sub1'); +Insert into fn_tab_selected (SELECTED_TAB_CD,TAB_URI) values ('TAB2_SUB1_S1','tab2_sub1'); +Insert into fn_tab_selected (SELECTED_TAB_CD,TAB_URI) values ('TAB2_SUB2','tab2_sub2'); +Insert into fn_tab_selected (SELECTED_TAB_CD,TAB_URI) values ('TAB2_SUB3','tab2_sub3'); +Insert into fn_tab_selected (SELECTED_TAB_CD,TAB_URI) values ('TAB3','tab3'); +Insert into fn_tab_selected (SELECTED_TAB_CD,TAB_URI) values ('TAB4','tab4'); + +-- DEMO_BAR_CHART +Insert into demo_bar_chart (label, value) values ('A', 29.765957771107); +Insert into demo_bar_chart (label, value) values ('B', 0); +Insert into demo_bar_chart (label, value) values ('C', 32.807804682612); +Insert into demo_bar_chart (label, value) values ('D', 196.45946739256); +Insert into demo_bar_chart (label, value) values ('E', 0.19434030906893); +Insert into demo_bar_chart (label, value) values ('F', 98.079782601442); +Insert into demo_bar_chart (label, value) values ('G', 13.925743130903); +Insert into demo_bar_chart (label, value) values ('H', 5.1387322875705); + +-- DEMO_BAR_CHART_INTER +Insert into demo_bar_chart_inter (spam_date, num_rpt_sources, num_det_sources) values (STR_TO_DATE('6-Mar-13','%e-%b-%y'), 198, 220); +Insert into demo_bar_chart_inter (spam_date, num_rpt_sources, num_det_sources) values (STR_TO_DATE('5-Mar-13','%e-%b-%y'), 198, 220); +Insert into demo_bar_chart_inter (spam_date, num_rpt_sources, num_det_sources) values (STR_TO_DATE('4-Mar-13','%e-%b-%y'), 238, 235); +Insert into demo_bar_chart_inter (spam_date, num_rpt_sources, num_det_sources) values (STR_TO_DATE('3-Mar-13','%e-%b-%y'), 238, 235); +Insert into demo_bar_chart_inter (spam_date, num_rpt_sources, num_det_sources) values (STR_TO_DATE('2-Mar-13','%e-%b-%y'), 256, 275); +Insert into demo_bar_chart_inter (spam_date, num_rpt_sources, num_det_sources) values (STR_TO_DATE('1-Mar-13','%e-%b-%y'), 239, 260); +Insert into demo_bar_chart_inter (spam_date, num_rpt_sources, num_det_sources) values (STR_TO_DATE('28-Feb-13','%e-%b-%y'), 247, 255); +Insert into demo_bar_chart_inter (spam_date, num_rpt_sources, num_det_sources) values (STR_TO_DATE('27-Feb-13','%e-%b-%y'), 252, 265); +Insert into demo_bar_chart_inter (spam_date, num_rpt_sources, num_det_sources) values (STR_TO_DATE('26-Feb-13','%e-%b-%y'), 198, 220); + +-- DEMO_LINE_CHART +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('1-May-12','%e-%b-%y'),582.13); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('30-Apr-12','%e-%b-%y'),583.98); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('27-Apr-12','%e-%b-%y'),603); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('26-Apr-12','%e-%b-%y'),607.7); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('25-Apr-12','%e-%b-%y'),610); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('24-Apr-12','%e-%b-%y'),560.28); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('23-Apr-12','%e-%b-%y'),571.7); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('20-Apr-12','%e-%b-%y'),572.98); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('19-Apr-12','%e-%b-%y'),587.44); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('18-Apr-12','%e-%b-%y'),608.34); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('17-Apr-12','%e-%b-%y'),609.7); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('16-Apr-12','%e-%b-%y'),580.13); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('13-Apr-12','%e-%b-%y'),605.23); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('12-Apr-12','%e-%b-%y'),622.77); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('11-Apr-12','%e-%b-%y'),626.2); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('10-Apr-12','%e-%b-%y'),628.44); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('9-Apr-12','%e-%b-%y'),636.23); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('5-Apr-12','%e-%b-%y'),633.68); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('4-Apr-12','%e-%b-%y'),624.31); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('3-Apr-12','%e-%b-%y'),629.32); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('2-Apr-12','%e-%b-%y'),618.63); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('30-Mar-12','%e-%b-%y'),599.55); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('29-Mar-12','%e-%b-%y'),609.86); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('28-Mar-12','%e-%b-%y'),617.62); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('27-Mar-12','%e-%b-%y'),614.48); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('26-Mar-12','%e-%b-%y'),606.98); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('23-Mar-12','%e-%b-%y'),596.05); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('22-Mar-12','%e-%b-%y'),599.34); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('21-Mar-12','%e-%b-%y'),602.5); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('20-Mar-12','%e-%b-%y'),605.96); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('19-Mar-12','%e-%b-%y'),601.1); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('16-Mar-12','%e-%b-%y'),585.57); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('15-Mar-12','%e-%b-%y'),585.56); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('14-Mar-12','%e-%b-%y'),589.58); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('13-Mar-12','%e-%b-%y'),568.1); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('12-Mar-12','%e-%b-%y'),552); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('9-Mar-12','%e-%b-%y'),545.17); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('8-Mar-12','%e-%b-%y'),541.99); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('7-Mar-12','%e-%b-%y'),530.69); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('6-Mar-12','%e-%b-%y'),530.26); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('5-Mar-12','%e-%b-%y'),533.16); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('2-Mar-12','%e-%b-%y'),545.18); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('1-Mar-12','%e-%b-%y'),544.47); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('29-Feb-12','%e-%b-%y'),542.44); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('28-Feb-12','%e-%b-%y'),535.41); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('27-Feb-12','%e-%b-%y'),525.76); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('24-Feb-12','%e-%b-%y'),522.41); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('23-Feb-12','%e-%b-%y'),516.39); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('22-Feb-12','%e-%b-%y'),513.04); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('21-Feb-12','%e-%b-%y'),514.85); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('17-Feb-12','%e-%b-%y'),502.12); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('16-Feb-12','%e-%b-%y'),502.21); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('15-Feb-12','%e-%b-%y'),497.67); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('14-Feb-12','%e-%b-%y'),509.46); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('13-Feb-12','%e-%b-%y'),502.6); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('10-Feb-12','%e-%b-%y'),493.42); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('9-Feb-12','%e-%b-%y'),493.17); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('8-Feb-12','%e-%b-%y'),476.68); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('7-Feb-12','%e-%b-%y'),468.83); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('6-Feb-12','%e-%b-%y'),463.97); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('3-Feb-12','%e-%b-%y'),459.68); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('2-Feb-12','%e-%b-%y'),455.12); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('1-Feb-12','%e-%b-%y'),456.19); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('31-Jan-12','%e-%b-%y'),456.48); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('30-Jan-12','%e-%b-%y'),453.01); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('27-Jan-12','%e-%b-%y'),447.28); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('26-Jan-12','%e-%b-%y'),444.63); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('25-Jan-12','%e-%b-%y'),446.66); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('24-Jan-12','%e-%b-%y'),420.41); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('23-Jan-12','%e-%b-%y'),427.41); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('20-Jan-12','%e-%b-%y'),420.3); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('19-Jan-12','%e-%b-%y'),427.75); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('18-Jan-12','%e-%b-%y'),429.11); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('17-Jan-12','%e-%b-%y'),424.7); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('13-Jan-12','%e-%b-%y'),419.81); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('12-Jan-12','%e-%b-%y'),421.39); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('11-Jan-12','%e-%b-%y'),422.55); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('10-Jan-12','%e-%b-%y'),423.24); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('9-Jan-12','%e-%b-%y'),421.73); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('6-Jan-12','%e-%b-%y'),422.4); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('5-Jan-12','%e-%b-%y'),418.03); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('4-Jan-12','%e-%b-%y'),413.44); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('3-Jan-12','%e-%b-%y'),411.23); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('30-Dec-11','%e-%b-%y'),405); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('29-Dec-11','%e-%b-%y'),405.12); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('28-Dec-11','%e-%b-%y'),402.64); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('27-Dec-11','%e-%b-%y'),406.53); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('23-Dec-11','%e-%b-%y'),403.43); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('22-Dec-11','%e-%b-%y'),398.55); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('21-Dec-11','%e-%b-%y'),396.44); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('20-Dec-11','%e-%b-%y'),395.95); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('19-Dec-11','%e-%b-%y'),382.21); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('16-Dec-11','%e-%b-%y'),381.02); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('15-Dec-11','%e-%b-%y'),378.94); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('14-Dec-11','%e-%b-%y'),380.19); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('13-Dec-11','%e-%b-%y'),388.81); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('12-Dec-11','%e-%b-%y'),391.84); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('9-Dec-11','%e-%b-%y'),393.62); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('8-Dec-11','%e-%b-%y'),390.66); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('7-Dec-11','%e-%b-%y'),389.09); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('6-Dec-11','%e-%b-%y'),390.95); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('5-Dec-11','%e-%b-%y'),393.01); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('2-Dec-11','%e-%b-%y'),389.7); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('1-Dec-11','%e-%b-%y'),387.93); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('30-Nov-11','%e-%b-%y'),382.2); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('29-Nov-11','%e-%b-%y'),373.2); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('28-Nov-11','%e-%b-%y'),376.12); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('25-Nov-11','%e-%b-%y'),363.57); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('23-Nov-11','%e-%b-%y'),366.99); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('22-Nov-11','%e-%b-%y'),376.51); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('21-Nov-11','%e-%b-%y'),369.01); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('18-Nov-11','%e-%b-%y'),374.94); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('17-Nov-11','%e-%b-%y'),377.41); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('16-Nov-11','%e-%b-%y'),384.77); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('15-Nov-11','%e-%b-%y'),388.83); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('14-Nov-11','%e-%b-%y'),379.26); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('11-Nov-11','%e-%b-%y'),384.62); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('10-Nov-11','%e-%b-%y'),385.22); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('9-Nov-11','%e-%b-%y'),395.28); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('8-Nov-11','%e-%b-%y'),406.23); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('7-Nov-11','%e-%b-%y'),399.73); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('4-Nov-11','%e-%b-%y'),400.24); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('3-Nov-11','%e-%b-%y'),403.07); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('2-Nov-11','%e-%b-%y'),397.41); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('1-Nov-11','%e-%b-%y'),396.51); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('31-Oct-11','%e-%b-%y'),404.78); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('28-Oct-11','%e-%b-%y'),404.95); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('27-Oct-11','%e-%b-%y'),404.69); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('26-Oct-11','%e-%b-%y'),400.6); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('25-Oct-11','%e-%b-%y'),397.77); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('24-Oct-11','%e-%b-%y'),405.77); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('21-Oct-11','%e-%b-%y'),392.87); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('20-Oct-11','%e-%b-%y'),395.31); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('19-Oct-11','%e-%b-%y'),398.62); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('18-Oct-11','%e-%b-%y'),422.24); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('17-Oct-11','%e-%b-%y'),419.99); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('14-Oct-11','%e-%b-%y'),422); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('13-Oct-11','%e-%b-%y'),408.43); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('12-Oct-11','%e-%b-%y'),402.19); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('11-Oct-11','%e-%b-%y'),400.29); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('10-Oct-11','%e-%b-%y'),388.81); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('7-Oct-11','%e-%b-%y'),369.8); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('6-Oct-11','%e-%b-%y'),377.37); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('5-Oct-11','%e-%b-%y'),378.25); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('4-Oct-11','%e-%b-%y'),372.5); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('3-Oct-11','%e-%b-%y'),374.6); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('30-Sep-11','%e-%b-%y'),381.32); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('29-Sep-11','%e-%b-%y'),390.57); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('28-Sep-11','%e-%b-%y'),397.01); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('27-Sep-11','%e-%b-%y'),399.26); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('26-Sep-11','%e-%b-%y'),403.17); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('23-Sep-11','%e-%b-%y'),404.3); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('22-Sep-11','%e-%b-%y'),401.82); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('21-Sep-11','%e-%b-%y'),412.14); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('20-Sep-11','%e-%b-%y'),413.45); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('19-Sep-11','%e-%b-%y'),411.63); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('16-Sep-11','%e-%b-%y'),400.5); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('15-Sep-11','%e-%b-%y'),392.96); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('14-Sep-11','%e-%b-%y'),389.3); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('13-Sep-11','%e-%b-%y'),384.62); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('12-Sep-11','%e-%b-%y'),379.94); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('9-Sep-11','%e-%b-%y'),377.48); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('8-Sep-11','%e-%b-%y'),384.14); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('7-Sep-11','%e-%b-%y'),383.93); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('6-Sep-11','%e-%b-%y'),379.74); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('2-Sep-11','%e-%b-%y'),374.05); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('1-Sep-11','%e-%b-%y'),381.03); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('31-Aug-11','%e-%b-%y'),384.83); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('30-Aug-11','%e-%b-%y'),389.99); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('29-Aug-11','%e-%b-%y'),389.97); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('26-Aug-11','%e-%b-%y'),383.58); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('25-Aug-11','%e-%b-%y'),373.72); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('24-Aug-11','%e-%b-%y'),376.18); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('23-Aug-11','%e-%b-%y'),373.6); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('22-Aug-11','%e-%b-%y'),356.44); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('19-Aug-11','%e-%b-%y'),356.03); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('18-Aug-11','%e-%b-%y'),366.05); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('17-Aug-11','%e-%b-%y'),380.44); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('16-Aug-11','%e-%b-%y'),380.48); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('15-Aug-11','%e-%b-%y'),383.41); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('12-Aug-11','%e-%b-%y'),376.99); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('11-Aug-11','%e-%b-%y'),373.7); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('10-Aug-11','%e-%b-%y'),363.69); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('9-Aug-11','%e-%b-%y'),374.01); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('8-Aug-11','%e-%b-%y'),353.21); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('5-Aug-11','%e-%b-%y'),373.62); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('4-Aug-11','%e-%b-%y'),377.37); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('3-Aug-11','%e-%b-%y'),392.57); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('2-Aug-11','%e-%b-%y'),388.91); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('1-Aug-11','%e-%b-%y'),396.75); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('29-Jul-11','%e-%b-%y'),390.48); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('28-Jul-11','%e-%b-%y'),391.82); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('27-Jul-11','%e-%b-%y'),392.59); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('26-Jul-11','%e-%b-%y'),403.41); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('25-Jul-11','%e-%b-%y'),398.5); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('22-Jul-11','%e-%b-%y'),393.3); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('21-Jul-11','%e-%b-%y'),387.29); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('20-Jul-11','%e-%b-%y'),386.9); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('19-Jul-11','%e-%b-%y'),376.85); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('18-Jul-11','%e-%b-%y'),373.8); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('15-Jul-11','%e-%b-%y'),364.92); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('14-Jul-11','%e-%b-%y'),357.77); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('13-Jul-11','%e-%b-%y'),358.02); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('12-Jul-11','%e-%b-%y'),353.75); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('11-Jul-11','%e-%b-%y'),354); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('8-Jul-11','%e-%b-%y'),359.71); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('7-Jul-11','%e-%b-%y'),357.2); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('6-Jul-11','%e-%b-%y'),351.76); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('5-Jul-11','%e-%b-%y'),349.43); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('1-Jul-11','%e-%b-%y'),343.26); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('30-Jun-11','%e-%b-%y'),335.67); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('29-Jun-11','%e-%b-%y'),334.04); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('28-Jun-11','%e-%b-%y'),335.26); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('27-Jun-11','%e-%b-%y'),332.04); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('24-Jun-11','%e-%b-%y'),326.35); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('23-Jun-11','%e-%b-%y'),331.23); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('22-Jun-11','%e-%b-%y'),322.61); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('21-Jun-11','%e-%b-%y'),325.3); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('20-Jun-11','%e-%b-%y'),315.32); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('17-Jun-11','%e-%b-%y'),320.26); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('16-Jun-11','%e-%b-%y'),325.16); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('15-Jun-11','%e-%b-%y'),326.75); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('14-Jun-11','%e-%b-%y'),332.44); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('13-Jun-11','%e-%b-%y'),326.6); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('10-Jun-11','%e-%b-%y'),325.9); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('9-Jun-11','%e-%b-%y'),331.49); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('8-Jun-11','%e-%b-%y'),332.24); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('7-Jun-11','%e-%b-%y'),332.04); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('6-Jun-11','%e-%b-%y'),338.04); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('3-Jun-11','%e-%b-%y'),343.44); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('2-Jun-11','%e-%b-%y'),346.1); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('1-Jun-11','%e-%b-%y'),345.51); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('31-May-11','%e-%b-%y'),347.83); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('27-May-11','%e-%b-%y'),337.41); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('26-May-11','%e-%b-%y'),335); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('25-May-11','%e-%b-%y'),336.78); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('24-May-11','%e-%b-%y'),332.19); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('23-May-11','%e-%b-%y'),334.4); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('20-May-11','%e-%b-%y'),335.22); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('19-May-11','%e-%b-%y'),340.53); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('18-May-11','%e-%b-%y'),339.87); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('17-May-11','%e-%b-%y'),336.14); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('16-May-11','%e-%b-%y'),333.3); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('13-May-11','%e-%b-%y'),340.5); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('12-May-11','%e-%b-%y'),346.57); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('11-May-11','%e-%b-%y'),347.23); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('10-May-11','%e-%b-%y'),349.45); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('9-May-11','%e-%b-%y'),347.6); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('6-May-11','%e-%b-%y'),346.66); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('5-May-11','%e-%b-%y'),346.75); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('4-May-11','%e-%b-%y'),349.57); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('3-May-11','%e-%b-%y'),348.2); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('2-May-11','%e-%b-%y'),346.28); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('29-Apr-11','%e-%b-%y'),350.13); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('28-Apr-11','%e-%b-%y'),346.75); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('27-Apr-11','%e-%b-%y'),350.15); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('26-Apr-11','%e-%b-%y'),350.42); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('25-Apr-11','%e-%b-%y'),353.01); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('21-Apr-11','%e-%b-%y'),350.7); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('20-Apr-11','%e-%b-%y'),342.41); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('19-Apr-11','%e-%b-%y'),337.86); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('18-Apr-11','%e-%b-%y'),331.85); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('15-Apr-11','%e-%b-%y'),327.46); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('14-Apr-11','%e-%b-%y'),332.42); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('13-Apr-11','%e-%b-%y'),336.13); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('12-Apr-11','%e-%b-%y'),332.4); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('11-Apr-11','%e-%b-%y'),330.8); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('8-Apr-11','%e-%b-%y'),335.06); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('7-Apr-11','%e-%b-%y'),338.08); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('6-Apr-11','%e-%b-%y'),338.04); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('5-Apr-11','%e-%b-%y'),338.89); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('4-Apr-11','%e-%b-%y'),341.19); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('1-Apr-11','%e-%b-%y'),344.56); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('31-Mar-11','%e-%b-%y'),348.51); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('30-Mar-11','%e-%b-%y'),348.63); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('29-Mar-11','%e-%b-%y'),350.96); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('28-Mar-11','%e-%b-%y'),350.44); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('25-Mar-11','%e-%b-%y'),351.54); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('24-Mar-11','%e-%b-%y'),344.97); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('23-Mar-11','%e-%b-%y'),339.19); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('22-Mar-11','%e-%b-%y'),341.2); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('21-Mar-11','%e-%b-%y'),339.3); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('18-Mar-11','%e-%b-%y'),330.67); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('17-Mar-11','%e-%b-%y'),334.64); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('16-Mar-11','%e-%b-%y'),330.01); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('15-Mar-11','%e-%b-%y'),345.43); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('14-Mar-11','%e-%b-%y'),353.56); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('11-Mar-11','%e-%b-%y'),351.99); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('10-Mar-11','%e-%b-%y'),346.67); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('9-Mar-11','%e-%b-%y'),352.47); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('8-Mar-11','%e-%b-%y'),355.76); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('7-Mar-11','%e-%b-%y'),355.36); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('4-Mar-11','%e-%b-%y'),360); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('3-Mar-11','%e-%b-%y'),359.56); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('2-Mar-11','%e-%b-%y'),352.12); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('1-Mar-11','%e-%b-%y'),349.31); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('28-Feb-11','%e-%b-%y'),353.21); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('25-Feb-11','%e-%b-%y'),348.16); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('24-Feb-11','%e-%b-%y'),342.88); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('23-Feb-11','%e-%b-%y'),342.62); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('22-Feb-11','%e-%b-%y'),338.61); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('18-Feb-11','%e-%b-%y'),350.56); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('17-Feb-11','%e-%b-%y'),358.3); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('16-Feb-11','%e-%b-%y'),363.13); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('15-Feb-11','%e-%b-%y'),359.9); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('14-Feb-11','%e-%b-%y'),359.18); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('11-Feb-11','%e-%b-%y'),356.85); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('10-Feb-11','%e-%b-%y'),354.54); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('9-Feb-11','%e-%b-%y'),358.16); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('8-Feb-11','%e-%b-%y'),355.2); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('7-Feb-11','%e-%b-%y'),351.88); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('4-Feb-11','%e-%b-%y'),346.5); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('3-Feb-11','%e-%b-%y'),343.44); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('2-Feb-11','%e-%b-%y'),344.32); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('1-Feb-11','%e-%b-%y'),345.03); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('31-Jan-11','%e-%b-%y'),339.32); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('28-Jan-11','%e-%b-%y'),336.1); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('27-Jan-11','%e-%b-%y'),343.21); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('26-Jan-11','%e-%b-%y'),343.85); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('25-Jan-11','%e-%b-%y'),341.4); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('24-Jan-11','%e-%b-%y'),337.45); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('21-Jan-11','%e-%b-%y'),326.72); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('20-Jan-11','%e-%b-%y'),332.68); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('19-Jan-11','%e-%b-%y'),338.84); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('18-Jan-11','%e-%b-%y'),340.65); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('14-Jan-11','%e-%b-%y'),348.48); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('13-Jan-11','%e-%b-%y'),345.68); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('12-Jan-11','%e-%b-%y'),344.42); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('11-Jan-11','%e-%b-%y'),341.64); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('10-Jan-11','%e-%b-%y'),342.46); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('7-Jan-11','%e-%b-%y'),336.12); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('6-Jan-11','%e-%b-%y'),333.73); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('5-Jan-11','%e-%b-%y'),334); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('4-Jan-11','%e-%b-%y'),331.29); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('3-Jan-11','%e-%b-%y'),329.57); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('31-Dec-10','%e-%b-%y'),322.56); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('30-Dec-10','%e-%b-%y'),323.66); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('29-Dec-10','%e-%b-%y'),325.29); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('28-Dec-10','%e-%b-%y'),325.47); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('27-Dec-10','%e-%b-%y'),324.68); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('23-Dec-10','%e-%b-%y'),323.6); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('22-Dec-10','%e-%b-%y'),325.16); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('21-Dec-10','%e-%b-%y'),324.2); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('20-Dec-10','%e-%b-%y'),322.21); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('17-Dec-10','%e-%b-%y'),320.61); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('16-Dec-10','%e-%b-%y'),321.25); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('15-Dec-10','%e-%b-%y'),320.36); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('14-Dec-10','%e-%b-%y'),320.29); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('13-Dec-10','%e-%b-%y'),321.67); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('10-Dec-10','%e-%b-%y'),320.56); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('9-Dec-10','%e-%b-%y'),319.76); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('8-Dec-10','%e-%b-%y'),321.01); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('7-Dec-10','%e-%b-%y'),318.21); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('6-Dec-10','%e-%b-%y'),320.15); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('3-Dec-10','%e-%b-%y'),317.44); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('2-Dec-10','%e-%b-%y'),318.15); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('1-Dec-10','%e-%b-%y'),316.4); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('30-Nov-10','%e-%b-%y'),311.15); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('29-Nov-10','%e-%b-%y'),316.87); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('26-Nov-10','%e-%b-%y'),315); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('24-Nov-10','%e-%b-%y'),314.8); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('23-Nov-10','%e-%b-%y'),308.73); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('22-Nov-10','%e-%b-%y'),313.36); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('19-Nov-10','%e-%b-%y'),306.73); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('18-Nov-10','%e-%b-%y'),308.43); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('17-Nov-10','%e-%b-%y'),300.5); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('16-Nov-10','%e-%b-%y'),301.59); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('15-Nov-10','%e-%b-%y'),307.04); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('12-Nov-10','%e-%b-%y'),308.03); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('11-Nov-10','%e-%b-%y'),316.66); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('10-Nov-10','%e-%b-%y'),318.03); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('9-Nov-10','%e-%b-%y'),316.08); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('8-Nov-10','%e-%b-%y'),318.62); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('5-Nov-10','%e-%b-%y'),317.13); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('4-Nov-10','%e-%b-%y'),318.27); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('3-Nov-10','%e-%b-%y'),312.8); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('2-Nov-10','%e-%b-%y'),309.36); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('1-Nov-10','%e-%b-%y'),304.18); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('29-Oct-10','%e-%b-%y'),300.98); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('28-Oct-10','%e-%b-%y'),305.24); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('27-Oct-10','%e-%b-%y'),307.83); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('26-Oct-10','%e-%b-%y'),308.05); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('25-Oct-10','%e-%b-%y'),308.84); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('22-Oct-10','%e-%b-%y'),307.47); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('21-Oct-10','%e-%b-%y'),309.52); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('20-Oct-10','%e-%b-%y'),310.53); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('19-Oct-10','%e-%b-%y'),309.49); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('18-Oct-10','%e-%b-%y'),318); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('15-Oct-10','%e-%b-%y'),314.74); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('14-Oct-10','%e-%b-%y'),302.31); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('13-Oct-10','%e-%b-%y'),300.14); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('12-Oct-10','%e-%b-%y'),298.54); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('11-Oct-10','%e-%b-%y'),295.36); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('8-Oct-10','%e-%b-%y'),294.07); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('7-Oct-10','%e-%b-%y'),289.22); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('6-Oct-10','%e-%b-%y'),289.19); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('5-Oct-10','%e-%b-%y'),288.94); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('4-Oct-10','%e-%b-%y'),278.64); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('1-Oct-10','%e-%b-%y'),282.52); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('30-Sep-10','%e-%b-%y'),283.75); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('29-Sep-10','%e-%b-%y'),287.37); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('28-Sep-10','%e-%b-%y'),286.86); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('27-Sep-10','%e-%b-%y'),291.16); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('24-Sep-10','%e-%b-%y'),292.32); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('23-Sep-10','%e-%b-%y'),288.92); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('22-Sep-10','%e-%b-%y'),287.75); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('21-Sep-10','%e-%b-%y'),283.77); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('20-Sep-10','%e-%b-%y'),283.23); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('17-Sep-10','%e-%b-%y'),275.37); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('16-Sep-10','%e-%b-%y'),276.57); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('15-Sep-10','%e-%b-%y'),270.22); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('14-Sep-10','%e-%b-%y'),268.06); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('13-Sep-10','%e-%b-%y'),267.04); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('10-Sep-10','%e-%b-%y'),263.41); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('9-Sep-10','%e-%b-%y'),263.07); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('8-Sep-10','%e-%b-%y'),262.92); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('7-Sep-10','%e-%b-%y'),257.81); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('6-Sep-10','%e-%b-%y'),258.77); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('3-Sep-10','%e-%b-%y'),258.77); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('2-Sep-10','%e-%b-%y'),252.17); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('1-Sep-10','%e-%b-%y'),250.33); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('31-Aug-10','%e-%b-%y'),243.1); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('30-Aug-10','%e-%b-%y'),242.5); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('27-Aug-10','%e-%b-%y'),241.62); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('26-Aug-10','%e-%b-%y'),240.28); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('25-Aug-10','%e-%b-%y'),242.89); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('24-Aug-10','%e-%b-%y'),239.93); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('23-Aug-10','%e-%b-%y'),245.8); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('20-Aug-10','%e-%b-%y'),249.64); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('19-Aug-10','%e-%b-%y'),249.88); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('18-Aug-10','%e-%b-%y'),253.07); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('17-Aug-10','%e-%b-%y'),251.97); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('16-Aug-10','%e-%b-%y'),247.64); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('13-Aug-10','%e-%b-%y'),249.1); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('12-Aug-10','%e-%b-%y'),251.79); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('11-Aug-10','%e-%b-%y'),250.19); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('10-Aug-10','%e-%b-%y'),259.41); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('9-Aug-10','%e-%b-%y'),261.75); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('6-Aug-10','%e-%b-%y'),260.09); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('5-Aug-10','%e-%b-%y'),261.7); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('4-Aug-10','%e-%b-%y'),262.98); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('3-Aug-10','%e-%b-%y'),261.93); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('2-Aug-10','%e-%b-%y'),261.85); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('30-Jul-10','%e-%b-%y'),257.25); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('29-Jul-10','%e-%b-%y'),258.11); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('28-Jul-10','%e-%b-%y'),260.96); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('27-Jul-10','%e-%b-%y'),264.08); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('26-Jul-10','%e-%b-%y'),259.28); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('23-Jul-10','%e-%b-%y'),259.94); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('22-Jul-10','%e-%b-%y'),259.02); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('21-Jul-10','%e-%b-%y'),254.24); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('20-Jul-10','%e-%b-%y'),251.89); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('19-Jul-10','%e-%b-%y'),245.58); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('16-Jul-10','%e-%b-%y'),249.9); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('15-Jul-10','%e-%b-%y'),251.45); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('14-Jul-10','%e-%b-%y'),252.73); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('13-Jul-10','%e-%b-%y'),251.8); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('12-Jul-10','%e-%b-%y'),257.28); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('9-Jul-10','%e-%b-%y'),259.62); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('8-Jul-10','%e-%b-%y'),258.09); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('7-Jul-10','%e-%b-%y'),258.66); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('6-Jul-10','%e-%b-%y'),248.63); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('5-Jul-10','%e-%b-%y'),246.94); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('2-Jul-10','%e-%b-%y'),246.94); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('1-Jul-10','%e-%b-%y'),248.48); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('30-Jun-10','%e-%b-%y'),251.53); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('29-Jun-10','%e-%b-%y'),256.17); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('28-Jun-10','%e-%b-%y'),268.3); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('25-Jun-10','%e-%b-%y'),266.7); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('24-Jun-10','%e-%b-%y'),269); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('23-Jun-10','%e-%b-%y'),270.97); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('22-Jun-10','%e-%b-%y'),273.85); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('21-Jun-10','%e-%b-%y'),270.17); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('18-Jun-10','%e-%b-%y'),274.07); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('17-Jun-10','%e-%b-%y'),271.87); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('16-Jun-10','%e-%b-%y'),267.25); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('15-Jun-10','%e-%b-%y'),259.69); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('14-Jun-10','%e-%b-%y'),254.28); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('11-Jun-10','%e-%b-%y'),253.51); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('10-Jun-10','%e-%b-%y'),250.51); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('9-Jun-10','%e-%b-%y'),243.2); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('8-Jun-10','%e-%b-%y'),249.33); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('7-Jun-10','%e-%b-%y'),250.94); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('4-Jun-10','%e-%b-%y'),255.96); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('3-Jun-10','%e-%b-%y'),263.12); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('2-Jun-10','%e-%b-%y'),263.95); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('1-Jun-10','%e-%b-%y'),260.83); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('31-May-10','%e-%b-%y'),256.88); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('28-May-10','%e-%b-%y'),256.88); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('27-May-10','%e-%b-%y'),253.35); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('26-May-10','%e-%b-%y'),244.11); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('25-May-10','%e-%b-%y'),245.22); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('24-May-10','%e-%b-%y'),246.76); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('21-May-10','%e-%b-%y'),242.32); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('20-May-10','%e-%b-%y'),237.76); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('19-May-10','%e-%b-%y'),248.34); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('18-May-10','%e-%b-%y'),252.36); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('17-May-10','%e-%b-%y'),254.22); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('14-May-10','%e-%b-%y'),253.82); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('13-May-10','%e-%b-%y'),258.36); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('12-May-10','%e-%b-%y'),262.09); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('11-May-10','%e-%b-%y'),256.52); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('10-May-10','%e-%b-%y'),253.99); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('7-May-10','%e-%b-%y'),235.86); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('6-May-10','%e-%b-%y'),246.25); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('5-May-10','%e-%b-%y'),255.98); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('4-May-10','%e-%b-%y'),258.68); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('3-May-10','%e-%b-%y'),266.35); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('30-Apr-10','%e-%b-%y'),261.09); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('29-Apr-10','%e-%b-%y'),268.64); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('28-Apr-10','%e-%b-%y'),261.6); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('27-Apr-10','%e-%b-%y'),262.04); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('26-Apr-10','%e-%b-%y'),269.5); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('23-Apr-10','%e-%b-%y'),270.83); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('22-Apr-10','%e-%b-%y'),266.47); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('21-Apr-10','%e-%b-%y'),259.22); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('20-Apr-10','%e-%b-%y'),244.59); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('19-Apr-10','%e-%b-%y'),247.07); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('16-Apr-10','%e-%b-%y'),247.4); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('15-Apr-10','%e-%b-%y'),248.92); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('14-Apr-10','%e-%b-%y'),245.69); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('13-Apr-10','%e-%b-%y'),242.43); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('12-Apr-10','%e-%b-%y'),242.29); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('9-Apr-10','%e-%b-%y'),241.79); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('8-Apr-10','%e-%b-%y'),239.95); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('7-Apr-10','%e-%b-%y'),240.6); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('6-Apr-10','%e-%b-%y'),239.54); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('5-Apr-10','%e-%b-%y'),238.49); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('2-Apr-10','%e-%b-%y'),235.97); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('1-Apr-10','%e-%b-%y'),235.97); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('31-Mar-10','%e-%b-%y'),235); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('30-Mar-10','%e-%b-%y'),235.84); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('29-Mar-10','%e-%b-%y'),232.39); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('26-Mar-10','%e-%b-%y'),230.9); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('25-Mar-10','%e-%b-%y'),226.65); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('24-Mar-10','%e-%b-%y'),229.37); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('23-Mar-10','%e-%b-%y'),228.36); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('22-Mar-10','%e-%b-%y'),224.75); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('19-Mar-10','%e-%b-%y'),222.25); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('18-Mar-10','%e-%b-%y'),224.65); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('17-Mar-10','%e-%b-%y'),224.12); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('16-Mar-10','%e-%b-%y'),224.45); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('15-Mar-10','%e-%b-%y'),223.84); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('12-Mar-10','%e-%b-%y'),226.6); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('11-Mar-10','%e-%b-%y'),225.5); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('10-Mar-10','%e-%b-%y'),224.84); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('9-Mar-10','%e-%b-%y'),223.02); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('8-Mar-10','%e-%b-%y'),219.08); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('5-Mar-10','%e-%b-%y'),218.95); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('4-Mar-10','%e-%b-%y'),210.71); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('3-Mar-10','%e-%b-%y'),209.33); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('2-Mar-10','%e-%b-%y'),208.85); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('1-Mar-10','%e-%b-%y'),208.99); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('26-Feb-10','%e-%b-%y'),204.62); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('25-Feb-10','%e-%b-%y'),202); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('24-Feb-10','%e-%b-%y'),200.66); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('23-Feb-10','%e-%b-%y'),197.06); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('22-Feb-10','%e-%b-%y'),200.42); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('19-Feb-10','%e-%b-%y'),201.67); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('18-Feb-10','%e-%b-%y'),202.93); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('17-Feb-10','%e-%b-%y'),202.55); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('16-Feb-10','%e-%b-%y'),203.4); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('15-Feb-10','%e-%b-%y'),200.38); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('12-Feb-10','%e-%b-%y'),200.38); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('11-Feb-10','%e-%b-%y'),198.67); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('10-Feb-10','%e-%b-%y'),195.12); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('9-Feb-10','%e-%b-%y'),196.19); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('8-Feb-10','%e-%b-%y'),194.12); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('5-Feb-10','%e-%b-%y'),195.46); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('4-Feb-10','%e-%b-%y'),192.05); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('3-Feb-10','%e-%b-%y'),199.23); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('2-Feb-10','%e-%b-%y'),195.86); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('1-Feb-10','%e-%b-%y'),194.73); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('29-Jan-10','%e-%b-%y'),192.06); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('28-Jan-10','%e-%b-%y'),199.29); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('27-Jan-10','%e-%b-%y'),207.88); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('26-Jan-10','%e-%b-%y'),205.94); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('25-Jan-10','%e-%b-%y'),203.08); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('22-Jan-10','%e-%b-%y'),197.75); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('21-Jan-10','%e-%b-%y'),208.07); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('20-Jan-10','%e-%b-%y'),211.72); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('19-Jan-10','%e-%b-%y'),215.04); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('18-Jan-10','%e-%b-%y'),205.93); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('15-Jan-10','%e-%b-%y'),205.93); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('14-Jan-10','%e-%b-%y'),209.43); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('13-Jan-10','%e-%b-%y'),210.65); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('12-Jan-10','%e-%b-%y'),207.72); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('11-Jan-10','%e-%b-%y'),210.11); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('8-Jan-10','%e-%b-%y'),211.98); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('7-Jan-10','%e-%b-%y'),210.58); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('6-Jan-10','%e-%b-%y'),210.97); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('5-Jan-10','%e-%b-%y'),214.38); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('4-Jan-10','%e-%b-%y'),214.01); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('1-Jan-10','%e-%b-%y'),210.73); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('31-Dec-09','%e-%b-%y'),210.73); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('30-Dec-09','%e-%b-%y'),211.64); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('29-Dec-09','%e-%b-%y'),209.1); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('28-Dec-09','%e-%b-%y'),211.61); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('25-Dec-09','%e-%b-%y'),209.04); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('24-Dec-09','%e-%b-%y'),209.04); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('23-Dec-09','%e-%b-%y'),202.1); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('22-Dec-09','%e-%b-%y'),200.36); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('21-Dec-09','%e-%b-%y'),198.23); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('18-Dec-09','%e-%b-%y'),195.43); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('17-Dec-09','%e-%b-%y'),191.86); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('16-Dec-09','%e-%b-%y'),195.03); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('15-Dec-09','%e-%b-%y'),194.17); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('14-Dec-09','%e-%b-%y'),196.98); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('11-Dec-09','%e-%b-%y'),194.67); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('10-Dec-09','%e-%b-%y'),196.43); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('9-Dec-09','%e-%b-%y'),197.8); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('8-Dec-09','%e-%b-%y'),189.87); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('7-Dec-09','%e-%b-%y'),188.95); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('4-Dec-09','%e-%b-%y'),193.32); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('3-Dec-09','%e-%b-%y'),196.48); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('2-Dec-09','%e-%b-%y'),196.23); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('1-Dec-09','%e-%b-%y'),196.97); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('30-Nov-09','%e-%b-%y'),199.91); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('27-Nov-09','%e-%b-%y'),200.59); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('26-Nov-09','%e-%b-%y'),204.19); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('25-Nov-09','%e-%b-%y'),204.19); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('24-Nov-09','%e-%b-%y'),204.44); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('23-Nov-09','%e-%b-%y'),205.88); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('20-Nov-09','%e-%b-%y'),199.92); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('19-Nov-09','%e-%b-%y'),200.51); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('18-Nov-09','%e-%b-%y'),205.96); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('17-Nov-09','%e-%b-%y'),207); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('16-Nov-09','%e-%b-%y'),206.63); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('13-Nov-09','%e-%b-%y'),204.45); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('12-Nov-09','%e-%b-%y'),201.99); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('11-Nov-09','%e-%b-%y'),203.25); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('10-Nov-09','%e-%b-%y'),202.98); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('9-Nov-09','%e-%b-%y'),201.46); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('6-Nov-09','%e-%b-%y'),194.34); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('5-Nov-09','%e-%b-%y'),194.03); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('4-Nov-09','%e-%b-%y'),190.81); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('3-Nov-09','%e-%b-%y'),188.75); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('2-Nov-09','%e-%b-%y'),189.31); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('30-Oct-09','%e-%b-%y'),188.5); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('29-Oct-09','%e-%b-%y'),196.35); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('28-Oct-09','%e-%b-%y'),192.4); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('27-Oct-09','%e-%b-%y'),197.37); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('26-Oct-09','%e-%b-%y'),202.48); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('23-Oct-09','%e-%b-%y'),203.94); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('22-Oct-09','%e-%b-%y'),205.2); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('21-Oct-09','%e-%b-%y'),204.92); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('20-Oct-09','%e-%b-%y'),198.76); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('19-Oct-09','%e-%b-%y'),189.86); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('16-Oct-09','%e-%b-%y'),188.05); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('15-Oct-09','%e-%b-%y'),190.56); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('14-Oct-09','%e-%b-%y'),191.29); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('13-Oct-09','%e-%b-%y'),190.02); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('12-Oct-09','%e-%b-%y'),190.81); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('9-Oct-09','%e-%b-%y'),190.47); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('8-Oct-09','%e-%b-%y'),189.27); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('7-Oct-09','%e-%b-%y'),190.25); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('6-Oct-09','%e-%b-%y'),190.01); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('5-Oct-09','%e-%b-%y'),186.02); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('2-Oct-09','%e-%b-%y'),184.9); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('1-Oct-09','%e-%b-%y'),180.86); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('30-Sep-09','%e-%b-%y'),185.35); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('29-Sep-09','%e-%b-%y'),185.38); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('28-Sep-09','%e-%b-%y'),186.15); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('25-Sep-09','%e-%b-%y'),182.37); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('24-Sep-09','%e-%b-%y'),183.82); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('23-Sep-09','%e-%b-%y'),185.5); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('22-Sep-09','%e-%b-%y'),184.48); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('21-Sep-09','%e-%b-%y'),184.02); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('18-Sep-09','%e-%b-%y'),185.02); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('17-Sep-09','%e-%b-%y'),184.55); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('16-Sep-09','%e-%b-%y'),181.87); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('15-Sep-09','%e-%b-%y'),175.16); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('14-Sep-09','%e-%b-%y'),173.72); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('11-Sep-09','%e-%b-%y'),172.16); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('10-Sep-09','%e-%b-%y'),172.56); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('9-Sep-09','%e-%b-%y'),171.14); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('8-Sep-09','%e-%b-%y'),172.93); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('4-Sep-09','%e-%b-%y'),170.31); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('3-Sep-09','%e-%b-%y'),166.55); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('2-Sep-09','%e-%b-%y'),165.18); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('1-Sep-09','%e-%b-%y'),165.3); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('31-Aug-09','%e-%b-%y'),168.21); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('28-Aug-09','%e-%b-%y'),170.05); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('27-Aug-09','%e-%b-%y'),169.45); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('26-Aug-09','%e-%b-%y'),167.41); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('25-Aug-09','%e-%b-%y'),169.4); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('24-Aug-09','%e-%b-%y'),169.06); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('21-Aug-09','%e-%b-%y'),169.22); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('20-Aug-09','%e-%b-%y'),166.33); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('19-Aug-09','%e-%b-%y'),164.6); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('18-Aug-09','%e-%b-%y'),164); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('17-Aug-09','%e-%b-%y'),159.59); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('14-Aug-09','%e-%b-%y'),166.78); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('13-Aug-09','%e-%b-%y'),168.42); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('12-Aug-09','%e-%b-%y'),165.31); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('10-Aug-09','%e-%b-%y'),164.72); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('7-Aug-09','%e-%b-%y'),165.51); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('6-Aug-09','%e-%b-%y'),163.91); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('5-Aug-09','%e-%b-%y'),165.11); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('4-Aug-09','%e-%b-%y'),165.55); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('3-Aug-09','%e-%b-%y'),166.43); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('31-Jul-09','%e-%b-%y'),163.39); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('30-Jul-09','%e-%b-%y'),162.79); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('29-Jul-09','%e-%b-%y'),160.03); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('28-Jul-09','%e-%b-%y'),160); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('27-Jul-09','%e-%b-%y'),160.1); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('24-Jul-09','%e-%b-%y'),159.99); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('23-Jul-09','%e-%b-%y'),157.82); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('22-Jul-09','%e-%b-%y'),156.74); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('21-Jul-09','%e-%b-%y'),151.51); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('20-Jul-09','%e-%b-%y'),152.91); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('17-Jul-09','%e-%b-%y'),151.75); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('16-Jul-09','%e-%b-%y'),147.52); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('15-Jul-09','%e-%b-%y'),146.88); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('14-Jul-09','%e-%b-%y'),142.27); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('13-Jul-09','%e-%b-%y'),142.34); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('10-Jul-09','%e-%b-%y'),138.52); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('9-Jul-09','%e-%b-%y'),136.36); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('8-Jul-09','%e-%b-%y'),137.22); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('7-Jul-09','%e-%b-%y'),135.4); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('6-Jul-09','%e-%b-%y'),138.61); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('3-Jul-09','%e-%b-%y'),140.02); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('2-Jul-09','%e-%b-%y'),140.02); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('1-Jul-09','%e-%b-%y'),142.83); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('30-Jun-09','%e-%b-%y'),142.43); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('29-Jun-09','%e-%b-%y'),141.97); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('26-Jun-09','%e-%b-%y'),142.44); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('25-Jun-09','%e-%b-%y'),139.86); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('24-Jun-09','%e-%b-%y'),136.22); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('23-Jun-09','%e-%b-%y'),134.01); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('22-Jun-09','%e-%b-%y'),137.37); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('19-Jun-09','%e-%b-%y'),139.48); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('18-Jun-09','%e-%b-%y'),135.88); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('17-Jun-09','%e-%b-%y'),135.58); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('16-Jun-09','%e-%b-%y'),136.35); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('15-Jun-09','%e-%b-%y'),136.09); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('12-Jun-09','%e-%b-%y'),136.97); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('11-Jun-09','%e-%b-%y'),139.95); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('10-Jun-09','%e-%b-%y'),140.25); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('9-Jun-09','%e-%b-%y'),142.72); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('8-Jun-09','%e-%b-%y'),143.85); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('5-Jun-09','%e-%b-%y'),144.67); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('4-Jun-09','%e-%b-%y'),143.74); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('3-Jun-09','%e-%b-%y'),140.95); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('2-Jun-09','%e-%b-%y'),139.49); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('1-Jun-09','%e-%b-%y'),139.35); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('29-May-09','%e-%b-%y'),135.81); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('28-May-09','%e-%b-%y'),135.07); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('27-May-09','%e-%b-%y'),133.05); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('26-May-09','%e-%b-%y'),130.78); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('22-May-09','%e-%b-%y'),122.5); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('21-May-09','%e-%b-%y'),124.18); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('20-May-09','%e-%b-%y'),125.87); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('19-May-09','%e-%b-%y'),127.45); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('18-May-09','%e-%b-%y'),126.65); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('15-May-09','%e-%b-%y'),122.42); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('14-May-09','%e-%b-%y'),122.95); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('13-May-09','%e-%b-%y'),119.49); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('12-May-09','%e-%b-%y'),124.42); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('11-May-09','%e-%b-%y'),129.57); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('8-May-09','%e-%b-%y'),129.19); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('7-May-09','%e-%b-%y'),129.06); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('6-May-09','%e-%b-%y'),132.5); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('5-May-09','%e-%b-%y'),132.71); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('4-May-09','%e-%b-%y'),132.07); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('1-May-09','%e-%b-%y'),127.24); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('30-Apr-09','%e-%b-%y'),125.83); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('29-Apr-09','%e-%b-%y'),125.14); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('28-Apr-09','%e-%b-%y'),123.9); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('27-Apr-09','%e-%b-%y'),124.73); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('24-Apr-09','%e-%b-%y'),123.9); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('23-Apr-09','%e-%b-%y'),125.4); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('22-Apr-09','%e-%b-%y'),121.51); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('21-Apr-09','%e-%b-%y'),121.76); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('20-Apr-09','%e-%b-%y'),120.5); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('17-Apr-09','%e-%b-%y'),123.42); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('16-Apr-09','%e-%b-%y'),121.45); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('15-Apr-09','%e-%b-%y'),117.64); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('14-Apr-09','%e-%b-%y'),118.31); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('13-Apr-09','%e-%b-%y'),120.22); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('10-Apr-09','%e-%b-%y'),119.57); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('9-Apr-09','%e-%b-%y'),119.57); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('8-Apr-09','%e-%b-%y'),116.32); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('7-Apr-09','%e-%b-%y'),115); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('6-Apr-09','%e-%b-%y'),118.45); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('3-Apr-09','%e-%b-%y'),115.99); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('2-Apr-09','%e-%b-%y'),112.71); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('1-Apr-09','%e-%b-%y'),108.69); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('31-Mar-09','%e-%b-%y'),105.12); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('30-Mar-09','%e-%b-%y'),104.49); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('27-Mar-09','%e-%b-%y'),106.85); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('26-Mar-09','%e-%b-%y'),109.87); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('25-Mar-09','%e-%b-%y'),106.49); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('24-Mar-09','%e-%b-%y'),106.5); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('23-Mar-09','%e-%b-%y'),107.66); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('20-Mar-09','%e-%b-%y'),101.59); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('19-Mar-09','%e-%b-%y'),101.62); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('18-Mar-09','%e-%b-%y'),101.52); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('17-Mar-09','%e-%b-%y'),99.66); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('16-Mar-09','%e-%b-%y'),95.42); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('13-Mar-09','%e-%b-%y'),95.93); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('12-Mar-09','%e-%b-%y'),96.35); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('11-Mar-09','%e-%b-%y'),92.68); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('10-Mar-09','%e-%b-%y'),88.63); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('9-Mar-09','%e-%b-%y'),83.11); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('6-Mar-09','%e-%b-%y'),85.3); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('5-Mar-09','%e-%b-%y'),88.84); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('4-Mar-09','%e-%b-%y'),91.17); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('3-Mar-09','%e-%b-%y'),88.37); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('2-Mar-09','%e-%b-%y'),87.94); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('27-Feb-09','%e-%b-%y'),89.31); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('26-Feb-09','%e-%b-%y'),89.19); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('25-Feb-09','%e-%b-%y'),91.16); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('24-Feb-09','%e-%b-%y'),90.25); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('23-Feb-09','%e-%b-%y'),86.95); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('20-Feb-09','%e-%b-%y'),91.2); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('19-Feb-09','%e-%b-%y'),90.64); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('18-Feb-09','%e-%b-%y'),94.37); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('17-Feb-09','%e-%b-%y'),94.53); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('13-Feb-09','%e-%b-%y'),99.16); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('12-Feb-09','%e-%b-%y'),99.27); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('11-Feb-09','%e-%b-%y'),96.82); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('10-Feb-09','%e-%b-%y'),97.83); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('9-Feb-09','%e-%b-%y'),102.51); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('6-Feb-09','%e-%b-%y'),99.72); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('5-Feb-09','%e-%b-%y'),96.46); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('4-Feb-09','%e-%b-%y'),93.55); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('3-Feb-09','%e-%b-%y'),92.98); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('2-Feb-09','%e-%b-%y'),91.51); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('30-Jan-09','%e-%b-%y'),90.13); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('29-Jan-09','%e-%b-%y'),93); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('28-Jan-09','%e-%b-%y'),94.2); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('27-Jan-09','%e-%b-%y'),90.73); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('26-Jan-09','%e-%b-%y'),89.64); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('23-Jan-09','%e-%b-%y'),88.36); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('22-Jan-09','%e-%b-%y'),88.36); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('21-Jan-09','%e-%b-%y'),82.83); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('20-Jan-09','%e-%b-%y'),78.2); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('16-Jan-09','%e-%b-%y'),82.33); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('15-Jan-09','%e-%b-%y'),83.38); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('14-Jan-09','%e-%b-%y'),85.33); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('13-Jan-09','%e-%b-%y'),87.71); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('12-Jan-09','%e-%b-%y'),88.66); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('9-Jan-09','%e-%b-%y'),90.58); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('8-Jan-09','%e-%b-%y'),92.7); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('7-Jan-09','%e-%b-%y'),91.01); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('6-Jan-09','%e-%b-%y'),93.02); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('5-Jan-09','%e-%b-%y'),94.58); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('2-Jan-09','%e-%b-%y'),90.75); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('1-Jan-09','%e-%b-%y'),85.35); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('31-Dec-08','%e-%b-%y'),85.35); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('30-Dec-08','%e-%b-%y'),86.29); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('29-Dec-08','%e-%b-%y'),86.61); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('26-Dec-08','%e-%b-%y'),85.81); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('25-Dec-08','%e-%b-%y'),85.04); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('24-Dec-08','%e-%b-%y'),85.04); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('23-Dec-08','%e-%b-%y'),86.38); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('22-Dec-08','%e-%b-%y'),85.74); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('19-Dec-08','%e-%b-%y'),90); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('18-Dec-08','%e-%b-%y'),89.43); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('17-Dec-08','%e-%b-%y'),89.16); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('16-Dec-08','%e-%b-%y'),95.43); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('15-Dec-08','%e-%b-%y'),94.75); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('12-Dec-08','%e-%b-%y'),98.27); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('11-Dec-08','%e-%b-%y'),95); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('10-Dec-08','%e-%b-%y'),98.21); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('9-Dec-08','%e-%b-%y'),100.06); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('8-Dec-08','%e-%b-%y'),99.72); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('5-Dec-08','%e-%b-%y'),94); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('4-Dec-08','%e-%b-%y'),91.41); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('3-Dec-08','%e-%b-%y'),95.9); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('2-Dec-08','%e-%b-%y'),92.47); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('1-Dec-08','%e-%b-%y'),88.93); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('28-Nov-08','%e-%b-%y'),92.67); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('27-Nov-08','%e-%b-%y'),95); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('26-Nov-08','%e-%b-%y'),95); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('25-Nov-08','%e-%b-%y'),90.8); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('24-Nov-08','%e-%b-%y'),92.95); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('21-Nov-08','%e-%b-%y'),82.58); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('20-Nov-08','%e-%b-%y'),80.49); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('19-Nov-08','%e-%b-%y'),86.29); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('18-Nov-08','%e-%b-%y'),89.91); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('17-Nov-08','%e-%b-%y'),88.14); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('14-Nov-08','%e-%b-%y'),90.24); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('13-Nov-08','%e-%b-%y'),96.44); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('12-Nov-08','%e-%b-%y'),90.12); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('11-Nov-08','%e-%b-%y'),94.77); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('10-Nov-08','%e-%b-%y'),95.88); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('7-Nov-08','%e-%b-%y'),98.24); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('6-Nov-08','%e-%b-%y'),99.1); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('5-Nov-08','%e-%b-%y'),103.3); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('4-Nov-08','%e-%b-%y'),110.99); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('3-Nov-08','%e-%b-%y'),106.96); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('31-Oct-08','%e-%b-%y'),107.59); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('30-Oct-08','%e-%b-%y'),111.04); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('29-Oct-08','%e-%b-%y'),104.55); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('28-Oct-08','%e-%b-%y'),99.91); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('27-Oct-08','%e-%b-%y'),92.09); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('24-Oct-08','%e-%b-%y'),96.38); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('23-Oct-08','%e-%b-%y'),98.23); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('22-Oct-08','%e-%b-%y'),96.87); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('21-Oct-08','%e-%b-%y'),91.49); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('20-Oct-08','%e-%b-%y'),98.44); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('17-Oct-08','%e-%b-%y'),97.4); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('16-Oct-08','%e-%b-%y'),101.89); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('15-Oct-08','%e-%b-%y'),97.95); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('14-Oct-08','%e-%b-%y'),104.08); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('13-Oct-08','%e-%b-%y'),110.26); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('10-Oct-08','%e-%b-%y'),96.8); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('9-Oct-08','%e-%b-%y'),88.74); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('8-Oct-08','%e-%b-%y'),89.79); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('7-Oct-08','%e-%b-%y'),89.16); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('6-Oct-08','%e-%b-%y'),98.14); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('3-Oct-08','%e-%b-%y'),97.07); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('2-Oct-08','%e-%b-%y'),100.1); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('1-Oct-08','%e-%b-%y'),109.12); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('30-Sep-08','%e-%b-%y'),113.66); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('29-Sep-08','%e-%b-%y'),105.26); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('26-Sep-08','%e-%b-%y'),128.24); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('25-Sep-08','%e-%b-%y'),131.93); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('24-Sep-08','%e-%b-%y'),128.71); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('23-Sep-08','%e-%b-%y'),126.84); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('22-Sep-08','%e-%b-%y'),131.05); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('19-Sep-08','%e-%b-%y'),140.91); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('18-Sep-08','%e-%b-%y'),134.09); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('17-Sep-08','%e-%b-%y'),127.83); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('16-Sep-08','%e-%b-%y'),139.88); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('15-Sep-08','%e-%b-%y'),140.36); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('12-Sep-08','%e-%b-%y'),148.94); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('11-Sep-08','%e-%b-%y'),152.65); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('10-Sep-08','%e-%b-%y'),151.61); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('9-Sep-08','%e-%b-%y'),151.68); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('8-Sep-08','%e-%b-%y'),157.92); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('5-Sep-08','%e-%b-%y'),160.18); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('4-Sep-08','%e-%b-%y'),161.22); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('3-Sep-08','%e-%b-%y'),166.96); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('2-Sep-08','%e-%b-%y'),166.19); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('29-Aug-08','%e-%b-%y'),169.53); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('28-Aug-08','%e-%b-%y'),173.74); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('27-Aug-08','%e-%b-%y'),174.67); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('26-Aug-08','%e-%b-%y'),173.64); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('25-Aug-08','%e-%b-%y'),172.55); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('22-Aug-08','%e-%b-%y'),176.79); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('21-Aug-08','%e-%b-%y'),174.29); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('20-Aug-08','%e-%b-%y'),175.84); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('19-Aug-08','%e-%b-%y'),173.53); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('18-Aug-08','%e-%b-%y'),175.39); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('15-Aug-08','%e-%b-%y'),175.74); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('14-Aug-08','%e-%b-%y'),179.32); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('13-Aug-08','%e-%b-%y'),179.3); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('12-Aug-08','%e-%b-%y'),176.73); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('11-Aug-08','%e-%b-%y'),173.56); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('8-Aug-08','%e-%b-%y'),169.55); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('7-Aug-08','%e-%b-%y'),163.57); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('6-Aug-08','%e-%b-%y'),164.19); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('5-Aug-08','%e-%b-%y'),160.64); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('4-Aug-08','%e-%b-%y'),153.23); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('1-Aug-08','%e-%b-%y'),156.66); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('31-Jul-08','%e-%b-%y'),158.95); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('30-Jul-08','%e-%b-%y'),159.88); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('29-Jul-08','%e-%b-%y'),157.08); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('28-Jul-08','%e-%b-%y'),154.4); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('25-Jul-08','%e-%b-%y'),162.12); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('24-Jul-08','%e-%b-%y'),159.03); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('23-Jul-08','%e-%b-%y'),166.26); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('22-Jul-08','%e-%b-%y'),162.02); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('21-Jul-08','%e-%b-%y'),166.29); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('18-Jul-08','%e-%b-%y'),165.15); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('17-Jul-08','%e-%b-%y'),171.81); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('16-Jul-08','%e-%b-%y'),172.81); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('15-Jul-08','%e-%b-%y'),169.64); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('14-Jul-08','%e-%b-%y'),173.88); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('11-Jul-08','%e-%b-%y'),172.58); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('10-Jul-08','%e-%b-%y'),176.63); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('9-Jul-08','%e-%b-%y'),174.25); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('8-Jul-08','%e-%b-%y'),179.55); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('7-Jul-08','%e-%b-%y'),175.16); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('3-Jul-08','%e-%b-%y'),170.12); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('2-Jul-08','%e-%b-%y'),168.18); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('1-Jul-08','%e-%b-%y'),174.68); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('30-Jun-08','%e-%b-%y'),167.44); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('27-Jun-08','%e-%b-%y'),170.09); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('26-Jun-08','%e-%b-%y'),168.26); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('25-Jun-08','%e-%b-%y'),177.39); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('24-Jun-08','%e-%b-%y'),173.25); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('23-Jun-08','%e-%b-%y'),173.16); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('20-Jun-08','%e-%b-%y'),175.27); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('19-Jun-08','%e-%b-%y'),180.9); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('18-Jun-08','%e-%b-%y'),178.75); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('17-Jun-08','%e-%b-%y'),181.43); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('16-Jun-08','%e-%b-%y'),176.84); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('13-Jun-08','%e-%b-%y'),172.37); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('12-Jun-08','%e-%b-%y'),173.26); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('11-Jun-08','%e-%b-%y'),180.81); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('10-Jun-08','%e-%b-%y'),185.64); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('9-Jun-08','%e-%b-%y'),181.61); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('6-Jun-08','%e-%b-%y'),185.64); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('5-Jun-08','%e-%b-%y'),189.43); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('4-Jun-08','%e-%b-%y'),185.19); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('3-Jun-08','%e-%b-%y'),185.37); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('2-Jun-08','%e-%b-%y'),186.1); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('30-May-08','%e-%b-%y'),188.75); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('29-May-08','%e-%b-%y'),186.69); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('28-May-08','%e-%b-%y'),187.01); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('27-May-08','%e-%b-%y'),186.43); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('23-May-08','%e-%b-%y'),181.17); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('22-May-08','%e-%b-%y'),177.05); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('21-May-08','%e-%b-%y'),178.19); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('20-May-08','%e-%b-%y'),185.9); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('19-May-08','%e-%b-%y'),183.6); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('16-May-08','%e-%b-%y'),187.62); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('15-May-08','%e-%b-%y'),189.73); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('14-May-08','%e-%b-%y'),186.26); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('13-May-08','%e-%b-%y'),189.96); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('12-May-08','%e-%b-%y'),188.16); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('9-May-08','%e-%b-%y'),183.45); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('8-May-08','%e-%b-%y'),185.06); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('7-May-08','%e-%b-%y'),182.59); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('6-May-08','%e-%b-%y'),186.66); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('5-May-08','%e-%b-%y'),184.73); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('2-May-08','%e-%b-%y'),180.94); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('1-May-08','%e-%b-%y'),180); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('30-Apr-08','%e-%b-%y'),173.95); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('29-Apr-08','%e-%b-%y'),175.05); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('28-Apr-08','%e-%b-%y'),172.24); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('25-Apr-08','%e-%b-%y'),169.73); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('24-Apr-08','%e-%b-%y'),168.94); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('23-Apr-08','%e-%b-%y'),162.89); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('22-Apr-08','%e-%b-%y'),160.2); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('21-Apr-08','%e-%b-%y'),168.16); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('18-Apr-08','%e-%b-%y'),161.04); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('17-Apr-08','%e-%b-%y'),154.49); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('16-Apr-08','%e-%b-%y'),153.7); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('15-Apr-08','%e-%b-%y'),148.38); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('14-Apr-08','%e-%b-%y'),147.78); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('11-Apr-08','%e-%b-%y'),147.14); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('10-Apr-08','%e-%b-%y'),154.55); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('9-Apr-08','%e-%b-%y'),151.44); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('8-Apr-08','%e-%b-%y'),152.84); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('7-Apr-08','%e-%b-%y'),155.89); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('4-Apr-08','%e-%b-%y'),153.08); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('3-Apr-08','%e-%b-%y'),151.61); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('2-Apr-08','%e-%b-%y'),147.49); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('1-Apr-08','%e-%b-%y'),149.53); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('31-Mar-08','%e-%b-%y'),143.5); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('28-Mar-08','%e-%b-%y'),143.01); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('27-Mar-08','%e-%b-%y'),140.25); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('26-Mar-08','%e-%b-%y'),145.06); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('25-Mar-08','%e-%b-%y'),140.98); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('24-Mar-08','%e-%b-%y'),139.53); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('20-Mar-08','%e-%b-%y'),133.27); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('19-Mar-08','%e-%b-%y'),129.67); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('18-Mar-08','%e-%b-%y'),132.82); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('17-Mar-08','%e-%b-%y'),126.73); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('14-Mar-08','%e-%b-%y'),126.61); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('13-Mar-08','%e-%b-%y'),127.94); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('12-Mar-08','%e-%b-%y'),126.03); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('11-Mar-08','%e-%b-%y'),127.35); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('10-Mar-08','%e-%b-%y'),119.69); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('7-Mar-08','%e-%b-%y'),122.25); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('6-Mar-08','%e-%b-%y'),120.93); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('5-Mar-08','%e-%b-%y'),124.49); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('4-Mar-08','%e-%b-%y'),124.62); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('3-Mar-08','%e-%b-%y'),121.73); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('29-Feb-08','%e-%b-%y'),125.02); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('28-Feb-08','%e-%b-%y'),129.91); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('27-Feb-08','%e-%b-%y'),122.96); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('26-Feb-08','%e-%b-%y'),119.15); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('25-Feb-08','%e-%b-%y'),119.74); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('22-Feb-08','%e-%b-%y'),119.46); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('21-Feb-08','%e-%b-%y'),121.54); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('20-Feb-08','%e-%b-%y'),123.82); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('19-Feb-08','%e-%b-%y'),122.18); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('15-Feb-08','%e-%b-%y'),124.63); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('14-Feb-08','%e-%b-%y'),127.46); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('13-Feb-08','%e-%b-%y'),129.4); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('12-Feb-08','%e-%b-%y'),124.86); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('11-Feb-08','%e-%b-%y'),129.45); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('8-Feb-08','%e-%b-%y'),125.48); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('7-Feb-08','%e-%b-%y'),121.24); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('6-Feb-08','%e-%b-%y'),122); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('5-Feb-08','%e-%b-%y'),129.36); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('4-Feb-08','%e-%b-%y'),131.65); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('1-Feb-08','%e-%b-%y'),133.75); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('31-Jan-08','%e-%b-%y'),135.36); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('30-Jan-08','%e-%b-%y'),132.18); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('29-Jan-08','%e-%b-%y'),131.54); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('28-Jan-08','%e-%b-%y'),130.01); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('25-Jan-08','%e-%b-%y'),130.01); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('24-Jan-08','%e-%b-%y'),135.6); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('23-Jan-08','%e-%b-%y'),139.07); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('22-Jan-08','%e-%b-%y'),155.64); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('18-Jan-08','%e-%b-%y'),161.36); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('17-Jan-08','%e-%b-%y'),160.89); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('16-Jan-08','%e-%b-%y'),159.64); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('15-Jan-08','%e-%b-%y'),169.04); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('14-Jan-08','%e-%b-%y'),178.78); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('11-Jan-08','%e-%b-%y'),172.69); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('10-Jan-08','%e-%b-%y'),178.02); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('9-Jan-08','%e-%b-%y'),179.4); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('8-Jan-08','%e-%b-%y'),171.25); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('7-Jan-08','%e-%b-%y'),177.64); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('4-Jan-08','%e-%b-%y'),180.05); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('3-Jan-08','%e-%b-%y'),194.93); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('2-Jan-08','%e-%b-%y'),194.84); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('31-Dec-07','%e-%b-%y'),198.08); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('28-Dec-07','%e-%b-%y'),199.83); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('27-Dec-07','%e-%b-%y'),198.57); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('26-Dec-07','%e-%b-%y'),198.95); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('24-Dec-07','%e-%b-%y'),198.8); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('21-Dec-07','%e-%b-%y'),193.91); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('20-Dec-07','%e-%b-%y'),187.21); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('19-Dec-07','%e-%b-%y'),183.12); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('18-Dec-07','%e-%b-%y'),182.98); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('17-Dec-07','%e-%b-%y'),184.4); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('14-Dec-07','%e-%b-%y'),190.39); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('13-Dec-07','%e-%b-%y'),191.83); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('12-Dec-07','%e-%b-%y'),190.86); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('11-Dec-07','%e-%b-%y'),188.54); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('10-Dec-07','%e-%b-%y'),194.21); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('7-Dec-07','%e-%b-%y'),194.3); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('6-Dec-07','%e-%b-%y'),189.95); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('5-Dec-07','%e-%b-%y'),185.5); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('4-Dec-07','%e-%b-%y'),179.81); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('3-Dec-07','%e-%b-%y'),178.86); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('30-Nov-07','%e-%b-%y'),182.22); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('29-Nov-07','%e-%b-%y'),184.29); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('28-Nov-07','%e-%b-%y'),180.22); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('27-Nov-07','%e-%b-%y'),174.81); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('26-Nov-07','%e-%b-%y'),172.54); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('23-Nov-07','%e-%b-%y'),171.54); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('21-Nov-07','%e-%b-%y'),168.46); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('20-Nov-07','%e-%b-%y'),168.85); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('19-Nov-07','%e-%b-%y'),163.95); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('16-Nov-07','%e-%b-%y'),166.39); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('15-Nov-07','%e-%b-%y'),164.3); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('14-Nov-07','%e-%b-%y'),166.11); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('13-Nov-07','%e-%b-%y'),169.96); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('12-Nov-07','%e-%b-%y'),153.76); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('9-Nov-07','%e-%b-%y'),165.37); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('8-Nov-07','%e-%b-%y'),175.47); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('7-Nov-07','%e-%b-%y'),186.3); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('6-Nov-07','%e-%b-%y'),191.79); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('5-Nov-07','%e-%b-%y'),186.18); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('2-Nov-07','%e-%b-%y'),187.87); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('1-Nov-07','%e-%b-%y'),187.44); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('31-Oct-07','%e-%b-%y'),189.95); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('30-Oct-07','%e-%b-%y'),187); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('29-Oct-07','%e-%b-%y'),185.09); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('26-Oct-07','%e-%b-%y'),184.7); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('25-Oct-07','%e-%b-%y'),182.78); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('24-Oct-07','%e-%b-%y'),185.93); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('23-Oct-07','%e-%b-%y'),186.16); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('22-Oct-07','%e-%b-%y'),174.36); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('19-Oct-07','%e-%b-%y'),170.42); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('18-Oct-07','%e-%b-%y'),173.5); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('17-Oct-07','%e-%b-%y'),172.75); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('16-Oct-07','%e-%b-%y'),169.58); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('15-Oct-07','%e-%b-%y'),166.98); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('12-Oct-07','%e-%b-%y'),167.25); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('11-Oct-07','%e-%b-%y'),162.23); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('10-Oct-07','%e-%b-%y'),166.79); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('9-Oct-07','%e-%b-%y'),167.86); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('8-Oct-07','%e-%b-%y'),167.91); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('5-Oct-07','%e-%b-%y'),161.45); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('4-Oct-07','%e-%b-%y'),156.24); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('3-Oct-07','%e-%b-%y'),157.92); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('2-Oct-07','%e-%b-%y'),158.45); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('1-Oct-07','%e-%b-%y'),156.34); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('28-Sep-07','%e-%b-%y'),153.47); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('27-Sep-07','%e-%b-%y'),154.5); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('26-Sep-07','%e-%b-%y'),152.77); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('25-Sep-07','%e-%b-%y'),153.18); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('24-Sep-07','%e-%b-%y'),148.28); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('21-Sep-07','%e-%b-%y'),144.15); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('20-Sep-07','%e-%b-%y'),140.31); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('19-Sep-07','%e-%b-%y'),140.77); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('18-Sep-07','%e-%b-%y'),140.92); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('17-Sep-07','%e-%b-%y'),138.41); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('14-Sep-07','%e-%b-%y'),138.81); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('13-Sep-07','%e-%b-%y'),137.2); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('12-Sep-07','%e-%b-%y'),136.85); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('11-Sep-07','%e-%b-%y'),135.49); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('10-Sep-07','%e-%b-%y'),136.71); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('7-Sep-07','%e-%b-%y'),131.77); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('6-Sep-07','%e-%b-%y'),135.01); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('5-Sep-07','%e-%b-%y'),136.76); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('4-Sep-07','%e-%b-%y'),144.16); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('31-Aug-07','%e-%b-%y'),138.48); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('30-Aug-07','%e-%b-%y'),136.25); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('29-Aug-07','%e-%b-%y'),134.08); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('28-Aug-07','%e-%b-%y'),126.82); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('27-Aug-07','%e-%b-%y'),132.25); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('24-Aug-07','%e-%b-%y'),135.3); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('23-Aug-07','%e-%b-%y'),131.07); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('22-Aug-07','%e-%b-%y'),132.51); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('21-Aug-07','%e-%b-%y'),127.57); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('20-Aug-07','%e-%b-%y'),122.22); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('17-Aug-07','%e-%b-%y'),122.06); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('16-Aug-07','%e-%b-%y'),117.05); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('15-Aug-07','%e-%b-%y'),119.9); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('14-Aug-07','%e-%b-%y'),124.03); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('13-Aug-07','%e-%b-%y'),127.79); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('10-Aug-07','%e-%b-%y'),125); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('9-Aug-07','%e-%b-%y'),126.39); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('8-Aug-07','%e-%b-%y'),134.01); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('7-Aug-07','%e-%b-%y'),135.03); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('6-Aug-07','%e-%b-%y'),135.25); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('3-Aug-07','%e-%b-%y'),131.85); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('2-Aug-07','%e-%b-%y'),136.49); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('1-Aug-07','%e-%b-%y'),135); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('31-Jul-07','%e-%b-%y'),131.76); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('30-Jul-07','%e-%b-%y'),141.43); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('27-Jul-07','%e-%b-%y'),143.85); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('26-Jul-07','%e-%b-%y'),146); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('25-Jul-07','%e-%b-%y'),137.26); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('24-Jul-07','%e-%b-%y'),134.89); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('23-Jul-07','%e-%b-%y'),143.7); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('20-Jul-07','%e-%b-%y'),143.75); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('19-Jul-07','%e-%b-%y'),140); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('18-Jul-07','%e-%b-%y'),138.12); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('17-Jul-07','%e-%b-%y'),138.91); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('16-Jul-07','%e-%b-%y'),138.1); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('13-Jul-07','%e-%b-%y'),137.73); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('12-Jul-07','%e-%b-%y'),134.07); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('11-Jul-07','%e-%b-%y'),132.39); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('10-Jul-07','%e-%b-%y'),132.35); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('9-Jul-07','%e-%b-%y'),130.33); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('6-Jul-07','%e-%b-%y'),132.3); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('5-Jul-07','%e-%b-%y'),132.75); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('3-Jul-07','%e-%b-%y'),127.17); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('2-Jul-07','%e-%b-%y'),121.26); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('29-Jun-07','%e-%b-%y'),122.04); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('28-Jun-07','%e-%b-%y'),120.56); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('27-Jun-07','%e-%b-%y'),121.89); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('26-Jun-07','%e-%b-%y'),119.65); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('25-Jun-07','%e-%b-%y'),122.34); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('22-Jun-07','%e-%b-%y'),123); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('21-Jun-07','%e-%b-%y'),123.9); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('20-Jun-07','%e-%b-%y'),121.55); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('19-Jun-07','%e-%b-%y'),123.66); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('18-Jun-07','%e-%b-%y'),125.09); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('15-Jun-07','%e-%b-%y'),120.5); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('14-Jun-07','%e-%b-%y'),118.75); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('13-Jun-07','%e-%b-%y'),117.5); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('12-Jun-07','%e-%b-%y'),120.38); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('11-Jun-07','%e-%b-%y'),120.19); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('8-Jun-07','%e-%b-%y'),124.49); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('7-Jun-07','%e-%b-%y'),124.07); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('6-Jun-07','%e-%b-%y'),123.64); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('5-Jun-07','%e-%b-%y'),122.67); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('4-Jun-07','%e-%b-%y'),121.33); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('1-Jun-07','%e-%b-%y'),118.4); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('31-May-07','%e-%b-%y'),121.19); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('30-May-07','%e-%b-%y'),118.77); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('29-May-07','%e-%b-%y'),114.35); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('25-May-07','%e-%b-%y'),113.62); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('24-May-07','%e-%b-%y'),110.69); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('23-May-07','%e-%b-%y'),112.89); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('22-May-07','%e-%b-%y'),113.54); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('21-May-07','%e-%b-%y'),111.98); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('18-May-07','%e-%b-%y'),110.02); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('17-May-07','%e-%b-%y'),109.44); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('16-May-07','%e-%b-%y'),107.34); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('15-May-07','%e-%b-%y'),107.52); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('14-May-07','%e-%b-%y'),109.36); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('11-May-07','%e-%b-%y'),108.74); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('10-May-07','%e-%b-%y'),107.34); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('9-May-07','%e-%b-%y'),106.88); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('8-May-07','%e-%b-%y'),105.06); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('7-May-07','%e-%b-%y'),103.92); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('4-May-07','%e-%b-%y'),100.81); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('3-May-07','%e-%b-%y'),100.4); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('2-May-07','%e-%b-%y'),100.39); +Insert into demo_line_chart (series, log_date, data_value) values ('Series3',STR_TO_DATE('1-May-07','%e-%b-%y'),99.47); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('30-Apr-07','%e-%b-%y'),99.8); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('27-Apr-07','%e-%b-%y'),99.92); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('26-Apr-07','%e-%b-%y'),98.84); +Insert into demo_line_chart (series, log_date, data_value) values ('Series2',STR_TO_DATE('25-Apr-07','%e-%b-%y'),95.35); +Insert into demo_line_chart (series, log_date, data_value) values ('Series1',STR_TO_DATE('24-Apr-07','%e-%b-%y'),93.24); + +-- DEMO_PIE_CHART +Insert into demo_pie_chart (legend, data_value) values ('One', 5); +Insert into demo_pie_chart (legend, data_value) values ('Two', 2); +Insert into demo_pie_chart (legend, data_value) values ('Three', 9); +Insert into demo_pie_chart (legend, data_value) values ('Four', 7); +Insert into demo_pie_chart (legend, data_value) values ('Five', 4); +Insert into demo_pie_chart (legend, data_value) values ('Six', 3); +Insert into demo_pie_chart (legend, data_value) values ('Seven', .5); + + +-- DEMO_SCATTER_CHART +Insert into demo_scatter_chart (rainfall, key_value, measurements) values (4.1, 'Particulate', 122); +Insert into demo_scatter_chart (rainfall, key_value, measurements) values (4.3, 'Particulate', 117); +Insert into demo_scatter_chart (rainfall, key_value, measurements) values (5.7, 'Particulate', 112); +Insert into demo_scatter_chart (rainfall, key_value, measurements) values (5.4, 'Particulate', 114); +Insert into demo_scatter_chart (rainfall, key_value, measurements) values (5.9, 'Particulate', 110); +Insert into demo_scatter_chart (rainfall, key_value, measurements) values (5.0, 'Particulate', 114); +Insert into demo_scatter_chart (rainfall, key_value, measurements) values (3.6, 'Particulate', 128); +Insert into demo_scatter_chart (rainfall, key_value, measurements) values (1.9, 'Particulate', 137); +Insert into demo_scatter_chart (rainfall, key_value, measurements) values (7.3, 'Particulate', 104); +Insert into demo_scatter_chart (rainfall, key_value, measurements) values (6.9, 'Humidity', 119); +Insert into demo_scatter_chart (rainfall, key_value, measurements) values (7.9, 'Humidity', 118); +Insert into demo_scatter_chart (rainfall, key_value, measurements) values (9.8, 'Humidity', 103); +Insert into demo_scatter_chart (rainfall, key_value, measurements) values (4.9, 'Humidity', 137); +Insert into demo_scatter_chart (rainfall, key_value, measurements) values (6.8, 'Humidity', 102); +Insert into demo_scatter_chart (rainfall, key_value, measurements) values (4.7, 'Humidity', 89); +Insert into demo_scatter_chart (rainfall, key_value, measurements) values (2.7, 'Humidity', 98); +Insert into demo_scatter_chart (rainfall, key_value, measurements) values (3.7, 'Humidity', 145); +Insert into demo_scatter_chart (rainfall, key_value, measurements) values (7.4, 'Humidity', 118); + +-- DEMO_SCATTER_PLOT + +-- SET DEFINE OFF; +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample0', -46.5901128883449, -464.477370615131); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample0', -85.0293361247543, -362.252178232471); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample0', 70.9700275365898, 402.214363675566); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample0', -50.1110580054506, -310.108907443154); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample0', 85.043005750476, 813.481841353449); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample0', -14.2356123424179, -134.200903707809); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample0', -66.7014933188071, -445.754374526706); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample0', -79.941582021797, -694.089097548454); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample0', -64.4665101305822, -431.660620986243); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample0', 13.718818366452, 100.010719918027); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample0', 35.457456199233, 223.254643848734); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample0', 55.2326402548387, 268.940835852805); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample0', -32.9989160276248, -237.280626944034); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample0', -0.464911506111831, -2.65656324666862); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample0', -59.0205101710777, -498.895652307826); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample0', 28.0939970575828, 117.200615553207); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample0', 31.7305239061572, 186.662624012256); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample0', 50.9035126419798, 440.937283203403); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample0', 58.3875046571053, 547.879249694999); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample0', 76.7846997917459, 525.020578968308); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample0', 1.73485745801611, 7.28149474936192); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample0', 15.304841061276, 71.2374666595537); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample0', 75.1342455000693, 381.145932349436); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample0', -58.2087417684623, -573.630956069476); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample0', 76.7977837302114, 624.733726327778); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample0', 56.3295585433654, 309.697529902676); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample0', -9.27601440680639, -49.5126219388194); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample0', 98.3002030040236, 765.653589829535); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample0', -25.0987502451517, -174.651201240269); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample0', 39.9215299020147, 337.889176256456); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample0', 77.9225832868337, 356.183903852096); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample0', 75.4311841137638, 14.5258766665983); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample0', 58.9445375968278, 376.359576288564); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample0', 46.9521897141796, 3.5679984193934); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample0', -49.0378307695689, -230.816092788509); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample0', -96.2461776340861, -863.765255159092); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample0', -96.3388912796447, -538.147283544646); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample0', -21.4684477767032, -200.140077054848); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample0', -30.3532837083366, -226.462637188158); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample0', -17.5055590488884, -118.709622452841); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample1', 56.6394671790491, 385.48951169801); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample1', 70.4622912302344, 356.986529538635); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample1', 58.2647422222769, 489.418744916999); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample1', -92.16093253903, -425.576081634713); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample1', -2.64574970943097, -26.190027661226); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample1', -16.7568654181289, -117.460886096034); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample1', 68.215377945908, 606.917788617984); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample1', 53.7387814434413, 367.53491797949); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample1', -51.8861573715238, -289.998186955562); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample1', -15.9721784074351, -75.335027134323); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample1', 63.2540648905791, 602.546517566905); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample1', -53.376167960458, -470.921238684285); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample1', 40.8307443439851, 276.112653117961); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample1', -13.0540977188468, -127.648158921993); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample1', -43.7358336047599, -435.080470107322); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample1', -74.5673321340732, -617.960236798371); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample1', -6.47907144443936, -55.654651151187); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample1', 68.1915507628225, 352.320728639801); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample1', -23.5393521654339, -137.714557244391); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample1', 28.3621412621467, 141.103859877604); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample1', -99.5615230664525, -974.857161307048); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample1', -77.7132553058204, -736.182131225006); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample1', 95.9321864873013, 478.286112499176); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample1', 97.7451855292708, 940.301427763062); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample1', -10.2483179758141, -70.1145330070458); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample1', -24.0750124187893, -113.523998470537); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample1', -5.5721118558967, -43.8516395203455); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample1', -55.5378338160537, -368.506951528332); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample1', 52.6669516338013, 38.2926120131942); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample1', -74.1981412067658, -436.990411988621); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample1', -8.70511941690364, -71.3277811558721); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample1', 63.2921735621378, 534.825008407329); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample1', 97.9066635843841, 678.994971737474); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample1', -83.1613916743288, -494.53303650568); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample1', 23.4730547863992, 223.031148353333); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample1', 40.6105099506845, 199.937366405274); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample1', 35.4473225526307, 331.61786915261); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample1', 27.2050975460142, 146.277993239147); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample1', -1.54684302938646, -12.6706471561247); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample1', 45.8386162291745, 401.780882699918); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample2', 43.4241956158593, 228.71488367607); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample2', -23.4517134254585, -165.958577325218); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample2', -98.8954664030229, -829.964553125469); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample2', 48.0527046113198, 451.527720751234); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample2', -77.8912947988124, -416.867729852279); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample2', 23.8325471824168, 206.907438743452); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample2', 83.2787398847467, 814.01250022556); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample2', 49.1572992549647, 451.03037365466); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample2', -11.1351768833872, -57.3863334655361); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample2', 71.1980242104626, 572.745863967841); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample2', 15.0952976022392, 103.30274980367); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample2', 75.0300005037414, 406.581640027236); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample2', -82.0092720309019, -690.340287049552); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample2', 40.2433497232209, 363.579616486762); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample2', 26.8157962678174, 262.150124949525); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample2', -83.9563210001448, -432.739081022174); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample2', -20.6480437627346, -161.330015497217); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample2', 37.1388896882226, 161.352404658606); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample2', 20.2126667486174, 168.833789818416); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample2', 58.3723632769494, 293.206814023827); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample2', -20.2876832456236, -88.0090685884954); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample2', 72.9768050433371, 691.684023528398); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample2', -21.6612128833675, -130.834158714088); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample2', 97.4870524045038, 806.47904449193); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample2', 60.6688063197852, 255.749289305775); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample2', -44.235772358471, -336.262226570567); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample2', -47.39573087854, -321.133647936626); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample2', -24.7522484346097, -204.548308435727); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample2', -42.903238078129, -239.651563752902); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample2', 20.4656734934697, 172.700213789797); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample2', 56.0665747085147, 365.360390019834); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample2', 31.9979219049038, 237.490140339893); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample2', -29.9884426739069, -203.821484170813); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample2', 13.5011085362703, 79.4784314297668); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample2', 41.8402945507358, 297.04934398378); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample2', -84.9323678979223, -345.2331996232); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample2', -42.2469964847455, -361.468816319656); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample2', 98.1057699772752, 445.181262282444); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample2', 95.5327901766563, 522.663100406047); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample2', 35.0916611161316, 246.796980313209); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample3', 99.3987950082867, 401.97428571655); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample3', -3.0419413965969, -14.5325761725203); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample3', -79.388026451666, -701.817589967372); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample3', -88.451242397524, -668.370526000304); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample3', 34.3131838963851, 254.418322223563); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample3', -61.518208630511, -347.521623572776); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample3', 45.6124480237487, 356.33565541369); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample3', -1.0716036518037, -7.80544934354423); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample3', 31.7371714687412, 283.925868763573); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample3', -76.771029786315, -626.268489584739); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample3', -67.913690110843, -614.736930677921); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample3', 34.9311671860034, 171.384205820777); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample3', 94.3264454603021, 914.267819214392); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample3', 76.7493996267558, 705.649611960615); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample3', -87.795202856922, -749.505178721718); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample3', 2.10914716736019, 15.4036733330536); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample3', -50.456669557937, -318.410608422062); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample3', -94.646644883092, -734.660992935541); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample3', 34.9170862075359, 347.583881438806); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample3', 44.3524585090071, 294.615219199443); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample3', -67.191016143335, -609.956472872497); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample3', -78.826443879164, -369.129912603377); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample3', -50.427554400015, -418.144241602024); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample3', -70.371769526721, -307.02193189609); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample3', 16.3220947890044, 97.0997346831135); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample3', -47.067245718878, -398.27032236792); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample3', 5.91206661301702, 24.7239863780181); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample3', -99.621681801868, -843.593457399484); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample3', 87.4503492670535, 695.345037859433); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample3', -91.176921118057, -683.305064255346); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample3', -0.6632900001386, -5.34157539224209); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample3', 2.98188785882178, 12.1181973600389); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample3', 30.6008700087597, 205.922863867274); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample3', 7.90348761612496, 65.5271597329641); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample3', 40.3565229854156, 268.058138389501); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample3', 37.6892733312091, 247.519083233639); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample3', 16.4759733864001, 107.72661087278); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample3', -53.578492311122, -369.768816039059); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample3', 77.1292326560541, 765.262108306778); +Insert into demo_scatter_plot + (SERIES, VALUEX, VALUEY) + Values + ('Sample3', -79.566811593352, -677.545127214159); + +-- DEMO_UTIL_CHART +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-04-17','%Y-%m-%d'),53.86667); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-08-10','%Y-%m-%d'),62.95747); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-04-21','%Y-%m-%d'),48.80000); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-04-22','%Y-%m-%d'),51.33333); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-08-11','%Y-%m-%d'),56.13373); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-04-23','%Y-%m-%d'),53.40000); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-08-12','%Y-%m-%d'),57.05287); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-04-24','%Y-%m-%d'),51.00000); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-08-13','%Y-%m-%d'),55.78947); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-04-25','%Y-%m-%d'),54.60000); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-08-14','%Y-%m-%d'),63.34907); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-04-26','%Y-%m-%d'),50.86667); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-08-15','%Y-%m-%d'),52.21327); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-04-27','%Y-%m-%d'),48.33333); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-08-16','%Y-%m-%d'),51.32080); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-04-28','%Y-%m-%d'),50.26667); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-08-17','%Y-%m-%d'),58.35720); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-04-29','%Y-%m-%d'),51.73333); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-08-18','%Y-%m-%d'),57.62293); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-04-30','%Y-%m-%d'),67.60000); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-08-19','%Y-%m-%d'),55.25000); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-05-01','%Y-%m-%d'),59.89393); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-08-20','%Y-%m-%d'),58.79573); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-05-02','%Y-%m-%d'),61.20753); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-08-21','%Y-%m-%d'),54.09720); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-05-03','%Y-%m-%d'),58.98340); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-08-22','%Y-%m-%d'),59.95813); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-05-04','%Y-%m-%d'),59.55873); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-08-23','%Y-%m-%d'),62.03067); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-05-05','%Y-%m-%d'),58.73680); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-08-24','%Y-%m-%d'),61.97620); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-05-06','%Y-%m-%d'),59.89967); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-08-25','%Y-%m-%d'),58.00207); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-05-07','%Y-%m-%d'),60.67973); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-08-26','%Y-%m-%d'),59.95440); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-05-08','%Y-%m-%d'),60.85913); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-08-27','%Y-%m-%d'),55.43747); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-05-09','%Y-%m-%d'),60.62460); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-08-28','%Y-%m-%d'),52.53933); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-05-10','%Y-%m-%d'),59.51887); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-08-29','%Y-%m-%d'),57.46260); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-05-11','%Y-%m-%d'),61.57187); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-08-30','%Y-%m-%d'),60.04787); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-05-12','%Y-%m-%d'),60.70000); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-08-31','%Y-%m-%d'),58.79480); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-05-13','%Y-%m-%d'),69.85133); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-09-01','%Y-%m-%d'),54.40107); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-05-14','%Y-%m-%d'),68.99620); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-09-02','%Y-%m-%d'),62.26007); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-05-15','%Y-%m-%d'),67.64080); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-09-03','%Y-%m-%d'),60.72360); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-05-16','%Y-%m-%d'),59.71433); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-09-04','%Y-%m-%d'),60.95847); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-05-17','%Y-%m-%d'),59.99667); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-09-05','%Y-%m-%d'),59.45920); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-05-18','%Y-%m-%d'),63.27207); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-09-06','%Y-%m-%d'),60.58620); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-05-19','%Y-%m-%d'),60.32080); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-09-07','%Y-%m-%d'),61.94207); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-05-20','%Y-%m-%d'),57.32907); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-09-08','%Y-%m-%d'),59.03327); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-05-21','%Y-%m-%d'),59.76933); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-09-09','%Y-%m-%d'),62.83087); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-05-22','%Y-%m-%d'),59.12453); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-09-10','%Y-%m-%d'),59.36840); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-05-23','%Y-%m-%d'),57.10167); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-09-11','%Y-%m-%d'),56.11480); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-05-24','%Y-%m-%d'),58.45820); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-09-12','%Y-%m-%d'),62.23393); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-05-25','%Y-%m-%d'),59.45440); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-09-13','%Y-%m-%d'),59.72313); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-05-26','%Y-%m-%d'),60.12807); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-09-14','%Y-%m-%d'),53.37093); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-05-27','%Y-%m-%d'),59.11760); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-09-15','%Y-%m-%d'),52.99233); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-05-28','%Y-%m-%d'),57.32020); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-09-16','%Y-%m-%d'),55.99080); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-05-29','%Y-%m-%d'),59.80360); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-09-17','%Y-%m-%d'),53.93853); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-05-30','%Y-%m-%d'),66.73280); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-09-18','%Y-%m-%d'),55.99313); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-05-31','%Y-%m-%d'),58.78673); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-09-19','%Y-%m-%d'),68.23393); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-06-01','%Y-%m-%d'),58.82773); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-09-20','%Y-%m-%d'),61.86213); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-06-02','%Y-%m-%d'),63.12100); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-09-21','%Y-%m-%d'),61.20307); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-06-03','%Y-%m-%d'),59.70467); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-09-22','%Y-%m-%d'),61.05900); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-06-04','%Y-%m-%d'),58.85173); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-09-23','%Y-%m-%d'),58.41040); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-06-05','%Y-%m-%d'),61.21880); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-09-24','%Y-%m-%d'),59.15967); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-06-06','%Y-%m-%d'),58.99920); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-09-25','%Y-%m-%d'),56.42153); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-06-07','%Y-%m-%d'),59.94693); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-09-26','%Y-%m-%d'),60.46580); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-06-08','%Y-%m-%d'),66.27293); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-09-27','%Y-%m-%d'),57.44333); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-06-09','%Y-%m-%d'),61.46773); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-09-28','%Y-%m-%d'),56.88887); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-06-10','%Y-%m-%d'),59.70467); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-09-29','%Y-%m-%d'),61.85773); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-06-11','%Y-%m-%d'),60.16000); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-09-30','%Y-%m-%d'),61.96400); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-06-12','%Y-%m-%d'),61.20300); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-10-01','%Y-%m-%d'),65.88833); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-06-13','%Y-%m-%d'),60.95673); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-10-02','%Y-%m-%d'),62.67920); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-06-14','%Y-%m-%d'),60.70207); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-10-03','%Y-%m-%d'),63.52047); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-06-15','%Y-%m-%d'),61.02520); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-10-04','%Y-%m-%d'),58.60280); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-06-16','%Y-%m-%d'),60.33953); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-10-05','%Y-%m-%d'),63.74487); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-06-17','%Y-%m-%d'),61.20300); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-10-06','%Y-%m-%d'),59.94880); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-06-18','%Y-%m-%d'),63.12100); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-10-07','%Y-%m-%d'),59.44380); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-06-23','%Y-%m-%d'),61.09153); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-10-08','%Y-%m-%d'),59.16320); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-06-24','%Y-%m-%d'),61.28867); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-10-09','%Y-%m-%d'),60.84593); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-06-25','%Y-%m-%d'),60.95673); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-10-10','%Y-%m-%d'),58.84113); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-06-26','%Y-%m-%d'),60.61100); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-10-11','%Y-%m-%d'),62.59827); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-06-27','%Y-%m-%d'),61.22913); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-10-12','%Y-%m-%d'),60.94660); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-06-28','%Y-%m-%d'),58.88507); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-10-13','%Y-%m-%d'),59.37593); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-06-29','%Y-%m-%d'),59.73693); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-10-14','%Y-%m-%d'),67.21840); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-06-30','%Y-%m-%d'),62.45307); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-10-15','%Y-%m-%d'),68.56020); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-07-01','%Y-%m-%d'),61.30167); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-10-16','%Y-%m-%d'),57.56493); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-07-02','%Y-%m-%d'),62.92727); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-10-17','%Y-%m-%d'),57.02280); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-07-03','%Y-%m-%d'),60.05887); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-10-18','%Y-%m-%d'),56.20947); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-07-06','%Y-%m-%d'),61.20100); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-10-19','%Y-%m-%d'),55.69353); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-07-07','%Y-%m-%d'),60.66120); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-10-20','%Y-%m-%d'),57.17640); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-07-08','%Y-%m-%d'),59.78180); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-10-21','%Y-%m-%d'),57.50867); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-07-09','%Y-%m-%d'),58.74653); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-10-22','%Y-%m-%d'),61.67860); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-07-10','%Y-%m-%d'),59.77893); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-10-23','%Y-%m-%d'),57.34867); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-07-11','%Y-%m-%d'),67.34500); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-10-24','%Y-%m-%d'),61.68080); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-07-12','%Y-%m-%d'),57.07293); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-10-25','%Y-%m-%d'),55.55793); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-07-13','%Y-%m-%d'),57.37567); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-10-26','%Y-%m-%d'),55.81013); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-07-14','%Y-%m-%d'),63.97820); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-10-27','%Y-%m-%d'),59.85540); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-07-15','%Y-%m-%d'),56.06647); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-10-28','%Y-%m-%d'),61.05073); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-07-16','%Y-%m-%d'),53.66347); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-10-29','%Y-%m-%d'),59.81253); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-07-23','%Y-%m-%d'),56.50813); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-10-30','%Y-%m-%d'),61.02047); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-07-24','%Y-%m-%d'),53.19667); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-10-31','%Y-%m-%d'),60.60413); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-07-25','%Y-%m-%d'),51.57133); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-11-01','%Y-%m-%d'),57.43067); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-07-26','%Y-%m-%d'),45.98160); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-11-02','%Y-%m-%d'),58.63027); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-07-27','%Y-%m-%d'),49.21113); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-11-03','%Y-%m-%d'),59.08127); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-07-28','%Y-%m-%d'),49.67213); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-11-04','%Y-%m-%d'),59.37373); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-07-29','%Y-%m-%d'),52.94053); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-11-05','%Y-%m-%d'),58.13413); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-07-30','%Y-%m-%d'),57.55727); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-11-06','%Y-%m-%d'),57.18893); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-07-31','%Y-%m-%d'),61.76900); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-11-07','%Y-%m-%d'),56.72853); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-08-01','%Y-%m-%d'),56.51953); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-11-08','%Y-%m-%d'),56.47340); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-08-02','%Y-%m-%d'),61.04853); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-11-09','%Y-%m-%d'),62.02333); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-08-03','%Y-%m-%d'),70.06067); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-11-10','%Y-%m-%d'),61.21787); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-08-04','%Y-%m-%d'),60.97787); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-11-11','%Y-%m-%d'),62.01087); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-08-05','%Y-%m-%d'),59.25967); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-11-12','%Y-%m-%d'),62.67573); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-08-06','%Y-%m-%d'),56.12287); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-11-13','%Y-%m-%d'),59.23993); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-08-07','%Y-%m-%d'),63.99913); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-11-14','%Y-%m-%d'),67.34973); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-08-08','%Y-%m-%d'),58.71127); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-11-15','%Y-%m-%d'),60.93753); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-08-09','%Y-%m-%d'),64.01913); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-11-16','%Y-%m-%d'),54.52607); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-11-17','%Y-%m-%d'),57.81127); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-11-18','%Y-%m-%d'),63.53027); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-11-19','%Y-%m-%d'),58.13000); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-11-20','%Y-%m-%d'),58.46827); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-11-21','%Y-%m-%d'),65.27807); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-11-22','%Y-%m-%d'),53.74513); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-11-23','%Y-%m-%d'),60.99107); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-11-24','%Y-%m-%d'),60.45427); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-11-25','%Y-%m-%d'),56.16847); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-11-26','%Y-%m-%d'),59.04040); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-11-27','%Y-%m-%d'),54.62040); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-11-28','%Y-%m-%d'),56.34687); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-11-29','%Y-%m-%d'),54.81560); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-11-30','%Y-%m-%d'),60.22753); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-12-01','%Y-%m-%d'),59.07307); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-12-02','%Y-%m-%d'),59.73553); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-12-03','%Y-%m-%d'),68.69447); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-12-04','%Y-%m-%d'),68.91767); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-12-05','%Y-%m-%d'),67.86460); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-12-06','%Y-%m-%d'),64.43120); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-03-01','%Y-%m-%d'),61.22507); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-12-07','%Y-%m-%d'),60.67793); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-03-02','%Y-%m-%d'),63.27533); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-12-08','%Y-%m-%d'),62.47060); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-03-03','%Y-%m-%d'),69.88087); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-12-09','%Y-%m-%d'),58.26053); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-03-04','%Y-%m-%d'),66.84920); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-12-10','%Y-%m-%d'),61.03340); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-03-05','%Y-%m-%d'),61.57367); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-12-11','%Y-%m-%d'),57.32620); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-03-06','%Y-%m-%d'),60.52293); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-12-12','%Y-%m-%d'),63.10353); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-03-07','%Y-%m-%d'),62.21027); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-12-13','%Y-%m-%d'),61.73167); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-03-08','%Y-%m-%d'),63.20380); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-12-14','%Y-%m-%d'),65.31080); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-03-09','%Y-%m-%d'),62.72427); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-12-15','%Y-%m-%d'),64.67620); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-03-10','%Y-%m-%d'),61.59373); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-12-16','%Y-%m-%d'),62.87287); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-03-11','%Y-%m-%d'),61.21280); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-12-17','%Y-%m-%d'),60.14680); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-03-12','%Y-%m-%d'),60.79787); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-12-18','%Y-%m-%d'),63.01007); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-03-13','%Y-%m-%d'),60.00080); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-12-19','%Y-%m-%d'),57.82680); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-03-14','%Y-%m-%d'),60.82333); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-12-20','%Y-%m-%d'),62.59173); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-03-15','%Y-%m-%d'),59.62020); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-12-21','%Y-%m-%d'),61.65607); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-03-16','%Y-%m-%d'),60.27420); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-12-23','%Y-%m-%d'),61.80000); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-03-17','%Y-%m-%d'),60.06200); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-12-24','%Y-%m-%d'),59.93333); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-03-18','%Y-%m-%d'),60.88900); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-12-25','%Y-%m-%d'),50.93333); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-03-19','%Y-%m-%d'),59.92547); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-12-26','%Y-%m-%d'),60.46667); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-03-20','%Y-%m-%d'),59.99853); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-12-27','%Y-%m-%d'),62.06667); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-03-21','%Y-%m-%d'),58.65873); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-12-28','%Y-%m-%d'),61.93333); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-03-22','%Y-%m-%d'),60.61000); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-12-29','%Y-%m-%d'),61.26667); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-03-23','%Y-%m-%d'),59.92280); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-12-30','%Y-%m-%d'),61.60000); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-03-24','%Y-%m-%d'),59.52427); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2014-12-31','%Y-%m-%d'),62.86667); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-03-25','%Y-%m-%d'),59.44887); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-01-01','%Y-%m-%d'),60.93333); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-03-26','%Y-%m-%d'),60.23540); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-01-02','%Y-%m-%d'),62.66667); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-03-27','%Y-%m-%d'),61.18333); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-01-03','%Y-%m-%d'),62.46667); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-03-28','%Y-%m-%d'),60.88133); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-01-04','%Y-%m-%d'),60.80000); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-03-29','%Y-%m-%d'),61.74160); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-01-06','%Y-%m-%d'),62.40000); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-03-30','%Y-%m-%d'),60.25647); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-01-08','%Y-%m-%d'),61.40000); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-03-31','%Y-%m-%d'),60.41220); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-01-09','%Y-%m-%d'),63.20000); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-04-01','%Y-%m-%d'),59.21053); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-01-10','%Y-%m-%d'),61.82227); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-04-02','%Y-%m-%d'),55.04713); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-01-11','%Y-%m-%d'),61.89553); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-04-03','%Y-%m-%d'),56.08473); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-01-12','%Y-%m-%d'),60.90127); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-04-04','%Y-%m-%d'),64.51107); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-01-13','%Y-%m-%d'),62.23660); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-04-05','%Y-%m-%d'),56.75193); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-01-14','%Y-%m-%d'),61.76947); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-04-06','%Y-%m-%d'),61.64240); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-01-15','%Y-%m-%d'),63.08853); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-04-07','%Y-%m-%d'),61.33653); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-01-16','%Y-%m-%d'),60.12627); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-04-08','%Y-%m-%d'),69.28867); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-01-17','%Y-%m-%d'),60.60020); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-04-09','%Y-%m-%d'),60.87507); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-01-18','%Y-%m-%d'),60.43440); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-04-10','%Y-%m-%d'),68.08707); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-01-19','%Y-%m-%d'),65.02820); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-04-11','%Y-%m-%d'),60.57680); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-01-20','%Y-%m-%d'),62.95593); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-04-12','%Y-%m-%d'),61.52467); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-01-21','%Y-%m-%d'),61.23967); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-04-13','%Y-%m-%d'),58.06567); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-01-22','%Y-%m-%d'),62.61853); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-04-14','%Y-%m-%d'),59.80807); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-01-23','%Y-%m-%d'),63.64227); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-04-15','%Y-%m-%d'),79.90007); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-01-24','%Y-%m-%d'),63.42147); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-04-16','%Y-%m-%d'),54.75020); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-01-25','%Y-%m-%d'),60.82687); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-04-17','%Y-%m-%d'),65.69500); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-01-26','%Y-%m-%d'),60.66260); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-04-18','%Y-%m-%d'),68.56247); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-01-27','%Y-%m-%d'),60.12767); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-04-19','%Y-%m-%d'),72.67153); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-01-28','%Y-%m-%d'),60.51513); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-04-20','%Y-%m-%d'),71.30720); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-01-29','%Y-%m-%d'),61.71520); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-04-21','%Y-%m-%d'),57.75233); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-01-30','%Y-%m-%d'),60.89553); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-04-22','%Y-%m-%d'),59.04200); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-01-31','%Y-%m-%d'),63.50540); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-04-23','%Y-%m-%d'),62.30153); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-02-01','%Y-%m-%d'),62.37533); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-04-24','%Y-%m-%d'),67.68287); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-02-02','%Y-%m-%d'),60.31400); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-04-25','%Y-%m-%d'),69.21800); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-02-03','%Y-%m-%d'),63.43920); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-04-26','%Y-%m-%d'),69.75993); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-02-04','%Y-%m-%d'),61.20487); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-04-27','%Y-%m-%d'),64.64113); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-02-05','%Y-%m-%d'),62.11167); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-04-28','%Y-%m-%d'),60.10053); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-02-06','%Y-%m-%d'),59.96140); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-04-29','%Y-%m-%d'),58.67653); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-02-07','%Y-%m-%d'),62.60727); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-04-30','%Y-%m-%d'),58.29180); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-02-08','%Y-%m-%d'),61.95493); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-05-01','%Y-%m-%d'),60.56173); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-02-09','%Y-%m-%d'),58.89653); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-05-02','%Y-%m-%d'),57.15840); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-02-10','%Y-%m-%d'),66.20167); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-05-03','%Y-%m-%d'),54.49167); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-02-11','%Y-%m-%d'),64.76873); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-05-04','%Y-%m-%d'),61.54087); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-02-12','%Y-%m-%d'),69.90680); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-05-05','%Y-%m-%d'),63.86073); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-02-13','%Y-%m-%d'),68.49253); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-05-06','%Y-%m-%d'),64.13460); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-02-14','%Y-%m-%d'),63.19360); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-05-07','%Y-%m-%d'),65.30087); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-02-15','%Y-%m-%d'),63.35453); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-05-08','%Y-%m-%d'),64.46353); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-02-16','%Y-%m-%d'),59.78020); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-05-09','%Y-%m-%d'),62.81193); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-02-17','%Y-%m-%d'),60.70760); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-05-10','%Y-%m-%d'),56.14480); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-02-18','%Y-%m-%d'),58.05167); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-05-11','%Y-%m-%d'),61.47853); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-02-19','%Y-%m-%d'),57.12700); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-05-12','%Y-%m-%d'),63.39287); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-02-20','%Y-%m-%d'),59.49013); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-05-13','%Y-%m-%d'),64.30640); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-02-21','%Y-%m-%d'),59.18607); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-05-14','%Y-%m-%d'),64.29447); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-02-22','%Y-%m-%d'),60.94680); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-05-15','%Y-%m-%d'),65.63307); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-02-23','%Y-%m-%d'),59.85807); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-05-16','%Y-%m-%d'),62.32887); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-02-24','%Y-%m-%d'),60.06767); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-05-17','%Y-%m-%d'),56.52853); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-02-25','%Y-%m-%d'),61.60267); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-05-18','%Y-%m-%d'),70.26520); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-02-26','%Y-%m-%d'),60.94220); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-05-19','%Y-%m-%d'),64.38267); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-02-27','%Y-%m-%d'),59.99040); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-05-20','%Y-%m-%d'),63.01447); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-02-28','%Y-%m-%d'),63.05567); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-05-21','%Y-%m-%d'),61.89200); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-05-22','%Y-%m-%d'),62.06920); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-05-23','%Y-%m-%d'),68.49253); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-05-24','%Y-%m-%d'),69.98867); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-05-25','%Y-%m-%d'),60.26940); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-05-26','%Y-%m-%d'),62.91493); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-06-09','%Y-%m-%d'),62.28433); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-05-27','%Y-%m-%d'),62.36827); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-06-10','%Y-%m-%d'),64.38787); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-06-11','%Y-%m-%d'),61.17093); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-05-28','%Y-%m-%d'),60.33887); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-06-12','%Y-%m-%d'),57.17713); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-05-29','%Y-%m-%d'),83.89220); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-06-13','%Y-%m-%d'),57.69653); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-05-30','%Y-%m-%d'),60.96747); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-06-14','%Y-%m-%d'),55.97980); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-05-31','%Y-%m-%d'),57.80627); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-06-15','%Y-%m-%d'),62.08940); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-06-01','%Y-%m-%d'),61.60173); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-06-16','%Y-%m-%d'),83.81047); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-06-02','%Y-%m-%d'),63.23627); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-06-17','%Y-%m-%d'),61.32540); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-06-03','%Y-%m-%d'),58.39987); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-06-18','%Y-%m-%d'),61.08900); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-06-04','%Y-%m-%d'),69.51947); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-06-19','%Y-%m-%d'),67.26267); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-06-05','%Y-%m-%d'),69.67787); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-06-20','%Y-%m-%d'),58.71120); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-06-06','%Y-%m-%d'),62.40513); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-06-21','%Y-%m-%d'),55.77320); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-06-07','%Y-%m-%d'),61.01893); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-06-22','%Y-%m-%d'),59.99420); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-06-08','%Y-%m-%d'),61.34813); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-06-23','%Y-%m-%d'),60.83867); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-06-24','%Y-%m-%d'),59.57020); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-06-25','%Y-%m-%d'),63.20393); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-09-17','%Y-%m-%d'),67.93333); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-06-26','%Y-%m-%d'),58.30480); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-09-18','%Y-%m-%d'),64.06667); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-06-27','%Y-%m-%d'),58.79667); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-09-19','%Y-%m-%d'),60.13333); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-06-28','%Y-%m-%d'),54.04967); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-09-20','%Y-%m-%d'),57.86667); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-06-29','%Y-%m-%d'),57.88313); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-09-21','%Y-%m-%d'),58.33333); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-06-30','%Y-%m-%d'),56.94940); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-09-22','%Y-%m-%d'),59.86667); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-07-01','%Y-%m-%d'),65.01080); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-09-23','%Y-%m-%d'),59.60000); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-07-02','%Y-%m-%d'),64.97013); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-09-24','%Y-%m-%d'),59.80000); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-07-03','%Y-%m-%d'),65.06647); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-09-25','%Y-%m-%d'),59.46667); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-07-04','%Y-%m-%d'),64.08287); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-09-26','%Y-%m-%d'),76.00000); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-07-05','%Y-%m-%d'),65.40367); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-09-27','%Y-%m-%d'),59.86667); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-07-06','%Y-%m-%d'),72.61373); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-09-28','%Y-%m-%d'),59.13333); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-07-07','%Y-%m-%d'),72.53120); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-09-29','%Y-%m-%d'),58.93333); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-07-08','%Y-%m-%d'),72.54133); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-12-26','%Y-%m-%d'),58.93333); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-09-30','%Y-%m-%d'),54.00000); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-10-01','%Y-%m-%d'),58.26667); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-10-02','%Y-%m-%d'),59.46667); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-10-03','%Y-%m-%d'),58.86667); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-10-04','%Y-%m-%d'),60.33333); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-10-05','%Y-%m-%d'),101.00000); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-10-06','%Y-%m-%d'),58.00000); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-10-07','%Y-%m-%d'),59.53333); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-10-08','%Y-%m-%d'),56.00000); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-10-09','%Y-%m-%d'),57.93333); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-10-10','%Y-%m-%d'),65.73333); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-10-11','%Y-%m-%d'),56.00000); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-10-12','%Y-%m-%d'),54.86667); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-10-13','%Y-%m-%d'),68.60000); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-10-14','%Y-%m-%d'),69.93333); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-10-15','%Y-%m-%d'),66.86667); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-10-16','%Y-%m-%d'),58.66667); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-10-17','%Y-%m-%d'),60.06667); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-10-18','%Y-%m-%d'),58.40000); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-10-19','%Y-%m-%d'),55.26667); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-10-20','%Y-%m-%d'),55.86667); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-10-21','%Y-%m-%d'),57.86667); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-10-22','%Y-%m-%d'),57.40000); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-10-23','%Y-%m-%d'),58.20000); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-10-24','%Y-%m-%d'),57.93333); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-10-25','%Y-%m-%d'),58.60000); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-10-26','%Y-%m-%d'),61.66667); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-10-27','%Y-%m-%d'),57.66667); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-10-28','%Y-%m-%d'),58.40000); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-10-29','%Y-%m-%d'),59.33333); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-10-30','%Y-%m-%d'),55.73333); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-10-31','%Y-%m-%d'),53.80000); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-11-01','%Y-%m-%d'),56.86667); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-11-02','%Y-%m-%d'),57.00000); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-11-03','%Y-%m-%d'),55.00000); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-11-04','%Y-%m-%d'),57.06667); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-11-05','%Y-%m-%d'),65.13333); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-11-06','%Y-%m-%d'),55.26667); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-11-07','%Y-%m-%d'),57.60000); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-11-08','%Y-%m-%d'),59.06667); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-11-09','%Y-%m-%d'),60.13333); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-11-10','%Y-%m-%d'),58.93333); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-11-11','%Y-%m-%d'),58.13333); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-11-12','%Y-%m-%d'),57.40000); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-11-13','%Y-%m-%d'),57.66667); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-11-14','%Y-%m-%d'),55.80000); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-11-15','%Y-%m-%d'),55.66667); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-11-16','%Y-%m-%d'),58.26667); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-11-17','%Y-%m-%d'),58.93333); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-11-18','%Y-%m-%d'),64.73333); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-11-19','%Y-%m-%d'),59.26667); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-11-20','%Y-%m-%d'),57.66667); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-11-21','%Y-%m-%d'),57.00000); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-11-22','%Y-%m-%d'),59.00000); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-11-23','%Y-%m-%d'),56.80000); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-11-24','%Y-%m-%d'),58.60000); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-11-25','%Y-%m-%d'),57.80000); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-11-26','%Y-%m-%d'),57.13333); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-11-27','%Y-%m-%d'),53.00000); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-11-28','%Y-%m-%d'),58.80000); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-11-29','%Y-%m-%d'),56.80000); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-11-30','%Y-%m-%d'),58.93333); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-12-01','%Y-%m-%d'),60.40000); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-12-02','%Y-%m-%d'),59.60000); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-12-03','%Y-%m-%d'),58.53333); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-12-04','%Y-%m-%d'),77.60000); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-12-05','%Y-%m-%d'),56.53333); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-12-06','%Y-%m-%d'),55.93333); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-12-07','%Y-%m-%d'),57.13333); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-12-08','%Y-%m-%d'),57.20000); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-12-09','%Y-%m-%d'),71.86667); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-12-10','%Y-%m-%d'),62.53333); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-12-11','%Y-%m-%d'),59.93333); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-12-12','%Y-%m-%d'),59.13333); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-12-13','%Y-%m-%d'),62.73333); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-12-14','%Y-%m-%d'),59.66667); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-12-15','%Y-%m-%d'),59.86667); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-12-16','%Y-%m-%d'),62.00000); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-12-17','%Y-%m-%d'),66.73333); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-12-18','%Y-%m-%d'),59.46667); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-12-19','%Y-%m-%d'),60.66667); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-12-20','%Y-%m-%d'),57.26667); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-12-21','%Y-%m-%d'),60.86667); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-12-22','%Y-%m-%d'),59.86667); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-12-23','%Y-%m-%d'),61.13333); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-12-24','%Y-%m-%d'),57.93333); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-12-25','%Y-%m-%d'),52.73333); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-07-09','%Y-%m-%d'),70.77980); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-07-10','%Y-%m-%d'),70.40000); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-07-11','%Y-%m-%d'),60.00000); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-07-12','%Y-%m-%d'),58.40000); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-07-13','%Y-%m-%d'),58.80000); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-07-14','%Y-%m-%d'),58.73333); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-07-15','%Y-%m-%d'),68.86667); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-07-16','%Y-%m-%d'),84.00000); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-07-17','%Y-%m-%d'),61.13333); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-07-18','%Y-%m-%d'),64.40000); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-07-19','%Y-%m-%d'),59.60000); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-07-20','%Y-%m-%d'),77.00000); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-07-21','%Y-%m-%d'),60.53333); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-07-22','%Y-%m-%d'),65.33333); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-07-23','%Y-%m-%d'),68.06667); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-07-24','%Y-%m-%d'),58.53333); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-07-25','%Y-%m-%d'),56.86667); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-07-26','%Y-%m-%d'),58.73333); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-07-27','%Y-%m-%d'),59.06667); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-07-28','%Y-%m-%d'),59.73333); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-07-29','%Y-%m-%d'),58.46667); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-07-30','%Y-%m-%d'),59.40000); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-12-27','%Y-%m-%d'),59.06667); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-07-31','%Y-%m-%d'),57.93333); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-12-28','%Y-%m-%d'),305.60000); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-08-01','%Y-%m-%d'),59.93333); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-12-29','%Y-%m-%d'),62.26667); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-08-02','%Y-%m-%d'),61.26667); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-12-30','%Y-%m-%d'),60.53333); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-08-03','%Y-%m-%d'),59.06667); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-12-31','%Y-%m-%d'),60.66667); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-08-04','%Y-%m-%d'),83.00000); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2016-01-01','%Y-%m-%d'),55.00000); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-08-05','%Y-%m-%d'),59.80000); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2016-01-02','%Y-%m-%d'),61.26667); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-08-06','%Y-%m-%d'),58.53333); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2016-01-03','%Y-%m-%d'),61.20000); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-08-07','%Y-%m-%d'),59.13333); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2016-01-04','%Y-%m-%d'),62.46667); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-08-08','%Y-%m-%d'),57.33333); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2016-01-05','%Y-%m-%d'),61.40000); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-08-09','%Y-%m-%d'),58.66667); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2016-01-06','%Y-%m-%d'),61.13333); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-08-10','%Y-%m-%d'),59.06667); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2016-01-07','%Y-%m-%d'),62.46667); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-08-11','%Y-%m-%d'),58.80000); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2016-01-08','%Y-%m-%d'),100.66667); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-08-12','%Y-%m-%d'),57.20000); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2016-01-09','%Y-%m-%d'),62.60000); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-08-13','%Y-%m-%d'),61.60000); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2016-01-10','%Y-%m-%d'),66.00000); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-08-14','%Y-%m-%d'),58.66667); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2016-01-11','%Y-%m-%d'),61.20000); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-08-15','%Y-%m-%d'),59.66667); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2016-01-12','%Y-%m-%d'),60.46667); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-08-16','%Y-%m-%d'),61.40000); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2016-01-13','%Y-%m-%d'),61.46667); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-08-17','%Y-%m-%d'),59.06667); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2016-01-14','%Y-%m-%d'),60.93333); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-08-18','%Y-%m-%d'),59.60000); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2016-01-15','%Y-%m-%d'),61.26667); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-08-19','%Y-%m-%d'),59.60000); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2016-01-16','%Y-%m-%d'),61.53333); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-08-20','%Y-%m-%d'),60.33333); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2016-01-17','%Y-%m-%d'),70.93333); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-08-21','%Y-%m-%d'),63.80000); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2016-01-18','%Y-%m-%d'),61.46667); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-08-22','%Y-%m-%d'),58.53333); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2016-01-19','%Y-%m-%d'),61.33333); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-08-23','%Y-%m-%d'),59.00000); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2016-01-20','%Y-%m-%d'),61.00000); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-08-24','%Y-%m-%d'),59.66667); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2016-01-21','%Y-%m-%d'),61.86667); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-08-25','%Y-%m-%d'),63.06667); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2016-01-22','%Y-%m-%d'),60.93333); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-08-26','%Y-%m-%d'),61.33333); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2016-01-23','%Y-%m-%d'),61.26667); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-08-27','%Y-%m-%d'),60.73333); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2016-01-24','%Y-%m-%d'),60.80000); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-08-28','%Y-%m-%d'),57.13333); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2016-01-25','%Y-%m-%d'),61.13333); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-08-29','%Y-%m-%d'),59.13333); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2016-01-26','%Y-%m-%d'),61.86667); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-08-30','%Y-%m-%d'),57.13333); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2016-01-27','%Y-%m-%d'),61.93333); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-08-31','%Y-%m-%d'),59.86667); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2016-01-28','%Y-%m-%d'),61.33333); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-09-01','%Y-%m-%d'),58.26667); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2016-01-29','%Y-%m-%d'),61.06667); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-09-02','%Y-%m-%d'),61.46667); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2016-01-30','%Y-%m-%d'),61.46667); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-09-03','%Y-%m-%d'),59.60000); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2016-01-31','%Y-%m-%d'),59.26667); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-09-04','%Y-%m-%d'),59.53333); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2016-02-01','%Y-%m-%d'),60.86667); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-09-05','%Y-%m-%d'),59.93333); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2016-02-02','%Y-%m-%d'),60.86667); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-09-06','%Y-%m-%d'),61.66667); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2016-02-03','%Y-%m-%d'),60.00000); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-09-07','%Y-%m-%d'),59.20000); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2016-02-04','%Y-%m-%d'),61.06667); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-09-08','%Y-%m-%d'),61.73333); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2016-02-05','%Y-%m-%d'),60.80000); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-09-09','%Y-%m-%d'),61.60000); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2016-02-06','%Y-%m-%d'),60.46667); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-09-10','%Y-%m-%d'),60.26667); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2016-02-07','%Y-%m-%d'),60.66667); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-09-11','%Y-%m-%d'),58.00000); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2016-02-08','%Y-%m-%d'),61.00000); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-09-12','%Y-%m-%d'),58.60000); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2016-02-09','%Y-%m-%d'),61.26667); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-09-13','%Y-%m-%d'),58.53333); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2016-02-10','%Y-%m-%d'),60.60000); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-09-14','%Y-%m-%d'),60.66667); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2016-02-11','%Y-%m-%d'),60.13333); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-09-15','%Y-%m-%d'),62.06667); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2016-02-12','%Y-%m-%d'),59.93333); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2015-09-16','%Y-%m-%d'),65.60000); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2016-02-13','%Y-%m-%d'),61.60000); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2016-02-14','%Y-%m-%d'),69.33333); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2016-02-15','%Y-%m-%d'),59.80000); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2016-02-16','%Y-%m-%d'),59.80000); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2016-02-17','%Y-%m-%d'),60.46667); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2016-02-18','%Y-%m-%d'),61.26667); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2016-02-19','%Y-%m-%d'),62.33333); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2016-02-20','%Y-%m-%d'),60.93333); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2016-02-21','%Y-%m-%d'),59.73333); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2016-02-22','%Y-%m-%d'),61.40000); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2016-02-23','%Y-%m-%d'),60.93333); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2016-02-24','%Y-%m-%d'),64.13333); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2016-02-25','%Y-%m-%d'),61.53333); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2016-02-26','%Y-%m-%d'),59.06667); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2016-02-27','%Y-%m-%d'),61.60000); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2016-02-28','%Y-%m-%d'),60.86667); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2016-02-29','%Y-%m-%d'),61.00000); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2016-03-01','%Y-%m-%d'),61.86667); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2016-03-02','%Y-%m-%d'),61.66667); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2016-03-03','%Y-%m-%d'),60.73333); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2016-03-04','%Y-%m-%d'),61.26667); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2016-03-05','%Y-%m-%d'),61.60000); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2016-03-06','%Y-%m-%d'),61.33333); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2016-03-07','%Y-%m-%d'),61.86667); +INSERT INTO demo_util_chart (TRAFFIC_DATE,UTIL_PERC ) VALUES (str_to_date('2016-03-08','%Y-%m-%d'),62.00000); + +commit; diff --git a/ecomp-sdk/epsdk-app-common/src/main/java/org/onap/portalapp/controller/sample/BroadcastListController.java b/ecomp-sdk/epsdk-app-common/src/main/java/org/onap/portalapp/controller/sample/BroadcastListController.java index fa1bcbeb..aeeaca56 100644 --- a/ecomp-sdk/epsdk-app-common/src/main/java/org/onap/portalapp/controller/sample/BroadcastListController.java +++ b/ecomp-sdk/epsdk-app-common/src/main/java/org/onap/portalapp/controller/sample/BroadcastListController.java @@ -47,6 +47,7 @@ import javax.servlet.http.HttpServletResponse; import org.json.JSONObject; import org.onap.portalsdk.core.controller.RestrictedBaseController; import org.onap.portalsdk.core.domain.BroadcastMessage; +import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate; import org.onap.portalsdk.core.service.BroadcastService; import org.onap.portalsdk.core.web.support.JsonMessage; import org.springframework.beans.factory.annotation.Autowired; @@ -62,6 +63,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; @Controller @RequestMapping("/") public class BroadcastListController extends RestrictedBaseController { + private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(BroadcastListController.class); @Autowired private BroadcastService broadcastService; @@ -86,7 +88,7 @@ public class BroadcastListController extends RestrictedBaseController { JSONObject j = new JSONObject(msg); response.getWriter().write(j.toString()); } catch (Exception e) { - e.printStackTrace(); + logger.error(EELFLoggerDelegate.errorLogger, "getBroadcast() failed", e); } } @@ -120,6 +122,7 @@ public class BroadcastListController extends RestrictedBaseController { request.setCharacterEncoding("UTF-8"); PrintWriter out = response.getWriter(); out.write(e.getMessage()); + logger.error(EELFLoggerDelegate.errorLogger, "remove() failed", e); return null; } @@ -154,6 +157,7 @@ public class BroadcastListController extends RestrictedBaseController { request.setCharacterEncoding("UTF-8"); PrintWriter out = response.getWriter(); out.write(e.getMessage()); + logger.error(EELFLoggerDelegate.errorLogger, "toggleActive() failed", e); return null; } diff --git a/ecomp-sdk/epsdk-app-common/src/main/java/org/onap/portalapp/util/SecurityXssValidator.java b/ecomp-sdk/epsdk-app-common/src/main/java/org/onap/portalapp/util/SecurityXssValidator.java index 3d2f741c..b51cb8db 100644 --- a/ecomp-sdk/epsdk-app-common/src/main/java/org/onap/portalapp/util/SecurityXssValidator.java +++ b/ecomp-sdk/epsdk-app-common/src/main/java/org/onap/portalapp/util/SecurityXssValidator.java @@ -43,6 +43,7 @@ import java.util.concurrent.locks.Lock; import java.util.concurrent.locks.ReentrantLock; import java.util.regex.Pattern; +import org.apache.commons.lang.NotImplementedException; import org.apache.commons.lang.StringUtils; import org.apache.commons.lang3.StringEscapeUtils; import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate; @@ -55,80 +56,78 @@ import org.owasp.esapi.codecs.MySQLCodec.Mode; public class SecurityXssValidator { private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(SecurityXssValidator.class); - + private static final String MYSQL_DB = "mysql"; private static final String ORACLE_DB = "oracle"; - private static final String MARIA_DB ="mariadb"; - - + private static final String MARIA_DB = "mariadb"; + static SecurityXssValidator validator = null; private static Codec instance; private static final Lock lock = new ReentrantLock(); - + public static SecurityXssValidator getInstance() { - - if(validator == null) { + + if (validator == null) { lock.lock(); try { - if(validator == null) - validator = new SecurityXssValidator(); + if (validator == null) + validator = new SecurityXssValidator(); } finally { lock.unlock(); } } - + return validator; } - + private SecurityXssValidator() { // Avoid anything between script tags - XSS_INPUT_PATTERNS.add(Pattern.compile("<script>(.*?)</script>", Pattern.CASE_INSENSITIVE)); + XSS_INPUT_PATTERNS.add(Pattern.compile("<script>(.*?)</script>", Pattern.CASE_INSENSITIVE)); + + // avoid iframes + XSS_INPUT_PATTERNS.add(Pattern.compile("<iframe(.*?)>(.*?)</iframe>", Pattern.CASE_INSENSITIVE)); - // avoid iframes - XSS_INPUT_PATTERNS.add(Pattern.compile("<iframe(.*?)>(.*?)</iframe>", Pattern.CASE_INSENSITIVE)); + // Avoid anything in a src='...' type of expression + XSS_INPUT_PATTERNS.add(Pattern.compile("src[\r\n]*=[\r\n]*\\\'(.*?)\\\'", + Pattern.CASE_INSENSITIVE | Pattern.MULTILINE | Pattern.DOTALL)); - // Avoid anything in a src='...' type of expression - XSS_INPUT_PATTERNS.add(Pattern.compile("src[\r\n]*=[\r\n]*\\\'(.*?)\\\'", - Pattern.CASE_INSENSITIVE | Pattern.MULTILINE | Pattern.DOTALL)); + XSS_INPUT_PATTERNS.add(Pattern.compile("src[\r\n]*=[\r\n]*\\\"(.*?)\\\"", + Pattern.CASE_INSENSITIVE | Pattern.MULTILINE | Pattern.DOTALL)); - XSS_INPUT_PATTERNS.add(Pattern.compile("src[\r\n]*=[\r\n]*\\\"(.*?)\\\"", - Pattern.CASE_INSENSITIVE | Pattern.MULTILINE | Pattern.DOTALL)); + XSS_INPUT_PATTERNS.add(Pattern.compile("src[\r\n]*=[\r\n]*([^>]+)", + Pattern.CASE_INSENSITIVE | Pattern.MULTILINE | Pattern.DOTALL)); - XSS_INPUT_PATTERNS.add(Pattern.compile("src[\r\n]*=[\r\n]*([^>]+)", - Pattern.CASE_INSENSITIVE | Pattern.MULTILINE | Pattern.DOTALL)); + // Remove any lonesome </script> tag + XSS_INPUT_PATTERNS.add(Pattern.compile("</script>", Pattern.CASE_INSENSITIVE)); - // Remove any lonesome </script> tag - XSS_INPUT_PATTERNS.add(Pattern.compile("</script>", Pattern.CASE_INSENSITIVE)); + XSS_INPUT_PATTERNS.add(Pattern.compile(".*(<script>|</script>).*", Pattern.CASE_INSENSITIVE)); - // Remove any lonesome <script ...> tag - XSS_INPUT_PATTERNS - .add(Pattern.compile("<script(.*?)>", Pattern.CASE_INSENSITIVE | Pattern.MULTILINE | Pattern.DOTALL)); + XSS_INPUT_PATTERNS.add(Pattern.compile(".*(<iframe>|</iframe>).*", Pattern.CASE_INSENSITIVE)); - // Avoid eval(...) expressions - XSS_INPUT_PATTERNS - .add(Pattern.compile("eval\\((.*?)\\)", Pattern.CASE_INSENSITIVE | Pattern.MULTILINE | Pattern.DOTALL)); + // Remove any lonesome <script ...> tag + XSS_INPUT_PATTERNS + .add(Pattern.compile("<script(.*?)>", Pattern.CASE_INSENSITIVE | Pattern.MULTILINE | Pattern.DOTALL)); - // Avoid expression(...) expressions - XSS_INPUT_PATTERNS.add(Pattern.compile("expression\\((.*?)\\)", - Pattern.CASE_INSENSITIVE | Pattern.MULTILINE | Pattern.DOTALL)); + // Avoid eval(...) expressions + XSS_INPUT_PATTERNS + .add(Pattern.compile("eval\\((.*?)\\)", Pattern.CASE_INSENSITIVE | Pattern.MULTILINE | Pattern.DOTALL)); - // Avoid javascript:... expressions - XSS_INPUT_PATTERNS.add(Pattern.compile("javascript:", Pattern.CASE_INSENSITIVE)); + // Avoid expression(...) expressions + XSS_INPUT_PATTERNS.add(Pattern.compile("expression\\((.*?)\\)", + Pattern.CASE_INSENSITIVE | Pattern.MULTILINE | Pattern.DOTALL)); - // Avoid vbscript:... expressions - XSS_INPUT_PATTERNS.add(Pattern.compile("vbscript:", Pattern.CASE_INSENSITIVE)); + // Avoid javascript:... expressions + XSS_INPUT_PATTERNS.add(Pattern.compile(".*(javascript:|vbscript:).*", Pattern.CASE_INSENSITIVE)); - // Avoid onload= expressions - XSS_INPUT_PATTERNS - .add(Pattern.compile("onload(.*?)=", Pattern.CASE_INSENSITIVE | Pattern.MULTILINE | Pattern.DOTALL)); + // Avoid onload= expressions + XSS_INPUT_PATTERNS.add( + Pattern.compile(".*(onload(.*?)=).*", Pattern.CASE_INSENSITIVE | Pattern.MULTILINE | Pattern.DOTALL)); } - - private List<Pattern> XSS_INPUT_PATTERNS = new ArrayList<Pattern>(); - + + private List<Pattern> XSS_INPUT_PATTERNS = new ArrayList<Pattern>(); /** - * * This method takes a string and strips out any potential script - * injections. + * * This method takes a string and strips out any potential script injections. * * @param value * @return String - the new "sanitized" string. @@ -157,35 +156,56 @@ public class SecurityXssValidator { return value; } - - public Codec getCodec() { + + public Boolean denyXSS(String value) { + Boolean flag = Boolean.FALSE; try { - if (null == instance) { - if (StringUtils.containsIgnoreCase(SystemProperties.getProperty(SystemProperties.DB_DRIVER), - MYSQL_DB)|| StringUtils.containsIgnoreCase(SystemProperties.getProperty(SystemProperties.DB_DRIVER), - MARIA_DB)) { - instance = new MySQLCodec(Mode.STANDARD); - - } else if (StringUtils.containsIgnoreCase(SystemProperties.getProperty(SystemProperties.DB_DRIVER), - ORACLE_DB)) { - instance = new OracleCodec(); + if (StringUtils.isNotBlank(value)) { + value = ESAPI.encoder().canonicalize(value); + for (Pattern xssInputPattern : XSS_INPUT_PATTERNS) { + if (xssInputPattern.matcher(value).matches()) { + flag = Boolean.TRUE; + break; } + } - + } + + } catch (Exception e) { + logger.error(EELFLoggerDelegate.errorLogger, "denyXSS() failed", e); + } + + return flag; + } + + public Codec getCodec() { + try { + if (null == instance) { + if (StringUtils.containsIgnoreCase(SystemProperties.getProperty(SystemProperties.DB_DRIVER), MYSQL_DB) + || StringUtils.containsIgnoreCase(SystemProperties.getProperty(SystemProperties.DB_DRIVER), + MARIA_DB)) { + instance = new MySQLCodec(Mode.STANDARD); + + } else if (StringUtils.containsIgnoreCase(SystemProperties.getProperty(SystemProperties.DB_DRIVER), + ORACLE_DB)) { + instance = new OracleCodec(); + } else { + throw new NotImplementedException("Handling for data base \"" + + SystemProperties.getProperty(SystemProperties.DB_DRIVER) + "\" not yet implemented."); + } + } } catch (Exception ex) { - System.out.println("Could not strip XSS from value = " + " | ex = " + ex.getMessage()); + logger.error(EELFLoggerDelegate.errorLogger, "getCodec() failed", ex); } return instance; } - public List<Pattern> getXSS_INPUT_PATTERNS() { return XSS_INPUT_PATTERNS; } - public void setXSS_INPUT_PATTERNS(List<Pattern> xSS_INPUT_PATTERNS) { XSS_INPUT_PATTERNS = xSS_INPUT_PATTERNS; } diff --git a/ecomp-sdk/epsdk-app-os/db-scripts/EcompSdkDDLMySql_2_1_OS.sql b/ecomp-sdk/epsdk-app-os/db-scripts/EcompSdkDDLMySql_2_1_OS.sql new file mode 100644 index 00000000..abc21a3a --- /dev/null +++ b/ecomp-sdk/epsdk-app-os/db-scripts/EcompSdkDDLMySql_2_1_OS.sql @@ -0,0 +1,12 @@ +-- --------------------------------------------------------------------------------------------------------------- +-- This script adds tables for the OPEN-SOURCE version 2.1.0 of the ECOMP SDK application database. +-- The DDL COMMON script must be executed first! +-- --------------------------------------------------------------------------------------------------------------- + +SET FOREIGN_KEY_CHECKS=1; + +USE ecomp_sdk; + +-- No additional tables required at this time + +commit; diff --git a/ecomp-sdk/epsdk-app-os/db-scripts/EcompSdkDMLMySql_2_1_OS.sql b/ecomp-sdk/epsdk-app-os/db-scripts/EcompSdkDMLMySql_2_1_OS.sql new file mode 100644 index 00000000..cb4a3085 --- /dev/null +++ b/ecomp-sdk/epsdk-app-os/db-scripts/EcompSdkDMLMySql_2_1_OS.sql @@ -0,0 +1,39 @@ +-- --------------------------------------------------------------------------------------------------------------- +-- This script populates tables in the OPEN-SOURCE version 2.1.0 of the ECOMP SDK application database. +-- The DML COMMON script must be executed first! +-- --------------------------------------------------------------------------------------------------------------- + +SET FOREIGN_KEY_CHECKS=1; +USE ecomp_sdk; + +-- fn_menu +INSERT INTO fn_menu (MENU_ID, LABEL, PARENT_ID, SORT_ORDER, ACTION, FUNCTION_CD, ACTIVE_YN, SERVLET, QUERY_STRING, EXTERNAL_URL, TARGET, MENU_SET_CD, SEPARATOR_YN, IMAGE_SRC) VALUES (1, 'Root', NULL, 10, NULL, 'menu_home', 'N', NULL, NULL, NULL, NULL, 'APP', 'N', NULL); -- we need even though it's inactive +INSERT INTO fn_menu (MENU_ID, LABEL, PARENT_ID, SORT_ORDER, ACTION, FUNCTION_CD, ACTIVE_YN, SERVLET, QUERY_STRING, EXTERNAL_URL, TARGET, MENU_SET_CD, SEPARATOR_YN, IMAGE_SRC) VALUES (5000, 'Sample Pages', 1, 30, 'sample.htm', 'menu_sample', 'Y', NULL, NULL, NULL, NULL, 'APP', 'N', 'icon-documents-book'); +INSERT INTO fn_menu (MENU_ID, LABEL, PARENT_ID, SORT_ORDER, ACTION, FUNCTION_CD, ACTIVE_YN, SERVLET, QUERY_STRING, EXTERNAL_URL, TARGET, MENU_SET_CD, SEPARATOR_YN, IMAGE_SRC) VALUES (2, 'Home', 1, 10, 'welcome.htm', 'menu_home', 'Y', NULL, NULL, NULL, NULL, 'APP', 'N', 'icon-building-home'); +INSERT INTO fn_menu (MENU_ID, LABEL, PARENT_ID, SORT_ORDER, ACTION, FUNCTION_CD, ACTIVE_YN, SERVLET, QUERY_STRING, EXTERNAL_URL, TARGET, MENU_SET_CD, SEPARATOR_YN, IMAGE_SRC) VALUES (8, 'Reports', 1, 40, 'report.htm', 'menu_reports', 'Y', NULL, NULL, NULL, NULL, 'APP', 'N', 'icon-misc-piechart'); +INSERT INTO fn_menu (MENU_ID, LABEL, PARENT_ID, SORT_ORDER, ACTION, FUNCTION_CD, ACTIVE_YN, SERVLET, QUERY_STRING, EXTERNAL_URL, TARGET, MENU_SET_CD, SEPARATOR_YN, IMAGE_SRC) VALUES (9, 'Profile', 1, 90, 'userProfile', 'menu_profile', 'Y', NULL, NULL, NULL, NULL, 'APP', 'N', 'icon-people-oneperson'); +INSERT INTO fn_menu (MENU_ID, LABEL, PARENT_ID, SORT_ORDER, ACTION, FUNCTION_CD, ACTIVE_YN, SERVLET, QUERY_STRING, EXTERNAL_URL, TARGET, MENU_SET_CD, SEPARATOR_YN, IMAGE_SRC) VALUES (10, 'Admin', 1, 110, 'role_list.htm', 'menu_admin', 'Y', NULL, NULL, NULL, NULL, 'APP', 'N', 'icon-content-star'); +INSERT INTO fn_menu (MENU_ID, LABEL, PARENT_ID, SORT_ORDER, ACTION, FUNCTION_CD, ACTIVE_YN, SERVLET, QUERY_STRING, EXTERNAL_URL, TARGET, MENU_SET_CD, SEPARATOR_YN, IMAGE_SRC) VALUES (84, 'All Reports', 8, 50, 'report', 'menu_reports', 'Y', NULL, NULL, NULL, NULL, 'APP', 'N', '/static/fusion/images/reports.png'); +INSERT INTO fn_menu (MENU_ID, LABEL, PARENT_ID, SORT_ORDER, ACTION, FUNCTION_CD, ACTIVE_YN, SERVLET, QUERY_STRING, EXTERNAL_URL, TARGET, MENU_SET_CD, SEPARATOR_YN, IMAGE_SRC) values (87, 'Create Reports', 8, 120, 'report#/report_wizard', 'menu_reports', 'Y', NULL, 'r_action=report.create', NULL, NULL, 'APP', 'N', NULL); +INSERT INTO fn_menu (MENU_ID, LABEL, PARENT_ID, SORT_ORDER, ACTION, FUNCTION_CD, ACTIVE_YN, SERVLET, QUERY_STRING, EXTERNAL_URL, TARGET, MENU_SET_CD, SEPARATOR_YN, IMAGE_SRC) values (88, 'Sample Dashboard', 8, 130, 'report_dashboard', 'menu_reports', 'N', NULL, NULL, NULL, NULL, 'APP', 'N', NULL); +INSERT INTO fn_menu (MENU_ID, LABEL, PARENT_ID, SORT_ORDER, ACTION, FUNCTION_CD, ACTIVE_YN, SERVLET, QUERY_STRING, EXTERNAL_URL, TARGET, MENU_SET_CD, SEPARATOR_YN, IMAGE_SRC) VALUES (89, 'Import', 8, 140, 'report#/report_import', 'menu_reports', 'N', null, null, null, null, 'APP', 'N', null); +INSERT INTO fn_menu (MENU_ID, LABEL, PARENT_ID, SORT_ORDER, ACTION, FUNCTION_CD, ACTIVE_YN, SERVLET, QUERY_STRING, EXTERNAL_URL, TARGET, MENU_SET_CD, SEPARATOR_YN, IMAGE_SRC) VALUES (94, 'Self', 9, 40,'userProfile#/self_profile', 'menu_profile', 'Y', NULL, NULL, NULL, NULL, 'APP', 'N', '/static/fusion/images/profile.png'); +INSERT INTO fn_menu (MENU_ID, LABEL, PARENT_ID, SORT_ORDER, ACTION, FUNCTION_CD, ACTIVE_YN, SERVLET, QUERY_STRING, EXTERNAL_URL, TARGET, MENU_SET_CD, SEPARATOR_YN, IMAGE_SRC) VALUES (101, 'Roles', 10, 20, 'admin#/admin', 'menu_admin', 'Y', NULL, NULL, NULL, NULL, 'APP', 'N', '/static/fusion/images/users.png'); +INSERT INTO fn_menu (MENU_ID, LABEL, PARENT_ID, SORT_ORDER, ACTION, FUNCTION_CD, ACTIVE_YN, SERVLET, QUERY_STRING, EXTERNAL_URL, TARGET, MENU_SET_CD, SEPARATOR_YN, IMAGE_SRC) VALUES (102, 'Role Functions', 10, 30, 'admin#/role_function_list', 'menu_admin', 'Y', NULL, NULL, NULL, NULL, 'APP', 'N', NULL); +INSERT INTO fn_menu (MENU_ID, LABEL, PARENT_ID, SORT_ORDER, ACTION, FUNCTION_CD, ACTIVE_YN, SERVLET, QUERY_STRING, EXTERNAL_URL, TARGET, MENU_SET_CD, SEPARATOR_YN, IMAGE_SRC) VALUES (105, 'Cache Admin', 10, 40, 'admin#/jcs_admin', 'menu_admin', 'Y', NULL, NULL, NULL, NULL, 'APP', 'N', '/static/fusion/images/cache.png'); +INSERT INTO fn_menu (MENU_ID, LABEL, PARENT_ID, SORT_ORDER, ACTION, FUNCTION_CD, ACTIVE_YN, SERVLET, QUERY_STRING, EXTERNAL_URL, TARGET, MENU_SET_CD, SEPARATOR_YN, IMAGE_SRC) VALUES (108, 'Usage', 10, 80, 'admin#/usage_list', 'menu_admin', 'Y', NULL, NULL, NULL, NULL, 'APP', 'N', '/static/fusion/images/users.png'); +INSERT INTO fn_menu (MENU_ID, LABEL, PARENT_ID, SORT_ORDER, ACTION, FUNCTION_CD, ACTIVE_YN, SERVLET, QUERY_STRING, EXTERNAL_URL, TARGET, MENU_SET_CD, SEPARATOR_YN, IMAGE_SRC) VALUES (121, 'Collaboration', 5000, 100, 'samplePage#/collaborate_list', 'menu_sample', 'Y', NULL, NULL, NULL, NULL, 'APP', 'N', '/static/fusion/images/bubble.png'); +INSERT INTO fn_menu (MENU_ID, LABEL, PARENT_ID, SORT_ORDER, ACTION, FUNCTION_CD, ACTIVE_YN, SERVLET, QUERY_STRING, EXTERNAL_URL, TARGET, MENU_SET_CD, SEPARATOR_YN, IMAGE_SRC) VALUES (930, 'Search', 9, 15, 'userProfile', 'menu_admin', 'Y', NULL, NULL, NULL, NULL, 'APP', 'N', '/static/fusion/images/search_profile.png'); +INSERT INTO fn_menu (MENU_ID, LABEL, PARENT_ID, SORT_ORDER, ACTION, FUNCTION_CD, ACTIVE_YN, SERVLET, QUERY_STRING, EXTERNAL_URL, TARGET, MENU_SET_CD, SEPARATOR_YN, IMAGE_SRC) VALUES (150022, 'Menus', 10, 60, 'admin#/admin_menu_edit', 'menu_admin', 'Y', NULL, NULL, NULL, NULL, 'APP', 'N', NULL); +INSERT INTO fn_menu (MENU_ID, LABEL, PARENT_ID, SORT_ORDER, ACTION, FUNCTION_CD, ACTIVE_YN, SERVLET, QUERY_STRING, EXTERNAL_URL, TARGET, MENU_SET_CD, SEPARATOR_YN, IMAGE_SRC) VALUES (150038,'Notebook',5000,135,'samplePage#/notebook','menu_sample','Y',NULL,NULL,NULL,NULL,'APP','N',NULL); + +-- fn_user +Insert into fn_user (USER_ID,ORG_ID,MANAGER_ID,FIRST_NAME,MIDDLE_NAME,LAST_NAME,PHONE,FAX,CELLULAR,EMAIL,ADDRESS_ID,ALERT_METHOD_CD,HRID,ORG_USER_ID,ORG_CODE,LOGIN_ID,LOGIN_PWD,LAST_LOGIN_DATE,ACTIVE_YN,CREATED_ID,CREATED_DATE,MODIFIED_ID,MODIFIED_DATE,IS_INTERNAL_YN,ADDRESS_LINE_1,ADDRESS_LINE_2,CITY,STATE_CD,ZIP_CODE,COUNTRY_CD,LOCATION_CLLI,ORG_MANAGER_USERID,COMPANY,DEPARTMENT_NAME,JOB_TITLE,TIMEZONE,DEPARTMENT,BUSINESS_UNIT,BUSINESS_UNIT_NAME,COST_CENTER,FIN_LOC_CODE,SILO_STATUS) values (1,null,null,'Demo',null,'User',null,null,null,'demo@email.com',null,null,null,'demo',null,'demo','demo',str_to_date('24-OCT-16','%d-%M-%Y'),'Y',null,str_to_date('17-OCT-16','%d-%M-%Y'),1,str_to_date('24-OCT-16','%d-%M-%Y'),'N',null,null,null,'NJ',null,'US',null,null,null,null,null,10,null,null,null,null,null,null); + +-- fn_app +Insert into fn_app (APP_ID,APP_NAME,APP_IMAGE_URL,APP_DESCRIPTION,APP_NOTES,APP_URL,APP_ALTERNATE_URL,APP_REST_ENDPOINT,ML_APP_NAME,ML_APP_ADMIN_ID,MOTS_ID,APP_PASSWORD,OPEN,ENABLED,THUMBNAIL,APP_USERNAME,UEB_KEY,UEB_SECRET,UEB_TOPIC_NAME) VALUES (1,'Default',null,'Some Default Description','Some Default Note',null,null,null,'ECPP','?','1','okYTaDrhzibcbGVq5mjkVQ==','N','N',null,'Default',null,null,'ECOMP-PORTAL-INBOX'); + +-- fn_user_role +Insert into fn_user_role (USER_ID,ROLE_ID,PRIORITY,APP_ID) values (1,1,null,1); + +commit; diff --git a/ecomp-sdk/epsdk-app-os/db-scripts/readme b/ecomp-sdk/epsdk-app-os/db-scripts/readme new file mode 100644 index 00000000..47f2fe1a --- /dev/null +++ b/ecomp-sdk/epsdk-app-os/db-scripts/readme @@ -0,0 +1,34 @@ +* This Readme file contains a description of open source scripts located in + + epsdk-app-os / db-scripts / + +*************************************************************************************************************************************** + +Directions: + +DDL +For ONAP Amsterdam instance run EcompSdkDDLMySql_1710_Common.sql add script EcompSdkDDLMySql_1710_OS.sql. + +EcompSdkDDLMySql_1710_Common.sql - this is the DDL entries that both Opensource and AT&T have in common +EcompSdkDDLMySql_1710_OS.sql - this is the specific DDL entries that only OS needs, empty placeholder + +For ONAP Beijing instance run EcompSdkDDLMySql_2_1_Common.sql add script EcompSdkDDLMySql_2_1_OS.sql. + +EcompSdkDDLMySql_2_1_Common.sql - this is the DDL entries that both Opensource and AT&T have in common +EcompSdkDDLMySql_2_1_OS.sql - this is the specific DDL entries that only OS needs, empty placeholder + +DML +For an ONAP Amsterdam instance run script EcompSdkDMLMySql_1710_Common.sql and script EcompSdkDMLMySql_1710_OS.sql. + +EcompSdkDMLMySql_1707_Common.sql - common DML entries +EcompSdkDMLMySql_1707_OS.sql - DML entries for Opensource needs + +For an ONAP Beijing instance run script EcompSdkDMLMySql_2_1_Common.sql and script EcompSdkDMLMySql_2_1_OS.sql. + +EcompSdkDMLMySql_2_1_Common.sql - common DML entries +EcompSdkDMLMySql_2_1_OS.sql - DML entries for Opensource needs + +Our Existing Partner Apps can call the following scripts to upgrade from earlier version + +EcompSdkMySql_Upgrade_1707_to_1710_Common.sql +EcompSdkMySql_Rollback_1710_to_1707_Common.sql diff --git a/ecomp-sdk/epsdk-app-os/db-scripts/readme.txt b/ecomp-sdk/epsdk-app-os/db-scripts/readme.txt deleted file mode 100644 index 093f77cc..00000000 --- a/ecomp-sdk/epsdk-app-os/db-scripts/readme.txt +++ /dev/null @@ -1,24 +0,0 @@ -This Readme file contains a description of open source scripts located in - - epsdk-app-os / db-scripts / - -*************************************************************************************************************************************** - -Directions: - -DDL -For ONAP instance run EcompSdkDDLMySql_1710_Common.sql add script EcompSdkDDLMySql_1710_OS.sql. - -EcompSdkDDLMySql_1710_Common.sql - this is the DDL entries that both Opensource and AT&T have in common -EcompSdkDDLMySql_1710_OS.sql - this is the specific DDL entries that only OS needs - -DML -For an ONAP instance run script EcompSdkDMLMySql_1710_Common.sql and script EcompSdkDMLMySql_1710_OS.sql. - -EcompSdkDMLMySql_1707_Common.sql - common DML entries -EcompSdkDMLMySql_1707_OS.sql - DML entries for Opensource needs - -Our Existing Partner Apps can call the following scripts to upgrade from earlier version - -EcompSdkMySql_Upgrade_1707_to_1710_Common.sql -EcompSdkMySql_Rollback_1710_to_1707_Common.sql diff --git a/ecomp-sdk/epsdk-app-os/pom.xml b/ecomp-sdk/epsdk-app-os/pom.xml index dc8e9d94..db0a455f 100644 --- a/ecomp-sdk/epsdk-app-os/pom.xml +++ b/ecomp-sdk/epsdk-app-os/pom.xml @@ -1,9 +1,11 @@ <?xml version="1.0"?> -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> - <!-- This is the Maven project object model (POM) file for the open-source SDK web app. - This is NOT the Portal - but it is developed and supported by the Portal team. --> + <!-- This is the Maven project object model (POM) file for the open-source + SDK web app. This is NOT the Portal - but it is developed and supported by + the Portal team. --> <parent> <groupId>org.onap.portal.sdk</groupId> @@ -11,9 +13,9 @@ <version>2.1.0-SNAPSHOT</version> </parent> - <!-- GroupId is inherited from parent --> + <!-- GroupId is inherited from parent --> <artifactId>epsdk-app-os</artifactId> - <!-- Version is inherited from parent --> + <!-- Version is inherited from parent --> <packaging>war</packaging> <name>ONAP Portal SDK Webapp for OpenSource</name> <description>ONAP Portal SDK Web Application for public release</description> @@ -25,6 +27,9 @@ <skipassembly>true</skipassembly> <!-- Tests usually require some setup that maven cannot do, so skip. --> <skiptests>true</skiptests> + <!-- Version number gets stored only here --> + <tomcat.download.path>http://archive.apache.org/dist/tomcat/tomcat-8/v8.0.37/bin</tomcat.download.path> + <tomcat.download.name>apache-tomcat-8.0.37</tomcat.download.name> </properties> <!-- repositories are inherited from parent --> @@ -39,7 +44,7 @@ <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> - <version>2.19.1</version> + <!-- parent specifies the <version>2.19.1</version> --> <configuration> <skipTests>${skiptests}</skipTests> <includes> @@ -104,15 +109,48 @@ <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-deploy-plugin</artifactId> - <version>2.8</version> + <!-- parent specifies the<version>2.8</version> --> <configuration> <skip>true</skip> </configuration> </plugin> + <plugin> + <groupId>io.fabric8</groupId> + <artifactId>docker-maven-plugin</artifactId> + <version>0.22.0</version> + <configuration> + <verbose>true</verbose> + <images> + <image> + <name>onap/portal-sdk:${project.version}</name> + <build> + <from>frolvlad/alpine-oraclejdk8:slim</from> + <assembly> + <descriptorRef>artifact</descriptorRef> + </assembly> + <runCmds> + <!-- must be all on one line; use CDATA to turn off the Eclipse formatter --> + <run><![CDATA[wget -q ${tomcat.download.path}/${tomcat.download.name}.tar.gz]]></run> + <run>tar -xzf ${tomcat.download.name}.tar.gz</run> + <run>rm -f ${tomcat.download.name}.tar.gz</run> + <run>rm -fr ${tomcat.download.name}/webapps/[a-z]*</run> + <run>mkdir -p /opt</run> + <run>mv ${tomcat.download.name} /opt</run> + <run><![CDATA[mv /maven/*.war /opt/${tomcat.download.name}/webapps/ONAPPORTALSDK.war]]></run> + </runCmds> + <cmd> + <shell>/opt/${tomcat.download.name}/bin/catalina.sh run</shell> + </cmd> + </build> + </image> + </images> + </configuration> + </plugin> + </plugins> </build> - + <dependencies> <!-- SDK overlay war --> <dependency> diff --git a/ecomp-sdk/epsdk-app-os/src/main/java/org/onap/portalapp/filter/SecurityXssFilter.java b/ecomp-sdk/epsdk-app-os/src/main/java/org/onap/portalapp/filter/SecurityXssFilter.java index b3ebed73..71ab7359 100644 --- a/ecomp-sdk/epsdk-app-os/src/main/java/org/onap/portalapp/filter/SecurityXssFilter.java +++ b/ecomp-sdk/epsdk-app-os/src/main/java/org/onap/portalapp/filter/SecurityXssFilter.java @@ -39,92 +39,70 @@ package org.onap.portalapp.filter; import java.io.IOException; -import javax.servlet.Filter; +import java.io.UnsupportedEncodingException; + import javax.servlet.FilterChain; -import javax.servlet.FilterConfig; import javax.servlet.ServletException; -import javax.servlet.ServletRequest; -import javax.servlet.ServletResponse; import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletRequestWrapper; +import javax.servlet.http.HttpServletResponse; import org.apache.commons.lang.StringUtils; import org.onap.portalapp.util.SecurityXssValidator; -import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate; - -public class SecurityXssFilter implements Filter { - - private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(SecurityXssFilter.class); - - private SecurityXssValidator validator = SecurityXssValidator.getInstance(); - - class SecurityRequestWrapper extends HttpServletRequestWrapper { - - public SecurityRequestWrapper(HttpServletRequest servletRequest) { - super(servletRequest); - } +import org.springframework.web.filter.OncePerRequestFilter; +import org.springframework.web.util.ContentCachingRequestWrapper; +import org.springframework.web.util.ContentCachingResponseWrapper; +import org.springframework.web.util.WebUtils; - @Override - public String[] getParameterValues(String parameter) { - String[] values = super.getParameterValues(parameter); +public class SecurityXssFilter extends OncePerRequestFilter { - if (values == null) { - return null; - } - - int count = values.length; - String[] encodedValues = new String[count]; - for (int i = 0; i < count; i++) { - encodedValues[i] = stripXss(values[i]); - - } - - return encodedValues; - } + private static final String BAD_REQUEST = "BAD_REQUEST"; - private String stripXss(String value) { - - - return validator.stripXSS(value); - } + private SecurityXssValidator validator = SecurityXssValidator.getInstance(); - @Override - public String getParameter(String parameter) { - String value = super.getParameter(parameter); - if (StringUtils.isNotBlank(value)) { - value = stripXss(value); + private static String getRequestData(final HttpServletRequest request) throws UnsupportedEncodingException { + String payload = null; + ContentCachingRequestWrapper wrapper = WebUtils.getNativeRequest(request, ContentCachingRequestWrapper.class); + if (wrapper != null) { + byte[] buf = wrapper.getContentAsByteArray(); + if (buf.length > 0) { + payload = new String(buf, 0, buf.length, wrapper.getCharacterEncoding()); } - return value; } + return payload; + } - @Override - public String getHeader(String name) { - String value = super.getHeader(name); - if (StringUtils.isNotBlank(value)) { - value = stripXss(value); + private static String getResponseData(final HttpServletResponse response) throws IOException { + String payload = null; + ContentCachingResponseWrapper wrapper = WebUtils.getNativeResponse(response, + ContentCachingResponseWrapper.class); + if (wrapper != null) { + byte[] buf = wrapper.getContentAsByteArray(); + if (buf.length > 0) { + payload = new String(buf, 0, buf.length, wrapper.getCharacterEncoding()); + wrapper.copyBodyToResponse(); } - return value; } - } - - @Override - public void init(FilterConfig filterConfig) throws ServletException { + return payload; } @Override - public void destroy() { - } - - @Override - public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) - throws IOException, ServletException { - - try { + protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) + throws ServletException, IOException { + + if (request.getMethod().equalsIgnoreCase("POST") || request.getMethod().equalsIgnoreCase("PUT")) { + + HttpServletRequest requestToCache = new ContentCachingRequestWrapper(request); + HttpServletResponse responseToCache = new ContentCachingResponseWrapper(response); + filterChain.doFilter(requestToCache, responseToCache); + String requestData = getRequestData(requestToCache); + String responseData = getResponseData(responseToCache); + if (StringUtils.isNotBlank(requestData) && validator.denyXSS(requestData)) { + throw new SecurityException(BAD_REQUEST); + } - chain.doFilter(new SecurityRequestWrapper((HttpServletRequest) request), response); - } catch (Exception e) { - logger.error(EELFLoggerDelegate.errorLogger, "doFilter() failed", e); + } else { + filterChain.doFilter(request, response); } - } + } } diff --git a/ecomp-sdk/epsdk-app-os/src/main/resources/key.properties b/ecomp-sdk/epsdk-app-os/src/main/resources/key.properties new file mode 100644 index 00000000..aa3355d1 --- /dev/null +++ b/ecomp-sdk/epsdk-app-os/src/main/resources/key.properties @@ -0,0 +1,41 @@ +### +# ============LICENSE_START========================================== +# ONAP Portal SDK +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +### + +# Properties read by the ECOMP Framework library (epsdk-fw) + +cipher.enc.key = AGLDdG4D04BKm2IxIWEr8o==
\ No newline at end of file diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/resources/ESAPI.properties b/ecomp-sdk/epsdk-app-overlay/src/main/resources/ESAPI.properties index 290dbff3..d06d602c 100644 --- a/ecomp-sdk/epsdk-app-overlay/src/main/resources/ESAPI.properties +++ b/ecomp-sdk/epsdk-app-overlay/src/main/resources/ESAPI.properties @@ -32,8 +32,6 @@ ESAPI.Encryptor=org.owasp.esapi.reference.crypto.JavaEncryptor ESAPI.Executor=org.owasp.esapi.reference.DefaultExecutor ESAPI.HTTPUtilities=org.owasp.esapi.reference.DefaultHTTPUtilities ESAPI.IntrusionDetector=org.owasp.esapi.reference.DefaultIntrusionDetector -# Log4JFactory Requires log4j.xml or log4j.properties in classpath -ESAPI.Logger=org.owasp.esapi.reference.Log4JLogFactory #ESAPI.Logger=org.owasp.esapi.reference.JavaLogFactory ESAPI.Randomizer=org.owasp.esapi.reference.DefaultRandomizer ESAPI.Validator=org.owasp.esapi.reference.DefaultValidator @@ -42,9 +40,9 @@ ESAPI.Validator=org.owasp.esapi.reference.DefaultValidator # ESAPI Authenticator # Authenticator.AllowedLoginAttempts=3 -Authenticator.MaxOldPasswordHashes=13 +#Authenticator.MaxOldPasswordHashes=13 Authenticator.UsernameParameterName=username -Authenticator.PasswordParameterName=password +#Authenticator.PasswordParameterName=password # RememberTokenDuration (in days) Authenticator.RememberTokenDuration=14 # Session Timeouts (in minutes) diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-view-models/ds2-admin/role-function.html b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-view-models/ds2-admin/role-function.html index cab8c682..55f2980b 100644 --- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-view-models/ds2-admin/role-function.html +++ b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-view-models/ds2-admin/role-function.html @@ -1,12 +1,13 @@ <div id="page-content"> <h1 class="heading-page" id="profileSearch">Role Function</h1> + <span class= "heading-small" ng-if="isAppCentralized=='true'"><b>Please go to portal to Manage Role Function.</b></span> <div ng-show="showLoader" class="span loader-container"> <i class="icon-primary-spinner" role="img" aria-label="Please wait while we load your content"></i> </div> <div ng-hide="showLoader"> <div class="row-nowrap"> - <div class="span12"> + <div class="span12" ng-if="isAppCentralized=='false'"> <div class="form-row"> <div class="field-group"> <button class="btn btn-alt btn-medium" type="button" @@ -38,20 +39,20 @@ <tr> <th b2b-table-header key="name">Name</th> <th b2b-table-header key="code">Code</th> - <th b2b-table-header sortable="false">Edit</th> - <th b2b-table-header sortable="false">Delete</th> + <th b2b-table-header sortable="false" ng-if="isAppCentralized=='false'">Edit</th> + <th b2b-table-header sortable="false" ng-if="isAppCentralized=='false'">Delete</th> </tr> </thead> <tbody b2b-table-row type="body" row-repeat="rowData in tableData"> <tr> <td b2b-table-body ng-bind="rowData['name']"></td> <td b2b-table-body ng-bind="rowData['code']"></td> - <td b2b-table-body> + <td b2b-table-body ng-if="isAppCentralized=='false'"> <div style="font-size: 20px;"> <a ng-click="saveRoleFuncPopUp(rowData);" class="icon-misc-pen"></a> </div> </td> - <td b2b-table-body> + <td b2b-table-body ng-if="isAppCentralized=='false'"> <div style="font-size: 20px;"> <a href="javascript:void(0)" ng-click="delRoleFuncConfirmPopUp(rowData);" diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-view-models/ds2-admin/role_list.html b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-view-models/ds2-admin/role_list.html index 5c407390..e325b8ab 100644 --- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-view-models/ds2-admin/role_list.html +++ b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-view-models/ds2-admin/role_list.html @@ -1,6 +1,7 @@ <div id="page-content"> <div> <h1 class="heading-page" id="Roles">Roles</h1> + <span class= "heading-small" ng-if="isAppCentralized=='true'"><b>Please go to portal to Manage Roles.</b></span> </div> <div ng-show="showLoader" class="span loader-container"> <i class="icon-primary-spinner" role="img" @@ -8,34 +9,35 @@ </div> <div ng-hide="showLoader"> <div> - <button type="submit" onClick="window.location='admin#/role/0';" class="btn btn-alt btn-small">Add New Role</button> + <button type="submit" ng-click="addRoleFuncPopUp(rowData);" class="btn btn-alt btn-small" ng-if="isAppCentralized=='false'">Add New Role</button> </div> - <h2 class="heading-small">Click on a Role to view its details.</h2> + <h2 class="heading-small" ng-if="isAppCentralized=='false'">Click on a Role to view its details.</h2> <table class="striped" ng-if="availableRoleFunctions" style="width: auto;"> <thead> <tr> <th>Name</th> <th>Priority</th> - <th>Edit</th> - <th>Active?</th> - <th>Delete?</th> + <th ng-if="isAppCentralized=='false'">Edit</th> + <th ng-if="isAppCentralized=='false'">Active?</th> + <th ng-if="isAppCentralized=='false'">Delete?</th> </tr> </thead> <tbody type="body" ng-repeat="availableRole in ociavailableRoles"> <tr> <td>{{ availableRole.name }}</td> <td>{{ availableRole.priority }}</td> - <td> + <div ng-if="isAppCentralized=='false'"> + <td ng-if="isAppCentralized=='false'"> <a href="admin#/role/{{availableRole.id}}" class="icon-misc-pen"></a> </td> - <td> - <div > + <td ng-if="isAppCentralized=='false'"> + <div> <label class="btn-switch-label" tabindex="0" role="option"> - <input type="checkbox" b2b-switches ng-model="availableRole.active" ng-click="activateRoleConfirmPopUp(availableRole.active,availableRole);" > + <input type="checkbox" b2b-switches ng-model="availableRole.active" ng-click="activateRoleConfirmPopUp(availableRole.active,availableRole);"> </label> </div> </td> - <td width="10%"> + <td width="10%" ng-if="isAppCentralized=='false'"> <div ng-click="delRoleConfirmPopUp(availableRole);"><a href="javascript:void(0)" class="icon-misc-trash"></a></div> </td> </tr> diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/static/fusion/raptor/js/ajax.js b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/static/fusion/raptor/js/ajax.js deleted file mode 100644 index c24c2688..00000000 --- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/static/fusion/raptor/js/ajax.js +++ /dev/null @@ -1,214 +0,0 @@ -/* Simple AJAX Code-Kit (SACK) v1.6.1 */ -/* 2005 Gregory Wild-Smith */ -/* www.twilightuniverse.com */ -/* Software licenced under a modified X11 licence, - see documentation or authors website for more details */ - -function sack(file) { - this.xmlhttp = null; - - this.resetData = function() { - this.method = "POST"; - this.queryStringSeparator = "?"; - this.argumentSeparator = "&"; - this.URLString = ""; - this.encodeURIString = true; - this.execute = false; - this.element = null; - this.elementObj = null; - this.requestFile = file; - this.vars = new Object(); - this.responseStatus = new Array(2); - }; - - this.resetFunctions = function() { - this.onLoading = function() { }; - this.onLoaded = function() { }; - this.onInteractive = function() { }; - this.onCompletion = function() { }; - this.onError = function() { }; - this.onFail = function() { }; - }; - - this.reset = function() { - this.resetFunctions(); - this.resetData(); - }; - - this.createAJAX = function() { - try { - this.xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); - } catch (e1) { - try { - this.xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); - } catch (e2) { - this.xmlhttp = null; - } - } - - if (! this.xmlhttp) { - if (typeof XMLHttpRequest != "undefined") { - this.xmlhttp = new XMLHttpRequest(); - } else { - this.failed = true; - } - } - }; - - /*Modified by Sundar: to accept POST request*/ - this.setVar = function(name, value, index){ - if(index) - this.vars[name+'~'+index] = Array(value, false); - else - this.vars[name+'~'+0] = Array(value, false); - }; - - this.encVar = function(name, value, returnvars) { - if (true == returnvars) { - return Array(encodeURIComponent(name), encodeURIComponent(value)); - } else { - this.vars[encodeURIComponent(name)] = Array(encodeURIComponent(value), true); - } - } - - this.processURLString = function(string, encode) { - encoded = encodeURIComponent(this.argumentSeparator); - regexp = new RegExp(this.argumentSeparator + "|" + encoded); - varArray = string.split(regexp); - for (i = 0; i < varArray.length; i++){ - urlVars = varArray[i].split("="); - if (true == encode){ - this.encVar(urlVars[0], urlVars[1]); - } else { - this.setVar(urlVars[0], urlVars[1]); - } - } - } - - this.createURLString = function(urlstring) { - if (this.encodeURIString && this.URLString.length) { - this.processURLString(this.URLString, true); - } - - if (urlstring) { - if (this.URLString.length) { - this.URLString += this.argumentSeparator + urlstring; - } else { - this.URLString = urlstring; - } - } - - // prevents caching of URLString - this.setVar("rndval", new Date().getTime()); - - urlstringtemp = new Array(); - /*Modified by Sundar: to accept POST request*/ - var key1 = ""; - for (key in this.vars) { - if (false == this.vars[key][1] && true == this.encodeURIString) { - encoded = this.encVar(key, this.vars[key][0], true); - delete this.vars[key]; - this.vars[encoded[0]] = Array(encoded[1], true); - key = encoded[0]; - } - key1 = key.substr(0,key.indexOf('~')); - //alert("Key " + key1); - urlstringtemp[urlstringtemp.length] = key1 + "=" + this.vars[key][0]; - } - if (urlstring){ - this.URLString += this.argumentSeparator + urlstringtemp.join(this.argumentSeparator); - } else { - this.URLString += urlstringtemp.join(this.argumentSeparator); - } - //alert("URLString " + this.URLString); - - } - - this.runResponse = function() { - eval(this.response); - } - - - this.runAJAX = function(urlstring,noWaitForResponse,timeOut) { - - if(noWaitForResponse == null){ - noWaitForResponse = true; - } - - if (this.failed) { - this.onFail(); - } else { - this.createURLString(urlstring); - if (this.element) { - this.elementObj = document.getElementById(this.element); - } - if (this.xmlhttp) { - var self = this; - //SUNDAR: Added timeout for synchronous AJAX - if(!noWaitForResponse && timeOut != null && !isNaN(timeOut)){ - window.setTimeout("dummyFunction()",timeOut); - } - if (this.method == "GET") { - totalurlstring = this.requestFile + this.queryStringSeparator + this.URLString; - this.xmlhttp.open(this.method, totalurlstring, noWaitForResponse); - } else { - - this.xmlhttp.open(this.method, this.requestFile, noWaitForResponse); - try { - this.xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded") - } catch (e) { } - } - - this.xmlhttp.onreadystatechange = function() { - //alert("AJAX READY " + self.xmlhttp.readyState); - switch (self.xmlhttp.readyState) { - case 1: - self.onLoading(); - break; - case 2: - self.onLoaded(); - break; - case 3: - self.onInteractive(); - break; - case 4: - self.response = self.xmlhttp.responseText; - self.responseXML = self.xmlhttp.responseXML; - self.responseStatus[0] = self.xmlhttp.status; - self.responseStatus[1] = self.xmlhttp.statusText; - - if (self.execute) { - self.runResponse(); - } - - if (self.elementObj) { - elemNodeName = self.elementObj.nodeName; - elemNodeName.toLowerCase(); - if (elemNodeName == "input" - || elemNodeName == "select" - || elemNodeName == "option" - || elemNodeName == "textarea") { - self.elementObj.value = self.response; - } else { - self.elementObj.innerHTML = self.response; - } - } - if (self.responseStatus[0] == "200") { - self.onCompletion(); - } else { - self.onError(); - } - - self.URLString = ""; - break; - } - }; - - this.xmlhttp.send(this.URLString); - } - } - }; - - this.reset(); - this.createAJAX(); -} diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/static/fusion/raptor/js/prototype-1.6.0.3.js b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/static/fusion/raptor/js/prototype-1.6.0.3.js deleted file mode 100644 index dfe8ab4e..00000000 --- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/static/fusion/raptor/js/prototype-1.6.0.3.js +++ /dev/null @@ -1,4320 +0,0 @@ -/* Prototype JavaScript framework, version 1.6.0.3 - * (c) 2005-2008 Sam Stephenson - * - * Prototype is freely distributable under the terms of an MIT-style license. - * For details, see the Prototype web site: http://www.prototypejs.org/ - * - *--------------------------------------------------------------------------*/ - -var Prototype = { - Version: '1.6.0.3', - - Browser: { - IE: !!(window.attachEvent && - navigator.userAgent.indexOf('Opera') === -1), - Opera: navigator.userAgent.indexOf('Opera') > -1, - WebKit: navigator.userAgent.indexOf('AppleWebKit/') > -1, - Gecko: navigator.userAgent.indexOf('Gecko') > -1 && - navigator.userAgent.indexOf('KHTML') === -1, - MobileSafari: !!navigator.userAgent.match(/Apple.*Mobile.*Safari/) - }, - - BrowserFeatures: { - XPath: !!document.evaluate, - SelectorsAPI: !!document.querySelector, - ElementExtensions: !!window.HTMLElement, - SpecificElementExtensions: - document.createElement('div')['__proto__'] && - document.createElement('div')['__proto__'] !== - document.createElement('form')['__proto__'] - }, - - ScriptFragment: '<script[^>]*>([\\S\\s]*?)<\/script>', - JSONFilter: /^\/\*-secure-([\s\S]*)\*\/\s*$/, - - emptyFunction: function() { }, - K: function(x) { return x } -}; - -if (Prototype.Browser.MobileSafari) - Prototype.BrowserFeatures.SpecificElementExtensions = false; - - -/* Based on Alex Arnell's inheritance implementation. */ -var Class = { - create: function() { - var parent = null, properties = $A(arguments); - if (Object.isFunction(properties[0])) - parent = properties.shift(); - - function klass() { - this.initialize.apply(this, arguments); - } - - Object.extend(klass, Class.Methods); - klass.superclass = parent; - klass.subclasses = []; - - if (parent) { - var subclass = function() { }; - subclass.prototype = parent.prototype; - klass.prototype = new subclass; - parent.subclasses.push(klass); - } - - for (var i = 0; i < properties.length; i++) - klass.addMethods(properties[i]); - - if (!klass.prototype.initialize) - klass.prototype.initialize = Prototype.emptyFunction; - - klass.prototype.constructor = klass; - - return klass; - } -}; - -Class.Methods = { - addMethods: function(source) { - var ancestor = this.superclass && this.superclass.prototype; - var properties = Object.keys(source); - - if (!Object.keys({ toString: true }).length) - properties.push("toString", "valueOf"); - - for (var i = 0, length = properties.length; i < length; i++) { - var property = properties[i], value = source[property]; - if (ancestor && Object.isFunction(value) && - value.argumentNames().first() == "$super") { - var method = value; - value = (function(m) { - return function() { return ancestor[m].apply(this, arguments) }; - })(property).wrap(method); - - value.valueOf = method.valueOf.bind(method); - value.toString = method.toString.bind(method); - } - this.prototype[property] = value; - } - - return this; - } -}; - -var Abstract = { }; - -Object.extend = function(destination, source) { - for (var property in source) - destination[property] = source[property]; - return destination; -}; - -Object.extend(Object, { - inspect: function(object) { - try { - if (Object.isUndefined(object)) return 'undefined'; - if (object === null) return 'null'; - return object.inspect ? object.inspect() : String(object); - } catch (e) { - if (e instanceof RangeError) return '...'; - throw e; - } - }, - - toJSON: function(object) { - var type = typeof object; - switch (type) { - case 'undefined': - case 'function': - case 'unknown': return; - case 'boolean': return object.toString(); - } - - if (object === null) return 'null'; - if (object.toJSON) return object.toJSON(); - if (Object.isElement(object)) return; - - var results = []; - for (var property in object) { - var value = Object.toJSON(object[property]); - if (!Object.isUndefined(value)) - results.push(property.toJSON() + ': ' + value); - } - - return '{' + results.join(', ') + '}'; - }, - - toQueryString: function(object) { - return $H(object).toQueryString(); - }, - - toHTML: function(object) { - return object && object.toHTML ? object.toHTML() : String.interpret(object); - }, - - keys: function(object) { - var keys = []; - for (var property in object) - keys.push(property); - return keys; - }, - - values: function(object) { - var values = []; - for (var property in object) - values.push(object[property]); - return values; - }, - - clone: function(object) { - return Object.extend({ }, object); - }, - - isElement: function(object) { - return !!(object && object.nodeType == 1); - }, - - isArray: function(object) { - return object != null && typeof object == "object" && - 'splice' in object && 'join' in object; - }, - - isHash: function(object) { - return object instanceof Hash; - }, - - isFunction: function(object) { - return typeof object == "function"; - }, - - isString: function(object) { - return typeof object == "string"; - }, - - isNumber: function(object) { - return typeof object == "number"; - }, - - isUndefined: function(object) { - return typeof object == "undefined"; - } -}); - -Object.extend(Function.prototype, { - argumentNames: function() { - var names = this.toString().match(/^[\s\(]*function[^(]*\(([^\)]*)\)/)[1] - .replace(/\s+/g, '').split(','); - return names.length == 1 && !names[0] ? [] : names; - }, - - bind: function() { - if (arguments.length < 2 && Object.isUndefined(arguments[0])) return this; - var __method = this, args = $A(arguments), object = args.shift(); - return function() { - return __method.apply(object, args.concat($A(arguments))); - } - }, - - bindAsEventListener: function() { - var __method = this, args = $A(arguments), object = args.shift(); - return function(event) { - return __method.apply(object, [event || window.event].concat(args)); - } - }, - - curry: function() { - if (!arguments.length) return this; - var __method = this, args = $A(arguments); - return function() { - return __method.apply(this, args.concat($A(arguments))); - } - }, - - delay: function() { - var __method = this, args = $A(arguments), timeout = args.shift() * 1000; - return window.setTimeout(function() { - return __method.apply(__method, args); - }, timeout); - }, - - defer: function() { - var args = [0.01].concat($A(arguments)); - return this.delay.apply(this, args); - }, - - wrap: function(wrapper) { - var __method = this; - return function() { - return wrapper.apply(this, [__method.bind(this)].concat($A(arguments))); - } - }, - - methodize: function() { - if (this._methodized) return this._methodized; - var __method = this; - return this._methodized = function() { - return __method.apply(null, [this].concat($A(arguments))); - }; - } -}); - -Date.prototype.toJSON = function() { - return '"' + this.getUTCFullYear() + '-' + - (this.getUTCMonth() + 1).toPaddedString(2) + '-' + - this.getUTCDate().toPaddedString(2) + 'T' + - this.getUTCHours().toPaddedString(2) + ':' + - this.getUTCMinutes().toPaddedString(2) + ':' + - this.getUTCSeconds().toPaddedString(2) + 'Z"'; -}; - -var Try = { - these: function() { - var returnValue; - - for (var i = 0, length = arguments.length; i < length; i++) { - var lambda = arguments[i]; - try { - returnValue = lambda(); - break; - } catch (e) { } - } - - return returnValue; - } -}; - -RegExp.prototype.match = RegExp.prototype.test; - -RegExp.escape = function(str) { - return String(str).replace(/([.*+?^=!:${}()|[\]\/\\])/g, '\\$1'); -}; - -/*--------------------------------------------------------------------------*/ - -var PeriodicalExecuter = Class.create({ - initialize: function(callback, frequency) { - this.callback = callback; - this.frequency = frequency; - this.currentlyExecuting = false; - - this.registerCallback(); - }, - - registerCallback: function() { - this.timer = setInterval(this.onTimerEvent.bind(this), this.frequency * 1000); - }, - - execute: function() { - this.callback(this); - }, - - stop: function() { - if (!this.timer) return; - clearInterval(this.timer); - this.timer = null; - }, - - onTimerEvent: function() { - if (!this.currentlyExecuting) { - try { - this.currentlyExecuting = true; - this.execute(); - } finally { - this.currentlyExecuting = false; - } - } - } -}); -Object.extend(String, { - interpret: function(value) { - return value == null ? '' : String(value); - }, - specialChar: { - '\b': '\\b', - '\t': '\\t', - '\n': '\\n', - '\f': '\\f', - '\r': '\\r', - '\\': '\\\\' - } -}); - -Object.extend(String.prototype, { - gsub: function(pattern, replacement) { - var result = '', source = this, match; - replacement = arguments.callee.prepareReplacement(replacement); - - while (source.length > 0) { - if (match = source.match(pattern)) { - result += source.slice(0, match.index); - result += String.interpret(replacement(match)); - source = source.slice(match.index + match[0].length); - } else { - result += source, source = ''; - } - } - return result; - }, - - sub: function(pattern, replacement, count) { - replacement = this.gsub.prepareReplacement(replacement); - count = Object.isUndefined(count) ? 1 : count; - - return this.gsub(pattern, function(match) { - if (--count < 0) return match[0]; - return replacement(match); - }); - }, - - scan: function(pattern, iterator) { - this.gsub(pattern, iterator); - return String(this); - }, - - truncate: function(length, truncation) { - length = length || 30; - truncation = Object.isUndefined(truncation) ? '...' : truncation; - return this.length > length ? - this.slice(0, length - truncation.length) + truncation : String(this); - }, - - strip: function() { - return this.replace(/^\s+/, '').replace(/\s+$/, ''); - }, - - stripTags: function() { - return this.replace(/<\/?[^>]+>/gi, ''); - }, - - stripScripts: function() { - return this.replace(new RegExp(Prototype.ScriptFragment, 'img'), ''); - }, - - extractScripts: function() { - var matchAll = new RegExp(Prototype.ScriptFragment, 'img'); - var matchOne = new RegExp(Prototype.ScriptFragment, 'im'); - return (this.match(matchAll) || []).map(function(scriptTag) { - return (scriptTag.match(matchOne) || ['', ''])[1]; - }); - }, - - evalScripts: function() { - return this.extractScripts().map(function(script) { return eval(script) }); - }, - - escapeHTML: function() { - var self = arguments.callee; - self.text.data = this; - return self.div.innerHTML; - }, - - unescapeHTML: function() { - var div = new Element('div'); - div.innerHTML = this.stripTags(); - return div.childNodes[0] ? (div.childNodes.length > 1 ? - $A(div.childNodes).inject('', function(memo, node) { return memo+node.nodeValue }) : - div.childNodes[0].nodeValue) : ''; - }, - - toQueryParams: function(separator) { - var match = this.strip().match(/([^?#]*)(#.*)?$/); - if (!match) return { }; - - return match[1].split(separator || '&').inject({ }, function(hash, pair) { - if ((pair = pair.split('='))[0]) { - var key = decodeURIComponent(pair.shift()); - var value = pair.length > 1 ? pair.join('=') : pair[0]; - if (value != undefined) value = decodeURIComponent(value); - - if (key in hash) { - if (!Object.isArray(hash[key])) hash[key] = [hash[key]]; - hash[key].push(value); - } - else hash[key] = value; - } - return hash; - }); - }, - - toArray: function() { - return this.split(''); - }, - - succ: function() { - return this.slice(0, this.length - 1) + - String.fromCharCode(this.charCodeAt(this.length - 1) + 1); - }, - - times: function(count) { - return count < 1 ? '' : new Array(count + 1).join(this); - }, - - camelize: function() { - var parts = this.split('-'), len = parts.length; - if (len == 1) return parts[0]; - - var camelized = this.charAt(0) == '-' - ? parts[0].charAt(0).toUpperCase() + parts[0].substring(1) - : parts[0]; - - for (var i = 1; i < len; i++) - camelized += parts[i].charAt(0).toUpperCase() + parts[i].substring(1); - - return camelized; - }, - - capitalize: function() { - return this.charAt(0).toUpperCase() + this.substring(1).toLowerCase(); - }, - - underscore: function() { - return this.gsub(/::/, '/').gsub(/([A-Z]+)([A-Z][a-z])/,'#{1}_#{2}').gsub(/([a-z\d])([A-Z])/,'#{1}_#{2}').gsub(/-/,'_').toLowerCase(); - }, - - dasherize: function() { - return this.gsub(/_/,'-'); - }, - - inspect: function(useDoubleQuotes) { - var escapedString = this.gsub(/[\x00-\x1f\\]/, function(match) { - var character = String.specialChar[match[0]]; - return character ? character : '\\u00' + match[0].charCodeAt().toPaddedString(2, 16); - }); - if (useDoubleQuotes) return '"' + escapedString.replace(/"/g, '\\"') + '"'; - return "'" + escapedString.replace(/'/g, '\\\'') + "'"; - }, - - toJSON: function() { - return this.inspect(true); - }, - - unfilterJSON: function(filter) { - return this.sub(filter || Prototype.JSONFilter, '#{1}'); - }, - - isJSON: function() { - var str = this; - if (str.blank()) return false; - str = this.replace(/\\./g, '@').replace(/"[^"\\\n\r]*"/g, ''); - return (/^[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]*$/).test(str); - }, - - evalJSON: function(sanitize) { - var json = this.unfilterJSON(); - try { - if (!sanitize || json.isJSON()) return eval('(' + json + ')'); - } catch (e) { } - throw new SyntaxError('Badly formed JSON string: ' + this.inspect()); - }, - - include: function(pattern) { - return this.indexOf(pattern) > -1; - }, - - startsWith: function(pattern) { - return this.indexOf(pattern) === 0; - }, - - endsWith: function(pattern) { - var d = this.length - pattern.length; - return d >= 0 && this.lastIndexOf(pattern) === d; - }, - - empty: function() { - return this == ''; - }, - - blank: function() { - return /^\s*$/.test(this); - }, - - interpolate: function(object, pattern) { - return new Template(this, pattern).evaluate(object); - } -}); - -if (Prototype.Browser.WebKit || Prototype.Browser.IE) Object.extend(String.prototype, { - escapeHTML: function() { - return this.replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>'); - }, - unescapeHTML: function() { - return this.stripTags().replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>'); - } -}); - -String.prototype.gsub.prepareReplacement = function(replacement) { - if (Object.isFunction(replacement)) return replacement; - var template = new Template(replacement); - return function(match) { return template.evaluate(match) }; -}; - -String.prototype.parseQuery = String.prototype.toQueryParams; - -Object.extend(String.prototype.escapeHTML, { - div: document.createElement('div'), - text: document.createTextNode('') -}); - -String.prototype.escapeHTML.div.appendChild(String.prototype.escapeHTML.text); - -var Template = Class.create({ - initialize: function(template, pattern) { - this.template = template.toString(); - this.pattern = pattern || Template.Pattern; - }, - - evaluate: function(object) { - if (Object.isFunction(object.toTemplateReplacements)) - object = object.toTemplateReplacements(); - - return this.template.gsub(this.pattern, function(match) { - if (object == null) return ''; - - var before = match[1] || ''; - if (before == '\\') return match[2]; - - var ctx = object, expr = match[3]; - var pattern = /^([^.[]+|\[((?:.*?[^\\])?)\])(\.|\[|$)/; - match = pattern.exec(expr); - if (match == null) return before; - - while (match != null) { - var comp = match[1].startsWith('[') ? match[2].gsub('\\\\]', ']') : match[1]; - ctx = ctx[comp]; - if (null == ctx || '' == match[3]) break; - expr = expr.substring('[' == match[3] ? match[1].length : match[0].length); - match = pattern.exec(expr); - } - - return before + String.interpret(ctx); - }); - } -}); -Template.Pattern = /(^|.|\r|\n)(#\{(.*?)\})/; - -var $break = { }; - -var Enumerable = { - each: function(iterator, context) { - var index = 0; - try { - this._each(function(value) { - iterator.call(context, value, index++); - }); - } catch (e) { - if (e != $break) throw e; - } - return this; - }, - - eachSlice: function(number, iterator, context) { - var index = -number, slices = [], array = this.toArray(); - if (number < 1) return array; - while ((index += number) < array.length) - slices.push(array.slice(index, index+number)); - return slices.collect(iterator, context); - }, - - all: function(iterator, context) { - iterator = iterator || Prototype.K; - var result = true; - this.each(function(value, index) { - result = result && !!iterator.call(context, value, index); - if (!result) throw $break; - }); - return result; - }, - - any: function(iterator, context) { - iterator = iterator || Prototype.K; - var result = false; - this.each(function(value, index) { - if (result = !!iterator.call(context, value, index)) - throw $break; - }); - return result; - }, - - collect: function(iterator, context) { - iterator = iterator || Prototype.K; - var results = []; - this.each(function(value, index) { - results.push(iterator.call(context, value, index)); - }); - return results; - }, - - detect: function(iterator, context) { - var result; - this.each(function(value, index) { - if (iterator.call(context, value, index)) { - result = value; - throw $break; - } - }); - return result; - }, - - findAll: function(iterator, context) { - var results = []; - this.each(function(value, index) { - if (iterator.call(context, value, index)) - results.push(value); - }); - return results; - }, - - grep: function(filter, iterator, context) { - iterator = iterator || Prototype.K; - var results = []; - - if (Object.isString(filter)) - filter = new RegExp(filter); - - this.each(function(value, index) { - if (filter.match(value)) - results.push(iterator.call(context, value, index)); - }); - return results; - }, - - include: function(object) { - if (Object.isFunction(this.indexOf)) - if (this.indexOf(object) != -1) return true; - - var found = false; - this.each(function(value) { - if (value == object) { - found = true; - throw $break; - } - }); - return found; - }, - - inGroupsOf: function(number, fillWith) { - fillWith = Object.isUndefined(fillWith) ? null : fillWith; - return this.eachSlice(number, function(slice) { - while(slice.length < number) slice.push(fillWith); - return slice; - }); - }, - - inject: function(memo, iterator, context) { - this.each(function(value, index) { - memo = iterator.call(context, memo, value, index); - }); - return memo; - }, - - invoke: function(method) { - var args = $A(arguments).slice(1); - return this.map(function(value) { - return value[method].apply(value, args); - }); - }, - - max: function(iterator, context) { - iterator = iterator || Prototype.K; - var result; - this.each(function(value, index) { - value = iterator.call(context, value, index); - if (result == null || value >= result) - result = value; - }); - return result; - }, - - min: function(iterator, context) { - iterator = iterator || Prototype.K; - var result; - this.each(function(value, index) { - value = iterator.call(context, value, index); - if (result == null || value < result) - result = value; - }); - return result; - }, - - partition: function(iterator, context) { - iterator = iterator || Prototype.K; - var trues = [], falses = []; - this.each(function(value, index) { - (iterator.call(context, value, index) ? - trues : falses).push(value); - }); - return [trues, falses]; - }, - - pluck: function(property) { - var results = []; - this.each(function(value) { - results.push(value[property]); - }); - return results; - }, - - reject: function(iterator, context) { - var results = []; - this.each(function(value, index) { - if (!iterator.call(context, value, index)) - results.push(value); - }); - return results; - }, - - sortBy: function(iterator, context) { - return this.map(function(value, index) { - return { - value: value, - criteria: iterator.call(context, value, index) - }; - }).sort(function(left, right) { - var a = left.criteria, b = right.criteria; - return a < b ? -1 : a > b ? 1 : 0; - }).pluck('value'); - }, - - toArray: function() { - return this.map(); - }, - - zip: function() { - var iterator = Prototype.K, args = $A(arguments); - if (Object.isFunction(args.last())) - iterator = args.pop(); - - var collections = [this].concat(args).map($A); - return this.map(function(value, index) { - return iterator(collections.pluck(index)); - }); - }, - - size: function() { - return this.toArray().length; - }, - - inspect: function() { - return '#<Enumerable:' + this.toArray().inspect() + '>'; - } -}; - -Object.extend(Enumerable, { - map: Enumerable.collect, - find: Enumerable.detect, - select: Enumerable.findAll, - filter: Enumerable.findAll, - member: Enumerable.include, - entries: Enumerable.toArray, - every: Enumerable.all, - some: Enumerable.any -}); -function $A(iterable) { - if (!iterable) return []; - if (iterable.toArray) return iterable.toArray(); - var length = iterable.length || 0, results = new Array(length); - while (length--) results[length] = iterable[length]; - return results; -} - -if (Prototype.Browser.WebKit) { - $A = function(iterable) { - if (!iterable) return []; - // In Safari, only use the `toArray` method if it's not a NodeList. - // A NodeList is a function, has an function `item` property, and a numeric - // `length` property. Adapted from Google Doctype. - if (!(typeof iterable === 'function' && typeof iterable.length === - 'number' && typeof iterable.item === 'function') && iterable.toArray) - return iterable.toArray(); - var length = iterable.length || 0, results = new Array(length); - while (length--) results[length] = iterable[length]; - return results; - }; -} - -Array.from = $A; - -Object.extend(Array.prototype, Enumerable); - -if (!Array.prototype._reverse) Array.prototype._reverse = Array.prototype.reverse; - -Object.extend(Array.prototype, { - _each: function(iterator) { - for (var i = 0, length = this.length; i < length; i++) - iterator(this[i]); - }, - - clear: function() { - this.length = 0; - return this; - }, - - first: function() { - return this[0]; - }, - - last: function() { - return this[this.length - 1]; - }, - - compact: function() { - return this.select(function(value) { - return value != null; - }); - }, - - flatten: function() { - return this.inject([], function(array, value) { - return array.concat(Object.isArray(value) ? - value.flatten() : [value]); - }); - }, - - without: function() { - var values = $A(arguments); - return this.select(function(value) { - return !values.include(value); - }); - }, - - reverse: function(inline) { - return (inline !== false ? this : this.toArray())._reverse(); - }, - - reduce: function() { - return this.length > 1 ? this : this[0]; - }, - - uniq: function(sorted) { - return this.inject([], function(array, value, index) { - if (0 == index || (sorted ? array.last() != value : !array.include(value))) - array.push(value); - return array; - }); - }, - - intersect: function(array) { - return this.uniq().findAll(function(item) { - return array.detect(function(value) { return item === value }); - }); - }, - - clone: function() { - return [].concat(this); - }, - - size: function() { - return this.length; - }, - - inspect: function() { - return '[' + this.map(Object.inspect).join(', ') + ']'; - }, - - toJSON: function() { - var results = []; - this.each(function(object) { - var value = Object.toJSON(object); - if (!Object.isUndefined(value)) results.push(value); - }); - return '[' + results.join(', ') + ']'; - } -}); - -// use native browser JS 1.6 implementation if available -if (Object.isFunction(Array.prototype.forEach)) - Array.prototype._each = Array.prototype.forEach; - -if (!Array.prototype.indexOf) Array.prototype.indexOf = function(item, i) { - i || (i = 0); - var length = this.length; - if (i < 0) i = length + i; - for (; i < length; i++) - if (this[i] === item) return i; - return -1; -}; - -if (!Array.prototype.lastIndexOf) Array.prototype.lastIndexOf = function(item, i) { - i = isNaN(i) ? this.length : (i < 0 ? this.length + i : i) + 1; - var n = this.slice(0, i).reverse().indexOf(item); - return (n < 0) ? n : i - n - 1; -}; - -Array.prototype.toArray = Array.prototype.clone; - -function $w(string) { - if (!Object.isString(string)) return []; - string = string.strip(); - return string ? string.split(/\s+/) : []; -} - -if (Prototype.Browser.Opera){ - Array.prototype.concat = function() { - var array = []; - for (var i = 0, length = this.length; i < length; i++) array.push(this[i]); - for (var i = 0, length = arguments.length; i < length; i++) { - if (Object.isArray(arguments[i])) { - for (var j = 0, arrayLength = arguments[i].length; j < arrayLength; j++) - array.push(arguments[i][j]); - } else { - array.push(arguments[i]); - } - } - return array; - }; -} -Object.extend(Number.prototype, { - toColorPart: function() { - return this.toPaddedString(2, 16); - }, - - succ: function() { - return this + 1; - }, - - times: function(iterator, context) { - $R(0, this, true).each(iterator, context); - return this; - }, - - toPaddedString: function(length, radix) { - var string = this.toString(radix || 10); - return '0'.times(length - string.length) + string; - }, - - toJSON: function() { - return isFinite(this) ? this.toString() : 'null'; - } -}); - -$w('abs round ceil floor').each(function(method){ - Number.prototype[method] = Math[method].methodize(); -}); -function $H(object) { - return new Hash(object); -}; - -var Hash = Class.create(Enumerable, (function() { - - function toQueryPair(key, value) { - if (Object.isUndefined(value)) return key; - return key + '=' + encodeURIComponent(String.interpret(value)); - } - - return { - initialize: function(object) { - this._object = Object.isHash(object) ? object.toObject() : Object.clone(object); - }, - - _each: function(iterator) { - for (var key in this._object) { - var value = this._object[key], pair = [key, value]; - pair.key = key; - pair.value = value; - iterator(pair); - } - }, - - set: function(key, value) { - return this._object[key] = value; - }, - - get: function(key) { - // simulating poorly supported hasOwnProperty - if (this._object[key] !== Object.prototype[key]) - return this._object[key]; - }, - - unset: function(key) { - var value = this._object[key]; - delete this._object[key]; - return value; - }, - - toObject: function() { - return Object.clone(this._object); - }, - - keys: function() { - return this.pluck('key'); - }, - - values: function() { - return this.pluck('value'); - }, - - index: function(value) { - var match = this.detect(function(pair) { - return pair.value === value; - }); - return match && match.key; - }, - - merge: function(object) { - return this.clone().update(object); - }, - - update: function(object) { - return new Hash(object).inject(this, function(result, pair) { - result.set(pair.key, pair.value); - return result; - }); - }, - - toQueryString: function() { - return this.inject([], function(results, pair) { - var key = encodeURIComponent(pair.key), values = pair.value; - - if (values && typeof values == 'object') { - if (Object.isArray(values)) - return results.concat(values.map(toQueryPair.curry(key))); - } else results.push(toQueryPair(key, values)); - return results; - }).join('&'); - }, - - inspect: function() { - return '#<Hash:{' + this.map(function(pair) { - return pair.map(Object.inspect).join(': '); - }).join(', ') + '}>'; - }, - - toJSON: function() { - return Object.toJSON(this.toObject()); - }, - - clone: function() { - return new Hash(this); - } - } -})()); - -Hash.prototype.toTemplateReplacements = Hash.prototype.toObject; -Hash.from = $H; -var ObjectRange = Class.create(Enumerable, { - initialize: function(start, end, exclusive) { - this.start = start; - this.end = end; - this.exclusive = exclusive; - }, - - _each: function(iterator) { - var value = this.start; - while (this.include(value)) { - iterator(value); - value = value.succ(); - } - }, - - include: function(value) { - if (value < this.start) - return false; - if (this.exclusive) - return value < this.end; - return value <= this.end; - } -}); - -var $R = function(start, end, exclusive) { - return new ObjectRange(start, end, exclusive); -}; - -var Ajax = { - getTransport: function() { - return Try.these( - function() {return new XMLHttpRequest()}, - function() {return new ActiveXObject('Msxml2.XMLHTTP')}, - function() {return new ActiveXObject('Microsoft.XMLHTTP')} - ) || false; - }, - - activeRequestCount: 0 -}; - -Ajax.Responders = { - responders: [], - - _each: function(iterator) { - this.responders._each(iterator); - }, - - register: function(responder) { - if (!this.include(responder)) - this.responders.push(responder); - }, - - unregister: function(responder) { - this.responders = this.responders.without(responder); - }, - - dispatch: function(callback, request, transport, json) { - this.each(function(responder) { - if (Object.isFunction(responder[callback])) { - try { - responder[callback].apply(responder, [request, transport, json]); - } catch (e) { } - } - }); - } -}; - -Object.extend(Ajax.Responders, Enumerable); - -Ajax.Responders.register({ - onCreate: function() { Ajax.activeRequestCount++ }, - onComplete: function() { Ajax.activeRequestCount-- } -}); - -Ajax.Base = Class.create({ - initialize: function(options) { - this.options = { - method: 'post', - asynchronous: true, - contentType: 'application/x-www-form-urlencoded', - encoding: 'UTF-8', - parameters: '', - evalJSON: true, - evalJS: true - }; - Object.extend(this.options, options || { }); - - this.options.method = this.options.method.toLowerCase(); - - if (Object.isString(this.options.parameters)) - this.options.parameters = this.options.parameters.toQueryParams(); - else if (Object.isHash(this.options.parameters)) - this.options.parameters = this.options.parameters.toObject(); - } -}); - -Ajax.Request = Class.create(Ajax.Base, { - _complete: false, - - initialize: function($super, url, options) { - $super(options); - this.transport = Ajax.getTransport(); - this.request(url); - }, - - request: function(url) { - this.url = url; - this.method = this.options.method; - var params = Object.clone(this.options.parameters); - - if (!['get', 'post'].include(this.method)) { - // simulate other verbs over post - params['_method'] = this.method; - this.method = 'post'; - } - - this.parameters = params; - - if (params = Object.toQueryString(params)) { - // when GET, append parameters to URL - if (this.method == 'get') - this.url += (this.url.include('?') ? '&' : '?') + params; - else if (/Konqueror|Safari|KHTML/.test(navigator.userAgent)) - params += '&_='; - } - - try { - var response = new Ajax.Response(this); - if (this.options.onCreate) this.options.onCreate(response); - Ajax.Responders.dispatch('onCreate', this, response); - - this.transport.open(this.method.toUpperCase(), this.url, - this.options.asynchronous); - - if (this.options.asynchronous) this.respondToReadyState.bind(this).defer(1); - - this.transport.onreadystatechange = this.onStateChange.bind(this); - this.setRequestHeaders(); - - this.body = this.method == 'post' ? (this.options.postBody || params) : null; - this.transport.send(this.body); - - /* Force Firefox to handle ready state 4 for synchronous requests */ - if (!this.options.asynchronous && this.transport.overrideMimeType) - this.onStateChange(); - - } - catch (e) { - this.dispatchException(e); - } - }, - - onStateChange: function() { - var readyState = this.transport.readyState; - if (readyState > 1 && !((readyState == 4) && this._complete)) - this.respondToReadyState(this.transport.readyState); - }, - - setRequestHeaders: function() { - var headers = { - 'X-Requested-With': 'XMLHttpRequest', - 'X-Prototype-Version': Prototype.Version, - 'Accept': 'text/javascript, text/html, application/xml, text/xml, */*' - }; - - if (this.method == 'post') { - headers['Content-type'] = this.options.contentType + - (this.options.encoding ? '; charset=' + this.options.encoding : ''); - - /* Force "Connection: close" for older Mozilla browsers to work - * around a bug where XMLHttpRequest sends an incorrect - * Content-length header. See Mozilla Bugzilla #246651. - */ - if (this.transport.overrideMimeType && - (navigator.userAgent.match(/Gecko\/(\d{4})/) || [0,2005])[1] < 2005) - headers['Connection'] = 'close'; - } - - // user-defined headers - if (typeof this.options.requestHeaders == 'object') { - var extras = this.options.requestHeaders; - - if (Object.isFunction(extras.push)) - for (var i = 0, length = extras.length; i < length; i += 2) - headers[extras[i]] = extras[i+1]; - else - $H(extras).each(function(pair) { headers[pair.key] = pair.value }); - } - - for (var name in headers) - this.transport.setRequestHeader(name, headers[name]); - }, - - success: function() { - var status = this.getStatus(); - return !status || (status >= 200 && status < 300); - }, - - getStatus: function() { - try { - return this.transport.status || 0; - } catch (e) { return 0 } - }, - - respondToReadyState: function(readyState) { - var state = Ajax.Request.Events[readyState], response = new Ajax.Response(this); - - if (state == 'Complete') { - try { - this._complete = true; - (this.options['on' + response.status] - || this.options['on' + (this.success() ? 'Success' : 'Failure')] - || Prototype.emptyFunction)(response, response.headerJSON); - } catch (e) { - this.dispatchException(e); - } - - var contentType = response.getHeader('Content-type'); - if (this.options.evalJS == 'force' - || (this.options.evalJS && this.isSameOrigin() && contentType - && contentType.match(/^\s*(text|application)\/(x-)?(java|ecma)script(;.*)?\s*$/i))) - this.evalResponse(); - } - - try { - (this.options['on' + state] || Prototype.emptyFunction)(response, response.headerJSON); - Ajax.Responders.dispatch('on' + state, this, response, response.headerJSON); - } catch (e) { - this.dispatchException(e); - } - - if (state == 'Complete') { - // avoid memory leak in MSIE: clean up - this.transport.onreadystatechange = Prototype.emptyFunction; - } - }, - - isSameOrigin: function() { - var m = this.url.match(/^\s*https?:\/\/[^\/]*/); - return !m || (m[0] == '#{protocol}//#{domain}#{port}'.interpolate({ - protocol: location.protocol, - domain: document.domain, - port: location.port ? ':' + location.port : '' - })); - }, - - getHeader: function(name) { - try { - return this.transport.getResponseHeader(name) || null; - } catch (e) { return null } - }, - - evalResponse: function() { - try { - return eval((this.transport.responseText || '').unfilterJSON()); - } catch (e) { - this.dispatchException(e); - } - }, - - dispatchException: function(exception) { - (this.options.onException || Prototype.emptyFunction)(this, exception); - Ajax.Responders.dispatch('onException', this, exception); - } -}); - -Ajax.Request.Events = - ['Uninitialized', 'Loading', 'Loaded', 'Interactive', 'Complete']; - -Ajax.Response = Class.create({ - initialize: function(request){ - this.request = request; - var transport = this.transport = request.transport, - readyState = this.readyState = transport.readyState; - - if((readyState > 2 && !Prototype.Browser.IE) || readyState == 4) { - this.status = this.getStatus(); - this.statusText = this.getStatusText(); - this.responseText = String.interpret(transport.responseText); - this.headerJSON = this._getHeaderJSON(); - } - - if(readyState == 4) { - var xml = transport.responseXML; - this.responseXML = Object.isUndefined(xml) ? null : xml; - this.responseJSON = this._getResponseJSON(); - } - }, - - status: 0, - statusText: '', - - getStatus: Ajax.Request.prototype.getStatus, - - getStatusText: function() { - try { - return this.transport.statusText || ''; - } catch (e) { return '' } - }, - - getHeader: Ajax.Request.prototype.getHeader, - - getAllHeaders: function() { - try { - return this.getAllResponseHeaders(); - } catch (e) { return null } - }, - - getResponseHeader: function(name) { - return this.transport.getResponseHeader(name); - }, - - getAllResponseHeaders: function() { - return this.transport.getAllResponseHeaders(); - }, - - _getHeaderJSON: function() { - var json = this.getHeader('X-JSON'); - if (!json) return null; - json = decodeURIComponent(escape(json)); - try { - return json.evalJSON(this.request.options.sanitizeJSON || - !this.request.isSameOrigin()); - } catch (e) { - this.request.dispatchException(e); - } - }, - - _getResponseJSON: function() { - var options = this.request.options; - if (!options.evalJSON || (options.evalJSON != 'force' && - !(this.getHeader('Content-type') || '').include('application/json')) || - this.responseText.blank()) - return null; - try { - return this.responseText.evalJSON(options.sanitizeJSON || - !this.request.isSameOrigin()); - } catch (e) { - this.request.dispatchException(e); - } - } -}); - -Ajax.Updater = Class.create(Ajax.Request, { - initialize: function($super, container, url, options) { - this.container = { - success: (container.success || container), - failure: (container.failure || (container.success ? null : container)) - }; - - options = Object.clone(options); - var onComplete = options.onComplete; - options.onComplete = (function(response, json) { - this.updateContent(response.responseText); - if (Object.isFunction(onComplete)) onComplete(response, json); - }).bind(this); - - $super(url, options); - }, - - updateContent: function(responseText) { - var receiver = this.container[this.success() ? 'success' : 'failure'], - options = this.options; - - if (!options.evalScripts) responseText = responseText.stripScripts(); - - if (receiver = $(receiver)) { - if (options.insertion) { - if (Object.isString(options.insertion)) { - var insertion = { }; insertion[options.insertion] = responseText; - receiver.insert(insertion); - } - else options.insertion(receiver, responseText); - } - else receiver.update(responseText); - } - } -}); - -Ajax.PeriodicalUpdater = Class.create(Ajax.Base, { - initialize: function($super, container, url, options) { - $super(options); - this.onComplete = this.options.onComplete; - - this.frequency = (this.options.frequency || 2); - this.decay = (this.options.decay || 1); - - this.updater = { }; - this.container = container; - this.url = url; - - this.start(); - }, - - start: function() { - this.options.onComplete = this.updateComplete.bind(this); - this.onTimerEvent(); - }, - - stop: function() { - this.updater.options.onComplete = undefined; - clearTimeout(this.timer); - (this.onComplete || Prototype.emptyFunction).apply(this, arguments); - }, - - updateComplete: function(response) { - if (this.options.decay) { - this.decay = (response.responseText == this.lastText ? - this.decay * this.options.decay : 1); - - this.lastText = response.responseText; - } - this.timer = this.onTimerEvent.bind(this).delay(this.decay * this.frequency); - }, - - onTimerEvent: function() { - this.updater = new Ajax.Updater(this.container, this.url, this.options); - } -}); -function $(element) { - if (arguments.length > 1) { - for (var i = 0, elements = [], length = arguments.length; i < length; i++) - elements.push($(arguments[i])); - return elements; - } - if (Object.isString(element)) - element = document.getElementById(element); - return Element.extend(element); -} - -if (Prototype.BrowserFeatures.XPath) { - document._getElementsByXPath = function(expression, parentElement) { - var results = []; - var query = document.evaluate(expression, $(parentElement) || document, - null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null); - for (var i = 0, length = query.snapshotLength; i < length; i++) - results.push(Element.extend(query.snapshotItem(i))); - return results; - }; -} - -/*--------------------------------------------------------------------------*/ - -if (!window.Node) var Node = { }; - -if (!Node.ELEMENT_NODE) { - // DOM level 2 ECMAScript Language Binding - Object.extend(Node, { - ELEMENT_NODE: 1, - ATTRIBUTE_NODE: 2, - TEXT_NODE: 3, - CDATA_SECTION_NODE: 4, - ENTITY_REFERENCE_NODE: 5, - ENTITY_NODE: 6, - PROCESSING_INSTRUCTION_NODE: 7, - COMMENT_NODE: 8, - DOCUMENT_NODE: 9, - DOCUMENT_TYPE_NODE: 10, - DOCUMENT_FRAGMENT_NODE: 11, - NOTATION_NODE: 12 - }); -} - -(function() { - var element = this.Element; - this.Element = function(tagName, attributes) { - attributes = attributes || { }; - tagName = tagName.toLowerCase(); - var cache = Element.cache; - if (Prototype.Browser.IE && attributes.name) { - tagName = '<' + tagName + ' name="' + attributes.name + '">'; - delete attributes.name; - return Element.writeAttribute(document.createElement(tagName), attributes); - } - if (!cache[tagName]) cache[tagName] = Element.extend(document.createElement(tagName)); - return Element.writeAttribute(cache[tagName].cloneNode(false), attributes); - }; - Object.extend(this.Element, element || { }); - if (element) this.Element.prototype = element.prototype; -}).call(window); - -Element.cache = { }; - -Element.Methods = { - visible: function(element) { - return $(element).style.display != 'none'; - }, - - toggle: function(element) { - element = $(element); - Element[Element.visible(element) ? 'hide' : 'show'](element); - return element; - }, - - hide: function(element) { - element = $(element); - element.style.display = 'none'; - return element; - }, - - show: function(element) { - element = $(element); - element.style.display = ''; - return element; - }, - - remove: function(element) { - element = $(element); - element.parentNode.removeChild(element); - return element; - }, - - update: function(element, content) { - element = $(element); - if (content && content.toElement) content = content.toElement(); - if (Object.isElement(content)) return element.update().insert(content); - content = Object.toHTML(content); - element.innerHTML = content.stripScripts(); - content.evalScripts.bind(content).defer(); - return element; - }, - - replace: function(element, content) { - element = $(element); - if (content && content.toElement) content = content.toElement(); - else if (!Object.isElement(content)) { - content = Object.toHTML(content); - var range = element.ownerDocument.createRange(); - range.selectNode(element); - content.evalScripts.bind(content).defer(); - content = range.createContextualFragment(content.stripScripts()); - } - element.parentNode.replaceChild(content, element); - return element; - }, - - insert: function(element, insertions) { - element = $(element); - - if (Object.isString(insertions) || Object.isNumber(insertions) || - Object.isElement(insertions) || (insertions && (insertions.toElement || insertions.toHTML))) - insertions = {bottom:insertions}; - - var content, insert, tagName, childNodes; - - for (var position in insertions) { - content = insertions[position]; - position = position.toLowerCase(); - insert = Element._insertionTranslations[position]; - - if (content && content.toElement) content = content.toElement(); - if (Object.isElement(content)) { - insert(element, content); - continue; - } - - content = Object.toHTML(content); - - tagName = ((position == 'before' || position == 'after') - ? element.parentNode : element).tagName.toUpperCase(); - - childNodes = Element._getContentFromAnonymousElement(tagName, content.stripScripts()); - - if (position == 'top' || position == 'after') childNodes.reverse(); - childNodes.each(insert.curry(element)); - - content.evalScripts.bind(content).defer(); - } - - return element; - }, - - wrap: function(element, wrapper, attributes) { - element = $(element); - if (Object.isElement(wrapper)) - $(wrapper).writeAttribute(attributes || { }); - else if (Object.isString(wrapper)) wrapper = new Element(wrapper, attributes); - else wrapper = new Element('div', wrapper); - if (element.parentNode) - element.parentNode.replaceChild(wrapper, element); - wrapper.appendChild(element); - return wrapper; - }, - - inspect: function(element) { - element = $(element); - var result = '<' + element.tagName.toLowerCase(); - $H({'id': 'id', 'className': 'class'}).each(function(pair) { - var property = pair.first(), attribute = pair.last(); - var value = (element[property] || '').toString(); - if (value) result += ' ' + attribute + '=' + value.inspect(true); - }); - return result + '>'; - }, - - recursivelyCollect: function(element, property) { - element = $(element); - var elements = []; - while (element = element[property]) - if (element.nodeType == 1) - elements.push(Element.extend(element)); - return elements; - }, - - ancestors: function(element) { - return $(element).recursivelyCollect('parentNode'); - }, - - descendants: function(element) { - return $(element).select("*"); - }, - - firstDescendant: function(element) { - element = $(element).firstChild; - while (element && element.nodeType != 1) element = element.nextSibling; - return $(element); - }, - - immediateDescendants: function(element) { - if (!(element = $(element).firstChild)) return []; - while (element && element.nodeType != 1) element = element.nextSibling; - if (element) return [element].concat($(element).nextSiblings()); - return []; - }, - - previousSiblings: function(element) { - return $(element).recursivelyCollect('previousSibling'); - }, - - nextSiblings: function(element) { - return $(element).recursivelyCollect('nextSibling'); - }, - - siblings: function(element) { - element = $(element); - return element.previousSiblings().reverse().concat(element.nextSiblings()); - }, - - match: function(element, selector) { - if (Object.isString(selector)) - selector = new Selector(selector); - return selector.match($(element)); - }, - - up: function(element, expression, index) { - element = $(element); - if (arguments.length == 1) return $(element.parentNode); - var ancestors = element.ancestors(); - return Object.isNumber(expression) ? ancestors[expression] : - Selector.findElement(ancestors, expression, index); - }, - - down: function(element, expression, index) { - element = $(element); - if (arguments.length == 1) return element.firstDescendant(); - return Object.isNumber(expression) ? element.descendants()[expression] : - Element.select(element, expression)[index || 0]; - }, - - previous: function(element, expression, index) { - element = $(element); - if (arguments.length == 1) return $(Selector.handlers.previousElementSibling(element)); - var previousSiblings = element.previousSiblings(); - return Object.isNumber(expression) ? previousSiblings[expression] : - Selector.findElement(previousSiblings, expression, index); - }, - - next: function(element, expression, index) { - element = $(element); - if (arguments.length == 1) return $(Selector.handlers.nextElementSibling(element)); - var nextSiblings = element.nextSiblings(); - return Object.isNumber(expression) ? nextSiblings[expression] : - Selector.findElement(nextSiblings, expression, index); - }, - - select: function() { - var args = $A(arguments), element = $(args.shift()); - return Selector.findChildElements(element, args); - }, - - adjacent: function() { - var args = $A(arguments), element = $(args.shift()); - return Selector.findChildElements(element.parentNode, args).without(element); - }, - - identify: function(element) { - element = $(element); - var id = element.readAttribute('id'), self = arguments.callee; - if (id) return id; - do { id = 'anonymous_element_' + self.counter++ } while ($(id)); - element.writeAttribute('id', id); - return id; - }, - - readAttribute: function(element, name) { - element = $(element); - if (Prototype.Browser.IE) { - var t = Element._attributeTranslations.read; - if (t.values[name]) return t.values[name](element, name); - if (t.names[name]) name = t.names[name]; - if (name.include(':')) { - return (!element.attributes || !element.attributes[name]) ? null : - element.attributes[name].value; - } - } - return element.getAttribute(name); - }, - - writeAttribute: function(element, name, value) { - element = $(element); - var attributes = { }, t = Element._attributeTranslations.write; - - if (typeof name == 'object') attributes = name; - else attributes[name] = Object.isUndefined(value) ? true : value; - - for (var attr in attributes) { - name = t.names[attr] || attr; - value = attributes[attr]; - if (t.values[attr]) name = t.values[attr](element, value); - if (value === false || value === null) - element.removeAttribute(name); - else if (value === true) - element.setAttribute(name, name); - else element.setAttribute(name, value); - } - return element; - }, - - getHeight: function(element) { - return $(element).getDimensions().height; - }, - - getWidth: function(element) { - return $(element).getDimensions().width; - }, - - classNames: function(element) { - return new Element.ClassNames(element); - }, - - hasClassName: function(element, className) { - if (!(element = $(element))) return; - var elementClassName = element.className; - return (elementClassName.length > 0 && (elementClassName == className || - new RegExp("(^|\\s)" + className + "(\\s|$)").test(elementClassName))); - }, - - addClassName: function(element, className) { - if (!(element = $(element))) return; - if (!element.hasClassName(className)) - element.className += (element.className ? ' ' : '') + className; - return element; - }, - - removeClassName: function(element, className) { - if (!(element = $(element))) return; - element.className = element.className.replace( - new RegExp("(^|\\s+)" + className + "(\\s+|$)"), ' ').strip(); - return element; - }, - - toggleClassName: function(element, className) { - if (!(element = $(element))) return; - return element[element.hasClassName(className) ? - 'removeClassName' : 'addClassName'](className); - }, - - // removes whitespace-only text node children - cleanWhitespace: function(element) { - element = $(element); - var node = element.firstChild; - while (node) { - var nextNode = node.nextSibling; - if (node.nodeType == 3 && !/\S/.test(node.nodeValue)) - element.removeChild(node); - node = nextNode; - } - return element; - }, - - empty: function(element) { - return $(element).innerHTML.blank(); - }, - - descendantOf: function(element, ancestor) { - element = $(element), ancestor = $(ancestor); - - if (element.compareDocumentPosition) - return (element.compareDocumentPosition(ancestor) & 8) === 8; - - if (ancestor.contains) - return ancestor.contains(element) && ancestor !== element; - - while (element = element.parentNode) - if (element == ancestor) return true; - - return false; - }, - - scrollTo: function(element) { - element = $(element); - var pos = element.cumulativeOffset(); - window.scrollTo(pos[0], pos[1]); - return element; - }, - - getStyle: function(element, style) { - element = $(element); - style = style == 'float' ? 'cssFloat' : style.camelize(); - var value = element.style[style]; - if (!value || value == 'auto') { - var css = document.defaultView.getComputedStyle(element, null); - value = css ? css[style] : null; - } - if (style == 'opacity') return value ? parseFloat(value) : 1.0; - return value == 'auto' ? null : value; - }, - - getOpacity: function(element) { - return $(element).getStyle('opacity'); - }, - - setStyle: function(element, styles) { - element = $(element); - var elementStyle = element.style, match; - if (Object.isString(styles)) { - element.style.cssText += ';' + styles; - return styles.include('opacity') ? - element.setOpacity(styles.match(/opacity:\s*(\d?\.?\d*)/)[1]) : element; - } - for (var property in styles) - if (property == 'opacity') element.setOpacity(styles[property]); - else - elementStyle[(property == 'float' || property == 'cssFloat') ? - (Object.isUndefined(elementStyle.styleFloat) ? 'cssFloat' : 'styleFloat') : - property] = styles[property]; - - return element; - }, - - setOpacity: function(element, value) { - element = $(element); - element.style.opacity = (value == 1 || value === '') ? '' : - (value < 0.00001) ? 0 : value; - return element; - }, - - getDimensions: function(element) { - element = $(element); - var display = element.getStyle('display'); - if (display != 'none' && display != null) // Safari bug - return {width: element.offsetWidth, height: element.offsetHeight}; - - // All *Width and *Height properties give 0 on elements with display none, - // so enable the element temporarily - var els = element.style; - var originalVisibility = els.visibility; - var originalPosition = els.position; - var originalDisplay = els.display; - els.visibility = 'hidden'; - els.position = 'absolute'; - els.display = 'block'; - var originalWidth = element.clientWidth; - var originalHeight = element.clientHeight; - els.display = originalDisplay; - els.position = originalPosition; - els.visibility = originalVisibility; - return {width: originalWidth, height: originalHeight}; - }, - - makePositioned: function(element) { - element = $(element); - var pos = Element.getStyle(element, 'position'); - if (pos == 'static' || !pos) { - element._madePositioned = true; - element.style.position = 'relative'; - // Opera returns the offset relative to the positioning context, when an - // element is position relative but top and left have not been defined - if (Prototype.Browser.Opera) { - element.style.top = 0; - element.style.left = 0; - } - } - return element; - }, - - undoPositioned: function(element) { - element = $(element); - if (element._madePositioned) { - element._madePositioned = undefined; - element.style.position = - element.style.top = - element.style.left = - element.style.bottom = - element.style.right = ''; - } - return element; - }, - - makeClipping: function(element) { - element = $(element); - if (element._overflow) return element; - element._overflow = Element.getStyle(element, 'overflow') || 'auto'; - if (element._overflow !== 'hidden') - element.style.overflow = 'hidden'; - return element; - }, - - undoClipping: function(element) { - element = $(element); - if (!element._overflow) return element; - element.style.overflow = element._overflow == 'auto' ? '' : element._overflow; - element._overflow = null; - return element; - }, - - cumulativeOffset: function(element) { - var valueT = 0, valueL = 0; - do { - valueT += element.offsetTop || 0; - valueL += element.offsetLeft || 0; - element = element.offsetParent; - } while (element); - return Element._returnOffset(valueL, valueT); - }, - - positionedOffset: function(element) { - var valueT = 0, valueL = 0; - do { - valueT += element.offsetTop || 0; - valueL += element.offsetLeft || 0; - element = element.offsetParent; - if (element) { - if (element.tagName.toUpperCase() == 'BODY') break; - var p = Element.getStyle(element, 'position'); - if (p !== 'static') break; - } - } while (element); - return Element._returnOffset(valueL, valueT); - }, - - absolutize: function(element) { - element = $(element); - if (element.getStyle('position') == 'absolute') return element; - // Position.prepare(); // To be done manually by Scripty when it needs it. - - var offsets = element.positionedOffset(); - var top = offsets[1]; - var left = offsets[0]; - var width = element.clientWidth; - var height = element.clientHeight; - - element._originalLeft = left - parseFloat(element.style.left || 0); - element._originalTop = top - parseFloat(element.style.top || 0); - element._originalWidth = element.style.width; - element._originalHeight = element.style.height; - - element.style.position = 'absolute'; - element.style.top = top + 'px'; - element.style.left = left + 'px'; - element.style.width = width + 'px'; - element.style.height = height + 'px'; - return element; - }, - - relativize: function(element) { - element = $(element); - if (element.getStyle('position') == 'relative') return element; - // Position.prepare(); // To be done manually by Scripty when it needs it. - - element.style.position = 'relative'; - var top = parseFloat(element.style.top || 0) - (element._originalTop || 0); - var left = parseFloat(element.style.left || 0) - (element._originalLeft || 0); - - element.style.top = top + 'px'; - element.style.left = left + 'px'; - element.style.height = element._originalHeight; - element.style.width = element._originalWidth; - return element; - }, - - cumulativeScrollOffset: function(element) { - var valueT = 0, valueL = 0; - do { - valueT += element.scrollTop || 0; - valueL += element.scrollLeft || 0; - element = element.parentNode; - } while (element); - return Element._returnOffset(valueL, valueT); - }, - - getOffsetParent: function(element) { - if (element.offsetParent) return $(element.offsetParent); - if (element == document.body) return $(element); - - while ((element = element.parentNode) && element != document.body) - if (Element.getStyle(element, 'position') != 'static') - return $(element); - - return $(document.body); - }, - - viewportOffset: function(forElement) { - var valueT = 0, valueL = 0; - - var element = forElement; - do { - valueT += element.offsetTop || 0; - valueL += element.offsetLeft || 0; - - // Safari fix - if (element.offsetParent == document.body && - Element.getStyle(element, 'position') == 'absolute') break; - - } while (element = element.offsetParent); - - element = forElement; - do { - if (!Prototype.Browser.Opera || (element.tagName && (element.tagName.toUpperCase() == 'BODY'))) { - valueT -= element.scrollTop || 0; - valueL -= element.scrollLeft || 0; - } - } while (element = element.parentNode); - - return Element._returnOffset(valueL, valueT); - }, - - clonePosition: function(element, source) { - var options = Object.extend({ - setLeft: true, - setTop: true, - setWidth: true, - setHeight: true, - offsetTop: 0, - offsetLeft: 0 - }, arguments[2] || { }); - - // find page position of source - source = $(source); - var p = source.viewportOffset(); - - // find coordinate system to use - element = $(element); - var delta = [0, 0]; - var parent = null; - // delta [0,0] will do fine with position: fixed elements, - // position:absolute needs offsetParent deltas - if (Element.getStyle(element, 'position') == 'absolute') { - parent = element.getOffsetParent(); - delta = parent.viewportOffset(); - } - - // correct by body offsets (fixes Safari) - if (parent == document.body) { - delta[0] -= document.body.offsetLeft; - delta[1] -= document.body.offsetTop; - } - - // set position - if (options.setLeft) element.style.left = (p[0] - delta[0] + options.offsetLeft) + 'px'; - if (options.setTop) element.style.top = (p[1] - delta[1] + options.offsetTop) + 'px'; - if (options.setWidth) element.style.width = source.offsetWidth + 'px'; - if (options.setHeight) element.style.height = source.offsetHeight + 'px'; - return element; - } -}; - -Element.Methods.identify.counter = 1; - -Object.extend(Element.Methods, { - getElementsBySelector: Element.Methods.select, - childElements: Element.Methods.immediateDescendants -}); - -Element._attributeTranslations = { - write: { - names: { - className: 'class', - htmlFor: 'for' - }, - values: { } - } -}; - -if (Prototype.Browser.Opera) { - Element.Methods.getStyle = Element.Methods.getStyle.wrap( - function(proceed, element, style) { - switch (style) { - case 'left': case 'top': case 'right': case 'bottom': - if (proceed(element, 'position') === 'static') return null; - case 'height': case 'width': - // returns '0px' for hidden elements; we want it to return null - if (!Element.visible(element)) return null; - - // returns the border-box dimensions rather than the content-box - // dimensions, so we subtract padding and borders from the value - var dim = parseInt(proceed(element, style), 10); - - if (dim !== element['offset' + style.capitalize()]) - return dim + 'px'; - - var properties; - if (style === 'height') { - properties = ['border-top-width', 'padding-top', - 'padding-bottom', 'border-bottom-width']; - } - else { - properties = ['border-left-width', 'padding-left', - 'padding-right', 'border-right-width']; - } - return properties.inject(dim, function(memo, property) { - var val = proceed(element, property); - return val === null ? memo : memo - parseInt(val, 10); - }) + 'px'; - default: return proceed(element, style); - } - } - ); - - Element.Methods.readAttribute = Element.Methods.readAttribute.wrap( - function(proceed, element, attribute) { - if (attribute === 'title') return element.title; - return proceed(element, attribute); - } - ); -} - -else if (Prototype.Browser.IE) { - // IE doesn't report offsets correctly for static elements, so we change them - // to "relative" to get the values, then change them back. - Element.Methods.getOffsetParent = Element.Methods.getOffsetParent.wrap( - function(proceed, element) { - element = $(element); - // IE throws an error if element is not in document - try { element.offsetParent } - catch(e) { return $(document.body) } - var position = element.getStyle('position'); - if (position !== 'static') return proceed(element); - element.setStyle({ position: 'relative' }); - var value = proceed(element); - element.setStyle({ position: position }); - return value; - } - ); - - $w('positionedOffset viewportOffset').each(function(method) { - Element.Methods[method] = Element.Methods[method].wrap( - function(proceed, element) { - element = $(element); - try { element.offsetParent } - catch(e) { return Element._returnOffset(0,0) } - var position = element.getStyle('position'); - if (position !== 'static') return proceed(element); - // Trigger hasLayout on the offset parent so that IE6 reports - // accurate offsetTop and offsetLeft values for position: fixed. - var offsetParent = element.getOffsetParent(); - if (offsetParent && offsetParent.getStyle('position') === 'fixed') - offsetParent.setStyle({ zoom: 1 }); - element.setStyle({ position: 'relative' }); - var value = proceed(element); - element.setStyle({ position: position }); - return value; - } - ); - }); - - Element.Methods.cumulativeOffset = Element.Methods.cumulativeOffset.wrap( - function(proceed, element) { - try { element.offsetParent } - catch(e) { return Element._returnOffset(0,0) } - return proceed(element); - } - ); - - Element.Methods.getStyle = function(element, style) { - element = $(element); - style = (style == 'float' || style == 'cssFloat') ? 'styleFloat' : style.camelize(); - var value = element.style[style]; - if (!value && element.currentStyle) value = element.currentStyle[style]; - - if (style == 'opacity') { - if (value = (element.getStyle('filter') || '').match(/alpha\(opacity=(.*)\)/)) - if (value[1]) return parseFloat(value[1]) / 100; - return 1.0; - } - - if (value == 'auto') { - if ((style == 'width' || style == 'height') && (element.getStyle('display') != 'none')) - return element['offset' + style.capitalize()] + 'px'; - return null; - } - return value; - }; - - Element.Methods.setOpacity = function(element, value) { - function stripAlpha(filter){ - return filter.replace(/alpha\([^\)]*\)/gi,''); - } - element = $(element); - var currentStyle = element.currentStyle; - if ((currentStyle && !currentStyle.hasLayout) || - (!currentStyle && element.style.zoom == 'normal')) - element.style.zoom = 1; - - var filter = element.getStyle('filter'), style = element.style; - if (value == 1 || value === '') { - (filter = stripAlpha(filter)) ? - style.filter = filter : style.removeAttribute('filter'); - return element; - } else if (value < 0.00001) value = 0; - style.filter = stripAlpha(filter) + - 'alpha(opacity=' + (value * 100) + ')'; - return element; - }; - - Element._attributeTranslations = { - read: { - names: { - 'class': 'className', - 'for': 'htmlFor' - }, - values: { - _getAttr: function(element, attribute) { - return element.getAttribute(attribute, 2); - }, - _getAttrNode: function(element, attribute) { - var node = element.getAttributeNode(attribute); - return node ? node.value : ""; - }, - _getEv: function(element, attribute) { - attribute = element.getAttribute(attribute); - return attribute ? attribute.toString().slice(23, -2) : null; - }, - _flag: function(element, attribute) { - return $(element).hasAttribute(attribute) ? attribute : null; - }, - style: function(element) { - return element.style.cssText.toLowerCase(); - }, - title: function(element) { - return element.title; - } - } - } - }; - - Element._attributeTranslations.write = { - names: Object.extend({ - cellpadding: 'cellPadding', - cellspacing: 'cellSpacing' - }, Element._attributeTranslations.read.names), - values: { - checked: function(element, value) { - element.checked = !!value; - }, - - style: function(element, value) { - element.style.cssText = value ? value : ''; - } - } - }; - - Element._attributeTranslations.has = {}; - - $w('colSpan rowSpan vAlign dateTime accessKey tabIndex ' + - 'encType maxLength readOnly longDesc frameBorder').each(function(attr) { - Element._attributeTranslations.write.names[attr.toLowerCase()] = attr; - Element._attributeTranslations.has[attr.toLowerCase()] = attr; - }); - - (function(v) { - Object.extend(v, { - href: v._getAttr, - src: v._getAttr, - type: v._getAttr, - action: v._getAttrNode, - disabled: v._flag, - checked: v._flag, - readonly: v._flag, - multiple: v._flag, - onload: v._getEv, - onunload: v._getEv, - onclick: v._getEv, - ondblclick: v._getEv, - onmousedown: v._getEv, - onmouseup: v._getEv, - onmouseover: v._getEv, - onmousemove: v._getEv, - onmouseout: v._getEv, - onfocus: v._getEv, - onblur: v._getEv, - onkeypress: v._getEv, - onkeydown: v._getEv, - onkeyup: v._getEv, - onsubmit: v._getEv, - onreset: v._getEv, - onselect: v._getEv, - onchange: v._getEv - }); - })(Element._attributeTranslations.read.values); -} - -else if (Prototype.Browser.Gecko && /rv:1\.8\.0/.test(navigator.userAgent)) { - Element.Methods.setOpacity = function(element, value) { - element = $(element); - element.style.opacity = (value == 1) ? 0.999999 : - (value === '') ? '' : (value < 0.00001) ? 0 : value; - return element; - }; -} - -else if (Prototype.Browser.WebKit) { - Element.Methods.setOpacity = function(element, value) { - element = $(element); - element.style.opacity = (value == 1 || value === '') ? '' : - (value < 0.00001) ? 0 : value; - - if (value == 1) - if(element.tagName.toUpperCase() == 'IMG' && element.width) { - element.width++; element.width--; - } else try { - var n = document.createTextNode(' '); - element.appendChild(n); - element.removeChild(n); - } catch (e) { } - - return element; - }; - - // Safari returns margins on body which is incorrect if the child is absolutely - // positioned. For performance reasons, redefine Element#cumulativeOffset for - // KHTML/WebKit only. - Element.Methods.cumulativeOffset = function(element) { - var valueT = 0, valueL = 0; - do { - valueT += element.offsetTop || 0; - valueL += element.offsetLeft || 0; - if (element.offsetParent == document.body) - if (Element.getStyle(element, 'position') == 'absolute') break; - - element = element.offsetParent; - } while (element); - - return Element._returnOffset(valueL, valueT); - }; -} - -if (Prototype.Browser.IE || Prototype.Browser.Opera) { - // IE and Opera are missing .innerHTML support for TABLE-related and SELECT elements - Element.Methods.update = function(element, content) { - element = $(element); - - if (content && content.toElement) content = content.toElement(); - if (Object.isElement(content)) return element.update().insert(content); - - content = Object.toHTML(content); - var tagName = element.tagName.toUpperCase(); - - if (tagName in Element._insertionTranslations.tags) { - $A(element.childNodes).each(function(node) { element.removeChild(node) }); - Element._getContentFromAnonymousElement(tagName, content.stripScripts()) - .each(function(node) { element.appendChild(node) }); - } - else element.innerHTML = content.stripScripts(); - - content.evalScripts.bind(content).defer(); - return element; - }; -} - -if ('outerHTML' in document.createElement('div')) { - Element.Methods.replace = function(element, content) { - element = $(element); - - if (content && content.toElement) content = content.toElement(); - if (Object.isElement(content)) { - element.parentNode.replaceChild(content, element); - return element; - } - - content = Object.toHTML(content); - var parent = element.parentNode, tagName = parent.tagName.toUpperCase(); - - if (Element._insertionTranslations.tags[tagName]) { - var nextSibling = element.next(); - var fragments = Element._getContentFromAnonymousElement(tagName, content.stripScripts()); - parent.removeChild(element); - if (nextSibling) - fragments.each(function(node) { parent.insertBefore(node, nextSibling) }); - else - fragments.each(function(node) { parent.appendChild(node) }); - } - else element.outerHTML = content.stripScripts(); - - content.evalScripts.bind(content).defer(); - return element; - }; -} - -Element._returnOffset = function(l, t) { - var result = [l, t]; - result.left = l; - result.top = t; - return result; -}; - -Element._getContentFromAnonymousElement = function(tagName, html) { - var div = new Element('div'), t = Element._insertionTranslations.tags[tagName]; - if (t) { - div.innerHTML = t[0] + html + t[1]; - t[2].times(function() { div = div.firstChild }); - } else div.innerHTML = html; - return $A(div.childNodes); -}; - -Element._insertionTranslations = { - before: function(element, node) { - element.parentNode.insertBefore(node, element); - }, - top: function(element, node) { - element.insertBefore(node, element.firstChild); - }, - bottom: function(element, node) { - element.appendChild(node); - }, - after: function(element, node) { - element.parentNode.insertBefore(node, element.nextSibling); - }, - tags: { - TABLE: ['<table>', '</table>', 1], - TBODY: ['<table><tbody>', '</tbody></table>', 2], - TR: ['<table><tbody><tr>', '</tr></tbody></table>', 3], - TD: ['<table><tbody><tr><td>', '</td></tr></tbody></table>', 4], - SELECT: ['<select>', '</select>', 1] - } -}; - -(function() { - Object.extend(this.tags, { - THEAD: this.tags.TBODY, - TFOOT: this.tags.TBODY, - TH: this.tags.TD - }); -}).call(Element._insertionTranslations); - -Element.Methods.Simulated = { - hasAttribute: function(element, attribute) { - attribute = Element._attributeTranslations.has[attribute] || attribute; - var node = $(element).getAttributeNode(attribute); - return !!(node && node.specified); - } -}; - -Element.Methods.ByTag = { }; - -Object.extend(Element, Element.Methods); - -if (!Prototype.BrowserFeatures.ElementExtensions && - document.createElement('div')['__proto__']) { - window.HTMLElement = { }; - window.HTMLElement.prototype = document.createElement('div')['__proto__']; - Prototype.BrowserFeatures.ElementExtensions = true; -} - -Element.extend = (function() { - if (Prototype.BrowserFeatures.SpecificElementExtensions) - return Prototype.K; - - var Methods = { }, ByTag = Element.Methods.ByTag; - - var extend = Object.extend(function(element) { - if (!element || element._extendedByPrototype || - element.nodeType != 1 || element == window) return element; - - var methods = Object.clone(Methods), - tagName = element.tagName.toUpperCase(), property, value; - - // extend methods for specific tags - if (ByTag[tagName]) Object.extend(methods, ByTag[tagName]); - - for (property in methods) { - value = methods[property]; - if (Object.isFunction(value) && !(property in element)) - element[property] = value.methodize(); - } - - element._extendedByPrototype = Prototype.emptyFunction; - return element; - - }, { - refresh: function() { - // extend methods for all tags (Safari doesn't need this) - if (!Prototype.BrowserFeatures.ElementExtensions) { - Object.extend(Methods, Element.Methods); - Object.extend(Methods, Element.Methods.Simulated); - } - } - }); - - extend.refresh(); - return extend; -})(); - -Element.hasAttribute = function(element, attribute) { - if (element.hasAttribute) return element.hasAttribute(attribute); - return Element.Methods.Simulated.hasAttribute(element, attribute); -}; - -Element.addMethods = function(methods) { - var F = Prototype.BrowserFeatures, T = Element.Methods.ByTag; - - if (!methods) { - Object.extend(Form, Form.Methods); - Object.extend(Form.Element, Form.Element.Methods); - Object.extend(Element.Methods.ByTag, { - "FORM": Object.clone(Form.Methods), - "INPUT": Object.clone(Form.Element.Methods), - "SELECT": Object.clone(Form.Element.Methods), - "TEXTAREA": Object.clone(Form.Element.Methods) - }); - } - - if (arguments.length == 2) { - var tagName = methods; - methods = arguments[1]; - } - - if (!tagName) Object.extend(Element.Methods, methods || { }); - else { - if (Object.isArray(tagName)) tagName.each(extend); - else extend(tagName); - } - - function extend(tagName) { - tagName = tagName.toUpperCase(); - if (!Element.Methods.ByTag[tagName]) - Element.Methods.ByTag[tagName] = { }; - Object.extend(Element.Methods.ByTag[tagName], methods); - } - - function copy(methods, destination, onlyIfAbsent) { - onlyIfAbsent = onlyIfAbsent || false; - for (var property in methods) { - var value = methods[property]; - if (!Object.isFunction(value)) continue; - if (!onlyIfAbsent || !(property in destination)) - destination[property] = value.methodize(); - } - } - - function findDOMClass(tagName) { - var klass; - var trans = { - "OPTGROUP": "OptGroup", "TEXTAREA": "TextArea", "P": "Paragraph", - "FIELDSET": "FieldSet", "UL": "UList", "OL": "OList", "DL": "DList", - "DIR": "Directory", "H1": "Heading", "H2": "Heading", "H3": "Heading", - "H4": "Heading", "H5": "Heading", "H6": "Heading", "Q": "Quote", - "INS": "Mod", "DEL": "Mod", "A": "Anchor", "IMG": "Image", "CAPTION": - "TableCaption", "COL": "TableCol", "COLGROUP": "TableCol", "THEAD": - "TableSection", "TFOOT": "TableSection", "TBODY": "TableSection", "TR": - "TableRow", "TH": "TableCell", "TD": "TableCell", "FRAMESET": - "FrameSet", "IFRAME": "IFrame" - }; - if (trans[tagName]) klass = 'HTML' + trans[tagName] + 'Element'; - if (window[klass]) return window[klass]; - klass = 'HTML' + tagName + 'Element'; - if (window[klass]) return window[klass]; - klass = 'HTML' + tagName.capitalize() + 'Element'; - if (window[klass]) return window[klass]; - - window[klass] = { }; - window[klass].prototype = document.createElement(tagName)['__proto__']; - return window[klass]; - } - - if (F.ElementExtensions) { - copy(Element.Methods, HTMLElement.prototype); - copy(Element.Methods.Simulated, HTMLElement.prototype, true); - } - - if (F.SpecificElementExtensions) { - for (var tag in Element.Methods.ByTag) { - var klass = findDOMClass(tag); - if (Object.isUndefined(klass)) continue; - copy(T[tag], klass.prototype); - } - } - - Object.extend(Element, Element.Methods); - delete Element.ByTag; - - if (Element.extend.refresh) Element.extend.refresh(); - Element.cache = { }; -}; - -document.viewport = { - getDimensions: function() { - var dimensions = { }, B = Prototype.Browser; - $w('width height').each(function(d) { - var D = d.capitalize(); - if (B.WebKit && !document.evaluate) { - // Safari <3.0 needs self.innerWidth/Height - dimensions[d] = self['inner' + D]; - } else if (B.Opera && parseFloat(window.opera.version()) < 9.5) { - // Opera <9.5 needs document.body.clientWidth/Height - dimensions[d] = document.body['client' + D] - } else { - dimensions[d] = document.documentElement['client' + D]; - } - }); - return dimensions; - }, - - getWidth: function() { - return this.getDimensions().width; - }, - - getHeight: function() { - return this.getDimensions().height; - }, - - getScrollOffsets: function() { - return Element._returnOffset( - window.pageXOffset || document.documentElement.scrollLeft || document.body.scrollLeft, - window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop); - } -}; -/* Portions of the Selector class are derived from Jack Slocum's DomQuery, - * part of YUI-Ext version 0.40, distributed under the terms of an MIT-style - * license. Please see http://www.yui-ext.com/ for more information. */ - -var Selector = Class.create({ - initialize: function(expression) { - this.expression = expression.strip(); - - if (this.shouldUseSelectorsAPI()) { - this.mode = 'selectorsAPI'; - } else if (this.shouldUseXPath()) { - this.mode = 'xpath'; - this.compileXPathMatcher(); - } else { - this.mode = "normal"; - this.compileMatcher(); - } - - }, - - shouldUseXPath: function() { - if (!Prototype.BrowserFeatures.XPath) return false; - - var e = this.expression; - - // Safari 3 chokes on :*-of-type and :empty - if (Prototype.Browser.WebKit && - (e.include("-of-type") || e.include(":empty"))) - return false; - - // XPath can't do namespaced attributes, nor can it read - // the "checked" property from DOM nodes - if ((/(\[[\w-]*?:|:checked)/).test(e)) - return false; - - return true; - }, - - shouldUseSelectorsAPI: function() { - if (!Prototype.BrowserFeatures.SelectorsAPI) return false; - - if (!Selector._div) Selector._div = new Element('div'); - - // Make sure the browser treats the selector as valid. Test on an - // isolated element to minimize cost of this check. - try { - Selector._div.querySelector(this.expression); - } catch(e) { - return false; - } - - return true; - }, - - compileMatcher: function() { - var e = this.expression, ps = Selector.patterns, h = Selector.handlers, - c = Selector.criteria, le, p, m; - - if (Selector._cache[e]) { - this.matcher = Selector._cache[e]; - return; - } - - this.matcher = ["this.matcher = function(root) {", - "var r = root, h = Selector.handlers, c = false, n;"]; - - while (e && le != e && (/\S/).test(e)) { - le = e; - for (var i in ps) { - p = ps[i]; - if (m = e.match(p)) { - this.matcher.push(Object.isFunction(c[i]) ? c[i](m) : - new Template(c[i]).evaluate(m)); - e = e.replace(m[0], ''); - break; - } - } - } - - this.matcher.push("return h.unique(n);\n}"); - eval(this.matcher.join('\n')); - Selector._cache[this.expression] = this.matcher; - }, - - compileXPathMatcher: function() { - var e = this.expression, ps = Selector.patterns, - x = Selector.xpath, le, m; - - if (Selector._cache[e]) { - this.xpath = Selector._cache[e]; return; - } - - this.matcher = ['.//*']; - while (e && le != e && (/\S/).test(e)) { - le = e; - for (var i in ps) { - if (m = e.match(ps[i])) { - this.matcher.push(Object.isFunction(x[i]) ? x[i](m) : - new Template(x[i]).evaluate(m)); - e = e.replace(m[0], ''); - break; - } - } - } - - this.xpath = this.matcher.join(''); - Selector._cache[this.expression] = this.xpath; - }, - - findElements: function(root) { - root = root || document; - var e = this.expression, results; - - switch (this.mode) { - case 'selectorsAPI': - // querySelectorAll queries document-wide, then filters to descendants - // of the context element. That's not what we want. - // Add an explicit context to the selector if necessary. - if (root !== document) { - var oldId = root.id, id = $(root).identify(); - e = "#" + id + " " + e; - } - - results = $A(root.querySelectorAll(e)).map(Element.extend); - root.id = oldId; - - return results; - case 'xpath': - return document._getElementsByXPath(this.xpath, root); - default: - return this.matcher(root); - } - }, - - match: function(element) { - this.tokens = []; - - var e = this.expression, ps = Selector.patterns, as = Selector.assertions; - var le, p, m; - - while (e && le !== e && (/\S/).test(e)) { - le = e; - for (var i in ps) { - p = ps[i]; - if (m = e.match(p)) { - // use the Selector.assertions methods unless the selector - // is too complex. - if (as[i]) { - this.tokens.push([i, Object.clone(m)]); - e = e.replace(m[0], ''); - } else { - // reluctantly do a document-wide search - // and look for a match in the array - return this.findElements(document).include(element); - } - } - } - } - - var match = true, name, matches; - for (var i = 0, token; token = this.tokens[i]; i++) { - name = token[0], matches = token[1]; - if (!Selector.assertions[name](element, matches)) { - match = false; break; - } - } - - return match; - }, - - toString: function() { - return this.expression; - }, - - inspect: function() { - return "#<Selector:" + this.expression.inspect() + ">"; - } -}); - -Object.extend(Selector, { - _cache: { }, - - xpath: { - descendant: "//*", - child: "/*", - adjacent: "/following-sibling::*[1]", - laterSibling: '/following-sibling::*', - tagName: function(m) { - if (m[1] == '*') return ''; - return "[local-name()='" + m[1].toLowerCase() + - "' or local-name()='" + m[1].toUpperCase() + "']"; - }, - className: "[contains(concat(' ', @class, ' '), ' #{1} ')]", - id: "[@id='#{1}']", - attrPresence: function(m) { - m[1] = m[1].toLowerCase(); - return new Template("[@#{1}]").evaluate(m); - }, - attr: function(m) { - m[1] = m[1].toLowerCase(); - m[3] = m[5] || m[6]; - return new Template(Selector.xpath.operators[m[2]]).evaluate(m); - }, - pseudo: function(m) { - var h = Selector.xpath.pseudos[m[1]]; - if (!h) return ''; - if (Object.isFunction(h)) return h(m); - return new Template(Selector.xpath.pseudos[m[1]]).evaluate(m); - }, - operators: { - '=': "[@#{1}='#{3}']", - '!=': "[@#{1}!='#{3}']", - '^=': "[starts-with(@#{1}, '#{3}')]", - '$=': "[substring(@#{1}, (string-length(@#{1}) - string-length('#{3}') + 1))='#{3}']", - '*=': "[contains(@#{1}, '#{3}')]", - '~=': "[contains(concat(' ', @#{1}, ' '), ' #{3} ')]", - '|=': "[contains(concat('-', @#{1}, '-'), '-#{3}-')]" - }, - pseudos: { - 'first-child': '[not(preceding-sibling::*)]', - 'last-child': '[not(following-sibling::*)]', - 'only-child': '[not(preceding-sibling::* or following-sibling::*)]', - 'empty': "[count(*) = 0 and (count(text()) = 0)]", - 'checked': "[@checked]", - 'disabled': "[(@disabled) and (@type!='hidden')]", - 'enabled': "[not(@disabled) and (@type!='hidden')]", - 'not': function(m) { - var e = m[6], p = Selector.patterns, - x = Selector.xpath, le, v; - - var exclusion = []; - while (e && le != e && (/\S/).test(e)) { - le = e; - for (var i in p) { - if (m = e.match(p[i])) { - v = Object.isFunction(x[i]) ? x[i](m) : new Template(x[i]).evaluate(m); - exclusion.push("(" + v.substring(1, v.length - 1) + ")"); - e = e.replace(m[0], ''); - break; - } - } - } - return "[not(" + exclusion.join(" and ") + ")]"; - }, - 'nth-child': function(m) { - return Selector.xpath.pseudos.nth("(count(./preceding-sibling::*) + 1) ", m); - }, - 'nth-last-child': function(m) { - return Selector.xpath.pseudos.nth("(count(./following-sibling::*) + 1) ", m); - }, - 'nth-of-type': function(m) { - return Selector.xpath.pseudos.nth("position() ", m); - }, - 'nth-last-of-type': function(m) { - return Selector.xpath.pseudos.nth("(last() + 1 - position()) ", m); - }, - 'first-of-type': function(m) { - m[6] = "1"; return Selector.xpath.pseudos['nth-of-type'](m); - }, - 'last-of-type': function(m) { - m[6] = "1"; return Selector.xpath.pseudos['nth-last-of-type'](m); - }, - 'only-of-type': function(m) { - var p = Selector.xpath.pseudos; return p['first-of-type'](m) + p['last-of-type'](m); - }, - nth: function(fragment, m) { - var mm, formula = m[6], predicate; - if (formula == 'even') formula = '2n+0'; - if (formula == 'odd') formula = '2n+1'; - if (mm = formula.match(/^(\d+)$/)) // digit only - return '[' + fragment + "= " + mm[1] + ']'; - if (mm = formula.match(/^(-?\d*)?n(([+-])(\d+))?/)) { // an+b - if (mm[1] == "-") mm[1] = -1; - var a = mm[1] ? Number(mm[1]) : 1; - var b = mm[2] ? Number(mm[2]) : 0; - predicate = "[((#{fragment} - #{b}) mod #{a} = 0) and " + - "((#{fragment} - #{b}) div #{a} >= 0)]"; - return new Template(predicate).evaluate({ - fragment: fragment, a: a, b: b }); - } - } - } - }, - - criteria: { - tagName: 'n = h.tagName(n, r, "#{1}", c); c = false;', - className: 'n = h.className(n, r, "#{1}", c); c = false;', - id: 'n = h.id(n, r, "#{1}", c); c = false;', - attrPresence: 'n = h.attrPresence(n, r, "#{1}", c); c = false;', - attr: function(m) { - m[3] = (m[5] || m[6]); - return new Template('n = h.attr(n, r, "#{1}", "#{3}", "#{2}", c); c = false;').evaluate(m); - }, - pseudo: function(m) { - if (m[6]) m[6] = m[6].replace(/"/g, '\\"'); - return new Template('n = h.pseudo(n, "#{1}", "#{6}", r, c); c = false;').evaluate(m); - }, - descendant: 'c = "descendant";', - child: 'c = "child";', - adjacent: 'c = "adjacent";', - laterSibling: 'c = "laterSibling";' - }, - - patterns: { - // combinators must be listed first - // (and descendant needs to be last combinator) - laterSibling: /^\s*~\s*/, - child: /^\s*>\s*/, - adjacent: /^\s*\+\s*/, - descendant: /^\s/, - - // selectors follow - tagName: /^\s*(\*|[\w\-]+)(\b|$)?/, - id: /^#([\w\-\*]+)(\b|$)/, - className: /^\.([\w\-\*]+)(\b|$)/, - pseudo: -/^:((first|last|nth|nth-last|only)(-child|-of-type)|empty|checked|(en|dis)abled|not)(\((.*?)\))?(\b|$|(?=\s|[:+~>]))/, - attrPresence: /^\[((?:[\w]+:)?[\w]+)\]/, - attr: /\[((?:[\w-]*:)?[\w-]+)\s*(?:([!^$*~|]?=)\s*((['"])([^\4]*?)\4|([^'"][^\]]*?)))?\]/ - }, - - // for Selector.match and Element#match - assertions: { - tagName: function(element, matches) { - return matches[1].toUpperCase() == element.tagName.toUpperCase(); - }, - - className: function(element, matches) { - return Element.hasClassName(element, matches[1]); - }, - - id: function(element, matches) { - return element.id === matches[1]; - }, - - attrPresence: function(element, matches) { - return Element.hasAttribute(element, matches[1]); - }, - - attr: function(element, matches) { - var nodeValue = Element.readAttribute(element, matches[1]); - return nodeValue && Selector.operators[matches[2]](nodeValue, matches[5] || matches[6]); - } - }, - - handlers: { - // UTILITY FUNCTIONS - // joins two collections - concat: function(a, b) { - for (var i = 0, node; node = b[i]; i++) - a.push(node); - return a; - }, - - // marks an array of nodes for counting - mark: function(nodes) { - var _true = Prototype.emptyFunction; - for (var i = 0, node; node = nodes[i]; i++) - node._countedByPrototype = _true; - return nodes; - }, - - unmark: function(nodes) { - for (var i = 0, node; node = nodes[i]; i++) - node._countedByPrototype = undefined; - return nodes; - }, - - // mark each child node with its position (for nth calls) - // "ofType" flag indicates whether we're indexing for nth-of-type - // rather than nth-child - index: function(parentNode, reverse, ofType) { - parentNode._countedByPrototype = Prototype.emptyFunction; - if (reverse) { - for (var nodes = parentNode.childNodes, i = nodes.length - 1, j = 1; i >= 0; i--) { - var node = nodes[i]; - if (node.nodeType == 1 && (!ofType || node._countedByPrototype)) node.nodeIndex = j++; - } - } else { - for (var i = 0, j = 1, nodes = parentNode.childNodes; node = nodes[i]; i++) - if (node.nodeType == 1 && (!ofType || node._countedByPrototype)) node.nodeIndex = j++; - } - }, - - // filters out duplicates and extends all nodes - unique: function(nodes) { - if (nodes.length == 0) return nodes; - var results = [], n; - for (var i = 0, l = nodes.length; i < l; i++) - if (!(n = nodes[i])._countedByPrototype) { - n._countedByPrototype = Prototype.emptyFunction; - results.push(Element.extend(n)); - } - return Selector.handlers.unmark(results); - }, - - // COMBINATOR FUNCTIONS - descendant: function(nodes) { - var h = Selector.handlers; - for (var i = 0, results = [], node; node = nodes[i]; i++) - h.concat(results, node.getElementsByTagName('*')); - return results; - }, - - child: function(nodes) { - var h = Selector.handlers; - for (var i = 0, results = [], node; node = nodes[i]; i++) { - for (var j = 0, child; child = node.childNodes[j]; j++) - if (child.nodeType == 1 && child.tagName != '!') results.push(child); - } - return results; - }, - - adjacent: function(nodes) { - for (var i = 0, results = [], node; node = nodes[i]; i++) { - var next = this.nextElementSibling(node); - if (next) results.push(next); - } - return results; - }, - - laterSibling: function(nodes) { - var h = Selector.handlers; - for (var i = 0, results = [], node; node = nodes[i]; i++) - h.concat(results, Element.nextSiblings(node)); - return results; - }, - - nextElementSibling: function(node) { - while (node = node.nextSibling) - if (node.nodeType == 1) return node; - return null; - }, - - previousElementSibling: function(node) { - while (node = node.previousSibling) - if (node.nodeType == 1) return node; - return null; - }, - - // TOKEN FUNCTIONS - tagName: function(nodes, root, tagName, combinator) { - var uTagName = tagName.toUpperCase(); - var results = [], h = Selector.handlers; - if (nodes) { - if (combinator) { - // fastlane for ordinary descendant combinators - if (combinator == "descendant") { - for (var i = 0, node; node = nodes[i]; i++) - h.concat(results, node.getElementsByTagName(tagName)); - return results; - } else nodes = this[combinator](nodes); - if (tagName == "*") return nodes; - } - for (var i = 0, node; node = nodes[i]; i++) - if (node.tagName.toUpperCase() === uTagName) results.push(node); - return results; - } else return root.getElementsByTagName(tagName); - }, - - id: function(nodes, root, id, combinator) { - var targetNode = $(id), h = Selector.handlers; - if (!targetNode) return []; - if (!nodes && root == document) return [targetNode]; - if (nodes) { - if (combinator) { - if (combinator == 'child') { - for (var i = 0, node; node = nodes[i]; i++) - if (targetNode.parentNode == node) return [targetNode]; - } else if (combinator == 'descendant') { - for (var i = 0, node; node = nodes[i]; i++) - if (Element.descendantOf(targetNode, node)) return [targetNode]; - } else if (combinator == 'adjacent') { - for (var i = 0, node; node = nodes[i]; i++) - if (Selector.handlers.previousElementSibling(targetNode) == node) - return [targetNode]; - } else nodes = h[combinator](nodes); - } - for (var i = 0, node; node = nodes[i]; i++) - if (node == targetNode) return [targetNode]; - return []; - } - return (targetNode && Element.descendantOf(targetNode, root)) ? [targetNode] : []; - }, - - className: function(nodes, root, className, combinator) { - if (nodes && combinator) nodes = this[combinator](nodes); - return Selector.handlers.byClassName(nodes, root, className); - }, - - byClassName: function(nodes, root, className) { - if (!nodes) nodes = Selector.handlers.descendant([root]); - var needle = ' ' + className + ' '; - for (var i = 0, results = [], node, nodeClassName; node = nodes[i]; i++) { - nodeClassName = node.className; - if (nodeClassName.length == 0) continue; - if (nodeClassName == className || (' ' + nodeClassName + ' ').include(needle)) - results.push(node); - } - return results; - }, - - attrPresence: function(nodes, root, attr, combinator) { - if (!nodes) nodes = root.getElementsByTagName("*"); - if (nodes && combinator) nodes = this[combinator](nodes); - var results = []; - for (var i = 0, node; node = nodes[i]; i++) - if (Element.hasAttribute(node, attr)) results.push(node); - return results; - }, - - attr: function(nodes, root, attr, value, operator, combinator) { - if (!nodes) nodes = root.getElementsByTagName("*"); - if (nodes && combinator) nodes = this[combinator](nodes); - var handler = Selector.operators[operator], results = []; - for (var i = 0, node; node = nodes[i]; i++) { - var nodeValue = Element.readAttribute(node, attr); - if (nodeValue === null) continue; - if (handler(nodeValue, value)) results.push(node); - } - return results; - }, - - pseudo: function(nodes, name, value, root, combinator) { - if (nodes && combinator) nodes = this[combinator](nodes); - if (!nodes) nodes = root.getElementsByTagName("*"); - return Selector.pseudos[name](nodes, value, root); - } - }, - - pseudos: { - 'first-child': function(nodes, value, root) { - for (var i = 0, results = [], node; node = nodes[i]; i++) { - if (Selector.handlers.previousElementSibling(node)) continue; - results.push(node); - } - return results; - }, - 'last-child': function(nodes, value, root) { - for (var i = 0, results = [], node; node = nodes[i]; i++) { - if (Selector.handlers.nextElementSibling(node)) continue; - results.push(node); - } - return results; - }, - 'only-child': function(nodes, value, root) { - var h = Selector.handlers; - for (var i = 0, results = [], node; node = nodes[i]; i++) - if (!h.previousElementSibling(node) && !h.nextElementSibling(node)) - results.push(node); - return results; - }, - 'nth-child': function(nodes, formula, root) { - return Selector.pseudos.nth(nodes, formula, root); - }, - 'nth-last-child': function(nodes, formula, root) { - return Selector.pseudos.nth(nodes, formula, root, true); - }, - 'nth-of-type': function(nodes, formula, root) { - return Selector.pseudos.nth(nodes, formula, root, false, true); - }, - 'nth-last-of-type': function(nodes, formula, root) { - return Selector.pseudos.nth(nodes, formula, root, true, true); - }, - 'first-of-type': function(nodes, formula, root) { - return Selector.pseudos.nth(nodes, "1", root, false, true); - }, - 'last-of-type': function(nodes, formula, root) { - return Selector.pseudos.nth(nodes, "1", root, true, true); - }, - 'only-of-type': function(nodes, formula, root) { - var p = Selector.pseudos; - return p['last-of-type'](p['first-of-type'](nodes, formula, root), formula, root); - }, - - // handles the an+b logic - getIndices: function(a, b, total) { - if (a == 0) return b > 0 ? [b] : []; - return $R(1, total).inject([], function(memo, i) { - if (0 == (i - b) % a && (i - b) / a >= 0) memo.push(i); - return memo; - }); - }, - - // handles nth(-last)-child, nth(-last)-of-type, and (first|last)-of-type - nth: function(nodes, formula, root, reverse, ofType) { - if (nodes.length == 0) return []; - if (formula == 'even') formula = '2n+0'; - if (formula == 'odd') formula = '2n+1'; - var h = Selector.handlers, results = [], indexed = [], m; - h.mark(nodes); - for (var i = 0, node; node = nodes[i]; i++) { - if (!node.parentNode._countedByPrototype) { - h.index(node.parentNode, reverse, ofType); - indexed.push(node.parentNode); - } - } - if (formula.match(/^\d+$/)) { // just a number - formula = Number(formula); - for (var i = 0, node; node = nodes[i]; i++) - if (node.nodeIndex == formula) results.push(node); - } else if (m = formula.match(/^(-?\d*)?n(([+-])(\d+))?/)) { // an+b - if (m[1] == "-") m[1] = -1; - var a = m[1] ? Number(m[1]) : 1; - var b = m[2] ? Number(m[2]) : 0; - var indices = Selector.pseudos.getIndices(a, b, nodes.length); - for (var i = 0, node, l = indices.length; node = nodes[i]; i++) { - for (var j = 0; j < l; j++) - if (node.nodeIndex == indices[j]) results.push(node); - } - } - h.unmark(nodes); - h.unmark(indexed); - return results; - }, - - 'empty': function(nodes, value, root) { - for (var i = 0, results = [], node; node = nodes[i]; i++) { - // IE treats comments as element nodes - if (node.tagName == '!' || node.firstChild) continue; - results.push(node); - } - return results; - }, - - 'not': function(nodes, selector, root) { - var h = Selector.handlers, selectorType, m; - var exclusions = new Selector(selector).findElements(root); - h.mark(exclusions); - for (var i = 0, results = [], node; node = nodes[i]; i++) - if (!node._countedByPrototype) results.push(node); - h.unmark(exclusions); - return results; - }, - - 'enabled': function(nodes, value, root) { - for (var i = 0, results = [], node; node = nodes[i]; i++) - if (!node.disabled && (!node.type || node.type !== 'hidden')) - results.push(node); - return results; - }, - - 'disabled': function(nodes, value, root) { - for (var i = 0, results = [], node; node = nodes[i]; i++) - if (node.disabled) results.push(node); - return results; - }, - - 'checked': function(nodes, value, root) { - for (var i = 0, results = [], node; node = nodes[i]; i++) - if (node.checked) results.push(node); - return results; - } - }, - - operators: { - '=': function(nv, v) { return nv == v; }, - '!=': function(nv, v) { return nv != v; }, - '^=': function(nv, v) { return nv == v || nv && nv.startsWith(v); }, - '$=': function(nv, v) { return nv == v || nv && nv.endsWith(v); }, - '*=': function(nv, v) { return nv == v || nv && nv.include(v); }, - '$=': function(nv, v) { return nv.endsWith(v); }, - '*=': function(nv, v) { return nv.include(v); }, - '~=': function(nv, v) { return (' ' + nv + ' ').include(' ' + v + ' '); }, - '|=': function(nv, v) { return ('-' + (nv || "").toUpperCase() + - '-').include('-' + (v || "").toUpperCase() + '-'); } - }, - - split: function(expression) { - var expressions = []; - expression.scan(/(([\w#:.~>+()\s-]+|\*|\[.*?\])+)\s*(,|$)/, function(m) { - expressions.push(m[1].strip()); - }); - return expressions; - }, - - matchElements: function(elements, expression) { - var matches = $$(expression), h = Selector.handlers; - h.mark(matches); - for (var i = 0, results = [], element; element = elements[i]; i++) - if (element._countedByPrototype) results.push(element); - h.unmark(matches); - return results; - }, - - findElement: function(elements, expression, index) { - if (Object.isNumber(expression)) { - index = expression; expression = false; - } - return Selector.matchElements(elements, expression || '*')[index || 0]; - }, - - findChildElements: function(element, expressions) { - expressions = Selector.split(expressions.join(',')); - var results = [], h = Selector.handlers; - for (var i = 0, l = expressions.length, selector; i < l; i++) { - selector = new Selector(expressions[i].strip()); - h.concat(results, selector.findElements(element)); - } - return (l > 1) ? h.unique(results) : results; - } -}); - -if (Prototype.Browser.IE) { - Object.extend(Selector.handlers, { - // IE returns comment nodes on getElementsByTagName("*"). - // Filter them out. - concat: function(a, b) { - for (var i = 0, node; node = b[i]; i++) - if (node.tagName !== "!") a.push(node); - return a; - }, - - // IE improperly serializes _countedByPrototype in (inner|outer)HTML. - unmark: function(nodes) { - for (var i = 0, node; node = nodes[i]; i++) - node.removeAttribute('_countedByPrototype'); - return nodes; - } - }); -} - -function $$() { - return Selector.findChildElements(document, $A(arguments)); -} -var Form = { - reset: function(form) { - $(form).reset(); - return form; - }, - - serializeElements: function(elements, options) { - if (typeof options != 'object') options = { hash: !!options }; - else if (Object.isUndefined(options.hash)) options.hash = true; - var key, value, submitted = false, submit = options.submit; - - var data = elements.inject({ }, function(result, element) { - if (!element.disabled && element.name) { - key = element.name; value = $(element).getValue(); - if (value != null && element.type != 'file' && (element.type != 'submit' || (!submitted && - submit !== false && (!submit || key == submit) && (submitted = true)))) { - if (key in result) { - // a key is already present; construct an array of values - if (!Object.isArray(result[key])) result[key] = [result[key]]; - result[key].push(value); - } - else result[key] = value; - } - } - return result; - }); - - return options.hash ? data : Object.toQueryString(data); - } -}; - -Form.Methods = { - serialize: function(form, options) { - return Form.serializeElements(Form.getElements(form), options); - }, - - getElements: function(form) { - return $A($(form).getElementsByTagName('*')).inject([], - function(elements, child) { - if (Form.Element.Serializers[child.tagName.toLowerCase()]) - elements.push(Element.extend(child)); - return elements; - } - ); - }, - - getInputs: function(form, typeName, name) { - form = $(form); - var inputs = form.getElementsByTagName('input'); - - if (!typeName && !name) return $A(inputs).map(Element.extend); - - for (var i = 0, matchingInputs = [], length = inputs.length; i < length; i++) { - var input = inputs[i]; - if ((typeName && input.type != typeName) || (name && input.name != name)) - continue; - matchingInputs.push(Element.extend(input)); - } - - return matchingInputs; - }, - - disable: function(form) { - form = $(form); - Form.getElements(form).invoke('disable'); - return form; - }, - - enable: function(form) { - form = $(form); - Form.getElements(form).invoke('enable'); - return form; - }, - - findFirstElement: function(form) { - var elements = $(form).getElements().findAll(function(element) { - return 'hidden' != element.type && !element.disabled; - }); - var firstByIndex = elements.findAll(function(element) { - return element.hasAttribute('tabIndex') && element.tabIndex >= 0; - }).sortBy(function(element) { return element.tabIndex }).first(); - - return firstByIndex ? firstByIndex : elements.find(function(element) { - return ['input', 'select', 'textarea'].include(element.tagName.toLowerCase()); - }); - }, - - focusFirstElement: function(form) { - form = $(form); - form.findFirstElement().activate(); - return form; - }, - - request: function(form, options) { - form = $(form), options = Object.clone(options || { }); - - var params = options.parameters, action = form.readAttribute('action') || ''; - if (action.blank()) action = window.location.href; - options.parameters = form.serialize(true); - - if (params) { - if (Object.isString(params)) params = params.toQueryParams(); - Object.extend(options.parameters, params); - } - - if (form.hasAttribute('method') && !options.method) - options.method = form.method; - - return new Ajax.Request(action, options); - } -}; - -/*--------------------------------------------------------------------------*/ - -Form.Element = { - focus: function(element) { - $(element).focus(); - return element; - }, - - select: function(element) { - $(element).select(); - return element; - } -}; - -Form.Element.Methods = { - serialize: function(element) { - element = $(element); - if (!element.disabled && element.name) { - var value = element.getValue(); - if (value != undefined) { - var pair = { }; - pair[element.name] = value; - return Object.toQueryString(pair); - } - } - return ''; - }, - - getValue: function(element) { - element = $(element); - var method = element.tagName.toLowerCase(); - return Form.Element.Serializers[method](element); - }, - - setValue: function(element, value) { - element = $(element); - var method = element.tagName.toLowerCase(); - Form.Element.Serializers[method](element, value); - return element; - }, - - clear: function(element) { - $(element).value = ''; - return element; - }, - - present: function(element) { - return $(element).value != ''; - }, - - activate: function(element) { - element = $(element); - try { - element.focus(); - if (element.select && (element.tagName.toLowerCase() != 'input' || - !['button', 'reset', 'submit'].include(element.type))) - element.select(); - } catch (e) { } - return element; - }, - - disable: function(element) { - element = $(element); - element.disabled = true; - return element; - }, - - enable: function(element) { - element = $(element); - element.disabled = false; - return element; - } -}; - -/*--------------------------------------------------------------------------*/ - -var Field = Form.Element; -var $F = Form.Element.Methods.getValue; - -/*--------------------------------------------------------------------------*/ - -Form.Element.Serializers = { - input: function(element, value) { - switch (element.type.toLowerCase()) { - case 'checkbox': - case 'radio': - return Form.Element.Serializers.inputSelector(element, value); - default: - return Form.Element.Serializers.textarea(element, value); - } - }, - - inputSelector: function(element, value) { - if (Object.isUndefined(value)) return element.checked ? element.value : null; - else element.checked = !!value; - }, - - textarea: function(element, value) { - if (Object.isUndefined(value)) return element.value; - else element.value = value; - }, - - select: function(element, value) { - if (Object.isUndefined(value)) - return this[element.type == 'select-one' ? - 'selectOne' : 'selectMany'](element); - else { - var opt, currentValue, single = !Object.isArray(value); - for (var i = 0, length = element.length; i < length; i++) { - opt = element.options[i]; - currentValue = this.optionValue(opt); - if (single) { - if (currentValue == value) { - opt.selected = true; - return; - } - } - else opt.selected = value.include(currentValue); - } - } - }, - - selectOne: function(element) { - var index = element.selectedIndex; - return index >= 0 ? this.optionValue(element.options[index]) : null; - }, - - selectMany: function(element) { - var values, length = element.length; - if (!length) return null; - - for (var i = 0, values = []; i < length; i++) { - var opt = element.options[i]; - if (opt.selected) values.push(this.optionValue(opt)); - } - return values; - }, - - optionValue: function(opt) { - // extend element because hasAttribute may not be native - return Element.extend(opt).hasAttribute('value') ? opt.value : opt.text; - } -}; - -/*--------------------------------------------------------------------------*/ - -Abstract.TimedObserver = Class.create(PeriodicalExecuter, { - initialize: function($super, element, frequency, callback) { - $super(callback, frequency); - this.element = $(element); - this.lastValue = this.getValue(); - }, - - execute: function() { - var value = this.getValue(); - if (Object.isString(this.lastValue) && Object.isString(value) ? - this.lastValue != value : String(this.lastValue) != String(value)) { - this.callback(this.element, value); - this.lastValue = value; - } - } -}); - -Form.Element.Observer = Class.create(Abstract.TimedObserver, { - getValue: function() { - return Form.Element.getValue(this.element); - } -}); - -Form.Observer = Class.create(Abstract.TimedObserver, { - getValue: function() { - return Form.serialize(this.element); - } -}); - -/*--------------------------------------------------------------------------*/ - -Abstract.EventObserver = Class.create({ - initialize: function(element, callback) { - this.element = $(element); - this.callback = callback; - - this.lastValue = this.getValue(); - if (this.element.tagName.toLowerCase() == 'form') - this.registerFormCallbacks(); - else - this.registerCallback(this.element); - }, - - onElementEvent: function() { - var value = this.getValue(); - if (this.lastValue != value) { - this.callback(this.element, value); - this.lastValue = value; - } - }, - - registerFormCallbacks: function() { - Form.getElements(this.element).each(this.registerCallback, this); - }, - - registerCallback: function(element) { - if (element.type) { - switch (element.type.toLowerCase()) { - case 'checkbox': - case 'radio': - Event.observe(element, 'click', this.onElementEvent.bind(this)); - break; - default: - Event.observe(element, 'change', this.onElementEvent.bind(this)); - break; - } - } - } -}); - -Form.Element.EventObserver = Class.create(Abstract.EventObserver, { - getValue: function() { - return Form.Element.getValue(this.element); - } -}); - -Form.EventObserver = Class.create(Abstract.EventObserver, { - getValue: function() { - return Form.serialize(this.element); - } -}); -if (!window.Event) var Event = { }; - -Object.extend(Event, { - KEY_BACKSPACE: 8, - KEY_TAB: 9, - KEY_RETURN: 13, - KEY_ESC: 27, - KEY_LEFT: 37, - KEY_UP: 38, - KEY_RIGHT: 39, - KEY_DOWN: 40, - KEY_DELETE: 46, - KEY_HOME: 36, - KEY_END: 35, - KEY_PAGEUP: 33, - KEY_PAGEDOWN: 34, - KEY_INSERT: 45, - - cache: { }, - - relatedTarget: function(event) { - var element; - switch(event.type) { - case 'mouseover': element = event.fromElement; break; - case 'mouseout': element = event.toElement; break; - default: return null; - } - return Element.extend(element); - } -}); - -Event.Methods = (function() { - var isButton; - - if (Prototype.Browser.IE) { - var buttonMap = { 0: 1, 1: 4, 2: 2 }; - isButton = function(event, code) { - return event.button == buttonMap[code]; - }; - - } else if (Prototype.Browser.WebKit) { - isButton = function(event, code) { - switch (code) { - case 0: return event.which == 1 && !event.metaKey; - case 1: return event.which == 1 && event.metaKey; - default: return false; - } - }; - - } else { - isButton = function(event, code) { - return event.which ? (event.which === code + 1) : (event.button === code); - }; - } - - return { - isLeftClick: function(event) { return isButton(event, 0) }, - isMiddleClick: function(event) { return isButton(event, 1) }, - isRightClick: function(event) { return isButton(event, 2) }, - - element: function(event) { - event = Event.extend(event); - - var node = event.target, - type = event.type, - currentTarget = event.currentTarget; - - if (currentTarget && currentTarget.tagName) { - // Firefox screws up the "click" event when moving between radio buttons - // via arrow keys. It also screws up the "load" and "error" events on images, - // reporting the document as the target instead of the original image. - if (type === 'load' || type === 'error' || - (type === 'click' && currentTarget.tagName.toLowerCase() === 'input' - && currentTarget.type === 'radio')) - node = currentTarget; - } - if (node.nodeType == Node.TEXT_NODE) node = node.parentNode; - return Element.extend(node); - }, - - findElement: function(event, expression) { - var element = Event.element(event); - if (!expression) return element; - var elements = [element].concat(element.ancestors()); - return Selector.findElement(elements, expression, 0); - }, - - pointer: function(event) { - var docElement = document.documentElement, - body = document.body || { scrollLeft: 0, scrollTop: 0 }; - return { - x: event.pageX || (event.clientX + - (docElement.scrollLeft || body.scrollLeft) - - (docElement.clientLeft || 0)), - y: event.pageY || (event.clientY + - (docElement.scrollTop || body.scrollTop) - - (docElement.clientTop || 0)) - }; - }, - - pointerX: function(event) { return Event.pointer(event).x }, - pointerY: function(event) { return Event.pointer(event).y }, - - stop: function(event) { - Event.extend(event); - event.preventDefault(); - event.stopPropagation(); - event.stopped = true; - } - }; -})(); - -Event.extend = (function() { - var methods = Object.keys(Event.Methods).inject({ }, function(m, name) { - m[name] = Event.Methods[name].methodize(); - return m; - }); - - if (Prototype.Browser.IE) { - Object.extend(methods, { - stopPropagation: function() { this.cancelBubble = true }, - preventDefault: function() { this.returnValue = false }, - inspect: function() { return "[object Event]" } - }); - - return function(event) { - if (!event) return false; - if (event._extendedByPrototype) return event; - - event._extendedByPrototype = Prototype.emptyFunction; - var pointer = Event.pointer(event); - Object.extend(event, { - target: event.srcElement, - relatedTarget: Event.relatedTarget(event), - pageX: pointer.x, - pageY: pointer.y - }); - return Object.extend(event, methods); - }; - - } else { - Event.prototype = Event.prototype || document.createEvent("HTMLEvents")['__proto__']; - Object.extend(Event.prototype, methods); - return Prototype.K; - } -})(); - -Object.extend(Event, (function() { - var cache = Event.cache; - - function getEventID(element) { - if (element._prototypeEventID) return element._prototypeEventID[0]; - arguments.callee.id = arguments.callee.id || 1; - return element._prototypeEventID = [++arguments.callee.id]; - } - - function getDOMEventName(eventName) { - if (eventName && eventName.include(':')) return "dataavailable"; - return eventName; - } - - function getCacheForID(id) { - return cache[id] = cache[id] || { }; - } - - function getWrappersForEventName(id, eventName) { - var c = getCacheForID(id); - return c[eventName] = c[eventName] || []; - } - - function createWrapper(element, eventName, handler) { - var id = getEventID(element); - var c = getWrappersForEventName(id, eventName); - if (c.pluck("handler").include(handler)) return false; - - var wrapper = function(event) { - if (!Event || !Event.extend || - (event.eventName && event.eventName != eventName)) - return false; - - Event.extend(event); - handler.call(element, event); - }; - - wrapper.handler = handler; - c.push(wrapper); - return wrapper; - } - - function findWrapper(id, eventName, handler) { - var c = getWrappersForEventName(id, eventName); - return c.find(function(wrapper) { return wrapper.handler == handler }); - } - - function destroyWrapper(id, eventName, handler) { - var c = getCacheForID(id); - if (!c[eventName]) return false; - c[eventName] = c[eventName].without(findWrapper(id, eventName, handler)); - } - - function destroyCache() { - for (var id in cache) - for (var eventName in cache[id]) - cache[id][eventName] = null; - } - - - // Internet Explorer needs to remove event handlers on page unload - // in order to avoid memory leaks. - if (window.attachEvent) { - window.attachEvent("onunload", destroyCache); - } - - // Safari has a dummy event handler on page unload so that it won't - // use its bfcache. Safari <= 3.1 has an issue with restoring the "document" - // object when page is returned to via the back button using its bfcache. - if (Prototype.Browser.WebKit) { - window.addEventListener('unload', Prototype.emptyFunction, false); - } - - return { - observe: function(element, eventName, handler) { - element = $(element); - var name = getDOMEventName(eventName); - - var wrapper = createWrapper(element, eventName, handler); - if (!wrapper) return element; - - if (element.addEventListener) { - element.addEventListener(name, wrapper, false); - } else { - element.attachEvent("on" + name, wrapper); - } - - return element; - }, - - stopObserving: function(element, eventName, handler) { - element = $(element); - var id = getEventID(element), name = getDOMEventName(eventName); - - if (!handler && eventName) { - getWrappersForEventName(id, eventName).each(function(wrapper) { - element.stopObserving(eventName, wrapper.handler); - }); - return element; - - } else if (!eventName) { - Object.keys(getCacheForID(id)).each(function(eventName) { - element.stopObserving(eventName); - }); - return element; - } - - var wrapper = findWrapper(id, eventName, handler); - if (!wrapper) return element; - - if (element.removeEventListener) { - element.removeEventListener(name, wrapper, false); - } else { - element.detachEvent("on" + name, wrapper); - } - - destroyWrapper(id, eventName, handler); - - return element; - }, - - fire: function(element, eventName, memo) { - element = $(element); - if (element == document && document.createEvent && !element.dispatchEvent) - element = document.documentElement; - - var event; - if (document.createEvent) { - event = document.createEvent("HTMLEvents"); - event.initEvent("dataavailable", true, true); - } else { - event = document.createEventObject(); - event.eventType = "ondataavailable"; - } - - event.eventName = eventName; - event.memo = memo || { }; - - if (document.createEvent) { - element.dispatchEvent(event); - } else { - element.fireEvent(event.eventType, event); - } - - return Event.extend(event); - } - }; -})()); - -Object.extend(Event, Event.Methods); - -Element.addMethods({ - fire: Event.fire, - observe: Event.observe, - stopObserving: Event.stopObserving -}); - -Object.extend(document, { - fire: Element.Methods.fire.methodize(), - observe: Element.Methods.observe.methodize(), - stopObserving: Element.Methods.stopObserving.methodize(), - loaded: false -}); - -(function() { - /* Support for the DOMContentLoaded event is based on work by Dan Webb, - Matthias Miller, Dean Edwards and John Resig. */ - - var timer; - - function fireContentLoadedEvent() { - if (document.loaded) return; - if (timer) window.clearInterval(timer); - document.fire("dom:loaded"); - document.loaded = true; - } - - if (document.addEventListener) { - if (Prototype.Browser.WebKit) { - timer = window.setInterval(function() { - if (/loaded|complete/.test(document.readyState)) - fireContentLoadedEvent(); - }, 0); - - Event.observe(window, "load", fireContentLoadedEvent); - - } else { - document.addEventListener("DOMContentLoaded", - fireContentLoadedEvent, false); - } - - } else { - document.write("<script id=__onDOMContentLoaded defer src=//:><\/script>"); - $("__onDOMContentLoaded").onreadystatechange = function() { - if (this.readyState == "complete") { - this.onreadystatechange = null; - fireContentLoadedEvent(); - } - }; - } -})(); -/*------------------------------- DEPRECATED -------------------------------*/ - -Hash.toQueryString = Object.toQueryString; - -var Toggle = { display: Element.toggle }; - -Element.Methods.childOf = Element.Methods.descendantOf; - -var Insertion = { - Before: function(element, content) { - return Element.insert(element, {before:content}); - }, - - Top: function(element, content) { - return Element.insert(element, {top:content}); - }, - - Bottom: function(element, content) { - return Element.insert(element, {bottom:content}); - }, - - After: function(element, content) { - return Element.insert(element, {after:content}); - } -}; - -var $continue = new Error('"throw $continue" is deprecated, use "return" instead'); - -// This should be moved to script.aculo.us; notice the deprecated methods -// further below, that map to the newer Element methods. -var Position = { - // set to true if needed, warning: firefox performance problems - // NOT neeeded for page scrolling, only if draggable contained in - // scrollable elements - includeScrollOffsets: false, - - // must be called before calling withinIncludingScrolloffset, every time the - // page is scrolled - prepare: function() { - this.deltaX = window.pageXOffset - || document.documentElement.scrollLeft - || document.body.scrollLeft - || 0; - this.deltaY = window.pageYOffset - || document.documentElement.scrollTop - || document.body.scrollTop - || 0; - }, - - // caches x/y coordinate pair to use with overlap - within: function(element, x, y) { - if (this.includeScrollOffsets) - return this.withinIncludingScrolloffsets(element, x, y); - this.xcomp = x; - this.ycomp = y; - this.offset = Element.cumulativeOffset(element); - - return (y >= this.offset[1] && - y < this.offset[1] + element.offsetHeight && - x >= this.offset[0] && - x < this.offset[0] + element.offsetWidth); - }, - - withinIncludingScrolloffsets: function(element, x, y) { - var offsetcache = Element.cumulativeScrollOffset(element); - - this.xcomp = x + offsetcache[0] - this.deltaX; - this.ycomp = y + offsetcache[1] - this.deltaY; - this.offset = Element.cumulativeOffset(element); - - return (this.ycomp >= this.offset[1] && - this.ycomp < this.offset[1] + element.offsetHeight && - this.xcomp >= this.offset[0] && - this.xcomp < this.offset[0] + element.offsetWidth); - }, - - // within must be called directly before - overlap: function(mode, element) { - if (!mode) return 0; - if (mode == 'vertical') - return ((this.offset[1] + element.offsetHeight) - this.ycomp) / - element.offsetHeight; - if (mode == 'horizontal') - return ((this.offset[0] + element.offsetWidth) - this.xcomp) / - element.offsetWidth; - }, - - // Deprecation layer -- use newer Element methods now (1.5.2). - - cumulativeOffset: Element.Methods.cumulativeOffset, - - positionedOffset: Element.Methods.positionedOffset, - - absolutize: function(element) { - Position.prepare(); - return Element.absolutize(element); - }, - - relativize: function(element) { - Position.prepare(); - return Element.relativize(element); - }, - - realOffset: Element.Methods.cumulativeScrollOffset, - - offsetParent: Element.Methods.getOffsetParent, - - page: Element.Methods.viewportOffset, - - clone: function(source, target, options) { - options = options || { }; - return Element.clonePosition(target, source, options); - } -}; - -/*--------------------------------------------------------------------------*/ - -if (!document.getElementsByClassName) document.getElementsByClassName = function(instanceMethods){ - function iter(name) { - return name.blank() ? null : "[contains(concat(' ', @class, ' '), ' " + name + " ')]"; - } - - instanceMethods.getElementsByClassName = Prototype.BrowserFeatures.XPath ? - function(element, className) { - className = className.toString().strip(); - var cond = /\s/.test(className) ? $w(className).map(iter).join('') : iter(className); - return cond ? document._getElementsByXPath('.//*' + cond, element) : []; - } : function(element, className) { - className = className.toString().strip(); - var elements = [], classNames = (/\s/.test(className) ? $w(className) : null); - if (!classNames && !className) return elements; - - var nodes = $(element).getElementsByTagName('*'); - className = ' ' + className + ' '; - - for (var i = 0, child, cn; child = nodes[i]; i++) { - if (child.className && (cn = ' ' + child.className + ' ') && (cn.include(className) || - (classNames && classNames.all(function(name) { - return !name.toString().blank() && cn.include(' ' + name + ' '); - })))) - elements.push(Element.extend(child)); - } - return elements; - }; - - return function(className, parentElement) { - return $(parentElement || document.body).getElementsByClassName(className); - }; -}(Element.Methods); - -/*--------------------------------------------------------------------------*/ - -Element.ClassNames = Class.create(); -Element.ClassNames.prototype = { - initialize: function(element) { - this.element = $(element); - }, - - _each: function(iterator) { - this.element.className.split(/\s+/).select(function(name) { - return name.length > 0; - })._each(iterator); - }, - - set: function(className) { - this.element.className = className; - }, - - add: function(classNameToAdd) { - if (this.include(classNameToAdd)) return; - this.set($A(this).concat(classNameToAdd).join(' ')); - }, - - remove: function(classNameToRemove) { - if (!this.include(classNameToRemove)) return; - this.set($A(this).without(classNameToRemove).join(' ')); - }, - - toString: function() { - return $A(this).join(' '); - } -}; - -Object.extend(Element.ClassNames.prototype, Enumerable); - -/*--------------------------------------------------------------------------*/ - -Element.addMethods();
\ No newline at end of file diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/service/LoginServiceCentralizedImpl.java b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/service/LoginServiceCentralizedImpl.java index 54d1267a..6acd433c 100644 --- a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/service/LoginServiceCentralizedImpl.java +++ b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/service/LoginServiceCentralizedImpl.java @@ -73,7 +73,8 @@ public class LoginServiceCentralizedImpl extends FusionService implements LoginS private UserService userService; @Override - public LoginBean findUser(LoginBean bean, String menuPropertiesFilename, @SuppressWarnings("rawtypes") Map additionalParams) throws IOException { + public LoginBean findUser(LoginBean bean, String menuPropertiesFilename, + @SuppressWarnings("rawtypes") Map additionalParams) throws IOException { return findUser(bean, menuPropertiesFilename, additionalParams, true); } @@ -121,11 +122,14 @@ public class LoginServiceCentralizedImpl extends FusionService implements LoginS User appuser = findUserWithoutPwd(user.getLoginId()); - appuser.setLastLoginDate(new Date()); - - // update the last logged in date for the user - dataAccessService.saveDomainObject(appuser, additionalParams); + if (appuser == null && userHasRoleFunctions(user)) { + createUserIfNecessary(user); + } else { + appuser.setLastLoginDate(new Date()); + // update the last logged in date for the user + dataAccessService.saveDomainObject(appuser, additionalParams); + } // update the audit log of the user // Check for the client device type and set log attributes // appropriately @@ -149,6 +153,34 @@ public class LoginServiceCentralizedImpl extends FusionService implements LoginS return bean; } + private void createUserIfNecessary(User user) { + logger.debug(EELFLoggerDelegate.debugLogger, "createUser: " + user.getOrgUserId()); + User user1 = new User(); + user1.setEmail(user.getEmail()); + user1.setEmail(user.getEmail()); + user1.setFirstName(user.getFirstName()); + user1.setHrid(user.getHrid()); + user1.setJobTitle(user.getJobTitle()); + user1.setLastName(user.getLastName()); + user1.setLoginId(user.getLoginId()); + user1.setOrgManagerUserId(user.getOrgManagerUserId()); + user1.setMiddleInitial(user.getMiddleInitial()); + user1.setOrgCode(user.getOrgCode()); + user1.setOrgId(user.getOrgId()); + user1.setPhone(user.getPhone()); + user1.setOrgUserId(user.getOrgUserId()); + user1.setActive(user.getActive()); + user1.setLastLoginDate(new Date()); + + try { + dataAccessService.saveDomainObject(user1, null); + logger.debug(EELFLoggerDelegate.debugLogger, "createdUser Successfully: " + user.getOrgUserId()); + } catch (Exception ex) { + logger.error(EELFLoggerDelegate.errorLogger, "createUserIfNecessary failed", ex); + } + + } + private boolean userHasActiveRoles(User user) { boolean hasActiveRole = false; @SuppressWarnings("rawtypes") @@ -163,6 +195,20 @@ public class LoginServiceCentralizedImpl extends FusionService implements LoginS return hasActiveRole; } + private boolean userHasRoleFunctions(User user) { + boolean hasRoleFunctions = false; + @SuppressWarnings("rawtypes") + Iterator roles = user.getRoles().iterator(); + while (roles.hasNext()) { + Role role = (Role) roles.next(); + if (role.getActive() && role.getRoleFunctions() != null && !role.getRoleFunctions().isEmpty()) { + hasRoleFunctions = true; + break; + } + } + return hasRoleFunctions; + } + private User findUser(LoginBean bean) throws IOException { String repsonse = restApiRequestBuilder.getViaREST("/user/" + bean.getUserid(), true, bean.getUserid()); User user = userService.userMapper(repsonse); @@ -183,7 +229,7 @@ public class LoginServiceCentralizedImpl extends FusionService implements LoginS @SuppressWarnings("rawtypes") private User findUser(String loginId, String password) { - Map<String,String> params = new HashMap<>(); + Map<String, String> params = new HashMap<>(); params.put("login_id", loginId); params.put("login_pwd", password); List list = dataAccessService.executeNamedQuery("getUserByLoginIdLoginPwd", params, new HashMap()); @@ -192,8 +238,8 @@ public class LoginServiceCentralizedImpl extends FusionService implements LoginS @SuppressWarnings("rawtypes") private User findUserWithoutPwd(String loginId) { - Map<String,String> params = new HashMap<>(); - params.put("login_id", loginId); + Map<String, String> params = new HashMap<>(); + params.put("login_id", loginId); List list = dataAccessService.executeNamedQuery("getUserByLoginId", params, new HashMap()); return (list == null || list.isEmpty()) ? null : (User) list.get(0); } diff --git a/ecomp-sdk/epsdk-fw/pom.xml b/ecomp-sdk/epsdk-fw/pom.xml index de185f48..73283ee8 100644 --- a/ecomp-sdk/epsdk-fw/pom.xml +++ b/ecomp-sdk/epsdk-fw/pom.xml @@ -1,5 +1,6 @@ <?xml version="1.0"?> -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> @@ -15,7 +16,9 @@ <name>ONAP Portal SDK Framework</name> <!-- properties are inherited from parent --> - + <properties> + <resteasy.version>3.0.18.Final</resteasy.version> + </properties> <!-- repositories are inherited from parent --> <!-- profiles are inherited from parent --> @@ -54,8 +57,6 @@ </build> <dependencies> - - <!-- publicly available --> <dependency> <groupId>javax.servlet</groupId> <artifactId>javax.servlet-api</artifactId> @@ -81,12 +82,79 @@ <artifactId>jackson-databind</artifactId> <version>2.6.3</version> </dependency> - <dependency> - <groupId>org.owasp.esapi</groupId> - <artifactId>esapi</artifactId> - <version>2.1.0.1</version> - </dependency> - + <dependency> + <groupId>org.owasp.esapi</groupId> + <artifactId>esapi</artifactId> + <version>2.1.0.1</version> + <exclusions> + <exclusion> + <groupId>log4j</groupId> + <artifactId>log4j</artifactId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>4.12</version> + <scope>test</scope> + </dependency> + <!-- Test scaffold --> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>jul-to-slf4j</artifactId> + <version>1.7.25</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>jcl-over-slf4j</artifactId> + <version>1.7.25</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>ch.qos.logback</groupId> + <artifactId>logback-classic</artifactId> + <version>1.1.1</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.jboss.resteasy</groupId> + <artifactId>resteasy-spring</artifactId> + <version>${resteasy.version}</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.jboss.resteasy</groupId> + <artifactId>resteasy-client</artifactId> + <version>${resteasy.version}</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.jboss.resteasy</groupId> + <artifactId>resteasy-jaxb-provider</artifactId> + <version>${resteasy.version}</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.jboss.resteasy</groupId> + <artifactId>tjws</artifactId> + <version>${resteasy.version}</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.jboss.spec.javax.servlet</groupId> + <artifactId>jboss-servlet-api_3.1_spec</artifactId> + <version>1.0.0.Final</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.mockito</groupId> + <artifactId>mockito-core</artifactId> + <version>1.10.19</version> + <scope>test</scope> + </dependency> + </dependencies> </project> diff --git a/ecomp-sdk/epsdk-fw/src/main/java/org/onap/portalsdk/core/onboarding/rest/RestWebServiceClient.java b/ecomp-sdk/epsdk-fw/src/main/java/org/onap/portalsdk/core/onboarding/rest/RestWebServiceClient.java index 91f019be..a752055f 100644 --- a/ecomp-sdk/epsdk-fw/src/main/java/org/onap/portalsdk/core/onboarding/rest/RestWebServiceClient.java +++ b/ecomp-sdk/epsdk-fw/src/main/java/org/onap/portalsdk/core/onboarding/rest/RestWebServiceClient.java @@ -51,7 +51,6 @@ import org.onap.portalsdk.core.onboarding.util.PortalApiConstants; import org.onap.portalsdk.core.onboarding.util.PortalApiProperties; import org.owasp.esapi.ESAPI; - /** * Simple REST client for GET, POST and DELETE operations against the Portal * application. @@ -211,7 +210,9 @@ public class RestWebServiceClient { // add request header con.setRequestProperty("uebkey", appUebKey); - con.setRequestProperty("LoginId", ESAPI.encoder().canonicalize(loginId)); + if (loginId != null) { + con.setRequestProperty("LoginId", ESAPI.encoder().canonicalize(loginId)); + } con.setRequestProperty("user-agent", appName); con.setRequestProperty("X-ECOMP-RequestID", requestId); con.setRequestProperty("username", appUserName); @@ -527,31 +528,10 @@ public class RestWebServiceClient { int bytes; while ((bytes = in.read(buf)) > 0) sb.append(new String(buf, 0, bytes)); - } - catch (Exception ex) { + } catch (Exception ex) { logger.error("readAndCloseStream", ex); } return sb.toString(); } - /** - * Basic unit test for the client to call Portal app on localhost. - * - * @param args - * Ignored - * @throws IOException - * On failure - */ - public static void main(String[] args) throws IOException { - RestWebServiceClient client = RestWebServiceClient.getInstance(); - final String getUrl = "http://www.ecomp.openecomp.org:8080/ecompportal/auxapi/analytics"; - String get = client.get(getUrl, "userId", "appName", null, "appUebKey", "appUserName", "appPassword", null); - System.out.println("Get result:\n" + get); - final String postUrl = "http://www.ecomp.openecomp.org:8080/ecompportal/auxapi/storeAnalytics"; - final String content = " { " + " \"action\" : \"test1\", " + " \"page\" : \"test2\", " - + " \"function\" : \"test3\", " + " \"userid\" : \"ab1234\" " + "}"; - String post = client.post(postUrl, "userId", "appName", null, "appUebKey", "appUserName", "appPassword", - "application/json", content, true); - System.out.println("Post result:\n" + post); - } } diff --git a/ecomp-sdk/epsdk-fw/src/main/java/org/onap/portalsdk/core/onboarding/util/CipherUtil.java b/ecomp-sdk/epsdk-fw/src/main/java/org/onap/portalsdk/core/onboarding/util/CipherUtil.java index 92d9ffc3..ba95d870 100644 --- a/ecomp-sdk/epsdk-fw/src/main/java/org/onap/portalsdk/core/onboarding/util/CipherUtil.java +++ b/ecomp-sdk/epsdk-fw/src/main/java/org/onap/portalsdk/core/onboarding/util/CipherUtil.java @@ -40,14 +40,17 @@ package org.onap.portalsdk.core.onboarding.util; import java.io.UnsupportedEncodingException; import java.security.InvalidKeyException; import java.security.NoSuchAlgorithmException; +import java.security.SecureRandom; import javax.crypto.BadPaddingException; import javax.crypto.Cipher; import javax.crypto.IllegalBlockSizeException; import javax.crypto.NoSuchPaddingException; +import javax.crypto.spec.IvParameterSpec; import javax.crypto.spec.SecretKeySpec; import org.apache.commons.codec.binary.Base64; +import org.apache.commons.lang.ArrayUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.onap.portalsdk.core.onboarding.exception.CipherUtilException; @@ -59,10 +62,19 @@ public class CipherUtil { /** * Default key. */ - private final static String key = "AGLDdG4D04BKm2IxIWEr8o==!"; + private static final String keyString = KeyProperties.getProperty(KeyConstants.CIPHER_ENCRYPTION_KEY); + + private static final String ALGORITHM = "AES"; + private static final String ALGORYTHM_DETAILS = ALGORITHM + "/CBC/PKCS5PADDING"; + private static final int BLOCK_SIZE = 128; + @SuppressWarnings("unused") + private static SecretKeySpec secretKeySpec; + private static IvParameterSpec ivspec; /** - * Encrypts the text using the specified secret key. + * @deprecated Please use {@link #encryptPKC(String)} to encrypt the text. + * + * Encrypts the text using the specified secret key. * * @param plainText * Text to encrypt @@ -71,7 +83,9 @@ public class CipherUtil { * @return encrypted version of plain text. * @throws CipherUtilException * if any encryption step fails + * */ + @Deprecated public static String encrypt(String plainText, String secretKey) throws CipherUtilException { String encryptedString = null; try { @@ -90,7 +104,8 @@ public class CipherUtil { } /** - * Encrypts the text using a default secret key. + * @deprecated Please use {@link #encryptPKC(String)} to encrypt the text. + * Encrypts the text using the secret key in key.properties file. * * @param plainText * Text to encrypt @@ -98,12 +113,29 @@ public class CipherUtil { * @throws CipherUtilException * if any decryption step fails */ + @Deprecated public static String encrypt(String plainText) throws CipherUtilException { - return CipherUtil.encrypt(plainText, key); + return CipherUtil.encrypt(plainText, keyString); } /** - * Decrypts the text using the specified secret key. + * Encrypts the text using a secret key. + * + * @param plainText + * Text to encrypt + * @return Encrypted Text + * @throws CipherUtilException + * if any decryption step fails + */ + public static String encryptPKC(String plainText) throws CipherUtilException { + return CipherUtil.encryptPKC(plainText, keyString); + } + + /** + * + * @deprecated Please use {@link #decryptPKC(String)} to Decryption the text. + * + * Decrypts the text using the specified secret key. * * @param encryptedText * Text to decrypt @@ -112,7 +144,9 @@ public class CipherUtil { * @return plain text version of encrypted text * @throws CipherUtilException * if any decryption step fails + * */ + @Deprecated public static String decrypt(String encryptedText, String secretKey) throws CipherUtilException { String encryptedString = null; try { @@ -130,8 +164,79 @@ public class CipherUtil { return encryptedString; } + private static SecretKeySpec getSecretKeySpec() { + byte[] key = Base64.decodeBase64(keyString); + return new SecretKeySpec(key, ALGORITHM); + } + + private static SecretKeySpec getSecretKeySpec(String keyString) { + byte[] key = Base64.decodeBase64(keyString); + return new SecretKeySpec(key, ALGORITHM); + } + /** - * Decrypts the text using a default secret key. + * Encrypt the text using the secret key in key.properties file + * + * @param value + * @return The encrypted string + * @throws BadPaddingException + * @throws CipherUtilException + * In case of issue with the encryption + */ + public static String encryptPKC(String value, String skey) throws CipherUtilException { + Cipher cipher = null; + byte[] iv = null, finalByte = null; + + try { + cipher = Cipher.getInstance(ALGORYTHM_DETAILS, "SunJCE"); + + SecureRandom r = SecureRandom.getInstance("SHA1PRNG"); + iv = new byte[BLOCK_SIZE / 8]; + r.nextBytes(iv); + ivspec = new IvParameterSpec(iv); + cipher.init(Cipher.ENCRYPT_MODE, getSecretKeySpec(skey), ivspec); + finalByte = cipher.doFinal(value.getBytes()); + + } catch (Exception ex) { + logger.error("encrypt failed", ex); + throw new CipherUtilException(ex); + } + return Base64.encodeBase64String(ArrayUtils.addAll(iv, finalByte)); + } + + /** + * Decrypts the text using the secret key in key.properties file. + * + * @param message + * The encrypted string that must be decrypted using the ecomp + * Encryption Key + * @return The String decrypted + * @throws CipherUtilException + * if any decryption step fails + */ + public static String decryptPKC(String message, String skey) throws CipherUtilException { + byte[] encryptedMessage = Base64.decodeBase64(message); + Cipher cipher; + byte[] decrypted = null; + try { + cipher = Cipher.getInstance(ALGORYTHM_DETAILS, "SunJCE"); + ivspec = new IvParameterSpec(ArrayUtils.subarray(encryptedMessage, 0, BLOCK_SIZE / 8)); + byte[] realData = ArrayUtils.subarray(encryptedMessage, BLOCK_SIZE / 8, encryptedMessage.length); + cipher.init(Cipher.DECRYPT_MODE, getSecretKeySpec(skey), ivspec); + decrypted = cipher.doFinal(realData); + + } catch (Exception ex) { + logger.error("decrypt failed", ex); + throw new CipherUtilException(ex); + } + + return new String(decrypted); + } + + /** + * @deprecated Please use {@link #decryptPKC(String)} to Decrypt the text. + * + * Decrypts the text using the secret key in key.properties file. * * @param encryptedText * Text to decrypt @@ -139,11 +244,26 @@ public class CipherUtil { * @throws CipherUtilException * if any decryption step fails */ + @Deprecated public static String decrypt(String encryptedText) throws CipherUtilException { - return CipherUtil.decrypt(encryptedText, key); + return CipherUtil.decrypt(encryptedText, keyString); + } + + /** + * + * Decrypts the text using the secret key in key.properties file. + * + * @param encryptedText + * Text to decrypt + * @return Decrypted text + * @throws CipherUtilException + * if any decryption step fails + */ + public static String decryptPKC(String encryptedText) throws CipherUtilException { + return CipherUtil.decryptPKC(encryptedText, keyString); } -/* public static void main(String[] args) throws CipherUtilException { + public static void main(String[] args) throws CipherUtilException { String testValue = "Welcome123"; String encrypted; @@ -152,9 +272,9 @@ public class CipherUtil { if (args.length != 2) { System.out.println("Default password testing... "); System.out.println("Plain password: " + testValue); - encrypted = encrypt(testValue); + encrypted = encryptPKC(testValue); System.out.println("Encrypted password: " + encrypted); - decrypted = decrypt(encrypted); + decrypted = decryptPKC(encrypted); System.out.println("Decrypted password: " + decrypted); } else { String whatToDo = args[0]; @@ -170,5 +290,6 @@ public class CipherUtil { System.out.println("Encrypted Text" + encrypted); } } - }*/ + } + } diff --git a/ecomp-sdk/epsdk-fw/src/main/java/org/onap/portalsdk/core/onboarding/util/KeyConstants.java b/ecomp-sdk/epsdk-fw/src/main/java/org/onap/portalsdk/core/onboarding/util/KeyConstants.java new file mode 100644 index 00000000..096b04dc --- /dev/null +++ b/ecomp-sdk/epsdk-fw/src/main/java/org/onap/portalsdk/core/onboarding/util/KeyConstants.java @@ -0,0 +1,46 @@ +/* + * ============LICENSE_START========================================== + * ONAP Portal SDK + * =================================================================== + * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the "License"); + * you may not use this software except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END============================================ + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. + */ +package org.onap.portalsdk.core.onboarding.util; + +public interface KeyConstants { + + // Names of keys in the key.properties file + public static final String CIPHER_ENCRYPTION_KEY = "cipher.enc.key"; + + +} diff --git a/ecomp-sdk/epsdk-fw/src/main/java/org/onap/portalsdk/core/onboarding/util/KeyProperties.java b/ecomp-sdk/epsdk-fw/src/main/java/org/onap/portalsdk/core/onboarding/util/KeyProperties.java new file mode 100644 index 00000000..956d3b81 --- /dev/null +++ b/ecomp-sdk/epsdk-fw/src/main/java/org/onap/portalsdk/core/onboarding/util/KeyProperties.java @@ -0,0 +1,123 @@ +/* + * ============LICENSE_START========================================== + * ONAP Portal SDK + * =================================================================== + * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the "License"); + * you may not use this software except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END============================================ + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. + */ +package org.onap.portalsdk.core.onboarding.util; + +import java.io.IOException; +import java.io.InputStream; +import java.util.Properties; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +/** + * Searches the classpath for the file "key.properties". + * + * To put the file "key.properties" on the classpath, it can be in the same + * directory where the first package folder is - 'myClasses' folder in the + * following case as an example: + * + */ +public class KeyProperties { + + private static final Log logger = LogFactory.getLog(KeyProperties.class); + + private static Properties properties; + private static String propertyFileName = "key.properties"; + + private static final Object lockObject = new Object(); + + /** + * Constructor is private. + */ + private KeyProperties() { + } + + /** + * Gets the property value for the specified key. If a value is found, leading + * and trailing space is trimmed. + * + * @param property + * Property key + * @return Value for the named property; null if the property file was not + * loaded or the key was not found. + */ + public static String getProperty(String property) { + if (properties == null) { + synchronized (lockObject) { + try { + if (!initialize()) { + logger.error("Failed to read property file " + propertyFileName); + return null; + } + } catch (IOException e) { + logger.error("Failed to read property file " + propertyFileName, e); + return null; + } + } + } + String value = properties.getProperty(property); + if (value != null) + value = value.trim(); + return value; + } + + /** + * Reads properties from a portal.properties file on the classpath. + * + * Clients do NOT need to call this method. Clients MAY call this method to test + * whether the properties file can be loaded successfully. + * + * @return True if properties were successfully loaded, else false. + * @throws IOException + * On failure + */ + private static boolean initialize() throws IOException { + if (properties != null) + return true; + InputStream in = KeyProperties.class.getClassLoader().getResourceAsStream(propertyFileName); + if (in == null) + return false; + properties = new Properties(); + try { + properties.load(in); + } finally { + in.close(); + } + return true; + } +} diff --git a/ecomp-sdk/epsdk-fw/src/test/java/org/onap/portalsdk/fw/test/AbstractModelTest.java b/ecomp-sdk/epsdk-fw/src/test/java/org/onap/portalsdk/fw/test/AbstractModelTest.java new file mode 100644 index 00000000..ca35446b --- /dev/null +++ b/ecomp-sdk/epsdk-fw/src/test/java/org/onap/portalsdk/fw/test/AbstractModelTest.java @@ -0,0 +1,75 @@ +/* + * ============LICENSE_START========================================== + * ONAP Portal SDK + * =================================================================== + * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the "License"); + * you may not use this software except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END============================================ + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. + */ + +package org.onap.portalsdk.fw.test; + +import java.util.Date; + +public abstract class AbstractModelTest { + + // Values for properties + final long time = new Date().getTime(); + final boolean b1 = true; + final boolean b2 = false; + final Byte[] by1 = { 0, 1, 2, 3 }; + final Date d1 = new Date(time + 1 * 24 * 60 * 60 * 1000); + final Date d2 = new Date(time + 2 * 24 * 60 * 60 * 1000); + final Date d3 = new Date(time + 3 * 24 * 60 * 60 * 1000); + final Date d4 = new Date(time + 4 * 24 * 60 * 60 * 1000); + final Date d5 = new Date(time + 5 * 24 * 60 * 60 * 1000); + final Integer i1 = 1; + final Integer i2 = 2; + final Integer i3 = 3; + final Integer i4 = 4; + final Integer i5 = 5; + final Long l1 = 1L; + final Long l2 = 2L; + final Long l3 = 3L; + final Long l4 = 4L; + final String s1 = "string1"; + final String s2 = "string2"; + final String s3 = "string3"; + final String s4 = "string4"; + final String s5 = "string5"; + final String s6 = "string6"; + final String s7 = "string7"; + final String s8 = "string8"; + final String s9 = "string9"; + final String s10 = "string10"; + +} diff --git a/ecomp-sdk/epsdk-fw/src/test/java/org/onap/portalsdk/fw/test/DomainTest.java b/ecomp-sdk/epsdk-fw/src/test/java/org/onap/portalsdk/fw/test/DomainTest.java new file mode 100644 index 00000000..700c8b3e --- /dev/null +++ b/ecomp-sdk/epsdk-fw/src/test/java/org/onap/portalsdk/fw/test/DomainTest.java @@ -0,0 +1,169 @@ +/* + * ============LICENSE_START========================================== + * ONAP Portal SDK + * =================================================================== + * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the "License"); + * you may not use this software except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END============================================ + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. + */ + +package org.onap.portalsdk.fw.test; + +import java.util.HashSet; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.junit.Assert; +import org.junit.Test; +import org.onap.portalsdk.core.onboarding.crossapi.PortalAPIResponse; +import org.onap.portalsdk.core.restful.domain.EcompRole; +import org.onap.portalsdk.core.restful.domain.EcompUser; +import org.onap.portalsdk.core.restful.domain.PortalTimeoutVO; +import org.onap.portalsdk.core.restful.domain.SharedContext; + +public class DomainTest extends AbstractModelTest { + + private final Log logger = LogFactory.getLog(DomainTest.class); + + @Test + public void testPortalAPIResponse() { + PortalAPIResponse m = new PortalAPIResponse(true, s1); + Assert.assertEquals("ok", m.getStatus()); + Assert.assertEquals(s1, m.getMessage()); + logger.info(m.toString()); + } + + @Test + public void testEcompRole() { + EcompRole m = new EcompRole(); + m.setId(l1); + m.setName(s1); + Assert.assertEquals(l1, m.getId()); + Assert.assertEquals(s1, m.getName()); + Assert.assertTrue(m.equals(m)); + Assert.assertFalse(m.equals(new EcompRole())); + Assert.assertNotNull(m.hashCode()); + logger.info(m.toString()); + } + + @Test + public void testEcompUser() { + EcompUser m = new EcompUser(); + m.setActive(false); + m.setEmail(s1); + m.setFirstName(s2); + m.setHrid(s3); + m.setJobTitle(s4); + m.setLastName(s5); + m.setLoginId(s6); + m.setManagerId(s7); + m.setMiddleInitial(s8); + m.setOrgCode(s9); + m.setOrgId(l1); + m.setOrgManagerUserId(s10); + // Start over at 1, but double + m.setOrgUserId(s1 + s1); + m.setPhone(s2 + s2); + EcompRole r = new EcompRole(); + HashSet<EcompRole> roles = new HashSet<>(); + roles.add(r); + m.setRoles(roles); + Assert.assertEquals(false, m.isActive()); + Assert.assertEquals(s1, m.getEmail()); + Assert.assertEquals(s2, m.getFirstName()); + Assert.assertEquals(s3, m.getHrid()); + Assert.assertEquals(s4, m.getJobTitle()); + Assert.assertEquals(s5, m.getLastName()); + Assert.assertEquals(s6, m.getLoginId()); + Assert.assertEquals(s7, m.getManagerId()); + Assert.assertEquals(s8, m.getMiddleInitial()); + Assert.assertEquals(s9, m.getOrgCode()); + Assert.assertEquals(l1, m.getOrgId()); + Assert.assertEquals(s10, m.getOrgManagerUserId()); + Assert.assertEquals(s1 + s1, m.getOrgUserId()); + Assert.assertEquals(s2 + s2, m.getPhone()); + // this is weak + Assert.assertEquals(roles, m.getRoles()); + Assert.assertTrue(m.equals(m)); + Assert.assertFalse(m.equals(null)); + Assert.assertFalse(m.equals(new EcompUser())); + Assert.assertNotNull(m.hashCode()); + logger.info(m.toString()); + } + + @Test + public void testPortalTimeoutVO() { + PortalTimeoutVO m = new PortalTimeoutVO(); + m.setjSessionId(s1); + m.setSessionTimOutMilliSec(l1); + Assert.assertEquals(s1, m.getjSessionId()); + Assert.assertEquals(l1, m.getSessionTimOutMilliSec()); + Assert.assertTrue(m.equals(m)); + Assert.assertFalse(m.equals(null)); + Assert.assertFalse(m.equals(new PortalTimeoutVO())); + } + + @Test + public void testSharedContext() { + SharedContext m = new SharedContext(); + m.setAuditTrail(s1); + m.setAuditUserId(s2); + m.setCkey(s3); + m.setContext_id(s4); + m.setCreate_time(l1); + m.setCreated(s5); + m.setCreatedId(s6); + m.setCvalue(s7); + m.setId(l2); + m.setModified(s8); + m.setModifiedId(s9); + m.setResponse(s10); + m.setRowNum(s1 + s1); + Assert.assertEquals(s1, m.getAuditTrail()); + Assert.assertEquals(s2, m.getAuditUserId()); + Assert.assertEquals(s3, m.getCkey()); + Assert.assertEquals(s4, m.getContext_id()); + Assert.assertEquals(l1, m.getCreate_time()); + Assert.assertEquals(s5, m.getCreated()); + Assert.assertEquals(s6, m.getCreatedId()); + Assert.assertEquals(s7, m.getCvalue()); + Assert.assertEquals(l2, m.getId()); + Assert.assertEquals(s8, m.getModified()); + Assert.assertEquals(s9, m.getModifiedId()); + Assert.assertEquals(s10, m.getResponse()); + Assert.assertEquals(s1 + s1, m.getRowNum()); + Assert.assertTrue(m.equals(m)); + Assert.assertFalse(m.equals(null)); + Assert.assertFalse(m.equals(new SharedContext())); + } + +} diff --git a/ecomp-sdk/epsdk-fw/src/test/java/org/onap/portalsdk/fw/test/ExceptionTest.java b/ecomp-sdk/epsdk-fw/src/test/java/org/onap/portalsdk/fw/test/ExceptionTest.java new file mode 100644 index 00000000..76f8f072 --- /dev/null +++ b/ecomp-sdk/epsdk-fw/src/test/java/org/onap/portalsdk/fw/test/ExceptionTest.java @@ -0,0 +1,73 @@ +/* + * ============LICENSE_START========================================== + * ONAP Portal SDK + * =================================================================== + * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the "License"); + * you may not use this software except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END============================================ + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. + */ + +package org.onap.portalsdk.fw.test; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.junit.Assert; +import org.junit.Test; +import org.onap.portalsdk.core.onboarding.exception.CipherUtilException; +import org.onap.portalsdk.core.onboarding.exception.PortalAPIException; + +public class ExceptionTest extends AbstractModelTest { + + private final Log logger = LogFactory.getLog(ExceptionTest.class); + + @Test + public void coverCipherUtilException() { + Exception e = new CipherUtilException(); + e = new CipherUtilException("message", new Exception(), false, false); + e = new CipherUtilException("message", new Exception()); + e = new CipherUtilException("message"); + e = new CipherUtilException(new Exception()); + Assert.assertNotNull(e); + logger.info(e); + } + + @Test + public void coverPortalAPIException() { + Exception e = new PortalAPIException(); + e = new PortalAPIException("message", new Exception(), false, false); + e = new PortalAPIException("message", new Exception()); + e = new PortalAPIException("message"); + e = new PortalAPIException(new Exception()); + Assert.assertNotNull(e); + logger.info(e); + } +} diff --git a/ecomp-sdk/epsdk-fw/src/test/java/org/onap/portalsdk/fw/test/ExtendSessionTimeoutTest.java b/ecomp-sdk/epsdk-fw/src/test/java/org/onap/portalsdk/fw/test/ExtendSessionTimeoutTest.java new file mode 100644 index 00000000..a87639d8 --- /dev/null +++ b/ecomp-sdk/epsdk-fw/src/test/java/org/onap/portalsdk/fw/test/ExtendSessionTimeoutTest.java @@ -0,0 +1,99 @@ +/* + * ============LICENSE_START========================================== + * ONAP Portal SDK + * =================================================================== + * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the "License"); + * you may not use this software except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END============================================ + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. + */ + +package org.onap.portalsdk.fw.test; + +import java.io.IOException; +import java.net.URL; + +import javax.ws.rs.HeaderParam; +import javax.ws.rs.POST; +import javax.ws.rs.Path; +import javax.ws.rs.Produces; +import javax.ws.rs.core.MediaType; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.junit.After; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; +import org.onap.portalsdk.core.onboarding.crossapi.SessionCommunicationService; +import org.onap.portalsdk.core.onboarding.listener.PortalTimeoutHandler; +import org.onap.portalsdk.core.onboarding.listener.PortalTimeoutHandler.SessionCommInf; +import org.onap.portalsdk.core.onboarding.util.PortalApiConstants; +import org.onap.portalsdk.core.onboarding.util.PortalApiProperties; + +public class ExtendSessionTimeoutTest { + + private final Log logger = LogFactory.getLog(ExtendSessionTimeoutTest.class); + private InMemoryRestServer server; + + @Path("extendSessionTimeOuts") + public static class RestResource { + @POST + @Produces(MediaType.APPLICATION_JSON) + public String get( @HeaderParam("username") String username, + @HeaderParam("password") String password, @HeaderParam("uebkey") String uebkey) { + return "{ 'post-session' : '" + username + "' }"; + } + } + + @Before + public void before() throws Exception { + URL url = new URL(PortalApiProperties.getProperty(PortalApiConstants.ECOMP_REST_URL)); + server = InMemoryRestServer.create(url.getPort(), new RestResource()); + } + + @After + public void after() throws Exception { + server.close(); + } + + @Test + public void testRequestSessionTimeoutExtension() throws IOException { + String url = PortalApiProperties.getProperty(PortalApiConstants.ECOMP_REST_URL); + String get = SessionCommunicationService.requestPortalSessionTimeoutExtension(url, "userName", "word", "uebKey", "map"); + Assert.assertNotNull(get); + logger.info("extend session test yields: " + get); + // Similar test via a different path + SessionCommInf sc = new PortalTimeoutHandler.SessionComm(); + sc.extendSessionTimeOuts(url, "userName", "word", "uebKey", "map"); + } + +} diff --git a/ecomp-sdk/epsdk-fw/src/test/java/org/onap/portalsdk/fw/test/InMemoryRestServer.java b/ecomp-sdk/epsdk-fw/src/test/java/org/onap/portalsdk/fw/test/InMemoryRestServer.java new file mode 100644 index 00000000..2c37e214 --- /dev/null +++ b/ecomp-sdk/epsdk-fw/src/test/java/org/onap/portalsdk/fw/test/InMemoryRestServer.java @@ -0,0 +1,150 @@ +/** + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * https://github.com/mp911de/rest-api-test + * + * Embedded InMemory REST server for RESTEasy. Usage: + * <ul> + * <li>InMemoryRestServer srv = InMemoryRestServer.create(...) passing your resources and provider classes</li> + * <li>srv.baseUri() for BaseUrl</li> + * <li>srv.newRequest("/relative/resource/path") to issue requests</li> + * <li>srv.close() to stop</li> + * </ul> + * + */ +package org.onap.portalsdk.fw.test; + +import java.io.IOException; +import java.net.ServerSocket; +import java.util.HashSet; +import java.util.Set; + +import javax.ws.rs.core.Application; + +import org.jboss.resteasy.client.jaxrs.ResteasyClient; +import org.jboss.resteasy.client.jaxrs.ResteasyWebTarget; +import org.jboss.resteasy.plugins.server.embedded.SecurityDomain; +import org.jboss.resteasy.plugins.server.tjws.TJWSEmbeddedJaxrsServer; + + +public class InMemoryRestServer implements AutoCloseable { + + private int port; + + private Set<Object> objects = new HashSet<Object>(); + @SuppressWarnings("rawtypes") + private Set<Class> classes = new HashSet<Class>(); + + private TJWSEmbeddedJaxrsServer server; + private SecurityDomain securityDomain; + private ResteasyClient resteasyClient; + private String bindAddress = "localhost"; + + private InMemoryRestServer(Object... objects) { + append(objects); + } + + /** + * Create instance and pass given instances/classes as singletons/providers. + * + * @param port + * Port number to bind + * @param objects + * Resource providers + * @return running instance of {@link InMemoryRestServer} + * @throws IOException + * In case of error + */ + public static InMemoryRestServer create(int port, Object... objects) throws IOException { + InMemoryRestServer inMemoryRestServer = new InMemoryRestServer(objects); + inMemoryRestServer.start(port); + return inMemoryRestServer; + } + + @SuppressWarnings("rawtypes") + private void append(Object... objects) { + for (Object object : objects) { + if (object instanceof Class) { + classes.add((Class) object); + } else { + this.objects.add(object); + } + } + } + + private void start(int requestPort) throws IOException { + if (requestPort <= 0) + port = findFreePort(); + else + port = requestPort; + server = new TJWSEmbeddedJaxrsServer(); + server.setPort(port); + server.setBindAddress(bindAddress); + server.setSecurityDomain(securityDomain); + + for (Object object : objects) { + if (object instanceof Application) { + server.getDeployment().setApplication((Application) object); + } else { + server.getDeployment().getResources().add(object); + } + } + + for (@SuppressWarnings("rawtypes") Class resourceOrProvider : classes) { + if (Application.class.isAssignableFrom(resourceOrProvider)) { + server.getDeployment().setApplicationClass(resourceOrProvider.getName()); + } else { + server.getDeployment().getProviderClasses().add(resourceOrProvider.getName()); + } + } + + server.start(); + } + + /** + * @return baseURI (http://localhost:PORT) to the REST server. + */ + public String baseUri() { + return "http://" + bindAddress + ":" + port; + } + + /** + * Begin a new {@link ResteasyWebTarget} with additional, relative path with leading /. + * + * @param uriTemplate + * URI template + * @return ResteasyWebTarget + */ + public ResteasyWebTarget newRequest(String uriTemplate) { + return resteasyClient.target(baseUri() + uriTemplate); + } + + /** + * Find a free server port. + * + * @return port number. + * @throws IOException + * On failure to create server socket + */ + private static int findFreePort() throws IOException { + ServerSocket server = new ServerSocket(0); + int port = server.getLocalPort(); + server.close(); + return port; + } + + /** + * Close the server and free resources. + */ + @Override + public void close() { + if (server != null) { + server.stop(); + server = null; + } + } +}
\ No newline at end of file diff --git a/ecomp-sdk/epsdk-fw/src/test/java/org/onap/portalsdk/fw/test/PortalTimeoutHandlerTest.java b/ecomp-sdk/epsdk-fw/src/test/java/org/onap/portalsdk/fw/test/PortalTimeoutHandlerTest.java new file mode 100644 index 00000000..8826237d --- /dev/null +++ b/ecomp-sdk/epsdk-fw/src/test/java/org/onap/portalsdk/fw/test/PortalTimeoutHandlerTest.java @@ -0,0 +1,100 @@ +/* + * ============LICENSE_START========================================== + * ONAP Portal SDK + * =================================================================== + * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the "License"); + * you may not use this software except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END============================================ + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. + */ + +package org.onap.portalsdk.fw.test; + +import java.util.HashMap; +import java.util.Map; + +import javax.servlet.http.HttpSession; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.Mock; +import org.mockito.Mockito; +import org.mockito.invocation.InvocationOnMock; +import org.mockito.runners.MockitoJUnitRunner; +import org.mockito.stubbing.Answer; +import org.onap.portalsdk.core.onboarding.listener.PortalTimeoutHandler; + +@RunWith(MockitoJUnitRunner.class) +public class PortalTimeoutHandlerTest extends AbstractModelTest { + + private final Log logger = LogFactory.getLog(PortalTimeoutHandlerTest.class); + + @Mock + private HttpSession mockHttpSession; + private Map<String, Object> attributes = new HashMap<String, Object>(); + + @Before + public void before() { + Mockito.doAnswer(new Answer<Object>() { + @Override + public Object answer(InvocationOnMock invocation) throws Throwable { + String key = (String) invocation.getArguments()[0]; + logger.debug("get for key " + key); + return attributes.get(key); + } + }).when(mockHttpSession).getAttribute(Mockito.anyString()); + + Mockito.doAnswer(new Answer<Object>() { + @Override + public Object answer(InvocationOnMock invocation) throws Throwable { + String key = (String) invocation.getArguments()[0]; + logger.debug("set for key " + key); + Object value = invocation.getArguments()[1]; + attributes.put(key, value); + return null; + } + }).when(mockHttpSession).setAttribute(Mockito.anyString(), Mockito.any()); + } + + @Test + public void testPortalTimeoutHandler() { + Assert.assertNotNull(PortalTimeoutHandler.getInstance()); + Assert.assertNotNull(PortalTimeoutHandler.getSessionMap()); + PortalTimeoutHandler.sessionCreated("portalJSessionId", "jSessionId", mockHttpSession); + PortalTimeoutHandler.invalidateSession("portalJSessionId"); + PortalTimeoutHandler.sessionDestroyed(mockHttpSession); + PortalTimeoutHandler.gatherSessionExtensions(); + } +} diff --git a/ecomp-sdk/epsdk-fw/src/test/java/org/onap/portalsdk/fw/test/RestClientTest.java b/ecomp-sdk/epsdk-fw/src/test/java/org/onap/portalsdk/fw/test/RestClientTest.java new file mode 100644 index 00000000..d36ee79d --- /dev/null +++ b/ecomp-sdk/epsdk-fw/src/test/java/org/onap/portalsdk/fw/test/RestClientTest.java @@ -0,0 +1,112 @@ +/* + * ============LICENSE_START========================================== + * ONAP Portal SDK + * =================================================================== + * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the "License"); + * you may not use this software except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END============================================ + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. + */ + +package org.onap.portalsdk.fw.test; + +import java.io.IOException; +import java.net.URL; + +import javax.ws.rs.DELETE; +import javax.ws.rs.GET; +import javax.ws.rs.HeaderParam; +import javax.ws.rs.POST; +import javax.ws.rs.Path; +import javax.ws.rs.Produces; +import javax.ws.rs.core.MediaType; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.junit.After; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; +import org.onap.portalsdk.core.onboarding.rest.RestWebServiceClient; +import org.onap.portalsdk.core.onboarding.util.PortalApiConstants; +import org.onap.portalsdk.core.onboarding.util.PortalApiProperties; + +public class RestClientTest { + + private final Log logger = LogFactory.getLog(RestClientTest.class); + private InMemoryRestServer server; + + @Path("portal") + public static class RestResource { + @GET + @Produces(MediaType.APPLICATION_JSON) + public String get(@HeaderParam("LoginId") String loginId, @HeaderParam("username") String username, + @HeaderParam("password") String password) { + return "{ 'get' : '" + loginId + "' }"; + } + @POST + public String post(@HeaderParam("LoginId") String loginId, @HeaderParam("username") String username, + @HeaderParam("password") String password) { + return "{ 'post' : '" + loginId + "' }"; + } + @DELETE + public String delete(@HeaderParam("LoginId") String loginId, @HeaderParam("username") String username, + @HeaderParam("password") String password) { + return "{ 'delete' : '" + loginId + "' }"; + } + } + + @Before + public void before() throws Exception { + URL url = new URL(PortalApiProperties.getProperty(PortalApiConstants.ECOMP_REST_URL)); + server = InMemoryRestServer.create(url.getPort(), new RestResource()); + } + + @After + public void after() throws Exception { + server.close(); + } + + @Test + public void testRestClient() throws IOException { + RestWebServiceClient client = RestWebServiceClient.getInstance(); + String get = client.getPortalContent("/portal", "userid", "appName", "requestId", "appUserName", "appPassword", true); + Assert.assertNotNull(get); + logger.info("Get test yields: " + get); + String post = client.postPortalContent("/portal", "userid", "appName", "requestId", "appUserName", "appPassword", MediaType.APPLICATION_JSON, "content", true); + Assert.assertNotNull(post); + logger.info("Post test yields: " + post); + String delete = client.deletePortalContent("/portal", "userid", "appName", "requestId", "appUserName", "appPassword", MediaType.APPLICATION_JSON, "content", true); + Assert.assertNotNull(delete); + logger.info("Delete test yields: " + delete); + } + +} diff --git a/ecomp-sdk/epsdk-fw/src/test/java/org/onap/portalsdk/fw/test/SessionSlotCheckIntervalTest.java b/ecomp-sdk/epsdk-fw/src/test/java/org/onap/portalsdk/fw/test/SessionSlotCheckIntervalTest.java new file mode 100644 index 00000000..79e87532 --- /dev/null +++ b/ecomp-sdk/epsdk-fw/src/test/java/org/onap/portalsdk/fw/test/SessionSlotCheckIntervalTest.java @@ -0,0 +1,103 @@ +/* + * ============LICENSE_START========================================== + * ONAP Portal SDK + * =================================================================== + * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the "License"); + * you may not use this software except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END============================================ + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. + */ + +package org.onap.portalsdk.fw.test; + +import java.io.IOException; +import java.net.URL; + +import javax.ws.rs.GET; +import javax.ws.rs.HeaderParam; +import javax.ws.rs.Path; +import javax.ws.rs.Produces; +import javax.ws.rs.core.MediaType; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.junit.After; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; +import org.onap.portalsdk.core.onboarding.crossapi.SessionCommunicationService; +import org.onap.portalsdk.core.onboarding.listener.PortalTimeoutHandler; +import org.onap.portalsdk.core.onboarding.listener.PortalTimeoutHandler.SessionCommInf; +import org.onap.portalsdk.core.onboarding.util.PortalApiConstants; +import org.onap.portalsdk.core.onboarding.util.PortalApiProperties; + +public class SessionSlotCheckIntervalTest { + + private final Log logger = LogFactory.getLog(SessionSlotCheckIntervalTest.class); + private static final String timeoutValue = "1"; + private InMemoryRestServer server; + + @Path("getSessionSlotCheckInterval") + public static class RestResource { + @GET + @Produces(MediaType.APPLICATION_JSON) + public String get( @HeaderParam("username") String username, + @HeaderParam("password") String password, @HeaderParam("uebkey") String uebkey) { + // Expects only an integer, not even a POJO/JSON model. + return timeoutValue; + } + } + + @Before + public void before() throws Exception { + URL url = new URL(PortalApiProperties.getProperty(PortalApiConstants.ECOMP_REST_URL)); + server = InMemoryRestServer.create(url.getPort(), new RestResource()); + } + + @After + public void after() throws Exception { + server.close(); + } + + @Test + public void testSessionSlot() throws IOException { + String url = PortalApiProperties.getProperty(PortalApiConstants.ECOMP_REST_URL); + String get = SessionCommunicationService.getSessionSlotCheckInterval(url, "userName", "word", "uebKey"); + Assert.assertTrue(get.equals(timeoutValue)); + logger.info("Get test yields: " + get); + // Similar test via a different path + SessionCommInf sc = new PortalTimeoutHandler.SessionComm(); + Integer i = sc.fetchSessionSlotCheckInterval(url, "userName", "word", "uebKey"); + Assert.assertTrue(i.toString().equals(timeoutValue)); + logger.info("Fetched slot-check interval: " + i); + } + +} diff --git a/ecomp-sdk/epsdk-fw/src/test/java/org/onap/portalsdk/fw/test/UtilTest.java b/ecomp-sdk/epsdk-fw/src/test/java/org/onap/portalsdk/fw/test/UtilTest.java new file mode 100644 index 00000000..66a81a04 --- /dev/null +++ b/ecomp-sdk/epsdk-fw/src/test/java/org/onap/portalsdk/fw/test/UtilTest.java @@ -0,0 +1,80 @@ +/* + * ============LICENSE_START========================================== + * ONAP Portal SDK + * =================================================================== + * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the "License"); + * you may not use this software except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END============================================ + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. + */ + +package org.onap.portalsdk.fw.test; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.junit.Assert; +import org.junit.Test; +import org.onap.portalsdk.core.onboarding.exception.CipherUtilException; +import org.onap.portalsdk.core.onboarding.util.CipherUtil; +import org.onap.portalsdk.core.onboarding.util.PortalApiConstants; +import org.onap.portalsdk.core.onboarding.util.PortalApiProperties; + +public class UtilTest extends AbstractModelTest { + + private final Log logger = LogFactory.getLog(UtilTest.class); + + + @Test + public void testCipherUtil() throws CipherUtilException { + String cipher; + + cipher = CipherUtil.encryptPKC(s1); + Assert.assertNotNull(cipher); + Assert.assertNotEquals(cipher, s1); + Assert.assertEquals(s1, CipherUtil.decryptPKC(cipher)); + + cipher = CipherUtil.encryptPKC(s2); + Assert.assertNotNull(cipher); + Assert.assertNotEquals(cipher, s2); + Assert.assertEquals(s2, CipherUtil.decryptPKC(cipher)); + + logger.info("CipherUtils tested"); + } + + @Test + public void testProperties() { + // Relies on portal.properties file in src/test/resources + String val = PortalApiProperties.getProperty(PortalApiConstants.ECOMP_REST_URL); + Assert.assertNotNull(val); + logger.info("PortalApiProperties tested"); + } + +} diff --git a/ecomp-sdk/epsdk-fw/src/test/resources/ESAPI.properties b/ecomp-sdk/epsdk-fw/src/test/resources/ESAPI.properties new file mode 100644 index 00000000..52c39161 --- /dev/null +++ b/ecomp-sdk/epsdk-fw/src/test/resources/ESAPI.properties @@ -0,0 +1,367 @@ +#=========================================================================== +# ESAPI Configuration +# +# If true, then print all the ESAPI properties set here when they are loaded. +# If false, they are not printed. Useful to reduce output when running JUnit tests. +# If you need to troubleshoot a properties related problem, turning this on may help. +# This is 'false' in the src/test/resources/.esapi version. It is 'true' by +# default for reasons of backward compatibility with earlier ESAPI versions. +ESAPI.printProperties=true + +# ESAPI is designed to be easily extensible. You can use the reference implementation +# or implement your own providers to take advantage of your enterprise's security +# infrastructure. The functions in ESAPI are referenced using the ESAPI locator, like: +# +# String ciphertext = +# ESAPI.encryptor().encrypt("Secret message"); // Deprecated in 2.0 +# CipherText cipherText = +# ESAPI.encryptor().encrypt(new PlainText("Secret message")); // Preferred +# +# Below you can specify the classname for the provider that you wish to use in your +# application. The only requirement is that it implement the appropriate ESAPI interface. +# This allows you to switch security implementations in the future without rewriting the +# entire application. +# +# ExperimentalAccessController requires ESAPI-AccessControlPolicy.xml in .esapi directory +ESAPI.AccessControl=org.owasp.esapi.reference.DefaultAccessController +# FileBasedAuthenticator requires users.txt file in .esapi directory +ESAPI.Authenticator=org.owasp.esapi.reference.FileBasedAuthenticator +ESAPI.Encoder=org.owasp.esapi.reference.DefaultEncoder +ESAPI.Encryptor=org.owasp.esapi.reference.crypto.JavaEncryptor + +ESAPI.Executor=org.owasp.esapi.reference.DefaultExecutor +ESAPI.HTTPUtilities=org.owasp.esapi.reference.DefaultHTTPUtilities +ESAPI.IntrusionDetector=org.owasp.esapi.reference.DefaultIntrusionDetector +ESAPI.Logger=org.owasp.esapi.reference.JavaLogFactory +ESAPI.Randomizer=org.owasp.esapi.reference.DefaultRandomizer +ESAPI.Validator=org.owasp.esapi.reference.DefaultValidator + +#=========================================================================== +# ESAPI Authenticator +# +Authenticator.AllowedLoginAttempts=3 +Authenticator.MaxOldPasswordHashes=13 +Authenticator.UsernameParameterName=username +Authenticator.PasswordParameterName=password +# RememberTokenDuration (in days) +Authenticator.RememberTokenDuration=14 +# Session Timeouts (in minutes) +Authenticator.IdleTimeoutDuration=20 +Authenticator.AbsoluteTimeoutDuration=120 + +#=========================================================================== +# ESAPI Encoder +# +# ESAPI canonicalizes input before validation to prevent bypassing filters with encoded attacks. +# Failure to canonicalize input is a very common mistake when implementing validation schemes. +# Canonicalization is automatic when using the ESAPI Validator, but you can also use the +# following code to canonicalize data. +# +# ESAPI.Encoder().canonicalize( "%22hello world"" ); +# +# Multiple encoding is when a single encoding format is applied multiple times. Allowing +# multiple encoding is strongly discouraged. +Encoder.AllowMultipleEncoding=false + +# Mixed encoding is when multiple different encoding formats are applied, or when +# multiple formats are nested. Allowing multiple encoding is strongly discouraged. +Encoder.AllowMixedEncoding=false + +# The default list of codecs to apply when canonicalizing untrusted data. The list should include the codecs +# for all downstream interpreters or decoders. For example, if the data is likely to end up in a URL, HTML, or +# inside JavaScript, then the list of codecs below is appropriate. The order of the list is not terribly important. +Encoder.DefaultCodecList=HTMLEntityCodec,PercentCodec,JavaScriptCodec + + +#=========================================================================== +# ESAPI Encryption +# +# The ESAPI Encryptor provides basic cryptographic functions with a simplified API. +# To get started, generate a new key using java -classpath esapi.jar org.owasp.esapi.reference.crypto.JavaEncryptor +# There is not currently any support for key rotation, so be careful when changing your key and salt as it +# will invalidate all signed, encrypted, and hashed data. +# +# WARNING: Not all combinations of algorithms and key lengths are supported. +# If you choose to use a key length greater than 128, you MUST download the +# unlimited strength policy files and install in the lib directory of your JRE/JDK. +# See http://java.sun.com/javase/downloads/index.jsp for more information. +# +# Backward compatibility with ESAPI Java 1.4 is supported by the two deprecated API +# methods, Encryptor.encrypt(String) and Encryptor.decrypt(String). However, whenever +# possible, these methods should be avoided as they use ECB cipher mode, which in almost +# all circumstances a poor choice because of it's weakness. CBC cipher mode is the default +# for the new Encryptor encrypt / decrypt methods for ESAPI Java 2.0. In general, you +# should only use this compatibility setting if you have persistent data encrypted with +# version 1.4 and even then, you should ONLY set this compatibility mode UNTIL +# you have decrypted all of your old encrypted data and then re-encrypted it with +# ESAPI 2.0 using CBC mode. If you have some reason to mix the deprecated 1.4 mode +# with the new 2.0 methods, make sure that you use the same cipher algorithm for both +# (256-bit AES was the default for 1.4; 128-bit is the default for 2.0; see below for +# more details.) Otherwise, you will have to use the new 2.0 encrypt / decrypt methods +# where you can specify a SecretKey. (Note that if you are using the 256-bit AES, +# that requires downloading the special jurisdiction policy files mentioned above.) +# +# ***** IMPORTANT: Do NOT forget to replace these with your own values! ***** +# To calculate these values, you can run: +# java -classpath esapi.jar org.owasp.esapi.reference.crypto.JavaEncryptor +# +Encryptor.MasterKey=tzfztf56ftv +Encryptor.MasterSalt=123456ztrewq + +# Provides the default JCE provider that ESAPI will "prefer" for its symmetric +# encryption and hashing. (That is it will look to this provider first, but it +# will defer to other providers if the requested algorithm is not implemented +# by this provider.) If left unset, ESAPI will just use your Java VM's current +# preferred JCE provider, which is generally set in the file +# "$JAVA_HOME/jre/lib/security/java.security". +# +# The main intent of this is to allow ESAPI symmetric encryption to be +# used with a FIPS 140-2 compliant crypto-module. For details, see the section +# "Using ESAPI Symmetric Encryption with FIPS 140-2 Cryptographic Modules" in +# the ESAPI 2.0 Symmetric Encryption User Guide, at: +# http://owasp-esapi-java.googlecode.com/svn/trunk/documentation/esapi4java-core-2.0-symmetric-crypto-user-guide.html +# However, this property also allows you to easily use an alternate JCE provider +# such as "Bouncy Castle" without having to make changes to "java.security". +# See Javadoc for SecurityProviderLoader for further details. If you wish to use +# a provider that is not known to SecurityProviderLoader, you may specify the +# fully-qualified class name of the JCE provider class that implements +# java.security.Provider. If the name contains a '.', this is interpreted as +# a fully-qualified class name that implements java.security.Provider. +# +# NOTE: Setting this property has the side-effect of changing it in your application +# as well, so if you are using JCE in your application directly rather than +# through ESAPI (you wouldn't do that, would you? ;-), it will change the +# preferred JCE provider there as well. +# +# Default: Keeps the JCE provider set to whatever JVM sets it to. +Encryptor.PreferredJCEProvider= + +# AES is the most widely used and strongest encryption algorithm. This +# should agree with your Encryptor.CipherTransformation property. +# By default, ESAPI Java 1.4 uses "PBEWithMD5AndDES" and which is +# very weak. It is essentially a password-based encryption key, hashed +# with MD5 around 1K times and then encrypted with the weak DES algorithm +# (56-bits) using ECB mode and an unspecified padding (it is +# JCE provider specific, but most likely "NoPadding"). However, 2.0 uses +# "AES/CBC/PKCSPadding". If you want to change these, change them here. +# Warning: This property does not control the default reference implementation for +# ESAPI 2.0 using JavaEncryptor. Also, this property will be dropped +# in the future. +# @deprecated +Encryptor.EncryptionAlgorithm=AES +# For ESAPI Java 2.0 - New encrypt / decrypt methods use this. +Encryptor.CipherTransformation=AES/CBC/PKCS5Padding + +# Applies to ESAPI 2.0 and later only! +# Comma-separated list of cipher modes that provide *BOTH* +# confidentiality *AND* message authenticity. (NIST refers to such cipher +# modes as "combined modes" so that's what we shall call them.) If any of these +# cipher modes are used then no MAC is calculated and stored +# in the CipherText upon encryption. Likewise, if one of these +# cipher modes is used with decryption, no attempt will be made +# to validate the MAC contained in the CipherText object regardless +# of whether it contains one or not. Since the expectation is that +# these cipher modes support support message authenticity already, +# injecting a MAC in the CipherText object would be at best redundant. +# +# Note that as of JDK 1.5, the SunJCE provider does not support *any* +# of these cipher modes. Of these listed, only GCM and CCM are currently +# NIST approved. YMMV for other JCE providers. E.g., Bouncy Castle supports +# GCM and CCM with "NoPadding" mode, but not with "PKCS5Padding" or other +# padding modes. +Encryptor.cipher_modes.combined_modes=GCM,CCM,IAPM,EAX,OCB,CWC + +# Applies to ESAPI 2.0 and later only! +# Additional cipher modes allowed for ESAPI 2.0 encryption. These +# cipher modes are in _addition_ to those specified by the property +# 'Encryptor.cipher_modes.combined_modes'. +# Note: We will add support for streaming modes like CFB & OFB once +# we add support for 'specified' to the property 'Encryptor.ChooseIVMethod' +# (probably in ESAPI 2.1). +# DISCUSS: Better name? +Encryptor.cipher_modes.additional_allowed=CBC + +# 128-bit is almost always sufficient and appears to be more resistant to +# related key attacks than is 256-bit AES. Use '_' to use default key size +# for cipher algorithms (where it makes sense because the algorithm supports +# a variable key size). Key length must agree to what's provided as the +# cipher transformation, otherwise this will be ignored after logging a +# warning. +# +# NOTE: This is what applies BOTH ESAPI 1.4 and 2.0. See warning above about mixing! +Encryptor.EncryptionKeyLength=128 + +# Because 2.0 uses CBC mode by default, it requires an initialization vector (IV). +# (All cipher modes except ECB require an IV.) There are two choices: we can either +# use a fixed IV known to both parties or allow ESAPI to choose a random IV. While +# the IV does not need to be hidden from adversaries, it is important that the +# adversary not be allowed to choose it. Also, random IVs are generally much more +# secure than fixed IVs. (In fact, it is essential that feed-back cipher modes +# such as CFB and OFB use a different IV for each encryption with a given key so +# in such cases, random IVs are much preferred. By default, ESAPI 2.0 uses random +# IVs. If you wish to use 'fixed' IVs, set 'Encryptor.ChooseIVMethod=fixed' and +# uncomment the Encryptor.fixedIV. +# +# Valid values: random|fixed|specified 'specified' not yet implemented; planned for 2.1 +Encryptor.ChooseIVMethod=random +# If you choose to use a fixed IV, then you must place a fixed IV here that +# is known to all others who are sharing your secret key. The format should +# be a hex string that is the same length as the cipher block size for the +# cipher algorithm that you are using. The following is an *example* for AES +# from an AES test vector for AES-128/CBC as described in: +# NIST Special Publication 800-38A (2001 Edition) +# "Recommendation for Block Cipher Modes of Operation". +# (Note that the block size for AES is 16 bytes == 128 bits.) +# +Encryptor.fixedIV=0x000102030405060708090a0b0c0d0e0f + +# Whether or not CipherText should use a message authentication code (MAC) with it. +# This prevents an adversary from altering the IV as well as allowing a more +# fool-proof way of determining the decryption failed because of an incorrect +# key being supplied. This refers to the "separate" MAC calculated and stored +# in CipherText, not part of any MAC that is calculated as a result of a +# "combined mode" cipher mode. +# +# If you are using ESAPI with a FIPS 140-2 cryptographic module, you *must* also +# set this property to false. +Encryptor.CipherText.useMAC=true + +# Whether or not the PlainText object may be overwritten and then marked +# eligible for garbage collection. If not set, this is still treated as 'true'. +Encryptor.PlainText.overwrite=true + +# Do not use DES except in a legacy situations. 56-bit is way too small key size. +#Encryptor.EncryptionKeyLength=56 +#Encryptor.EncryptionAlgorithm=DES + +# TripleDES is considered strong enough for most purposes. +# Note: There is also a 112-bit version of DESede. Using the 168-bit version +# requires downloading the special jurisdiction policy from Sun. +#Encryptor.EncryptionKeyLength=168 +#Encryptor.EncryptionAlgorithm=DESede + +Encryptor.HashAlgorithm=SHA-512 +Encryptor.HashIterations=1024 +Encryptor.DigitalSignatureAlgorithm=SHA1withDSA +Encryptor.DigitalSignatureKeyLength=1024 +Encryptor.RandomAlgorithm=SHA1PRNG +Encryptor.CharacterEncoding=UTF-8 + +# This is the Pseudo Random Function (PRF) that ESAPI's Key Derivation Function +# (KDF) normally uses. Note this is *only* the PRF used for ESAPI's KDF and +# *not* what is used for ESAPI's MAC. (Currently, HmacSHA1 is always used for +# the MAC, mostly to keep the overall size at a minimum.) +# +# Currently supported choices for JDK 1.5 and 1.6 are: +# HmacSHA1 (160 bits), HmacSHA256 (256 bits), HmacSHA384 (384 bits), and +# HmacSHA512 (512 bits). +# Note that HmacMD5 is *not* supported for the PRF used by the KDF even though +# the JDKs support it. See the ESAPI 2.0 Symmetric Encryption User Guide +# further details. +Encryptor.KDF.PRF=HmacSHA256 +#=========================================================================== +# ESAPI Logging +# Set the application name if these logs are combined with other applications +Logger.ApplicationName=Ecompportal_application +# If you use an HTML log viewer that does not properly HTML escape log data, you can set LogEncodingRequired to true +Logger.LogEncodingRequired=false +# Determines whether ESAPI should log the application name. This might be clutter in some single-server/single-app environments. +Logger.LogApplicationName=true +# Determines whether ESAPI should log the server IP and port. This might be clutter in some single-server environments. +Logger.LogServerIP=true +# LogFileName, the name of the logging file. Provide a full directory path (e.g., C:\\ESAPI\\ESAPI_logging_file) if you +# want to place it in a specific directory. +Logger.LogFileName=Ecompportal_ESAPI_logging_file +# MaxLogFileSize, the max size (in bytes) of a single log file before it cuts over to a new one (default is 10,000,000) +Logger.MaxLogFileSize=10000000 + + +#=========================================================================== +# ESAPI Intrusion Detection +# +# Each event has a base to which .count, .interval, and .action are added +# The IntrusionException will fire if we receive "count" events within "interval" seconds +# The IntrusionDetector is configurable to take the following actions: log, logout, and disable +# (multiple actions separated by commas are allowed e.g. event.test.actions=log,disable +# +# Custom Events +# Names must start with "event." as the base +# Use IntrusionDetector.addEvent( "test" ) in your code to trigger "event.test" here +# You can also disable intrusion detection completely by changing +# the following parameter to true +# +IntrusionDetector.Disable=false +# +IntrusionDetector.event.test.count=2 +IntrusionDetector.event.test.interval=10 +IntrusionDetector.event.test.actions=disable,log + +# Exception Events +# All EnterpriseSecurityExceptions are registered automatically +# Call IntrusionDetector.getInstance().addException(e) for Exceptions that do not extend EnterpriseSecurityException +# Use the fully qualified classname of the exception as the base + +# any intrusion is an attack +IntrusionDetector.org.owasp.esapi.errors.IntrusionException.count=1 +IntrusionDetector.org.owasp.esapi.errors.IntrusionException.interval=1 +IntrusionDetector.org.owasp.esapi.errors.IntrusionException.actions=log,disable,logout + +# for test purposes +# CHECKME: Shouldn't there be something in the property name itself that designates +# that these are for testing??? +IntrusionDetector.org.owasp.esapi.errors.IntegrityException.count=10 +IntrusionDetector.org.owasp.esapi.errors.IntegrityException.interval=5 +IntrusionDetector.org.owasp.esapi.errors.IntegrityException.actions=log,disable,logout + +# rapid validation errors indicate scans or attacks in progress +# org.owasp.esapi.errors.ValidationException.count=10 +# org.owasp.esapi.errors.ValidationException.interval=10 +# org.owasp.esapi.errors.ValidationException.actions=log,logout + +# sessions jumping between hosts indicates session hijacking +IntrusionDetector.org.owasp.esapi.errors.AuthenticationHostException.count=2 +IntrusionDetector.org.owasp.esapi.errors.AuthenticationHostException.interval=10 +IntrusionDetector.org.owasp.esapi.errors.AuthenticationHostException.actions=log,logout + + +#=========================================================================== +# ESAPI Validation +# +# The ESAPI Validator works on regular expressions with defined names. You can define names +# either here, or you may define application specific patterns in a separate file defined below. +# This allows enterprises to specify both organizational standards as well as application specific +# validation rules. +# +Validator.ConfigurationFile=validation.properties +Validator.ConfigurationFile.MultiValued=false + +# Validators used by ESAPI +Validator.AccountName=^[a-zA-Z0-9]{3,20}$ +Validator.SystemCommand=^[a-zA-Z\\-\\/]{1,64}$ +Validator.RoleName=^[a-z]{1,20}$ + +#the word TEST below should be changed to your application +#name - only relative URL's are supported +Validator.Redirect=^\\/test.*$ + +# Global HTTP Validation Rules +# Values with Base64 encoded data (e.g. encrypted state) will need at least [a-zA-Z0-9\/+=] +Validator.HTTPScheme=^(http|https)$ +Validator.HTTPServerName=^[a-zA-Z0-9_.\\-]*$ +Validator.HTTPParameterName=^[a-zA-Z0-9_]{1,32}$ +Validator.HTTPParameterValue=^[a-zA-Z0-9.\\-\\/+=@_ ]*$ +Validator.HTTPCookieName=^[a-zA-Z0-9\\-_]{1,32}$ +Validator.HTTPCookieValue=^[a-zA-Z0-9\\-\\/+=_ ]*$ +Validator.HTTPHeaderName=^[a-zA-Z0-9\\-_]{1,32}$ +Validator.HTTPHeaderValue=^[a-zA-Z0-9()\\-=\\*\\.\\?;,+\\/:&_ ]*$ +Validator.HTTPContextPath=^\\/?[a-zA-Z0-9.\\-\\/_]*$ +Validator.HTTPServletPath=^[a-zA-Z0-9.\\-\\/_]*$ +Validator.HTTPPath=^[a-zA-Z0-9.\\-_]*$ +Validator.HTTPQueryString=^[a-zA-Z0-9()\\-=\\*\\.\\?;,+\\/:&_ %]*$ +Validator.HTTPURI=^[a-zA-Z0-9()\\-=\\*\\.\\?;,+\\/:&_ ]*$ +Validator.HTTPURL=^.*$ +Validator.HTTPJSESSIONID=^[A-Z0-9]{10,30}$ + +# Validation of file related input +Validator.FileName=^[a-zA-Z0-9!@#$%^&{}\\[\\]()_+\\-=,.~'` ]{1,255}$ +Validator.DirectoryName=^[a-zA-Z0-9:/\\\\!@#$%^&{}\\[\\]()_+\\-=,.~'` ]{1,255}$ diff --git a/ecomp-sdk/epsdk-fw/src/test/resources/key.properties b/ecomp-sdk/epsdk-fw/src/test/resources/key.properties new file mode 100644 index 00000000..aa3355d1 --- /dev/null +++ b/ecomp-sdk/epsdk-fw/src/test/resources/key.properties @@ -0,0 +1,41 @@ +### +# ============LICENSE_START========================================== +# ONAP Portal SDK +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +### + +# Properties read by the ECOMP Framework library (epsdk-fw) + +cipher.enc.key = AGLDdG4D04BKm2IxIWEr8o==
\ No newline at end of file diff --git a/ecomp-sdk/epsdk-fw/src/test/resources/portal.properties b/ecomp-sdk/epsdk-fw/src/test/resources/portal.properties new file mode 100644 index 00000000..15bedc9a --- /dev/null +++ b/ecomp-sdk/epsdk-fw/src/test/resources/portal.properties @@ -0,0 +1,3 @@ +# for testing only +ecomp_rest_url = http://localhost:55155 +ueb_app_key = 123abc diff --git a/ecomp-sdk/epsdk-fw/src/test/resources/validation.properties b/ecomp-sdk/epsdk-fw/src/test/resources/validation.properties new file mode 100644 index 00000000..b275093f --- /dev/null +++ b/ecomp-sdk/epsdk-fw/src/test/resources/validation.properties @@ -0,0 +1,32 @@ +# The ESAPI validator does many security checks on input, such as canonicalization +# and whitelist validation. Note that all of these validation rules are applied *after* +# canonicalization. Double-encoded characters (even with different encodings involved, +# are never allowed. +# +# To use: +# +# First set up a pattern below. You can choose any name you want, prefixed by the word +# "Validation." For example: +# Validation.Email=^[A-Za-z0-9._%-]+@[A-Za-z0-9.-]+\\.[a-zA-Z]{2,4}$ +# +# Then you can validate in your code against the pattern like this: +# ESAPI.validator().isValidInput("User Email", input, "Email", maxLength, allowNull); +# Where maxLength and allowNull are set for you needs, respectively. +# +# But note, when you use boolean variants of validation functions, you lose critical +# canonicalization. It is preferable to use the "get" methods (which throw exceptions) and +# and use the returned user input which is in canonical form. Consider the following: +# +# try { +# someObject.setEmail(ESAPI.validator().getValidInput("User Email", input, "Email", maxLength, allowNull)); +# +Validator.SafeString=^[.\\p{Alnum}\\p{Space}]{0,1024}$ +#Given the discussion: https://github.com/ESAPI/esapi-java-legacy/issues/374, a better upper-bound for domain name +#was selected as 62. This is slightly under the length in RFC-1035 +Validator.Email=^[A-Za-z0-9._%'-]+@[A-Za-z0-9.-]+\\.[a-zA-Z]{2,62}$ +Validator.Gmail=^[A-Za-z0-9._%'-+]+@[A-Za-z0-9.-]+\\.[a-zA-Z]{2,62}$ +Validator.IPAddress=^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$ +#Validator.URL=^(?:ht|f)tp(s?+)\\:\\/\\/[0-9a-zA-Z](?:[-.\\w]*[0-9a-zA-Z])*(?::(?:0-9)*)*(?:\\/?+)(?:[a-zA-Z0-9\\-\\.\\?\\,\\:\\'\\/\\\\\\+=&%\\$#_]*)?+$ +Validator.URL=^(?:ht|f)tp(?:s?)(?:[:A-Za-z0-9%/#?&.=-]*)$ +Validator.CreditCard=^(\\d{4}[- ]?){3}\\d{4}$ +Validator.SSN=^(?!000)([0-6]\\d{2}|7([0-6]\\d|7[012]))([ -]?)(?!00)\\d\\d\\3(?!0000)\\d{4}$
\ No newline at end of file |