return;
}
//Switch portal application to edit mode
uiPortalApp.setModeState(UIPortalApplication.APP_BLOCK_EDIT_MODE);
UIWorkingWorkspace uiWorkingWS = uiPortalApp.findFirstComponentOfType(UIWorkingWorkspace.class);
UIEditInlineWorkspace editInlineWS = uiWorkingWS.getChild(UIEditInlineWorkspace.class);
//Clone a UIPage object, that is required for Abort action
UIPage uiPage = editInlineWS.createUIComponent(UIPage.class, null, null);
PortalDataMapper.toUIPage(uiPage, page);
UIPageBody uiPageBody = uiPortalApp.findFirstComponentOfType(UIPageBody.class);
if (uiPageBody.getUIComponent() != null)
uiPageBody.setUIComponent(null);
if (Page.DESKTOP_PAGE.equals(page.getFactoryId()))
{
UIMaskWorkspace uiMaskWS = uiPortalApp.getChildById(UIPortalApplication.UI_MASK_WS_ID);
UIPageForm uiPageForm = uiMaskWS.createUIComponent(UIPageForm.class, "UIBrowserPageForm", "UIPageForm");
uiPageForm.setValues(uiPage);
uiMaskWS.setUIComponent(uiPageForm);
uiMaskWS.setShow(true);
pcontext.addUIComponentToUpdateByAjax(uiMaskWS);
return;
}
editInlineWS.setRendered(true);
editInlineWS.setUIComponent(uiPage);
UIPortalComposer portalComposer = editInlineWS.getChild(UIPortalComposer.class).setRendered(true);
portalComposer.setComponentConfig(UIPortalComposer.class, "UIPageEditor");
portalComposer.setShowControl(true);
portalComposer.setEditted(false);
portalComposer.setCollapse(false);
portalComposer.setId("UIPageEditor");
//toolPanel.setUIComponent(uiPage);
//toolPanel.setShowMaskLayer(false);
//uiWorkingWS.setRenderedChild(UIPortalToolPanel.class);
//uiWorkingWS.addChild(UIPortalComposer.class, "UIPageEditor", null);
uiWorkingWS.setRenderedChild(UIPortalApplication.UI_EDITTING_WS_ID);
pcontext.addUIComponentToUpdateByAjax(uiWorkingWS);
pcontext.setFullRender(true);
}