UIPortalApplication uiApp = Util.getUIPortalApplication();
UIWorkingWorkspace uiWorkingWS = uiApp.getChildById(UIPortalApplication.UI_WORKING_WS_ID);
// check edit permission for page
UIPageBody pageBody = uiWorkingWS.findFirstComponentOfType(UIPageBody.class);
UIPage uiPage = (UIPage)pageBody.getUIComponent();
if (uiPage == null)
{
uiApp.addMessage(new ApplicationMessage("UIPageBrowser.msg.PageNotExist", null));
return;
}
Page page = PortalDataMapper.toPageModel(uiPage);
UserACL userACL = uiApp.getApplicationComponent(UserACL.class);
if (!userACL.hasEditPermission(page))
{
uiApp.addMessage(new ApplicationMessage("UIPortalManagement.msg.Invalid-EditPage-Permission", null));
return;
}
uiWorkingWS.setRenderedChild(UIEditInlineWorkspace.class);
UIPortalComposer portalComposer =
uiWorkingWS.findFirstComponentOfType(UIPortalComposer.class).setRendered(true);
portalComposer.setComponentConfig(UIPortalComposer.class, "UIPageEditor");
portalComposer.setId("UIPageEditor");
portalComposer.setShowControl(true);
portalComposer.setEditted(false);
portalComposer.setCollapse(false);
UIPortalToolPanel uiToolPanel = uiWorkingWS.findFirstComponentOfType(UIPortalToolPanel.class);
uiToolPanel.setShowMaskLayer(false);
uiApp.setModeState(UIPortalApplication.APP_BLOCK_EDIT_MODE);
// We clone the edited UIPage object, that is required for Abort action
//UIPage newUIPage = new UIPage();
UIPage newUIPage = uiWorkingWS.createUIComponent(UIPage.class, null, null);
PortalDataMapper.toUIPage(newUIPage, page);
uiToolPanel.setWorkingComponent(newUIPage);
// Remove current UIPage from UIPageBody
pageBody.setUIComponent(null);