geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dwo...@apache.org
Subject svn commit: r732398 [1/3] - in /geronimo/server/trunk/plugins/console: console-base-portlets/src/main/java/org/apache/geronimo/console/ca/ console-base-portlets/src/main/java/org/apache/geronimo/console/configmanager/ console-base-portlets/src/main/jav...
Date Wed, 07 Jan 2009 17:03:43 GMT
Author: dwoods
Date: Wed Jan  7 09:03:41 2009
New Revision: 732398

URL: http://svn.apache.org/viewvc?rev=732398&view=rev
Log:
GERONIMO-4484 Extraction, localization and display of messages generated in portlets.  Applied common-message-base.patch and common-message-core.patch from Gang Yin, with some minor updates.

Added:
    geronimo/server/trunk/plugins/console/console-base-portlets/src/main/webapp/WEB-INF/CommonMsg.tld   (with props)
    geronimo/server/trunk/plugins/console/console-core/src/main/java/org/apache/geronimo/console/message/
    geronimo/server/trunk/plugins/console/console-core/src/main/java/org/apache/geronimo/console/message/CommonMessage.java   (with props)
    geronimo/server/trunk/plugins/console/console-core/src/main/java/org/apache/geronimo/console/message/CommonMessageTag.java   (with props)
    geronimo/server/trunk/plugins/console/console-core/src/main/java/org/apache/geronimo/console/message/ErrorMessage.java   (with props)
    geronimo/server/trunk/plugins/console/console-core/src/main/java/org/apache/geronimo/console/message/InfoMessage.java   (with props)
    geronimo/server/trunk/plugins/console/console-core/src/main/java/org/apache/geronimo/console/message/WarnMessage.java   (with props)
    geronimo/server/trunk/plugins/console/console-portal-driver/src/main/webapp/CommonMsg.css   (with props)
    geronimo/server/trunk/plugins/console/console-portal-driver/src/main/webapp/CommonMsg.js   (with props)
Modified:
    geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/ca/BaseCAHandler.java
    geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/ca/CADetailsHandler.java
    geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/ca/CertReqDetailsHandler.java
    geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/ca/CertificationAuthorityPortlet.java
    geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/ca/ConfirmCAHandler.java
    geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/ca/ConfirmCertReqHandler.java
    geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/ca/ConfirmClientCertHandler.java
    geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/ca/IntroHandler.java
    geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/ca/ListRequestsIssueHandler.java
    geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/ca/ListRequestsVerifyHandler.java
    geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/ca/ProcessCSRHandler.java
    geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/ca/SetupCAHandler.java
    geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/ca/UnlockCAHandler.java
    geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/ca/ViewCertificateHandler.java
    geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/configmanager/ConfigManagerPortlet.java
    geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/keystores/BaseKeystoreHandler.java
    geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/keystores/CertificateDetailsHandler.java
    geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/keystores/ChangePasswordHandler.java
    geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/keystores/EditKeystoreHandler.java
    geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/keystores/KeystoresPortlet.java
    geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/keystores/ListHandler.java
    geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/keystores/LockEditKeystoreHandler.java
    geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/keystores/LockKeystoreHandler.java
    geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/keystores/UnlockKeyHandler.java
    geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/keystores/UnlockKeystoreHandler.java
    geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/keystores/ViewKeystoreHandler.java
    geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/securitymanager/SEGroupsPortlet.java
    geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/securitymanager/SEUsersPortlet.java
    geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/servermanager/ServerManagerPortlet.java
    geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/webmanager/WebManagerPortlet.java
    geronimo/server/trunk/plugins/console/console-base-portlets/src/main/resources/portletinfo.properties
    geronimo/server/trunk/plugins/console/console-base-portlets/src/main/resources/portletinfo_zh.properties
    geronimo/server/trunk/plugins/console/console-base-portlets/src/main/webapp/WEB-INF/portlet.xml
    geronimo/server/trunk/plugins/console/console-base-portlets/src/main/webapp/WEB-INF/view/ca/_header.jsp
    geronimo/server/trunk/plugins/console/console-base-portlets/src/main/webapp/WEB-INF/view/ca/caDetails.jsp
    geronimo/server/trunk/plugins/console/console-base-portlets/src/main/webapp/WEB-INF/view/ca/certReqDetails.jsp
    geronimo/server/trunk/plugins/console/console-base-portlets/src/main/webapp/WEB-INF/view/ca/confirmCA.jsp
    geronimo/server/trunk/plugins/console/console-base-portlets/src/main/webapp/WEB-INF/view/ca/confirmCertReq.jsp
    geronimo/server/trunk/plugins/console/console-base-portlets/src/main/webapp/WEB-INF/view/ca/confirmClientCert.jsp
    geronimo/server/trunk/plugins/console/console-base-portlets/src/main/webapp/WEB-INF/view/ca/index.jsp
    geronimo/server/trunk/plugins/console/console-base-portlets/src/main/webapp/WEB-INF/view/ca/listRequestsIssue.jsp
    geronimo/server/trunk/plugins/console/console-base-portlets/src/main/webapp/WEB-INF/view/ca/listRequestsVerify.jsp
    geronimo/server/trunk/plugins/console/console-base-portlets/src/main/webapp/WEB-INF/view/ca/processCSR.jsp
    geronimo/server/trunk/plugins/console/console-base-portlets/src/main/webapp/WEB-INF/view/ca/setupCA.jsp
    geronimo/server/trunk/plugins/console/console-base-portlets/src/main/webapp/WEB-INF/view/ca/unlockCA.jsp
    geronimo/server/trunk/plugins/console/console-base-portlets/src/main/webapp/WEB-INF/view/ca/viewCertificate.jsp
    geronimo/server/trunk/plugins/console/console-base-portlets/src/main/webapp/WEB-INF/view/configmanager/normal.jsp
    geronimo/server/trunk/plugins/console/console-base-portlets/src/main/webapp/WEB-INF/view/keystore/_header.jsp
    geronimo/server/trunk/plugins/console/console-base-portlets/src/main/webapp/WEB-INF/view/keystore/certificateDetails.jsp
    geronimo/server/trunk/plugins/console/console-base-portlets/src/main/webapp/WEB-INF/view/keystore/changePassword.jsp
    geronimo/server/trunk/plugins/console/console-base-portlets/src/main/webapp/WEB-INF/view/keystore/index.jsp
    geronimo/server/trunk/plugins/console/console-base-portlets/src/main/webapp/WEB-INF/view/keystore/unlockKey.jsp
    geronimo/server/trunk/plugins/console/console-base-portlets/src/main/webapp/WEB-INF/view/keystore/unlockKeystore.jsp
    geronimo/server/trunk/plugins/console/console-base-portlets/src/main/webapp/WEB-INF/view/keystore/viewKeystore.jsp
    geronimo/server/trunk/plugins/console/console-base-portlets/src/main/webapp/WEB-INF/view/securityrealmmanager/se/groups/maximized.jsp
    geronimo/server/trunk/plugins/console/console-base-portlets/src/main/webapp/WEB-INF/view/securityrealmmanager/se/users/maximized.jsp
    geronimo/server/trunk/plugins/console/console-base-portlets/src/main/webapp/WEB-INF/view/servermanager/normal.jsp
    geronimo/server/trunk/plugins/console/console-base-portlets/src/main/webapp/WEB-INF/view/webmanager/normal.jsp
    geronimo/server/trunk/plugins/console/console-core/pom.xml
    geronimo/server/trunk/plugins/console/console-core/src/main/java/org/apache/geronimo/console/BasePortlet.java
    geronimo/server/trunk/plugins/console/console-core/src/main/java/org/apache/geronimo/console/MultiPageAbstractHandler.java
    geronimo/server/trunk/plugins/console/console-jetty/src/main/history/dependencies.xml
    geronimo/server/trunk/plugins/console/console-portal-driver/src/main/webapp/WEB-INF/themes/head.jsp
    geronimo/server/trunk/plugins/console/console-portal-driver/src/main/webapp/loginerror.jsp
    geronimo/server/trunk/plugins/console/console-tomcat/src/main/history/dependencies.xml

Modified: geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/ca/BaseCAHandler.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/ca/BaseCAHandler.java?rev=732398&r1=732397&r2=732398&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/ca/BaseCAHandler.java (original)
+++ geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/ca/BaseCAHandler.java Wed Jan  7 09:03:41 2009
@@ -23,6 +23,7 @@
 
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
+import org.apache.geronimo.console.BasePortlet;
 import org.apache.geronimo.console.MultiPageAbstractHandler;
 import org.apache.geronimo.console.MultiPageModel;
 import org.apache.geronimo.console.util.PortletManager;
@@ -63,11 +64,6 @@
     // Certificate request store directory
     protected static final String defaultCSRStoreDir = "var/security/ca/requests";
 
-    // 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";
-
     /**
      * Constructor
      */
@@ -75,6 +71,10 @@
         super(mode, viewName);
     }
 
+    protected BaseCAHandler(String mode, String viewName, BasePortlet portlet) {
+        super(mode, viewName, portlet);
+    }
+
     public final static class CAModel implements MultiPageModel {
         public CAModel(PortletRequest request) {
         }

Modified: geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/ca/CADetailsHandler.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/ca/CADetailsHandler.java?rev=732398&r1=732397&r2=732398&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/ca/CADetailsHandler.java (original)
+++ geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/ca/CADetailsHandler.java Wed Jan  7 09:03:41 2009
@@ -32,6 +32,7 @@
 
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
+import org.apache.geronimo.console.BasePortlet;
 import org.apache.geronimo.console.MultiPageModel;
 import org.apache.geronimo.management.geronimo.CertificationAuthority;
 import org.apache.geronimo.crypto.CaUtils;
@@ -45,25 +46,15 @@
 public class CADetailsHandler extends BaseCAHandler {
     private static final Logger log = LoggerFactory.getLogger(CADetailsHandler.class);
     
-    public CADetailsHandler() {
-        super(CADETAILS_MODE, "/WEB-INF/view/ca/caDetails.jsp");
+    public CADetailsHandler(BasePortlet portlet) {
+        super(CADETAILS_MODE, "/WEB-INF/view/ca/caDetails.jsp", portlet);
     }
 
     public String actionBeforeView(ActionRequest request, ActionResponse 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) response.setRenderParameter(params[i], value);
-        }
         return getMode();
     }
 
     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);
-        }
         try {
             CertificationAuthority ca = getCertificationAuthority(request);
             if(ca == null) {
@@ -90,7 +81,7 @@
             fingerPrints.put("SHA1", CertificateUtil.generateFingerprint(caCert, "SHA1"));
             request.setAttribute("fingerPrints", fingerPrints);
         } catch (Exception e) {
-            request.setAttribute(ERROR_MSG, e.toString());
+            portlet.addErrorMessage(request, portlet.getLocalizedString("errorMsg15", request), e.getMessage());
             log.error("Errors while trying to view CA Details.", e);
         }
     }

Modified: geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/ca/CertReqDetailsHandler.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/ca/CertReqDetailsHandler.java?rev=732398&r1=732397&r2=732398&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/ca/CertReqDetailsHandler.java (original)
+++ geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/ca/CertReqDetailsHandler.java Wed Jan  7 09:03:41 2009
@@ -33,6 +33,7 @@
 
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
+import org.apache.geronimo.console.BasePortlet;
 import org.apache.geronimo.console.MultiPageModel;
 import org.apache.geronimo.management.geronimo.CertificationAuthority;
 
@@ -44,12 +45,12 @@
 public class CertReqDetailsHandler extends BaseCAHandler {
     private static final Logger log = LoggerFactory.getLogger(CertReqDetailsHandler.class);
     
-    public CertReqDetailsHandler() {
-        super(CERT_REQ_DETAILS_MODE, "/WEB-INF/view/ca/certReqDetails.jsp");
+    public CertReqDetailsHandler(BasePortlet portlet) {
+        super(CERT_REQ_DETAILS_MODE, "/WEB-INF/view/ca/certReqDetails.jsp", portlet);
     }
 
     public String actionBeforeView(ActionRequest request, ActionResponse response, MultiPageModel model) throws PortletException, IOException {
-        String[] params = {ERROR_MSG, INFO_MSG, "algorithm", "sNo", "validFrom", "validTo", "pkcs10certreq", "subject", "publickey", "requestId"};
+        String[] params = {"algorithm", "sNo", "validFrom", "validTo", "pkcs10certreq", "subject", "publickey", "requestId"};
         for(int i = 0; i < params.length; ++i) {
             String value = request.getParameter(params[i]);
             if(value != null) response.setRenderParameter(params[i], value);
@@ -63,14 +64,14 @@
                 response.setRenderParameter("sNo", sNo);
             } catch (Exception e) {
                 log.error("Unable to get next serial number from CA.", e);
-                response.setRenderParameter(ERROR_MSG, e.toString());
+                portlet.addErrorMessage(request, portlet.getLocalizedString("errorMsg21", request), e.getMessage());
             }
         }
         return getMode();
     }
 
     public void renderView(RenderRequest request, RenderResponse response, MultiPageModel model) throws PortletException, IOException {
-        String[] params = {ERROR_MSG, INFO_MSG, "subject", "publickey", "sNo", "validFrom", "validTo", "algorithm", "pkcs10certreq", "requestId"};
+        String[] params = {"subject", "publickey", "sNo", "validFrom", "validTo", "algorithm", "pkcs10certreq", "requestId"};
         for(int i = 0; i < params.length; ++i) {
             Object value = request.getParameter(params[i]);
             if(value != null) request.setAttribute(params[i], value);
@@ -78,8 +79,6 @@
     }
 
     public String actionAfterView(ActionRequest request, ActionResponse response, MultiPageModel model) throws PortletException, IOException {
-        String errorMsg = null;
-
         try {
             // Validate the Serial Number
             String sNo = request.getParameter("sNo");
@@ -116,11 +115,9 @@
             // Go to client certificate confirmation page
             return CONFIRM_CLIENT_CERT_MODE+BEFORE_ACTION;
         } catch(Exception e) {
-            errorMsg = e.toString();
+            portlet.addErrorMessage(request, portlet.getLocalizedString("errorMsg22", request), e.getMessage());
             log.error("Errors in user input while processing a CSR.", e);
         }
-        
-        if(errorMsg != null) response.setRenderParameter(ERROR_MSG, errorMsg);
         return getMode()+BEFORE_ACTION;
     }
 }

Modified: geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/ca/CertificationAuthorityPortlet.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/ca/CertificationAuthorityPortlet.java?rev=732398&r1=732397&r2=732398&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/ca/CertificationAuthorityPortlet.java (original)
+++ geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/ca/CertificationAuthorityPortlet.java Wed Jan  7 09:03:41 2009
@@ -32,18 +32,18 @@
 public class CertificationAuthorityPortlet extends MultiPagePortlet {
     public void init(PortletConfig config) throws PortletException {
         super.init(config);
-        addHelper(new IntroHandler(), config);
-        addHelper(new SetupCAHandler(), config);
-        addHelper(new ConfirmCAHandler(), config);
-        addHelper(new CADetailsHandler(), config);
-        addHelper(new UnlockCAHandler(), config);
-        addHelper(new ProcessCSRHandler(), config);
-        addHelper(new CertReqDetailsHandler(), config);
-        addHelper(new ConfirmClientCertHandler(), config);
-        addHelper(new ViewCertificateHandler(), config);
-        addHelper(new ListRequestsIssueHandler(), config);
-        addHelper(new ListRequestsVerifyHandler(), config);
-        addHelper(new ConfirmCertReqHandler(), config);
+        addHelper(new IntroHandler(this), config);
+        addHelper(new SetupCAHandler(this), config);
+        addHelper(new ConfirmCAHandler(this), config);
+        addHelper(new CADetailsHandler(this), config);
+        addHelper(new UnlockCAHandler(this), config);
+        addHelper(new ProcessCSRHandler(this), config);
+        addHelper(new CertReqDetailsHandler(this), config);
+        addHelper(new ConfirmClientCertHandler(this), config);
+        addHelper(new ViewCertificateHandler(this), config);
+        addHelper(new ListRequestsIssueHandler(this), config);
+        addHelper(new ListRequestsVerifyHandler(this), config);
+        addHelper(new ConfirmCertReqHandler(this), config);
     }
 
     protected String getModelJSPVariableName() {

Modified: geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/ca/ConfirmCAHandler.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/ca/ConfirmCAHandler.java?rev=732398&r1=732397&r2=732398&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/ca/ConfirmCAHandler.java (original)
+++ geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/ca/ConfirmCAHandler.java Wed Jan  7 09:03:41 2009
@@ -21,6 +21,7 @@
 import java.math.BigInteger;
 import java.net.URI;
 import java.text.DateFormat;
+import java.text.MessageFormat;
 import java.text.SimpleDateFormat;
 import java.util.Date;
 
@@ -33,6 +34,7 @@
 
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
+import org.apache.geronimo.console.BasePortlet;
 import org.apache.geronimo.console.MultiPageModel;
 import org.apache.geronimo.console.util.PortletManager;
 import org.apache.geronimo.gbean.AbstractName;
@@ -57,12 +59,12 @@
 public class ConfirmCAHandler extends BaseCAHandler {
     private static final Logger log = LoggerFactory.getLogger(ConfirmCAHandler.class);
     
-    public ConfirmCAHandler() {
-        super(CONFIRM_CA_MODE, "/WEB-INF/view/ca/confirmCA.jsp");
+    public ConfirmCAHandler(BasePortlet portlet) {
+        super(CONFIRM_CA_MODE, "/WEB-INF/view/ca/confirmCA.jsp", portlet);
     }
 
     public String actionBeforeView(ActionRequest request, ActionResponse response, MultiPageModel model) throws PortletException, IOException {
-        String[] params = {ERROR_MSG, INFO_MSG, "caCN", "caOU", "caO", "caL", "caST", "caC", "alias", "keyAlgorithm", "keySize", "algorithm", "validFrom", "validTo", "sNo", "password"};
+        String[] params = {"caCN", "caOU", "caO", "caL", "caST", "caC", "alias", "keyAlgorithm", "keySize", "algorithm", "validFrom", "validTo", "sNo", "password"};
         for(int i = 0; i < params.length; ++i) {
             String value = request.getParameter(params[i]);
             if(value != null) response.setRenderParameter(params[i], value);
@@ -71,7 +73,7 @@
     }
 
     public void renderView(RenderRequest request, RenderResponse response, MultiPageModel model) throws PortletException, IOException {
-        String[] params = {ERROR_MSG, INFO_MSG, "caCN", "caOU", "caO", "caL", "caST", "caC", "alias", "keyAlgorithm", "keySize", "algorithm", "validFrom", "validTo", "sNo", "password"};
+        String[] params = {"caCN", "caOU", "caO", "caL", "caST", "caC", "alias", "keyAlgorithm", "keySize", "algorithm", "validFrom", "validTo", "sNo", "password"};
         for(int i = 0; i < params.length; ++i) {
             String value = request.getParameter(params[i]);
             if(value != null) request.setAttribute(params[i], value);
@@ -93,7 +95,6 @@
         String validFrom = request.getParameter("validFrom");
         String validTo = request.getParameter("validTo");
         String sNo = request.getParameter("sNo");
-        String errorMsg = null;
         
         try {
             // Generate keypair
@@ -129,17 +130,16 @@
             
             // CA Setup is succeessful.
             // Load a page to show CA details.
-            response.setRenderParameter(INFO_MSG, "CA Setup is successful!");
+            portlet.addInfoMessage(request, portlet.getLocalizedString("infoMsg15", request));
             log.info("CA Setup is successful.");
             
             return CADETAILS_MODE+BEFORE_ACTION;
         } catch(Exception e) {
-            errorMsg = e.toString();
+            // An error occurred.  Go back to CA details entry page so that user can correct the errors.
+            portlet.addErrorMessage(request, portlet.getLocalizedString("infoMsg07", request), e.getMessage());
             log.error("Errors in CA Setup process.", e);
         }
-        
-        // An error occurred.  Go back to CA details entry page so that user can correct the errors.
-        if(errorMsg != null) response.setRenderParameter(ERROR_MSG, errorMsg);
+
         return SETUPCA_MODE+BEFORE_ACTION;
     }
     

Modified: geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/ca/ConfirmCertReqHandler.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/ca/ConfirmCertReqHandler.java?rev=732398&r1=732397&r2=732398&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/ca/ConfirmCertReqHandler.java (original)
+++ geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/ca/ConfirmCertReqHandler.java Wed Jan  7 09:03:41 2009
@@ -18,6 +18,7 @@
 package org.apache.geronimo.console.ca;
 
 import java.io.IOException;
+import java.text.MessageFormat;
 
 import javax.portlet.ActionRequest;
 import javax.portlet.ActionResponse;
@@ -25,6 +26,7 @@
 import javax.portlet.RenderRequest;
 import javax.portlet.RenderResponse;
 
+import org.apache.geronimo.console.BasePortlet;
 import org.apache.geronimo.console.MultiPageModel;
 
 /**
@@ -33,12 +35,12 @@
  * @version $Rev$ $Date$
  */
 public class ConfirmCertReqHandler extends BaseCAHandler {
-    public ConfirmCertReqHandler() {
-        super(CONFIRM_CERT_REQ_MODE, "/WEB-INF/view/ca/confirmCertReq.jsp");
+    public ConfirmCertReqHandler(BasePortlet portlet) {
+        super(CONFIRM_CERT_REQ_MODE, "/WEB-INF/view/ca/confirmCertReq.jsp", portlet);
     }
 
     public String actionBeforeView(ActionRequest request, ActionResponse response, MultiPageModel model) throws PortletException, IOException {
-        String[] params = {ERROR_MSG, INFO_MSG, "subject", "publickey", "requestId"};
+        String[] params = {"subject", "publickey", "requestId"};
         for(int i = 0; i < params.length; ++i) {
             String value = request.getParameter(params[i]);
             if(value != null) response.setRenderParameter(params[i], value);
@@ -47,7 +49,7 @@
     }
 
     public void renderView(RenderRequest request, RenderResponse response, MultiPageModel model) throws PortletException, IOException {
-        String[] params = {ERROR_MSG, INFO_MSG, "subject", "publickey", "requestId"};
+        String[] params = {"subject", "publickey", "requestId"};
         for(int i = 0; i < params.length; ++i) {
             String value = request.getParameter(params[i]);
             if(value != null) request.setAttribute(params[i], value);
@@ -60,10 +62,10 @@
         String reject = request.getParameter("reject");
         if(approve != null) {
             getCertificateRequestStore(request).setRequestVerified(requestId);
-            response.setRenderParameter(INFO_MSG, "Approved CSR. id = "+requestId);
+            portlet.addInfoMessage(request, MessageFormat.format(portlet.getLocalizedString("infoMsg16", request), requestId));
         } else if(reject != null) {
             getCertificateRequestStore(request).deleteRequest(requestId);
-            response.setRenderParameter(INFO_MSG, "Rejected and deleted CSR. id = "+requestId);
+            portlet.addInfoMessage(request, MessageFormat.format(portlet.getLocalizedString("infoMsg17", request), requestId));
         }
         return LIST_REQUESTS_VERIFY_MODE+BEFORE_ACTION;
     }

Modified: geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/ca/ConfirmClientCertHandler.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/ca/ConfirmClientCertHandler.java?rev=732398&r1=732397&r2=732398&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/ca/ConfirmClientCertHandler.java (original)
+++ geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/ca/ConfirmClientCertHandler.java Wed Jan  7 09:03:41 2009
@@ -22,6 +22,7 @@
 import java.math.BigInteger;
 import java.security.PublicKey;
 import java.text.DateFormat;
+import java.text.MessageFormat;
 import java.text.SimpleDateFormat;
 import java.util.Date;
 import java.util.Map;
@@ -36,6 +37,7 @@
 
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
+import org.apache.geronimo.console.BasePortlet;
 import org.apache.geronimo.console.MultiPageModel;
 import org.apache.geronimo.management.geronimo.CertificationAuthority;
 import org.apache.geronimo.crypto.CaUtils;
@@ -49,12 +51,12 @@
 public class ConfirmClientCertHandler extends BaseCAHandler {
     private static final Logger log = LoggerFactory.getLogger(ConfirmClientCertHandler.class);
     
-    public ConfirmClientCertHandler() {
-        super(CONFIRM_CLIENT_CERT_MODE, "/WEB-INF/view/ca/confirmClientCert.jsp");
+    public ConfirmClientCertHandler(BasePortlet portlet) {
+        super(CONFIRM_CLIENT_CERT_MODE, "/WEB-INF/view/ca/confirmClientCert.jsp", portlet);
     }
 
     public String actionBeforeView(ActionRequest request, ActionResponse response, MultiPageModel model) throws PortletException, IOException {
-        String[] params = {ERROR_MSG, INFO_MSG, "subject", "publickey", "algorithm", "validFrom", "validTo", "sNo", "pkcs10certreq", "requestId"};
+        String[] params = {"subject", "publickey", "algorithm", "validFrom", "validTo", "sNo", "pkcs10certreq", "requestId"};
         for(int i = 0; i < params.length; ++i) {
             String value = request.getParameter(params[i]);
             if(value != null) response.setRenderParameter(params[i], value);
@@ -63,7 +65,7 @@
     }
 
     public void renderView(RenderRequest request, RenderResponse response, MultiPageModel model) throws PortletException, IOException {
-        String[] params = {ERROR_MSG, INFO_MSG, "subject", "publickey", "algorithm", "validFrom", "validTo", "sNo", "pkcs10certreq", "requestId"};
+        String[] params = {"subject", "publickey", "algorithm", "validFrom", "validTo", "sNo", "pkcs10certreq", "requestId"};
         for(int i = 0; i < params.length; ++i) {
             String value = request.getParameter(params[i]);
             if(value != null) request.setAttribute(params[i], value);
@@ -71,7 +73,6 @@
     }
 
     public String actionAfterView(ActionRequest request, ActionResponse response, MultiPageModel model) throws PortletException, IOException {
-        String errorMsg = null;
         try {
             CertificationAuthority ca = getCertificationAuthority(request);
             if(ca == null) {
@@ -83,8 +84,7 @@
                 // This may happen if the user clicks on "Issue Certificate" button a second time
                 log.warn("Second request to issue certificate with serial number'"+sNo+"'.  A certificate has already been issued.");
                 response.setRenderParameter("sNo", sNo.toString());
-                response.setRenderParameter(INFO_MSG, "A certificate with the serial number '"+sNo+"' has already been issued. "
-                        +"You may be seeing this message since you have clicked on 'Issue Certificate' button a second time.");
+                portlet.addWarningMessage(request, MessageFormat.format(portlet.getLocalizedString("warnMsg06", request), sNo));
                 return VIEW_CERT_MODE;
             }
 
@@ -154,16 +154,14 @@
 
             // Set the serial number and forward to view certificate page
             response.setRenderParameter("sNo", sNo.toString());
-            response.setRenderParameter(INFO_MSG, "Certificate Issued successfully. This Certificate details can also be viewed using the serial number '"
-                    +sNo+"' with the 'View Issued Certificate' link provided in the CA home screen.");
+            portlet.addInfoMessage(request, MessageFormat.format(portlet.getLocalizedString("infoMsg18", request), sNo));
             log.info("Certificate with serial number '"+sNo+"' issued to "+subject);
             return VIEW_CERT_MODE;
         } catch(Exception e) {
-            errorMsg = e.toString();
+            // An error occurred.  Go back to previous screen to let the user correct the errors.
+            portlet.addErrorMessage(request, portlet.getLocalizedString("errorMsg23", request), e.getMessage());
             log.error("Errors in issuing certificate.", e);
         }
-        // An error occurred.  Go back to previous screen to let the user correct the errors.
-        response.setRenderParameter(ERROR_MSG, errorMsg);
         return CERT_REQ_DETAILS_MODE+BEFORE_ACTION;
     }
 }

Modified: geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/ca/IntroHandler.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/ca/IntroHandler.java?rev=732398&r1=732397&r2=732398&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/ca/IntroHandler.java (original)
+++ geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/ca/IntroHandler.java Wed Jan  7 09:03:41 2009
@@ -27,6 +27,7 @@
 
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
+import org.apache.geronimo.console.BasePortlet;
 import org.apache.geronimo.console.MultiPageModel;
 import org.apache.geronimo.management.geronimo.CertificationAuthority;
 
@@ -38,26 +39,15 @@
 public class IntroHandler extends BaseCAHandler {
     private static final Logger log = LoggerFactory.getLogger(IntroHandler.class);
     
-    public IntroHandler() {
-        super(INDEX_MODE, "/WEB-INF/view/ca/index.jsp");
+    public IntroHandler(BasePortlet portlet) {
+        super(INDEX_MODE, "/WEB-INF/view/ca/index.jsp", portlet);
     }
 
     public String actionBeforeView(ActionRequest request, ActionResponse response, MultiPageModel model) throws PortletException, IOException {
-        String[] params = new String[] {ERROR_MSG, INFO_MSG};
-        for(int i = 0; i < params.length; ++i) {
-            String value = request.getParameter(params[i]);
-            if(value != null) response.setRenderParameter(params[i], value);
-        }
         return getMode();
     }
 
-    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);
-        }
-        
+    public void renderView(RenderRequest request, RenderResponse response, MultiPageModel model) throws PortletException, IOException {        
         CertificationAuthority ca = getCertificationAuthority(request);
         if(ca == null) {
             // CA GBean is not running or the CA has not been initialized.
@@ -73,20 +63,20 @@
             CertificationAuthority ca = getCertificationAuthority(request);
             if(ca == null) {
                 log.warn("CA is not running or CA may not have been initialized.  Unable to lock CA.");
-                response.setRenderParameter(ERROR_MSG, "CA is not running or CA may not have been initialized.  Unable to lock CA.");
+                portlet.addWarningMessage(request, portlet.getLocalizedString("warnMsg05", request));
             } else {
                 ca.lock();
                 log.info("CA is now locked.");
-                response.setRenderParameter(INFO_MSG, "CA has been locked!");
+                portlet.addInfoMessage(request, portlet.getLocalizedString("infoMsg12", request));
             }
         } else if(request.getParameter("publish") != null) {
             CertificationAuthority ca = getCertificationAuthority(request);
             try {
                 getCertificateStore(request).storeCACertificate(ca.getCertificate());
-                response.setRenderParameter(INFO_MSG, "CA's certificate published to Certificate Store");
+                portlet.addInfoMessage(request, portlet.getLocalizedString("infoMsg13", request));
             } catch (Exception e) {
                 log.error("Error while publishing CA's certificate to Certificate Store", e);
-                response.setRenderParameter(ERROR_MSG, "Error while publishing CA's certificate to Certificate Store. "+e);
+                portlet.addErrorMessage(request, portlet.getLocalizedString("errorMsg13", request), e.getMessage());
             }
         }
         return getMode()+BEFORE_ACTION;

Modified: geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/ca/ListRequestsIssueHandler.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/ca/ListRequestsIssueHandler.java?rev=732398&r1=732397&r2=732398&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/ca/ListRequestsIssueHandler.java (original)
+++ geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/ca/ListRequestsIssueHandler.java Wed Jan  7 09:03:41 2009
@@ -19,6 +19,7 @@
 
 import java.io.ByteArrayInputStream;
 import java.io.IOException;
+import java.text.MessageFormat;
 import java.util.Map;
 import java.util.Properties;
 
@@ -30,6 +31,7 @@
 
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
+import org.apache.geronimo.console.BasePortlet;
 import org.apache.geronimo.console.MultiPageModel;
 import org.apache.geronimo.management.geronimo.CertificateRequestStore;
 import org.apache.geronimo.crypto.CaUtils;
@@ -43,32 +45,21 @@
 public class ListRequestsIssueHandler extends BaseCAHandler {
     private static final Logger log = LoggerFactory.getLogger(ListRequestsIssueHandler.class);
     
-    public ListRequestsIssueHandler() {
-        super(LIST_REQUESTS_ISSUE_MODE, "/WEB-INF/view/ca/listRequestsIssue.jsp");
+    public ListRequestsIssueHandler(BasePortlet portlet) {
+        super(LIST_REQUESTS_ISSUE_MODE, "/WEB-INF/view/ca/listRequestsIssue.jsp", portlet);
     }
 
     public String actionBeforeView(ActionRequest request, ActionResponse 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) response.setRenderParameter(params[i], value);
-        }
         return getMode();
     }
 
     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);
-        }
         CertificateRequestStore csrStore = getCertificateRequestStore(request);
         String[] csrIds = csrStore.getVerifiedRequestIds();
         request.setAttribute("csrIds", csrIds);
     }
 
     public String actionAfterView(ActionRequest request, ActionResponse response, MultiPageModel model) throws PortletException, IOException {
-        String errorMsg = null;
         String requestId = request.getParameter("requestId");
         try {
             response.setRenderParameter("requestId", requestId);
@@ -99,10 +90,9 @@
             }
             return CERT_REQ_DETAILS_MODE+BEFORE_ACTION;
         } catch(Exception e) {
-            errorMsg = e.toString();
+            portlet.addErrorMessage(request, MessageFormat.format(portlet.getLocalizedString("errorMsg17", request), requestId), e.getMessage());
             log.error("Errors while processing a Certificate Request. id="+requestId, e);
         }
-        response.setRenderParameter(ERROR_MSG, errorMsg);
         return getMode()+BEFORE_ACTION;
     }
 }

Modified: geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/ca/ListRequestsVerifyHandler.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/ca/ListRequestsVerifyHandler.java?rev=732398&r1=732397&r2=732398&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/ca/ListRequestsVerifyHandler.java (original)
+++ geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/ca/ListRequestsVerifyHandler.java Wed Jan  7 09:03:41 2009
@@ -19,6 +19,7 @@
 
 import java.io.ByteArrayInputStream;
 import java.io.IOException;
+import java.text.MessageFormat;
 import java.util.Map;
 import java.util.Properties;
 
@@ -30,6 +31,7 @@
 
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
+import org.apache.geronimo.console.BasePortlet;
 import org.apache.geronimo.console.MultiPageModel;
 import org.apache.geronimo.management.geronimo.CertificateRequestStore;
 import org.apache.geronimo.crypto.CaUtils;
@@ -43,32 +45,21 @@
 public class ListRequestsVerifyHandler extends BaseCAHandler {
     private static final Logger log = LoggerFactory.getLogger(ListRequestsVerifyHandler.class);
 
-    public ListRequestsVerifyHandler() {
-        super(LIST_REQUESTS_VERIFY_MODE, "/WEB-INF/view/ca/listRequestsVerify.jsp");
+    public ListRequestsVerifyHandler(BasePortlet portlet) {
+        super(LIST_REQUESTS_VERIFY_MODE, "/WEB-INF/view/ca/listRequestsVerify.jsp", portlet);
     }
 
     public String actionBeforeView(ActionRequest request, ActionResponse 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) response.setRenderParameter(params[i], value);
-        }
         return getMode();
     }
 
     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);
-        }
         CertificateRequestStore csrStore = getCertificateRequestStore(request);
         String[] csrIds = csrStore.getVerificatonDueRequestIds();
         request.setAttribute("csrIds", csrIds);
     }
 
     public String actionAfterView(ActionRequest request, ActionResponse response, MultiPageModel model) throws PortletException, IOException {
-        String errorMsg = null;
         String requestId = request.getParameter("requestId");
         try {
             response.setRenderParameter("requestId", requestId);
@@ -99,10 +90,9 @@
             }
             return CONFIRM_CERT_REQ_MODE+BEFORE_ACTION;
         } catch(Exception e) {
-            errorMsg = e.toString();
+            portlet.addErrorMessage(request, MessageFormat.format(portlet.getLocalizedString("errorMsg18", request), requestId), e.getMessage());
             log.error("Errors while verifying Certificate Request. id="+requestId, e);
         }
-        response.setRenderParameter(ERROR_MSG, errorMsg);
         return getMode()+BEFORE_ACTION;
     }
 }

Modified: geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/ca/ProcessCSRHandler.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/ca/ProcessCSRHandler.java?rev=732398&r1=732397&r2=732398&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/ca/ProcessCSRHandler.java (original)
+++ geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/ca/ProcessCSRHandler.java Wed Jan  7 09:03:41 2009
@@ -28,6 +28,7 @@
 
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
+import org.apache.geronimo.console.BasePortlet;
 import org.apache.geronimo.console.MultiPageModel;
 import org.apache.geronimo.crypto.CaUtils;
 
@@ -39,29 +40,18 @@
 public class ProcessCSRHandler extends BaseCAHandler {
     private static final Logger log = LoggerFactory.getLogger(ProcessCSRHandler.class);
     
-    public ProcessCSRHandler() {
-        super(PROCESS_CSR_MODE, "/WEB-INF/view/ca/processCSR.jsp");
+    public ProcessCSRHandler(BasePortlet portlet) {
+        super(PROCESS_CSR_MODE, "/WEB-INF/view/ca/processCSR.jsp", portlet);
     }
 
     public String actionBeforeView(ActionRequest request, ActionResponse 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) response.setRenderParameter(params[i], value);
-        }
         return getMode();
     }
 
     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) {
-            Object value = request.getParameter(params[i]);
-            if(value != null) request.setAttribute(params[i], value);
-        }
     }
 
     public String actionAfterView(ActionRequest request, ActionResponse response, MultiPageModel model) throws PortletException, IOException {
-        String errorMsg = null;
         try {
             // Process the PKCS10 Certificate Request
             String pkcs10certreq = request.getParameter("pkcs10certreq");
@@ -72,10 +62,9 @@
             response.setRenderParameter("publickey", certReqMap.get(CaUtils.CERT_REQ_PUBLICKEY_OBJ).toString());
             return CERT_REQ_DETAILS_MODE+BEFORE_ACTION;
         } catch(Exception e) {
-            errorMsg = e.toString();
+            portlet.addErrorMessage(request, portlet.getLocalizedString("errorMsg20", request), e.getMessage());
             log.error("Errors while processing a CSR.", e);
         }
-        response.setRenderParameter(ERROR_MSG, errorMsg);
         return getMode()+BEFORE_ACTION;
     }
 }

Modified: geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/ca/SetupCAHandler.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/ca/SetupCAHandler.java?rev=732398&r1=732397&r2=732398&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/ca/SetupCAHandler.java (original)
+++ geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/ca/SetupCAHandler.java Wed Jan  7 09:03:41 2009
@@ -33,6 +33,7 @@
 
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
+import org.apache.geronimo.console.BasePortlet;
 import org.apache.geronimo.console.MultiPageModel;
 
 /**
@@ -43,12 +44,12 @@
 public class SetupCAHandler extends BaseCAHandler {
     private static final Logger log = LoggerFactory.getLogger(SetupCAHandler.class);
     
-    public SetupCAHandler() {
-        super(SETUPCA_MODE, "/WEB-INF/view/ca/setupCA.jsp");
+    public SetupCAHandler(BasePortlet portlet) {
+        super(SETUPCA_MODE, "/WEB-INF/view/ca/setupCA.jsp", portlet);
     }
 
     public String actionBeforeView(ActionRequest request, ActionResponse response, MultiPageModel model) throws PortletException, IOException {
-        String[] params = {ERROR_MSG, INFO_MSG, "caCN", "caOU", "caO", "caL", "caST", "caC", "alias", "keyAlgorithm", "keySize", "algorithm", "validFrom", "validTo", "sNo", "password"};
+        String[] params = {"caCN", "caOU", "caO", "caL", "caST", "caC", "alias", "keyAlgorithm", "keySize", "algorithm", "validFrom", "validTo", "sNo", "password"};
         for(int i = 0; i < params.length; ++i) {
             String value = request.getParameter(params[i]);
             if(value != null) response.setRenderParameter(params[i], value);
@@ -57,7 +58,7 @@
     }
 
     public void renderView(RenderRequest request, RenderResponse response, MultiPageModel model) throws PortletException, IOException {
-        String[] params = {ERROR_MSG, INFO_MSG, "caCN", "caOU", "caO", "caL", "caST", "caC", "alias", "keyAlgorithm", "keySize", "algorithm", "validFrom", "validTo", "sNo", "password"};
+        String[] params = {"caCN", "caOU", "caO", "caL", "caST", "caC", "alias", "keyAlgorithm", "keySize", "algorithm", "validFrom", "validTo", "sNo", "password"};
         for(int i = 0; i < params.length; ++i) {
             Object value = request.getParameter(params[i]);
             if(value != null) request.setAttribute(params[i], value);
@@ -65,7 +66,6 @@
     }
 
     public String actionAfterView(ActionRequest request, ActionResponse response, MultiPageModel model) throws PortletException, IOException {
-        String errorMsg = null;
         try {
             // Validate the Serial Number
             String sNo = request.getParameter("sNo");
@@ -102,10 +102,9 @@
             // Load page to confirm CA details
             return CONFIRM_CA_MODE+BEFORE_ACTION;
         } catch(Exception e) {
-            errorMsg = e.toString();
-            log.error("Error in user input during CA Setup.", e);
+            portlet.addErrorMessage(request, portlet.getLocalizedString("errorMsg19", request), e.getMessage());
+            log.error("", e);
         }
-        if(errorMsg != null) response.setRenderParameter(ERROR_MSG, errorMsg);
         return getMode()+BEFORE_ACTION;
     }
 

Modified: geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/ca/UnlockCAHandler.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/ca/UnlockCAHandler.java?rev=732398&r1=732397&r2=732398&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/ca/UnlockCAHandler.java (original)
+++ geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/ca/UnlockCAHandler.java Wed Jan  7 09:03:41 2009
@@ -27,6 +27,7 @@
 
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
+import org.apache.geronimo.console.BasePortlet;
 import org.apache.geronimo.console.MultiPageModel;
 import org.apache.geronimo.management.geronimo.CertificationAuthority;
 
@@ -38,29 +39,18 @@
 public class UnlockCAHandler extends BaseCAHandler {
     private static final Logger log = LoggerFactory.getLogger(UnlockCAHandler.class);
     
-    public UnlockCAHandler() {
-        super(UNLOCKCA_MODE, "/WEB-INF/view/ca/unlockCA.jsp");
+    public UnlockCAHandler(BasePortlet portlet) {
+        super(UNLOCKCA_MODE, "/WEB-INF/view/ca/unlockCA.jsp", portlet);
     }
 
     public String actionBeforeView(ActionRequest request, ActionResponse 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) response.setRenderParameter(params[i], value);
-        }
         return getMode();
     }
 
     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) {
-            Object value = request.getParameter(params[i]);
-            if(value != null) request.setAttribute(params[i], value);
-        }
     }
 
     public String actionAfterView(ActionRequest request, ActionResponse response, MultiPageModel model) throws PortletException, IOException {
-        String errorMsg = null;
         try {
             String password = request.getParameter("password");
             if(password == null) {
@@ -73,15 +63,14 @@
             ca.unlock(password.toCharArray());
 
             // Return to CA's index page
-            response.setRenderParameter(INFO_MSG, "CA has been unlocked successfully!");
+            portlet.addInfoMessage(request, portlet.getLocalizedString("infoMsg14", request));
             log.info("CA has been unlocked successfully!");
             return INDEX_MODE+BEFORE_ACTION;
         } catch(Exception e) {
-            errorMsg = e.toString();
+            // An error occurred.  Set the error message and load the page again.
+            portlet.addErrorMessage(request, portlet.getLocalizedString("errorMsg14", request), e.getMessage());
             log.error("Errors in unlocking CA.", e);
         }
-        // An error occurred.  Set the error message and load the page again.
-        response.setRenderParameter(ERROR_MSG, errorMsg);
         return getMode()+BEFORE_ACTION;
     }
 }

Modified: geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/ca/ViewCertificateHandler.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/ca/ViewCertificateHandler.java?rev=732398&r1=732397&r2=732398&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/ca/ViewCertificateHandler.java (original)
+++ geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/ca/ViewCertificateHandler.java Wed Jan  7 09:03:41 2009
@@ -22,6 +22,7 @@
 import java.security.PublicKey;
 import java.security.cert.Certificate;
 import java.security.interfaces.RSAPublicKey;
+import java.text.MessageFormat;
 import java.util.HashMap;
 import java.util.Map;
 
@@ -33,6 +34,7 @@
 
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
+import org.apache.geronimo.console.BasePortlet;
 import org.apache.geronimo.console.MultiPageModel;
 import org.apache.geronimo.management.geronimo.CertificationAuthority;
 import org.apache.geronimo.crypto.CertificateUtil;
@@ -45,12 +47,12 @@
 public class ViewCertificateHandler extends BaseCAHandler {
     private static final Logger log = LoggerFactory.getLogger(ViewCertificateHandler.class);
     
-    public ViewCertificateHandler() {
-        super(VIEW_CERT_MODE, "/WEB-INF/view/ca/viewCertificate.jsp");
+    public ViewCertificateHandler(BasePortlet portlet) {
+        super(VIEW_CERT_MODE, "/WEB-INF/view/ca/viewCertificate.jsp", portlet);
     }
 
     public String actionBeforeView(ActionRequest request, ActionResponse response, MultiPageModel model) throws PortletException, IOException {
-        String[] params = {ERROR_MSG, INFO_MSG, "sNo"};
+        String[] params = {"sNo"};
         for(int i = 0; i < params.length; ++i) {
             String value = request.getParameter(params[i]);
             if(value != null) response.setRenderParameter(params[i], value);
@@ -59,12 +61,6 @@
     }
 
     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);
-        }
-        String errorMsg = request.getParameter(ERROR_MSG);
         String sNo = request.getParameter("sNo");
         try {
             if(!request.getParameterMap().containsKey("sNo")) {
@@ -95,10 +91,9 @@
             if("true".equalsIgnoreCase(request.getParameter("linkToListRequests")))
                 request.setAttribute("linkToListRequests", Boolean.TRUE);
         } catch (Exception e) {
-            errorMsg = e.toString();
+            portlet.addErrorMessage(request, MessageFormat.format(portlet.getLocalizedString("errorMsg16", request), sNo), e.getMessage());
             log.error("Errors trying to view certificate with serial number '"+sNo+"'", e);
         }
-        request.setAttribute(ERROR_MSG, errorMsg);
     }
 
     public String actionAfterView(ActionRequest request, ActionResponse response, MultiPageModel model) throws PortletException, IOException {

Modified: geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/configmanager/ConfigManagerPortlet.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/configmanager/ConfigManagerPortlet.java?rev=732398&r1=732397&r2=732398&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/configmanager/ConfigManagerPortlet.java (original)
+++ geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/configmanager/ConfigManagerPortlet.java Wed Jan  7 09:03:41 2009
@@ -121,19 +121,20 @@
         return kids;
     }
 
-    public void printResults(Set<Artifact> lcresult, StringBuffer buf) {
+    public String printResults(Set<Artifact> lcresult) {
+        StringBuilder sb = new StringBuilder();
         for (Artifact config : lcresult) {
 
-            //TODO might be a hack
+            // TODO might be a hack
             List<String> kidsChild = loadChildren(kernel, config.toString());
 
-            //TODO figure out the web url and show it when appropriate.
-            buf.append("    ").append(config).append("<br />");
-            for (String kid: kidsChild) {
-                buf.append("      `-> ").append(kid).append("<br />");
+            // TODO figure out the web url and show it when appropriate.
+            sb.append("<br />").append(config);
+            for (String kid : kidsChild) {
+                sb.append("<br />-> ").append(kid);
             }
-            buf.append("<br />");
         }
+        return sb.toString();
     }
 
     public void processAction(ActionRequest actionRequest, ActionResponse actionResponse) throws PortletException, IOException {
@@ -150,7 +151,7 @@
                 }
                 if(!configurationManager.isRunning(configId)) {
                     org.apache.geronimo.kernel.config.LifecycleResults lcresult = configurationManager.startConfiguration(configId);
-                    message(actionResponse, lcresult, "Started application<br /><br />");
+                    addInfoMessage(actionRequest, getLocalizedString("infoMsg01", actionRequest) + printResults(lcresult.getStarted()));
                 }
             } else if (STOP_ACTION.equals(action)) {
                 if(configurationManager.isRunning(configId)) {
@@ -158,40 +159,32 @@
                 }
                 if(configurationManager.isLoaded(configId)) {
                     LifecycleResults lcresult = configurationManager.unloadConfiguration(configId);
-                    message(actionResponse, lcresult, "Stopped application<br /><br />");
+                    addInfoMessage(actionRequest, getLocalizedString("infoMsg02", actionRequest) + printResults(lcresult.getStarted()));
                 }
             } else if (UNINSTALL_ACTION.equals(action)) {
                 configurationManager.uninstallConfiguration(configId);
-                message(actionResponse, null, "Uninstalled application<br /><br />"+configId+"<br /><br />");
+                addInfoMessage(actionRequest, getLocalizedString("infoMsg04", actionRequest) + "<br />" + configId);
             } else if (RESTART_ACTION.equals(action)) {
                 LifecycleResults lcresult = configurationManager.reloadConfiguration(configId);
-                message(actionResponse, lcresult, "Restarted application<br /><br />");
+                addInfoMessage(actionRequest, getLocalizedString("infoMsg03", actionRequest) + printResults(lcresult.getStarted()));
             } else {
-                message(actionResponse, null, "Invalid value for changeState: " + action + "<br /><br />");
+                addWarningMessage(actionRequest, getLocalizedString("warnMsg01", actionRequest) + action + "<br />");
                 throw new PortletException("Invalid value for changeState: " + action);
             }
         } catch (NoSuchConfigException e) {
             // ignore this for now
-            message(actionResponse, null, "Configuration not found<br /><br />");
+            addErrorMessage(actionRequest, getLocalizedString("errorMsg01", actionRequest));
             logger.error("Configuration not found", e);
         } catch (LifecycleException e) {
             // todo we have a much more detailed report now
-            message(actionResponse, null, "Lifecycle operation failed<br /><br />");
+            addErrorMessage(actionRequest, getLocalizedString("errorMsg02", actionRequest));
             logger.error("Lifecycle operation failed ", e);
         } catch (Throwable e) {
-            message(actionResponse, null, "Encountered an unhandled exception<br /><br />");
+            addErrorMessage(actionRequest, getLocalizedString("errorMsg03", actionRequest));
             logger.error("Exception", e);
         }
     }
 
-    private void message(ActionResponse actionResponse, LifecycleResults lcresult, String str) {
-        StringBuffer buf = new StringBuffer(str);
-        if (lcresult != null) {
-            this.printResults(lcresult.getStarted(), buf);
-        }
-        actionResponse.setRenderParameter("messageStatus", buf.toString());
-    }
-
     /**
      * Check if a configuration should be listed here. This method depends on the "config-type" portlet parameter
      * which is set in portle.xml.
@@ -314,11 +307,8 @@
         renderRequest.setAttribute("showWebInfo", Boolean.valueOf(showWebInfo()));
         renderRequest.setAttribute("showDependencies", Boolean.valueOf(showDependencies));
         if (moduleDetails.size() == 0) {
-            renderRequest.setAttribute("messageInstalled", "No modules found of this type<br /><br />");
-        } else {
-            renderRequest.setAttribute("messageInstalled", "");
+            addWarningMessage(renderRequest, getLocalizedString("warnMsg02", renderRequest));
         }
-        renderRequest.setAttribute("messageStatus", renderRequest.getParameter("messageStatus"));
         if (WindowState.NORMAL.equals(renderRequest.getWindowState())) {
             normalView.include(renderRequest, renderResponse);
         } else {

Modified: geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/keystores/BaseKeystoreHandler.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/keystores/BaseKeystoreHandler.java?rev=732398&r1=732397&r2=732398&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/keystores/BaseKeystoreHandler.java (original)
+++ geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/keystores/BaseKeystoreHandler.java Wed Jan  7 09:03:41 2009
@@ -32,6 +32,7 @@
 
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
+import org.apache.geronimo.console.BasePortlet;
 import org.apache.geronimo.console.MultiPageAbstractHandler;
 import org.apache.geronimo.console.MultiPageModel;
 import org.apache.geronimo.management.geronimo.KeystoreException;
@@ -62,18 +63,16 @@
     protected static final String GENERATE_CSR = "generateCSR";
     protected static final String IMPORT_CA_REPLY = "importCAReply";
     protected static final String DELETE_ENTRY = "deleteEntry";
-    protected static final String CHANGE_PASSWORD = "changePassword";
-
-    // 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 static final String CHANGE_PASSWORD = "changePassword";    
 
     protected BaseKeystoreHandler(String mode, String viewName) {
         super(mode, viewName);
     }
 
+    protected BaseKeystoreHandler(String mode, String viewName, BasePortlet portlet) {
+        super(mode, viewName, portlet);
+    }
+
     public final static class KeystoreModel implements MultiPageModel {
         public KeystoreModel(PortletRequest request) {
         }

Modified: geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/keystores/CertificateDetailsHandler.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/keystores/CertificateDetailsHandler.java?rev=732398&r1=732397&r2=732398&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/keystores/CertificateDetailsHandler.java (original)
+++ geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/keystores/CertificateDetailsHandler.java Wed Jan  7 09:03:41 2009
@@ -46,11 +46,6 @@
     }
 
     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);
-        }
         String id = request.getParameter("id");
         String alias = request.getParameter("alias");
         if(alias == null && request.getParameterMap().containsKey("alias")) {

Modified: geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/keystores/ChangePasswordHandler.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/keystores/ChangePasswordHandler.java?rev=732398&r1=732397&r2=732398&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/keystores/ChangePasswordHandler.java (original)
+++ geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/keystores/ChangePasswordHandler.java Wed Jan  7 09:03:41 2009
@@ -16,8 +16,11 @@
  */
 package org.apache.geronimo.console.keystores;
 
+import java.text.MessageFormat;
+
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
+import org.apache.geronimo.console.BasePortlet;
 import org.apache.geronimo.console.MultiPageModel;
 
 import javax.portlet.ActionRequest;
@@ -35,12 +38,12 @@
 public class ChangePasswordHandler extends BaseKeystoreHandler {
     private static final Logger log = LoggerFactory.getLogger(ChangePasswordHandler.class);
     
-    public ChangePasswordHandler() {
-        super(CHANGE_PASSWORD, "/WEB-INF/view/keystore/changePassword.jsp");
+    public ChangePasswordHandler(BasePortlet portlet) {
+        super(CHANGE_PASSWORD, "/WEB-INF/view/keystore/changePassword.jsp", portlet);
     }
 
     public String actionBeforeView(ActionRequest request, ActionResponse response, MultiPageModel model) throws PortletException, IOException {
-        String[] params = {ERROR_MSG, INFO_MSG, "keystore", "alias"};
+        String[] params = {"keystore", "alias"};
         for(int i = 0; i < params.length; ++i) {
             String value = request.getParameter(params[i]);
             if(value != null) response.setRenderParameter(params[i], value);
@@ -49,7 +52,7 @@
     }
 
     public void renderView(RenderRequest request, RenderResponse response, MultiPageModel model) throws PortletException, IOException {
-        String[] params = {ERROR_MSG, INFO_MSG, "keystore", "alias"};
+        String[] params = {"keystore", "alias"};
         for(int i = 0; i < params.length; ++i) {
             String value = request.getParameter(params[i]);
             if(value != null) request.setAttribute(params[i], value);
@@ -77,19 +80,25 @@
                 // Keystore password is to be changed.
                 data.changeKeystorePassword(password.toCharArray(), newPassword.toCharArray());
                 response.setRenderParameter("id", keystore);
-                response.setRenderParameter(INFO_MSG, "Password changed for keystore '"+keystore+"'.");
+                portlet.addInfoMessage(request, MessageFormat.format(portlet.getLocalizedString("infoMsg10", request), keystore));
                 return VIEW_KEYSTORE+BEFORE_ACTION;
             } else {
                 // Private key password is to be changed.
                 data.changeKeyPassword(alias, password.toCharArray(), newPassword.toCharArray());
                 response.setRenderParameter("id", keystore);
                 response.setRenderParameter("alias", alias);
-                response.setRenderParameter(INFO_MSG, "Password changed for private key '"+alias+"'.");
+                portlet.addInfoMessage(request, MessageFormat.format(portlet.getLocalizedString("infoMsg11", request), alias));
                 return CERTIFICATE_DETAILS;
             }
         } catch (Exception e) {
-            String message = "Unable to change password for "+ (alias == null || alias.equals("") ? "keystore "+keystore : "private key "+alias) + ".";
-            response.setRenderParameter(ERROR_MSG, message+" "+e.toString());
+        	String message = "";
+        	if(alias == null || alias.equals("")) {
+                message = "Unable to change password for keystore " + keystore + ".";
+                portlet.addErrorMessage(request, MessageFormat.format(portlet.getLocalizedString("errorMsg11", request), keystore), e.getMessage());
+        	} else {
+                message = "Unable to change password for private key " + alias + ".";
+                portlet.addErrorMessage(request, MessageFormat.format(portlet.getLocalizedString("errorMsg12", request), alias), e.getMessage());
+        	}
             log.error(message, e);
             return getMode()+BEFORE_ACTION;
         }

Modified: geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/keystores/EditKeystoreHandler.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/keystores/EditKeystoreHandler.java?rev=732398&r1=732397&r2=732398&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/keystores/EditKeystoreHandler.java (original)
+++ geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/keystores/EditKeystoreHandler.java Wed Jan  7 09:03:41 2009
@@ -16,8 +16,11 @@
  */
 package org.apache.geronimo.console.keystores;
 
+import java.text.MessageFormat;
+
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
+import org.apache.geronimo.console.BasePortlet;
 import org.apache.geronimo.console.MultiPageModel;
 import org.apache.geronimo.management.geronimo.KeystoreException;
 
@@ -36,8 +39,8 @@
 public class EditKeystoreHandler extends BaseKeystoreHandler {
     private static final Logger log = LoggerFactory.getLogger(EditKeystoreHandler.class);
     
-    public EditKeystoreHandler() {
-        super(UNLOCK_KEYSTORE_FOR_EDITING, "/WEB-INF/view/keystore/unlockKeystore.jsp");
+    public EditKeystoreHandler(BasePortlet portlet) {
+        super(UNLOCK_KEYSTORE_FOR_EDITING, "/WEB-INF/view/keystore/unlockKeystore.jsp", portlet);
     }
 
     public String actionBeforeView(ActionRequest request, ActionResponse response, MultiPageModel model) throws PortletException, IOException {
@@ -49,11 +52,6 @@
     }
 
     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");
     }
@@ -72,11 +70,11 @@
         try {
             data.unlockEdit(storePass);
         } catch (KeystoreException e) {
-            response.setRenderParameter(ERROR_MSG, "Unable to unlock keystore "+keystore+" for editing. "+e.toString());
+        	portlet.addErrorMessage(request, MessageFormat.format(portlet.getLocalizedString("errorMsg08", request), keystore), e.getMessage());
             log.error("Unable to unlock keystore "+keystore+" for editing.", e);
             return getMode()+BEFORE_ACTION;
         }
-        response.setRenderParameter(INFO_MSG, "Keystore "+keystore+" successfully unlocked for editing.");
+        portlet.addInfoMessage(request, MessageFormat.format(portlet.getLocalizedString("infoMsg05", request), keystore));
         return LIST_MODE+BEFORE_ACTION;
     }
 }

Modified: geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/keystores/KeystoresPortlet.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/keystores/KeystoresPortlet.java?rev=732398&r1=732397&r2=732398&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/keystores/KeystoresPortlet.java (original)
+++ geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/keystores/KeystoresPortlet.java Wed Jan  7 09:03:41 2009
@@ -32,22 +32,22 @@
     public void init(PortletConfig config) throws PortletException {
         super.init(config);
         addHelper(new ListHandler(), config);
-        addHelper(new EditKeystoreHandler(), config);
-        addHelper(new UnlockKeystoreHandler(), config);
+        addHelper(new EditKeystoreHandler(this), config);
+        addHelper(new UnlockKeystoreHandler(this), config);
         addHelper(new CreateKeystoreHandler(), config);
-        addHelper(new ViewKeystoreHandler(), config);
+        addHelper(new ViewKeystoreHandler(this), config);
         addHelper(new UploadCertificateHandler(), config);
         addHelper(new ConfirmCertificateHandler(), config);
         addHelper(new ConfigureNewKeyHandler(), config);
         addHelper(new ConfirmKeyHandler(), config);
-        addHelper(new LockEditKeystoreHandler(), config);
-        addHelper(new LockKeystoreHandler(), config);
-        addHelper(new UnlockKeyHandler(), config);
+        addHelper(new LockEditKeystoreHandler(this), config);
+        addHelper(new LockKeystoreHandler(this), config);
+        addHelper(new UnlockKeyHandler(this), config);
         addHelper(new CertificateDetailsHandler(), config);
         addHelper(new GenerateCSRHandler(), config);
         addHelper(new ImportCAReplyHandler(), config);
         addHelper(new DeleteEntryHandler(), config);
-        addHelper(new ChangePasswordHandler(), config);
+        addHelper(new ChangePasswordHandler(this), config);
     }
 
     protected String getModelJSPVariableName() {

Modified: geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/keystores/ListHandler.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/keystores/ListHandler.java?rev=732398&r1=732397&r2=732398&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/keystores/ListHandler.java (original)
+++ geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/keystores/ListHandler.java Wed Jan  7 09:03:41 2009
@@ -49,11 +49,6 @@
     }
 
     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);

Modified: geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/keystores/LockEditKeystoreHandler.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/keystores/LockEditKeystoreHandler.java?rev=732398&r1=732397&r2=732398&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/keystores/LockEditKeystoreHandler.java (original)
+++ geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/keystores/LockEditKeystoreHandler.java Wed Jan  7 09:03:41 2009
@@ -16,6 +16,9 @@
  */
 package org.apache.geronimo.console.keystores;
 
+import java.text.MessageFormat;
+
+import org.apache.geronimo.console.BasePortlet;
 import org.apache.geronimo.console.MultiPageModel;
 
 import javax.portlet.ActionRequest;
@@ -31,15 +34,15 @@
  * @version $Rev$ $Date$
  */
 public class LockEditKeystoreHandler extends BaseKeystoreHandler {
-    public LockEditKeystoreHandler() {
-        super(LOCK_KEYSTORE_FOR_EDITING, null);
+    public LockEditKeystoreHandler(BasePortlet portlet) {
+        super(LOCK_KEYSTORE_FOR_EDITING, null, portlet);
     }
 
     public String actionBeforeView(ActionRequest request, ActionResponse response, MultiPageModel model) throws PortletException, IOException {
         String keystore = request.getParameter("keystore");
         KeystoreData data = ((KeystoreData) request.getPortletSession(true).getAttribute(KEYSTORE_DATA_PREFIX + keystore));
         data.lockEdit();
-        response.setRenderParameter(INFO_MSG, "Keystore '"+keystore+"' is now edit locked.");
+        portlet.addInfoMessage(request, MessageFormat.format(portlet.getLocalizedString("infoMsg06", request), keystore));
         return LIST_MODE+BEFORE_ACTION;
     }
 

Modified: geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/keystores/LockKeystoreHandler.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/keystores/LockKeystoreHandler.java?rev=732398&r1=732397&r2=732398&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/keystores/LockKeystoreHandler.java (original)
+++ geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/keystores/LockKeystoreHandler.java Wed Jan  7 09:03:41 2009
@@ -16,6 +16,9 @@
  */
 package org.apache.geronimo.console.keystores;
 
+import java.text.MessageFormat;
+
+import org.apache.geronimo.console.BasePortlet;
 import org.apache.geronimo.console.MultiPageModel;
 import org.apache.geronimo.management.geronimo.KeystoreException;
 
@@ -32,8 +35,8 @@
  * @version $Rev$ $Date$
  */
 public class LockKeystoreHandler extends BaseKeystoreHandler {
-    public LockKeystoreHandler() {
-        super(LOCK_KEYSTORE_FOR_USAGE, null);
+    public LockKeystoreHandler(BasePortlet portlet) {
+        super(LOCK_KEYSTORE_FOR_USAGE, null, portlet);
     }
 
     public String actionBeforeView(ActionRequest request, ActionResponse response, MultiPageModel model) throws PortletException, IOException {
@@ -41,7 +44,7 @@
         KeystoreData data = ((KeystoreData) request.getPortletSession(true).getAttribute(KEYSTORE_DATA_PREFIX + keystore));
         try {
             data.lockUse();
-            response.setRenderParameter(INFO_MSG, "Availability of keystore '"+keystore+"' is locked.");
+            portlet.addInfoMessage(request, MessageFormat.format(portlet.getLocalizedString("infoMsg08", request), keystore));
         } catch (KeystoreException e) {
             throw new PortletException(e);
         }

Modified: geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/keystores/UnlockKeyHandler.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/keystores/UnlockKeyHandler.java?rev=732398&r1=732397&r2=732398&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/keystores/UnlockKeyHandler.java (original)
+++ geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/keystores/UnlockKeyHandler.java Wed Jan  7 09:03:41 2009
@@ -16,8 +16,11 @@
  */
 package org.apache.geronimo.console.keystores;
 
+import java.text.MessageFormat;
+
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
+import org.apache.geronimo.console.BasePortlet;
 import org.apache.geronimo.console.MultiPageModel;
 import org.apache.geronimo.management.geronimo.KeystoreException;
 
@@ -36,8 +39,8 @@
 public class UnlockKeyHandler extends BaseKeystoreHandler {
     private static final Logger log = LoggerFactory.getLogger(UnlockKeyHandler.class);
     
-    public UnlockKeyHandler() {
-        super(UNLOCK_KEY, "/WEB-INF/view/keystore/unlockKey.jsp");
+    public UnlockKeyHandler(BasePortlet portlet) {
+        super(UNLOCK_KEY, "/WEB-INF/view/keystore/unlockKey.jsp", portlet);
     }
 
     public String actionBeforeView(ActionRequest request, ActionResponse response, MultiPageModel model) throws PortletException, IOException {
@@ -45,11 +48,6 @@
     }
 
     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);
-        }
         String keystore = request.getParameter("keystore");
         String password = request.getParameter("password");
         request.setAttribute("keystore", keystore);
@@ -76,11 +74,11 @@
         } catch (KeystoreException e) {
             response.setRenderParameter("keystore", keystore);
             response.setRenderParameter("password", password);
-            response.setRenderParameter(ERROR_MSG, "Unable to unlock key '"+alias+"'." + e);
+            portlet.addErrorMessage(request, MessageFormat.format(portlet.getLocalizedString("errorMsg10", request), alias), e.getMessage());
             log.error("Unable to unlock key '"+alias+"'.", e);
             return getMode()+BEFORE_ACTION;
         }
-        response.setRenderParameter(INFO_MSG, "Successfully unlocked key '"+alias+"' in keystore '"+keystore+"'.");
+        portlet.addInfoMessage(request, MessageFormat.format(portlet.getLocalizedString("infoMsg09", request), alias, keystore));
         return LIST_MODE+BEFORE_ACTION;
     }
 }

Modified: geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/keystores/UnlockKeystoreHandler.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/keystores/UnlockKeystoreHandler.java?rev=732398&r1=732397&r2=732398&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/keystores/UnlockKeystoreHandler.java (original)
+++ geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/keystores/UnlockKeystoreHandler.java Wed Jan  7 09:03:41 2009
@@ -16,8 +16,11 @@
  */
 package org.apache.geronimo.console.keystores;
 
+import java.text.MessageFormat;
+
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
+import org.apache.geronimo.console.BasePortlet;
 import org.apache.geronimo.console.MultiPageModel;
 
 import javax.portlet.ActionRequest;
@@ -35,8 +38,8 @@
 public class UnlockKeystoreHandler extends BaseKeystoreHandler {
     private static final Logger log = LoggerFactory.getLogger(UnlockKeystoreHandler.class);
     
-    public UnlockKeystoreHandler() {
-        super(UNLOCK_KEYSTORE_FOR_USAGE, "/WEB-INF/view/keystore/unlockKeystore.jsp");
+    public UnlockKeystoreHandler(BasePortlet portlet) {
+        super(UNLOCK_KEYSTORE_FOR_USAGE, "/WEB-INF/view/keystore/unlockKeystore.jsp", portlet);
     }
 
     public String actionBeforeView(ActionRequest request, ActionResponse response, MultiPageModel model) throws PortletException, IOException {
@@ -48,11 +51,6 @@
     }
 
     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);
-        }
         String keystore = request.getParameter("keystore");
         request.setAttribute("keystore", keystore);
         request.setAttribute("mode", "unlockKeystore");
@@ -85,11 +83,11 @@
                 return UNLOCK_KEY+BEFORE_ACTION;
             } // otherwise it has no keys
         } catch (Exception e) {
-            response.setRenderParameter(ERROR_MSG, "Unable to unlock keystore '"+keystore+"' for availability. "+e.toString());
+        	portlet.addErrorMessage(request, MessageFormat.format(portlet.getLocalizedString("errorMsg09", request), keystore), e.getMessage());
             log.error("Unable to unlock keystore '"+keystore+"' for availability.", e);
             return getMode()+BEFORE_ACTION;
         }
-        response.setRenderParameter(INFO_MSG, "Successfully unlocked keystore '"+keystore+"' for availability.");
+        portlet.addInfoMessage(request, MessageFormat.format(portlet.getLocalizedString("infoMsg07", request), keystore));
         return LIST_MODE+BEFORE_ACTION;
     }
 }



Mime
View raw message