geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ammul...@apache.org
Subject svn commit: r332560 - in /geronimo/trunk/applications/console-standard/src: java/org/apache/geronimo/console/databasemanager/wizard/DatabasePoolPortlet.java webapp/WEB-INF/view/dbwizard/edit.jsp
Date Fri, 11 Nov 2005 14:15:14 GMT
Author: ammulder
Date: Fri Nov 11 06:15:09 2005
New Revision: 332560

URL: http://svn.apache.org/viewcvs?rev=332560&view=rev
Log:
Implement the DB pool edit screen (GERONIMO-1158)

Modified:
    geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/databasemanager/wizard/DatabasePoolPortlet.java
    geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/dbwizard/edit.jsp

Modified: geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/databasemanager/wizard/DatabasePoolPortlet.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/databasemanager/wizard/DatabasePoolPortlet.java?rev=332560&r1=332559&r2=332560&view=diff
==============================================================================
--- geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/databasemanager/wizard/DatabasePoolPortlet.java
(original)
+++ geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/databasemanager/wizard/DatabasePoolPortlet.java
Fri Nov 11 06:15:09 2005
@@ -300,6 +300,7 @@
     }
 
     private void renderEdit(RenderRequest renderRequest, RenderResponse renderResponse) throws
IOException, PortletException {
+        loadDriverJARList(renderRequest);
         editView.include(renderRequest, renderResponse);
     }
 
@@ -314,6 +315,26 @@
     }
 
     private void renderBasicParams(RenderRequest renderRequest, RenderResponse renderResponse,
PoolData data) throws IOException, PortletException {
+        loadDriverJARList(renderRequest);
+        // Make sure all properties available for the DB are listed
+        DatabaseInfo info = getDatabaseInfo(data);
+        if(info != null) {
+            String[] params = info.getUrlParameters();
+            for (int i = 0; i < params.length; i++) {
+                String param = params[i];
+                final String key = "property-"+param;
+                if(!data.getProperties().containsKey(key)) {
+                    data.getProperties().put(key, param.equals("port") && info.getDefaultPort()
> 0 ? new Integer(info.getDefaultPort()) : null);
+                }
+            }
+        }
+        // Pass on errors
+        renderRequest.setAttribute("driverError", renderRequest.getParameter("driverError"));
+
+        basicParamsView.include(renderRequest, renderResponse);
+    }
+
+    private void loadDriverJARList(RenderRequest renderRequest) {
         // List the available JARs
         List list = new ArrayList();
         ListableRepository[] repos = PortletManager.getListableRepositories(renderRequest);
@@ -338,22 +359,6 @@
         }
         Collections.sort(list);
         renderRequest.setAttribute("jars", list);
-        // Make sure all properties available for the DB are listed
-        DatabaseInfo info = getDatabaseInfo(data);
-        if(info != null) {
-            String[] params = info.getUrlParameters();
-            for (int i = 0; i < params.length; i++) {
-                String param = params[i];
-                final String key = "property-"+param;
-                if(!data.getProperties().containsKey(key)) {
-                    data.getProperties().put(key, param.equals("port") && info.getDefaultPort()
> 0 ? new Integer(info.getDefaultPort()) : null);
-                }
-            }
-        }
-        // Pass on errors
-        renderRequest.setAttribute("driverError", renderRequest.getParameter("driverError"));
-
-        basicParamsView.include(renderRequest, renderResponse);
     }
 
     private void renderConfirmURL(RenderRequest renderRequest, RenderResponse renderResponse)
throws IOException, PortletException {

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=332560&r1=332559&r2=332560&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
Fri Nov 11 06:15:09 2005
@@ -4,12 +4,142 @@
 
 <p>This page edits a new or existing database pool.</p>
 
-<p><a href="<portlet:actionURL portletMode="view">
-              <portlet:param name="mode" value="test" />
-            </portlet:actionURL>">Test Connection</a></p>
-<p><a href="<portlet:actionURL portletMode="view">
-              <portlet:param name="mode" value="save" />
-            </portlet:actionURL>">Skip Test & Save</a></p>
+<!--   FORM TO COLLECT DATA FOR THIS PAGE   -->
+<form name="<portlet:namespace/>DatabaseForm" action="<portlet:actionURL/>">
+    <input type="hidden" name="mode" value="process-url" />
+    <input type="hidden" name="test" value="true" />
+
+    <input type="hidden" name="dbtype" value="${pool.dbtype}" />
+    <input type="hidden" name="urlPrototype" value="${pool.urlPrototype}" />
+    <input type="hidden" name="jar2" value="${pool.jar2}" />
+    <input type="hidden" name="jar3" value="${pool.jar3}" />
+  <c:forEach var="prop" items="${pool.properties}">
+    <input type="hidden" name="${prop.key}" value="${prop.value}" />
+  </c:forEach>
+
+    <table border="0">
+    <!-- ENTRY FIELD: NAME -->
+      <tr>
+        <th><div align="right">Name of Database Pool:</div></th>
+        <td><input name="name" type="text" size="30" value="${pool.name}"></td>
+      </tr>
+      <tr>
+        <td></td>
+        <td>A name that is different than the name for any other database pools in
the server</td>
+      </tr>
+    <!-- HEADER -->
+      <tr>
+        <th colspan="2">Basic Connection Properties</th>
+      </tr>
+    <!-- ENTRY FIELD: Driver Class -->
+      <tr>
+        <th><div align="right">JDBC Driver Class:</div></th>
+        <td><input name="driverClass" type="text" size="30" value="${pool.driverClass}"></td>
+      </tr>
+      <tr>
+        <td></td>
+        <td>
+          <c:if test="${!(empty driverError)}"><font color="red"><b>Unable
to load driver from selected JARs!</b></font></c:if>
+          See the documentation for your JDBC driver.
+        </td>
+      </tr>
+    <!-- ENTRY FIELD: Driver JAR -->
+      <tr>
+        <th><div align="right">Driver JAR:</div></th>
+        <td>
+          <select name="jar1">
+            <option></option>
+        <c:forEach var="jar" items="${jars}">
+            <option <c:if test="${jar == pool.jar1}">selected</c:if>>${jar}</option>
+        </c:forEach>
+          </select>
+        </td>
+      </tr>
+      <tr>
+        <td></td>
+        <td>The JAR holding the selected JDBC driver.  Should be installed under GERONIMO/repository/
(or
+          <input type="button" value="Download a Driver" onclick="document.<portlet:namespace/>DatabaseForm.mode.value='download';document.<portlet:namespace/>DatabaseForm.submit();return
false;" />)
+        </td>
+      </tr>
+    <!-- ENTRY FIELD: URL -->
+      <tr>
+        <th><div align="right">JDBC Connect URL:</div></th>
+        <td><input name="url" type="text" size="50" value="${pool.url}"></td>
+      </tr>
+      <tr>
+        <td></td>
+        <td>Make sure the generated URL fits the syntax for your JDBC driver.</td>
+      </tr>
+    <!-- ENTRY FIELD: Username -->
+      <tr>
+        <th><div align="right">DB User Name:</div></th>
+        <td><input name="user" type="text" size="20" value="${pool.user}"></td>
+      </tr>
+      <tr>
+        <td></td>
+        <td>The username used to connect to the database</td>
+      </tr>
+    <!-- ENTRY FIELD: Password -->
+      <tr>
+        <th><div align="right">DB Password:</div></th>
+        <td><input name="password" type="password" size="20" value="${pool.password}"></td>
+      </tr>
+      <tr>
+        <td></td>
+        <td>The password used to connect to the database</td>
+      </tr>
+    <!-- HEADER -->
+      <tr>
+        <th colspan="2">Connection Pool Parameters</th>
+      </tr>
+    <!-- ENTRY FIELD: Min Size -->
+      <tr>
+        <th><div align="right">Pool Min Size:</div></th>
+        <td><input name="minSize" type="text" size="5" value="${pool.minSize}"></td>
+      </tr>
+      <tr>
+        <td></td>
+        <td>The minimum number of connections in the pool.  Leave blank for default.</td>
+      </tr>
+    <!-- ENTRY FIELD: Max Size -->
+      <tr>
+        <th><div align="right">Pool Max Size:</div></th>
+        <td><input name="maxSize" type="text" size="5" value="${pool.maxSize}"></td>
+      </tr>
+      <tr>
+        <td></td>
+        <td>The maximum number of connections in the pool.  Leave blank for default.</td>
+      </tr>
+    <!-- ENTRY FIELD: Blocking Timeout -->
+      <tr>
+        <th><div align="right">Blocking Timeout:</div></th>
+        <td><input name="blockingTimeout" type="text" size="7" value="${pool.blockingTimeout}">
(in milliseconds)</td>
+      </tr>
+      <tr>
+        <td></td>
+        <td>The length of time a caller will wait for a connection.  Leave blank for
default.</td>
+      </tr>
+    <!-- ENTRY FIELD: Idle timeout -->
+      <tr>
+        <th><div align="right">Idle Timeout:</div></th>
+        <td><input name="idleTimeout" type="text" size="5" value="${pool.idleTimeout}">
(in minutes)</td>
+      </tr>
+      <tr>
+        <td></td>
+        <td>How long a connection can be idle before being closed.  Leave blank for
default.</td>
+      </tr>
+
+    <!-- SUBMIT BUTTON -->
+      <tr>
+        <td></td>
+        <td><input type="submit" value="Test Connection" />
+          <input type="button" value="Skip Test" onclick="document.<portlet:namespace/>DatabaseForm.test.value='false';document.<portlet:namespace/>DatabaseForm.submit();return
false;" />
+        </td>
+      </tr>
+    </table>
+</form>
+<!--   END OF FORM TO COLLECT DATA FOR THIS PAGE   -->
+
 
 
 <p><a href="<portlet:actionURL portletMode="view">



Mime
View raw message