geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rwo...@apache.org
Subject svn commit: r1082391 - in /geronimo/server/trunk/plugins/console/console-base-portlets/src/main: i18n-resources/ java/org/apache/geronimo/console/bundlemanager/
Date Thu, 17 Mar 2011 04:06:33 GMT
Author: rwonly
Date: Thu Mar 17 04:06:33 2011
New Revision: 1082391

URL: http://svn.apache.org/viewvc?rev=1082391&view=rev
Log:
GERONIMO-5847 improve info/warning/error messages

Modified:
    geronimo/server/trunk/plugins/console/console-base-portlets/src/main/i18n-resources/portletinfo_en.properties
    geronimo/server/trunk/plugins/console/console-base-portlets/src/main/i18n-resources/portletinfo_ja.properties
    geronimo/server/trunk/plugins/console/console-base-portlets/src/main/i18n-resources/portletinfo_zh.properties
    geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/bundlemanager/BundleManagerPortlet.java

Modified: geronimo/server/trunk/plugins/console/console-base-portlets/src/main/i18n-resources/portletinfo_en.properties
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/console/console-base-portlets/src/main/i18n-resources/portletinfo_en.properties?rev=1082391&r1=1082390&r2=1082391&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/console/console-base-portlets/src/main/i18n-resources/portletinfo_en.properties
(original)
+++ geronimo/server/trunk/plugins/console/console-base-portlets/src/main/i18n-resources/portletinfo_en.properties
Thu Mar 17 04:06:33 2011
@@ -160,3 +160,16 @@ consolebase.warnMsg05  = CA is not runni
 consolebase.warnMsg06  = A certificate with the serial number <b>{0}</b> has
already been issued. You might be seeing this message since you have clicked 'Issue Certificate'
button a second time.
 consolebase.warnMsg07  = <p style='font-size:120%;'><b>A shutdown of the server
will disable this Web Console! Proceed only if you are certain you want to terminate the server.</b></p>
 consolebase.warnMsg08  = There are no Web Containers defined.
+
+consolebase.bundlemanager.info.start            = Bundle: {0} (id={1}) is successfully started.
+consolebase.bundlemanager.info.stop             = Bundle: {0} (id={1}) is successfully stopped.
+consolebase.bundlemanager.info.update           = Bundle: {0} (id={1}) is successfully updated.
+consolebase.bundlemanager.info.refresh          = Bundle: {0} (id={1}) is successfully refreshed.
+consolebase.bundlemanager.info.uninstall        = Bundle: {0} (id={1}) is successfully uninstalled.
+consolebase.bundlemanager.info.install          = Bundle: {0} is successfully installed,
its Id is {1}.
+consolebase.bundlemanager.warn.invalidAction    = Invalid action:
+consolebase.bundlemanager.warn.nobundlesfound   = No bundles found of this type. 
+consolebase.bundlemanager.err.actionError       = Encountered an unhandled exception while
process action: 
+consolebase.bundlemanager.err.file.uploadError  = File upload failed, encounter a FileUploadException.
+consolebase.bundlemanager.err.file.writeError   = Write file failed, encounter an unhandled
exception.
+consolebase.bundlemanager.err.file.nullError    = The uploaded file is null.

Modified: geronimo/server/trunk/plugins/console/console-base-portlets/src/main/i18n-resources/portletinfo_ja.properties
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/console/console-base-portlets/src/main/i18n-resources/portletinfo_ja.properties?rev=1082391&r1=1082390&r2=1082391&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/console/console-base-portlets/src/main/i18n-resources/portletinfo_ja.properties
(original)
+++ geronimo/server/trunk/plugins/console/console-base-portlets/src/main/i18n-resources/portletinfo_ja.properties
Thu Mar 17 04:06:33 2011
@@ -161,3 +161,16 @@ consolebase.warnMsg05  = 認証å�
 consolebase.warnMsg06  = シリアル番号 <b>{0}</b> の証明書はすでに発行済みです。'証明書の発行'
ボタンを 2 回クリックしたため、このメッセージを確認した可能性があります。
 consolebase.warnMsg07  = <div style='font-size:large;'><b>サーバーのシャットダウンは、この
Web コンソールを無効化します!</b></div>\r\n<p>サーバーを強制終了させたい場合のみ続行してください。</p>
 consolebase.warnMsg08  = Web コンテナーを定義していません。
+
+consolebase.bundlemanager.info.start            = Bundle: {0} (id={1}) is successfully started.
+consolebase.bundlemanager.info.stop             = Bundle: {0} (id={1}) is successfully stopped.
+consolebase.bundlemanager.info.update           = Bundle: {0} (id={1}) is successfully updated.
+consolebase.bundlemanager.info.refresh          = Bundle: {0} (id={1}) is successfully refreshed.
+consolebase.bundlemanager.info.uninstall        = Bundle: {0} (id={1}) is successfully uninstalled.
+consolebase.bundlemanager.info.install          = Bundle: {0} is successfully installed,
its Id is {1}.
+consolebase.bundlemanager.warn.invalidAction    = Invalid action:
+consolebase.bundlemanager.warn.nobundlesfound   = No bundles found of this type. 
+consolebase.bundlemanager.err.actionError       = Encountered an unhandled exception while
process action: 
+consolebase.bundlemanager.err.file.uploadError  = File upload failed, encounter a FileUploadException.
+consolebase.bundlemanager.err.file.writeError   = Write file failed, encounter an unhandled
exception.
+consolebase.bundlemanager.err.file.nullError    = The uploaded file is null.
\ No newline at end of file

Modified: geronimo/server/trunk/plugins/console/console-base-portlets/src/main/i18n-resources/portletinfo_zh.properties
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/console/console-base-portlets/src/main/i18n-resources/portletinfo_zh.properties?rev=1082391&r1=1082390&r2=1082391&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/console/console-base-portlets/src/main/i18n-resources/portletinfo_zh.properties
(original)
+++ geronimo/server/trunk/plugins/console/console-base-portlets/src/main/i18n-resources/portletinfo_zh.properties
Thu Mar 17 04:06:33 2011
@@ -161,3 +161,16 @@ consolebase.warnMsg05  = CA未处�
 consolebase.warnMsg06  = 序列号为<b>{0}</b>的证书先前已被发布,当你点击了'发布证书'按钮两次时你可能会看到这条消息。
 consolebase.warnMsg07  = <p style='font-size:120%;'><b>关闭服务器将会使Web控制台不可用!只有当你确定要关闭服务器时,才继续。</b></p>
 consolebase.warnMsg08  = 未定义任何Web容器。
+
+consolebase.bundlemanager.info.start            = Bundle: {0} (id={1}) is successfully started.
+consolebase.bundlemanager.info.stop             = Bundle: {0} (id={1}) is successfully stopped.
+consolebase.bundlemanager.info.update           = Bundle: {0} (id={1}) is successfully updated.
+consolebase.bundlemanager.info.refresh          = Bundle: {0} (id={1}) is successfully refreshed.
+consolebase.bundlemanager.info.uninstall        = Bundle: {0} (id={1}) is successfully uninstalled.
+consolebase.bundlemanager.info.install          = Bundle: {0} is successfully installed,
its Id is {1}.
+consolebase.bundlemanager.warn.invalidAction    = Invalid action:
+consolebase.bundlemanager.warn.nobundlesfound   = No bundles found of this type. 
+consolebase.bundlemanager.err.actionError       = Encountered an unhandled exception while
process action: 
+consolebase.bundlemanager.err.file.uploadError  = File upload failed, encounter a FileUploadException.
+consolebase.bundlemanager.err.file.writeError   = Write file failed, encounter an unhandled
exception.
+consolebase.bundlemanager.err.file.nullError    = The uploaded file is null.
\ No newline at end of file

Modified: geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/bundlemanager/BundleManagerPortlet.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/bundlemanager/BundleManagerPortlet.java?rev=1082391&r1=1082390&r2=1082391&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/bundlemanager/BundleManagerPortlet.java
(original)
+++ geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/bundlemanager/BundleManagerPortlet.java
Thu Mar 17 04:06:33 2011
@@ -52,7 +52,6 @@ import org.apache.geronimo.kernel.config
 import org.apache.geronimo.kernel.config.ConfigurationManager;
 import org.apache.xbean.osgi.bundle.util.BundleDescription;
 import org.apache.xbean.osgi.bundle.util.VersionRange;
-import org.apache.xbean.osgi.bundle.util.BundleDescription.RequireBundle;
 import org.osgi.framework.Bundle;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.BundleException;
@@ -187,30 +186,31 @@ public class BundleManagerPortlet extend
                 
                 try {
                     Bundle bundle = bundleContext.getBundle(Long.parseLong(id));
-
+                    String symbolicName = bundle.getSymbolicName();
+                                        
                     if (START_OPERATION.equals(operation)) {
                         bundle.start();
-                        addInfoMessage(actionRequest, "bundle started");
+                        addInfoMessage(actionRequest, getLocalizedString(actionRequest, "consolebase.bundlemanager.info.start",
symbolicName, id));
                     } else if (STOP_OPERATION.equals(operation)) {
                         bundle.stop();
-                        addInfoMessage(actionRequest, getLocalizedString(actionRequest, "consolebase.infoMsg02"));
+                        addInfoMessage(actionRequest, getLocalizedString(actionRequest, "consolebase.bundlemanager.info.stop",
symbolicName, id));
                     } else if (UNINSTALL_OPERATION.equals(operation)) {
                         bundle.uninstall();
-                        addInfoMessage(actionRequest, getLocalizedString(actionRequest, "consolebase.infoMsg04")
+ "<br />" + BundleUtil.getSymbolicName(bundle));
+                        addInfoMessage(actionRequest, getLocalizedString(actionRequest, "consolebase.bundlemanager.info.uninstall",
symbolicName, id));
                     } else if (UPDATE_OPERATION.equals(operation)) {
                         bundle.update();
-                        addInfoMessage(actionRequest, getLocalizedString(actionRequest, "consolebase.infoMsg19"));
+                        addInfoMessage(actionRequest, getLocalizedString(actionRequest, "consolebase.bundlemanager.info.update",
symbolicName, id));
                     } else if (REFRESH_OPERATION.equals(operation)) {
                         ServiceReference reference = bundleContext.getServiceReference(PackageAdmin.class.getName());
                         PackageAdmin packageAdmin = (PackageAdmin) bundle.getBundleContext().getService(reference);
                         packageAdmin.refreshPackages(new Bundle[]{bundle});
-                        addInfoMessage(actionRequest, "bundle refreshed");
+                        addInfoMessage(actionRequest, getLocalizedString(actionRequest, "consolebase.bundlemanager.info.refresh",
symbolicName, id));
                     } else {
-                        addWarningMessage(actionRequest, getLocalizedString(actionRequest,
"consolebase.warnMsg01") + action + "<br />");
-                        throw new PortletException("Invalid value for changeState: " + action);
-                    }            
+                        // should never happen
+                        addWarningMessage(actionRequest, getLocalizedString(actionRequest,
"consolebase.bundlemanager.warn.invalidAction") + action);
+                    }
                 } catch (Throwable e) {
-                    addErrorMessage(actionRequest, getLocalizedString(actionRequest, "consolebase.errorMsg03"),
e.getMessage());
+                    addErrorMessage(actionRequest, getLocalizedString(actionRequest, "consolebase.bundlemanager.err.actionError")
+ action, e.getMessage());
                     logger.error("Exception", e);
                 }
             }
@@ -410,7 +410,7 @@ public class BundleManagerPortlet extend
                 renderRequest.setAttribute("initStartLevel", startLevelService.getInitialBundleStartLevel());
                 
                 if (bundleInfos.size() == 0) {
-                    addWarningMessage(renderRequest, getLocalizedString(renderRequest, "consolebase.warnMsg02"));
+                    addWarningMessage(renderRequest, getLocalizedString(renderRequest, "consolebase.bundlemanager.warn.nobundlesfound"));
                 }
                 
                 bundleManagerView.include(renderRequest, renderResponse);
@@ -933,8 +933,8 @@ public class BundleManagerPortlet extend
         try {
             items = uploader.parseRequest(request);
         } catch (FileUploadException e) {
-            addErrorMessage(request, "file upload failed!");
-            logger.error("file upload failed!",e);
+            addErrorMessage(request, getLocalizedString(request, "consolebase.bundlemanager.err.file.uploadError"));
+            logger.error("FileUploadException", e);
             return;
         }
 
@@ -957,13 +957,14 @@ public class BundleManagerPortlet extend
                     try {
                         item.write(bundleFile);
                     } catch (Exception e) {
-                        addErrorMessage(request, "write file failed!");
-                        logger.error("write file failed!", e);
+                        addErrorMessage(request, getLocalizedString(request,"consolebase.bundlemanager.err.file.writeError"));
+                        logger.error("Exception", e);
                         return;
                     }
                 } else {
-                    addErrorMessage(request, "the file is null!");
-                    logger.error("the file is null!");
+                    //should never happen
+                    addErrorMessage(request, getLocalizedString(request, "consolebase.bundlemanager.err.file.nullError"));
+                    logger.error("The uploaded file is null!");
                     return;
                 }
             } else {
@@ -981,10 +982,10 @@ public class BundleManagerPortlet extend
         Bundle installedBundle;
         try {
             installedBundle = bundleContext.installBundle(url);
-            addInfoMessage(request, "bundle installed");
+            addInfoMessage(request, getLocalizedString(request, "consolebase.bundlemanager.info.install",
installedBundle.getSymbolicName(), installedBundle.getBundleId()));
         } catch (BundleException e) {
-            addErrorMessage(request, "install bundle failed!");
-            logger.error("install bundle failed!", e);
+            addErrorMessage(request, getLocalizedString(request, "consolebase.bundlemanager.err.actionError")
+ "install", e.getMessage());
+            logger.error("BundleException", e);
             return;
         }
         
@@ -1005,10 +1006,10 @@ public class BundleManagerPortlet extend
         if ("yes".equals(startAfterInstalled)) {
             try {
                 installedBundle.start();
-                addInfoMessage(request, "bundle started");
+                addInfoMessage(request, getLocalizedString(request, "consolebase.bundlemanager.info.start",
installedBundle.getSymbolicName(), installedBundle.getBundleId()));
             } catch (BundleException e) {
-                addErrorMessage(request, "start bundle failed!");
-                logger.error("start bundle failed!", e);
+                addErrorMessage(request, getLocalizedString(request, "consolebase.bundlemanager.err.actionError")
+ "start", e.getMessage());
+                logger.error("BundleException", e);
                 return;
             }
             



Mime
View raw message