Print

Print


Author: [log in to unmask]
Date: Mon Sep 21 15:09:42 2015
New Revision: 3654

Log:
Initial commit of data quality webapp.

Added:
    webapps/trunk/data-quality-webapp/
    webapps/trunk/data-quality-webapp/pom.xml
    webapps/trunk/data-quality-webapp/src/
    webapps/trunk/data-quality-webapp/src/main/
    webapps/trunk/data-quality-webapp/src/main/java/
    webapps/trunk/data-quality-webapp/src/main/java/org/
    webapps/trunk/data-quality-webapp/src/main/java/org/hps/
    webapps/trunk/data-quality-webapp/src/main/java/org/hps/webapps/
    webapps/trunk/data-quality-webapp/src/main/java/org/hps/webapps/dataquality/
    webapps/trunk/data-quality-webapp/src/main/java/org/hps/webapps/dataquality/ShowPlotsServlet.java
    webapps/trunk/data-quality-webapp/src/main/webapp/
    webapps/trunk/data-quality-webapp/src/main/webapp/WEB-INF/
    webapps/trunk/data-quality-webapp/src/main/webapp/WEB-INF/context.xml
    webapps/trunk/data-quality-webapp/src/main/webapp/WEB-INF/web.xml
    webapps/trunk/data-quality-webapp/src/main/webapp/index.jsp
    webapps/trunk/data-quality-webapp/src/main/webapp/plot_page.jsp
    webapps/trunk/data-quality-webapp/src/main/webapp/show_plots.jsp
    webapps/trunk/data-quality-webapp/src/main/webapp/tree_page.jsp

Added: webapps/trunk/data-quality-webapp/pom.xml
 =============================================================================
--- webapps/trunk/data-quality-webapp/pom.xml	(added)
+++ webapps/trunk/data-quality-webapp/pom.xml	Mon Sep 21 15:09:42 2015
@@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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>
+    <groupId>org.hps</groupId>
+    <artifactId>hps-data-quality-webapp</artifactId>
+    <name>data-quality-webapp</name>
+    <description>Data Quality Web Application</description>
+    <packaging>war</packaging>
+    <version>1.0.0-SNAPSHOT</version>
+    <repositories>
+        <repository>
+            <id>maven-central-repo</id>
+            <name>Maven repository</name>
+            <url>http://repo1.maven.org/maven2/</url>
+            <snapshots>
+                <enabled>false</enabled>
+            </snapshots>
+            <releases>
+                <enabled>true</enabled>
+            </releases>
+        </repository>
+        <repository>
+            <id>freehep-maven2-public</id>
+            <name>Maven FreeHEP</name>
+            <url>http://srs.slac.stanford.edu/nexus/content/groups/freehep-maven2-public/</url>
+            <snapshots>
+                <enabled>true</enabled>
+            </snapshots>
+            <releases>
+                <enabled>true</enabled>
+            </releases>
+        </repository>
+    </repositories>
+    <dependencies>
+        <dependency>
+            <groupId>org.freehep</groupId>
+            <artifactId>freehep-aidatld</artifactId>
+            <version>1.4.4-SNAPSHOT</version>
+        </dependency>             
+        <dependency>
+            <groupId>org.freehep</groupId>
+            <artifactId>freehep-jaida-xml</artifactId>
+            <version>3.4.13-SNAPSHOT</version>
+        </dependency>
+        <dependency>
+            <groupId>org.freehep</groupId>
+            <artifactId>jas-plotter</artifactId>
+            <version>2.2.3</version>
+        </dependency>                
+        <dependency>
+            <groupId>org.freehep</groupId>
+            <artifactId>freehep-graphicsio</artifactId>
+            <version>2.3</version>
+        </dependency>
+        <dependency>
+            <groupId>org.freehep</groupId>
+            <artifactId>freehep-graphicsio-pdf</artifactId>
+            <version>2.3</version>
+        </dependency>
+        <dependency>
+            <groupId>org.freehep</groupId>
+            <artifactId>freehep-graphicsio-swf</artifactId>
+            <version>2.3</version>
+        </dependency>
+        <dependency>
+            <groupId>org.freehep</groupId>
+            <artifactId>freehep-graphicsio-svg</artifactId>
+            <version>2.3</version>
+        </dependency>
+        <dependency>
+            <groupId>org.freehep</groupId>
+            <artifactId>freehep-graphicsio-ps</artifactId>
+            <version>2.3</version>
+        </dependency>
+        <dependency>
+            <groupId>org.freehep</groupId>
+            <artifactId>freehep-graphicsio-emf</artifactId>
+            <version>2.3</version>
+        </dependency>
+        <dependency>
+            <groupId>org.freehep</groupId>
+            <artifactId>freehep-graphicsbase</artifactId>
+            <version>2.3</version>
+        </dependency>
+        <dependency>
+            <groupId>taglibs</groupId>
+            <artifactId>standard</artifactId>
+            <version>1.1.2</version>            
+        </dependency>
+        <dependency>
+            <groupId>javax.servlet</groupId>
+            <artifactId>servlet-api</artifactId>
+            <version>2.4</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>javax.servlet</groupId>
+            <artifactId>jsp-api</artifactId>
+            <version>2.0</version>
+            <scope>provided</scope>
+        </dependency>                
+    </dependencies>
+    <build>
+        <defaultGoal>war:war tomcat7:redeploy</defaultGoal>
+        <finalName>hps-run-webapp</finalName>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.tomcat.maven</groupId>
+                <artifactId>tomcat7-maven-plugin</artifactId>
+                <version>2.2</version>
+                <configuration>
+                    <url>http://localhost:8080/manager/text</url>
+                    <server>local-tomcat-server</server>
+                    <path>/data-quality</path>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+</project>

Added: webapps/trunk/data-quality-webapp/src/main/java/org/hps/webapps/dataquality/ShowPlotsServlet.java
 =============================================================================
--- webapps/trunk/data-quality-webapp/src/main/java/org/hps/webapps/dataquality/ShowPlotsServlet.java	(added)
+++ webapps/trunk/data-quality-webapp/src/main/java/org/hps/webapps/dataquality/ShowPlotsServlet.java	Mon Sep 21 15:09:42 2015
@@ -0,0 +1,20 @@
+package org.hps.webapps.dataquality;
+
+import java.io.IOException;
+
+import javax.servlet.RequestDispatcher;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+public class ShowPlotsServlet extends HttpServlet {
+    public void doGet(final HttpServletRequest request, final HttpServletResponse response) throws ServletException, IOException {
+    	if (request.getParameter("rootDataURI") == null) {
+    		throw new RuntimeException("rootDataURI is null");
+    	}
+    	request.getSession().setAttribute("rootDataURI", request.getParameter("rootDataURI"));
+        final RequestDispatcher dispatcher = this.getServletContext().getRequestDispatcher("/show_plots.jsp");
+        dispatcher.forward(request, response);
+    }   
+}

Added: webapps/trunk/data-quality-webapp/src/main/webapp/WEB-INF/context.xml
 =============================================================================
--- webapps/trunk/data-quality-webapp/src/main/webapp/WEB-INF/context.xml	(added)
+++ webapps/trunk/data-quality-webapp/src/main/webapp/WEB-INF/context.xml	Mon Sep 21 15:09:42 2015
@@ -0,0 +1,2 @@
+<Context>
+</Context>

Added: webapps/trunk/data-quality-webapp/src/main/webapp/WEB-INF/web.xml
 =============================================================================
--- webapps/trunk/data-quality-webapp/src/main/webapp/WEB-INF/web.xml	(added)
+++ webapps/trunk/data-quality-webapp/src/main/webapp/WEB-INF/web.xml	Mon Sep 21 15:09:42 2015
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
+    version="2.4">
+    
+    <session-config>
+        <session-timeout>9999</session-timeout>
+    </session-config>    
+    
+    <!-- plot servlet -->
+    <servlet>
+        <servlet-name>showplots</servlet-name>
+        <servlet-class>org.hps.webapps.dataquality.ShowPlotsServlet</servlet-class>
+    </servlet>
+
+    <servlet-mapping>
+        <servlet-name>showplots</servlet-name>
+        <url-pattern>/show_plots</url-pattern>
+    </servlet-mapping>
+                   
+    <!-- plot servlet -->
+    <servlet>
+        <servlet-name>aidaplot</servlet-name>
+        <servlet-class>hep.aida.web.servlet.PlotServlet</servlet-class>
+        <load-on-startup>1</load-on-startup>
+    </servlet>
+
+    <servlet-mapping>
+        <servlet-name>aidaplot</servlet-name>
+        <url-pattern>/aida_plot.jsp</url-pattern>
+    </servlet-mapping>
+    
+    <!-- icon servlet -->
+    <servlet>
+        <servlet-name>fhicon</servlet-name>
+        <servlet-class>org.freehep.webutil.tree.IconServlet</servlet-class>
+        <load-on-startup>1</load-on-startup>
+    </servlet>
+    
+    <servlet-mapping>
+        <servlet-name>fhicon</servlet-name>
+        <url-pattern>/icon.jsp</url-pattern>
+    </servlet-mapping>    
+
+</web-app>         
+         

Added: webapps/trunk/data-quality-webapp/src/main/webapp/index.jsp
 =============================================================================
--- webapps/trunk/data-quality-webapp/src/main/webapp/index.jsp	(added)
+++ webapps/trunk/data-quality-webapp/src/main/webapp/index.jsp	Mon Sep 21 15:09:42 2015
@@ -0,0 +1,21 @@
+<%@page contentType="text/html"
+    import="org.freehep.graphicsio.gif.GIFImageWriteParam,org.freehep.graphicsio.raw.RawImageWriteParam"%>
+<%@page pageEncoding="UTF-8"%>
+
+<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
+<%@taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
+<%@taglib prefix="aida" uri="http://aida.freehep.org/jsp20"%>
+<%@page isELIgnored="false"%>
+
+<head>
+<title>Show AIDA Plots</title>
+<Bass target="_self">
+</head>
+<body>
+    <form action="show_plots" method="GET" target="_blank">
+        File:<br> 
+        <input type="text" name="rootDataURI" /> 
+        <input type="submit" value="Show Plots" />
+    </form>
+</body>
+</html>

Added: webapps/trunk/data-quality-webapp/src/main/webapp/plot_page.jsp
 =============================================================================
--- webapps/trunk/data-quality-webapp/src/main/webapp/plot_page.jsp	(added)
+++ webapps/trunk/data-quality-webapp/src/main/webapp/plot_page.jsp	Mon Sep 21 15:09:42 2015
@@ -0,0 +1,111 @@
+<%@page contentType="text/html" import="org.freehep.graphicsio.gif.GIFImageWriteParam,org.freehep.graphicsio.raw.RawImageWriteParam"%>
+<%@page pageEncoding="UTF-8"%>
+
+<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
+<%@taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
+<%@taglib prefix="aida" uri="http://aida.freehep.org/jsp20"%>
+<%@page isELIgnored="false"%>
+
+<%
+    String rootDataURI = (String) session.getAttribute("rootDataURI");
+%>
+<c:set var="rootDataURI" value="<%= rootDataURI %>"/>
+
+<head>
+<title>AIDA Plot Frame</title>
+<Bass target="_self">
+</head>
+<body>
+
+    <!-- If nothing to plot (empty path) -->
+    <c:if test="${empty param.plotHref && empty aidaPath}">
+        <h3>
+            <b>Plot Frame</b>
+        </h3>
+    </c:if>
+
+    <!-- Do plotting only if path is non-empty -->
+    <c:if test="${!empty param.plotHref || !empty aidaPath}">
+
+        <!-- 
+      Get AIDA Tree. 
+      rootDataURI - name of the root file, defined elsewhere.
+    -->
+        <aida:tree storeName="${rootDataURI}" storeType="xml">
+        </aida:tree>
+
+        <c:if test="${!empty param.plotHref}">
+            <c:set var="aidaPath" value="${param.plotHref}" scope="session" />
+        </c:if>
+        <c:set var="ref" value="plot_page.jsp?plotHref=${aidaPath}" />
+
+        <!-- Get data from the AIDA Tree and put into "aidaObjects" variable -->
+        <aida:objects storeName="${rootDataURI}" path="${aidaPath}" var="aidaObjects">
+        </aida:objects>
+
+        <h3>
+            <b>Path:</b> ${aidaPath}
+        </h3>
+
+        <!-- Display Plotter Style Editor that controls Errors, Markers, etc. (optional) -->
+        <aida:plotterStyleEditor selectorText="Style Editor" includeNormalization="false" includeComparison="false"
+            action="${ref}" var="styleVar" />
+
+        <!-- Create clickable Image Map only for multiple data only (optional) -->
+        <c:set var="imgMap" value="false" />
+        <c:if test="${!empty aidaObjects && fn:length(aidaObjects) > 1}">
+            <c:set var="imgMap" value="true" />
+        </c:if>
+
+        <!-- Plot single or multiple data using "plotset" tag -->
+        <aida:plotset statusvar="status" nplots="${fn:length(aidaObjects)}" createImageMap="${imgMap}"
+            allowDownload="true" format="png">
+
+            <!-- Display the default navigation bar inside the Table (optional) -->
+            <aida:plotsetbar var="barVar" url="${ref}">
+                <c:if test="${barVar.npages > 1}">
+                    <TABLE bgcolor="D0D0D0" border="1">
+                        <TR>
+                            <TD>&nbsp;${barVar.defaultbar}&nbsp;</TD>
+                        </TR>
+                    </TABLE>
+                    <br>
+                </c:if>
+            </aida:plotsetbar>
+
+            <!-- Format plotter style according to the Plotter Style Editor settings (optional) -->
+            <c:if test="${!empty styleVar.showPlotStyle && styleVar.showPlotStyle != false}">
+                <aida:style>
+                    <aida:style type="statisticsBox">
+                        <aida:attribute name="isVisible" value="${styleVar.showStatistics}" />
+                    </aida:style>
+                    <aida:style type="legendBox">
+                        <aida:attribute name="isVisible" value="${styleVar.showLegend}" />
+                    </aida:style>
+                    <aida:style type="data">
+                        <aida:style type="errorBar">
+                            <aida:attribute name="isVisible" value="${styleVar.showError}" />
+                        </aida:style>
+                        <aida:style type="fill">
+                            <aida:attribute name="color" value="blue" />
+                        </aida:style>
+                        <c:if test="${!empty styleVar.markerSize && styleVar.markerSize != 'none'}">
+                            <aida:style type="marker">
+                                <aida:attribute name="isVisible" value="true" />
+                                <aida:attribute name="size" value="${styleVar.markerSize}" />
+                            </aida:style>
+                        </c:if>                                        
+                    </aida:style>
+                </aida:style>
+            </c:if>
+
+            <aida:region href="${ref}/${aida:objectName(aidaObjects[status.index])}">
+                <aida:plot var="${aidaObjects[status.index]}">
+                </aida:plot>
+            </aida:region>
+
+        </aida:plotset>
+    </c:if>
+
+</body>
+</html>

Added: webapps/trunk/data-quality-webapp/src/main/webapp/show_plots.jsp
 =============================================================================
--- webapps/trunk/data-quality-webapp/src/main/webapp/show_plots.jsp	(added)
+++ webapps/trunk/data-quality-webapp/src/main/webapp/show_plots.jsp	Mon Sep 21 15:09:42 2015
@@ -0,0 +1,23 @@
+<%@page contentType="text/html" import="org.freehep.graphicsio.raw.RawImageWriteParam"%>
+<%@page pageEncoding="UTF-8"%>
+
+<%@taglib prefix="aida" uri="http://aida.freehep.org/jsp20"%>
+<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
+
+<%
+	String rootDataURI = (String) session.getAttribute("rootDataURI");
+	String sessionId = session.getId();
+%>
+<c:set var="rootDataURI" value="<%=rootDataURI%>" />
+
+<html>
+<body>
+    <h1>AIDA Plots</h1>
+    <p>
+        <b>File:</b> 
+        <%=rootDataURI%>
+    </p>
+    <iframe src="tree_page.jsp" name="treeFrame" height="100%" width="30%"></iframe>
+    <iframe src="plot_page.jsp" name="plotFrame" height="100%" width="68%"></iframe>
+</body>
+</html>

Added: webapps/trunk/data-quality-webapp/src/main/webapp/tree_page.jsp
 =============================================================================
--- webapps/trunk/data-quality-webapp/src/main/webapp/tree_page.jsp	(added)
+++ webapps/trunk/data-quality-webapp/src/main/webapp/tree_page.jsp	Mon Sep 21 15:09:42 2015
@@ -0,0 +1,34 @@
+<%@page contentType="text/html"%>
+<%@page pageEncoding="UTF-8"%>
+
+<%@taglib prefix="aida" uri="http://aida.freehep.org/jsp20"%>
+<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
+<%@page isELIgnored="false"%>
+
+<%
+    String rootDataURI = (String) session.getAttribute("rootDataURI");
+%>
+<c:set var="rootDataURI" value="<%= rootDataURI %>"/>
+
+<html>
+<head>
+<title>AIDA Plots - <c:out value="${rootDataURI}" /></title>
+<Bass target="plotFrame">
+</head>
+
+<body>
+
+    <aida:tree storeName="${rootDataURI}" storeType="xml" />
+
+    <c:if test="${empty rootDataURI}">
+        <h3>rootDataURI not set</h3>
+    </c:if>
+
+    <c:if test="${!empty rootDataURI}">
+        <aida:displaytree leafHref="plot_page.jsp?plotHref=%p" folderHref="plot_page.jsp?plotHref=%p" rootLabel="/"
+            rootVisible="false" showItemCount="true" showFolderHrefForNodesWithLeavesOnly="true"
+            storeName="${rootDataURI}" />
+    </c:if>
+
+</body>
+</html>