geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dwo...@apache.org
Subject svn commit: r781081 [3/4] - in /geronimo/server/branches/2.1: plugins/activemq/activemq-portlets/src/main/java/org/apache/geronimo/console/jmsmanager/wizard/ plugins/activemq/activemq-portlets/src/main/webapp/WEB-INF/ plugins/console/console-base-portl...
Date Tue, 02 Jun 2009 17:01:01 GMT
Propchange: geronimo/server/branches/2.1/plugins/console/console-core/src/main/java/org/apache/geronimo/console/message/CommonMessageTag.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: geronimo/server/branches/2.1/plugins/console/console-core/src/main/java/org/apache/geronimo/console/message/ErrorMessage.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/plugins/console/console-core/src/main/java/org/apache/geronimo/console/message/ErrorMessage.java?rev=781081&view=auto
==============================================================================
--- geronimo/server/branches/2.1/plugins/console/console-core/src/main/java/org/apache/geronimo/console/message/ErrorMessage.java (added)
+++ geronimo/server/branches/2.1/plugins/console/console-core/src/main/java/org/apache/geronimo/console/message/ErrorMessage.java Tue Jun  2 17:00:57 2009
@@ -0,0 +1,59 @@
+/**
+ *  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.
+ */
+package org.apache.geronimo.console.message;
+
+public final class ErrorMessage extends CommonMessage {
+
+    private static final long serialVersionUID = 0L;
+
+    public ErrorMessage(String abbr) {
+        super(abbr);
+    }
+
+    public ErrorMessage(String abbr, String detail) {
+        super(abbr, detail);
+    }
+
+    @Override
+    public String renderMessage() {
+        String timestamp = String.valueOf(System.nanoTime());
+        StringBuilder sb = new StringBuilder();
+        sb.append("<tr valign=\"top\">");
+        sb.append("<td style=\"width: 20px;\">");
+        if (null != detail) {
+            sb.append("<a class=\"expand-task\" href=\"javascript:showHideSection('"
+                            + timestamp
+                            + "org_apache_geronimo_abbreviateMessages');showHideSection('"
+                            + timestamp
+                            + "org_apache_geronimo_detailedMessages');\" tabindex=\"1\"><img border=\"0\" align=\"absmiddle\" alt=\"show/hide\" src=\"/console/images/arrow_collapsed.gif\" id=\""
+                            + timestamp + "org_apache_geronimo_abbreviateMessagesImg\" title=\"show/hide\"/></a>");
+        }
+        sb.append("</td>");
+        sb.append("<td style=\"width: 20px;\"><img height=\"16\" width=\"16\" align=\"baseline\" src=\"/console/images/msg_error.gif\" alt=\"Error\" title=\"Error\"/></td>");
+        sb.append("<td><span id=\"" + timestamp
+                + "org_apache_geronimo_abbreviateMessages\" style=\"display: inline;\" class=\"validation-error\">"
+                + abbr + "</span>");
+        if (null != detail) {
+            sb.append("<span id=\""
+                            + timestamp
+                            + "org_apache_geronimo_detailedMessages\" style=\"display: none;\" class=\"validation-error\"><pre>"
+                            + detail + "</pre></span>");
+        }
+        sb.append("</td></tr>");
+        return sb.toString();
+    }
+}

Propchange: geronimo/server/branches/2.1/plugins/console/console-core/src/main/java/org/apache/geronimo/console/message/ErrorMessage.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: geronimo/server/branches/2.1/plugins/console/console-core/src/main/java/org/apache/geronimo/console/message/InfoMessage.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/plugins/console/console-core/src/main/java/org/apache/geronimo/console/message/InfoMessage.java?rev=781081&view=auto
==============================================================================
--- geronimo/server/branches/2.1/plugins/console/console-core/src/main/java/org/apache/geronimo/console/message/InfoMessage.java (added)
+++ geronimo/server/branches/2.1/plugins/console/console-core/src/main/java/org/apache/geronimo/console/message/InfoMessage.java Tue Jun  2 17:00:57 2009
@@ -0,0 +1,59 @@
+/**
+ *  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.
+ */
+package org.apache.geronimo.console.message;
+
+public final class InfoMessage extends CommonMessage {
+
+    private static final long serialVersionUID = 0L;
+
+    public InfoMessage(String abbr) {
+        super(abbr);
+    }
+
+    public InfoMessage(String abbr, String detail) {
+        super(abbr, detail);
+    }
+
+    @Override
+    public String renderMessage() {
+        String timestamp = String.valueOf(System.nanoTime());
+        StringBuilder sb = new StringBuilder();
+        sb.append("<tr valign=\"top\">");
+        sb.append("<td style=\"width: 20px;\">");
+        if (null != detail) {
+            sb.append("<a class=\"expand-task\" href=\"javascript:showHideSection('"
+                            + timestamp
+                            + "org_apache_geronimo_abbreviateMessages');showHideSection('"
+                            + timestamp
+                            + "org_apache_geronimo_detailedMessages');\" tabindex=\"1\"><img border=\"0\" align=\"absmiddle\" alt=\"show/hide\" src=\"/console/images/arrow_collapsed.gif\" id=\""
+                            + timestamp + "org_apache_geronimo_abbreviateMessagesImg\" title=\"show/hide\"/></a>");
+        }
+        sb.append("</td>");
+        sb.append("<td style=\"width: 20px;\"><img height=\"16\" width=\"16\" align=\"baseline\" src=\"/console/images/msg_info.gif\" alt=\"Info\" title=\"Information\"/></td>");
+        sb.append("<td><span id=\"" + timestamp
+                + "org_apache_geronimo_abbreviateMessages\" style=\"display: inline;\" class=\"validation-info\">"
+                + abbr + "</span>");
+        if (null != detail) {
+            sb.append("<span id=\""
+                            + timestamp
+                            + "org_apache_geronimo_detailedMessages\" style=\"display: none;\" class=\"validation-info\"><pre>"
+                            + detail + "</pre></span>");
+        }
+        sb.append("</td></tr>");
+        return sb.toString();
+    }
+}

Propchange: geronimo/server/branches/2.1/plugins/console/console-core/src/main/java/org/apache/geronimo/console/message/InfoMessage.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: geronimo/server/branches/2.1/plugins/console/console-core/src/main/java/org/apache/geronimo/console/message/WarnMessage.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/plugins/console/console-core/src/main/java/org/apache/geronimo/console/message/WarnMessage.java?rev=781081&view=auto
==============================================================================
--- geronimo/server/branches/2.1/plugins/console/console-core/src/main/java/org/apache/geronimo/console/message/WarnMessage.java (added)
+++ geronimo/server/branches/2.1/plugins/console/console-core/src/main/java/org/apache/geronimo/console/message/WarnMessage.java Tue Jun  2 17:00:57 2009
@@ -0,0 +1,59 @@
+/**
+ *  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.
+ */
+package org.apache.geronimo.console.message;
+
+public final class WarnMessage extends CommonMessage {
+
+    private static final long serialVersionUID = 0L;
+
+    public WarnMessage(String abbr) {
+        super(abbr);
+    }
+
+    public WarnMessage(String abbr, String detail) {
+        super(abbr, detail);
+    }
+
+    @Override
+    public String renderMessage() {
+        String timestamp = String.valueOf(System.nanoTime());
+        StringBuilder sb = new StringBuilder();
+        sb.append("<tr valign=\"top\">");
+        sb.append("<td style=\"width: 20px;\">");
+        if (null != detail) {
+            sb.append("<a class=\"expand-task\" href=\"javascript:showHideSection('"
+                            + timestamp
+                            + "org_apache_geronimo_abbreviateMessages');showHideSection('"
+                            + timestamp
+                            + "org_apache_geronimo_detailedMessages');\" tabindex=\"1\"><img border=\"0\" align=\"absmiddle\" alt=\"show/hide\" src=\"/console/images/arrow_collapsed.gif\" id=\""
+                            + timestamp + "org_apache_geronimo_abbreviateMessagesImg\" title=\"show/hide\"/></a>");
+        }
+        sb.append("</td>");
+        sb.append("<td style=\"width: 20px;\"><img height=\"16\" width=\"16\" align=\"baseline\" src=\"/console/images/msg_warn.gif\" alt=\"Warn\" title=\"Warning\"/></td>");
+        sb.append("<td><span id=\"" + timestamp
+                + "org_apache_geronimo_abbreviateMessages\" style=\"display: inline;\" class=\"validation-warn\">"
+                + abbr + "</span>");
+        if (null != detail) {
+            sb.append("<span id=\""
+                            + timestamp
+                            + "org_apache_geronimo_detailedMessages\" style=\"display: none;\" class=\"validation-warn\"><pre>"
+                            + detail + "</pre></span>");
+        }
+        sb.append("</td></tr>");
+        return sb.toString();
+    }
+}

Propchange: geronimo/server/branches/2.1/plugins/console/console-core/src/main/java/org/apache/geronimo/console/message/WarnMessage.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: geronimo/server/branches/2.1/plugins/console/console-portal-driver/src/main/webapp/CommonMsg.css
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/plugins/console/console-portal-driver/src/main/webapp/CommonMsg.css?rev=781081&view=auto
==============================================================================
--- geronimo/server/branches/2.1/plugins/console/console-portal-driver/src/main/webapp/CommonMsg.css (added)
+++ geronimo/server/branches/2.1/plugins/console/console-portal-driver/src/main/webapp/CommonMsg.css Tue Jun  2 17:00:57 2009
@@ -0,0 +1,24 @@
+.messagePortlet {
+	background-color:#F7F7F7;
+	border:1px solid #88A4D7;
+	font-family:Verdana,Helvetica,sans-serif;
+	font-size:75%;
+}
+.expand-task {
+	color:#000000;
+	margin-bottom:2px;
+	margin-top:2px;
+	text-decoration:none;
+}
+.validation-error {
+	color:#CC0000;
+	font-family:Verdana,Helvetica,sans-serif;
+}
+.validation-info {
+    color:#000000;
+    font-family:Verdana,Helvetica,sans-serif;
+}
+.validation-warn {
+    color:#660000;
+    font-family:Verdana,Helvetica,sans-serif;
+}
\ No newline at end of file

Propchange: geronimo/server/branches/2.1/plugins/console/console-portal-driver/src/main/webapp/CommonMsg.css
------------------------------------------------------------------------------
    svn:eol-style = native

Added: geronimo/server/branches/2.1/plugins/console/console-portal-driver/src/main/webapp/CommonMsg.js
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/plugins/console/console-portal-driver/src/main/webapp/CommonMsg.js?rev=781081&view=auto
==============================================================================
--- geronimo/server/branches/2.1/plugins/console/console-portal-driver/src/main/webapp/CommonMsg.js (added)
+++ geronimo/server/branches/2.1/plugins/console/console-portal-driver/src/main/webapp/CommonMsg.js Tue Jun  2 17:00:57 2009
@@ -0,0 +1,211 @@
+//======================================================================
+//   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.
+//======================================================================
+function addErrorMessage(namespace, message){
+    var msg = {};
+    msg.type = "error";
+    msg.abbr = message;
+    addCommonMessage(namespace, msg);
+}
+
+function addWarningMessage(namespace, message){
+    var msg = {};
+    msg.type="warn";
+    msg.abbr = message;
+    addCommonMessage(namespace, msg);
+}
+
+function addInfoMessage(namespace, message){
+    var msg = {};
+    msg.type="info";
+    msg.abbr = message;
+    addCommonMessage(namespace, msg);
+}
+
+function addCommonMessage(namespace, msg){
+    var container = document.getElementById(namespace+"CommonMsgContainer");
+    var pre = container.previousSibling;
+    while (pre) {
+        if (pre.className=="messagePortlet") {
+            container.parentNode.removeChild(pre);
+            break;
+        }
+        pre = pre.previousSibling;
+    }
+    while(container.firstChild) {
+        container.removeChild(container.firstChild);
+    }
+    var table = document.createElement("table");
+    container.appendChild(table);
+    table.align="center"; table.vAlign="top"; table.width="100%"; table.border="0"; table.cellSpacing="0"; table.cellPadding="0"; table.className="messagePortlet"; table.summary="Inline Messages";
+    var tbody =  document.createElement("tbody");
+    table.appendChild(tbody);
+    var tr = document.createElement("tr");
+    tbody.appendChild(tr);    
+    tr.vAlign="top";
+    var td1 = document.createElement("td");
+    tr.appendChild(td1);    
+    td1.style.width="20px";
+    if (msg.detail) {
+        var a = document.createElement("a");
+        td1.appendChild(a);
+        a.className="expand-task"; a.href="javascript:showHideSection('"+namespace+"org_apache_geronimo_abbreviateMessages');showHideSection('"+namespace+"org_apache_geronimo_detailedMessages');"; a.tabIndex="1";
+        var img = document.createElement("img");
+        a.appendChild(img);
+        img.id=namespace+"org_apache_geronimo_abbreviateMessagesImg"; img.border="0"; img.align="absmiddle"; img.alt="show/hide"; img.src="/console/images/arrow_collapsed.gif"; img.title="show/hide";
+    }
+    var td2 = document.createElement("td");
+    tr.appendChild(td2);    
+    td2.style.width="20px";
+    var img2 = document.createElement("img");
+    td2.appendChild(img2);
+    img2.height="16"; img2.width="16"; img2.align="baseline";
+    switch (msg.type)
+    {
+        case "error":
+            img2.src="/console/images/msg_error.gif"; img2.alt="Error"; img2.title="Error";
+            break;
+        case "warn":
+            img2.src="/console/images/msg_warn.gif"; img2.alt="Warn"; img2.title="Warning";
+            break;
+        case "info":
+        default:
+            img2.src="/console/images/msg_info.gif"; img2.alt="Info"; img2.title="Infomation";
+    }
+    var td3 = document.createElement("td");
+    tr.appendChild(td3);
+    var span1 = document.createElement("span");
+    td3.appendChild(span1);
+    span1.id=namespace+"org_apache_geronimo_abbreviateMessages"; span1.style.display="inline";
+    switch (msg.type)
+    {
+        case "error":
+            span1.className="validation-error";
+            break;
+        case "warn":
+            span1.className="validation-warn";
+            break;
+        case "info":
+        default:
+            span1.className="validation-info";
+    }
+    span1.appendChild(document.createTextNode(msg.abbr));
+    if (msg.detail) {
+        var span2 = document.createElement("span");
+        td3.appendChild(span2);
+        span2.id=namespace+"org_apache_geronimo_detailedMessages"; span2.style.display="none";
+        switch (msg.type)
+        {
+            case "error":
+                span2.className="validation-error";
+                break;
+            case "warn":
+                span2.className="validation-warn";
+                break;
+            case "info":
+            default:
+                span2.className="validation-info";
+        }
+        var pre = document.createElement("pre");
+        span2.appendChild(pre);
+        pre.appendChild(document.createTextNode(msg.abbr));
+        pre.appendChild(document.createElement("br"));
+        pre.appendChild(document.createTextNode(msg.detail));
+        pre.appendChild(document.createElement("br"));
+    }
+}
+
+function showConfirmMessage() {
+    dojo.require("dijit.Dialog");
+    dojo.require("dijit.form.Button");
+    document.body.className = "soria";
+    var target = arguments[0];
+    var submit = new dojo.Deferred();
+    submit.addCallback(function(){
+        switch (target.nodeName.toLowerCase()) {
+            case "input":
+                var formNode = target.parentNode;
+                while (formNode) {
+                    if (formNode.nodeName.toLowerCase() == "form") {
+                        break;
+                    }
+                    formNode = formNode.parentNode;
+                }
+                if (formNode) {
+                    formNode.submit();
+                }
+                break;
+            case "a":
+                location.href=target.href;
+                break;
+            default:                            
+        }
+    });
+    var d = new dijit.Dialog();
+    dojo.style(d.closeButtonNode, "visibility", "hidden");
+    var table = document.createElement("table");
+    table.width="100%";
+    var tbody =  document.createElement("tbody");
+    table.appendChild(tbody);
+    var tr1 = document.createElement("tr");
+    tbody.appendChild(tr1);
+    var tr2 = document.createElement("tr");
+    tbody.appendChild(tr2);
+    var td11 = document.createElement("td");
+    tr1.appendChild(td11);
+    td11.colSpan="2"; td11.style.paddingBottom="10px"; td11.align="left";
+    var img = document.createElement("img");
+    td11.appendChild(img);
+    td11.appendChild(document.createTextNode(arguments[1]));
+    img.height="16"; img.width="16"; img.style.marginRight="8"; img.align="baseline"; img.src="/console/images/msg_warn.gif"; img.alt="Warn"; img.title="Warning";               
+    var td21 = document.createElement("td");
+    tr2.appendChild(td21);
+    td21.align="right";
+    var td22 = document.createElement("td");
+    tr2.appendChild(td22);
+    td22.align="left";
+    var b1 = new dijit.form.Button({label: arguments[2], tabIndex: "2"});
+    td21.appendChild(b1.domNode);
+    dojo.connect(b1, "onClick", function() {
+        d.hide();
+        submit.callback();
+    });
+    var b2 = new dijit.form.Button({label: arguments[3], tabIndex: "1"});
+    td22.appendChild(b2.domNode);
+    dojo.connect(b2, "onClick", function() {
+        d.hide();             
+    });
+    d.setContent(table);
+    d.show();
+    return false;
+}
+
+function showHideSection(id){
+    if(document.getElementById(id)!=null){
+        if(document.getElementById(id).style.display=="none"){
+            document.getElementById(id).style.display="inline";
+            if(document.getElementById(id+"Img")){
+                document.getElementById(id+"Img").src="/console/images/arrow_collapsed.gif";
+            }
+        }
+        else{
+            document.getElementById(id).style.display="none";
+            if(document.getElementById(id+"Img")){
+                document.getElementById(id+"Img").src="/console/images/arrow_expanded.gif";
+            }
+        }
+    }
+}    

Propchange: geronimo/server/branches/2.1/plugins/console/console-portal-driver/src/main/webapp/CommonMsg.js
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: geronimo/server/branches/2.1/plugins/console/console-portal-driver/src/main/webapp/WEB-INF/themes/head.jsp
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/plugins/console/console-portal-driver/src/main/webapp/WEB-INF/themes/head.jsp?rev=781081&r1=781080&r2=781081&view=diff
==============================================================================
--- geronimo/server/branches/2.1/plugins/console/console-portal-driver/src/main/webapp/WEB-INF/themes/head.jsp (original)
+++ geronimo/server/branches/2.1/plugins/console/console-portal-driver/src/main/webapp/WEB-INF/themes/head.jsp Tue Jun  2 17:00:57 2009
@@ -24,6 +24,8 @@
     <title><fmt:message key="console.head.title"/></title>
     <link rel="stylesheet" href="<%=request.getContextPath()%>/main.css" type="text/css"/>
     <link rel="stylesheet" href="<%=request.getContextPath()%>/pluto.css" type="text/css"/>
+    <link rel="stylesheet" href="<%=request.getContextPath()%>/CommonMsg.css" type="text/css"/>
     <link rel="SHORTCUT ICON" href="<%=request.getContextPath()%>/favicon.ico" type="image/x-icon"/>
     <script language="Javascript" src="<%=request.getContextPath()%>/js/forms.js" type="text/javascript"></script>
+    <script language="Javascript" src="<%=request.getContextPath()%>/CommonMsg.js" type="text/javascript"></script>
 </head>

Added: geronimo/server/branches/2.1/plugins/console/console-portal-driver/src/main/webapp/images/arrow_collapsed.gif
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/plugins/console/console-portal-driver/src/main/webapp/images/arrow_collapsed.gif?rev=781081&view=auto
==============================================================================
Binary file - no diff available.

Propchange: geronimo/server/branches/2.1/plugins/console/console-portal-driver/src/main/webapp/images/arrow_collapsed.gif
------------------------------------------------------------------------------
    svn:mime-type = image/gif

Added: geronimo/server/branches/2.1/plugins/console/console-portal-driver/src/main/webapp/images/arrow_expanded.gif
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/plugins/console/console-portal-driver/src/main/webapp/images/arrow_expanded.gif?rev=781081&view=auto
==============================================================================
Binary file - no diff available.

Propchange: geronimo/server/branches/2.1/plugins/console/console-portal-driver/src/main/webapp/images/arrow_expanded.gif
------------------------------------------------------------------------------
    svn:mime-type = image/gif

Added: geronimo/server/branches/2.1/plugins/console/console-portal-driver/src/main/webapp/images/msg_error.gif
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/plugins/console/console-portal-driver/src/main/webapp/images/msg_error.gif?rev=781081&view=auto
==============================================================================
Binary file - no diff available.

Propchange: geronimo/server/branches/2.1/plugins/console/console-portal-driver/src/main/webapp/images/msg_error.gif
------------------------------------------------------------------------------
    svn:mime-type = image/gif

Added: geronimo/server/branches/2.1/plugins/console/console-portal-driver/src/main/webapp/images/msg_info.gif
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/plugins/console/console-portal-driver/src/main/webapp/images/msg_info.gif?rev=781081&view=auto
==============================================================================
Binary file - no diff available.

Propchange: geronimo/server/branches/2.1/plugins/console/console-portal-driver/src/main/webapp/images/msg_info.gif
------------------------------------------------------------------------------
    svn:mime-type = image/gif

Added: geronimo/server/branches/2.1/plugins/console/console-portal-driver/src/main/webapp/images/msg_warn.gif
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/plugins/console/console-portal-driver/src/main/webapp/images/msg_warn.gif?rev=781081&view=auto
==============================================================================
Binary file - no diff available.

Propchange: geronimo/server/branches/2.1/plugins/console/console-portal-driver/src/main/webapp/images/msg_warn.gif
------------------------------------------------------------------------------
    svn:mime-type = image/gif

Modified: geronimo/server/branches/2.1/plugins/console/console-portal-driver/src/main/webapp/loginerror.jsp
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/plugins/console/console-portal-driver/src/main/webapp/loginerror.jsp?rev=781081&r1=781080&r2=781081&view=diff
==============================================================================
--- geronimo/server/branches/2.1/plugins/console/console-portal-driver/src/main/webapp/loginerror.jsp (original)
+++ geronimo/server/branches/2.1/plugins/console/console-portal-driver/src/main/webapp/loginerror.jsp Tue Jun  2 17:00:57 2009
@@ -52,6 +52,26 @@
 
   <%--  Main body --%>
   <table WIDTH="100%" BORDER="0" CELLSPACING="0" CELLPADDING="0">
+    
+    <tr>
+      <td width="30%" >&nbsp;</td>
+      <td class="Body" align="CENTER" valign="top">
+        <table align="center" cellspacing="0" cellpadding="0" width="550" border="0" valign="top" style="background-color:#F7F7F7; border:1px solid #88A4D7; font-family:Verdana,Helvetica,sans-serif; font-size:100%;">
+          <tbody>
+            <tr valign="top">
+              <td style="width: 20px;"><img height="16" align="baseline" width="16" title="Error" alt="Error" src="/console/images/msg_error.gif"/></td>
+              <td><span style="color:#CC0000; font-family:Verdana,Helvetica,sans-serif;"><fmt:message key="console.login_error.invalid"/></span></td>
+            </tr>
+          </tbody>
+        </table>
+      </td> 
+      <td width="30%" >&nbsp;</td>
+    </tr>
+    <tr>
+      <td>&nbsp;</td>
+      <td>&nbsp;</td>
+    </tr>    
+    
     <TR CLASS="Content">
       <td width="30%" >&nbsp;</td>
 
@@ -64,9 +84,6 @@
           <td class="ReallyDarkBackground"><strong>&nbsp;<fmt:message key="console.common.loginToConsole"/></td>
         </tr>
         <tr>
-          <td class="MediumBackground" align="center"><font color="red"><b><i><fmt:message key="console.login_error.invalid"/></i></b></font></td>
-        </tr>
-        <tr>
           <td>
           <table width="100%"  border="0" cellspacing="0" cellpadding="0">
               <tr>

Modified: geronimo/server/branches/2.1/plugins/console/plugin-portlets/src/main/java/org/apache/geronimo/console/configmanager/DeploymentPortlet.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/plugins/console/plugin-portlets/src/main/java/org/apache/geronimo/console/configmanager/DeploymentPortlet.java?rev=781081&r1=781080&r2=781081&view=diff
==============================================================================
--- geronimo/server/branches/2.1/plugins/console/plugin-portlets/src/main/java/org/apache/geronimo/console/configmanager/DeploymentPortlet.java (original)
+++ geronimo/server/branches/2.1/plugins/console/plugin-portlets/src/main/java/org/apache/geronimo/console/configmanager/DeploymentPortlet.java Tue Jun  2 17:00:57 2009
@@ -144,7 +144,7 @@
                 if(isRedeploy) {
                     TargetModuleID[] targets = identifyTargets(moduleFile, planFile, mgr.getAvailableModules(null, all));
                     if(targets.length == 0) {
-                        actionRequest.getPortletSession().setAttribute(ABBR_STATUS_PARM, "Unable to identify modules to replace. Please check if it has already been stopped or undeployed.");
+                        addErrorMessage(actionRequest, getLocalizedString(actionRequest, "errorMsg04"), null);
                         return;
                     }
                     progress = mgr.redeploy(targets, moduleFile, planFile);
@@ -159,7 +159,8 @@
                 String fullStatusMessage = null;
                
                 if(progress.getDeploymentStatus().isCompleted()) {
-                    abbrStatusMessage = "The application was successfully "+(isRedeploy ? "re" : "")+"deployed.<br/>";
+                    abbrStatusMessage = getLocalizedString(actionRequest, !isRedeploy ? "infoMsg01" : "infoMsg02");
+                    addInfoMessage(actionRequest, abbrStatusMessage);
                     // start installed app/s
                     if (!isRedeploy && startApp != null && !startApp.equals("")) {
                         progress = mgr.start(progress.getResultTargetModuleIDs());
@@ -167,18 +168,20 @@
                             Thread.sleep(100);
                         }
                         if (progress.getDeploymentStatus().isCompleted()) {
-                            abbrStatusMessage += "The application was successfully started";
+                            abbrStatusMessage = getLocalizedString(actionRequest, "infoMsg03");
+                            addInfoMessage(actionRequest, abbrStatusMessage);                            
                         } else {
-                            abbrStatusMessage += "The application was not successfully started";
+                            abbrStatusMessage = getLocalizedString(actionRequest, "errorMsg02");
                             fullStatusMessage = progress.getDeploymentStatus().getMessage();
+                            addErrorMessage(actionRequest, abbrStatusMessage, fullStatusMessage);
                         }
                     }
                 } else {
                     fullStatusMessage = progress.getDeploymentStatus().getMessage();
                     // for the abbreviated status message clip off everything
-                    // after the first line, which in most cases means the gnarly stacktrace 
-                    abbrStatusMessage = "Deployment failed:<br/>"
-                                      + fullStatusMessage.substring(0, fullStatusMessage.indexOf('\n'));
+                    // after the first line, which in most cases means the gnarly stacktrace
+                    abbrStatusMessage = getLocalizedString(actionRequest, "errorMsg01");
+                    addErrorMessage(actionRequest, abbrStatusMessage, fullStatusMessage);
                     // try to provide an upgraded version of the plan
                     try {
                         if (planFile != null && planFile.exists()) {
@@ -205,10 +208,6 @@
                         // status message has already been provided in this case
                     }
                 }
-                // have to store the status messages in the portlet session
-                // because the buffer size for render parameters is sometimes not big enough
-                actionRequest.getPortletSession().setAttribute(FULL_STATUS_PARM, fullStatusMessage);
-                actionRequest.getPortletSession().setAttribute(ABBR_STATUS_PARM, abbrStatusMessage);
             } finally {
                 mgr.release();
                 if (fis!=null) fis.close();
@@ -269,8 +268,6 @@
         // session during the processAction phase and then copied into render
         // attributes here so the JSP has easier access to them. This seems
         // to only be an issue on tomcat.
-        copyRenderAttribute(renderRequest, FULL_STATUS_PARM);
-        copyRenderAttribute(renderRequest, ABBR_STATUS_PARM);
         copyRenderAttribute(renderRequest, MIGRATED_PLAN_PARM);
         copyRenderAttribute(renderRequest, ORIGINAL_PLAN_PARM);
         deployView.include(renderRequest, renderResponse);

Modified: geronimo/server/branches/2.1/plugins/console/plugin-portlets/src/main/java/org/apache/geronimo/console/securitymanager/realm/SecurityRealmPortlet.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/plugins/console/plugin-portlets/src/main/java/org/apache/geronimo/console/securitymanager/realm/SecurityRealmPortlet.java?rev=781081&r1=781080&r2=781081&view=diff
==============================================================================
--- geronimo/server/branches/2.1/plugins/console/plugin-portlets/src/main/java/org/apache/geronimo/console/securitymanager/realm/SecurityRealmPortlet.java (original)
+++ geronimo/server/branches/2.1/plugins/console/plugin-portlets/src/main/java/org/apache/geronimo/console/securitymanager/realm/SecurityRealmPortlet.java Tue Jun  2 17:00:57 2009
@@ -192,7 +192,8 @@
                 ConfigurationManager configurationManager = ConfigurationUtil.getConfigurationManager(PortletManager.getKernel());
                 if (configurationManager.isInstalled(artifact)) {
                     actionResponse.setRenderParameter(MODE_KEY, SELECT_TYPE_MODE);
-                    actionResponse.setRenderParameter(MESSAGE_KEY, "realmwizard.message.sameRealmName");
+                    String error = getLocalizedString(actionRequest, "errorMsg03");
+                    addErrorMessage(actionRequest, error);
                 } else {
                     // Config properties have to be set in render since they have values of null
                     if (data.getRealmType().equals("Other")) {
@@ -209,8 +210,8 @@
             if (error == null) {
                 actionResponse.setRenderParameter(MODE_KEY, ADVANCED_MODE);
             } else {
-                actionResponse.setRenderParameter("LoginModuleError", error);
                 actionResponse.setRenderParameter(MODE_KEY, CONFIGURE_MODE);
+                addErrorMessage(actionRequest, error);
             }
         } else if (mode.equals("process-" + ADVANCED_MODE)) {
             String test = actionRequest.getParameter("test");
@@ -629,10 +630,6 @@
     }
 
     private void renderConfigure(RenderRequest request, RenderResponse response, RealmData data) throws IOException, PortletException {
-        // Pass errors through
-        if (request.getParameter("LoginModuleError") != null) {
-            request.setAttribute("LoginModuleError", request.getParameter("LoginModuleError"));
-        }
         // Clear out any cached modules
         data.modules = null;
         // Configure option list

Modified: geronimo/server/branches/2.1/plugins/console/plugin-portlets/src/main/resources/portletinfo.properties
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/plugins/console/plugin-portlets/src/main/resources/portletinfo.properties?rev=781081&r1=781080&r2=781081&view=diff
==============================================================================
--- geronimo/server/branches/2.1/plugins/console/plugin-portlets/src/main/resources/portletinfo.properties (original)
+++ geronimo/server/branches/2.1/plugins/console/plugin-portlets/src/main/resources/portletinfo.properties Tue Jun  2 17:00:57 2009
@@ -30,3 +30,17 @@
 Plugins = Plugins
 
 Security\ Realms = Security Realms
+
+errorMsg01 = Deployment Failed
+
+errorMsg02 = The application was not successfully started
+
+errorMsg03 = Security realm with the same name already exists, please specify a new security realm name.
+
+errorMsg04 = Unable to identify modules to replace. Please check if it has already been stopped or undeployed.
+
+infoMsg01 = The application was successfully deployed.
+
+infoMsg02 = The application was successfully redeployed.
+
+infoMsg03 = The application was successfully started.

Added: geronimo/server/branches/2.1/plugins/console/plugin-portlets/src/main/webapp/WEB-INF/CommonMsg.tld
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/plugins/console/plugin-portlets/src/main/webapp/WEB-INF/CommonMsg.tld?rev=781081&view=auto
==============================================================================
--- geronimo/server/branches/2.1/plugins/console/plugin-portlets/src/main/webapp/WEB-INF/CommonMsg.tld (added)
+++ geronimo/server/branches/2.1/plugins/console/plugin-portlets/src/main/webapp/WEB-INF/CommonMsg.tld Tue Jun  2 17:00:57 2009
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!DOCTYPE taglib PUBLIC
+  "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.1//EN"
+  "http://java.sun.com/j2ee/dtds/web-jsptaglibrary_1_1.dtd">
+<!-- 
+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.
+-->
+
+<taglib>
+  
+  <tlibversion>1.0</tlibversion>
+  <jspversion>1.1</jspversion>
+  <shortname>pluto</shortname>
+  <uri>http://portals.apache.org/pluto</uri>
+
+    <tag>
+        <name>commonMsg</name>
+        <tagclass>
+            org.apache.geronimo.console.message.CommonMessageTag
+        </tagclass>
+        <bodycontent>empty</bodycontent>
+    </tag>
+
+</taglib>
+

Propchange: geronimo/server/branches/2.1/plugins/console/plugin-portlets/src/main/webapp/WEB-INF/CommonMsg.tld
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: geronimo/server/branches/2.1/plugins/console/plugin-portlets/src/main/webapp/WEB-INF/portlet.xml
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/plugins/console/plugin-portlets/src/main/webapp/WEB-INF/portlet.xml?rev=781081&r1=781080&r2=781081&view=diff
==============================================================================
--- geronimo/server/branches/2.1/plugins/console/plugin-portlets/src/main/webapp/WEB-INF/portlet.xml (original)
+++ geronimo/server/branches/2.1/plugins/console/plugin-portlets/src/main/webapp/WEB-INF/portlet.xml Tue Jun  2 17:00:57 2009
@@ -22,7 +22,6 @@
 
 <portlet-app version="1.0">
 
-
     <portlet>
         <description>Portlet for deploying applications</description>
         <portlet-name>Deployment</portlet-name>
@@ -35,6 +34,9 @@
             <portlet-mode>HELP</portlet-mode>
         </supports>
         <supported-locale>en</supported-locale>
+        <supported-locale>zh</supported-locale>
+        <supported-locale>ja</supported-locale>
+        <resource-bundle>portletinfo</resource-bundle>
         <portlet-info>
             <title>Install New Applications</title>
             <short-title>Install Application</short-title>
@@ -42,7 +44,6 @@
         </portlet-info>
     </portlet>
 
-
     <portlet>
         <description>Portlet for CAR Import/Export</description>
         <portlet-name>ImportExport</portlet-name>
@@ -54,6 +55,9 @@
             <portlet-mode>VIEW</portlet-mode>
         </supports>
         <supported-locale>en</supported-locale>
+        <supported-locale>zh</supported-locale>
+        <supported-locale>ja</supported-locale>
+        <resource-bundle>portletinfo</resource-bundle>
         <portlet-info>
             <title>Install Plugins</title>
             <short-title>Install Plugins</short-title>
@@ -72,6 +76,9 @@
             <portlet-mode>VIEW</portlet-mode>
         </supports>
         <supported-locale>en</supported-locale>
+        <supported-locale>zh</supported-locale>
+        <supported-locale>ja</supported-locale>
+        <resource-bundle>portletinfo</resource-bundle>
         <portlet-info>
             <title>Assemble Server</title>
             <short-title>Assemble Server</short-title>
@@ -90,6 +97,9 @@
             <portlet-mode>VIEW</portlet-mode>
         </supports>
         <supported-locale>en</supported-locale>
+        <supported-locale>zh</supported-locale>
+        <supported-locale>ja</supported-locale>
+        <resource-bundle>portletinfo</resource-bundle>
         <portlet-info>
             <title>Create Plugin</title>
             <short-title>Create Plugin</short-title>
@@ -108,6 +118,9 @@
             <portlet-mode>VIEW</portlet-mode>
         </supports>
         <supported-locale>en</supported-locale>
+        <supported-locale>zh</supported-locale>
+        <supported-locale>ja</supported-locale>
+        <resource-bundle>portletinfo</resource-bundle>
         <portlet-info>
             <title>Security Realms</title>
             <short-title>Security Realms</short-title>

Modified: geronimo/server/branches/2.1/plugins/console/plugin-portlets/src/main/webapp/WEB-INF/view/car/results.jsp
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/plugins/console/plugin-portlets/src/main/webapp/WEB-INF/view/car/results.jsp?rev=781081&r1=781080&r2=781081&view=diff
==============================================================================
--- geronimo/server/branches/2.1/plugins/console/plugin-portlets/src/main/webapp/WEB-INF/view/car/results.jsp (original)
+++ geronimo/server/branches/2.1/plugins/console/plugin-portlets/src/main/webapp/WEB-INF/view/car/results.jsp Tue Jun  2 17:00:57 2009
@@ -21,9 +21,7 @@
 <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
 <fmt:setBundle basename="pluginportlets"/>
 <portlet:defineObjects/>
-<p>
-<fmt:message key="car.results.titles" />
-</p>
+<p><b><fmt:message key="car.results.titles" />:</b></p>
 <% 
     String[] configIds = request.getParameterValues("configId");
     for(int j=0;j<configIds.length;j++){

Modified: geronimo/server/branches/2.1/plugins/console/plugin-portlets/src/main/webapp/WEB-INF/view/configmanager/deploy.jsp
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/plugins/console/plugin-portlets/src/main/webapp/WEB-INF/view/configmanager/deploy.jsp?rev=781081&r1=781080&r2=781081&view=diff
==============================================================================
--- geronimo/server/branches/2.1/plugins/console/plugin-portlets/src/main/webapp/WEB-INF/view/configmanager/deploy.jsp (original)
+++ geronimo/server/branches/2.1/plugins/console/plugin-portlets/src/main/webapp/WEB-INF/view/configmanager/deploy.jsp Tue Jun  2 17:00:57 2009
@@ -17,6 +17,7 @@
 <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
 <%@ taglib uri="http://java.sun.com/portlet" prefix="portlet"%>
 <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
+<%@ taglib uri="/WEB-INF/CommonMsg.tld" prefix="CommonMsg"%>
 <fmt:setBundle basename="pluginportlets"/>
 <portlet:defineObjects/>
 
@@ -32,24 +33,7 @@
 }
 </script>
 
-<!-- Abbreviated status message -->
-<c:if test="${!(empty abbrStatusMessage)}">
-    <div id="<portlet:namespace/>abbrStatusMessage" style="display:inline">
-     ${abbrStatusMessage}<br/>
-    <c:if test="${!(empty fullStatusMessage)}">
-    <button onclick="<portlet:namespace/>toggleDisplay('fullStatusMessage');<portlet:namespace/>toggleDisplay('abbrStatusMessage');return false;">Show full details</button>
-    </c:if>
-    </div>
-</c:if>
-<!-- Full status message -->
-<c:if test="${!(empty fullStatusMessage)}">
-    <div id="<portlet:namespace/>fullStatusMessage" style="display:none">
-    <pre>
-<c:out escapeXml="true" value="${fullStatusMessage}"/>
-    </pre>
-    </div>
-</c:if>
-
+<CommonMsg:commonMsg/>
 <P/>
 
 <!-- Migrated Plan -->

Modified: geronimo/server/branches/2.1/plugins/console/plugin-portlets/src/main/webapp/WEB-INF/view/realmwizard/_sql.jsp
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/plugins/console/plugin-portlets/src/main/webapp/WEB-INF/view/realmwizard/_sql.jsp?rev=781081&r1=781080&r2=781081&view=diff
==============================================================================
--- geronimo/server/branches/2.1/plugins/console/plugin-portlets/src/main/webapp/WEB-INF/view/realmwizard/_sql.jsp (original)
+++ geronimo/server/branches/2.1/plugins/console/plugin-portlets/src/main/webapp/WEB-INF/view/realmwizard/_sql.jsp Tue Jun  2 17:00:57 2009
@@ -154,12 +154,12 @@
                    size="20" value="${realm.options['jdbcPassword']}"></td>
       </tr>
       <tr>
+        <td></td>
+        <td><fmt:message key="realmwizard._sql.JDBCPasswordExp" /></td>
+      </tr>
+      <tr>
         <th><div align="right"><fmt:message key="consolebase.common.confirmPassword"/></div></th>
         <td><input name="confirm-option-jdbcPassword" type="password"
                    size="20" value="${realm.options['jdbcPassword']}"></td>
       </tr>
-      <tr>
-        <td></td>
-        <td><fmt:message key="realmwizard._sql.JDBCPasswordExp" /></td>
-      </tr>
 

Modified: geronimo/server/branches/2.1/plugins/console/plugin-portlets/src/main/webapp/WEB-INF/view/realmwizard/configure.jsp
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/plugins/console/plugin-portlets/src/main/webapp/WEB-INF/view/realmwizard/configure.jsp?rev=781081&r1=781080&r2=781081&view=diff
==============================================================================
--- geronimo/server/branches/2.1/plugins/console/plugin-portlets/src/main/webapp/WEB-INF/view/realmwizard/configure.jsp (original)
+++ geronimo/server/branches/2.1/plugins/console/plugin-portlets/src/main/webapp/WEB-INF/view/realmwizard/configure.jsp Tue Jun  2 17:00:57 2009
@@ -21,6 +21,7 @@
 <%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
 <%@ taglib uri="http://java.sun.com/portlet" prefix="portlet"%>
 <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
+<%@ taglib uri="/WEB-INF/CommonMsg.tld" prefix="CommonMsg"%>
 <fmt:setBundle basename="pluginportlets"/>
 <portlet:defineObjects/>
 
@@ -39,9 +40,9 @@
 }
 </script>
 
-<p><fmt:message key="realmwizard.configure.title" /></p>
+<CommonMsg:commonMsg/>
 
-<c:if test="${!(empty LoginModuleError)}"><p><font color="red"><b>Error: ${LoginModuleError}</b></font></p></c:if>
+<p><fmt:message key="realmwizard.configure.title" /></p>
 
 <!--   FORM TO COLLECT DATA FOR THIS PAGE   -->
 <form name="<portlet:namespace/>RealmForm" action="<portlet:actionURL/>" method="POST">
@@ -100,6 +101,10 @@
                    type="<c:choose><c:when test="${optionMap[option].password}">password</c:when><c:otherwise>text</c:otherwise></c:choose>"
                    size="${optionMap[option].length}" value="${realm.options[option]}"></td>
       </tr>
+      <tr>
+        <td></td>
+        <td><fmt:message key="${optionMap[option].description}"/></td>
+      </tr>
     <c:if test="${optionMap[option].password}">
       <tr>
         <th style="min-width: 140px"><div align="right">Confirm password:</div></th>
@@ -110,10 +115,6 @@
           <portlet:namespace/>passwordFields = <portlet:namespace/>passwordFields.concat(new Array('option-${option}'))
       </script>
     </c:if>
-      <tr>
-        <td></td>
-        <td><fmt:message key="${optionMap[option].description}"/></td>
-      </tr>
       <c:if test="${!optionMap[option].blankAllowed}">
         <script language="JavaScript">
           <portlet:namespace/>requiredFields = <portlet:namespace/>requiredFields.concat(new Array('option-${option}'))

Added: geronimo/server/branches/2.1/plugins/debugviews/debugviews-portlets/src/main/webapp/WEB-INF/CommonMsg.tld
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/plugins/debugviews/debugviews-portlets/src/main/webapp/WEB-INF/CommonMsg.tld?rev=781081&view=auto
==============================================================================
--- geronimo/server/branches/2.1/plugins/debugviews/debugviews-portlets/src/main/webapp/WEB-INF/CommonMsg.tld (added)
+++ geronimo/server/branches/2.1/plugins/debugviews/debugviews-portlets/src/main/webapp/WEB-INF/CommonMsg.tld Tue Jun  2 17:00:57 2009
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!DOCTYPE taglib PUBLIC
+  "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.1//EN"
+  "http://java.sun.com/j2ee/dtds/web-jsptaglibrary_1_1.dtd">
+<!-- 
+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.
+-->
+
+<taglib>
+  
+  <tlibversion>1.0</tlibversion>
+  <jspversion>1.1</jspversion>
+  <shortname>pluto</shortname>
+  <uri>http://portals.apache.org/pluto</uri>
+
+    <tag>
+        <name>commonMsg</name>
+        <tagclass>
+            org.apache.geronimo.console.message.CommonMessageTag
+        </tagclass>
+        <bodycontent>empty</bodycontent>
+    </tag>
+
+</taglib>
+

Propchange: geronimo/server/branches/2.1/plugins/debugviews/debugviews-portlets/src/main/webapp/WEB-INF/CommonMsg.tld
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: geronimo/server/branches/2.1/plugins/debugviews/debugviews-portlets/src/main/webapp/WEB-INF/portlet.xml
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/plugins/debugviews/debugviews-portlets/src/main/webapp/WEB-INF/portlet.xml?rev=781081&r1=781080&r2=781081&view=diff
==============================================================================
--- geronimo/server/branches/2.1/plugins/debugviews/debugviews-portlets/src/main/webapp/WEB-INF/portlet.xml (original)
+++ geronimo/server/branches/2.1/plugins/debugviews/debugviews-portlets/src/main/webapp/WEB-INF/portlet.xml Tue Jun  2 17:00:57 2009
@@ -34,6 +34,9 @@
             <portlet-mode>HELP</portlet-mode>
         </supports>
         <supported-locale>en</supported-locale>
+        <supported-locale>zh</supported-locale>
+        <supported-locale>ja</supported-locale>
+        <resource-bundle>portletinfo</resource-bundle>
         <portlet-info>
             <title>ClassLoader Viewer</title>
             <short-title>classloaderviewer</short-title>
@@ -52,6 +55,9 @@
             <portlet-mode>HELP</portlet-mode>
         </supports>
         <supported-locale>en</supported-locale>
+        <supported-locale>zh</supported-locale>
+        <supported-locale>ja</supported-locale>
+        <resource-bundle>portletinfo</resource-bundle>
         <portlet-info>
             <title>Dependency Viewer</title>
             <short-title>dependencyviewer</short-title>
@@ -70,6 +76,9 @@
             <portlet-mode>HELP</portlet-mode>
         </supports>
         <supported-locale>en</supported-locale>
+        <supported-locale>zh</supported-locale>
+        <supported-locale>ja</supported-locale>
+        <resource-bundle>portletinfo</resource-bundle>
         <portlet-info>
             <title>JMX Viewer</title>
             <short-title>jmxviewer</short-title>
@@ -88,6 +97,9 @@
             <portlet-mode>HELP</portlet-mode>
         </supports>
         <supported-locale>en</supported-locale>
+        <supported-locale>zh</supported-locale>
+        <supported-locale>ja</supported-locale>
+        <resource-bundle>portletinfo</resource-bundle>
         <portlet-info>
             <title>JNDI Viewer</title>
             <short-title>jndiviewer</short-title>
@@ -106,6 +118,9 @@
             <portlet-mode>HELP</portlet-mode>
         </supports>
         <supported-locale>en</supported-locale>
+        <supported-locale>zh</supported-locale>
+        <supported-locale>ja</supported-locale>
+        <resource-bundle>portletinfo</resource-bundle>
         <portlet-info>
             <title>LDAP Viewer</title>
             <short-title>ldapviewer</short-title>

Modified: geronimo/server/branches/2.1/plugins/monitoring/mconsole-war/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/plugins/monitoring/mconsole-war/pom.xml?rev=781081&r1=781080&r2=781081&view=diff
==============================================================================
--- geronimo/server/branches/2.1/plugins/monitoring/mconsole-war/pom.xml (original)
+++ geronimo/server/branches/2.1/plugins/monitoring/mconsole-war/pom.xml Tue Jun  2 17:00:57 2009
@@ -70,6 +70,13 @@
         </dependency>
 
         <dependency>
+            <groupId>org.apache.geronimo.plugins</groupId>
+            <artifactId>console-core</artifactId>
+            <version>${version}</version>
+            <scope>provided</scope>
+        </dependency>
+
+        <dependency>
             <groupId>org.apache.geronimo.plugins.monitoring</groupId>
             <artifactId>agent-ejb</artifactId>
             <version>${monitoringConsoleVersion}</version>

Modified: geronimo/server/branches/2.1/plugins/monitoring/mconsole-war/src/main/java/org/apache/geronimo/monitoring/console/MonitoringPortlet.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/plugins/monitoring/mconsole-war/src/main/java/org/apache/geronimo/monitoring/console/MonitoringPortlet.java?rev=781081&r1=781080&r2=781081&view=diff
==============================================================================
--- geronimo/server/branches/2.1/plugins/monitoring/mconsole-war/src/main/java/org/apache/geronimo/monitoring/console/MonitoringPortlet.java (original)
+++ geronimo/server/branches/2.1/plugins/monitoring/mconsole-war/src/main/java/org/apache/geronimo/monitoring/console/MonitoringPortlet.java Tue Jun  2 17:00:57 2009
@@ -22,23 +22,25 @@
 import java.sql.ResultSet;
 import java.sql.SQLException;
 import java.sql.Statement;
+import java.text.MessageFormat;
 
 import javax.portlet.ActionRequest;
 import javax.portlet.ActionResponse;
-import javax.portlet.GenericPortlet;
 import javax.portlet.PortletConfig;
 import javax.portlet.PortletException;
+import javax.portlet.PortletRequest;
 import javax.portlet.PortletRequestDispatcher;
 import javax.portlet.RenderRequest;
 import javax.portlet.RenderResponse;
 
+import org.apache.geronimo.console.BasePortlet;
 import org.apache.geronimo.monitoring.console.util.DBManager;
 import org.apache.geronimo.crypto.EncryptionManager;
 
 /**
  * STATS
  */
-public class MonitoringPortlet extends GenericPortlet {
+public class MonitoringPortlet extends BasePortlet {
 
     private static final String NORMALVIEW_JSP = "/WEB-INF/view/monitoringNormal.jsp";
 
@@ -169,31 +171,26 @@
         } else if (action.equals("stopThread")
                 || action.equals("disableServerViewQuery")) {
             String server_id = actionRequest.getParameter("server_id");
-            String message = stopThread(server_id);
+            stopThread(server_id, actionRequest);
             actionResponse.setRenderParameter("server_id", server_id);
-            actionResponse.setRenderParameter("message", message);
         } else if (action.equals("startThread")
                 || action.equals("enableServerViewQuery")) {
             String server_id = actionRequest.getParameter("server_id");
             String snapshotDuration = actionRequest
                     .getParameter("snapshotDuration");
-            String message = startThread(server_id, new Long(snapshotDuration));
-            actionResponse.setRenderParameter("message", message);
+            startThread(server_id, new Long(snapshotDuration), actionRequest);
             actionResponse.setRenderParameter("server_id", server_id);
             actionResponse.setRenderParameter("snapshotDuration",
                     snapshotDuration);
         } else if (action.equals("disableServer")
                 || action.equals("disableEditServer")) {
             String server_id = actionRequest.getParameter("server_id");
+            alterServerState(server_id, false, actionRequest);
             actionResponse.setRenderParameter("server_id", server_id);
-            ;
-            actionResponse.setRenderParameter("message", alterServerState(
-                    server_id, false));
         } else if (action.equals("enableServer")
                 || action.equals("enableEditServer")) {
             String server_id = actionRequest.getParameter("server_id");
-            actionResponse.setRenderParameter("message", alterServerState(
-                    server_id, true));
+            alterServerState(server_id, true, actionRequest);
             actionResponse.setRenderParameter("server_id", server_id);
             ;
         } else if (action.equals("testAddServerConnection")) {
@@ -204,8 +201,7 @@
             String password2 = actionRequest.getParameter("password2");
             Integer port = Integer.parseInt(actionRequest.getParameter("port"));
             Integer protocol = Integer.parseInt(actionRequest.getParameter("protocol"));
-            String message = testConnection(name, ip, username, password, port, protocol);
-            actionResponse.setRenderParameter("message", message);
+            testConnection(ip, username, password, port, protocol, actionRequest);
             actionResponse.setRenderParameter("name", name);
             actionResponse.setRenderParameter("username", username);
             actionResponse.setRenderParameter("ip", ip);
@@ -231,8 +227,7 @@
             if(retention == null) {
                 retention = "";
             }
-            String message = testConnection(name, ip, username, password, port, protocol);
-            actionResponse.setRenderParameter("message", message);
+            testConnection(ip, username, password, port, protocol, actionRequest);
             actionResponse.setRenderParameter("name", name);
             actionResponse.setRenderParameter("username", username);
             actionResponse.setRenderParameter("ip", ip);
@@ -247,20 +242,18 @@
         }
     }
 
-    private String testConnection(String name, String ip, String username,
-            String password, int port, int protocol) {
+    private void testConnection(String ip, String username,
+            String password, int port, int protocol, PortletRequest request) {
         try {
-            MRCConnector mrc = new MRCConnector(ip, username, password, port, protocol);
-
-            return "Connection was successfully established.";
+            new MRCConnector(ip, username, password, port, protocol);
+            addInfoMessage(request, getLocalizedString(request, "infoMsg01"));
         } catch (Exception e) {
-            return "Failed to create a connection to server.";
+            addErrorMessage(request, getLocalizedString(request, "errorMsg01"), e.getMessage());
         }
     }
 
-    private String alterServerState(String server_id, boolean b) {
+    private void alterServerState(String server_id, boolean b, PortletRequest request) {
         Connection conn = (new DBManager()).getConnection();
-        String message = "";
         String name = "";
         try {
             PreparedStatement pStmt = conn
@@ -274,15 +267,14 @@
             conn.close();
             conn = (new DBManager()).getConnection();
             Statement stmt = conn.createStatement();
-            if (!b) {
+            if (b) {
                 stmt
                         .executeUpdate("UPDATE SERVERS SET ENABLED = 0 WHERE SERVER_ID="
                                 + server_id);
                 stmt
                         .executeUpdate("UPDATE GRAPHS SET ENABLED = 0 WHERE SERVER_ID="
                                 + server_id);
-                message = "Server " + name
-                        + " was successfully disabled.";
+                addInfoMessage(request, MessageFormat.format(getLocalizedString(request, "infoMsg02"), name));
             } else {
                 stmt
                         .executeUpdate("UPDATE SERVERS SET ENABLED = 1 WHERE SERVER_ID="
@@ -290,18 +282,13 @@
                 stmt
                         .executeUpdate("UPDATE GRAPHS SET ENABLED = 1 WHERE SERVER_ID="
                                 + server_id);
-                message = "Server " + name
-                        + " was successfully enabled.";
+                addInfoMessage(request, MessageFormat.format(getLocalizedString(request, "infoMsg03"), name));
             }
         } catch (SQLException e) {
-            if (!b)
-                message = "[ERROR] Server with server_id = "
-                        + server_id
-                        + " could not be disabled.";
+            if (b)
+                addErrorMessage(request, MessageFormat.format(getLocalizedString(request, "errorMsg02"), server_id), e.getMessage());
             else
-                message = "[ERROR] Server with server_id = "
-                        + server_id
-                        + " could not be enabled.";
+                addErrorMessage(request, MessageFormat.format(getLocalizedString(request, "errorMsg03"), server_id), e.getMessage());
         } finally {
             if (conn != null) {
                 try {
@@ -311,7 +298,6 @@
                 }
             }
         }
-        return message;
     }
 
     @Override
@@ -342,37 +328,28 @@
             request.setAttribute("server_id", server_id);
             String mbean = request.getParameter("mbean");
             request.setAttribute("mbean", mbean);
-            String message = startTrackingMbean(server_id, mbean);
-            request.setAttribute("message", message);
+            startTrackingMbean(server_id, mbean, request);
             viewServer.include(request, response);
         } else if (action.equals("stopTrackingMbean")) {
             String server_id = request.getParameter("server_id");
             request.setAttribute("server_id", server_id);
             String mbean = request.getParameter("mbean");
             request.setAttribute("mbean", mbean);
-            String message = stopTrackingMbean(server_id, mbean);
-            request.setAttribute("message", message);
+            stopTrackingMbean(server_id, mbean, request);
             viewServer.include(request, response);
         } else if (action.equals("stopThread")) {
             String server_id = request.getParameter("server_id");
-            String message = request.getParameter("message");
-            request.setAttribute("message", message);
             normalView.include(request, response);
         } else if (action.equals("startThread")) {
             String server_id = request.getParameter("server_id");
             Long snapshotDuration = java.lang.Long.parseLong(
                     request.getParameter("snapshotDuration"));
-            String message = request.getParameter("message");
-            request.setAttribute("message", message);
             normalView.include(request, response);
         } else if (action.equals("disableServerViewQuery") || action.equals("enableServerViewQuery")) {
             String server_id = request.getParameter("server_id");
-            String message = request.getParameter("message");
-            request.setAttribute("message", message);
             request.setAttribute("server_id", server_id);
             viewServer.include(request, response);
         } else {
-            request.setAttribute("message", request.getParameter("message"));
             normalView.include(request, response);
         }
     }
@@ -396,14 +373,10 @@
         } else if (action.equals("saveEditView")) {
             String view_id = request.getParameter("view_id");
             request.setAttribute("view_id", view_id);
-            String message = request.getParameter("message");
-            request.setAttribute("message", message);
             editView.include(request, response);
         } else if (action.equals("showAddView")) {
             addView.include(request, response);
         } else if (action.equals("saveAddView")) {
-            String message = request.getParameter("message");
-            request.setAttribute("message", message);
             normalView.include(request, response);
         } else if (action.equals("showAddGraph")) {
             String server_id = request.getParameter("server_id");
@@ -414,8 +387,6 @@
             request.setAttribute("dataname", dataname);
             addGraph.include(request, response);
         } else if (action.equals("saveAddGraph")) {
-            String message = request.getParameter("message");
-            request.setAttribute("message", message);
             normalView.include(request, response);
         } else if (action.equals("showEditGraph")) {
             String graph_id = request.getParameter("graph_id");
@@ -424,16 +395,10 @@
         } else if (action.equals("saveEditGraph")) {
             String graph_id = request.getParameter("graph_id");
             request.setAttribute("graph_id", graph_id);
-            String message = request.getParameter("message");
-            request.setAttribute("message", message);
             editGraph.include(request, response);
         } else if (action.equals("deleteGraph")) {
-            String message = request.getParameter("message");
-            request.setAttribute("message", message);
             normalView.include(request, response);
         } else if (action.equals("deleteView")) {
-            String message = request.getParameter("message");
-            request.setAttribute("message", message);
             normalView.include(request, response);
         } else if (action.equals("showEditServer")) {
             String server_id = request.getParameter("server_id");
@@ -442,18 +407,12 @@
         } else if (action.equals("saveEditServer")) {
             String server_id = request.getParameter("server_id");
             request.setAttribute("server_id", server_id);
-            String message = request.getParameter("message");
-            request.setAttribute("message", message);
             editServer.include(request, response);
         } else if (action.equals("showAddServer")) {
             addServer.include(request, response);
         } else if (action.equals("saveAddServer")) {
-            String message = request.getParameter("message");
-            request.setAttribute("message", message);
             normalView.include(request, response);
         } else if (action.equals("deleteServer")) {
-            String message = request.getParameter("message");
-            request.setAttribute("message", message);
             normalView.include(request, response);
         } else if (action.equals("testAddServerConnection")) {
             request.setAttribute("name", request.getParameter("name"));
@@ -463,7 +422,6 @@
             request
                     .setAttribute("password2", request
                             .getParameter("password2"));
-            request.setAttribute("message", request.getParameter("message"));
             request.setAttribute("port", request.getParameter("port"));
             addServer.include(request, response);
         } else if (action.equals("testEditServerConnection")) {
@@ -475,7 +433,6 @@
             request
                     .setAttribute("password2", request
                             .getParameter("password2"));
-            request.setAttribute("message", request.getParameter("message"));
             request
                     .setAttribute("server_id", request
                             .getParameter("server_id"));
@@ -486,14 +443,12 @@
             editServer.include(request, response);
         } else if (action.equals("disableEditServer")
                 || action.equals("enableEditServer")) {
-            request.setAttribute("message", request.getParameter("message"));
             request
                     .setAttribute("server_id", request
                             .getParameter("server_id"));
             editServer.include(request, response);
         } else if (action.equals("disableServer")
                 || action.equals("enableServer")) {
-            request.setAttribute("message", request.getParameter("message"));
             request
                     .setAttribute("server_id", request
                             .getParameter("server_id"));
@@ -535,15 +490,11 @@
                     pStmt.executeUpdate();
                 }
             con.close();
-            actionResponse.setRenderParameter("message",
-                    "View " + name
-                            + " has been updated");
+            addInfoMessage(actionRequest, MessageFormat.format(getLocalizedString(actionRequest, "infoMsg08"), name));
             return;
 
         } catch (Exception e) {
-            actionResponse.setRenderParameter("message",
-                    "Error updating View "
-                            + name + " " + e.getMessage());
+            addErrorMessage(actionRequest, MessageFormat.format(getLocalizedString(actionRequest, "errorMsg11"), name), e.getMessage());
             return;
         }
     }
@@ -581,13 +532,9 @@
                 }
             }
             con.close();
-            actionResponse.setRenderParameter("message",
-                    "View " + name
-                            + " has been added");
+            addInfoMessage(actionRequest, MessageFormat.format(getLocalizedString(actionRequest, "infoMsg09"), name));
         } catch (Exception e) {
-            actionResponse.setRenderParameter("message",
-                    "Error adding View " + name
-                            + " " + e.getMessage());
+            addErrorMessage(actionRequest, MessageFormat.format(getLocalizedString(actionRequest, "errorMsg12"), name), e.getMessage());
         } finally {
             try {
                 con.close();
@@ -674,14 +621,9 @@
                         .setSnapshotRetention(Integer.parseInt(retention));
             }
             // set success message
-            actionResponse
-                    .setRenderParameter(
-                            "message",
-                            "Server has been updated");
+            addInfoMessage(actionRequest, getLocalizedString(actionRequest, "infoMsg10"));
         } catch (Exception e) {
-            actionResponse.setRenderParameter("message",
-                    "Error updating server "
-                            + e.getMessage());
+            addErrorMessage(actionRequest, getLocalizedString(actionRequest, "errorMsg13"), e.getMessage());
         }
     }
 
@@ -714,14 +656,9 @@
                             + ","
                             + protocol + ")");
             pStmt.executeUpdate();
-            actionResponse.setRenderParameter("message",
-                    "Server " + name + " at "
-                            + ip + " has been added.");
-
+            addInfoMessage(actionRequest, MessageFormat.format(getLocalizedString(actionRequest, "infoMsg11"), name, ip));
         } catch (Exception e) {
-            actionResponse.setRenderParameter("message",
-                    "Error adding server "
-                            + e.getMessage());
+            addErrorMessage(actionRequest, getLocalizedString(actionRequest, "errorMsg14"), e.getMessage());
         } finally {
             try {
                 con.close();
@@ -748,16 +685,11 @@
                     + server_id);
             pStmt.executeUpdate();
             con.close();
-            actionResponse
-                    .setRenderParameter(
-                            "message",
-                            "Server and associated graphs have been deleted");
+            addInfoMessage(actionRequest, getLocalizedString(actionRequest, "infoMsg12"));
             return;
 
         } catch (Exception e) {
-            actionResponse.setRenderParameter("message",
-                    "Error deleting server "
-                            + e.getMessage());
+            addErrorMessage(actionRequest, getLocalizedString(actionRequest, "errorMsg15"), e.getMessage());
             return;
         }
     }
@@ -779,15 +711,11 @@
                             + view_id);
             pStmt.executeUpdate();
             con.close();
-            actionResponse
-                    .setRenderParameter("message",
-                            "View has been deleted");
+            addInfoMessage(actionRequest, getLocalizedString(actionRequest, "infoMsg13"));
             return;
 
         } catch (Exception e) {
-            actionResponse.setRenderParameter("message",
-                    "Error deleting view "
-                            + e.getMessage());
+            addErrorMessage(actionRequest, getLocalizedString(actionRequest, "errorMsg16"), e.getMessage());
             return;
         }
     }
@@ -849,15 +777,11 @@
                             + showArchive + ")");
             pStmt.executeUpdate();
             con.close();
-            actionResponse.setRenderParameter("message",
-                    "Graph " + name
-                            + " has been added.");
+            addInfoMessage(actionRequest, MessageFormat.format(getLocalizedString(actionRequest, "infoMsg14"), name));
             return;
 
         } catch (Exception e) {
-            actionResponse.setRenderParameter("message",
-                    "Error adding graph "
-                            + e.getMessage());
+            addErrorMessage(actionRequest, getLocalizedString(actionRequest, "errorMsg17"), e.getMessage());
             return;
         }
     }
@@ -922,15 +846,11 @@
                             + archive + " WHERE graph_id=" + graph_id);
             pStmt.executeUpdate();
             con.close();
-            actionResponse.setRenderParameter("message",
-                    "Graph " + name
-                            + " has been updated.");
+            addInfoMessage(actionRequest, MessageFormat.format(getLocalizedString(actionRequest, "infoMsg15"), name));
             return;
 
         } catch (Exception e) {
-            actionResponse.setRenderParameter("message",
-                    "Error editing graph "
-                            + e.getMessage());
+            addErrorMessage(actionRequest, getLocalizedString(actionRequest, "errorMsg18"), e.getMessage());
             return;
         }
     }
@@ -938,6 +858,7 @@
     private void deleteGraph(ActionRequest actionRequest,
             ActionResponse actionResponse) {
         String graph_id = actionRequest.getParameter("graph_id");
+        String name = actionRequest.getParameter("name");
         actionResponse.setRenderParameter("graph_id", graph_id);
         DBManager DBase = new DBManager();
         Connection con = DBase.getConnection();
@@ -966,20 +887,16 @@
                             + graph_id);
             pStmt.executeUpdate();
             con.close();
-            actionResponse
-                    .setRenderParameter("message",
-                            "Graph has been deleted");
+            addInfoMessage(actionRequest, MessageFormat.format(getLocalizedString(actionRequest, "infoMsg16"), name));
             return;
 
         } catch (Exception e) {
-            actionResponse.setRenderParameter("message",
-                    "Error deleting graph "
-                            + e.getMessage());
+            addErrorMessage(actionRequest, getLocalizedString(actionRequest, "errorMsg19"), e.getMessage());
             return;
         }
     }
 
-    private String startTrackingMbean(String server_id, String mbean) {
+    private void startTrackingMbean(String server_id, String mbean, PortletRequest request) {
         PreparedStatement pStmt = null;
         ResultSet rs = null;
         MRCConnector mrc = null;
@@ -997,9 +914,8 @@
                             + server_id);
             rs = pStmt.executeQuery();
             if (!rs.next()) {
-                return "DATABASE ERROR: Server id "
-                        + server_id
-                        + " not found in database";
+                addErrorMessage(request, MessageFormat.format(getLocalizedString(request, "errorMsg08"), server_id));
+                return;
             }
             server_ip = rs.getString("ip");
             password = rs.getString("password");
@@ -1007,40 +923,36 @@
             port = rs.getInt("port");
             protocol = rs.getInt("protocol");
         } catch (SQLException e) {
-            return "DATABASE ERROR: "
-                    + e.getMessage();
+            addErrorMessage(request, getLocalizedString(request, "errorMsg04"), e.getMessage());
+            return;
         }
         // attempt to connect to the mrc server
         try {
             con.close();
             mrc = new MRCConnector(server_ip, username, password, port, protocol);
         } catch (Exception e) {
-            return "MRC ERROR: Unable to connect to server "
-                    + server_ip
-                    + ": "
-                    + e.getMessage();
+            addErrorMessage(request, MessageFormat.format(getLocalizedString(request, "errorMsg05"), server_ip), e.getMessage());
+            return;
         }
 
         // tell the mrc server to start tracking an mbean
         try {
             if (mrc.startTrackingMbean(mbean)) {
                 String mbarr[] = mbean.split("name=");
-                return "MBean " + mbarr[1]
-                        + " tracking on server " + rs.getString("name");
+                addInfoMessage(request, MessageFormat.format(getLocalizedString(request, "infoMsg04"), mbarr[1], rs.getString("name")));
+                return;
             } else {
                 String mbarr[] = mbean.split("name=");
-                return "ERROR: MBean "
-                        + mbarr[1] + " could NOT be tracked on server "
-                        + rs.getString("name");
+                addErrorMessage(request, MessageFormat.format(getLocalizedString(request, "errorMsg06"), mbarr[1], rs.getString("name")));
+                return;
             }
         } catch (Exception e) {
-            return "MRC ERROR: MBean " + mbean
-                    + " could NOT be tracked on server " + server_ip
-                    + ": " + e.getMessage();
+            addErrorMessage(request, MessageFormat.format(getLocalizedString(request, "errorMsg06"), mbean, server_ip), e.getMessage());
+            return;
         }
     }
 
-    private String stopTrackingMbean(String server_id, String mbean) {
+    private void stopTrackingMbean(String server_id, String mbean, PortletRequest request) {
         PreparedStatement pStmt = null;
         ResultSet rs = null;
         MRCConnector mrc = null;
@@ -1058,9 +970,8 @@
                             + server_id);
             rs = pStmt.executeQuery();
             if (!rs.next()) {
-                return "DATABASE ERROR: Server id "
-                        + server_id
-                        + " not found in database";
+                addErrorMessage(request, MessageFormat.format(getLocalizedString(request, "errorMsg08"), server_id));
+                return;
             }
             server_ip = rs.getString("ip");
             password = rs.getString("password");
@@ -1068,41 +979,34 @@
             port = rs.getInt("port");
             protocol = rs.getInt("protocol");
         } catch (SQLException e) {
-            return "DATABASE ERROR: "
-                    + e.getMessage();
+            addErrorMessage(request, getLocalizedString(request, "errorMsg04"), e.getMessage());
+            return;
         }
         // attempt to connect to the mrc-server
         try {
             con.close();
                 mrc = new MRCConnector(server_ip, username, password, port, protocol);
-       } catch (Exception e) {
-            return "MRC ERROR: Unable to connect to server "
-                    + server_ip
-                    + ": "
-                    + e.getMessage();
+        } catch (Exception e) {
+           addErrorMessage(request, MessageFormat.format(getLocalizedString(request, "errorMsg05"), server_ip), e.getMessage());
+           return;
         }
         // tell the mrc-server to stop tracking some mbean
         try {
             if (mrc.stopTrackingMbean(mbean)) {
                 String mbarr[] = mbean.split("name=");
-                return "MBean " + mbarr[1]
-                        + " removed from tracking on server "
-                        + rs.getString("name");
+                addInfoMessage(request, MessageFormat.format(getLocalizedString(request, "infoMsg05"), mbarr[1], rs.getString("name")));
+                return;
             } else {
                 String mbarr[] = mbean.split("name=");
-                return "ERROR: MBean "
-                        + mbarr[1]
-                        + " could NOT be removed from tracking on server "
-                        + rs.getString("name");
+                addErrorMessage(request, MessageFormat.format(getLocalizedString(request, "errorMsg07"), mbarr[1], rs.getString("name")));
+                return;
             }
         } catch (Exception e) {
-            return "MRC ERROR: MBean " + mbean
-                    + " could NOT be removed from tracking on server "
-                    + server_ip + ": " + e.getMessage();
+            addErrorMessage(request, MessageFormat.format(getLocalizedString(request, "errorMsg07"), mbean, server_ip), e.getMessage());
         }
     }
 
-    private String stopThread(String server_id) {
+    private void stopThread(String server_id, PortletRequest request) {
         PreparedStatement pStmt = null;
         ResultSet rs = null;
         MRCConnector mrc = null;
@@ -1120,9 +1024,8 @@
                             + server_id);
             rs = pStmt.executeQuery();
             if (!rs.next()) {
-                return "DATABASE ERROR: Server id "
-                        + server_id
-                        + " not found in database";
+                addErrorMessage(request, MessageFormat.format(getLocalizedString(request, "errorMsg08"), server_id));
+                return;
             }
             server_ip = rs.getString("ip");
             password = rs.getString("password");
@@ -1130,38 +1033,34 @@
             port = rs.getInt("port");
             protocol = rs.getInt("protocol");
         } catch (SQLException e) {
-            return "DATABASE ERROR: "
-                    + e.getMessage();
+            addErrorMessage(request, getLocalizedString(request, "errorMsg04"), e.getMessage());
+            return;
         }
         // attempt to connect to the mrc-server
         try {
             con.close();
             mrc = new MRCConnector(server_ip, username, password, port, protocol);
         } catch (Exception e) {
-            return "MRC ERROR: Unable to connect to server "
-                    + server_ip
-                    + ": "
-                    + e.getMessage();
+            addErrorMessage(request, MessageFormat.format(getLocalizedString(request, "errorMsg05"), server_ip), e.getMessage());
+            return;
         }
         // tell the mrc-server to stop taking snapshots
         try {
             if (mrc.stopSnapshotThread()) {
-                return "Snapshot thread stopped on server "
-                        + rs.getString("name");
+                addInfoMessage(request, MessageFormat.format(getLocalizedString(request, "infoMsg06"), server_ip));
+                return;
             } else {
-                return "ERROR: Snapshot thread could NOT be stopped on server "
-                        + rs.getString("name");
+                addErrorMessage(request, MessageFormat.format(getLocalizedString(request, "errorMsg09"), server_ip));
+                return;
             }
 
         } catch (Exception e) {
-            return "MRC ERROR: Snapshot thread could NOT be stopped on server "
-                    + server_ip
-                    + ": "
-                    + e.getMessage();
+            addErrorMessage(request, MessageFormat.format(getLocalizedString(request, "errorMsg09"), server_ip), e.getMessage());
+            return;
         }
     }
 
-    private String startThread(String server_id, Long snapshotDuration) {
+    private void startThread(String server_id, Long snapshotDuration, PortletRequest request) {
         PreparedStatement pStmt = null;
         ResultSet rs = null;
         MRCConnector mrc = null;
@@ -1179,9 +1078,8 @@
                             + server_id);
             rs = pStmt.executeQuery();
             if (!rs.next()) {
-                return "DATABASE ERROR: Server id "
-                        + server_id
-                        + " not found in database";
+                addErrorMessage(request, MessageFormat.format(getLocalizedString(request, "errorMsg08"), server_id));
+                return;
             }
             server_ip = rs.getString("ip");
             password = rs.getString("password");
@@ -1189,33 +1087,29 @@
             port = rs.getInt("port");
             protocol = rs.getInt("protocol");
         } catch (SQLException e) {
-            return "DATABASE ERROR: "
-                    + e.getMessage();
+            addErrorMessage(request, getLocalizedString(request, "errorMsg04"), e.getMessage());
+            return;
         }
         // attempt to connect to the mrc-server
         try {
             con.close();
             mrc = new MRCConnector(server_ip, username, password, port, protocol);
         } catch (Exception e) {
-            return "MRC ERROR: Unable to connect to server "
-                    + server_ip
-                    + ": "
-                    + e.getMessage();
+            addErrorMessage(request, MessageFormat.format(getLocalizedString(request, "errorMsg05"), server_ip), e.getMessage());
+            return;
         }
         // tell the mrc-server to start the collection of statistics
         try {
             if (mrc.startSnapshotThread(new Long(snapshotDuration))) {
-                return "Snapshot thread started on server "
-                        + rs.getString("name");
+                addInfoMessage(request, MessageFormat.format(getLocalizedString(request, "infoMsg07"), rs.getString("name")));
+                return;
             } else {
-                return "ERROR: Snapshot thread could NOT be started on server "
-                        + rs.getString("name");
+                addErrorMessage(request, MessageFormat.format(getLocalizedString(request, "errorMsg10"), rs.getString("name")));
+                return;
             }
         } catch (Exception e) {
-            return "MRC ERROR: Snapshot thread could NOT be started on server "
-                    + server_ip
-                    + ": "
-                    + e.getMessage();
+            addErrorMessage(request, MessageFormat.format(getLocalizedString(request, "errorMsg10"), server_ip), e.getMessage());
+            return;
         }
     }
 



Mime
View raw message