ownerTypes.add(new SelectItemOption<String>(PortalConfig.PORTAL_TYPE));
}
ownerIdInput = new UIFormStringInput(OWNER_ID, OWNER_ID, null);
ownerIdInput.setEditable(false).setValue(pcontext.getRemoteUser());
UIFormSelectBox uiSelectBoxOwnerType = new UIFormSelectBox(OWNER_TYPE, OWNER_TYPE, ownerTypes);
uiSelectBoxOwnerType.setOnChange("ChangeOwnerType");
UIFormInputSet uiSettingSet = new UIFormInputSet("PageSetting");
uiSettingSet.addUIFormInput(new UIFormStringInput("pageId", "pageId", null).setEditable(false)).addUIFormInput(
uiSelectBoxOwnerType).addUIFormInput(ownerIdInput).addUIFormInput(
new UIFormStringInput("name", "name", null).addValidator(StringLengthValidator.class, 3, 30).addValidator(
IdentifierValidator.class).addValidator(MandatoryValidator.class)).addUIFormInput(
new UIFormStringInput("title", "title", null).addValidator(StringLengthValidator.class, 3, 120))
.addUIFormInput(new UIFormCheckBoxInput("showMaxWindow", "showMaxWindow", false));
addUIFormInput(uiSettingSet);
setSelectedTab(uiSettingSet.getId());
uiPermissionSetting = createUIComponent(UIFormInputSet.class, "PermissionSetting", null);
UIListPermissionSelector uiListPermissionSelector = createUIComponent(UIListPermissionSelector.class, null, null);
uiListPermissionSelector.configure("UIListPermissionSelector", "accessPermissions");
uiListPermissionSelector.addValidator(EmptyIteratorValidator.class);
uiPermissionSetting.addChild(uiListPermissionSelector);
uiPermissionSetting.setSelectedComponent(uiListPermissionSelector.getId());
UIPermissionSelector uiEditPermission = createUIComponent(UIPermissionSelector.class, null, null);
uiEditPermission.setRendered(false);
uiEditPermission.addValidator(org.exoplatform.webui.organization.UIPermissionSelector.MandatoryValidator.class);
uiEditPermission.setEditable(false);
uiEditPermission.configure("UIPermissionSelector", "editPermission");
uiPermissionSetting.addChild(uiEditPermission);
//TODO: This following line is fixed for bug PORTAL-2127
uiListPermissionSelector.getChild(UIFormPopupWindow.class).setId("UIPageFormPopupGroupMembershipSelector");
List<String> groups = configService.getMakableNavigations(pcontext.getRemoteUser(), true);
if (groups.size() > 0)
{
Collections.sort(groups);
ownerTypes.add(new SelectItemOption<String>(PortalConfig.GROUP_TYPE));
List<SelectItemOption<String>> groupsItem = new ArrayList<SelectItemOption<String>>();
for (String group : groups)
{
groupsItem.add(new SelectItemOption<String>(group));
}
groupIdSelectBox = new UIFormSelectBox(OWNER_ID, OWNER_ID, groupsItem);
groupIdSelectBox.setOnChange("ChangeOwnerId");
groupIdSelectBox.setParent(uiSettingSet);
}
setActions(new String[]{"Save", "Close"});
}