public void processAction(ActionRequest request, ActionResponse response) throws PortletException, IOException
{
RequestContext requestContext = (RequestContext)request.getAttribute(PortalReservedParameters.REQUEST_CONTEXT_ATTRIBUTE);
ContentPage requestPage = requestContext.getPage();
PageEditAccess pageEditAccess = (PageEditAccess)requestContext.getAttribute(PortalReservedParameters.PAGE_EDIT_ACCESS_ATTRIBUTE);
if ( requestPage == null || pageEditAccess == null )
{
// Targetting this portlet with an ActionRequest REQUIRES that the ProfilerValve has been invoked!
throw new PortletException("Current request page or PageEditAccess not available.");
}
decoratorCache.invalidate(requestContext);
String pageMode = request.getParameter("pageMode");
if ( pageMode != null )
{
if ( "view".equals(pageMode) )
{
pageEditAccess.setEditing(false);
}
else if ( "edit".equals(pageMode) && pageEditAccess.isEditAllowed() )
{
if ( this.editorType != null && this.editorType.equals( "desktop" ) )
{
String redirectUrl = this.desktop.getPortalUrl( requestContext, requestContext.getPath() );
redirectUrl += "?editPage=true&portal=true";
response.sendRedirect( redirectUrl );
}
else
{
pageEditAccess.setEditing(true);
}
}
return;
}
if ( pageEditAccess.isEditAllowed() && request.isPortletModeAllowed(PortletMode.EDIT) )
{
String layout = null;
boolean addLayout = request.getParameter("jsAddLayout") != null;
if ( addLayout || request.getParameter("jsChangeLayout") != null )