if (portletWindow == null) {
//No window for the layout node, return null
return null;
}
final IPortalRequestInfo portalRequestInfo = this.urlSyntaxProvider.getPortalRequestInfo(request);
if (portalRequestInfo.getUrlState() == UrlState.DETACHED) {
/*
* We want to handle DETACHED portlet windows differently/explicitly,
* but we need to be aware there may be other portlets on the page
* besides the targeted one. These would be portlets in regions
* (Respondr theme) -- such as DynamicRespondrSkin.
*
* We need to confirm, therefore, that this is actually the portlet
* in DETACHED. If it is, we'll send back a 'stateless' PortletWindow.
*/
if (portalRequestInfo.getTargetedPortletWindowId().toString().contains("_" + layoutNodeId + "_")) {
final IPortletWindowId portletWindowId = portletWindow.getPortletWindowId();
portletWindow = this.getOrCreateStatelessPortletWindow(request, portletWindowId);
}
}