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> <Bass 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> <Bass 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>