Hi,

Please commit my patch to the Head branch.

thanks,
Manveen

Comments:
-----------
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
Index: server.jsp
===================================================================
RCS file: /home/cvspublic/jakarta-tomcat-4.0/webapps/admin/server.jsp,v
retrieving revision 1.2
diff -u -r1.2 server.jsp
--- server.jsp  2001/12/11 22:54:12     1.2
+++ server.jsp  2001/12/19 22:58:49
@@ -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>
Index: service.jsp
===================================================================
RCS file: /home/cvspublic/jakarta-tomcat-4.0/webapps/admin/service.jsp,v
retrieving revision 1.1
diff -u -r1.1 service.jsp
--- service.jsp 2001/12/14 23:22:33     1.1
+++ service.jsp 2001/12/19 22:58:50
@@ -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>
cvs server: Diffing WEB-INF
Index: WEB-INF/struts-config.xml
===================================================================
RCS file: /home/cvspublic/jakarta-tomcat-4.0/webapps/admin/WEB-INF/struts-config.xml,v
retrieving revision 1.11
diff -u -r1.11 struts-config.xml
--- WEB-INF/struts-config.xml   2001/12/14 23:22:33     1.11
+++ WEB-INF/struts-config.xml   2001/12/19 22:58:51
@@ -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>
 
cvs server: Diffing WEB-INF/classes
cvs server: Diffing WEB-INF/classes/org
cvs server: Diffing WEB-INF/classes/org/apache
cvs server: Diffing WEB-INF/classes/org/apache/webapp
cvs server: Diffing WEB-INF/classes/org/apache/webapp/admin
Index: WEB-INF/classes/org/apache/webapp/admin/ServerForm.java
===================================================================
RCS file: 
/home/cvspublic/jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/ServerForm.java,v
retrieving revision 1.3
diff -u -r1.3 ServerForm.java
--- WEB-INF/classes/org/apache/webapp/admin/ServerForm.java     2001/12/14 23:22:33    
 1.3
+++ WEB-INF/classes/org/apache/webapp/admin/ServerForm.java     2001/12/19 22:58:52
@@ -81,11 +81,6 @@
     
     // ----------------------------------------------------- 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;
         
     }
     
Index: WEB-INF/classes/org/apache/webapp/admin/ServiceForm.java
===================================================================
RCS file: 
/home/cvspublic/jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/ServiceForm.java,v
retrieving revision 1.1
diff -u -r1.1 ServiceForm.java
--- WEB-INF/classes/org/apache/webapp/admin/ServiceForm.java    2001/12/14 23:22:33    
 1.1
+++ WEB-INF/classes/org/apache/webapp/admin/ServiceForm.java    2001/12/19 22:58:54
@@ -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;
     }
     
     /**
Index: WEB-INF/classes/org/apache/webapp/admin/SetUpServerAction.java
===================================================================
RCS file: 
/home/cvspublic/jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/SetUpServerAction.java,v
retrieving revision 1.5
diff -u -r1.5 SetUpServerAction.java
--- WEB-INF/classes/org/apache/webapp/admin/SetUpServerAction.java      2001/12/17 
17:37:43     1.5
+++ WEB-INF/classes/org/apache/webapp/admin/SetUpServerAction.java      2001/12/19 
+22:59:19
@@ -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
Index: WEB-INF/classes/org/apache/webapp/admin/SetUpServiceAction.java
===================================================================
RCS file: 
/home/cvspublic/jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/SetUpServiceAction.java,v
retrieving revision 1.3
diff -u -r1.3 SetUpServiceAction.java
--- WEB-INF/classes/org/apache/webapp/admin/SetUpServiceAction.java     2001/12/17 
17:34:05     1.3
+++ WEB-INF/classes/org/apache/webapp/admin/SetUpServiceAction.java     2001/12/19 
+22:59:21
@@ -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:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to