((PortletWindowListCtrl)windowList).add(portletWindow);
coplet.setTemporaryAttribute("window", portletWindow);
// load the portlet
final Map objectModel = ContextHelper.getObjectModel(this.context);
ServletRequestImpl req = (ServletRequestImpl) objectModel.get("portlet-request");
if ( req == null ) {
final HttpServletResponse res = (HttpServletResponse) objectModel.get(HttpEnvironment.HTTP_RESPONSE_OBJECT);
objectModel.put("portlet-response", new ServletResponseImpl(res));
req = new ServletRequestImpl((HttpServletRequest) objectModel.get(HttpEnvironment.HTTP_REQUEST_OBJECT), null);
objectModel.put("portlet-request", req);
}
final HttpServletResponse res = (HttpServletResponse) objectModel.get("portlet-response");
try {
this.portletContainer.portletLoad(portletWindow, req.getRequest(portletWindow),
res);
} catch (Exception e) {
this.getLogger().error("Error loading portlet " + portletEntityId + " for instance " + coplet.getId(), e);
// remove portlet entity
coplet.removeTemporaryAttribute("window");