Author: degenaro Date: Fri Feb 8 11:11:47 2013 New Revision: 1443937 URL: http://svn.apache.org/r1443937 Log: UIMA-2648 DUCC webserver (WS) to display test mode on page banners when ducc.properties comprises ducc.runmode=Test
Added: uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/$banner/$runmode.jsp uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/$banner/$runmode.production.jsp uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/$banner/$runmode.test.jsp uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/$banner/$testpattern.jsp uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/opensources/images/RCA_Indian_Head_test_pattern.JPG (with props) Modified: uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/java/org/apache/uima/ducc/ws/server/DuccWebServer.java uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/job.details.jsp uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/jobs.jsp uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/reservations.jsp uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/services.definitions.jsp uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/services.deployments.jsp uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/system.administration.jsp uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/system.classes.jsp uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/system.daemons.jsp uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/system.machines.jsp Modified: uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/java/org/apache/uima/ducc/ws/server/DuccWebServer.java URL: http://svn.apache.org/viewvc/uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/java/org/apache/uima/ducc/ws/server/DuccWebServer.java?rev=1443937&r1=1443936&r2=1443937&view=diff ============================================================================== --- uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/java/org/apache/uima/ducc/ws/server/DuccWebServer.java (original) +++ uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/java/org/apache/uima/ducc/ws/server/DuccWebServer.java Fri Feb 8 11:11:47 2013 @@ -19,6 +19,8 @@ package org.apache.uima.ducc.ws.server; import java.io.File; +import java.io.PrintWriter; +import java.util.Properties; import org.apache.jasper.servlet.JspServlet; import org.apache.uima.ducc.common.config.CommonConfiguration; @@ -178,7 +180,34 @@ public class DuccWebServer { resourceHandler.setDirectoriesListed(true); resourceHandler.setWelcomeFiles(new String[]{ "index.html" }); rootDir = ducc_web+File.separator+"root"; - resourceHandler.setResourceBase(rootDir); + resourceHandler.setResourceBase(rootDir); + // + try { + Properties properties = DuccWebProperties.get(); + String ducc_runmode = properties.getProperty("ducc.runmode","Production"); + logger.debug(methodName, null, "ducc.runmode:"+ducc_runmode); + logger.debug(methodName, null, "rootdir:"+rootDir); + String $runmode_jsp = rootDir+File.separator+"$banner"+File.separator+"$runmode.jsp"; + logger.debug(methodName, null, "$runmode_jsp:"+$runmode_jsp); + File $runmodeFile = new File($runmode_jsp); + logger.debug(methodName, null, "path:"+$runmodeFile.getAbsolutePath()); + $runmodeFile.delete(); + String text; + if(ducc_runmode.equals("Test")) { + text = "<html><%@ include file=\"$runmode.test.jsp\" %></html>"; + } + else { + text = "<html><%@ include file=\"$runmode.production.jsp\" %></html>"; + } + PrintWriter out = new PrintWriter($runmodeFile); + out.println(text); + out.flush(); + out.close(); + } + catch(Exception e) { + logger.info(methodName, null, e); + } + // HandlerList handlers = new HandlerList(); DuccHandler duccHandler = new DuccHandler(this); DuccHandlerLegacy duccHandlerLegacy = new DuccHandlerLegacy(this); Added: uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/$banner/$runmode.jsp URL: http://svn.apache.org/viewvc/uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/%24banner/%24runmode.jsp?rev=1443937&view=auto ============================================================================== --- uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/$banner/$runmode.jsp (added) +++ uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/$banner/$runmode.jsp Fri Feb 8 11:11:47 2013 @@ -0,0 +1,3 @@ +<html> +<%@ include file="$runmode.production.jsp" %> +</html> \ No newline at end of file Added: uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/$banner/$runmode.production.jsp URL: http://svn.apache.org/viewvc/uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/%24banner/%24runmode.production.jsp?rev=1443937&view=auto ============================================================================== --- uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/$banner/$runmode.production.jsp (added) +++ uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/$banner/$runmode.production.jsp Fri Feb 8 11:11:47 2013 @@ -0,0 +1,2 @@ +<html> +</html> \ No newline at end of file Added: uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/$banner/$runmode.test.jsp URL: http://svn.apache.org/viewvc/uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/%24banner/%24runmode.test.jsp?rev=1443937&view=auto ============================================================================== --- uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/$banner/$runmode.test.jsp (added) +++ uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/$banner/$runmode.test.jsp Fri Feb 8 11:11:47 2013 @@ -0,0 +1,3 @@ +<html> +<%@ include file="$testpattern.jsp" %> +</html> \ No newline at end of file Added: uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/$banner/$testpattern.jsp URL: http://svn.apache.org/viewvc/uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/%24banner/%24testpattern.jsp?rev=1443937&view=auto ============================================================================== --- uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/$banner/$testpattern.jsp (added) +++ uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/$banner/$testpattern.jsp Fri Feb 8 11:11:47 2013 @@ -0,0 +1,41 @@ +<!-- +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you 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 + +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. +--> +<td valign="middle" align="center"> +<table> +<tr> +<td> +<table> +<tr><td style="color: red;">T +<tr><td style="color: red;">E +<tr><td style="color: red;">S +<tr><td style="color: red;">T +</table> +<td>  +<td> +<a href="http://upload.wikimedia.org/wikipedia/commons/1/1b/RCA_Indian_Head_test_pattern.JPG" target="_test_pattern"><img src=../opensources/images/RCA_Indian_Head_test_pattern.JPG></a> +<td>  +<td> +<table> +<tr><td style="color: red;">T +<tr><td style="color: red;">E +<tr><td style="color: red;">S +<tr><td style="color: red;">T +</table> +</table> +</td> \ No newline at end of file Modified: uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/job.details.jsp URL: http://svn.apache.org/viewvc/uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/job.details.jsp?rev=1443937&r1=1443936&r2=1443937&view=diff ============================================================================== --- uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/job.details.jsp (original) +++ uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/job.details.jsp Fri Feb 8 11:11:47 2013 @@ -50,6 +50,8 @@ under the License. <%@ include file="$banner/c0-menu.jsp" %> </td> <!-- *********************** column ************************ --> +<%@ include file="$banner/$runmode.jsp" %> +<!-- *********************** column ************************ --> <td valign="middle" align="center"> <%@ include file="$banner/c1-refresh-job-details.jsp" %> </td> Modified: uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/jobs.jsp URL: http://svn.apache.org/viewvc/uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/jobs.jsp?rev=1443937&r1=1443936&r2=1443937&view=diff ============================================================================== --- uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/jobs.jsp (original) +++ uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/jobs.jsp Fri Feb 8 11:11:47 2013 @@ -118,6 +118,8 @@ if (table_style.equals("classic")) { <%@ include file="$banner/c0-menu.jsp" %> </td> <!-- *********************** column ************************ --> +<%@ include file="$banner/$runmode.jsp" %> +<!-- *********************** column ************************ --> <td valign="middle" align="center"> <%@ include file="$banner/c1-refresh-jobs.jsp" %> </td> Added: uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/opensources/images/RCA_Indian_Head_test_pattern.JPG URL: http://svn.apache.org/viewvc/uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/opensources/images/RCA_Indian_Head_test_pattern.JPG?rev=1443937&view=auto ============================================================================== Binary file - no diff available. Propchange: uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/opensources/images/RCA_Indian_Head_test_pattern.JPG ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Modified: uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/reservations.jsp URL: http://svn.apache.org/viewvc/uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/reservations.jsp?rev=1443937&r1=1443936&r2=1443937&view=diff ============================================================================== --- uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/reservations.jsp (original) +++ uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/reservations.jsp Fri Feb 8 11:11:47 2013 @@ -111,6 +111,8 @@ if (table_style.equals("classic")) { <%@ include file="$banner/c0-menu.jsp" %> </td> <!-- *********************** column ************************ --> +<%@ include file="$banner/$runmode.jsp" %> +<!-- *********************** column ************************ --> <td valign="middle" align="center"> <div id="reservation_form_button"> <button title="Login to enable" disabled style="font-size:8pt;">Request<br>Reservation</button> Modified: uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/services.definitions.jsp URL: http://svn.apache.org/viewvc/uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/services.definitions.jsp?rev=1443937&r1=1443936&r2=1443937&view=diff ============================================================================== --- uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/services.definitions.jsp (original) +++ uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/services.definitions.jsp Fri Feb 8 11:11:47 2013 @@ -108,6 +108,8 @@ if (table_style.equals("classic")) { <%@ include file="$banner/c0-menu.jsp" %> </td> <!-- *********************** column ************************ --> +<%@ include file="$banner/$runmode.jsp" %> +<!-- *********************** column ************************ --> <td valign="middle" align="center"> <%@ include file="$banner/c1-refresh-services-definitions.jsp" %> </td> Modified: uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/services.deployments.jsp URL: http://svn.apache.org/viewvc/uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/services.deployments.jsp?rev=1443937&r1=1443936&r2=1443937&view=diff ============================================================================== --- uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/services.deployments.jsp (original) +++ uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/services.deployments.jsp Fri Feb 8 11:11:47 2013 @@ -112,6 +112,8 @@ if (table_style.equals("classic")) { <%@ include file="$banner/c0-menu.jsp" %> </td> <!-- *********************** column ************************ --> +<%@ include file="$banner/$runmode.jsp" %> +<!-- *********************** column ************************ --> <td valign="middle" align="center"> <%@ include file="$banner/c1-refresh-services-deployments.jsp" %> </td> Modified: uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/system.administration.jsp URL: http://svn.apache.org/viewvc/uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/system.administration.jsp?rev=1443937&r1=1443936&r2=1443937&view=diff ============================================================================== --- uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/system.administration.jsp (original) +++ uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/system.administration.jsp Fri Feb 8 11:11:47 2013 @@ -51,6 +51,8 @@ under the License. <%@ include file="$banner/c0-menu.jsp" %> </td> <!-- *********************** column ************************ --> +<%@ include file="$banner/$runmode.jsp" %> +<!-- *********************** column ************************ --> <td valign="middle" align="center"> <%@ include file="$banner/c1-refresh-system-administration.jsp" %> </td> Modified: uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/system.classes.jsp URL: http://svn.apache.org/viewvc/uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/system.classes.jsp?rev=1443937&r1=1443936&r2=1443937&view=diff ============================================================================== --- uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/system.classes.jsp (original) +++ uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/system.classes.jsp Fri Feb 8 11:11:47 2013 @@ -112,6 +112,8 @@ if (table_style.equals("classic")) { <%@ include file="$banner/c0-menu.jsp" %> </td> <!-- *********************** column ************************ --> +<%@ include file="$banner/$runmode.jsp" %> +<!-- *********************** column ************************ --> <td valign="middle" align="center"> <%@ include file="$banner/c1-refresh-system-classes.jsp" %> </td> Modified: uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/system.daemons.jsp URL: http://svn.apache.org/viewvc/uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/system.daemons.jsp?rev=1443937&r1=1443936&r2=1443937&view=diff ============================================================================== --- uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/system.daemons.jsp (original) +++ uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/system.daemons.jsp Fri Feb 8 11:11:47 2013 @@ -110,6 +110,8 @@ if (table_style.equals("classic")) { <%@ include file="$banner/c0-menu.jsp" %> </td> <!-- *********************** column ************************ --> +<%@ include file="$banner/$runmode.jsp" %> +<!-- *********************** column ************************ --> <td valign="middle" align="center"> <div id="show_agents_form_button"> <button id="showbutton" style="font-size:8pt;" onclick="ducc_show_agents()">Show<br>Agents</button> Modified: uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/system.machines.jsp URL: http://svn.apache.org/viewvc/uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/system.machines.jsp?rev=1443937&r1=1443936&r2=1443937&view=diff ============================================================================== --- uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/system.machines.jsp (original) +++ uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/system.machines.jsp Fri Feb 8 11:11:47 2013 @@ -124,6 +124,8 @@ if (table_style.equals("classic")) { <%@ include file="$banner/c0-menu.jsp" %> </td> <!-- *********************** column ************************ --> +<%@ include file="$banner/$runmode.jsp" %> +<!-- *********************** column ************************ --> <td valign="middle" align="center"> <%@ include file="$banner/c1-refresh-system-machines.jsp" %> </td>