UIWorkingWorkspace uiWorkingWS = editInlineWS.getParent();
//Reset tab pane state
UITabPane tabPane = event.getSource().getChild(UITabPane.class);
tabPane.setSelectedTab(1);
UIPortal uiPortal = uiPortalApp.getCurrentSite();
UIPortalToolPanel uiToolPanel = uiWorkingWS.findFirstComponentOfType(UIPortalToolPanel.class);
UIPage uiPage = uiToolPanel.findFirstComponentOfType(UIPage.class);
Page page = (Page) PortalDataMapper.buildModelObject(uiPage);
String pageId = page.getPageId();
UserPortalConfigService portalConfigService = uiWorkingWS.getApplicationComponent(UserPortalConfigService.class);
/* Put the portal back in place as we have removed it in
* org.exoplatform.portal.webui.workspace.UIMainActionListener.EditInlineActionListener.execute(Event<UIWorkingWorkspace>) */
UISiteBody siteBody = uiWorkingWS.findFirstComponentOfType(UISiteBody.class);
UIEditInlineWorkspace uiEditWS = uiWorkingWS.getChild(UIEditInlineWorkspace.class);
UIComponent editComponent = uiEditWS.getUIComponent();
if (editComponent instanceof UIPortal) {
UIPortal editPortal = (UIPortal) editComponent;
editPortal.setHeaderAndFooterRendered(true);
siteBody.setUIComponent(editPortal);
}
/*
* if it is a edition of the current page and it is not available to current remote user anymore.
*/
PageKey pageKey = PageKey.parse(pageId);
if (page.getStorageId() != null && portalConfigService.getPageService().loadPage(pageKey) == null) {
uiPortalApp.addMessage(new ApplicationMessage("UIPageBrowser.msg.PageNotExist", new String[] { pageId },
ApplicationMessage.WARNING));
uiPortalApp.setModeState(UIPortalApplication.NORMAL_MODE);
uiWorkingWS.setRenderedChild(UIPortalApplication.UI_VIEWING_WS_ID);
Util.getPortalRequestContext().ignoreAJAXUpdateOnPortlets(true);
UserNode currentNode = uiPortal.getSelectedUserNode();
SiteKey siteKey = currentNode.getNavigation().getKey();
PageNodeEvent<UIPortalApplication> pnevent = new PageNodeEvent<UIPortalApplication>(uiPortalApp,
PageNodeEvent.CHANGE_NODE, siteKey, currentNode.getURI());
uiPortalApp.broadcast(pnevent, Event.Phase.PROCESS);
Util.updatePortalMode();
return;
}
UIPortalComposer composer = uiWorkingWS.findFirstComponentOfType(UIPortalComposer.class).setRendered(false);
// If it is a page creation wizard
if (composer.isUsedInWizard()) {
UIWizard wizard = (UIWizard) uiToolPanel.getUIComponent();
int step = wizard.getCurrentStep();
step++;
Event<UIComponent> uiEvent = wizard.createEvent("ViewStep" + step, Phase.PROCESS, event.getRequestContext());
uiEvent.broadcast();
return;