manveen     02/03/21 11:03:06

  Modified:    webapps/admin context.jsp
               webapps/admin/WEB-INF struts-config.xml
               webapps/admin/WEB-INF/classes/org/apache/webapp/admin
                        ApplicationResources_en.properties
                        ApplicationResources_es.properties
                        TomcatTreeBuilder.java
               webapps/admin/WEB-INF/classes/org/apache/webapp/admin/realm
                        JDBCRealmForm.java JNDIRealmForm.java
                        MemoryRealmForm.java
               webapps/admin/host host.jsp
               webapps/admin/logger logger.jsp
               webapps/admin/realm jdbcRealm.jsp jndiRealm.jsp
                        memoryRealm.jsp userDBRealm.jsp
               webapps/admin/service service.jsp
  Added:       webapps/admin/WEB-INF/classes/org/apache/webapp/admin/realm
                        EditRealmAction.java
                        SaveUserDatabaseRealmAction.java
                        UserDatabaseRealmForm.java
               webapps/admin/realm userDatabaseRealm.jsp
  Log:
  Refactored "realm".
  
  Added "EditRealmAction" that sets up the relevant realm form based on the type of 
realm.
  
  Revision  Changes    Path
  1.6       +11 -5     jakarta-tomcat-4.0/webapps/admin/context.jsp
  
  Index: context.jsp
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/webapps/admin/context.jsp,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- context.jsp       9 Mar 2002 00:10:56 -0000       1.5
  +++ context.jsp       21 Mar 2002 19:03:05 -0000      1.6
  @@ -31,11 +31,17 @@
           <div align="right">
         <controls:actions>
               <controls:action selected="true"> ----<bean:message 
key="actions.available.actions"/>---- </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 disabled="true"> --------------------------------- 
</controls:action>
  +            <%--
  +            <controls:action url='<%= "/AddLogger.do?parent=" + 
  +                                  URLEncoder.encode(thisObjectName) %>'>
  +                <bean:message key="actions.loggers.create"/>
  +            </controls:action>              
  +            <controls:action url='<%= "/DeleteLogger.do?parent=" + 
  +                                  URLEncoder.encode(thisObjectName) %>'> 
  +                <bean:message key="actions.loggers.deletes"/> 
  +            </controls:action>
  +            <controls:action disabled="true"> ------------------------------------- 
</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>
  
  
  
  1.37      +84 -90    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.36
  retrieving revision 1.37
  diff -u -r1.36 -r1.37
  --- struts-config.xml 15 Mar 2002 09:44:17 -0000      1.36
  +++ struts-config.xml 21 Mar 2002 19:03:05 -0000      1.37
  @@ -31,23 +31,6 @@
       <form-bean      name="setLocaleForm"
                       type="org.apache.webapp.admin.SetLocaleForm"/>
   
  -    <!-- JDBC Realm form bean -->
  -    <form-bean      name="jdbcRealmForm"
  -                    type="org.apache.webapp.admin.realm.JDBCRealmForm"/>
  -
  -    <!-- JNDI Realm form bean -->
  -    <form-bean      name="jndiRealmForm"
  -                    type="org.apache.webapp.admin.realm.JNDIRealmForm"/>
  -
  -    <!-- Memory Realm form bean -->
  -    <form-bean      name="memoryRealmForm"
  -                    type="org.apache.webapp.admin.realm.MemoryRealmForm"/>
  -
  -    <!-- UserDB Realm form bean -->
  -    <form-bean      name="userdbRealmForm"
  -                    type="org.apache.webapp.admin.realm.UserDBRealmForm"/>
  -
  -
       <!-- ============= Service Module ============= -->
   
       <form-bean      name="serviceForm"
  @@ -72,6 +55,20 @@
       <form-bean      name="loggersForm"
                       type="org.apache.webapp.admin.logger.LoggersForm"/>
   
  +    <!-- ============= Realm Module ============= -->
  +
  +    <form-bean      name="jdbcRealmForm"
  +                    type="org.apache.webapp.admin.realm.JDBCRealmForm"/>
  +
  +    <form-bean      name="jndiRealmForm"
  +                    type="org.apache.webapp.admin.realm.JNDIRealmForm"/>
  +
  +    <form-bean      name="memoryRealmForm"
  +                    type="org.apache.webapp.admin.realm.MemoryRealmForm"/>
  +
  +    <form-bean      name="userDatabaseRealmForm"
  +                    type="org.apache.webapp.admin.realm.UserDatabaseRealmForm"/>
  +
       <!-- ========== User Database Module ========== -->
   
       <form-bean      name="databaseForm"
  @@ -145,22 +142,6 @@
                       path="/user.jsp"
                   redirect="false"/>
   
  -    <forward        name="JDBCRealm"
  -                    path="/realm/jdbcRealm.jsp"
  -                redirect="false"/>
  -                
  -    <forward        name="JNDIRealm"
  -                    path="/realm/jndiRealm.jsp"
  -                redirect="false"/>
  -                
  -    <forward        name="MemoryRealm"
  -                    path="/realm/memoryRealm.jsp"
  -                redirect="false"/>
  -
  -    <forward        name="UserDBRealm"
  -                    path="/realm/userDBRealm.jsp"
  -                redirect="false"/>
  -
       <!-- ============ Service Module ============== -->
   
       <forward        name="Service"
  @@ -191,7 +172,24 @@
                       path="/logger/loggers.jsp"
                   redirect="false"/>
   
  -            
  +    <!-- ============ Logger Module ============== -->
  +
  +    <forward        name="JDBCRealm"
  +                    path="/realm/jdbcRealm.jsp"
  +                redirect="false"/>
  +                
  +    <forward        name="JNDIRealm"
  +                    path="/realm/jndiRealm.jsp"
  +                redirect="false"/>
  +                
  +    <forward        name="MemoryRealm"
  +                    path="/realm/memoryRealm.jsp"
  +                redirect="false"/>
  +
  +    <forward        name="UserDatabaseRealm"
  +                    path="/realm/userDatabaseRealm.jsp"
  +                redirect="false"/>
  +        
       <!-- ========== User Database Module ========== -->
   
       <forward        name="Group"
  @@ -289,34 +287,6 @@
                  scope="session">
       </action>
       
  -    <!-- Set up Memory Realm datastructure -->
  -    <action    path="/setUpMemoryRealm"
  -               type="org.apache.webapp.admin.realm.SetUpMemoryRealmAction"
  -               name="memoryRealmForm"
  -               scope="session">
  -    </action>
  -
  -   <!-- Set up JDBC Realm datastructure -->
  -    <action    path="/setUpJDBCRealm"
  -               type="org.apache.webapp.admin.realm.SetUpJDBCRealmAction"
  -               name="jdbcRealmForm"
  -               scope="session">
  -    </action>
  -        
  -   <!-- Set up JNDI Realm datastructure -->
  -    <action    path="/setUpJNDIRealm"
  -               type="org.apache.webapp.admin.realm.SetUpJNDIRealmAction"
  -               name="jndiRealmForm"
  -               scope="session">
  -    </action>
  -        
  -    <!-- Set up User darabase Realm datastructure -->
  -    <action    path="/setUpUserDBRealm"
  -               type="org.apache.webapp.admin.realm.SetUpUserDBRealmAction"
  -               name="userdbRealmForm"
  -               scope="session">
  -    </action>
  -    
       <!-- Log out of the application -->
       <action    path="/logOut"
                  type="org.apache.webapp.admin.LogOutAction">
  @@ -360,34 +330,6 @@
       <action    path="/treeControlTest"
                  type="org.apache.webapp.admin.TreeControlTestAction"/>
   
  -    <!-- JDBC realm action -->
  -    <action    path="/JDBCRealm"
  -               type="org.apache.webapp.admin.realm.JDBCRealmAction"
  -               name="jdbcRealmForm"
  -               scope="session"               
  -               input="/realm/jdbcRealm.jsp"/>
  -
  -    <!-- JNDI realm action -->
  -    <action    path="/JNDIRealm"
  -               type="org.apache.webapp.admin.realm.JNDIRealmAction"
  -               name="jndiRealmForm"
  -               scope="session"               
  -               input="/realm/jndiRealm.jsp"/>
  -
  -    <!-- Memory realm action -->
  -    <action    path="/MemoryRealm"
  -               type="org.apache.webapp.admin.realm.MemoryRealmAction"               
         
  -               name="memoryRealmForm"
  -               scope="session"
  -               input="/realm/memoryRealm.jsp"/>
  -               
  -    <!-- UserDB realm action -->
  -    <action    path="/UserDBRealm"
  -               type="org.apache.webapp.admin.realm.UserDBRealmAction"             
  -               name="userdbRealmForm"
  -               scope="session"
  -               input="/realm/userDBRealm.jsp"/>
  -
       <!-- ============= Service Module ============== -->
   
       <!-- Set up Add Service transaction -->
  @@ -450,6 +392,58 @@
                 input="/host/host.jsp"
                  scope="session"/>
   
  +    <!-- ============= Realm Module ============== -->
  +
  +    <!-- Set up Add Realm transaction -->
  +    <action    path="/AddRealm"
  +               type="org.apache.webapp.admin.realm.AddRealmAction">
  +    </action>
  +
  +    <!-- Set up Delete Realms transaction -->
  +    <action    path="/DeleteRealm"
  +               type="org.apache.webapp.admin.realm.DeleteRealmAction"
  +               name="realmsForm"
  +               scope="request"/>
  +
  +    <!-- Perform Delete Realms transaction -->
  +    <action    path="/DeleteRealms"
  +               type="org.apache.webapp.admin.realm.DeleteRealmsAction"
  +               name="realmsForm"
  +               scope="request"/>
  +
  +    <!-- Set up Edit Realm transaction (generic) -->
  +    <action    path="/EditRealm"
  +               type="org.apache.webapp.admin.realm.EditRealmAction">
  +    </action>
  +
  +    <!-- Perform Save UserDatabase Realm transaction -->
  +    <action    path="/SaveUserDatabaseRealm"
  +               type="org.apache.webapp.admin.realm.SaveUserDatabaseRealmAction"
  +               name="userDatabaseRealmForm"
  +              input="/realm/userDatabaseRealm.jsp"
  +               scope="session"/>
  +
  +   <!-- Perform Save JDBC Realm transaction -->
  +    <action    path="/SaveJDBCRealm"
  +               type="org.apache.webapp.admin.realm.SaveJDBCRealmAction"
  +               name="jdbcRealmForm"
  +              input="/realm/jdbcRealm.jsp"
  +               scope="session"/>
  +
  +    <!-- Perform Save JNDI Realm transaction -->
  +    <action    path="/SaveJNDIRealm"
  +               type="org.apache.webapp.admin.realm.SaveJNDIRealmAction"
  +               name="jndiRealmForm"
  +              input="/realm/jndiRealm.jsp"
  +               scope="session"/>
  +
  +    <!-- Perform Save Memory transaction -->
  +    <action    path="/SaveMemoryRealm"
  +               type="org.apache.webapp.admin.realm.SaveMemoryRealmAction"
  +               name="memoryRealmForm"
  +              input="/realm/memoryRealm.jsp"
  +               scope="session"/>
  +               
       <!-- ============= Logger Module ============== -->
   
       <!-- Set up Add Logger transaction -->
  
  
  
  1.35      +5 -0      
jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/ApplicationResources_en.properties
  
  Index: ApplicationResources_en.properties
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/ApplicationResources_en.properties,v
  retrieving revision 1.34
  retrieving revision 1.35
  diff -u -r1.34 -r1.35
  --- ApplicationResources_en.properties        15 Mar 2002 09:44:18 -0000      1.34
  +++ ApplicationResources_en.properties        21 Mar 2002 19:03:05 -0000      1.35
  @@ -146,7 +146,9 @@
   logger.suffix=Suffix
   logger.timestamp=Timestamp
   logger.filelogger.properties=Filelogger specific Properties
  +logger.verbositylevel=Verbosity Level
   error.loggerName.bad=Invalid logger name {0}
  +error.loggerName.exists=<li>Logger already exists</li>
   error.directory.required=<li>Directory cannot be empty.</li>
   error.prefix.required=<li>Prefix cannot be empty.</li>
   error.suffix.required=<li>Suffix cannot be empty.</li>
  @@ -168,6 +170,9 @@
   error.serviceName.bad=Invalid service name {0}
   error.serviceName.required=<li>Service Name required</li>
   error.serviceName.exists=<li>Service Name already exists</li>
  +error.realmName.bad=Invalid realm name {0}
  +error.realmName.required=<li>Realm Name required</li>
  +error.realmName.exists=<li>Realm already exists</li>
   actions.thisrealm.delete=Delete this User Realm
   realm.driver=Database Driver
   realm.passwd=Database Password
  
  
  
  1.30      +6 -0      
jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/ApplicationResources_es.properties
  
  Index: ApplicationResources_es.properties
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/ApplicationResources_es.properties,v
  retrieving revision 1.29
  retrieving revision 1.30
  diff -u -r1.29 -r1.30
  --- ApplicationResources_es.properties        15 Mar 2002 09:44:18 -0000      1.29
  +++ ApplicationResources_es.properties        21 Mar 2002 19:03:05 -0000      1.30
  @@ -146,7 +146,9 @@
   logger.suffix=Sufijo
   logger.timestamp=Timestamp
   logger.filelogger.properties=Propiedades especificas del FileLogger
  +logger.verbositylevel=Verbosity Level
   error.loggerName.bad=Invalid logger name {0}
  +error.loggerName.exists=<li>El logger ya existe.</li>
   error.directory.required=<li>El directorio no puede ser vacio.</li>
   error.prefix.required=<li>El prefijo no puede ser vacio.</li>
   error.suffix.required=<li>El sufijo no puede ser vacio.</li>
  @@ -164,8 +166,12 @@
   error.set.attributes=Error que fija caracteristicas de la informacion.
   actions.delete=Delete
   error.defaultHost.required=<li>Default Hostname requerido</li>
  +error.serviceName.bad=Invalid service nombre {0}
   error.serviceName.required=<li>Service name requerido</li>
   error.serviceName.exists=<li>El ServiceName ya existe.</li>
  +error.realmName.bad=Invalido realm nombre {0}
  +error.realmName.required=<li>Realm nombre requiredo</li>
  +error.realmName.exists=<li>Realm ya existe</li>
   actions.thisrealm.delete=Suprima Este User Realm
   realm.driver=Database Driver
   realm.passwd=Database Password
  
  
  
  1.21      +6 -11     
jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/TomcatTreeBuilder.java
  
  Index: TomcatTreeBuilder.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/TomcatTreeBuilder.java,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- TomcatTreeBuilder.java    15 Mar 2002 09:44:18 -0000      1.20
  +++ TomcatTreeBuilder.java    21 Mar 2002 19:03:05 -0000      1.21
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/TomcatTreeBuilder.java,v
 1.20 2002/03/15 09:44:18 manveen Exp $
  - * $Revision: 1.20 $
  - * $Date: 2002/03/15 09:44:18 $
  + * $Header: 
/home/cvs/jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/TomcatTreeBuilder.java,v
 1.21 2002/03/21 19:03:05 manveen Exp $
  + * $Revision: 1.21 $
  + * $Date: 2002/03/21 19:03:05 $
    *
    * ====================================================================
    *
  @@ -87,16 +87,13 @@
   import javax.management.MBeanAttributeInfo;
   import javax.management.MBeanInfo;
   
  -import org.apache.webapp.admin.logger.SetUpLoggerAction;
  -import org.apache.webapp.admin.realm.SetUpUserDBRealmAction;
  -
   /**
    * <p> Implementation of TreeBuilder interface for Tomcat Tree Controller
    *     to build plugin components into the tree
    *
    * @author Jazmin Jonson
    * @author Manveen Kaur
  - * @version $Revision: 1.20 $ $Date: 2002/03/15 09:44:18 $
  + * @version $Revision: 1.21 $ $Date: 2002/03/21 19:03:05 $
    */
   
   
  @@ -377,17 +374,15 @@
                   new TreeControlNode(realmName,
                                       "folder_16_pad.gif",
                                       nodeLabel,
  -                                    "setUpRealm.do?select=" +
  +                                    "EditRealm.do?select=" +
                                       URLEncoder.encode(realmName) +
                                       "&nodeLabel=" +
                                       URLEncoder.encode(nodeLabel),
                                       "content",
                                       false);
  -            // FIXME - Need a generic SetUpRealmAction for all types
  -            // containerNode.addChild(realmNode);
  +            containerNode.addChild(realmNode);
           }
   
       }
  -
       
   }
  
  
  
  1.2       +79 -14    
jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/realm/JDBCRealmForm.java
  
  Index: JDBCRealmForm.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/realm/JDBCRealmForm.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- JDBCRealmForm.java        11 Feb 2002 03:03:57 -0000      1.1
  +++ JDBCRealmForm.java        21 Mar 2002 19:03:06 -0000      1.2
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/realm/JDBCRealmForm.java,v
 1.1 2002/02/11 03:03:57 manveen Exp $
  - * $Revision: 1.1 $
  - * $Date: 2002/02/11 03:03:57 $
  + * $Header: 
/home/cvs/jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/realm/JDBCRealmForm.java,v
 1.2 2002/03/21 19:03:06 manveen Exp $
  + * $Revision: 1.2 $
  + * $Date: 2002/03/21 19:03:06 $
    *
    * ====================================================================
    *
  @@ -67,7 +67,7 @@
   import org.apache.struts.action.ActionForm;
   import org.apache.struts.action.ActionMapping;
   import java.net.InetAddress;
  -import java.util.ArrayList;
  +import java.util.List;
   
   import org.apache.webapp.admin.ApplicationServlet;
   import org.apache.webapp.admin.LabelValueBean;
  @@ -76,13 +76,23 @@
    * Form bean for the jdbc realm page.
    *
    * @author Manveen Kaur
  - * @version $Revision: 1.1 $ $Date: 2002/02/11 03:03:57 $
  + * @version $Revision: 1.2 $ $Date: 2002/03/21 19:03:06 $
    */
   
   public final class JDBCRealmForm extends ActionForm {
       
       // ----------------------------------------------------- Instance Variables
       
  +   /**
  +     * The administrative action represented by this form.
  +     */
  +    private String adminAction = "Edit";
  +
  +    /**
  +     * The object name of the Realm this bean refers to.
  +     */
  +    private String objectName = null;
  +
       /**
        * The text for the debug level.
        */
  @@ -103,7 +113,7 @@
       /**
        * Set of valid values for debug level.
        */
  -    private ArrayList debugLvlVals = null;
  +    private List debugLvlVals = null;
       
       /**
        * The text for the digest.
  @@ -157,21 +167,39 @@
       
       // ------------------------------------------------------------- Properties
   
  +       /**
  +     * Return the administrative action represented by this form.
  +     */
  +    public String getAdminAction() {
  +
  +        return this.adminAction;
  +
  +    }
  +
  +    /**
  +     * Set the administrative action represented by this form.
  +     */
  +    public void setAdminAction(String adminAction) {
  +
  +        this.adminAction = adminAction;
  +
  +    }
  +
       /**
  -     * Return the Realm Name.
  +     * Return the Object Name.
        */
  -    public String getRealmName() {
  +    public String getObjectName() {
           
  -        return this.realmName;
  +        return this.objectName;
           
       }
       
       /**
  -     * Set the Realm Name.
  +     * Set the Object Name.
        */
  -    public void setRealmName(String realmName) {
  +    public void setObjectName(String objectName) {
           
  -        this.realmName = realmName;
  +        this.objectName = objectName;
           
       }
       
  @@ -196,7 +224,7 @@
       /**
        * Return the debugVals.
        */
  -    public ArrayList getDebugLvlVals() {
  +    public List getDebugLvlVals() {
           
           return this.debugLvlVals;
           
  @@ -205,7 +233,7 @@
       /**
        * Set the debugVals.
        */
  -    public void setDebugLvlVals(ArrayList debugLvlVals) {
  +    public void setDebugLvlVals(List debugLvlVals) {
           
           this.debugLvlVals = debugLvlVals;
           
  @@ -421,6 +449,7 @@
        */
       public void reset(ActionMapping mapping, HttpServletRequest request) {
           
  +        this.objectName = null;
           this.debugLvl = "0";
           
           this.digest = null;
  @@ -435,6 +464,42 @@
           this.connectionPassword = null;
           this.connectionURL = null;
           
  +    }
  +    
  +    /**
  +     * Render this object as a String.
  +     */
  +    public String toString() {
  +
  +        StringBuffer sb = new StringBuffer("UserDatabaseRealmForm[adminAction=");
  +        sb.append(adminAction);
  +        sb.append(",debugLvl=");
  +        sb.append(debugLvl);
  +        sb.append(",digest=");
  +        sb.append(digest);
  +        sb.append("',driver='");
  +        sb.append(driver);
  +        sb.append("',roleNameCol=");
  +        sb.append(roleNameCol);
  +        sb.append(",passwordCol=");
  +        sb.append(passwordCol);
  +        sb.append("',userTable='");
  +        sb.append(userTable);
  +        sb.append("',roleTable=");
  +        sb.append(roleTable);
  +        sb.append(",connectionName=");
  +        sb.append(connectionName);        
  +        sb.append("',connectionPassword=");
  +        sb.append(connectionPassword);
  +        sb.append(",connectionURL=");
  +        sb.append(connectionURL);
  +        sb.append("',objectName='");
  +        sb.append(objectName);
  +        sb.append("',realmType=");
  +        sb.append(realmType);
  +        sb.append("]");
  +        return (sb.toString());
  +
       }
       
       /**
  
  
  
  1.2       +87 -24    
jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/realm/JNDIRealmForm.java
  
  Index: JNDIRealmForm.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/realm/JNDIRealmForm.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- JNDIRealmForm.java        12 Feb 2002 06:10:41 -0000      1.1
  +++ JNDIRealmForm.java        21 Mar 2002 19:03:06 -0000      1.2
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/realm/JNDIRealmForm.java,v
 1.1 2002/02/12 06:10:41 manveen Exp $
  - * $Revision: 1.1 $
  - * $Date: 2002/02/12 06:10:41 $
  + * $Header: 
/home/cvs/jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/realm/JNDIRealmForm.java,v
 1.2 2002/03/21 19:03:06 manveen Exp $
  + * $Revision: 1.2 $
  + * $Date: 2002/03/21 19:03:06 $
    *
    * ====================================================================
    *
  @@ -67,7 +67,7 @@
   import org.apache.struts.action.ActionForm;
   import org.apache.struts.action.ActionMapping;
   import java.net.InetAddress;
  -import java.util.ArrayList;
  +import java.util.List;
   
   import org.apache.webapp.admin.ApplicationServlet;
   import org.apache.webapp.admin.LabelValueBean;
  @@ -76,24 +76,28 @@
    * Form bean for the JNDI realm page.
    *
    * @author Manveen Kaur
  - * @version $Revision: 1.1 $ $Date: 2002/02/12 06:10:41 $
  + * @version $Revision: 1.2 $ $Date: 2002/03/21 19:03:06 $
    */
   
   public final class JNDIRealmForm extends ActionForm {
       
       // ----------------------------------------------------- Instance Variables
       
  +   /**
  +     * The administrative action represented by this form.
  +     */
  +    private String adminAction = "Edit";
  +
       /**
  -     * The text for the debug level.
  +     * The object name of the Realm this bean refers to.
        */
  -    private String debugLvl = "0";
  -    
  +    private String objectName = null;
  +
       /**
  -     * The text for the realm name, used to retrieve
  -     * the corresponding realm mBean.
  +     * The text for the debug level.
        */
  -    private String realmName = null;
  -    
  +    private String debugLvl = "0";
  +        
       /**
        * The text for the realm type.
        * Specifies if it is a JNDI, JNDI or MemoryRealm.
  @@ -163,30 +167,48 @@
       /**
        * Set of valid values for debug level.
        */
  -    private ArrayList debugLvlVals = null;
  +    private List debugLvlVals = null;
       
       /**
        * Set of valid values for search subtrees(true/false).
        */
  -    private ArrayList searchVals = null;
  +    private List searchVals = null;
       
       // ------------------------------------------------------------- Properties
       
  +       /**
  +     * Return the administrative action represented by this form.
  +     */
  +    public String getAdminAction() {
  +
  +        return this.adminAction;
  +
  +    }
  +
       /**
  -     * Return the Realm Name.
  +     * Set the administrative action represented by this form.
        */
  -    public String getRealmName() {
  +    public void setAdminAction(String adminAction) {
  +
  +        this.adminAction = adminAction;
  +
  +    }
  +
  +    /**
  +     * Return the Object Name.
  +     */
  +    public String getObjectName() {
           
  -        return this.realmName;
  +        return this.objectName;
           
       }
       
       /**
  -     * Set the Realm Name.
  +     * Set the Object Name.
        */
  -    public void setRealmName(String realmName) {
  +    public void setObjectName(String objectName) {
           
  -        this.realmName = realmName;
  +        this.objectName = objectName;
           
       }
       
  @@ -211,7 +233,7 @@
       /**
        * Return the debugVals.
        */
  -    public ArrayList getDebugLvlVals() {
  +    public List getDebugLvlVals() {
           
           return this.debugLvlVals;
           
  @@ -220,7 +242,7 @@
       /**
        * Set the debugVals.
        */
  -    public void setDebugLvlVals(ArrayList debugLvlVals) {
  +    public void setDebugLvlVals(List debugLvlVals) {
           
           this.debugLvlVals = debugLvlVals;
           
  @@ -229,7 +251,7 @@
       /**
        * Return the search Vals.
        */
  -    public ArrayList getSearchVals() {
  +    public List getSearchVals() {
           
           return this.searchVals;
           
  @@ -238,7 +260,7 @@
       /**
        * Set the search Vals.
        */
  -    public void setSearchVals(ArrayList searchVals) {
  +    public void setSearchVals(List searchVals) {
           
           this.searchVals = searchVals;
           
  @@ -491,6 +513,7 @@
        */
       public void reset(ActionMapping mapping, HttpServletRequest request) {
           
  +        this.objectName = null;
           this.debugLvl = "0";
           this.search="false";
           
  @@ -508,6 +531,46 @@
           this.contextFactory = null;
       }
       
  +       /**
  +     * Render this object as a String.
  +     */
  +    public String toString() {
  +
  +        StringBuffer sb = new StringBuffer("UserDatabaseRealmForm[adminAction=");
  +        sb.append(adminAction);
  +        sb.append(",debugLvl=");
  +        sb.append(debugLvl);
  +        sb.append(",search=");
  +        sb.append(search);
  +        sb.append(",digest=");
  +        sb.append(digest);
  +        sb.append("',roleAttribute='");
  +        sb.append(roleAttribute);
  +        sb.append("',connectionName=");
  +        sb.append(connectionName);
  +        sb.append(",connectionPassword=");
  +        sb.append(connectionPassword);
  +        sb.append("',connectionURL='");
  +        sb.append(connectionURL);
  +        sb.append("',rolePattern=");
  +        sb.append(rolePattern);
  +        sb.append(",roleBase=");
  +        sb.append(roleBase);
  +        sb.append("',userPassword='");
  +        sb.append(userPassword);
  +        sb.append("',userPattern=");
  +        sb.append(userPattern);
  +        sb.append(",contextFactory=");
  +        sb.append(contextFactory);
  +        sb.append("',objectName='");
  +        sb.append(objectName);
  +        sb.append("',realmType=");
  +        sb.append(realmType);
  +        sb.append("]");
  +        return (sb.toString());
  +
  +    }
  +
       /**
        * Validate the properties that have been set from this HTTP request,
        * and return an <code>ActionErrors</code> object that encapsulates any
  
  
  
  1.2       +65 -24    
jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/realm/MemoryRealmForm.java
  
  Index: MemoryRealmForm.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/realm/MemoryRealmForm.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- MemoryRealmForm.java      8 Feb 2002 21:33:02 -0000       1.1
  +++ MemoryRealmForm.java      21 Mar 2002 19:03:06 -0000      1.2
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/realm/MemoryRealmForm.java,v
 1.1 2002/02/08 21:33:02 manveen Exp $
  - * $Revision: 1.1 $
  - * $Date: 2002/02/08 21:33:02 $
  + * $Header: 
/home/cvs/jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/realm/MemoryRealmForm.java,v
 1.2 2002/03/21 19:03:06 manveen Exp $
  + * $Revision: 1.2 $
  + * $Date: 2002/03/21 19:03:06 $
    *
    * ====================================================================
    *
  @@ -66,8 +66,7 @@
   import org.apache.struts.action.ActionErrors;
   import org.apache.struts.action.ActionForm;
   import org.apache.struts.action.ActionMapping;
  -//import java.net.InetAddress;
  -import java.util.ArrayList;
  +import java.util.List;
   import java.util.Enumeration;
   
   import org.apache.webapp.admin.ApplicationServlet;
  @@ -77,24 +76,28 @@
    * Form bean for the memory realm page.
    *
    * @author Manveen Kaur
  - * @version $Revision: 1.1 $ $Date: 2002/02/08 21:33:02 $
  + * @version $Revision: 1.2 $ $Date: 2002/03/21 19:03:06 $
    */
   
   public final class MemoryRealmForm extends ActionForm {
       
       // ----------------------------------------------------- Instance Variables
       
  +   /**
  +     * The administrative action represented by this form.
  +     */
  +    private String adminAction = "Edit";
  +
       /**
  -     * The text for the debug level.
  +     * The object name of the Realm this bean refers to.
        */
  -    private String debugLvl = "0";
  -    
  +    private String objectName = null;
  +
       /**
  -     * The text for the realm name, used to retrieve
  -     * the corresponding realm mBean.
  +     * The text for the debug level.
        */
  -    private String realmName = null;
  -    
  +    private String debugLvl = "0";
  +        
       /**
        * The text for the realm type.
        * Specifies if it is a JNDI, JDBC, UserDatabase or MemoryRealm.
  @@ -104,7 +107,7 @@
       /**
        * Set of valid values for debug level.
        */
  -    private ArrayList debugLvlVals = null;
  +    private List debugLvlVals = null;
       
       /**
        * The text for the path Name.
  @@ -118,24 +121,42 @@
       
       // ------------------------------------------------------------- Properties
       
  +      /**
  +     * Return the administrative action represented by this form.
  +     */
  +    public String getAdminAction() {
  +
  +        return this.adminAction;
  +
  +    }
  +
  +    /**
  +     * Set the administrative action represented by this form.
  +     */
  +    public void setAdminAction(String adminAction) {
  +
  +        this.adminAction = adminAction;
  +
  +    }
  +
       /**
  -     * Return the Realm Name.
  +     * Return the Object Name.
        */
  -    public String getRealmName() {
  +    public String getObjectName() {
           
  -        return this.realmName;
  +        return this.objectName;
           
       }
       
       /**
  -     * Set the Realm Name.
  +     * Set the Object Name.
        */
  -    public void setRealmName(String realmName) {
  +    public void setObjectName(String objectName) {
           
  -        this.realmName = realmName;
  +        this.objectName = objectName;
           
       }
  -    
  +     
       /**
        * Return the Realm type.
        */
  @@ -157,7 +178,7 @@
       /**
        * Return the debugVals.
        */
  -    public ArrayList getDebugLvlVals() {
  +    public List getDebugLvlVals() {
           
           return this.debugLvlVals;
           
  @@ -166,7 +187,7 @@
       /**
        * Set the debugVals.
        */
  -    public void setDebugLvlVals(ArrayList debugLvlVals) {
  +    public void setDebugLvlVals(List debugLvlVals) {
           
           this.debugLvlVals = debugLvlVals;
           
  @@ -235,12 +256,33 @@
        * @param request The servlet request we are processing
        */
       public void reset(ActionMapping mapping, HttpServletRequest request) {
  -        
  +   
  +        this.objectName = null;
           this.debugLvl = "0";
           this.pathName = null;
           
       }
       
  +   /**
  +     * Render this object as a String.
  +     */
  +    public String toString() {
  +
  +        StringBuffer sb = new StringBuffer("UserDatabaseRealmForm[adminAction=");
  +        sb.append(adminAction);
  +        sb.append(",debugLvl=");
  +        sb.append(debugLvl);
  +        sb.append(",pathname=");
  +        sb.append(pathName);
  +        sb.append("',objectName='");
  +        sb.append(objectName);
  +        sb.append("',realmType=");
  +        sb.append(realmType);
  +        sb.append("]");
  +        return (sb.toString());
  +
  +    }
  +
       /**
        * Validate the properties that have been set from this HTTP request,
        * and return an <code>ActionErrors</code> object that encapsulates any
  @@ -261,7 +303,6 @@
           
           // front end validation when save is clicked.
           if (submit != null) {
  -            //pathName cannot be null
               if ((pathName == null) || (pathName.length()<1)) {
                   errors.add("pathName",
                   new ActionError("error.pathName.required"));
  
  
  
  1.1                  
jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/realm/EditRealmAction.java
  
  Index: EditRealmAction.java
  ===================================================================
  /*
   * $Header: 
/home/cvs/jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/realm/EditRealmAction.java,v
 1.1 2002/03/21 19:03:06 manveen Exp $
   * $Revision: 1.1 $
   * $Date: 2002/03/21 19:03:06 $
   *
   * ====================================================================
   *
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 2001-2002 The Apache Software Foundation.  All rights
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer.
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   *
   * 3. The end-user documentation included with the redistribution, if
   *    any, must include the following acknowlegement:
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowlegement may appear in the software itself,
   *    if and wherever such third-party acknowlegements normally appear.
   *
   * 4. The names "The Jakarta Project", "Tomcat", and "Apache Software
   *    Foundation" must not be used to endorse or promote products derived
   *    from this software without prior written permission. For written
   *    permission, please contact [EMAIL PROTECTED]
   *
   * 5. Products derived from this software may not be called "Apache"
   *    nor may "Apache" appear in their names without prior written
   *    permission of the Apache Group.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   *
   */
  
  package org.apache.webapp.admin.realm;
  
  import java.io.IOException;
  import java.util.Iterator;
  import java.util.List;
  import java.util.Locale;
  import java.util.ArrayList;
  import javax.servlet.ServletException;
  import javax.servlet.http.HttpServletRequest;
  import javax.servlet.http.HttpServletResponse;
  import javax.servlet.http.HttpSession;
  import org.apache.struts.action.Action;
  import org.apache.struts.action.ActionErrors;
  import org.apache.struts.action.ActionForm;
  import org.apache.struts.action.ActionForward;
  import org.apache.struts.action.ActionMapping;
  import org.apache.struts.util.MessageResources;
  
  import javax.management.MBeanServer;
  import javax.management.ObjectInstance;
  import javax.management.ObjectName;
  import javax.management.JMException;
  
  import org.apache.webapp.admin.ApplicationServlet;
  import org.apache.webapp.admin.LabelValueBean;
  import org.apache.webapp.admin.Lists;
  import org.apache.webapp.admin.TomcatTreeBuilder;
  
  /**
   * A generic <code>Action</code> that sets up <em>Edit 
   * Realm </em> transactions, based on the type of Realm.
   *
   * @author Manveen Kaur
   * @version $Revision: 1.1 $ $Date: 2002/03/21 19:03:06 $
   */
  
  public class EditRealmAction extends Action {
      
  
      /**
       * The MBeanServer we will be interacting with.
       */
      private MBeanServer mBServer = null;
      
  
      /**
       * The MessageResources we will be retrieving messages from.
       */
      private MessageResources resources = null;
      
      private HttpSession session = null;
      private Locale locale = null;
      
      // --------------------------------------------------------- Public Methods
      
      /**
       * Process the specified HTTP request, and create the corresponding HTTP
       * response (or forward to another web component that will create it).
       * Return an <code>ActionForward</code> instance describing where and how
       * control should be forwarded, or <code>null</code> if the response has
       * already been completed.
       *
       * @param mapping The ActionMapping used to select this instance
       * @param actionForm The optional ActionForm bean for this request (if any)
       * @param request The HTTP request we are processing
       * @param response The HTTP response we are creating
       *
       * @exception IOException if an input/output error occurs
       * @exception ServletException if a servlet exception occurs
       */
      public ActionForward perform(ActionMapping mapping,
                                   ActionForm form,
                                   HttpServletRequest request,
                                   HttpServletResponse response)
          throws IOException, ServletException {
          
          // Acquire the resources that we need
          session = request.getSession();
          locale = (Locale) session.getAttribute(Action.LOCALE_KEY);
          if (resources == null) {
              resources = getServlet().getResources();
          }
          
          // Acquire a reference to the MBeanServer containing our MBeans
          try {
              mBServer = ((ApplicationServlet) getServlet()).getServer();
          } catch (Throwable t) {
              throw new ServletException
              ("Cannot acquire MBeanServer reference", t);
          }
          
          // Set up the object names of the MBeans we are manipulating
          ObjectName rname = null;
          StringBuffer sb = null;
          try {
              rname = new ObjectName(request.getParameter("select"));
          } catch (Exception e) {
              String message =
                  resources.getMessage("error.realmName.bad",
                                       request.getParameter("select"));
              getServlet().log(message);
              response.sendError(HttpServletResponse.SC_BAD_REQUEST, message);
              return (null);
          }
          
         String realmType = null;
         String attribute = null;
          
         // Find what type of Realm this is
         try {    
              attribute = "className";
              String className = (String) 
                  mBServer.getAttribute(rname, attribute);
              int period = className.lastIndexOf(".");
              if (period >= 0)
                  realmType = className.substring(period + 1);
          } catch (Throwable t) {
            getServlet().log
                  (resources.getMessage(locale, "users.error.attribute.get",
                                        attribute), t);
              response.sendError
                  (HttpServletResponse.SC_INTERNAL_SERVER_ERROR,
                   resources.getMessage(locale, "users.error.attribute.get",
                                        attribute));
              return (null); 
          }
  
          // Forward to the appropriate realm display page
          
          if ("UserDatabaseRealm".equalsIgnoreCase(realmType)) {
                 setUpUserDatabaseRealm(rname, response);
          } else if ("MemoryRealm".equalsIgnoreCase(realmType)) {
                 setUpMemoryRealm(rname, response);
          } else if ("JDBCRealm".equalsIgnoreCase(realmType)) {
                 setUpJDBCRealm(rname, response);
          } else {
                 setUpJNDIRealm(rname, response);
          }
         
          return (mapping.findForward(realmType));
          
          /*
     */
              
          // Forward to the realm display page
          // return (mapping.findForward("Realm"));
          
      }
  
      private void setUpUserDatabaseRealm(ObjectName rname,
                                          HttpServletResponse response) 
      throws IOException {
          // Fill in the form values for display and editing
          UserDatabaseRealmForm realmFm = new UserDatabaseRealmForm();
          session.setAttribute("userDatabaseRealmForm", realmFm);
          realmFm.setAdminAction("Edit");
          realmFm.setObjectName(rname.toString());        
          String realmType = "UserDatabaseRealm";
          StringBuffer sb = new StringBuffer("Realm (");
          sb.append(realmType);
          sb.append(")");
          realmFm.setNodeLabel(sb.toString());
          realmFm.setRealmType(realmType);
          realmFm.setDebugLvlVals(Lists.getDebugLevels());
          String attribute = null;
          try {
  
              // Copy scalar properties
              attribute = "debug";
              realmFm.setDebugLvl
                  (((Integer) mBServer.getAttribute(rname, attribute)).toString());
              attribute = "resourceName";
              realmFm.setResource
                  ((String) mBServer.getAttribute(rname, attribute));
  
          } catch (Throwable t) {
              getServlet().log
                  (resources.getMessage(locale, "users.error.attribute.get",
                                        attribute), t);
              response.sendError
                  (HttpServletResponse.SC_INTERNAL_SERVER_ERROR,
                   resources.getMessage(locale, "users.error.attribute.get",
                                        attribute));
          }     
      }
      
      private void setUpMemoryRealm(ObjectName rname,
                                          HttpServletResponse response) 
      throws IOException {
          // Fill in the form values for display and editing
          MemoryRealmForm realmFm = new MemoryRealmForm();
          session.setAttribute("memoryRealmForm", realmFm);
          realmFm.setAdminAction("Edit");
          realmFm.setObjectName(rname.toString());        
          String realmType = "MemoryRealm";
          StringBuffer sb = new StringBuffer("Realm (");
          sb.append(realmType);
          sb.append(")");
          realmFm.setNodeLabel(sb.toString());
          realmFm.setRealmType(realmType);
          realmFm.setDebugLvlVals(Lists.getDebugLevels());
          String attribute = null;
          try {
  
              // Copy scalar properties
              attribute = "debug";
              realmFm.setDebugLvl
                  (((Integer) mBServer.getAttribute(rname, attribute)).toString());
              attribute = "pathname";
              realmFm.setPathName
                  ((String) mBServer.getAttribute(rname, attribute));
  
          } catch (Throwable t) {
              getServlet().log
                  (resources.getMessage(locale, "users.error.attribute.get",
                                        attribute), t);
              response.sendError
                  (HttpServletResponse.SC_INTERNAL_SERVER_ERROR,
                   resources.getMessage(locale, "users.error.attribute.get",
                                        attribute));
          }     
      }
      
      private void setUpJDBCRealm(ObjectName rname,
                                          HttpServletResponse response) 
      throws IOException {
          // Fill in the form values for display and editing
          JDBCRealmForm realmFm = new JDBCRealmForm();
          session.setAttribute("jdbcRealmForm", realmFm);
          realmFm.setAdminAction("Edit");
          realmFm.setObjectName(rname.toString());        
          String realmType = "JDBCRealm";
          StringBuffer sb = new StringBuffer("Realm (");
          sb.append(realmType);
          sb.append(")");
          realmFm.setNodeLabel(sb.toString());
          realmFm.setRealmType(realmType);
          realmFm.setDebugLvlVals(Lists.getDebugLevels());
          String attribute = null;
          try {
  
              // Copy scalar properties
              attribute = "debug";
              realmFm.setDebugLvl
                  (((Integer) mBServer.getAttribute(rname, attribute)).toString());
              attribute = "digest";
              realmFm.setDigest
                  ((String) mBServer.getAttribute(rname, attribute));
              attribute = "driverName";
              realmFm.setDriver
                  ((String) mBServer.getAttribute(rname, attribute));
              attribute = "roleNameCol";
              realmFm.setRoleNameCol
                  ((String) mBServer.getAttribute(rname, attribute));
              attribute = "userCredCol";
              realmFm.setPasswordCol
                  ((String) mBServer.getAttribute(rname, attribute));
              attribute = "userTable";
              realmFm.setUserTable
                  ((String) mBServer.getAttribute(rname, attribute));
              attribute = "userRoleTable";
              realmFm.setRoleTable
                  ((String) mBServer.getAttribute(rname, attribute));
              attribute = "connectionName";
              realmFm.setConnectionName
                  ((String) mBServer.getAttribute(rname, attribute));
              attribute = "connectionPassword";
              realmFm.setConnectionPassword
                  ((String) mBServer.getAttribute(rname, attribute));
              attribute = "connectionURL";
              realmFm.setConnectionURL
                  ((String) mBServer.getAttribute(rname, attribute));
              
          } catch (Throwable t) {
              getServlet().log
                  (resources.getMessage(locale, "users.error.attribute.get",
                                        attribute), t);
              response.sendError
                  (HttpServletResponse.SC_INTERNAL_SERVER_ERROR,
                   resources.getMessage(locale, "users.error.attribute.get",
                                        attribute));
          }     
      }
      
      private void setUpJNDIRealm(ObjectName rname,
                                          HttpServletResponse response) 
      throws IOException {
          // Fill in the form values for display and editing
          JNDIRealmForm realmFm = new JNDIRealmForm();
          session.setAttribute("jndiRealmForm", realmFm);
          realmFm.setAdminAction("Edit");
          realmFm.setObjectName(rname.toString());        
          String realmType = "JNDIRealm";
          StringBuffer sb = new StringBuffer("Realm (");
          sb.append(realmType);
          sb.append(")");
          realmFm.setNodeLabel(sb.toString());
          realmFm.setRealmType(realmType);
          realmFm.setDebugLvlVals(Lists.getDebugLevels());
          String attribute = null;
          try {
  
              // Copy scalar properties
              attribute = "debug";
              realmFm.setDebugLvl
                  (((Integer) mBServer.getAttribute(rname, attribute)).toString());
              attribute = "digest";
              realmFm.setDigest
                  ((String) mBServer.getAttribute(rname, attribute));
              attribute = "roleSearch";
              realmFm.setSearch
                  ((String) mBServer.getAttribute(rname, attribute));
              attribute = "roleName";
              realmFm.setRoleAttribute
                  ((String) mBServer.getAttribute(rname, attribute));
              attribute = "roleBase";
              realmFm.setRoleBase
                  ((String) mBServer.getAttribute(rname, attribute));
              attribute = "roleSubtree";
              realmFm.setRolePattern
                  ((String) mBServer.getAttribute(rname, attribute));
              attribute = "contextFactory";
              realmFm.setContextFactory
                  ((String) mBServer.getAttribute(rname, attribute));
              attribute = "userPassword";
              realmFm.setUserPassword
                  ((String) mBServer.getAttribute(rname, attribute));
              attribute = "userPattern";
              realmFm.setUserPattern
                  ((String) mBServer.getAttribute(rname, attribute));
              attribute = "connectionName";
              realmFm.setConnectionName
                  ((String) mBServer.getAttribute(rname, attribute));
              attribute = "connectionPassword";
              realmFm.setConnectionPassword
                  ((String) mBServer.getAttribute(rname, attribute));
              attribute = "connectionURL";
              realmFm.setConnectionURL
                  ((String) mBServer.getAttribute(rname, attribute));
  
          } catch (Throwable t) {
              getServlet().log
                  (resources.getMessage(locale, "users.error.attribute.get",
                                        attribute), t);
              response.sendError
                  (HttpServletResponse.SC_INTERNAL_SERVER_ERROR,
                   resources.getMessage(locale, "users.error.attribute.get",
                                        attribute));
          }     
      }
  }
  
  
  
  1.1                  
jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/realm/SaveUserDatabaseRealmAction.java
  
  Index: SaveUserDatabaseRealmAction.java
  ===================================================================
  /*
   * $Header: 
/home/cvs/jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/realm/SaveUserDatabaseRealmAction.java,v
 1.1 2002/03/21 19:03:06 manveen Exp $
   * $Revision: 1.1 $
   * $Date: 2002/03/21 19:03:06 $
   *
   * ====================================================================
   *
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 2001-2002 The Apache Software Foundation.  All rights
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer.
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   *
   * 3. The end-user documentation included with the redistribution, if
   *    any, must include the following acknowlegement:
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowlegement may appear in the software itself,
   *    if and wherever such third-party acknowlegements normally appear.
   *
   * 4. The names "The Jakarta Project", "Struts", and "Apache Software
   *    Foundation" must not be used to endorse or promote products derived
   *    from this software without prior written permission. For written
   *    permission, please contact [EMAIL PROTECTED]
   *
   * 5. Products derived from this software may not be called "Apache"
   *    nor may "Apache" appear in their names without prior written
   *    permission of the Apache Group.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   *
   */
  
  package org.apache.webapp.admin.realm;
  
  
  import java.net.URLEncoder;
  import java.util.Iterator;
  import java.util.Locale;
  import java.io.IOException;
  import javax.management.Attribute;
  import javax.management.MBeanServer;
  import javax.management.MBeanServerFactory;
  import javax.management.QueryExp;
  import javax.management.Query;
  import javax.management.ObjectInstance;
  import javax.management.ObjectName;
  import javax.management.JMException;
  import javax.servlet.ServletException;
  import javax.servlet.http.HttpServletRequest;
  import javax.servlet.http.HttpServletResponse;
  import javax.servlet.http.HttpSession;
  import org.apache.struts.action.Action;
  import org.apache.struts.action.ActionError;
  import org.apache.struts.action.ActionErrors;
  import org.apache.struts.action.ActionForm;
  import org.apache.struts.action.ActionForward;
  import org.apache.struts.action.ActionMapping;
  import org.apache.struts.util.MessageResources;
  import org.apache.webapp.admin.ApplicationServlet;
  import org.apache.webapp.admin.TomcatTreeBuilder;
  import org.apache.webapp.admin.TreeControl;
  import org.apache.webapp.admin.TreeControlNode;
  
  
  
  /**
   * The <code>Action</code> that completes <em>Add Realm</em> and
   * <em>Edit Realm</em> transactions for UserDatabase realm.
   *
   * @author Manveen Kaur
   * @version $Revision: 1.1 $ $Date: 2002/03/21 19:03:06 $
   */
  
  public final class SaveUserDatabaseRealmAction extends Action {
  
  
      // ----------------------------------------------------- Instance Variables
  
      /**
       * Signature for the <code>createStandardRealm</code> operation.
       */
      private String createStandardRealmTypes[] =
      { "java.lang.String",     // parent
      };
  
  
      /**
       * The MBeanServer we will be interacting with.
       */
      private MBeanServer mBServer = null;
      
  
      /**
       * The MessageResources we will be retrieving messages from.
       */
      private MessageResources resources = null;
  
  
      // --------------------------------------------------------- Public Methods
      
      
      /**
       * Process the specified HTTP request, and create the corresponding HTTP
       * response (or forward to another web component that will create it).
       * Return an <code>ActionForward</code> instance describing where and how
       * control should be forwarded, or <code>null</code> if the response has
       * already been completed.
       *
       * @param mapping The ActionMapping used to select this instance
       * @param actionForm The optional ActionForm bean for this request (if any)
       * @param request The HTTP request we are processing
       * @param response The HTTP response we are creating
       *
       * @exception IOException if an input/output error occurs
       * @exception ServletException if a servlet exception occurs
       */
      public ActionForward perform(ActionMapping mapping,
                                   ActionForm form,
                                   HttpServletRequest request,
                                   HttpServletResponse response)
          throws IOException, ServletException {
          
          // Acquire the resources that we need
          HttpSession session = request.getSession();
          Locale locale = (Locale) session.getAttribute(Action.LOCALE_KEY);
          if (resources == null) {
              resources = getServlet().getResources();
          }
          
          // Acquire a reference to the MBeanServer containing our MBeans
          try {
              mBServer = ((ApplicationServlet) getServlet()).getServer();
          } catch (Throwable t) {
              throw new ServletException
              ("Cannot acquire MBeanServer reference", t);
          }
          
          // Identify the requested action
          UserDatabaseRealmForm rform = (UserDatabaseRealmForm) form;
          String adminAction = rform.getAdminAction();
          String rObjectName = rform.getObjectName();
  
          // Perform a "Create UserDatabase Realm" transaction (if requested)
          if ("Create".equals(adminAction)) {
  
              String operation = null;
              String values[] = null;
  
              try {
  
                  // Ensure that the requested realm name is unique
                  // TBD -- create not yet implemented
                  ObjectName oname =
                      new ObjectName(TomcatTreeBuilder.REALM_TYPE +
                                     TomcatTreeBuilder.WILDCARD);
                  if (mBServer.isRegistered(oname)) {
                      ActionErrors errors = new ActionErrors();
                      errors.add("realmName",
                                 new ActionError("error.realmName.exists"));
                      saveErrors(request, errors);
                      return (new ActionForward(mapping.getInput()));
                  }
  
                  // Look up our MBeanFactory MBean
                  ObjectName fname =
                      new ObjectName(TomcatTreeBuilder.FACTORY_TYPE);
  
                  // Create a new StandardRealm object
                  values = new String[1];
                  // parent mBean as string
                  // TBD -- not yet implemented
                  values[0] = TomcatTreeBuilder.ENGINE_TYPE;
                  operation = "createUserDatabaseRealm";
                  rObjectName = (String)
                      mBServer.invoke(fname, operation,
                                      values, createStandardRealmTypes);
  
                  // Add the new Realm to our tree control node
                  TreeControl control = (TreeControl)
                      session.getAttribute("treeControlTest");
                  if (control != null) {
                      // TBD -- FIX ME
                      String parentName = TomcatTreeBuilder.SERVER_TYPE;
                      TreeControlNode parentNode = control.findNode(parentName);
                      if (parentNode != null) {
                          String nodeLabel =
                              "Realm (" + rform.getRealmType() + ")";
                          String encodedName =
                              URLEncoder.encode(rObjectName);
                          TreeControlNode childNode =
                              new TreeControlNode(rObjectName,
                                                  "folder_16_pad.gif",
                                                  nodeLabel,
                                                  "EditRealm.do?select=" +
                                                  encodedName,
                                                  "content",
                                                  true);
                          parentNode.addChild(childNode);
                          // FIXME - force a redisplay
                      } else {
                          getServlet().log
                              ("Cannot find parent node '" + parentName + "'");
                      }
                  } else {
                      getServlet().log
                          ("Cannot find TreeControlNode!");
                  }
  
              } catch (Exception e) {
  
                  getServlet().log
                      (resources.getMessage(locale, "users.error.invoke",
                                            operation), e);
                  response.sendError
                      (HttpServletResponse.SC_INTERNAL_SERVER_ERROR,
                       resources.getMessage(locale, "users.error.invoke",
                                            operation));
                  return (null);
  
              }
  
          }
  
          // Perform attribute updates as requested
          String attribute = null;
          try {
  
              ObjectName roname = new ObjectName(rObjectName);
  
              attribute = "debug";
              int debug = 0;
              try {
                  debug = Integer.parseInt(rform.getDebugLvl());
              } catch (Throwable t) {
                  debug = 0;
              }
              mBServer.setAttribute(roname,
                                    new Attribute("debug", new Integer(debug)));
  
              attribute = "resourceName";
              mBServer.setAttribute(roname,
                                    new Attribute("resourceName",  
rform.getResource()));
  
          } catch (Exception e) {
  
              getServlet().log
                  (resources.getMessage(locale, "users.error.attribute.set",
                                        attribute), e);
              response.sendError
                  (HttpServletResponse.SC_INTERNAL_SERVER_ERROR,
                   resources.getMessage(locale, "users.error.attribute.set",
                                        attribute));
              return (null);
          }
          
          // Forward to the success reporting page
          session.removeAttribute(mapping.getAttribute());
          return (mapping.findForward("Save Successful"));
          
      }
      
  }
  
  
  
  1.1                  
jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/realm/UserDatabaseRealmForm.java
  
  Index: UserDatabaseRealmForm.java
  ===================================================================
  /*
   * $Header: 
/home/cvs/jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/realm/UserDatabaseRealmForm.java,v
 1.1 2002/03/21 19:03:06 manveen Exp $
   * $Revision: 1.1 $
   * $Date: 2002/03/21 19:03:06 $
   *
   * ====================================================================
   *
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 2001 The Apache Software Foundation.  All rights
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer.
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   *
   * 3. The end-user documentation included with the redistribution, if
   *    any, must include the following acknowlegement:
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowlegement may appear in the software itself,
   *    if and wherever such third-party acknowlegements normally appear.
   *
   * 4. The names "The Jakarta Project", "Struts", and "Apache Software
   *    Foundation" must not be used to endorse or promote products derived
   *    from this software without prior written permission. For written
   *    permission, please contact [EMAIL PROTECTED]
   *
   * 5. Products derived from this software may not be called "Apache"
   *    nor may "Apache" appear in their names without prior written
   *    permission of the Apache Group.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   *
   */
  
  package org.apache.webapp.admin.realm;
  
  import javax.servlet.http.HttpServletRequest;
  import org.apache.struts.action.ActionError;
  import org.apache.struts.action.ActionErrors;
  import org.apache.struts.action.ActionForm;
  import org.apache.struts.action.ActionMapping;
  import java.net.InetAddress;
  import java.util.List;
  
  import org.apache.webapp.admin.ApplicationServlet;
  import org.apache.webapp.admin.LabelValueBean;
  
  /**
   * Form bean for the User Database realm page.
   *
   * @author Manveen Kaur
   * @version $Revision: 1.1 $ $Date: 2002/03/21 19:03:06 $
   */
  
  public final class UserDatabaseRealmForm extends ActionForm {
      
      // ----------------------------------------------------- Instance Variables
      
      /**
       * The administrative action represented by this form.
       */
      private String adminAction = "Edit";
  
      /**
       * The object name of the Realm this bean refers to.
       */
      private String objectName = null;
  
      /**
       * The text for the debug level.
       */
      private String debugLvl = "0";
          
      /**
       * The text for the realm type.
       * Specifies if it is a JNDI, JDBC, Userdatabase or Memory Realm.
       */
      private String realmType = null;
      
      /**
       * Set of valid values for debug level.
       */
      private List debugLvlVals = null;
      
      /**
       * The text for the resource name.
       */
      private String resource = null;
      
      /**
       * The text for the node label.
       */
      private String nodeLabel = null;
      
      // ------------------------------------------------------------- Properties
      
       /**
       * Return the administrative action represented by this form.
       */
      public String getAdminAction() {
  
          return this.adminAction;
  
      }
  
      /**
       * Set the administrative action represented by this form.
       */
      public void setAdminAction(String adminAction) {
  
          this.adminAction = adminAction;
  
      }
  
      /**
       * Return the Object Name.
       */
      public String getObjectName() {
          
          return this.objectName;
          
      }
      
      /**
       * Set the Object Name.
       */
      public void setObjectName(String objectName) {
          
          this.objectName = objectName;
          
      }
      
      /**
       * Return the Realm type.
       */
      public String getRealmType() {
          
          return this.realmType;
          
      }
      
      /**
       * Set the Realm type.
       */
      public void setRealmType(String realmType) {
          
          this.realmType = realmType;
          
      }
      
      /**
       * Return the debugVals.
       */
      public List getDebugLvlVals() {
          
          return this.debugLvlVals;
          
      }
      
      /**
       * Set the debugVals.
       */
      public void setDebugLvlVals(List debugLvlVals) {
          
          this.debugLvlVals = debugLvlVals;
          
      }
      
      /**
       * Return the Debug Level Text.
       */
      public String getDebugLvl() {
          
          return this.debugLvl;
          
      }
      
      /**
       * Set the Debug Level Text.
       */
      public void setDebugLvl(String debugLvl) {
          
          this.debugLvl = debugLvl;
          
      }
      
      /**
       * Return the resource Name.
       */
      public String getResource() {
          
          return this.resource;
          
      }
      
      /**
       * Set the resource Name.
       */
      public void setResource(String resource) {
          
          this.resource = resource;
          
      }
      
      /**
       * Return the label of the node that was clicked.
       */
      public String getNodeLabel() {
          
          return this.nodeLabel;
          
      }
      
      /**
       * Set the node label.
       */
      public void setNodeLabel(String nodeLabel) {
          
          this.nodeLabel = nodeLabel;
          
      }
      
      // --------------------------------------------------------- Public Methods
      
      /**
       * Reset all properties to their default values.
       *
       * @param mapping The mapping used to select this instance
       * @param request The servlet request we are processing
       */
      public void reset(ActionMapping mapping, HttpServletRequest request) {
          
          this.objectName = null;
          this.debugLvl = "0";
          this.resource = null;
          
      }
      
     /**
       * Render this object as a String.
       */
      public String toString() {
  
          StringBuffer sb = new StringBuffer("UserDatabaseRealmForm[adminAction=");
          sb.append(adminAction);
          sb.append(",debugLvl=");
          sb.append(debugLvl);
          sb.append(",resource=");
          sb.append(resource);
          sb.append("',objectName='");
          sb.append(objectName);
          sb.append("',realmType=");
          sb.append(realmType);
          sb.append("]");
          return (sb.toString());
  
      }
  
      /**
       * Validate the properties that have been set from this HTTP request,
       * and return an <code>ActionErrors</code> object that encapsulates any
       * validation errors that have been found.  If no errors are found, return
       * <code>null</code> or an <code>ActionErrors</code> object with no
       * recorded error messages.
       *
       * @param mapping The mapping used to select this instance
       * @param request The servlet request we are processing
       */
      
      public ActionErrors validate(ActionMapping mapping,
      HttpServletRequest request) {
          
          ActionErrors errors = new ActionErrors();
          
          String submit = request.getParameter("submit");
          
          // front end validation when save is clicked.
          if (submit != null) {
              if ((resource == null) || (resource.length() < 1)) {
                  errors.add("resource",
                  new ActionError("error.resource.required"));
              } else if (!resource.startsWith("java:")) {
                  errors.add("resource",
                  new ActionError("error.resource.javaprefix"));
              }
          }
          return errors;
      }
  }
  
  
  
  1.7       +12 -4     jakarta-tomcat-4.0/webapps/admin/host/host.jsp
  
  Index: host.jsp
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/webapps/admin/host/host.jsp,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- host.jsp  15 Mar 2002 01:16:29 -0000      1.6
  +++ host.jsp  21 Mar 2002 19:03:06 -0000      1.7
  @@ -50,10 +50,18 @@
               <controls:action> ------------------------------------- 
</controls:action>
               <controls:action url="">  <bean:message key="actions.alias.create"/> 
</controls:action>
               <controls:action url="">  <bean:message key="actions.alias.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>
  +            <controls:action url='<%= "/AddLogger.do?parent=" + 
  +                                  URLEncoder.encode(thisObjectName) %>'>
  +                <bean:message key="actions.loggers.create"/>
  +            </controls:action>              
  +            --%>
  +            <controls:action url='<%= "/DeleteLogger.do?parent=" + 
  +                                  URLEncoder.encode(thisObjectName) %>'> 
  +                <bean:message key="actions.loggers.deletes"/> 
  +            </controls:action>
  +            <controls:action disabled="true"> ------------------------------------- 
</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>
  
  
  
  1.2       +12 -6     jakarta-tomcat-4.0/webapps/admin/logger/logger.jsp
  
  Index: logger.jsp
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/webapps/admin/logger/logger.jsp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- logger.jsp        15 Mar 2002 09:44:18 -0000      1.1
  +++ logger.jsp        21 Mar 2002 19:03:06 -0000      1.2
  @@ -19,9 +19,9 @@
   
   <html:form method="POST" action="/SaveLogger">
   
  -  <bean:define id="loggerName" name="loggerForm" property="loggerName"/>
     <bean:define id="thisObjectName" type="java.lang.String"
                  name="loggerForm" property="objectName"/>
  +  <html:hidden property="parentObjectName"/>
     <html:hidden property="adminAction"/>
     <html:hidden property="objectName"/>
     <html:hidden property="loggerType"/>
  @@ -43,11 +43,10 @@
         <controls:actions>
               <controls:action selected="true"> ----<bean:message 
key="actions.available.actions"/>---- </controls:action>
               <controls:action disabled="true"> --------------------------------- 
</controls:action>
  -            <%--
               <controls:action url='<%= "/DeleteLogger.do?select=" +
                                     URLEncoder.encode(thisObjectName) %>'>
                   <bean:message key="actions.loggers.delete"/> 
  -            </controls:action>            --%>
  +            </controls:action>            
          </controls:actions>   
            </div>
         </td>
  @@ -69,8 +68,15 @@
         <controls:row labelStyle="table-label-text" dataStyle="table-normal-text">
               <controls:label><bean:message key="connector.type"/>:</controls:label>
               <controls:data>
  -              <bean:write name="loggerForm" property="loggerType" 
  -                    scope="session"/>
  +                 <logic:equal name="loggerForm" property="adminAction" 
value="Create">
  +                    <html:select property="loggerType" 
onchange="IA_jumpMenu('self',this)">
  +                     <bean:define id="loggerTypeVals" name="loggerForm" 
property="loggerTypeVals"/>
  +                     <html:options collection="loggerTypeVals" property="value" 
labelProperty="label"/>
  +                    </html:select>
  +                </logic:equal>
  +                <logic:equal name="loggerForm" property="adminAction" value="Edit">
  +                  <bean:write name="loggerForm" property="loggerType" 
scope="session"/>
  +                </logic:equal>
               </controls:data>
           </controls:row>
           
  @@ -86,7 +92,7 @@
           </controls:row>
    
           <controls:row labelStyle="table-label-text" dataStyle="table-normal-text">
  -            <controls:label>Verbosity Level:</controls:label>
  +            <controls:label><bean:message 
key="logger.verbositylevel"/>:</controls:label>
               <controls:data>
                  <html:select property="verbosityLvl">
                        <bean:define id="verbosityLvlVals" name="loggerForm" 
property="verbosityLvlVals"/>
  
  
  
  1.2       +7 -3      jakarta-tomcat-4.0/webapps/admin/realm/jdbcRealm.jsp
  
  Index: jdbcRealm.jsp
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/webapps/admin/realm/jdbcRealm.jsp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- jdbcRealm.jsp     12 Feb 2002 06:10:42 -0000      1.1
  +++ jdbcRealm.jsp     21 Mar 2002 19:03:06 -0000      1.2
  @@ -15,12 +15,16 @@
   
   <html:errors/>
   
  -<html:form method="POST" action="/JDBCRealm">
  +<html:form method="POST" action="/SaveJDBCRealm">
  +
  +  <bean:define id="thisObjectName" type="java.lang.String"
  +               name="userDatabaseRealmForm" property="objectName"/>
  +  <html:hidden property="adminAction"/>
  +  <html:hidden property="objectName"/>
  +
     <table width="100%" border="0" cellspacing="0" cellpadding="0">
       <tr bgcolor="7171A5">
         <td width="81%">
  -        <html:hidden property="realmName"/>
  -        <html:hidden property="realmType"/>
          <div class="page-title-text" align="left"> 
             <bean:write name="jdbcRealmForm" property="nodeLabel" scope="session"/>
          </div>
  
  
  
  1.2       +6 -3      jakarta-tomcat-4.0/webapps/admin/realm/jndiRealm.jsp
  
  Index: jndiRealm.jsp
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/webapps/admin/realm/jndiRealm.jsp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- jndiRealm.jsp     12 Feb 2002 06:10:42 -0000      1.1
  +++ jndiRealm.jsp     21 Mar 2002 19:03:06 -0000      1.2
  @@ -15,12 +15,15 @@
   
   <html:errors/>
   
  -<html:form method="POST" action="/JNDIRealm">
  +<html:form method="POST" action="/SaveJNDIRealm">
  +  <bean:define id="thisObjectName" type="java.lang.String"
  +               name="userDatabaseRealmForm" property="objectName"/>
  +  <html:hidden property="adminAction"/>
  +  <html:hidden property="objectName"/>
  +
     <table width="100%" border="0" cellspacing="0" cellpadding="0">
       <tr bgcolor="7171A5">
         <td width="81%">
  -        <html:hidden property="realmName"/>
  -        <html:hidden property="realmType"/>
          <div class="page-title-text" align="left"> 
             <bean:write name="jndiRealmForm" property="nodeLabel" scope="session"/>
          </div>
  
  
  
  1.2       +7 -3      jakarta-tomcat-4.0/webapps/admin/realm/memoryRealm.jsp
  
  Index: memoryRealm.jsp
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/webapps/admin/realm/memoryRealm.jsp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- memoryRealm.jsp   12 Feb 2002 06:10:42 -0000      1.1
  +++ memoryRealm.jsp   21 Mar 2002 19:03:06 -0000      1.2
  @@ -16,12 +16,16 @@
   
   <html:errors/>
   
  -<html:form method="GET" action="/MemoryRealm">
  +<html:form method="GET" action="/SaveMemoryRealm">
  +
  +  <bean:define id="thisObjectName" type="java.lang.String"
  +               name="userDatabaseRealmForm" property="objectName"/>
  +  <html:hidden property="adminAction"/>
  +  <html:hidden property="objectName"/>
  +
     <table width="100%" border="0" cellspacing="0" cellpadding="0">
       <tr bgcolor="7171A5">
         <td width="81%"> 
  -        <html:hidden property="realmName"/>
  -        <html:hidden property="realmType"/>
           <div class="page-title-text" align="left">
             <bean:write name="memoryRealmForm" property="nodeLabel" scope="session"/>
           </div>
  
  
  
  1.2       +12 -6     jakarta-tomcat-4.0/webapps/admin/realm/userDBRealm.jsp
  
  Index: userDBRealm.jsp
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/webapps/admin/realm/userDBRealm.jsp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- userDBRealm.jsp   12 Feb 2002 06:10:42 -0000      1.1
  +++ userDBRealm.jsp   21 Mar 2002 19:03:06 -0000      1.2
  @@ -15,14 +15,19 @@
   
   <html:errors/>
   
  -<html:form method="POST" action="/UserDBRealm">
  +<html:form method="POST" action="/SaveUserDatabaseRealm">
  +
  +  <bean:define id="thisObjectName" type="java.lang.String"
  +               name="userDatabaseRealmForm" property="objectName"/>
  +  <html:hidden property="adminAction"/>
  +  <html:hidden property="objectName"/>
  +
     <table width="100%" border="0" cellspacing="0" cellpadding="0">
       <tr bgcolor="7171A5">
         <td width="81%"> 
  -        <html:hidden property="realmName"/>
  -        <html:hidden property="realmType"/>
           <div class="page-title-text" align="left"> 
  -          <bean:write name="userdbRealmForm" property="nodeLabel" scope="session"/>
  +          <bean:write name="userDatabaseRealmForm" property="nodeLabel" 
  +                      scope="session"/>
           </div>
         </td>
         <td width="19%"> 
  @@ -54,7 +59,8 @@
         <controls:row labelStyle="table-label-text" dataStyle="table-normal-text">
               <controls:label><bean:message key="connector.type"/>:</controls:label>
               <controls:data>
  -              <bean:write name="userdbRealmForm" property="realmType" 
scope="session"/>
  +              <bean:write name="userDatabaseRealmForm" 
  +                          property="realmType" scope="session"/>
               </controls:data>
           </controls:row>
   
  @@ -62,7 +68,7 @@
               <controls:label><bean:message 
key="server.debuglevel"/>:</controls:label>
               <controls:data>
                  <html:select property="debugLvl">
  -                     <bean:define id="debugLvlVals" name="userdbRealmForm" 
property="debugLvlVals"/>
  +                     <bean:define id="debugLvlVals" name="userDatabaseRealmForm" 
property="debugLvlVals"/>
                        <html:options collection="debugLvlVals" property="value"
                           labelProperty="label"/>
                   </html:select>
  
  
  
  1.1                  jakarta-tomcat-4.0/webapps/admin/realm/userDatabaseRealm.jsp
  
  Index: userDatabaseRealm.jsp
  ===================================================================
  <!-- Standard Struts Entries -->
  <%@ page language="java" %>
  <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
  <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
  <%@ taglib uri="/WEB-INF/controls.tld" prefix="controls" %>
  
  <html:html locale="true">
  
  <%@ include file="../users/header.jsp" %>
  
  <!-- Body -->
  <body bgcolor="white">
  
  <!--Form -->
  
  <html:errors/>
  
  <html:form method="POST" action="/SaveUserDatabaseRealm">
  
    <bean:define id="thisObjectName" type="java.lang.String"
                 name="userDatabaseRealmForm" property="objectName"/>
    <html:hidden property="adminAction"/>
    <html:hidden property="objectName"/>
  
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr bgcolor="7171A5">
        <td width="81%"> 
          <div class="page-title-text" align="left"> 
            <bean:write name="userDatabaseRealmForm" property="nodeLabel" 
                        scope="session"/>
          </div>
        </td>
        <td width="19%"> 
          <div align="right">
        <controls:actions>
              <controls:action selected="true"> ----<bean:message 
key="actions.available.actions"/>---- </controls:action>
              <controls:action> --------------------------------- </controls:action>
              <%--
              <controls:action url="">  <bean:message key="actions.thisrealm.delete"/> 
</controls:action>
              --%>
         </controls:actions>   
           </div>
        </td>
      </tr>
    </table>
      <%@ include file="../buttons.jsp" %>
    <br>
  
    <table class="back-table" border="0" cellspacing="0" cellpadding="0" width="100%">
      <tr> 
        <td> 
         <controls:table tableStyle="front-table" lineStyle="line-row">
              <controls:row header="true" 
                  labelStyle="table-header-text" dataStyle="table-header-text">
              <controls:label><bean:message key="service.property"/></controls:label>
              <controls:data><bean:message key="service.value"/></controls:data>
          </controls:row>
  
        <controls:row labelStyle="table-label-text" dataStyle="table-normal-text">
              <controls:label><bean:message key="connector.type"/>:</controls:label>
              <controls:data>
                <bean:write name="userDatabaseRealmForm" 
                            property="realmType" scope="session"/>
              </controls:data>
          </controls:row>
  
          <controls:row labelStyle="table-label-text" dataStyle="table-normal-text">
              <controls:label><bean:message key="server.debuglevel"/>:</controls:label>
              <controls:data>
                 <html:select property="debugLvl">
                       <bean:define id="debugLvlVals" name="userDatabaseRealmForm" 
property="debugLvlVals"/>
                       <html:options collection="debugLvlVals" property="value"
                          labelProperty="label"/>
                  </html:select>
              </controls:data>
          </controls:row>
  
          <controls:row labelStyle="table-label-text" dataStyle="table-normal-text">
              <controls:label><bean:message key="realm.resource"/>:</controls:label>
              <controls:data>
                  <html:text property="resource" size="25" maxlength="25"/>
              </controls:data>
          </controls:row>
      
        </controls:table>
        </td>
      </tr>
    </table>
      
      <%@ include file="../buttons.jsp" %>
    <br>
    </html:form>
  <p>&nbsp;</p>
  </body>
  </html:html>
  
  
  
  1.8       +10 -6     jakarta-tomcat-4.0/webapps/admin/service/service.jsp
  
  Index: service.jsp
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/webapps/admin/service/service.jsp,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- service.jsp       15 Mar 2002 01:16:29 -0000      1.7
  +++ service.jsp       21 Mar 2002 19:03:06 -0000      1.8
  @@ -80,15 +80,19 @@
                   -------------------------------------
                 </controls:action>
                 <%--
  -              <controls:action url="">
  -                <bean:message key="actions.logger.create"/>
  +              <controls:action url='<%= "/AddLogger.do?parent=" + 
  +                                  URLEncoder.encode(thisObjectName) %>'>
  +                <bean:message key="actions.loggers.create"/>
                 </controls:action>
  -              <controls:action url="">
  -                <bean:message key="actions.logger.delete"/>
  +              --%>
  +              <controls:action url='<%= "/DeleteLogger.do?parent=" + 
  +                                  URLEncoder.encode(thisObjectName) %>'> 
  +                <bean:message key="actions.loggers.deletes"/> 
                 </controls:action>
  -              <controls:action>
  -                -------------------------------------
  +              <controls:action disabled="true"> 
  +                ------------------------------------- 
                 </controls:action>
  +              <%--
                 <controls:action url="">
                   <bean:message key="actions.requestfilter.create"/>
                 </controls:action>
  
  
  

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to