final IPortletWindow parentPortletWindow = this.portletWindowRegistry.convertPortletWindow(request, internalPortletWindow);
final IPortletWindowId parentPortletWindowId = parentPortletWindow.getPortletWindowId();
final IPortletWindow portletWindow = this.portletWindowRegistry.createDelegatePortletWindow(request, portletEntityId, parentPortletWindowId);
//Initialize the window since we just created it
final ContainerInvocation invocation = ContainerInvocation.getInvocation();
try {
this.portletRenderer.doInit(portletEntity, portletWindow.getPortletWindowId(), request, response);
}
finally {
if (invocation != null) {
ContainerInvocation.setInvocation(invocation.getPortletContainer(), invocation.getPortletWindow());
}
}
return new PortletDelegationDispatcherImpl(portletWindow, parentPortletWindow, person.getID(), this.portalRequestUtils, this.personManager, this.portletRenderer, this.portletRequestParameterManager, this);
}