// As ownerId is now normalized, we have to maker sure that owenerId of 'group' type starts with a '/'
if (SiteType.GROUP.getName().equals(ownerType) && ownerId.charAt(0) != '/') {
ownerId = "/" + ownerId;
}
Page page = (Page) bean;
page.setPageId(getUIStringInput("pageId").getValue());
page.setOwnerType(ownerType);
page.setOwnerId(ownerId);
page.setName(getUIStringInput("name").getValue());
String title = getUIStringInput("title").getValue();
if (title == null || title.trim().length() < 1)
title = page.getName();
page.setTitle(title);
if (!page.isShowMaxWindow()) {
page.setShowMaxWindow(getUICheckBoxInput("showMaxWindow").getValue());
}
if (!SiteType.USER.getName().equals(page.getOwnerType())) {
page.setAccessPermissions(uiPermissionSetting.getChild(UIListPermissionSelector.class).getValue());
page.setEditPermission(uiPermissionSetting.getChild(UIPermissionSelector.class).getValue());
}
UserACL userACL = getApplicationComponent(UserACL.class);
userACL.hasPermission(page);
UIFormInputItemSelector uiTemplate = getChildById("Template");
if (uiTemplate != null) {
SelectItemOption<?> itemOption = uiTemplate.getSelectedItemOption();
if (itemOption != null) {
page.setFactoryId(itemOption.getIcon());
// page.setTemplate((String)itemOption.getValue());
}
}
UIPageTemplateOptions uiConfigOptions = getChild(UIPageTemplateOptions.class);
if (uiConfigOptions == null)
return;
Page selectedPage = uiConfigOptions.createPageFromSelectedOption(page.getOwnerType(), page.getOwnerId());
if (selectedPage == null)
return;
page.setChildren(selectedPage.getChildren());
page.setFactoryId(selectedPage.getFactoryId());
}