Author: mwringe
Date: 2010-01-19 02:20:13 -0500 (Tue, 19 Jan 2010)
New Revision: 1363
Modified:
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortlet.java
Log:
Catch NoSuchPortletException and set the requested portlet to null instead. This will
allow for the error to be properly handled and displayed when the portlet is rendered.
Modified:
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortlet.java
===================================================================
---
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortlet.java 2010-01-19
07:06:40 UTC (rev 1362)
+++
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortlet.java 2010-01-19
07:20:13 UTC (rev 1363)
@@ -49,6 +49,7 @@
import org.gatein.common.i18n.LocalizedString;
import org.gatein.common.net.media.MediaType;
import org.gatein.pc.api.Mode;
+import org.gatein.pc.api.NoSuchPortletException;
import org.gatein.pc.api.PortletContext;
import org.gatein.pc.api.PortletInvoker;
import org.gatein.pc.api.PortletInvokerException;
@@ -800,8 +801,18 @@
String applicationId = dataStorage.getId(state.getApplicationState());
ModelAdapter<S, C> adapter =
ModelAdapter.getAdapter(state.getApplicationType());
PortletContext producerOfferedPortletContext =
adapter.getProducerOfferedPortletContext(applicationId);
- org.gatein.pc.api.Portlet producedOfferedPortlet =
portletInvoker.getPortlet(producerOfferedPortletContext);
-
+ org.gatein.pc.api.Portlet producedOfferedPortlet;
+
+ try
+ {
+ producedOfferedPortlet =
portletInvoker.getPortlet(producerOfferedPortletContext);
+ }
+ catch (NoSuchPortletException nspe)
+ {
+ producedOfferedPortlet = null;
+ nspe.printStackTrace();
+ }
+
this.adapter = adapter;
this.producerOfferedPortletContext = producerOfferedPortletContext;
this.producedOfferedPortlet = producedOfferedPortlet;
Show replies by date