private String selectedLocale;
private Map<String, String> cachedLabels;
public UIWizardPageSetInfo() throws Exception {
UICheckBoxInput uiDateInputCheck = new UICheckBoxInput(SHOW_PUBLICATION_DATE, null, false);
UICheckBoxInput uiVisibleCheck = new UICheckBoxInput(VISIBLE, null, false);
UICheckBoxInput uiSwitchLabelMode = new UICheckBoxInput(SWITCH_MODE, null, true);
UICheckBoxInput uiRestrictOutsidePublicationWindow = new UICheckBoxInput(RESTRICT_OUTSIDE_PUBLICATION_WINDOW, null, false);
uiDateInputCheck.setOnChange("SwitchPublicationDate");
uiVisibleCheck.setOnChange("SwitchVisible");
uiSwitchLabelMode.setOnChange(SWITCH_MODE_ONCHANGE);
UIFormSelectBox uiFormLanguagesSelectBox = new UIFormSelectBox(LANGUAGES, null, null);
initLanguageSelectBox(uiFormLanguagesSelectBox);
uiFormLanguagesSelectBox.setOnChange(LANGUAGES_ONCHANGE);
addChild(UIPageNodeSelector.class, null, null);
addUIFormInput(new UIFormStringInput(PAGE_NAME, "name", null).addValidator(MandatoryValidator.class)
.addValidator(UserConfigurableValidator.class, UserConfigurableValidator.PAGE_NAME));
addUIFormInput(uiSwitchLabelMode);
addUIFormInput(new UIFormStringInput(PAGE_DISPLAY_NAME, "label", null).setMaxLength(255).addValidator(
StringLengthValidator.class, 3, 120));
addUIFormInput(uiFormLanguagesSelectBox);
addUIFormInput(new UIFormStringInput(I18N_LABEL, null, null).setMaxLength(255).addValidator(
StringLengthValidator.class, 3, 120));
addUIFormInput(uiVisibleCheck.setChecked(true));
addUIFormInput(uiDateInputCheck);
UIFormInputBase<String> startPubDateInput = new UIFormDateTimeInput(START_PUBLICATION_DATE, null, null)
.addValidator(DateTimeValidator.class);
UIFormInputBase<String> endPubDateInput = new UIFormDateTimeInput(END_PUBLICATION_DATE, null, null)
.addValidator(DateTimeValidator.class);
addUIFormInput(startPubDateInput);
addUIFormInput(endPubDateInput);
addUIFormInput(uiRestrictOutsidePublicationWindow);
boolean isUserNav = Util.getUIPortal().getSiteType().equals(SiteType.USER);
if (isUserNav) {
uiVisibleCheck.setRendered(false);
uiDateInputCheck.setRendered(false);
startPubDateInput.setRendered(false);
endPubDateInput.setRendered(false);
uiRestrictOutsidePublicationWindow.setRendered(false);
}
this.selectedLocale = getUIFormSelectBox(LANGUAGES).getValue();
cachedLabels = new HashMap<String, String>();
switchLabelMode(true);