geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gdam...@apache.org
Subject svn commit: r446829 - in /geronimo/server/trunk/applications/console: geronimo-console-framework/src/main/webapp/js/ geronimo-console-standard/src/main/java/org/apache/geronimo/console/jmsmanager/server/ geronimo-console-standard/src/main/java/org/apac...
Date Sat, 16 Sep 2006 08:19:30 GMT
Author: gdamour
Date: Sat Sep 16 01:19:28 2006
New Revision: 446829

URL: http://svn.apache.org/viewvc?view=rev&rev=446829
Log:
GERONIMO-2378 Problems in JavaScript validation code forms.js
GERONIMO-2379 Security Realms portlet - form field validation using javascript
GERONIMO-2380 Keystores portlet - Form field validation using javascript
GERONIMO-2382 Webservers portlet - Form field validation using javascript
GERONIMO-2388 JMS Server portlet improvement - field validation, reset button and show current
task

All these patches have been provided by Vamsavardhana Reddy. Thanks for that!

Modified:
    geronimo/server/trunk/applications/console/geronimo-console-framework/src/main/webapp/js/forms.js
    geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/java/org/apache/geronimo/console/jmsmanager/server/JMSConnectorPortlet.java
    geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/java/org/apache/geronimo/console/securitymanager/realm/MasterLoginModuleInfo.java
    geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/classes/login-modules.properties
    geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/view/jmsmanager/server/connector/editGeneric.jsp
    geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/view/keystore/configureKey.jsp
    geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/view/keystore/uploadCertificate.jsp
    geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/view/realmwizard/_sql.jsp
    geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/view/realmwizard/advanced.jsp
    geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/view/realmwizard/configure.jsp
    geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/view/realmwizard/selectType.jsp
    geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/view/realmwizard/testLogin.jsp
    geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/view/webmanager/connector/editHTTP.jsp
    geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/view/webmanager/connector/editHTTPS.jsp

Modified: geronimo/server/trunk/applications/console/geronimo-console-framework/src/main/webapp/js/forms.js
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/applications/console/geronimo-console-framework/src/main/webapp/js/forms.js?view=diff&rev=446829&r1=446828&r2=446829
==============================================================================
--- geronimo/server/trunk/applications/console/geronimo-console-framework/src/main/webapp/js/forms.js
(original)
+++ geronimo/server/trunk/applications/console/geronimo-console-framework/src/main/webapp/js/forms.js
Sat Sep 16 01:19:28 2006
@@ -2,7 +2,7 @@
     var obj;
     for(i in elementNameArray){
         var elem = elementNameArray[i];
-        obj = eval("document." + formName + "." + elem); 
+        obj = eval("document.forms['" + formName + "'].elements['"+ elem +"']");
         if(isEmptyString(obj.value)){
             alert(elem + " must not be empty.");
             obj.focus(); 
@@ -15,7 +15,7 @@
     return value.length < 1;
 }
 function checkIntegral(formName, elementName){
-    var obj = eval("document." + formName + "." + elementName); 
+    var obj = eval("document.forms['" + formName + "'].elements['"+ elementName +"']");
     if(isIntegral(obj.value)) return true;
     else{
         alert(elementName + " must be an integer.");
@@ -25,6 +25,7 @@
 }
 
 function isIntegral(value){
+    if(value.length < 1) return false;
     var ints = "1234567890";
     for(i = 0; i < value.length; i++){
         if(ints.indexOf(value.charAt(i)) < 0) return false;

Modified: geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/java/org/apache/geronimo/console/jmsmanager/server/JMSConnectorPortlet.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/java/org/apache/geronimo/console/jmsmanager/server/JMSConnectorPortlet.java?view=diff&rev=446829&r1=446828&r2=446829
==============================================================================
--- geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/java/org/apache/geronimo/console/jmsmanager/server/JMSConnectorPortlet.java
(original)
+++ geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/java/org/apache/geronimo/console/jmsmanager/server/JMSConnectorPortlet.java
Sat Sep 16 01:19:28 2006
@@ -116,6 +116,7 @@
                 actionResponse.setRenderParameter("mode", "list");
             } else if(mode.equals("edit")) {
                 actionResponse.setRenderParameter("connectorURI", connectorURI);
+                actionResponse.setRenderParameter("brokerURI", brokerURI);
                 actionResponse.setRenderParameter("mode", "edit");
             } else if(mode.equals("delete")) {
                 AbstractName connectorAbstractName = new AbstractName(URI.create(connectorURI));
@@ -148,15 +149,20 @@
                 String protocol = renderRequest.getParameter("protocol");
                 renderRequest.setAttribute("protocol", protocol);
                 renderRequest.setAttribute("brokerURI", brokerURI);
+                renderRequest.setAttribute("brokerName", new AbstractName(URI.create(brokerURI)).getName().get("name").toString());
                 renderRequest.setAttribute("mode", "add");
                 editView.include(renderRequest, renderResponse);
             } else if(mode.equals("edit")) {
+                String brokerURI = renderRequest.getParameter("brokerURI");
                 String connectorURI = renderRequest.getParameter("connectorURI");
                 JMSConnector connector = (JMSConnector)PortletManager.getManagedBean(renderRequest,
new AbstractName(URI.create(connectorURI)));
                 if(connector == null) {
                     doList(renderRequest, manager, renderResponse);
                 } else {
                     renderRequest.setAttribute("connectorURI", connectorURI);
+                    renderRequest.setAttribute("brokerName", new AbstractName(URI.create(brokerURI)).getName().get("name").toString());
+                    renderRequest.setAttribute("connectorName", new AbstractName(URI.create(connectorURI)).getName().get("name").toString());
+                    renderRequest.setAttribute("protocol", connector.getProtocol());
                     renderRequest.setAttribute("port", new Integer(connector.getPort()));
                     renderRequest.setAttribute("host", connector.getHost());
                     renderRequest.setAttribute("mode", "save");

Modified: geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/java/org/apache/geronimo/console/securitymanager/realm/MasterLoginModuleInfo.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/java/org/apache/geronimo/console/securitymanager/realm/MasterLoginModuleInfo.java?view=diff&rev=446829&r1=446828&r2=446829
==============================================================================
--- geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/java/org/apache/geronimo/console/securitymanager/realm/MasterLoginModuleInfo.java
(original)
+++ geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/java/org/apache/geronimo/console/securitymanager/realm/MasterLoginModuleInfo.java
Sat Sep 16 01:19:28 2006
@@ -155,6 +155,10 @@
                         if(test != null) {
                             option.setDisplayOrder(Integer.parseInt(test.trim()));
                         }
+                        test = props.getProperty(prefix+fieldName+".blankAllowed");
+                        if(test != null) {
+                            option.setBlankAllowed("true".equalsIgnoreCase(test.trim()));
+                        }
                         fields.add(option);
                     }
                 }
@@ -191,6 +195,7 @@
         private boolean password = false;
         private int length = 30;
         private int displayOrder = 1;
+        private boolean blankAllowed = false;
 
         public OptionInfo(String name, String displayName, String description) {
             this.name = name;
@@ -236,6 +241,14 @@
 
         public int compareTo(Object o) {
             return displayOrder - ((OptionInfo)o).displayOrder;
+        }
+        
+        public boolean isBlankAllowed() {
+            return this.blankAllowed;
+        }
+        
+        public void setBlankAllowed(boolean blankAllowed) {
+            this.blankAllowed = blankAllowed;
         }
     }
 }

Modified: geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/classes/login-modules.properties
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/classes/login-modules.properties?view=diff&rev=446829&r1=446828&r2=446829
==============================================================================
--- geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/classes/login-modules.properties
(original)
+++ geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/classes/login-modules.properties
Sat Sep 16 01:19:28 2006
@@ -36,10 +36,12 @@
 module.ldap.field.connectionProtocol.displayName=Connect Protocol
 module.ldap.field.connectionProtocol.description=The connection protocol used to communicate
with the LDAP server.  Normally left blank, though it can be set to <tt>ssl</tt>
if the server supports it.
 module.ldap.field.connectionProtocol.length=10
+module.ldap.field.connectionProtocol.blankAllowed=true
 module.ldap.field.authentication.displayOrder=6
 module.ldap.field.authentication.displayName=Authentication
 module.ldap.field.authentication.description=The security level to use, which can be <tt>none</tt>,
<tt>simple</tt>, or <tt>strong</tt> (the usual value is <tt>simple</tt>.
 If this property is unspecified, the behavior is determined by the service provider.
 module.ldap.field.authentication.length=10
+module.ldap.field.authentication.blankAllowed=true
 module.ldap.field.userBase.displayOrder=7
 module.ldap.field.userBase.displayName=User Base
 module.ldap.field.userBase.description=The base LDAP context (location) to search for users.
 The search may look in this location only, or there and all subcontexts, depending on the
settings for "User Search Subtree" below.
@@ -72,6 +74,7 @@
 module.ldap.field.userRoleName.displayName=User Role Search String
 module.ldap.field.userRoleName.description=If the role entry does not have an attribute for
users, but instead the user entry has an attribute for roles, this should be used instead
of the "Role User Search String".  It names the attribute on a user that lists a role that
user is in.  A typical value would be <tt>(memberOf={0})</tt>.
 module.ldap.field.userRoleName.length=20
+module.ldap.field.userRoleName.blankAllowed=true
 # Certificate Properties File
 module.certprops.name=Certificate Properties File Realm
 module.certprops.class=org.apache.geronimo.security.realm.providers.CertificatePropertiesFileLoginModule

Modified: geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/view/jmsmanager/server/connector/editGeneric.jsp
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/view/jmsmanager/server/connector/editGeneric.jsp?view=diff&rev=446829&r1=446828&r2=446829
==============================================================================
--- geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/view/jmsmanager/server/connector/editGeneric.jsp
(original)
+++ geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/view/jmsmanager/server/connector/editGeneric.jsp
Sat Sep 16 01:19:28 2006
@@ -2,7 +2,22 @@
 <%@ taglib prefix="portlet" uri="http://java.sun.com/portlet" %>
 <portlet:defineObjects/>
 
-<form name="<portlet:namespace/>" action="<portlet:actionURL/>">
+<script language="JavaScript">
+var <portlet:namespace/>formName = "<portlet:namespace/>JmsConnectorForm";
+var <portlet:namespace/>requiredFields = new Array("host");
+var <portlet:namespace/>numericFields = new Array("port");
+function <portlet:namespace/>validateForm(){
+    if(!textElementsNotEmpty(<portlet:namespace/>formName, <portlet:namespace/>requiredFields))
+        return false;
+    for(i in <portlet:namespace/>numericFields) {
+        if(!checkIntegral(<portlet:namespace/>formName, <portlet:namespace/>numericFields[i]))
+            return false;
+    }
+    return true;
+}
+</script>
+
+<form name="<portlet:namespace/>JmsConnectorForm" action="<portlet:actionURL/>">
 <input type="hidden" name="mode" value="${mode}">
 <input type="hidden" name="protocol" value="${protocol}">
 <c:choose>
@@ -15,6 +30,16 @@
 </c:choose>
 <table width="100%%"  border="0">
 
+<!-- Current Task -->
+<c:choose>
+  <c:when test="${mode eq 'add'}">
+    <tr><th colspan="2" align="left">Add new ${protocol} connector for ${brokerName}</th></tr>
+  </c:when>
+  <c:otherwise>
+    <tr><th colspan="2" align="left">Edit ${protocol} connector ${connectorName}
for ${brokerName}.</th></tr>
+  </c:otherwise>
+</c:choose>
+
 <!-- Name Field -->
 <c:if test="${mode eq 'add'}">
   <tr>
@@ -25,6 +50,9 @@
     <td><div align="right"></div></td>
     <td>A name that is different than the name for any other JMS connectors in the
server</td>
   </tr>
+  <script language="JavaScript">
+    <portlet:namespace/>requiredFields = new Array("name").concat(<portlet:namespace/>requiredFields);
+  </script>
 </c:if>
 <!-- Host Field -->
   <tr>
@@ -48,10 +76,13 @@
     <td><div align="right"></div></td>
     <td>The network port to bind to.</td>
   </tr>
-<!-- Submit Button -->
+<!-- Form buttons -->
   <tr>
     <td><div align="right"></div></td>
-    <td><input name="submit" type="submit" value="Save"></td>
+    <td>
+      <input name="submit" type="submit" value="Save" onClick="return <portlet:namespace/>validateForm();">
+      <input name="reset" type="reset" value="Reset">
+    </td>
   </tr>
 </table>
 </form>

Modified: geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/view/keystore/configureKey.jsp
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/view/keystore/configureKey.jsp?view=diff&rev=446829&r1=446828&r2=446829
==============================================================================
--- geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/view/keystore/configureKey.jsp
(original)
+++ geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/view/keystore/configureKey.jsp
Sat Sep 16 01:19:28 2006
@@ -3,6 +3,21 @@
 <%@ taglib uri="http://java.sun.com/portlet" prefix="portlet"%>
 <portlet:defineObjects/>
 
+<script language="JavaScript">
+var <portlet:namespace/>formName = "<portlet:namespace/>KeystoreForm";
+var <portlet:namespace/>requiredFields = new Array("alias", "password", "certCN", "certO",
"certOU", "certL", "certST", "certC");
+var <portlet:namespace/>numericFields = new Array("valid");
+function <portlet:namespace/>validateForm(){
+    if(!textElementsNotEmpty(<portlet:namespace/>formName,<portlet:namespace/>requiredFields))
+        return false;
+    for(i in <portlet:namespace/>numericFields) {
+        if(!checkIntegral(<portlet:namespace/>formName, <portlet:namespace/>numericFields[i]))
+            return false;
+    }
+    return true;
+}
+</script>
+
 <p>On this screen you can configure the settings to generate a new private key.
 The next screen will let you review this information before generating the
 private key and accompanying certificate.</p>
@@ -89,7 +104,7 @@
             </td>
         </tr>
     </table>
-    <input type="submit" value="Review Key Data" />
+    <input type="submit" value="Review Key Data" onClick="return <portlet:namespace/>validateForm();"/>
 </form>
 
 

Modified: geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/view/keystore/uploadCertificate.jsp
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/view/keystore/uploadCertificate.jsp?view=diff&rev=446829&r1=446828&r2=446829
==============================================================================
--- geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/view/keystore/uploadCertificate.jsp
(original)
+++ geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/view/keystore/uploadCertificate.jsp
Sat Sep 16 01:19:28 2006
@@ -5,7 +5,7 @@
 
 <script language="JavaScript">
 var <portlet:namespace/>formName = "<portlet:namespace/>KeystoreForm";
-var <portlet:namespace/>requiredFields = new Array("alias");
+var <portlet:namespace/>requiredFields = new Array("certificate", "alias");
 function <portlet:namespace/>validateForm(){
     return textElementsNotEmpty(<portlet:namespace/>formName,<portlet:namespace/>requiredFields);
 }

Modified: geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/view/realmwizard/_sql.jsp
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/view/realmwizard/_sql.jsp?view=diff&rev=446829&r1=446828&r2=446829
==============================================================================
--- geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/view/realmwizard/_sql.jsp
(original)
+++ geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/view/realmwizard/_sql.jsp
Sat Sep 16 01:19:28 2006
@@ -1,6 +1,17 @@
 <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
 <%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
+<%@ taglib uri="http://java.sun.com/portlet" prefix="portlet"%>
 
+      <script language="JavaScript">
+        var <portlet:namespace/>requiredFieldsCommon = new Array('option-userSelect',
'option-groupSelect');
+        var <portlet:namespace/>requiredFieldsJDBC = new Array('option-jdbcDriver',
'jar', 'option-jdbcURL', 'option-jdbcUser', 'option-jdbcPassword');
+        function <portlet:namespace/>changeRequiredFields(par) {
+          if(par.value != '') // Database pool is selected
+            <portlet:namespace/>requiredFields = <portlet:namespace/>requiredFieldsCommon;
+          else
+            <portlet:namespace/>requiredFields = <portlet:namespace/>requiredFieldsCommon.concat(<portlet:namespace/>requiredFieldsJDBC);
+        }
+      </script>
       <tr>
         <th style="min-width: 140px"><div align="right">User SELECT SQL:</div></th>
         <td><input name="option-userSelect" type="text"
@@ -40,12 +51,15 @@
       <tr>
         <th><div align="right">Database Pool</div></th>
         <td>
-          <select name="option-databasePoolAbstractName">
+          <select name="option-databasePoolAbstractName" onChange="<portlet:namespace/>changeRequiredFields(this)">
             <option />
         <c:forEach var="pool" items="${pools}">
             <option value="${pool.abstractName}"<c:if test="${realm.options['dataSourceName']
eq pool.name && realm.options['dataSourceApplication'] eq pool.applicationName}">
selected</c:if>>${pool.displayName}</option>
         </c:forEach>
           </select>
+          <script language="JavaScript">
+            <portlet:namespace/>changeRequiredFields(document.forms[<portlet:namespace/>formName].elements['option-databasePoolAbstractName']);
+          </script>
         </td>
       </tr>
       <tr>

Modified: geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/view/realmwizard/advanced.jsp
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/view/realmwizard/advanced.jsp?view=diff&rev=446829&r1=446828&r2=446829
==============================================================================
--- geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/view/realmwizard/advanced.jsp
(original)
+++ geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/view/realmwizard/advanced.jsp
Sat Sep 16 01:19:28 2006
@@ -2,12 +2,32 @@
 <%@ taglib uri="http://java.sun.com/portlet" prefix="portlet"%>
 <portlet:defineObjects/>
 
+<script language="JavaScript">
+var <portlet:namespace/>formName = "<portlet:namespace/>RealmForm";
+function <portlet:namespace/>validateForm(){
+    var valid = true;
+    var realmForm = document.forms[<portlet:namespace/>formName];
+    if(realmForm.elements['enableAuditing'].checked)
+        valid = textElementsNotEmpty(<portlet:namespace/>formName, new Array('auditPath'));
+    if(!valid) return false;
+    
+    if(realmForm.elements['enableLockout'].checked) {
+        var fields = new Array('lockoutCount', 'lockoutWindow', 'lockoutDuration');
+        for(i in fields) {
+            valid = checkIntegral(<portlet:namespace/>formName, fields[i]);
+            if(!valid) return false;
+        }
+    }
+    return true;
+}
+</script>
+
 <p><b>Create Security Realm</b> -- Step 3: Advanced Configuration</p>
 
 <c:if test="${!(empty AdvancedError)}"><p><font color="red"><b>Error:
${AdvancedError}</b></font></p></c:if>
 
 <!--   FORM TO COLLECT DATA FOR THIS PAGE   -->
-<form name="<portlet:namespace/>RealmForm" action="<portlet:actionURL/>">
+<form name="<portlet:namespace/>RealmForm" action="<portlet:actionURL/>" onSubmit="return
<portlet:namespace/>validateForm()">
     <input type="hidden" name="mode" value="process-advanced" />
     <input type="hidden" name="test" value="true" />
     <input type="hidden" name="name" value="${realm.name}" />
@@ -69,7 +89,7 @@
       <tr>
         <th valign="top"><div align="right">Enable Lockout:</div></th>
         <td valign="top">
-          <input type="checkbox" id="<portlet:namespace/>lockoutCheckbox" name="enableAuditing"<c:if
test="${realm.lockoutEnabled}"> checked="checked"</c:if>
+          <input type="checkbox" id="<portlet:namespace/>lockoutCheckbox" name="enableLockout"<c:if
test="${realm.lockoutEnabled}"> checked="checked"</c:if>
                  onclick="document.getElementById('<portlet:namespace/>lockoutDiv').style.display=this.checked
? 'block' : 'none';document.getElementById('<portlet:namespace/>lockoutCount').value='';document.getElementById('<portlet:namespace/>lockoutWindow').value='';document.getElementById('<portlet:namespace/>lockoutDuration').value='';"/>
           <div id="<portlet:namespace/>lockoutDiv" style="display: <c:choose><c:when
test="${realm.lockoutEnabled}">block</c:when><c:otherwise>none</c:otherwise></c:choose>;">
           Lock a user after <input type="text" id="<portlet:namespace/>lockoutCount"
name="lockoutCount" size="2" maxlength="3" value="${realm.lockoutCount}" />

Modified: geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/view/realmwizard/configure.jsp
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/view/realmwizard/configure.jsp?view=diff&rev=446829&r1=446828&r2=446829
==============================================================================
--- geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/view/realmwizard/configure.jsp
(original)
+++ geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/view/realmwizard/configure.jsp
Sat Sep 16 01:19:28 2006
@@ -3,6 +3,14 @@
 <%@ taglib uri="http://java.sun.com/portlet" prefix="portlet"%>
 <portlet:defineObjects/>
 
+<script language="JavaScript">
+var <portlet:namespace/>formName = "<portlet:namespace/>RealmForm";
+var <portlet:namespace/>requiredFields;
+function <portlet:namespace/>validateForm(){
+    return textElementsNotEmpty(<portlet:namespace/>formName,<portlet:namespace/>requiredFields);
+}
+</script>
+
 <p><b>Create Security Realm</b> -- Step 2: Configure Login Module</p>
 
 <c:if test="${!(empty LoginModuleError)}"><p><font color="red"><b>Error:
${LoginModuleError}</b></font></p></c:if>
@@ -57,6 +65,9 @@
 <jsp:include page="_sql.jsp" />
   </c:when>
   <c:otherwise>
+    <script language="JavaScript">
+      <portlet:namespace/>requiredFields = new Array();
+    </script>
     <c:forEach var="option" items="${realm.optionNames}">
       <tr>
         <th style="min-width: 140px"><div align="right">${optionMap[option].displayName}:</div></th>
@@ -68,13 +79,18 @@
         <td></td>
         <td>${optionMap[option].description}</td>
       </tr>
+      <c:if test="${!optionMap[option].blankAllowed}">
+        <script language="JavaScript">
+          <portlet:namespace/>requiredFields = <portlet:namespace/>requiredFields.concat(new
Array('option-${option}'))
+        </script>
+      </c:if>
     </c:forEach>
   </c:otherwise>
 </c:choose>
     <!-- SUBMIT BUTTON -->
       <tr>
         <td></td>
-        <td><input type="submit" value="Next" /></td>
+        <td><input type="submit" value="Next" onClick="return <portlet:namespace/>validateForm()"/></td>
       </tr>
     </table>
 </form>

Modified: geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/view/realmwizard/selectType.jsp
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/view/realmwizard/selectType.jsp?view=diff&rev=446829&r1=446828&r2=446829
==============================================================================
--- geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/view/realmwizard/selectType.jsp
(original)
+++ geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/view/realmwizard/selectType.jsp
Sat Sep 16 01:19:28 2006
@@ -2,6 +2,14 @@
 <%@ taglib uri="http://java.sun.com/portlet" prefix="portlet"%>
 <portlet:defineObjects/>
 
+<script language="JavaScript">
+var <portlet:namespace/>formName = "<portlet:namespace/>RealmForm";
+var <portlet:namespace/>requiredFields = new Array("name");
+function <portlet:namespace/>validateForm(){
+    return textElementsNotEmpty(<portlet:namespace/>formName,<portlet:namespace/>requiredFields);
+}
+</script>
+
 <p><b>Create Security Realm</b> -- Step 1: Select Name and Type</p>
 
 <!--   FORM TO COLLECT DATA FOR THIS PAGE   -->
@@ -77,7 +85,7 @@
       </tr>
       <tr>
         <td></td>
-        <td><input type="submit" value="Next" /></td>
+        <td><input type="submit" value="Next" onclick="return <portlet:namespace/>validateForm()"/></td>
       </tr>
     </table>
 </form>

Modified: geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/view/realmwizard/testLogin.jsp
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/view/realmwizard/testLogin.jsp?view=diff&rev=446829&r1=446828&r2=446829
==============================================================================
--- geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/view/realmwizard/testLogin.jsp
(original)
+++ geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/view/realmwizard/testLogin.jsp
Sat Sep 16 01:19:28 2006
@@ -2,6 +2,14 @@
 <%@ taglib uri="http://java.sun.com/portlet" prefix="portlet"%>
 <portlet:defineObjects/>
 
+<script language="JavaScript">
+var <portlet:namespace/>formName = "<portlet:namespace/>RealmForm";
+var <portlet:namespace/>requiredFields = new Array('username');
+function <portlet:namespace/>validateForm(){
+    return textElementsNotEmpty(<portlet:namespace/>formName,<portlet:namespace/>requiredFields);
+}
+</script>
+
 <p><b>Create Security Realm</b> -- Step 4: Test Login</p>
 
 <p>From here you can enter a username and password for the main login module in the
realm, and
@@ -75,7 +83,7 @@
       </tr>
       <tr>
         <td></td>
-        <td><input type="submit" value="Next" /></td>
+        <td><input type="submit" value="Next" onClick="return <portlet:namespace/>validateForm()"/></td>
       </tr>
     </table>
 </form>

Modified: geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/view/webmanager/connector/editHTTP.jsp
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/view/webmanager/connector/editHTTP.jsp?view=diff&rev=446829&r1=446828&r2=446829
==============================================================================
--- geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/view/webmanager/connector/editHTTP.jsp
(original)
+++ geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/view/webmanager/connector/editHTTP.jsp
Sat Sep 16 01:19:28 2006
@@ -2,7 +2,24 @@
 <%@ taglib prefix="portlet" uri="http://java.sun.com/portlet" %>
 <portlet:defineObjects/>
 
-<form name="<portlet:namespace/>" action="<portlet:actionURL/>">
+<script language="JavaScript">
+var <portlet:namespace/>formName = "<portlet:namespace/>HttpForm";
+var <portlet:namespace/>requiredFields = new Array("host");
+var <portlet:namespace/>numericFields = new Array("port", "maxThreads");
+function <portlet:namespace/>validateForm(){
+    if(!textElementsNotEmpty(<portlet:namespace/>formName, <portlet:namespace/>requiredFields))
{
+        return false;
+    }
+    for(i in <portlet:namespace/>numericFields) {
+        if(!checkIntegral(<portlet:namespace/>formName, <portlet:namespace/>numericFields[i]))
{
+            return false;
+        }
+    }
+    return true;
+}
+</script>
+
+<form name="<portlet:namespace/>HttpForm" action="<portlet:actionURL/>">
 <input type="hidden" name="mode" value="${mode}">
 <input type="hidden" name="protocol" value="${protocol}">
 <input type="hidden" name="containerURI" value="${containerURI}">
@@ -32,6 +49,9 @@
     <td><div align="right"></div></td>
     <td>A name that is different than the name for any other web connectors in the
server</td>
   </tr>
+  <script language="JavaScript">
+    <portlet:namespace/>requiredFields = new Array("displayName").concat(<portlet:namespace/>requiredFields);
+  </script>
 </c:if>
 <!-- Host Field -->
   <tr>
@@ -67,6 +87,9 @@
     <td><div align="right"></div></td>
     <td>The minimum number of threads this connector should use to handle incoming
requests</td>
   </tr>
+  <script language="JavaScript">
+    <portlet:namespace/>numericFields = <portlet:namespace/>numericFields.concat(new
Array("minThreads"));
+  </script>
 </c:if>
 <!-- Max Threads Field -->
   <tr>
@@ -83,7 +106,7 @@
   <tr>
     <td><div align="right"></div></td>
     <td>
-      <input name="submit" type="submit" value="Save">
+      <input name="submit" type="submit" value="Save" onClick="return <portlet:namespace/>validateForm();">
       <input name="reset" type="reset" value="Reset">
       <input name="submit" type="submit" value="Cancel">
     </td>    

Modified: geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/view/webmanager/connector/editHTTPS.jsp
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/view/webmanager/connector/editHTTPS.jsp?view=diff&rev=446829&r1=446828&r2=446829
==============================================================================
--- geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/view/webmanager/connector/editHTTPS.jsp
(original)
+++ geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/view/webmanager/connector/editHTTPS.jsp
Sat Sep 16 01:19:28 2006
@@ -2,7 +2,24 @@
 <%@ taglib prefix="portlet" uri="http://java.sun.com/portlet" %>
 <portlet:defineObjects/>
 
-<form name="<portlet:namespace/>" action="<portlet:actionURL/>">
+<script language="JavaScript">
+var <portlet:namespace/>formName = "<portlet:namespace/>HttpsForm";
+var <portlet:namespace/>requiredFields = new Array("host");
+var <portlet:namespace/>numericFields = new Array("port", "maxThreads");
+function <portlet:namespace/>validateForm(){
+    if(!textElementsNotEmpty(<portlet:namespace/>formName, <portlet:namespace/>requiredFields))
{
+        return false;
+    }    
+    for(i in <portlet:namespace/>numericFields) {
+        if(!checkIntegral(<portlet:namespace/>formName, <portlet:namespace/>numericFields[i]))
{
+            return false;
+        }
+    }
+    return true;
+}
+</script>
+
+<form name="<portlet:namespace/>HttpsForm" action="<portlet:actionURL/>">
 <input type="hidden" name="mode" value="${mode}">
 <input type="hidden" name="protocol" value="${protocol}">
 <input type="hidden" name="containerURI" value="${containerURI}">
@@ -34,6 +51,9 @@
     <td><div align="right"></div></td>
     <td>A name that is different than the name for any other web connectors in the
server (no spaces in the name please)</td>
   </tr>
+  <script language="JavaScript">
+    <portlet:namespace/>requiredFields = new Array("displayName").concat(<portlet:namespace/>requiredFields);
+  </script>
 </c:if>
 <!-- Host Field -->
   <tr>
@@ -69,6 +89,9 @@
     <td><div align="right"></div></td>
     <td>The minimum number of threads this connector should use to handle incoming
requests</td>
   </tr>
+  <script language="JavaScript">
+    <portlet:namespace/>numericFields = <portlet:namespace/>numericFields.concat(new
Array("minThreads"));
+  </script>
 </c:if>
 <!-- Max Threads Field -->
   <tr>
@@ -140,6 +163,9 @@
     <td><div align="right"></div></td>
     <td>The file that holds the keystore (relative to the Geronimo install dir)</td>
   </tr>
+  <script language="JavaScript">
+    <portlet:namespace/>requiredFields = <portlet:namespace/>requiredFields.concat(new
Array("keystoreFile"));
+  </script>
 
 <!-- Keystore Password Field -->
   <tr>
@@ -156,6 +182,11 @@
       set to be the same on the keystore).</c:if><c:if test="${mode eq 'save'}">
 Leave
       this empty if you don't want to change the current password.</c:if></td>
   </tr>
+  <c:if test="${mode eq 'add'}">
+    <script language="JavaScript">
+      <portlet:namespace/>requiredFields = <portlet:namespace/>requiredFields.concat(new
Array("keystorePassword"));
+    </script>
+  </c:if>
 
     <!-- Keystore Type Field -->
       <tr>
@@ -278,7 +309,7 @@
   <tr>
     <td><div align="right"></div></td>
     <td>
-      <input name="submit" type="submit" value="Save">
+      <input name="submit" type="submit" value="Save" onClick="return <portlet:namespace/>validateForm();">
       <input name="reset" type="reset" value="Reset">
       <input name="submit" type="submit" value="Cancel">
     </td>    



Mime
View raw message