amyroh 2002/08/13 15:35:20 Modified: webapps/admin/WEB-INF/classes/org/apache/webapp/admin ApplicationResources_en.properties ApplicationResources_es.properties webapps/admin/WEB-INF/classes/org/apache/webapp/admin/realm AddRealmAction.java EditRealmAction.java JNDIRealmForm.java SaveJNDIRealmAction.java webapps/admin/realm jndiRealm.jsp Log: Minor changes in validation of required fields in JNDIRealm. Revision Changes Path 1.66 +4 -2 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.65 retrieving revision 1.66 diff -u -r1.65 -r1.66 --- ApplicationResources_en.properties 19 Jul 2002 00:23:18 -0000 1.65 +++ ApplicationResources_en.properties 13 Aug 2002 22:35:20 -0000 1.66 @@ -226,7 +226,8 @@ realm.userBase=User Base Element realm.user.subtree=Search User Subtree realm.userPassword=User Password -realm.userPattern=User Search Pattern +realm.userPattern=User Pattern +realm.userSearch=User Search valve.access.properties=Access Logger Properties valve.request.properties=Request Filter Properties valve.single.properties=Single SignOn Valve Properties @@ -257,7 +258,8 @@ error.rolePattern.required=<li>Role search pattern is required.</li> error.userBase.required=<li>User base element is required.</li> error.userPassword.required=<li>User Password is required.</li> -error.userPattern.required=<li>User search pattern is required.</li> +error.userPattern.required=<li>User pattern is required.</li> +error.userSearch.required=<li>User search is required.</li> error.contextFactory.required=<li>Context Factory is required.</li> error.connPassword.required=<li>Connection password is required.</li> error.connURL.required=<li>Connection URL is required.</li> 1.55 +19 -18 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.54 retrieving revision 1.55 diff -u -r1.54 -r1.55 --- ApplicationResources_es.properties 19 Jul 2002 00:23:18 -0000 1.54 +++ ApplicationResources_es.properties 13 Aug 2002 22:35:20 -0000 1.55 @@ -11,7 +11,7 @@ button.cancel=Reajuste button.commit=Confie Cambiar button.logout=Log Out -login.enter=Introduzca un nombre de usuario y una contrase\u00f1a para iniciar una nueva sesi\u00f3n +login.enter=Introduzca un nombre de usuario y una contrase\u00f1a para iniciar una nueva sesi\u00f3n login.changeLanguage=Cambio de idioma error.login=Nombre de usuario o contrase\u00f1a inv\u00e1lidos error.tryagain=Para intentar de nuevo, presione @@ -226,7 +226,8 @@ realm.userBase=User Base Element realm.user.subtree=Search User Subtree realm.userPassword=Palabra de paso Del Utilizador -realm.userPattern=User Search Pattern +realm.userPattern=User Pattern +realm.userSearch=User Search valve.access.properties=Propiedades del Access Logger valve.request.properties=Propiedades del Request Filter valve.single.properties=Propiedades del Single SignOn Valve @@ -257,7 +258,8 @@ error.rolePattern.required=<li>Se requiere el modelo de la busqueda del papel.</li> error.userBase.required=<li>Se requiere el elemento bajo del usuario.</li> error.userPassword.required=<li>Se requiere la palabra de paso del utilizador.</li> -error.userPattern.required=<li>Se requiere el modelo de la busqueda del utilizador.</li> +error.userPattern.required=<li>Se requiere el patrón del usuario.</li> +error.userSearch.required=<li>Se requiere la búsqueda del usuario.</li> error.contextFactory.required=<li>Se requiere la factory del contexto.</li> error.connPassword.required=<li>Se requiere la palabra de paso de la conexion.</li> error.connURL.required=<li>Se requiere el URL de la conexion.</li> @@ -279,7 +281,7 @@ resources.datasrc.jdbc=JDBC Driver resources.actions.datasrc=Datasources resources.actions.datasrc.create=Cree La Nueva Fuente De Datos -resources.actions.datasrc.delete=Fuentes De Datos De la Cancelación +resources.actions.datasrc.delete=Fuentes De Datos De la Cancelaci=n resources.actions.datasrc.edit=Corrija La Fuente De Datos resources.datasrc.url=Datasource URL resources.datasrc.jdbcclass=JDBC Driver Class @@ -290,37 +292,37 @@ resources.datasrc.validation=Validation Query resources.datasrc.jndi=JNDI Name resources.actions.mailsession=Sesiones Del Correo -resources.actions.mailsession.create=Cree La Nueva Sesión Del Correo -resources.actions.mailsession.delete=Sesión Del Correo De la Cancelación -resources.actions.mailsession.edit=Corrija La Sesión Del Correo +resources.actions.mailsession.create=Cree La Nueva Sesi=n Del Correo +resources.actions.mailsession.delete=Sesi=n Del Correo De la Cancelaci=n +resources.actions.mailsession.edit=Corrija La Sesi=n Del Correo resources.mailsession.name=Nombre resources.mailsession.mailhost=mail.smtp.host resources.actions.resourcelk=Acoplamientos Del Recurso resources.actions.resourcelk.create=Cree El Nuevo Acoplamiento Del Recurso -resources.actions.resourcelk.delete=Acoplamiento Del Recurso De la Cancelación +resources.actions.resourcelk.delete=Acoplamiento Del Recurso De la Cancelaci=n resources.actions.resourcelk.edit=Corrija El Acoplamiento Del Recurso resources.resourcelk.name=Nombre resources.resourcelk.global=Global resources.resourcelk.type=Tipo resources.error.name.required=<li>Nombre requiredo.</li> resources.error.global.required=<li>Global se requiere.</li> -resources.error.type.required=<li>Mecanografíe se requiere.</li> +resources.error.type.required=<li>Mecanograffe se requiere.</li> resources.error.value.required=<li>Value requiredo.</li> resources.error.value.mismatch=<li>El tipo y el valor no se parecen emparejar.</li> resources.error.entryType.invalid=<li>El tipo de la entrada no recognized.</li> -resources.error.entryType.notimpl=<li>Validación para este tipo no puesto en ejecucio'n todavía.</li> +resources.error.entryType.notimpl=<li>Validaci=n para este tipo no puesto en ejecucio'n todavfa.</li> resources.error.url.required=<li>Se requiere el URL de Datasource.</li> resources.error.driverClass.required=<li>Se requiere la clase del conductor de JDBC.</li> -resources.error.active.required=<li>Se requieren las conexiones activas máximas.</li> -resources.error.idle.required=<li>Se requieren las conexiones ociosas máximas.</li> -resources.error.wait.required=<li>La espera máxima para una conexión se requiere.</li> +resources.error.active.required=<li>Se requieren las conexiones activas m¯ximas.</li> +resources.error.idle.required=<li>Se requieren las conexiones ociosas m¯ximas.</li> +resources.error.wait.required=<li>La espera m¯xima para una conexi=n se requiere.</li> resources.error.mailhost.required=<li>mail.smtp.host is required.</li> -resources.integer.error=<li>Error inválido del número entero.</li> +resources.integer.error=<li>Error inv¯lido del n+mero entero.</li> resources.actions.userdb.create=Cree La Nueva Base de datos Del Usuario resources.actions.userdb.edit=Corrija La Base de datos Del Usuario -resources.actions.userdb.delete=Bases de datos Del Usuario De la Cancelación -resources.userdb.location=Localización -resources.userdb.factory=Fábrica +resources.actions.userdb.delete=Bases de datos Del Usuario De la Cancelaci=n +resources.userdb.location=Localizaci=n +resources.userdb.factory=F¯brica resources.treeBuilder.userdbs=Bases de datos Del Usuario resources.error.path.required=<li>Path requerido</li> resources.error.jndiName.required=<li>JNDI Nombre requerido</li> @@ -376,4 +378,3 @@ users.user.oldUser=Editar Propiedades del Usuario users.user.properties=Propiedades del Usuario # ---------- -------------------- ---------- - 1.5 +35 -34 jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/realm/AddRealmAction.java Index: AddRealmAction.java =================================================================== RCS file: /home/cvs/jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/realm/AddRealmAction.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- AddRealmAction.java 19 Jul 2002 00:23:18 -0000 1.4 +++ AddRealmAction.java 13 Aug 2002 22:35:20 -0000 1.5 @@ -86,7 +86,7 @@ */ public class AddRealmAction extends Action { - + /** * The MessageResources we will be retrieving messages from. */ @@ -96,7 +96,7 @@ private ArrayList types = null; // --------------------------------------------------------- Public Methods - + /** * Process the specified HTTP request, and create the corresponding HTTP * response (or forward to another web component that will create it). @@ -124,33 +124,33 @@ if (resources == null) { resources = getServlet().getResources(); } - + // Fill in the form values for display and editing - + String realmTypes[] = new String[4]; realmTypes[0] = "UserDatabaseRealm"; realmTypes[1] = "JNDIRealm"; realmTypes[2] = "MemoryRealm"; - realmTypes[3] = "JDBCRealm"; - + realmTypes[3] = "JDBCRealm"; + String parent = request.getParameter("parent"); - String type = request.getParameter("type"); - if (type == null) + String type = request.getParameter("type"); + if (type == null) type = "UserDatabaseRealm"; // default type is UserDatabaseRealm - - types = new ArrayList(); + + types = new ArrayList(); // the first element in the select list should be the type selected types.add(new LabelValueBean(type, - "/admin/AddRealm.do?parent=" + URLEncoder.encode(parent) - + "&type=" + type)); + "/admin/AddRealm.do?parent=" + URLEncoder.encode(parent) + + "&type=" + type)); for (int i=0; i< realmTypes.length; i++) { if (!type.equalsIgnoreCase(realmTypes[i])) { types.add(new LabelValueBean(realmTypes[i], - "/admin/AddRealm.do?parent=" + URLEncoder.encode(parent) - + "&type=" + realmTypes[i])); + "/admin/AddRealm.do?parent=" + URLEncoder.encode(parent) + + "&type=" + realmTypes[i])); } } - + if ("UserDatabaseRealm".equalsIgnoreCase(type)) { createUserDatabaseRealm(session, parent); } else if ("JNDIRealm".equalsIgnoreCase(type)) { @@ -163,7 +163,7 @@ } // Forward to the realm display page return (mapping.findForward(type)); - + } private void createUserDatabaseRealm(HttpSession session, String parent) { @@ -179,7 +179,7 @@ realmFm.setDebugLvl("0"); realmFm.setResource(""); realmFm.setDebugLvlVals(Lists.getDebugLevels()); - realmFm.setRealmTypeVals(types); + realmFm.setRealmTypeVals(types); } private void createJNDIRealm(HttpSession session, String parent) { @@ -194,23 +194,24 @@ realmFm.setRealmType(realmType); realmFm.setDebugLvl("0"); realmFm.setDigest(""); - realmFm.setRoleBase(""); + realmFm.setRoleBase(""); realmFm.setUserSubtree("false"); realmFm.setRoleSubtree("false"); realmFm.setRolePattern(""); - realmFm.setUserRoleName(""); - realmFm.setRoleName(""); - realmFm.setRoleBase(""); + realmFm.setUserRoleName(""); + realmFm.setRoleName(""); + realmFm.setRoleBase(""); realmFm.setContextFactory(""); realmFm.setUserBase(""); realmFm.setUserPattern(""); + realmFm.setUserSearch(""); realmFm.setUserPassword(""); realmFm.setConnectionName(""); realmFm.setConnectionPassword(""); realmFm.setConnectionURL(""); - realmFm.setDebugLvlVals(Lists.getDebugLevels()); + realmFm.setDebugLvlVals(Lists.getDebugLevels()); realmFm.setSearchVals(Lists.getBooleanValues()); - realmFm.setRealmTypeVals(types); + realmFm.setRealmTypeVals(types); } private void createMemoryRealm(HttpSession session, String parent) { @@ -223,10 +224,10 @@ String realmType = "MemoryRealm"; realmFm.setNodeLabel("Realm (" + realmType + ")"); realmFm.setRealmType(realmType); - realmFm.setDebugLvl("0"); + realmFm.setDebugLvl("0"); realmFm.setPathName(""); - realmFm.setDebugLvlVals(Lists.getDebugLevels()); - realmFm.setRealmTypeVals(types); + realmFm.setDebugLvlVals(Lists.getDebugLevels()); + realmFm.setRealmTypeVals(types); } private void createJDBCRealm(HttpSession session, String parent) { @@ -241,7 +242,7 @@ realmFm.setRealmType(realmType); realmFm.setDebugLvl("0"); realmFm.setDigest(""); - realmFm.setDriver(""); + realmFm.setDriver(""); realmFm.setRoleNameCol(""); realmFm.setPasswordCol(""); realmFm.setUserTable(""); @@ -249,10 +250,10 @@ realmFm.setConnectionName(""); realmFm.setConnectionPassword(""); realmFm.setConnectionURL(""); - realmFm.setDebugLvlVals(Lists.getDebugLevels()); - realmFm.setRealmTypeVals(types); + realmFm.setDebugLvlVals(Lists.getDebugLevels()); + realmFm.setRealmTypeVals(types); } - + } 1.11 +52 -49 jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/realm/EditRealmAction.java Index: EditRealmAction.java =================================================================== RCS file: /home/cvs/jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/realm/EditRealmAction.java,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- EditRealmAction.java 19 Jul 2002 00:23:18 -0000 1.10 +++ EditRealmAction.java 13 Aug 2002 22:35:20 -0000 1.11 @@ -88,7 +88,7 @@ import org.apache.webapp.admin.TomcatTreeBuilder; /** - * A generic <code>Action</code> that sets up <em>Edit + * A generic <code>Action</code> that sets up <em>Edit * Realm </em> transactions, based on the type of Realm. * * @author Manveen Kaur @@ -96,25 +96,25 @@ */ 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; private HttpServletRequest request = null; - + // --------------------------------------------------------- Public Methods - + /** * Process the specified HTTP request, and create the corresponding HTTP * response (or forward to another web component that will create it). @@ -135,7 +135,7 @@ HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { - + // Acquire the resources that we need session = request.getSession(); this.request = request; @@ -143,7 +143,7 @@ if (resources == null) { resources = getServlet().getResources(); } - + // Acquire a reference to the MBeanServer containing our MBeans try { mBServer = ((ApplicationServlet) getServlet()).getServer(); @@ -151,7 +151,7 @@ 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; @@ -165,14 +165,14 @@ response.sendError(HttpServletResponse.SC_BAD_REQUEST, message); return (null); } - + String realmType = null; String attribute = null; - + // Find what type of Realm this is - try { + try { attribute = "className"; - String className = (String) + String className = (String) mBServer.getAttribute(rname, attribute); int period = className.lastIndexOf("."); if (period >= 0) @@ -185,11 +185,11 @@ (HttpServletResponse.SC_INTERNAL_SERVER_ERROR, resources.getMessage(locale, "users.error.attribute.get", attribute)); - return (null); + return (null); } // Forward to the appropriate realm display page - + if ("UserDatabaseRealm".equalsIgnoreCase(realmType)) { setUpUserDatabaseRealm(rname, response); } else if ("MemoryRealm".equalsIgnoreCase(realmType)) { @@ -199,23 +199,23 @@ } else { setUpJNDIRealm(rname, response); } - + return (mapping.findForward(realmType)); - + } private void setUpUserDatabaseRealm(ObjectName rname, - HttpServletResponse response) + 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()); + realmFm.setObjectName(rname.toString()); String realmType = "UserDatabaseRealm"; StringBuffer sb = new StringBuffer(""); String host = rname.getKeyProperty("host"); - String context = rname.getKeyProperty("path"); + String context = rname.getKeyProperty("path"); if (host!=null) { sb.append("Host (" + host + ") > "); } @@ -227,7 +227,7 @@ realmFm.setRealmType(realmType); realmFm.setDebugLvlVals(Lists.getDebugLevels()); realmFm.setAllowDeletion(allowDeletion(rname)); - + String attribute = null; try { @@ -247,17 +247,17 @@ (HttpServletResponse.SC_INTERNAL_SERVER_ERROR, resources.getMessage(locale, "users.error.attribute.get", attribute)); - } + } } - + private void setUpMemoryRealm(ObjectName rname, - HttpServletResponse response) + 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()); + realmFm.setObjectName(rname.toString()); String realmType = "MemoryRealm"; StringBuffer sb = new StringBuffer("Realm ("); sb.append(realmType); @@ -286,17 +286,17 @@ (HttpServletResponse.SC_INTERNAL_SERVER_ERROR, resources.getMessage(locale, "users.error.attribute.get", attribute)); - } + } } - + private void setUpJDBCRealm(ObjectName rname, - HttpServletResponse response) + 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()); + realmFm.setObjectName(rname.toString()); String realmType = "JDBCRealm"; StringBuffer sb = new StringBuffer("Realm ("); sb.append(realmType); @@ -343,7 +343,7 @@ attribute = "connectionURL"; realmFm.setConnectionURL ((String) mBServer.getAttribute(rname, attribute)); - + } catch (Throwable t) { getServlet().log (resources.getMessage(locale, "users.error.attribute.get", @@ -352,17 +352,17 @@ (HttpServletResponse.SC_INTERNAL_SERVER_ERROR, resources.getMessage(locale, "users.error.attribute.get", attribute)); - } + } } - + private void setUpJNDIRealm(ObjectName rname, - HttpServletResponse response) + 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()); + realmFm.setObjectName(rname.toString()); String realmType = "JNDIRealm"; StringBuffer sb = new StringBuffer("Realm ("); sb.append(realmType); @@ -413,6 +413,9 @@ attribute = "userPattern"; realmFm.setUserPattern ((String) mBServer.getAttribute(rname, attribute)); + attribute = "userSearch"; + realmFm.setUserSearch + ((String) mBServer.getAttribute(rname, attribute)); attribute = "connectionName"; realmFm.setConnectionName ((String) mBServer.getAttribute(rname, attribute)); @@ -431,16 +434,16 @@ (HttpServletResponse.SC_INTERNAL_SERVER_ERROR, resources.getMessage(locale, "users.error.attribute.get", attribute)); - } + } } - + /* * Check if "delete this realm" operation should be enabled. * this operation is not allowed in case the realm is under service, * host or context that the admin app runs on. * return "true" if deletion is allowed. */ - + private String allowDeletion(ObjectName rname) { boolean retVal = true; @@ -448,27 +451,27 @@ // admin app's values String adminService = Lists.getAdminAppService( mBServer, rname.getDomain(),request); - String adminHost = request.getServerName(); + String adminHost = request.getServerName(); String adminContext = request.getContextPath(); String thisService = rname.getKeyProperty("service"); String thisHost = rname.getKeyProperty("host"); String thisContext = rname.getKeyProperty("path"); - + // realm is under context if (thisContext!=null) { - retVal = !(thisContext.equalsIgnoreCase(adminContext)); + retVal = !(thisContext.equalsIgnoreCase(adminContext)); } else if (thisHost != null) { - // realm is under host + // realm is under host retVal = !(thisHost.equalsIgnoreCase(adminHost)); } else { - // realm is under service + // realm is under service retVal = !(thisService.equalsIgnoreCase(adminService)); } - + } catch (Exception e) { - getServlet().log("Error getting admin service, host or context", e); + getServlet().log("Error getting admin service, host or context", e); } return new Boolean(retVal).toString(); - } + } } 1.9 +172 -141 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.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- JNDIRealmForm.java 19 Jul 2002 00:23:18 -0000 1.8 +++ JNDIRealmForm.java 13 Aug 2002 22:35:20 -0000 1.9 @@ -80,29 +80,29 @@ */ public final class JNDIRealmForm extends RealmForm { - + // ----------------------------------------------------- Instance Variables - + /** * Should we search the entire subtree for matching roles? */ private String roleSubtree = "false"; - + /** * Should we search the entire subtree for matching users? */ private String userSubtree = "false"; - + /** * The text for the digest algorithm. */ private String digest = null; - + /** * The text for the role Base. */ private String roleBase = null; - + /** * The text for the user role name. */ @@ -112,32 +112,32 @@ * The text for the role name. */ private String roleName = null; - + /** * The text for the role Pattern. */ private String rolePattern = null; - + /** * The text for the connection user name. */ private String connectionName = null; - + /** * The text for the connection Password. */ private String connectionPassword = null; - + /** * The text for the connection URL. */ private String connectionURL = null; - + /** * The text for the context Factory. */ private String contextFactory = null; - + /** * The text for the user Password. */ @@ -147,295 +147,318 @@ * The text for the user Base. */ private String userBase = null; - + /** - * The text for the user search Pattern. + * The text for the user Pattern. */ private String userPattern = null; - + + /** + * The text for the user Search. + */ + private String userSearch = null; + /** * Set of valid values for search subtrees(true/false). */ private List searchVals = null; - - + + // ------------------------------------------------------------- Properties - + /** * Return the search Vals. */ public List getSearchVals() { - + return this.searchVals; - + } - + /** * Set the search Vals. */ public void setSearchVals(List searchVals) { - + this.searchVals = searchVals; - + } - + /** * Return the roleSubtree boolean Text. */ public String getRoleSubtree() { - + return this.roleSubtree; - + } - + /** * Set the roleSubtree Text. */ public void setRoleSubtree(String roleSubtree) { - + this.roleSubtree = roleSubtree; - + } - + /** * Return the userSubtree boolean Text. */ public String getUserSubtree() { - + return this.userSubtree; - + } - + /** * Set the userSubtree Text. */ public void setUserSubtree(String userSubtree) { - + this.userSubtree = userSubtree; - + } /** * Return the digest. */ public String getDigest() { - + return this.digest; - + } - + /** * Set the digest. */ public void setDigest(String digest) { - + this.digest = digest; - + } - + /** * Return the roleBase . */ public String getRoleBase() { - + return this.roleBase ; - + } - + /** * Set the roleBase . */ public void setRoleBase(String roleBase ) { - + this.roleBase = roleBase ; - + } - + /** * Return the role name. */ public String getRoleName() { - + return this.roleName ; - + } - + /** * Set the role name Attribute . */ public void setRoleName(String roleName) { - + this.roleName = roleName ; - + } /** * Return the userBase. */ public String getUserBase() { - + return this.userBase ; - + } - + /** * Set the userBase. */ public void setUserBase(String userBase ) { - + this.userBase = userBase ; - + } - + /** * Return the user role name. */ public String getUserRoleName() { - + return this.userRoleName ; - + } - + /** * Set the user role name Attribute . */ public void setUserRoleName(String userRoleName) { - + this.userRoleName = userRoleName ; - + } - + /** * Return the role Pattern */ public String getRolePattern() { - + return this.rolePattern ; - + } - + /** * Set the role Pattern. */ public void setRolePattern(String rolePattern ) { - + this.rolePattern = rolePattern ; - + } - + /** * Return the user Password . */ public String getUserPassword() { - + return this.userPassword ; - + } - + /** * Set the user Password . */ public void setUserPassword(String userPassword ) { - + this.userPassword = userPassword ; - + } - - + + /** * Return the user Pattern . */ public String getUserPattern() { - + return this.userPattern ; - + } - + /** * Set the user user Pattern . */ public void setUserPattern(String userPattern) { - + this.userPattern = userPattern ; - + + } + + /** + * Return the user Search. + */ + public String getUserSearch() { + + return this.userSearch; + + } + + /** + * Set the user user Search. + */ + public void setUserSearch(String userSearch) { + + this.userSearch = userSearch; + } - + /** * Return the connection name. */ public String getConnectionName() { - + return this.connectionName; - + } - + /** * Set the connectionName. */ public void setConnectionName(String connectionName) { - + this.connectionName = connectionName; - + } - - + + /** * Return the connection password. */ public String getConnectionPassword() { - + return this.connectionPassword; - + } - + /** * Set the connection password. */ public void setConnectionPassword(String connectionPassword) { - + this.connectionPassword = connectionPassword; - + } - - + + /** * Return the connection URL. */ public String getConnectionURL() { - + return this.connectionURL; - + } - + /** * Set the connectionURL. */ public void setConnectionURL(String connectionURL) { - + this.connectionURL = connectionURL; - + } - + /** * Return the context Factory . */ public String getContextFactory() { - + return this.contextFactory ; - + } - + /** * Set the context Factory . */ public void setContextFactory(String contextFactory ) { - + this.contextFactory = contextFactory ; - + } - + // --------------------------------------------------------- Public Methods - + /** * Reset all properties to their default values. * @@ -443,27 +466,28 @@ * @param request The servlet request we are processing */ public void reset(ActionMapping mapping, HttpServletRequest request) { - + super.reset(mapping, request); this.roleSubtree="false"; this.userSubtree="false"; - + this.digest = null; this.roleName = null; this.userRoleName = null; - + this.connectionName = null; this.connectionPassword = null; this.connectionURL = null; - + this.rolePattern = null; this.roleBase = null; this.userBase = null; this.userPassword = null; this.userPattern = null; + this.userSearch = null; this.contextFactory = null; } - + /** * Render this object as a String. */ @@ -496,9 +520,11 @@ sb.append("',userPassword='"); sb.append(userPassword); sb.append(",userBase="); - sb.append(userBase); + sb.append(userBase); sb.append("',userPattern="); sb.append(userPattern); + sb.append("',userSearch="); + sb.append(userSearch); sb.append(",contextFactory="); sb.append(contextFactory); sb.append("',objectName='"); @@ -520,79 +546,84 @@ * @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) { // the following fields are required. - - if ((digest == null) || (digest.length() < 1)) { + + /*if ((digest == null) || (digest.length() < 1)) { errors.add("digest", new ActionError("error.digest.required")); - } - + } */ + if ((roleName == null) || (roleName.length() < 1)) { errors.add("roleName", new ActionError("error.roleName.required")); } - + if ((userRoleName == null) || (userRoleName.length() < 1)) { errors.add("userRoleName", new ActionError("error.userRoleName.required")); } - + if ((rolePattern == null) || (rolePattern.length() < 1)) { errors.add("rolePattern", new ActionError("error.rolePattern.required")); } - + if ((roleBase == null) || (roleBase.length() < 1)) { errors.add("roleBase", new ActionError("error.roleBase.required")); } - + if ((userBase == null) || (userBase.length() < 1)) { errors.add("userBase", new ActionError("error.userBase.required")); } - + if ((userPassword == null) || (userPassword.length() < 1)) { errors.add("userPassword", new ActionError("error.userPassword.required")); } - + if ((userPattern == null) || (userPattern.length() < 1)) { errors.add("userPattern", new ActionError("error.userPattern.required")); } - + + if ((userSearch == null) || (userSearch.length() < 1)) { + errors.add("userSearch", + new ActionError("error.userSearch.required")); + } + if ((connectionName == null) || (connectionName.length() < 1)) { errors.add("connectionName", new ActionError("error.connName.required")); } - + if ((connectionPassword == null) || (connectionPassword.length() < 1)) { errors.add("connectionPassword", new ActionError("error.connPassword.required")); } - + if ((connectionURL == null) || (connectionURL.length() < 1)) { errors.add("connectionURL", new ActionError("error.connURL.required")); } - - if ((contextFactory == null) || (contextFactory.length() < 1)) { + + /*if ((contextFactory == null) || (contextFactory.length() < 1)) { errors.add("contextFactory", new ActionError("error.contextFactory.required")); - } + } */ } - + return errors; } } 1.8 +28 -24 jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/realm/SaveJNDIRealmAction.java Index: SaveJNDIRealmAction.java =================================================================== RCS file: /home/cvs/jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/realm/SaveJNDIRealmAction.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- SaveJNDIRealmAction.java 19 Jul 2002 00:23:18 -0000 1.7 +++ SaveJNDIRealmAction.java 13 Aug 2002 22:35:20 -0000 1.8 @@ -116,7 +116,7 @@ * The MBeanServer we will be interacting with. */ private MBeanServer mBServer = null; - + /** * The MessageResources we will be retrieving messages from. @@ -125,8 +125,8 @@ // --------------------------------------------------------- Public Methods - - + + /** * Process the specified HTTP request, and create the corresponding HTTP * response (or forward to another web component that will create it). @@ -147,14 +147,14 @@ 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(); @@ -162,7 +162,7 @@ throw new ServletException ("Cannot acquire MBeanServer reference", t); } - + // Identify the requested action JNDIRealmForm rform = (JNDIRealmForm) form; String adminAction = rform.getAdminAction(); @@ -176,16 +176,16 @@ try { - String parent = rform.getParentObjectName(); + String parent = rform.getParentObjectName(); String objectName = DeleteLoggerAction.getObjectName(parent, TomcatTreeBuilder.REALM_TYPE); - + ObjectName pname = new ObjectName(parent); - StringBuffer sb = new StringBuffer(pname.getDomain()); - - // For service, create the corresponding Engine mBean - // Parent in this case needs to be the container mBean for the service - try { + StringBuffer sb = new StringBuffer(pname.getDomain()); + + // For service, create the corresponding Engine mBean + // Parent in this case needs to be the container mBean for the service + try { if ("Service".equalsIgnoreCase(pname.getKeyProperty("type"))) { sb.append(":type=Engine,service="); sb.append(pname.getKeyProperty("name")); @@ -199,7 +199,7 @@ response.sendError(HttpServletResponse.SC_BAD_REQUEST, message); return (null); } - + // Ensure that the requested user database name is unique ObjectName oname = new ObjectName(objectName); @@ -228,8 +228,8 @@ session.getAttribute("treeControlTest"); if (control != null) { TreeControlNode parentNode = control.findNode(rform.getParentObjectName()); - if (parentNode != null) { - String nodeLabel = rform.getNodeLabel(); + if (parentNode != null) { + String nodeLabel = rform.getNodeLabel(); String encodedName = URLEncoder.encode(rObjectName); TreeControlNode childNode = @@ -320,12 +320,16 @@ attribute = "userBase"; mBServer.setAttribute(roname, - new Attribute("userBase", rform.getUserBase())); + new Attribute("userBase", rform.getUserBase())); attribute = "userPattern"; mBServer.setAttribute(roname, new Attribute("userPattern", rform.getUserPattern())); + attribute = "userSearch"; + mBServer.setAttribute(roname, + new Attribute("userSearch", rform.getUserSearch())); + attribute = "connectionName"; mBServer.setAttribute(roname, new Attribute("connectionName", rform.getConnectionName())); @@ -349,11 +353,11 @@ attribute)); return (null); } - + // Forward to the success reporting page session.removeAttribute(mapping.getAttribute()); return (mapping.findForward("Save Successful")); - + } - + } 1.12 +7 -0 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.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- jndiRealm.jsp 24 Jul 2002 00:03:23 -0000 1.11 +++ jndiRealm.jsp 13 Aug 2002 22:35:20 -0000 1.12 @@ -199,6 +199,13 @@ </controls:data> </controls:row> + <controls:row labelStyle="table-label-text" dataStyle="table-normal-text"> + <controls:label><bean:message key="realm.userSearch"/>:</controls:label> + <controls:data> + <html:text property="userSearch" size="30"/> + </controls:data> + </controls:row> + </controls:table> </td> </tr>
-- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>