You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by am...@apache.org on 2005/11/21 22:18:27 UTC

svn commit: r347985 - in /geronimo/trunk/applications/console-standard/src: java/org/apache/geronimo/console/securitymanager/realm/ webapp/WEB-INF/view/dbwizard/ webapp/WEB-INF/view/realmwizard/

Author: ammulder
Date: Mon Nov 21 13:18:09 2005
New Revision: 347985

URL: http://svn.apache.org/viewcvs?rev=347985&view=rev
Log:
Add a usage page to the security realm portlet
Update the layout to give more space to the row captions in the security
  realm and database pool portlets
For realms, make sure to refresh the modules that the deployment plan is
  based on if you show the plan, edit the realm, and then show the plan
  again.
For realms, if you show the plan, don't force it to go to the full edit
  view if you've been using the wizard all along.

Added:
    geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/realmwizard/usage.jsp   (with props)
Modified:
    geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/securitymanager/realm/SecurityRealmPortlet.java
    geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/dbwizard/basicParams.jsp
    geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/dbwizard/confirmURL.jsp
    geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/dbwizard/edit.jsp
    geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/dbwizard/importUpload.jsp
    geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/dbwizard/list.jsp
    geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/dbwizard/selectDatabase.jsp
    geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/dbwizard/selectDownload.jsp
    geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/dbwizard/showPlan.jsp
    geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/dbwizard/testConnection.jsp
    geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/dbwizard/usage.jsp
    geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/realmwizard/advanced.jsp
    geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/realmwizard/configure.jsp
    geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/realmwizard/edit.jsp
    geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/realmwizard/list.jsp
    geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/realmwizard/selectType.jsp
    geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/realmwizard/showPlan.jsp
    geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/realmwizard/testLogin.jsp
    geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/realmwizard/testResults.jsp

Modified: geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/securitymanager/realm/SecurityRealmPortlet.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/securitymanager/realm/SecurityRealmPortlet.java?rev=347985&r1=347984&r2=347985&view=diff
==============================================================================
--- geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/securitymanager/realm/SecurityRealmPortlet.java (original)
+++ geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/securitymanager/realm/SecurityRealmPortlet.java Mon Nov 21 13:18:09 2005
@@ -105,6 +105,7 @@
     private static final String TEST_LOGIN_VIEW    = "/WEB-INF/view/realmwizard/testLogin.jsp";
     private static final String TEST_RESULTS_VIEW  = "/WEB-INF/view/realmwizard/testResults.jsp";
     private static final String SHOW_PLAN_VIEW     = "/WEB-INF/view/realmwizard/showPlan.jsp";
+    private static final String USAGE_VIEW         = "/WEB-INF/view/realmwizard/usage.jsp";
     private static final String LIST_MODE          = "list";
     private static final String EDIT_MODE          = "edit";
     private static final String SELECT_TYPE_MODE   = "type";
@@ -114,6 +115,7 @@
     private static final String TEST_RESULTS_MODE  = "results";
     private static final String SHOW_PLAN_MODE     = "plan";
     private static final String EDIT_EXISTING_MODE = "editExisting";
+    private static final String USAGE_MODE         = "usage";
     private static final String SAVE_MODE          = "save";
     private static final String MODE_KEY = "mode";
 
@@ -125,6 +127,7 @@
     private PortletRequestDispatcher testLoginView;
     private PortletRequestDispatcher testResultsView;
     private PortletRequestDispatcher planView;
+    private PortletRequestDispatcher usageView;
 
     public void init(PortletConfig portletConfig) throws PortletException {
         super.init(portletConfig);
@@ -136,6 +139,7 @@
         testLoginView = portletConfig.getPortletContext().getRequestDispatcher(TEST_LOGIN_VIEW);
         testResultsView = portletConfig.getPortletContext().getRequestDispatcher(TEST_RESULTS_VIEW);
         planView = portletConfig.getPortletContext().getRequestDispatcher(SHOW_PLAN_VIEW);
+        usageView = portletConfig.getPortletContext().getRequestDispatcher(USAGE_VIEW);
     }
 
     public void destroy() {
@@ -145,6 +149,7 @@
         configureView = null;
         advancedView = null;
         testLoginView = null;
+        usageView = null;
         planView = null;
         super.destroy();
     }
@@ -160,7 +165,11 @@
         } else if(mode.equals("process-"+SELECT_TYPE_MODE)) {
             if(data.getName() != null && !data.getName().trim().equals("")) {
                 // Config properties have to be set in render since they have values of null
-                actionResponse.setRenderParameter(MODE_KEY, CONFIGURE_MODE);
+                if(data.getRealmType().equals("Other")) {
+                    actionResponse.setRenderParameter(MODE_KEY, EDIT_MODE);
+                } else {
+                    actionResponse.setRenderParameter(MODE_KEY, CONFIGURE_MODE);
+                }
             } else {
                 actionResponse.setRenderParameter(MODE_KEY, SELECT_TYPE_MODE);
             }
@@ -190,6 +199,12 @@
         } else if(mode.equals(EDIT_EXISTING_MODE)) {
             actionLoadExistingRealm(actionRequest, data);
             actionResponse.setRenderParameter(MODE_KEY, EDIT_MODE);
+        } else if(mode.equals(CONFIGURE_MODE)) {
+            if(data.getObjectName() != null || (data.getRealmType() != null && data.getRealmType().equals("Other"))) {
+                actionResponse.setRenderParameter(MODE_KEY, EDIT_MODE);
+            } else {
+                actionResponse.setRenderParameter(MODE_KEY, CONFIGURE_MODE);
+            }
         } else if(mode.equals(SAVE_MODE)) {
             actionSaveRealm(actionRequest, data);
             actionResponse.setRenderParameter(MODE_KEY, LIST_MODE);
@@ -220,13 +235,15 @@
             } else if(mode.equals(CONFIGURE_MODE)) {
                 renderConfigure(renderRequest, renderResponse, data);
             } else if(mode.equals(ADVANCED_MODE)) {
-                renderAdvanced(renderRequest, renderResponse);
+                renderAdvanced(renderRequest, renderResponse, data);
             } else if(mode.equals(TEST_LOGIN_MODE)) {
                 renderTestLoginForm(renderRequest, renderResponse);
             } else if(mode.equals(TEST_RESULTS_MODE)) {
                 renderTestResults(renderRequest, renderResponse);
             } else if(mode.equals(SHOW_PLAN_MODE)) {
                 renderPlan(renderRequest, renderResponse);
+            } else if(mode.equals(USAGE_MODE)) {
+                renderUsage(renderRequest, renderResponse);
             }
         } catch (Throwable e) {
             log.error("Unable to render portlet", e);
@@ -490,6 +507,8 @@
         if(request.getParameter("LoginModuleError") != null) {
             request.setAttribute("LoginModuleError", request.getParameter("LoginModuleError"));
         }
+        // Clear out any cached modules
+        data.modules = null;
         // Configure option list
         MasterLoginModuleInfo info = getSelectedModule(data);
         for (int i = 0; i < info.getOptions().length; i++) {
@@ -507,7 +526,10 @@
         configureView.include(request, response);
     }
 
-    private void renderAdvanced(RenderRequest request, RenderResponse response) throws IOException, PortletException {
+    private void renderAdvanced(RenderRequest request, RenderResponse response, RealmData data) throws IOException, PortletException {
+        // Clear out any cached modules
+        data.modules = null;
+        // Show the page
         advancedView.include(request, response);
     }
 
@@ -533,6 +555,10 @@
         planView.include(request, response);
     }
 
+    private void renderUsage(RenderRequest request, RenderResponse response) throws IOException, PortletException {
+        usageView.include(request, response);
+    }
+
     private static MasterLoginModuleInfo getSelectedModule(RealmData data) {
         MasterLoginModuleInfo[] all = MasterLoginModuleInfo.getAllModules();
         for (int i = 0; i < all.length; i++) {
@@ -669,7 +695,7 @@
             list.addAll(Arrays.asList(data.modules));
         }
         if(data.getObjectName() == null) {
-            for(int i=list.size(); i<=5; i++) {
+            for(int i=list.size(); i<5; i++) {
                 LoginModuleDetails module = new LoginModuleDetails();
                 list.add(module);
             }

Modified: geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/dbwizard/basicParams.jsp
URL: http://svn.apache.org/viewcvs/geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/dbwizard/basicParams.jsp?rev=347985&r1=347984&r2=347985&view=diff
==============================================================================
--- geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/dbwizard/basicParams.jsp (original)
+++ geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/dbwizard/basicParams.jsp Mon Nov 21 13:18:09 2005
@@ -27,7 +27,7 @@
     <table border="0">
     <!-- ENTRY FIELD: Driver Class -->
       <tr>
-        <th><div align="right">JDBC Driver Class:</div></th>
+        <th style="min-width: 140px"><div align="right">JDBC Driver Class:</div></th>
         <td><input name="driverClass" type="text" size="30" value="${pool.driverClass}"></td>
       </tr>
       <tr>

Modified: geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/dbwizard/confirmURL.jsp
URL: http://svn.apache.org/viewcvs/geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/dbwizard/confirmURL.jsp?rev=347985&r1=347984&r2=347985&view=diff
==============================================================================
--- geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/dbwizard/confirmURL.jsp (original)
+++ geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/dbwizard/confirmURL.jsp Mon Nov 21 13:18:09 2005
@@ -29,7 +29,7 @@
     <table border="0">
     <!-- ENTRY FIELD: URL -->
       <tr>
-        <th><div align="right">JDBC Connect URL:</div></th>
+        <th style="min-width: 140px"><div align="right">JDBC Connect URL:</div></th>
         <td><input name="url" type="text" size="50" value="${pool.url}"></td>
       </tr>
       <tr>

Modified: geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/dbwizard/edit.jsp
URL: http://svn.apache.org/viewcvs/geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/dbwizard/edit.jsp?rev=347985&r1=347984&r2=347985&view=diff
==============================================================================
--- geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/dbwizard/edit.jsp (original)
+++ geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/dbwizard/edit.jsp Mon Nov 21 13:18:09 2005
@@ -25,7 +25,7 @@
     <table border="0">
     <!-- ENTRY FIELD: NAME -->
       <tr>
-        <th><div align="right">Pool Name:</div></th>
+        <th style="min-width: 140px"><div align="right">Pool Name:</div></th>
         <td>
       <c:choose> <%-- Can't change the pool name after deployment because it's wired into all the ObjectNames --%>
         <c:when test="${empty pool.objectName}">

Modified: geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/dbwizard/importUpload.jsp
URL: http://svn.apache.org/viewcvs/geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/dbwizard/importUpload.jsp?rev=347985&r1=347984&r2=347985&view=diff
==============================================================================
--- geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/dbwizard/importUpload.jsp (original)
+++ geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/dbwizard/importUpload.jsp Mon Nov 21 13:18:09 2005
@@ -17,7 +17,7 @@
         <td class="DarkBackground" colspan="2">${pool.importSource} Import</td>
       </tr>
       <tr>
-        <th align="right">Config File:</th>
+        <th align="right" style="min-width: 140px">Config File:</th>
         <td><input type="file" name="configFile" /></td>
       </tr>
       <tr>
@@ -53,7 +53,7 @@
 need to re-enter all the passwords.</td>
       </tr>
       <tr>
-        <th align="right">Domain directory path:</th>
+        <th align="right" style="min-width: 140px">Domain directory path:</th>
         <td><input type="text" name="weblogicDomainDir" size="40" /></td>
       </tr>
       <tr>

Modified: geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/dbwizard/list.jsp
URL: http://svn.apache.org/viewcvs/geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/dbwizard/list.jsp?rev=347985&r1=347984&r2=347985&view=diff
==============================================================================
--- geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/dbwizard/list.jsp (original)
+++ geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/dbwizard/list.jsp Mon Nov 21 13:18:09 2005
@@ -8,6 +8,9 @@
 <c:choose>
   <c:when test="${empty(pools)}"><p><i>There are no database pools defined</i></p></c:when>
   <c:otherwise>
+<p>For each pool listed, you can click the <b>usage</b> link to see examples of how
+  to use the pool from your application.</p>
+
 <table width="100%">
   <tr>
     <td class="DarkBackground">Name</td>

Modified: geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/dbwizard/selectDatabase.jsp
URL: http://svn.apache.org/viewcvs/geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/dbwizard/selectDatabase.jsp?rev=347985&r1=347984&r2=347985&view=diff
==============================================================================
--- geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/dbwizard/selectDatabase.jsp (original)
+++ geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/dbwizard/selectDatabase.jsp Mon Nov 21 13:18:09 2005
@@ -31,7 +31,7 @@
     <table border="0">
     <!-- ENTRY FIELD: NAME -->
       <tr>
-        <th><div align="right">Name of Database Pool:</div></th>
+        <th style="min-width: 140px"><div align="right">Name of Database Pool:</div></th>
         <td><input name="name" type="text" size="30" value="${pool.name}"></td>
       </tr>
       <tr>

Modified: geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/dbwizard/selectDownload.jsp
URL: http://svn.apache.org/viewcvs/geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/dbwizard/selectDownload.jsp?rev=347985&r1=347984&r2=347985&view=diff
==============================================================================
--- geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/dbwizard/selectDownload.jsp (original)
+++ geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/dbwizard/selectDownload.jsp Mon Nov 21 13:18:09 2005
@@ -41,7 +41,7 @@
     <table border="0">
     <!-- ENTRY FIELD: DRIVER TYPE -->
       <tr>
-        <th><div align="right">Select Driver:</div></th>
+        <th style="min-width: 140px"><div align="right">Select Driver:</div></th>
         <td>
           <select name="driverName">
         <c:forEach var="driver" items="${drivers}">

Modified: geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/dbwizard/showPlan.jsp
URL: http://svn.apache.org/viewcvs/geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/dbwizard/showPlan.jsp?rev=347985&r1=347984&r2=347985&view=diff
==============================================================================
--- geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/dbwizard/showPlan.jsp (original)
+++ geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/dbwizard/showPlan.jsp Mon Nov 21 13:18:09 2005
@@ -33,7 +33,7 @@
     <table border="0">
     <!-- STATUS FIELD: Deployment Plan -->
       <tr>
-        <th valign="top"><div align="right">Deployment Plan:</div></th>
+        <th valign="top" style="min-width: 140px"><div align="right">Deployment Plan:</div></th>
         <td><textarea rows="30" cols="60" readonly>${deploymentPlan}</textarea></td>
       </tr>
     <!-- SUBMIT BUTTON -->

Modified: geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/dbwizard/testConnection.jsp
URL: http://svn.apache.org/viewcvs/geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/dbwizard/testConnection.jsp?rev=347985&r1=347984&r2=347985&view=diff
==============================================================================
--- geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/dbwizard/testConnection.jsp (original)
+++ geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/dbwizard/testConnection.jsp Mon Nov 21 13:18:09 2005
@@ -33,7 +33,7 @@
     <table border="0">
     <!-- STATUS FIELD: Conection Result -->
       <tr>
-        <th><div align="right">Test Result:</div></th>
+        <th style="min-width: 140px"><div align="right">Test Result:</div></th>
         <td>
           <c:choose>
             <c:when test="${empty connectResult}">

Modified: geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/dbwizard/usage.jsp
URL: http://svn.apache.org/viewcvs/geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/dbwizard/usage.jsp?rev=347985&r1=347984&r2=347985&view=diff
==============================================================================
--- geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/dbwizard/usage.jsp (original)
+++ geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/dbwizard/usage.jsp Mon Nov 21 13:18:09 2005
@@ -7,7 +7,6 @@
   The example here is a web application, but other application modules would work in
   the same way.</p>
 
-
 <p><b>WEB-INF/web.xml</b></p>
 
 <p>The <tt>web.xml</tt> should have a <tt>resource-ref</tt> section declaring the database pool,

Modified: geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/realmwizard/advanced.jsp
URL: http://svn.apache.org/viewcvs/geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/realmwizard/advanced.jsp?rev=347985&r1=347984&r2=347985&view=diff
==============================================================================
--- geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/realmwizard/advanced.jsp (original)
+++ geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/realmwizard/advanced.jsp Mon Nov 21 13:18:09 2005
@@ -45,7 +45,7 @@
     <table border="0">
     <!-- ENTRY FIELD: Audit Log -->
       <tr>
-        <th valign="top"><div align="right">Enable Auditing:</div></th>
+        <th valign="top" style="min-width: 140px"><div align="right">Enable Auditing:</div></th>
         <td valign="top">
           <input type="checkbox" id="<portlet:namespace/>auditCheckbox" name="enableAuditing"<c:if test="${!(empty realm.auditPath)}"> checked="checked"</c:if>
           onclick="document.getElementById('<portlet:namespace/>auditDiv').style.display=this.checked ? 'block' : 'none';document.getElementById('<portlet:namespace/>auditPath').value='';"/>

Modified: geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/realmwizard/configure.jsp
URL: http://svn.apache.org/viewcvs/geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/realmwizard/configure.jsp?rev=347985&r1=347984&r2=347985&view=diff
==============================================================================
--- geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/realmwizard/configure.jsp (original)
+++ geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/realmwizard/configure.jsp Mon Nov 21 13:18:09 2005
@@ -54,7 +54,7 @@
   <c:otherwise>
     <c:forEach var="option" items="${realm.optionNames}">
       <tr>
-        <th><div align="right">${optionMap[option].displayName}:</div></th>
+        <th style="min-width: 140px"><div align="right">${optionMap[option].displayName}:</div></th>
         <td><input name="option-${option}"
                    type="<c:choose><c:when test="${optionMap[option].password}">password</c:when><c:otherwise>text</c:otherwise></c:choose>"
                    size="${optionMap[option].length}" value="${realm.options[option]}"></td>

Modified: geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/realmwizard/edit.jsp
URL: http://svn.apache.org/viewcvs/geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/realmwizard/edit.jsp?rev=347985&r1=347984&r2=347985&view=diff
==============================================================================
--- geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/realmwizard/edit.jsp (original)
+++ geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/realmwizard/edit.jsp Mon Nov 21 13:18:09 2005
@@ -5,6 +5,16 @@
 
 <p>This page edits a new or existing security realm.</p>
 
+<p>A security realm may have one or more login modules.  Many simple realms have
+only one login module.  Additional login modules may be used to access more
+underlying security information stores, or to add functionality such as auditing
+to a realm without affecting the authentication process for the realm.</p>
+
+<c:if test="${empty realm.objectName}">
+<p>If you don't need to use as many login modules as there are entries below,
+just leave the extra ones blank.</p>
+</c:if>
+
 <!--   FORM TO COLLECT DATA FOR THIS PAGE   -->
 <form name="<portlet:namespace/>RealmForm" action="<portlet:actionURL/>">
     <input type="hidden" name="mode" value="save" />
@@ -24,7 +34,7 @@
     <table border="0">
     <!-- ENTRY FIELD: NAME -->
       <tr>
-        <th><div align="right">Realm Name:</div></th>
+        <th style="min-width: 140px"><div align="right">Realm Name:</div></th>
         <td>
       <c:choose> <%-- Can't change the realm name after deployment because it's wired into all the ObjectNames --%>
         <c:when test="${empty realm.objectName}">

Modified: geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/realmwizard/list.jsp
URL: http://svn.apache.org/viewcvs/geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/realmwizard/list.jsp?rev=347985&r1=347984&r2=347985&view=diff
==============================================================================
--- geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/realmwizard/list.jsp (original)
+++ geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/realmwizard/list.jsp Mon Nov 21 13:18:09 2005
@@ -8,6 +8,9 @@
 <c:choose>
   <c:when test="${empty(realms)}"><p><i>There are no security realms defined</i></p></c:when>
   <c:otherwise>
+<p>For each realm listed, you can click the <b>usage</b> link to see examples of how
+  to use the realm from your application.</p>
+
 <table width="100%">
   <tr>
     <td class="DarkBackground">Name</td>
@@ -53,6 +56,11 @@
         <portlet:param name="mode" value="editExisting" />
         <portlet:param name="objectName" value="${realm.objectName}" />
       </portlet:actionURL>">edit</a>
+      <a href="<portlet:actionURL portletMode="view">
+        <portlet:param name="mode" value="usage" />
+        <portlet:param name="name" value="${realm.name}" />
+        <portlet:param name="objectName" value="${realm.objectName}" />
+      </portlet:actionURL>">usage</a>
            <%--<a href="<portlet:actionURL portletMode="view">
                  <portlet:param name="mode" value="delete" />
                  <portlet:param name="name" value="${info.objectName}" />

Modified: geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/realmwizard/selectType.jsp
URL: http://svn.apache.org/viewcvs/geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/realmwizard/selectType.jsp?rev=347985&r1=347984&r2=347985&view=diff
==============================================================================
--- geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/realmwizard/selectType.jsp (original)
+++ geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/realmwizard/selectType.jsp Mon Nov 21 13:18:09 2005
@@ -45,7 +45,7 @@
     <table border="0">
     <!-- ENTRY FIELD: NAME -->
       <tr>
-        <th><div align="right">Name of Security Realm:</div></th>
+        <th style="min-width: 140px"><div align="right">Name of Security Realm:</div></th>
         <td><input name="name" type="text" size="30" value="${realm.name}" /></td>
       </tr>
       <tr>

Modified: geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/realmwizard/showPlan.jsp
URL: http://svn.apache.org/viewcvs/geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/realmwizard/showPlan.jsp?rev=347985&r1=347984&r2=347985&view=diff
==============================================================================
--- geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/realmwizard/showPlan.jsp (original)
+++ geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/realmwizard/showPlan.jsp Mon Nov 21 13:18:09 2005
@@ -47,7 +47,7 @@
     <table border="0">
     <!-- STATUS FIELD: Deployment Plan -->
       <tr>
-        <th valign="top"><div align="right">Deployment Plan:</div></th>
+        <th valign="top" style="min-width: 140px"><div align="right">Deployment Plan:</div></th>
         <td><textarea rows="30" cols="60" readonly>${deploymentPlan}</textarea></td>
       </tr>
     <!-- SUBMIT BUTTON -->
@@ -55,7 +55,7 @@
         <td></td>
         <td>
 <input type="submit" value="<c:choose><c:when test="${empty realm.objectName}">Deploy Realm</c:when><c:otherwise>Save</c:otherwise></c:choose>" />
-<input type="button" value="Edit Settings" onclick="document.<portlet:namespace/>RealmForm.mode.value='edit';document.<portlet:namespace/>RealmForm.submit();return false;" />
+<input type="button" value="Edit Settings" onclick="document.<portlet:namespace/>RealmForm.mode.value='configure';document.<portlet:namespace/>RealmForm.submit();return false;" />
         </td>
       </tr>
     <!-- STATUS FIELD: Command-line guidance -->

Modified: geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/realmwizard/testLogin.jsp
URL: http://svn.apache.org/viewcvs/geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/realmwizard/testLogin.jsp?rev=347985&r1=347984&r2=347985&view=diff
==============================================================================
--- geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/realmwizard/testLogin.jsp (original)
+++ geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/realmwizard/testLogin.jsp Mon Nov 21 13:18:09 2005
@@ -52,7 +52,7 @@
     <table border="0">
     <!-- ENTRY FIELD: Username -->
       <tr>
-        <th><div align="right">Username:</div></th>
+        <th style="min-width: 140px"><div align="right">Username:</div></th>
         <td><input name="username" type="text" size="20" /></td>
       </tr>
       <tr>

Modified: geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/realmwizard/testResults.jsp
URL: http://svn.apache.org/viewcvs/geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/realmwizard/testResults.jsp?rev=347985&r1=347984&r2=347985&view=diff
==============================================================================
--- geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/realmwizard/testResults.jsp (original)
+++ geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/realmwizard/testResults.jsp Mon Nov 21 13:18:09 2005
@@ -48,7 +48,7 @@
     <table border="0">
     <!-- STATUS FIELD: Results -->
       <tr>
-        <th><div align="right">Test Results:</div></th>
+        <th style="min-width: 140px"><div align="right">Test Results:</div></th>
         <td colspan="2">${LoginResults}</td>
       </tr>
     <!-- STATUS FIELD: Principals -->
@@ -71,7 +71,8 @@
           <input type="submit" value="Test Again" />
           <input type="button" value="Edit Realm" onclick="document.<portlet:namespace/>RealmForm.mode.value='configure';document.<portlet:namespace/>RealmForm.submit();return false;" />
           <input type="button" value="Show Plan" onclick="document.<portlet:namespace/>RealmForm.mode.value='plan';document.<portlet:namespace/>RealmForm.submit();return false;" />
-          <input type="button" value="Deploy Realm" onclick="document.<portlet:namespace/>RealmForm.mode.value='save';document.<portlet:namespace/>RealmForm.submit();return false;" />
+          <input type="button" value="<c:choose><c:when test="${empty realm.objectName}">Deploy Realm</c:when><c:otherwise>Save</c:otherwise></c:choose>"
+                 onclick="document.<portlet:namespace/>RealmForm.mode.value='save';document.<portlet:namespace/>RealmForm.submit();return false;" />
         </td>
       </tr>
     </table>

Added: geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/realmwizard/usage.jsp
URL: http://svn.apache.org/viewcvs/geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/realmwizard/usage.jsp?rev=347985&view=auto
==============================================================================
--- geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/realmwizard/usage.jsp (added)
+++ geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/realmwizard/usage.jsp Mon Nov 21 13:18:09 2005
@@ -0,0 +1,136 @@
+<%@ 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"%>
+<portlet:defineObjects/>
+
+<p>This page talks about how to use the security realm ${realm.name} from a J2EE application.
+  The example here is a web application, but other application modules would work similarly.</p>
+
+
+<p><b>WEB-INF/web.xml</b></p>
+
+<p>The <tt>web.xml</tt> should have</p>
+<ul>
+  <li>One or more <tt>security-constraint</tt> blocks designating the protected pages or URLs</li>
+  <li>A <tt>login-config</tt> section configuring the login style for the application</li>
+  <li>One or more <tt>security-role</tt> blocks listing the security roles used by the
+    application</li>
+</ul>
+
+<pre>
+&lt;web-app xmlns="http://java.sun.com/xml/ns/j2ee"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
+         http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
+         version="2.4"&gt;
+
+  &lt;!--  servlets and mappings and normal web.xml stuff here --&gt;
+
+    &lt;security-constraint&gt;
+        &lt;web-resource-collection&gt;
+            &lt;web-resource-name&gt;Protected&lt;/web-resource-name&gt;
+            &lt;url-pattern&gt;/protected/*&lt;/url-pattern&gt;
+            &lt;http-method&gt;GET&lt;/http-method&gt;
+            &lt;http-method&gt;POST&lt;/http-method&gt;
+        &lt;/web-resource-collection&gt;
+        &lt;auth-constraint&gt;
+            &lt;role-name&gt;<b>admin</b>&lt;/role-name&gt;
+        &lt;/auth-constraint&gt;
+    &lt;/security-constraint&gt;
+    &lt;login-config&gt;
+        &lt;auth-method&gt;FORM&lt;/auth-method&gt;
+        &lt;realm-name&gt;This is not used for FORM login&lt;/realm-name&gt;
+        &lt;form-login-config&gt;
+            &lt;form-login-page&gt;/login.jsp&lt;/form-login-page&gt;
+            &lt;form-error-page&gt;/loginerror.jsp&lt;/form-error-page&gt;
+      &lt;/form-login-config&gt;
+    &lt;/login-config&gt;
+    &lt;security-role&gt;
+        &lt;role-name&gt;<b>admin</b>&lt;/role-name&gt;
+    &lt;/security-role&gt;
+&lt;/web-app&gt;
+</pre>
+
+<p><b>WEB-INF/geronimo-web.xml</b></p>
+
+<p>To configure the security realm and the members of each role, the web application
+needs to have a <tt>geronimo-web.xml</tt> deployment plan.  That may be packaged in the WAR
+in the <tt>WEB-INF</tt> directory, or it may be provided separately on the command line to
+the deploy tool.</p>
+
+<p>The <tt>geronimo-web.xml</tt> plan should have a <tt>security-realm-name</tt>
+element indicating which realm will be used to authenticate logins to the web application.
+It also needs to have a <tt>security</tt> element listing the users or groups who
+should be members of each <tt>security-role</tt> listed in <tt>web.xml</tt>.</p>
+
+<pre>
+&lt;?xml version="1.0" encoding="UTF-8"?&gt;
+&lt;web-app
+    xmlns="http://geronimo.apache.org/xml/ns/web"
+    xmlns:naming="http://geronimo.apache.org/xml/ns/naming"
+    configId="MyConfigName"
+    parentId="org/apache/geronimo/Server"&gt;
+
+    &lt;context-root&gt;/MyWebApp&lt;/context-root&gt;
+    &lt;context-priority-classloader&gt;true&lt;/context-priority-classloader&gt;
+
+    &lt;security-realm-name&gt;<b>${realm.name}</b>&lt;/security-realm-name&gt;
+    &lt;security&gt;
+        &lt;default-principal&gt;
+            &lt;principal name="anonymous"
+class="org.apache.geronimo.security.realm.providers.GeronimoUserPrincipal"
+            /&gt;
+        &lt;/default-principal&gt;
+        &lt;role-mappings&gt;
+            &lt;role role-name="<b>admin</b>"&gt;
+                &lt;principal name="administrators" designated-run-as="true"
+class="org.apache.geronimo.security.realm.providers.<b>GeronimoGroupPrincipal</b>"
+                /&gt;
+                &lt;principal name="root"
+class="org.apache.geronimo.security.realm.providers.<b>GeronimoUserPrincipal</b>"
+                /&gt;
+            &lt;/role&gt;
+        &lt;/role-mappings&gt;
+    &lt;/security&gt;
+&lt;/web-app&gt;
+</pre>
+
+<p>This example indicated that ${realm.name} will be used to handle all logins to
+the web application.  Then it maps the <tt>admin</tt> role to a combination of
+one user (<tt>root</tt>) and one group (<tt>administrators</tt>), using a combination
+of the principal classes and principal names.  (Note that if ${realm.name} uses a
+custom login module, the principal classes may be different, but the ones listed
+above are used for users and groups by all the standard Geronimo login modules.)</p>
+
+<p>It's also possible to configure separate login modules to use separate login
+domain names, and then use the login domain names in the role mapping (so a user
+"root" from login domain "Foo" is different from a user "root" from login domain
+"Bar"), but this is only important if you have multiple login modules assigning
+principals to the users.</p>
+
+<p>Finally, if the <tt>security</tt> section is declared in an EAR
+<tt>application.xml</tt> deployment descriptor, there's no need to repeat it
+in any of the modules inside the EAR -- they'll all share the same role mapping
+information.</p>
+
+<p><b>Application Code</b></p>
+
+<p>No special application code is required to work with security roles.</p>
+
+<p>If an application calls <tt>HttpServletRequest.getUserPrincipal()</tt>,
+Geronimo will return a principal where the principal class implements
+<tt>GeronimoCallerPrincipal</tt> -- normally a username (since <tt>GeronimoUserPrincipal</tt>
+implements <tt>GeronimoCallerPrincipal</tt>).  If you're using a custom login
+module and getting the wrong results for <tt>getUserPrincipal</tt>, try
+making your user principal class implement <tt>GeronimoCallerPrincipal</tt>.</p>
+
+<p>If an application calls <tt>HttpServletRequest.isUserInRole(role)</tt>,
+Geronimo will return true or false depending on whether any of the principals
+assigned to that user by the realm's login modules were listed in the role
+mapping above.</p>
+
+<hr />
+
+<p><a href="<portlet:actionURL portletMode="view">
+              <portlet:param name="mode" value="list" />
+            </portlet:actionURL>">Return to list</a></p>

Propchange: geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/realmwizard/usage.jsp
------------------------------------------------------------------------------
    svn:eol-style = native