XMLUtils.createElement(contenthandler, "title", title);
if ( this.environment != null ) {
InformationProviderService ips = (InformationProviderService) this.environment.getContainerService(InformationProviderService.class);
DynamicInformationProvider dip = ips.getDynamicProvider((HttpServletRequest) context.getObjectModel().get("portlet-request"));
Event event;
// Sizing
WindowState ws = (WindowState)copletInstanceData.getAttribute("window-state");
if ( ws == null ) {
ws = WindowState.NORMAL;
}
if ( ws.equals(WindowState.NORMAL) ) {
event = new ChangeCopletInstanceAspectDataEvent(copletInstanceData, "size", SizingStatus.STATUS_MINIMIZED);
PortletURLProviderImpl url = (PortletURLProviderImpl)dip.getPortletURLProvider(window);
url.clearParameters();
url.setWindowState(WindowState.MINIMIZED);
XMLUtils.createElement(contenthandler, "minimize-uri", url.toString(event));
}
if ( ws.equals(WindowState.MINIMIZED)) {
event = new ChangeCopletInstanceAspectDataEvent(copletInstanceData, "size", SizingStatus.STATUS_MAXIMIZED);
PortletURLProviderImpl url = (PortletURLProviderImpl)dip.getPortletURLProvider(window);
url.clearParameters();
url.setWindowState(WindowState.NORMAL);
XMLUtils.createElement(contenthandler, "maximize-uri", url.toString(event));
}
final Layout fullScreenLayout = service.getComponentManager().getProfileManager().getEntryLayout();
if ( fullScreenLayout != null && fullScreenLayout.equals( layout )) {
event = new FullScreenCopletEvent( copletInstanceData, null );
PortletURLProviderImpl url = (PortletURLProviderImpl)dip.getPortletURLProvider(window);
url.clearParameters();
url.setWindowState(WindowState.NORMAL);
XMLUtils.createElement(contenthandler, "fullscreen-uri", url.toString(event));
} else {
event = new FullScreenCopletEvent( copletInstanceData, layout );
PortletURLProviderImpl url = (PortletURLProviderImpl)dip.getPortletURLProvider(window);
url.clearParameters();
url.setWindowState(WindowState.MAXIMIZED);
XMLUtils.createElement(contenthandler, "fullscreen-uri", url.toString(event));
}
// portlet modes
PortletMode pm = (PortletMode)copletInstanceData.getAttribute("portlet-mode");
if ( pm == null ) {
pm = PortletMode.VIEW;
}
if ( !pm.equals(PortletMode.EDIT) ) {
PortletURLProviderImpl url = (PortletURLProviderImpl)dip.getPortletURLProvider(window);
url.clearParameters();
url.setPortletMode(PortletMode.EDIT);
XMLUtils.createElement(contenthandler, "edit-uri", url.toString());
}
if ( !pm.equals(PortletMode.HELP) ) {
PortletURLProviderImpl url = (PortletURLProviderImpl)dip.getPortletURLProvider(window);
url.clearParameters();
url.setPortletMode(PortletMode.HELP);
XMLUtils.createElement(contenthandler, "help-uri", url.toString());
}
if ( !pm.equals(PortletMode.VIEW) ) {
PortletURLProviderImpl url = (PortletURLProviderImpl)dip.getPortletURLProvider(window);
url.clearParameters();
url.setPortletMode(PortletMode.VIEW);
XMLUtils.createElement(contenthandler, "view-uri", url.toString());
}
}