PageService pageService = uiWorkingWS.getApplicationComponent(PageService.class);
try {
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(pageKey, pageState));
dataService.save(page);
} catch (StaleModelException ex) {
// Temporary solution to concurrency-related issue
// This catch block should be put in an appropriate ApplicationLifecyclec
}