LISTSERV mailing list manager LISTSERV 16.5

Help for HPS-SVN Archives


HPS-SVN Archives

HPS-SVN Archives


HPS-SVN@LISTSERV.SLAC.STANFORD.EDU


View:

Message:

[

First

|

Previous

|

Next

|

Last

]

By Topic:

[

First

|

Previous

|

Next

|

Last

]

By Author:

[

First

|

Previous

|

Next

|

Last

]

Font:

Proportional Font

LISTSERV Archives

LISTSERV Archives

HPS-SVN Home

HPS-SVN Home

HPS-SVN  October 2015

HPS-SVN October 2015

Subject:

r3905 - in /webapps/trunk/data-quality-webapp: pom.xml src/main/java/org/hps/webapps/dataquality/ShowPlotsServlet.java src/main/webapp/index.jsp src/main/webapp/plot_page.jsp src/main/webapp/show_plots.jsp src/main/webapp/tree_page.jsp

From:

[log in to unmask]

Reply-To:

Notification of commits to the hps svn repository <[log in to unmask]>

Date:

Wed, 28 Oct 2015 20:11:56 -0000

Content-Type:

text/plain

Parts/Attachments:

Parts/Attachments

text/plain (201 lines)

Author: [log in to unmask]
Date: Wed Oct 28 13:11:53 2015
New Revision: 3905

Log:
Cleanup session state variables; add ROOT support.

Modified:
    webapps/trunk/data-quality-webapp/pom.xml
    webapps/trunk/data-quality-webapp/src/main/java/org/hps/webapps/dataquality/ShowPlotsServlet.java
    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

Modified: webapps/trunk/data-quality-webapp/pom.xml
 =============================================================================
--- webapps/trunk/data-quality-webapp/pom.xml	(original)
+++ webapps/trunk/data-quality-webapp/pom.xml	Wed Oct 28 13:11:53 2015
@@ -41,6 +41,11 @@
         <dependency>
             <groupId>org.freehep</groupId>
             <artifactId>freehep-jaida-xml</artifactId>
+            <version>3.4.13-SNAPSHOT</version>
+        </dependency>
+        <dependency>
+            <groupId>org.freehep</groupId>
+            <artifactId>freehep-jaida-root</artifactId>
             <version>3.4.13-SNAPSHOT</version>
         </dependency>
         <dependency>

Modified: 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	(original)
+++ webapps/trunk/data-quality-webapp/src/main/java/org/hps/webapps/dataquality/ShowPlotsServlet.java	Wed Oct 28 13:11:53 2015
@@ -28,10 +28,20 @@
     }
 
     public void doGet(final HttpServletRequest request, final HttpServletResponse response) throws ServletException, IOException {
-    	if (request.getParameter("rootDataURI") == null) {
-    		throw new RuntimeException("rootDataURI is null");
+    	String file = request.getParameter("file");
+        if (file == null) {
+            throw new RuntimeException("The file parameter is missing from the request.");
     	}    	
-    	request.getSession().setAttribute("rootDataURI", request.getParameter("rootDataURI"));
+    	request.getSession().setAttribute("file", file);
+        String storeType = null;
+        if (file.endsWith(".root")) {
+            storeType = "root";
+        } else if (file.endsWith(".aida")) {
+            storeType = "xml";
+        } else {
+            throw new IllegalArgumentException("File " + file + " has unknown file extension.");
+        }
+        request.getSession().setAttribute("storeType", storeType);
         final RequestDispatcher dispatcher = this.getServletContext().getRequestDispatcher("/show_plots.jsp");
         dispatcher.forward(request, response);
     }   

Modified: webapps/trunk/data-quality-webapp/src/main/webapp/index.jsp
 =============================================================================
--- webapps/trunk/data-quality-webapp/src/main/webapp/index.jsp	(original)
+++ webapps/trunk/data-quality-webapp/src/main/webapp/index.jsp	Wed Oct 28 13:11:53 2015
@@ -1,20 +1,14 @@
-<%@page contentType="text/html"
-    import="org.freehep.graphicsio.gif.GIFImageWriteParam,org.freehep.graphicsio.raw.RawImageWriteParam"%>
+<%@page contentType="text/html"%>
 <%@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>
+<title>Show Plots</title>
 <base target="_self">
 </head>
 <body>
     <form action="show_plots" method="GET" target="_blank">
         File:<br> 
-        <input type="text" name="rootDataURI" /> 
+        <input type="text" name="file" /> 
         <input type="submit" value="Show Plots" />
     </form>
 </body>

Modified: webapps/trunk/data-quality-webapp/src/main/webapp/plot_page.jsp
 =============================================================================
--- webapps/trunk/data-quality-webapp/src/main/webapp/plot_page.jsp	(original)
+++ webapps/trunk/data-quality-webapp/src/main/webapp/plot_page.jsp	Wed Oct 28 13:11:53 2015
@@ -5,11 +5,6 @@
 <%@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>
@@ -20,7 +15,7 @@
     <!-- If nothing to plot (empty path) -->
     <c:if test="${empty param.plotHref && empty aidaPath}">
         <h3>
-            <b>Plot Frame</b>
+            <b>Select Plots from the Tree</b>
         </h3>
     </c:if>
 
@@ -29,9 +24,9 @@
 
         <!-- 
             Get AIDA Tree.  
-            rootDataURI - name of the root file, defined elsewhere.
+            file - name of the root file, defined elsewhere.
         -->
-        <aida:tree storeName="${rootDataURI}" storeType="xml">
+        <aida:tree storeName="${file}" storeType="${storeType}">
         </aida:tree>
 
         <c:if test="${!empty param.plotHref}">
@@ -40,7 +35,7 @@
         <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 storeName="${file}" path="${aidaPath}" var="aidaObjects">
         </aida:objects>
 
         <c:set value="${fn:contains(aidaObjects[0], 'Histogram2D')}" var="isHistogram2D"/>

Modified: webapps/trunk/data-quality-webapp/src/main/webapp/show_plots.jsp
 =============================================================================
--- webapps/trunk/data-quality-webapp/src/main/webapp/show_plots.jsp	(original)
+++ webapps/trunk/data-quality-webapp/src/main/webapp/show_plots.jsp	Wed Oct 28 13:11:53 2015
@@ -4,16 +4,10 @@
 <%@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>
     <h3>
-        <b>File:</b> <%=rootDataURI%>
+        <b>File:</b> <c:out value="${file}"/>
     </h3>
     <iframe src="tree_page.jsp" name="treeFrame" height="100%" width="30%"></iframe>
     <iframe src="plot_page.jsp" name="plotFrame" height="100%" width="68%"></iframe>

Modified: webapps/trunk/data-quality-webapp/src/main/webapp/tree_page.jsp
 =============================================================================
--- webapps/trunk/data-quality-webapp/src/main/webapp/tree_page.jsp	(original)
+++ webapps/trunk/data-quality-webapp/src/main/webapp/tree_page.jsp	Wed Oct 28 13:11:53 2015
@@ -5,29 +5,24 @@
 <%@ 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>
+<title>AIDA Plots - <c:out value="${file}" /></title>
 <base target="plotFrame">
 </head>
 
 <body>
 
-    <aida:tree storeName="${rootDataURI}" storeType="xml" />
+    <aida:tree storeName="${file}" storeType="${storeType}" />
 
-    <c:if test="${empty rootDataURI}">
-        <h3>rootDataURI not set</h3>
+    <c:if test="${empty file}">
+        <h3>file not set</h3>
     </c:if>
 
-    <c:if test="${!empty rootDataURI}">
+    <c:if test="${!empty file}">
         <aida:displaytree leafHref="plot_page.jsp?plotHref=%p" folderHref="plot_page.jsp?plotHref=%p" rootLabel="/"
             rootVisible="false" showItemCount="true" showFolderHrefForNodesWithLeavesOnly="true"
-            storeName="${rootDataURI}" />
+            storeName="${file}" />
     </c:if>
 
 </body>

Top of Message | Previous Page | Permalink

Advanced Options


Options

Log In

Log In

Get Password

Get Password


Search Archives

Search Archives


Subscribe or Unsubscribe

Subscribe or Unsubscribe


Archives

November 2017
August 2017
July 2017
January 2017
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
December 2013
November 2013

ATOM RSS1 RSS2



LISTSERV.SLAC.STANFORD.EDU

Secured by F-Secure Anti-Virus CataList Email List Search Powered by the LISTSERV Email List Manager

Privacy Notice, Security Notice and Terms of Use