Author: mwringe
Date: 2010-03-19 13:23:17 -0400 (Fri, 19 Mar 2010)
New Revision: 2320
Modified:
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortletActionListener.java
Log:
GTNPORTAL-896: handle security responses from the portlet container and log the specific
errors to the logs.
Modified:
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortletActionListener.java
===================================================================
---
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortletActionListener.java 2010-03-19
17:18:00 UTC (rev 2319)
+++
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortletActionListener.java 2010-03-19
17:23:17 UTC (rev 2320)
@@ -49,6 +49,8 @@
import org.gatein.pc.api.invocation.response.ErrorResponse;
import org.gatein.pc.api.invocation.response.HTTPRedirectionResponse;
import org.gatein.pc.api.invocation.response.PortletInvocationResponse;
+import org.gatein.pc.api.invocation.response.SecurityErrorResponse;
+import org.gatein.pc.api.invocation.response.SecurityResponse;
import org.gatein.pc.api.invocation.response.UpdateNavigationalStateResponse;
import javax.portlet.PortletMode;
@@ -141,6 +143,10 @@
{
handleErrorResponse((ErrorResponse)portletResponse);
}
+ else if (portletResponse instanceof SecurityResponse)
+ {
+ handleSecurityResponse((SecurityResponse)portletResponse);
+ }
else
{
throw new Exception("Unexpected response type [" + portletResponse
+ "]. Expected an UpdateNavigationResponse" +
@@ -246,6 +252,19 @@
{
throw (Exception)response.getCause();
}
+
+ private void handleSecurityResponse(SecurityResponse response) throws Exception
+ {
+ if (response instanceof SecurityErrorResponse)
+ {
+ SecurityErrorResponse securityErrorResponse =
(SecurityErrorResponse)response;
+ throw new Exception("SecurityErrorResponse Returned while trying to
process portlet action. ", securityErrorResponse.getThrowable());
+ }
+ else
+ {
+ throw new Exception("Security Response of type " +
response.getClass() + " encountered while trying to process portlet action.");
+ }
+ }
}
/**
Show replies by date