You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by re...@apache.org on 2001/12/20 10:31:52 UTC

cvs commit: jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin ServerForm.java ServiceForm.java SetUpServerAction.java SetUpServiceAction.java

remm        01/12/20 01:31:52

  Modified:    webapps/admin server.jsp service.jsp
               webapps/admin/WEB-INF struts-config.xml
               webapps/admin/WEB-INF/classes/org/apache/webapp/admin
                        ServerForm.java ServiceForm.java
                        SetUpServerAction.java SetUpServiceAction.java
  Log:
  - Modified server.jsp and service.jsp to use custom tags to generate the
  list of available actions from each page.
  Using these custom tags eliminates the need of setting ActionVals in
  SetUpServer and SetUpService.java
  - Patch submitted by Manveen Kaur <manveen.kaur at sun.com>
  
  Revision  Changes    Path
  1.3       +8 -5      jakarta-tomcat-4.0/webapps/admin/server.jsp
  
  Index: server.jsp
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/webapps/admin/server.jsp,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- server.jsp	2001/12/11 22:54:12	1.2
  +++ server.jsp	2001/12/20 09:31:51	1.3
  @@ -4,6 +4,7 @@
   <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
   <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
   <%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
  +<%@ taglib uri="/WEB-INF/controls.tld" prefix="controls" %>
   
   <html:html locale="true">
   
  @@ -23,11 +24,13 @@
         </td>
         <td align="right" nowrap> 
           <div class="page-title-text">
  -          <html:select property="action">
  -          <bean:define id="actionVals" name="serverForm" property="actionVals"/>
  -          <html:options collection="actionVals" 
  -            property="value" labelProperty="label"/>
  -            </html:select>
  +        <controls:actions>
  +            <controls:action selected="true"> ----<bean:message key="actions.available.actions"/>---- </controls:action>
  +            <controls:action> --------------------------------- </controls:action>
  +            <!-- will add the urls later once those screens get implemented -->
  +            <controls:action url="">  <bean:message key="actions.services.create"/> </controls:action>
  +            <controls:action url="">  <bean:message key="actions.services.delete"/> </controls:action>
  +        </controls:actions>
           </div>
         </td>
       </tr>
  
  
  
  1.2       +28 -5     jakarta-tomcat-4.0/webapps/admin/service.jsp
  
  Index: service.jsp
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/webapps/admin/service.jsp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- service.jsp	2001/12/14 23:22:33	1.1
  +++ service.jsp	2001/12/20 09:31:51	1.2
  @@ -4,6 +4,7 @@
   <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
   <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
   <%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
  +<%@ taglib uri="/WEB-INF/controls.tld" prefix="controls" %>
   
   <html:html locale="true">
   
  @@ -28,11 +29,33 @@
         </td>
         <td width="19%"> 
           <div align="right">
  -          <html:select property="action">
  -          <bean:define id="actionVals" name="serviceForm" property="actionVals"/>
  -          <html:options collection="actionVals" 
  -           property="value" labelProperty="label"/>
  -            </html:select>
  +        <controls:actions>
  +            <controls:action selected="true"> -----<bean:message key="actions.available.actions"/>----- </controls:action>
  +            <controls:action> ------------------------------------- </controls:action>
  +            <!-- will add the urls later once those screens get implemented -->
  +            <controls:action url="">  <bean:message key="actions.accesslogger.create"/> </controls:action>
  +            <controls:action url="">  <bean:message key="actions.accesslogger.delete"/> </controls:action>
  +            <controls:action> ------------------------------------- </controls:action>
  +            <controls:action url="">  <bean:message key="actions.connector.create"/> </controls:action>
  +            <controls:action url="">  <bean:message key="actions.connector.delete"/> </controls:action>
  +            <controls:action> ------------------------------------- </controls:action>
  +            <controls:action url="">  <bean:message key="actions.host.create"/> </controls:action>
  +            <controls:action url="">  <bean:message key="actions.host.delete"/> </controls:action>
  +            <controls:action> ------------------------------------- </controls:action>
  +            <controls:action url="">  <bean:message key="actions.logger.create"/> </controls:action>
  +            <controls:action url="">  <bean:message key="actions.logger.delete"/> </controls:action>
  +            <controls:action> ------------------------------------- </controls:action>
  +            <controls:action url="">  <bean:message key="actions.requestfilter.create"/> </controls:action>
  +            <controls:action url="">  <bean:message key="actions.requestfilter.delete"/> </controls:action>
  +            <controls:action> ------------------------------------- </controls:action>
  +            <controls:action url="">  <bean:message key="actions.userrealm.create"/> </controls:action>
  +            <controls:action url="">  <bean:message key="actions.userrealm.delete"/> </controls:action>
  +            <controls:action> ------------------------------------- </controls:action>
  +            <controls:action url="">  <bean:message key="actions.valve.create"/> </controls:action>
  +            <controls:action url="">  <bean:message key="actions.valve.delete"/> </controls:action>
  +            <controls:action> ------------------------------------- </controls:action>
  +            <controls:action url="">  <bean:message key="actions.service.delete"/> </controls:action>
  +        </controls:actions>
             </div>
         </td>
       </tr>
  
  
  
  1.12      +19 -0     jakarta-tomcat-4.0/webapps/admin/WEB-INF/struts-config.xml
  
  Index: struts-config.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/webapps/admin/WEB-INF/struts-config.xml,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- struts-config.xml	2001/12/14 23:22:33	1.11
  +++ struts-config.xml	2001/12/20 09:31:51	1.12
  @@ -23,6 +23,10 @@
       <form-bean      name="serviceForm"
                       type="org.apache.webapp.admin.ServiceForm"/>
   
  +    <!-- Connector form bean -->
  +    <form-bean      name="connectorForm"
  +                    type="org.apache.webapp.admin.ConnectorForm"/>
  +
       <!-- Set Locale form bean -->
       <form-bean      name="setLocaleForm"
                       type="org.apache.webapp.admin.SetLocaleForm"/>
  @@ -58,6 +62,10 @@
                       path="/service.jsp"
                   redirect="false"/>
   
  +    <forward        name="Connector"
  +                    path="/connector.jsp"
  +                redirect="false"/>
  +                
       <forward        name="Save Successful"
                       path="/saved.jsp"
                   redirect="false"/>
  @@ -102,6 +110,17 @@
                  scope="session">
         <forward        name="SetUpService"
                         path="/service.jsp"
  +                  redirect="true"/>
  +    </action>
  +
  +    
  +   <!-- Set up Connector datastructure -->
  +    <action    path="/setUpConnector"
  +               type="org.apache.webapp.admin.SetUpConnectorAction"
  +               name="connectorForm"
  +               scope="session">
  +      <forward        name="SetUpConnector"
  +                      path="/connector.jsp"
                     redirect="true"/>
       </action>
   
  
  
  
  1.4       +5 -49     jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/ServerForm.java
  
  Index: ServerForm.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/ServerForm.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ServerForm.java	2001/12/14 23:22:33	1.3
  +++ ServerForm.java	2001/12/20 09:31:52	1.4
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/ServerForm.java,v 1.3 2001/12/14 23:22:33 patrickl Exp $
  - * $Revision: 1.3 $
  - * $Date: 2001/12/14 23:22:33 $
  + * $Header: /home/cvs/jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/ServerForm.java,v 1.4 2001/12/20 09:31:52 remm Exp $
  + * $Revision: 1.4 $
  + * $Date: 2001/12/20 09:31:52 $
    *
    * ====================================================================
    *
  @@ -74,18 +74,13 @@
    * Form bean for the server form page.  
    * @author Patrick Luby
    * @author Manveen Kaur
  - * @version $Revision: 1.3 $ $Date: 2001/12/14 23:22:33 $
  + * @version $Revision: 1.4 $ $Date: 2001/12/20 09:31:52 $
    */
   
   public final class ServerForm extends ActionForm {
       
       // ----------------------------------------------------- Instance Variables
       
  -    /**
  -     * The text for the port number.
  -     */
  -    private String action = null;
  -    
       private String portNumberText = "8080";
       
       /**
  @@ -100,7 +95,7 @@
       private String shutdownText = null;
       
       private ArrayList debugLvlVals = null;
  -    private ArrayList actionVals = null;
  +    
       // ------------------------------------------------------------- Properties
       
       
  @@ -121,45 +116,7 @@
           this.debugLvlVals = debugLvlVals;
           
       }
  -    
  -    
  -    /**
  -     * Return the ActionVals.
  -     */
  -    public ArrayList getActionVals() {
  -        
  -        return this.actionVals;
  -        
  -    }
  -    
  -    /**
  -     * Set the ActionVals.
  -     */
  -    public void setActionVals(ArrayList actionVals) {
  -        
  -        this.actionVals = actionVals;
  -        
  -    }
  -    
  -    /**
  -     * Return the Action.
  -     */
  -    public String getAction() {
  -        
  -        return this.action;
           
  -    }
  -    
  -    /**
  -     * Set the action.
  -     */
  -    public void setAction(String action) {
  -        
  -        this.action = action;
  -        
  -    }
  -    
  -    
       /**
        * Return the portNumberText.
        */
  @@ -227,7 +184,6 @@
           this.portNumberText = null;
           this.debugLvl = "0";
           this.shutdownText = null;
  -        this.action = null;
           
       }
       
  
  
  
  1.2       +5 -49     jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/ServiceForm.java
  
  Index: ServiceForm.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/ServiceForm.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ServiceForm.java	2001/12/14 23:22:33	1.1
  +++ ServiceForm.java	2001/12/20 09:31:52	1.2
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/ServiceForm.java,v 1.1 2001/12/14 23:22:33 patrickl Exp $
  - * $Revision: 1.1 $
  - * $Date: 2001/12/14 23:22:33 $
  + * $Header: /home/cvs/jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/ServiceForm.java,v 1.2 2001/12/20 09:31:52 remm Exp $
  + * $Revision: 1.2 $
  + * $Date: 2001/12/20 09:31:52 $
    *
    * ====================================================================
    *
  @@ -73,7 +73,7 @@
    * Form bean for the service page.
    *
    * @author Manveen Kaur
  - * @version $Revision: 1.1 $ $Date: 2001/12/14 23:22:33 $
  + * @version $Revision: 1.2 $ $Date: 2001/12/20 09:31:52 $
    */
   
   public final class ServiceForm extends ActionForm {
  @@ -97,13 +97,7 @@
        * The text for the debug level.
        */
       private String debugLvl = "0";
  -    
  -    
  -    /**
  -     * The action chosen.
  -     */
  -    private String action = null;
  -    
  +        
       /**
        * The text for the defaultHost Name.
        */
  @@ -111,7 +105,6 @@
       
       private ArrayList debugLvlVals = null;
       private ArrayList hostNameVals = null;
  -    private ArrayList actionVals = null;
       // ------------------------------------------------------------- Properties
       
       
  @@ -151,41 +144,6 @@
           this.hostNameVals = hostNameVals;
           
       }
  -    /**
  -     * Return the ActionVals.
  -     */
  -    public ArrayList getActionVals() {
  -        
  -        return this.actionVals;
  -        
  -    }
  -    
  -    /**
  -     * Set the ActionVals.
  -     */
  -    public void setActionVals(ArrayList actionVals) {
  -        
  -        this.actionVals = actionVals;
  -        
  -    }
  -    
  -    /**
  -     * Return the Action.
  -     */
  -    public String getAction() {
  -        
  -        return this.action;
  -        
  -    }
  -    
  -    /**
  -     * Set the action.
  -     */
  -    public void setAction(String action) {
  -        
  -        this.action = action;
  -        
  -    }
       
       /**
        * Set the engineName.
  @@ -276,10 +234,8 @@
           this.engineName = null;
           this.debugLvl = "0";
           this.defaultHost = " ";
  -        this.action = null;
           //this.debugLvlVals = null;
           //this.hostNameVals = null;
  -        //this.actionVals = null;
       }
       
       /**
  
  
  
  1.6       +5 -29     jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/SetUpServerAction.java
  
  Index: SetUpServerAction.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/SetUpServerAction.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- SetUpServerAction.java	2001/12/17 17:37:43	1.5
  +++ SetUpServerAction.java	2001/12/20 09:31:52	1.6
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/SetUpServerAction.java,v 1.5 2001/12/17 17:37:43 patrickl Exp $
  - * $Revision: 1.5 $
  - * $Date: 2001/12/17 17:37:43 $
  + * $Header: /home/cvs/jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/SetUpServerAction.java,v 1.6 2001/12/20 09:31:52 remm Exp $
  + * $Revision: 1.6 $
  + * $Date: 2001/12/20 09:31:52 $
    *
    * ====================================================================
    *
  @@ -98,7 +98,7 @@
    *
    * @author Jazmin Jonson
    * @author Manveen Kaur
  - * @version $Revision: 1.5 $ $Date: 2001/12/17 17:37:43 $
  + * @version $Revision: 1.6 $ $Date: 2001/12/20 09:31:52 $
    */
   
   public class SetUpServerAction extends Action {
  @@ -110,7 +110,6 @@
       public final static String DEBUG_PROP_NAME = "debug";
   
       private ArrayList debugLvlList = null; 
  -    private ArrayList actionList = null;
    
       // --------------------------------------------------------- Public Methods
   
  @@ -149,10 +148,7 @@
                   request.getSession().setAttribute(mapping.getAttribute(), form);
                  
           }
  -            
  -        MessageResources messages = getResources();
  -        Locale locale = (Locale)session.getAttribute(Action.LOCALE_KEY);
  -            
  +
           // Do transaction stuff before this
   
           ServerForm serverFm = (ServerForm) form;
  @@ -172,23 +168,6 @@
   
           }
   
  -        if(actionList == null) {
  -
  -            actionList = new ArrayList();
  -            // You can get this from the Mbean
  -            actionList.add(new LabelValueBean(
  -            messages.getMessage(locale, "actions.available.actions"),
  -            "Available Actions"));
  -            
  -            actionList.add(new LabelValueBean(
  -            messages.getMessage(locale, "actions.services.create"),
  -            "Create New Service"));
  -            
  -            actionList.add(new LabelValueBean(
  -            messages.getMessage(locale, "actions.services.delete"),
  -            "Delete Services"));
  -        }
  -
           Integer portNumb = null;
           Integer debug = null;
           String shutdown = null;
  @@ -228,8 +207,6 @@
                                                        SHUTDOWN_PROP_NAME);
   
               request.setAttribute("debugLvlVals", debugLvlList);
  -            request.setAttribute("actionVals", actionList);
  -
   
           }catch(Throwable t){
               t.printStackTrace(System.out);
  @@ -241,7 +218,6 @@
           // Hardcode debuglvl for now
           serverFm.setDebugLvl(debug.toString());
           serverFm.setShutdownText(shutdown);
  -        serverFm.setActionVals(actionList);
           serverFm.setDebugLvlVals(debugLvlList);
           
           // Forward back to the test page
  
  
  
  1.4       +6 -80     jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/SetUpServiceAction.java
  
  Index: SetUpServiceAction.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/SetUpServiceAction.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- SetUpServiceAction.java	2001/12/17 17:34:05	1.3
  +++ SetUpServiceAction.java	2001/12/20 09:31:52	1.4
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/SetUpServiceAction.java,v 1.3 2001/12/17 17:34:05 patrickl Exp $
  - * $Revision: 1.3 $
  - * $Date: 2001/12/17 17:34:05 $
  + * $Header: /home/cvs/jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/SetUpServiceAction.java,v 1.4 2001/12/20 09:31:52 remm Exp $
  + * $Revision: 1.4 $
  + * $Date: 2001/12/20 09:31:52 $
    *
    * ====================================================================
    *
  @@ -99,7 +99,7 @@
    * page.
    *
    * @author Manveen Kaur
  - * @version $Revision: 1.3 $ $Date: 2001/12/17 17:34:05 $
  + * @version $Revision: 1.4 $ $Date: 2001/12/20 09:31:52 $
    */
   
   public class SetUpServiceAction extends Action {
  @@ -110,9 +110,6 @@
       public final static String HOST_PROP_NAME = "defaultHost";
       public final static String DEBUG_PROP_NAME = "debug";
       
  -    // list of available actions on this service.
  -    private ArrayList actionList = null;
  -    
       private ArrayList debugLvlList = null;
       private ArrayList hostNameList = null;
       
  @@ -155,8 +152,8 @@
           }
           
           // The message resources for this package.
  -        MessageResources messages = getResources();
  -        Locale locale = (Locale)session.getAttribute(Action.LOCALE_KEY);
  +    //    MessageResources messages = getResources();
  +    //    Locale locale = (Locale)session.getAttribute(Action.LOCALE_KEY);
           
           String selectedName = request.getParameter("select");
           
  @@ -177,76 +174,6 @@
               
           }
           
  -        if(actionList == null) {
  -            
  -            actionList = new ArrayList();
  -            // You can get this from the Mbean
  -            actionList.add(new LabelValueBean(
  -            messages.getMessage(locale, "actions.available.actions"),
  -            "Available Actions"));
  -            
  -            actionList.add(new LabelValueBean(
  -            messages.getMessage(locale, "actions.accesslogger.create"),
  -            "Create New Access Logger"));
  -            
  -            actionList.add(new LabelValueBean(
  -            messages.getMessage(locale, "actions.accesslogger.delete"),
  -            "Delete Access Logger"));
  -            
  -            actionList.add(new LabelValueBean(
  -            messages.getMessage(locale, "actions.connector.create"),
  -            "Create New Connector"));
  -            
  -            actionList.add(new LabelValueBean(
  -            messages.getMessage(locale, "actions.connector.delete"),
  -            "Delete Connectors..."));
  -            
  -            actionList.add(new LabelValueBean(
  -            messages.getMessage(locale, "actions.host.create"),
  -            "Create New Host"));
  -            
  -            actionList.add(new LabelValueBean(
  -            messages.getMessage(locale, "actions.host.delete"),
  -            "Delete Hosts"));
  -            
  -            actionList.add(new LabelValueBean(
  -            messages.getMessage(locale, "actions.logger.create"),
  -            "Create New Logger"));
  -            
  -            actionList.add(new LabelValueBean(
  -            messages.getMessage(locale, "actions.logger.delete"),
  -            "Delete Logger"));
  -            
  -            actionList.add(new LabelValueBean(
  -            messages.getMessage(locale, "actions.requestfilter.create"),
  -            "Create New Request Filter"));
  -            
  -            actionList.add(new LabelValueBean(
  -            messages.getMessage(locale, "actions.requestfilter.delete"),
  -            "Delete Request Filters"));
  -            
  -            actionList.add(new LabelValueBean(
  -            messages.getMessage(locale, "actions.userrealm.create"),
  -            "Create New User Realm"));
  -            
  -            actionList.add(new LabelValueBean(
  -            messages.getMessage(locale, "actions.userrealm.delete"),
  -            "Delete User Realm"));
  -            
  -            actionList.add(new LabelValueBean(
  -            messages.getMessage(locale, "actions.valve.create"),
  -            "Create New Valve"));
  -            
  -            actionList.add(new LabelValueBean(
  -            messages.getMessage(locale, "actions.valve.delete"),
  -            "Delete Valves"));
  -            
  -            actionList.add(new LabelValueBean(
  -            messages.getMessage(locale, "actions.service.delete"),
  -            "Delete This Service"));
  -            
  -        }
  -        
           String serviceName = null;
           String engineName = null;
           Integer debug = null;
  @@ -335,7 +262,6 @@
           serviceFm.setDebugLvl(debug.toString());
           serviceFm.setEngineName(engineName);
           serviceFm.setDebugLvlVals(debugLvlList);
  -        serviceFm.setActionVals(actionList);
           serviceFm.setHostNameVals(hostNameList);
           
           // Forward back to the test page
  
  
  

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>