Author: mwringe
Date: 2010-03-19 13:30:29 -0400 (Fri, 19 Mar 2010)
New Revision: 2321
Modified:
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortletForm.java
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortletLifecycle.java
Log:
GTNPORTAL-894: make portlet exceptions shown in the portal use the localized error
message. The message has already been localized, this change just enables the use of the
localized message instead of a hardcoded one.
Modified:
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortletForm.java
===================================================================
---
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortletForm.java 2010-03-19
17:23:17 UTC (rev 2320)
+++
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortletForm.java 2010-03-19
17:30:29 UTC (rev 2321)
@@ -247,7 +247,8 @@
}
catch (Throwable ex)
{
- portletContent.append("This portlet encountered an error and could not be
displayed.");
+ WebuiRequestContext webuiRequest = WebuiRequestContext.getCurrentInstance();
+
portletContent.append(webuiRequest.getApplicationResourceBundle().getString("UIPortlet.message.RuntimeError"));
log.error("The portlet " + uiPortlet_.getName() + " could not be
loaded. Check if properly deployed.",
ExceptionUtil.getRootCause(ex));
}
Modified:
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortletLifecycle.java
===================================================================
---
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortletLifecycle.java 2010-03-19
17:23:17 UTC (rev 2320)
+++
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortletLifecycle.java 2010-03-19
17:30:29 UTC (rev 2321)
@@ -292,7 +292,7 @@
.getComponentInstanceOfType(PortletExceptionHandleService.class);
portletExceptionService.handle(pcException);
- markup = Text.create("This portlet encountered an error and
could not be displayed.");
+ markup =
Text.create(context.getApplicationResourceBundle().getString("UIPortlet.message.RuntimeError"));
}
}
}
@@ -312,7 +312,7 @@
log.warn("Could not find the PortletExceptionHandleService in the exo
container");
}
- markup = Text.create("This portlet encountered an error and could not be
displayed.");
+ markup =
Text.create(context.getApplicationResourceBundle().getString("UIPortlet.message.RuntimeError"));
}
//
Show replies by date