}
// Action window config will only exist if there is an action request.
if (actionWindowConfig != null) {
flushPortletCache(renderContext.getUser(), actionWindowConfig, renderContext.getMainResource().getWorkspace());
PortletWindowImpl portletWindow = new PortletWindowImpl(container, actionWindowConfig, portalURL);
//if (logger.isDebugEnabled()) {
logger.debug("Processing action request for window: "
+ portletWindow.getId().getStringId());
//}
EntryPointInstance entryPointInstance = ServicesRegistry.getInstance().getApplicationsManagerService().getEntryPointInstance(actionWindowConfig.getMetaInfo(), renderContext.getMainResource().getWorkspace());
if (entryPointInstance != null) {
request.setEntryPointInstance(entryPointInstance);
} else {
logger.warn("Couldn't find related entryPointInstance, roles might not work properly !");
}
// copy jahia attibutes nested by the portlet
JahiaPortletUtil.copyJahiaAttributes(entryPointInstance, renderContext.getRequest(), portletWindow, request, true, renderContext.getMainResource().getWorkspace());
try {
container.doAction(portletWindow, request, renderContext.getResponse());
JahiaPortletUtil.copySharedMapFromPortletToJahia(renderContext.getRequest().getSession(), request, portletWindow);
} catch (PortletContainerException ex) {
throw new ServletException(ex);
} catch (PortletException ex) {
throw new ServletException(ex);
}
if (logger.isDebugEnabled()) {
logger.debug("Action request processed, send a redirect.\n\n");
}
return "";
}
//Resource request
else if (resourceWindowConfig != null) {
PortletWindowImpl portletWindow = new PortletWindowImpl(container,
resourceWindowConfig, portalURL);
if (logger.isDebugEnabled()) {
logger.debug("Processing resource Serving request for window: " + portletWindow.getId().getStringId());
}
try {
container.doServeResource(portletWindow, request, response);
} catch (PortletContainerException ex) {
logger.error(ex.getMessage(), ex);