Page page = new Page();
uiPageForm.invokeSetBindingBean(page);
DataStorage dataService = uiPageForm.getApplicationComponent(DataStorage.class);
// create new page
if (uiPage == null) {
PageService pageService = uiPageForm.getApplicationComponent(PageService.class);
PageContext existPage = pageService.loadPage(page.getPageKey());
if (existPage != null) {
uiPortalApp.addMessage(new ApplicationMessage("UIPageForm.msg.sameName", null));
return;
}
page.setModifiable(true);
if (page.getChildren() == null) {
page.setChildren(new ArrayList<ModelObject>());
}
//
PageState pageState = new PageState(page.getTitle(), page.getDescription(), page.isShowMaxWindow(),
page.getFactoryId(), page.getAccessPermissions() != null ? Arrays.asList(page.getAccessPermissions())
: null, page.getEditPermission());
pageService.savePage(new PageContext(page.getPageKey(), pageState));
//
dataService.save(page);
postSave(uiPortalApp, pcontext);
return;