geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vamsic...@apache.org
Subject svn commit: r477131 - in /geronimo/server/branches/1.2/applications/console/geronimo-console-standard/src/main: java/org/apache/geronimo/console/keystores/ webapp/WEB-INF/view/keystore/
Date Mon, 20 Nov 2006 10:14:02 GMT
Author: vamsic007
Date: Mon Nov 20 02:13:58 2006
New Revision: 477131

URL: http://svn.apache.org/viewvc?view=rev&rev=477131
Log:
GERONIMO-2236 keystore portlet - providing a null or incorrect password on edit unlock can
only be recovered with server recycle

Added:
    geronimo/server/branches/1.2/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/view/keystore/_header.jsp
  (with props)
Modified:
    geronimo/server/branches/1.2/applications/console/geronimo-console-standard/src/main/java/org/apache/geronimo/console/keystores/BaseKeystoreHandler.java
    geronimo/server/branches/1.2/applications/console/geronimo-console-standard/src/main/java/org/apache/geronimo/console/keystores/EditKeystoreHandler.java
    geronimo/server/branches/1.2/applications/console/geronimo-console-standard/src/main/java/org/apache/geronimo/console/keystores/ListHandler.java
    geronimo/server/branches/1.2/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/view/keystore/index.jsp
    geronimo/server/branches/1.2/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/view/keystore/unlockKeystore.jsp

Modified: geronimo/server/branches/1.2/applications/console/geronimo-console-standard/src/main/java/org/apache/geronimo/console/keystores/BaseKeystoreHandler.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/1.2/applications/console/geronimo-console-standard/src/main/java/org/apache/geronimo/console/keystores/BaseKeystoreHandler.java?view=diff&rev=477131&r1=477130&r2=477131
==============================================================================
--- geronimo/server/branches/1.2/applications/console/geronimo-console-standard/src/main/java/org/apache/geronimo/console/keystores/BaseKeystoreHandler.java
(original)
+++ geronimo/server/branches/1.2/applications/console/geronimo-console-standard/src/main/java/org/apache/geronimo/console/keystores/BaseKeystoreHandler.java
Mon Nov 20 02:13:58 2006
@@ -62,6 +62,11 @@
     protected static final String GENERATE_CSR = "generateCSR";
     protected static final String IMPORT_CA_REPLY = "importCAReply";
     protected static final String DELETE_ENTRY = "deleteEntry";
+
+    // Name of the attribute for error message to be displayed in a page
+    protected static final String ERROR_MSG = "errorMsg";
+    // Name of the attribute for information message to be displayed in a page
+    protected static final String INFO_MSG = "infoMsg";
     
 
     protected BaseKeystoreHandler(String mode, String viewName) {

Modified: geronimo/server/branches/1.2/applications/console/geronimo-console-standard/src/main/java/org/apache/geronimo/console/keystores/EditKeystoreHandler.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/1.2/applications/console/geronimo-console-standard/src/main/java/org/apache/geronimo/console/keystores/EditKeystoreHandler.java?view=diff&rev=477131&r1=477130&r2=477131
==============================================================================
--- geronimo/server/branches/1.2/applications/console/geronimo-console-standard/src/main/java/org/apache/geronimo/console/keystores/EditKeystoreHandler.java
(original)
+++ geronimo/server/branches/1.2/applications/console/geronimo-console-standard/src/main/java/org/apache/geronimo/console/keystores/EditKeystoreHandler.java
Mon Nov 20 02:13:58 2006
@@ -16,6 +16,8 @@
  */
 package org.apache.geronimo.console.keystores;
 
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 import org.apache.geronimo.console.MultiPageModel;
 import org.apache.geronimo.management.geronimo.KeystoreException;
 
@@ -32,6 +34,7 @@
  * @version $Rev$ $Date$
  */
 public class EditKeystoreHandler extends BaseKeystoreHandler {
+    private final static Log log = LogFactory.getLog(EditKeystoreHandler.class);
     public EditKeystoreHandler() {
         super(UNLOCK_KEYSTORE_FOR_EDITING, "/WEB-INF/view/keystore/unlockKeystore.jsp");
     }
@@ -45,6 +48,11 @@
     }
 
     public void renderView(RenderRequest request, RenderResponse response, MultiPageModel
model) throws PortletException, IOException {
+        String[] params = {ERROR_MSG, INFO_MSG};
+        for(int i = 0; i < params.length; ++i) {
+            String value = request.getParameter(params[i]);
+            if(value != null) request.setAttribute(params[i], value);
+        }
         request.setAttribute("keystore", request.getParameter("keystore"));
         request.setAttribute("mode", "unlockEdit");
     }
@@ -63,8 +71,11 @@
         try {
             data.unlockEdit(storePass);
         } catch (KeystoreException e) {
-            throw new PortletException(e);
+            response.setRenderParameter(ERROR_MSG, "Unable to unlock keystore "+keystore+"
for editing. "+e.toString());
+            log.error("Unable to unlock keystore "+keystore+" for editing.", e);
+            return getMode()+BEFORE_ACTION;
         }
+        response.setRenderParameter(INFO_MSG, "Keystore "+keystore+" successfully unlocked
for editing.");
         return LIST_MODE+BEFORE_ACTION;
     }
 }

Modified: geronimo/server/branches/1.2/applications/console/geronimo-console-standard/src/main/java/org/apache/geronimo/console/keystores/ListHandler.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/1.2/applications/console/geronimo-console-standard/src/main/java/org/apache/geronimo/console/keystores/ListHandler.java?view=diff&rev=477131&r1=477130&r2=477131
==============================================================================
--- geronimo/server/branches/1.2/applications/console/geronimo-console-standard/src/main/java/org/apache/geronimo/console/keystores/ListHandler.java
(original)
+++ geronimo/server/branches/1.2/applications/console/geronimo-console-standard/src/main/java/org/apache/geronimo/console/keystores/ListHandler.java
Mon Nov 20 02:13:58 2006
@@ -49,6 +49,11 @@
     }
 
     public void renderView(RenderRequest request, RenderResponse response, MultiPageModel
model) throws PortletException, IOException {
+        String[] params = {ERROR_MSG, INFO_MSG};
+        for(int i = 0; i < params.length; ++i) {
+            String value = request.getParameter(params[i]);
+            if(value != null) request.setAttribute(params[i], value);
+        }
         KeystoreManager manager = PortletManager.getCurrentServer(request).getKeystoreManager();
         KeystoreInstance[] keystores = manager.getKeystores();
         PortletSession session = request.getPortletSession(true);

Added: geronimo/server/branches/1.2/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/view/keystore/_header.jsp
URL: http://svn.apache.org/viewvc/geronimo/server/branches/1.2/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/view/keystore/_header.jsp?view=auto&rev=477131
==============================================================================
--- geronimo/server/branches/1.2/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/view/keystore/_header.jsp
(added)
+++ geronimo/server/branches/1.2/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/view/keystore/_header.jsp
Mon Nov 20 02:13:58 2006
@@ -0,0 +1,28 @@
+<%--
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+--%>
+
+<%-- $Rev$ $Date$ --%>
+
+<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
+<c:if test="${!empty(infoMsg)}">
+<p><font color="blue"><b>${infoMsg}</b></font></p>
+</c:if>
+
+<c:if test="${!empty(errorMsg)}">
+<p><font color="red"><b>Error: ${errorMsg}</b></font></p>
+</c:if>

Propchange: geronimo/server/branches/1.2/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/view/keystore/_header.jsp
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/branches/1.2/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/view/keystore/_header.jsp
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/branches/1.2/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/view/keystore/_header.jsp
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: geronimo/server/branches/1.2/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/view/keystore/index.jsp
URL: http://svn.apache.org/viewvc/geronimo/server/branches/1.2/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/view/keystore/index.jsp?view=diff&rev=477131&r1=477130&r2=477131
==============================================================================
--- geronimo/server/branches/1.2/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/view/keystore/index.jsp
(original)
+++ geronimo/server/branches/1.2/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/view/keystore/index.jsp
Mon Nov 20 02:13:58 2006
@@ -14,6 +14,9 @@
    See the License for the specific language governing permissions and
    limitations under the License.
 --%>
+
+<%-- $Rev$ $Date$ --%>
+
 <%@ page import="org.apache.geronimo.console.util.PortletManager"%>
 <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
 <%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
@@ -21,6 +24,8 @@
 <portlet:defineObjects/>
 <p>This tool walks you through the process of configuring keystores to use with
   SSL connectors (for the web container, etc.).</p>
+
+<jsp:include page="_header.jsp" />
 
 <c:choose>
   <c:when test="${empty(keystores)}"><p><i>There are no keystores defined</i></p></c:when>

Modified: geronimo/server/branches/1.2/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/view/keystore/unlockKeystore.jsp
URL: http://svn.apache.org/viewvc/geronimo/server/branches/1.2/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/view/keystore/unlockKeystore.jsp?view=diff&rev=477131&r1=477130&r2=477131
==============================================================================
--- geronimo/server/branches/1.2/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/view/keystore/unlockKeystore.jsp
(original)
+++ geronimo/server/branches/1.2/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/view/keystore/unlockKeystore.jsp
Mon Nov 20 02:13:58 2006
@@ -14,10 +14,15 @@
    See the License for the specific language governing permissions and
    limitations under the License.
 --%>
+
+<%-- $Rev$ $Date$ --%>
+
 <%@ page import="org.apache.geronimo.console.util.PortletManager"%>
 <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
 <%@ taglib uri="http://java.sun.com/portlet" prefix="portlet"%>
 <portlet:defineObjects/>
+
+<jsp:include page="_header.jsp" />
 
 <form name="<portlet:namespace/>KeystoreForm" action="<portlet:actionURL/>">
     <input type="hidden" name="keystore" value="${keystore}" />



Mime
View raw message