Return-Path: Delivered-To: apmail-geronimo-scm-archive@www.apache.org Received: (qmail 68670 invoked from network); 9 Mar 2009 04:43:52 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 9 Mar 2009 04:43:52 -0000 Received: (qmail 28338 invoked by uid 500); 9 Mar 2009 04:43:52 -0000 Delivered-To: apmail-geronimo-scm-archive@geronimo.apache.org Received: (qmail 28292 invoked by uid 500); 9 Mar 2009 04:43:52 -0000 Mailing-List: contact scm-help@geronimo.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: dev@geronimo.apache.org List-Id: Delivered-To: mailing list scm@geronimo.apache.org Received: (qmail 28283 invoked by uid 99); 9 Mar 2009 04:43:52 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 08 Mar 2009 21:43:52 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 09 Mar 2009 04:43:48 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 912602388A01; Mon, 9 Mar 2009 04:43:27 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r751581 - in /geronimo/server/branches/2.1/plugins/system-database/sysdb-portlets/src/main: java/org/apache/geronimo/console/databasemanager/wizard/ webapp/WEB-INF/view/dbwizard/ Date: Mon, 09 Mar 2009 04:43:27 -0000 To: scm@geronimo.apache.org From: gawor@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20090309044327.912602388A01@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: gawor Date: Mon Mar 9 04:43:26 2009 New Revision: 751581 URL: http://svn.apache.org/viewvc?rev=751581&view=rev Log: ensure username and password fields always appear next to each other so that web browsers don't autofill the wrong field. Based on patch from Ivan (GERONIMO-4561) Modified: geronimo/server/branches/2.1/plugins/system-database/sysdb-portlets/src/main/java/org/apache/geronimo/console/databasemanager/wizard/DatabasePoolPortlet.java geronimo/server/branches/2.1/plugins/system-database/sysdb-portlets/src/main/webapp/WEB-INF/view/dbwizard/basicParams.jsp geronimo/server/branches/2.1/plugins/system-database/sysdb-portlets/src/main/webapp/WEB-INF/view/dbwizard/edit.jsp Modified: geronimo/server/branches/2.1/plugins/system-database/sysdb-portlets/src/main/java/org/apache/geronimo/console/databasemanager/wizard/DatabasePoolPortlet.java URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/plugins/system-database/sysdb-portlets/src/main/java/org/apache/geronimo/console/databasemanager/wizard/DatabasePoolPortlet.java?rev=751581&r1=751580&r2=751581&view=diff ============================================================================== --- geronimo/server/branches/2.1/plugins/system-database/sysdb-portlets/src/main/java/org/apache/geronimo/console/databasemanager/wizard/DatabasePoolPortlet.java (original) +++ geronimo/server/branches/2.1/plugins/system-database/sysdb-portlets/src/main/java/org/apache/geronimo/console/databasemanager/wizard/DatabasePoolPortlet.java Mon Mar 9 04:43:26 2009 @@ -43,6 +43,7 @@ import java.util.Comparator; import java.util.HashMap; import java.util.HashSet; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import java.util.Properties; @@ -86,8 +87,8 @@ import org.apache.geronimo.connector.deployment.jsr88.SinglePool; import org.apache.geronimo.connector.outbound.PoolingAttributes; import org.apache.geronimo.console.BasePortlet; -import org.apache.geronimo.console.databasemanager.ManagementHelper; import org.apache.geronimo.console.ajax.ProgressInfo; +import org.apache.geronimo.console.databasemanager.ManagementHelper; import org.apache.geronimo.console.util.PortletManager; import org.apache.geronimo.converter.DatabaseConversionStatus; import org.apache.geronimo.converter.JDBCPool; @@ -179,6 +180,7 @@ private static final String LOCAL = "LOCAL"; private static final String XA = "XA"; private static final String NONE = "NONE"; + private static final String[] ORDERED_PROPERTY_NAMES = { "property-DatabaseName", "property-CreateDatabase", "property-UserName", "property-Password" }; private PortletRequestDispatcher listView; private PortletRequestDispatcher editView; @@ -669,6 +671,7 @@ Object value = factory.getConfigProperty(cp.getName()); data.properties.put("property-" + cp.getName(), value == null ? null : value.toString()); } + data.sort(); } } catch (Exception e) { log.error("Unable to look up connection property", e); @@ -791,6 +794,7 @@ if (more) { data.loadPropertyNames(); } + data.sort(); renderRequest.setAttribute("ConfigParams", map); } editView.include(renderRequest, renderResponse); @@ -1304,7 +1308,7 @@ private String dbtype; private String user; private String password; - private Map properties = new HashMap(); // Configuration for non-Generic drivers + private Map properties = new LinkedHashMap(); // Configuration for non-Generic drivers private Map urlProperties = new HashMap(); // URL substitution for Generic drivers private Map propertyNames; //todo: store these in the ConfigParam instead private String driverClass; @@ -1370,7 +1374,7 @@ if (importSource != null && importSource.equals("")) importSource = null; transactionType = request.getParameter("transactionType"); if (transactionType != null && "".equals(transactionType)) { - if(dbtype.endsWith("XA")){ + if (dbtype != null && dbtype.endsWith("XA")) { transactionType = XA; } else { transactionType = LOCAL; @@ -1387,6 +1391,7 @@ propertyNames.put(key, getPropertyName(key)); } } + sort(); deployError = request.getParameter("deployError"); if (deployError != null && deployError.equals("")) deployError = null; } @@ -1461,6 +1466,22 @@ if (deployError != null) response.setRenderParameter("deployError", deployError); } + + public void sort() { + Map sortedProperties = new LinkedHashMap(); + + for (String propertyName : ORDERED_PROPERTY_NAMES) { + if (properties.containsKey(propertyName)) { + sortedProperties.put(propertyName, properties.get(propertyName)); + properties.remove(propertyName); + } + } + + sortedProperties.putAll(properties); + + properties = sortedProperties; + } + public String getName() { return name; } Modified: geronimo/server/branches/2.1/plugins/system-database/sysdb-portlets/src/main/webapp/WEB-INF/view/dbwizard/basicParams.jsp URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/plugins/system-database/sysdb-portlets/src/main/webapp/WEB-INF/view/dbwizard/basicParams.jsp?rev=751581&r1=751580&r2=751581&view=diff ============================================================================== --- geronimo/server/branches/2.1/plugins/system-database/sysdb-portlets/src/main/webapp/WEB-INF/view/dbwizard/basicParams.jsp (original) +++ geronimo/server/branches/2.1/plugins/system-database/sysdb-portlets/src/main/webapp/WEB-INF/view/dbwizard/basicParams.jsp Mon Mar 9 04:43:26 2009 @@ -95,7 +95,7 @@
:
- + @@ -104,11 +104,11 @@
:
- +
:
- + Modified: geronimo/server/branches/2.1/plugins/system-database/sysdb-portlets/src/main/webapp/WEB-INF/view/dbwizard/edit.jsp URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/plugins/system-database/sysdb-portlets/src/main/webapp/WEB-INF/view/dbwizard/edit.jsp?rev=751581&r1=751580&r2=751581&view=diff ============================================================================== --- geronimo/server/branches/2.1/plugins/system-database/sysdb-portlets/src/main/webapp/WEB-INF/view/dbwizard/edit.jsp (original) +++ geronimo/server/branches/2.1/plugins/system-database/sysdb-portlets/src/main/webapp/WEB-INF/view/dbwizard/edit.jsp Mon Mar 9 04:43:26 2009 @@ -222,7 +222,7 @@
:
- + @@ -231,11 +231,11 @@
:
- +
:
- +