Package org.exoplatform.webui.form

Examples of org.exoplatform.webui.form.UIFormStringInput


        @Override
        public void execute(Event<UIRegisterForm> event) throws Exception {
            UIRegisterForm registerForm = event.getSource();
            OrganizationService orgService = registerForm.getApplicationComponent(OrganizationService.class);
            UIRegisterInputSet registerInput = registerForm.getChild(UIRegisterInputSet.class);
            UIFormStringInput userNameInput = registerInput.getUIStringInput(UIRegisterInputSet.USER_NAME);
            List<Validator> validators = userNameInput.getValidators();
            for (Validator validator : validators) {
                try {
                    validator.validate(userNameInput);
                } catch (MessageException e) {
                    event.getRequestContext().getUIApplication().addMessage(e.getDetailMessage());
                    return;
                }
            }

            String typedUsername = userNameInput.getValue();
            WebuiRequestContext context = WebuiRequestContext.getCurrentInstance();
            UIApplication uiApp = context.getUIApplication();
            if (usernameIsUsed(typedUsername, orgService)) {
                uiApp.addMessage(new ApplicationMessage("UIAccountInputSet.msg.user-exist", new String[] { typedUsername },
                        ApplicationMessage.WARNING));
View Full Code Here


        uiPopup.setWindowSize(900, 400);
        uiPopup.setShow(false);

        UIFormInputSet uiInputSet = new UIFormInputSet("PageNodeSetting");

        uiInputSet.addChild(new UIFormStringInput("pageId", "pageId", null));
        uiInputSet.addChild(new UIFormStringInput("pageName", "pageName", null)
                .addValidator(StringLengthValidator.class, 3, 30).addValidator(IdentifierValidator.class)
                .addValidator(MandatoryValidator.class));
        uiInputSet.addChild(new UIFormStringInput("pageTitle", "pageTitle", null).addValidator(StringLengthValidator.class, 3,
                120).addValidator(NotHTMLTagValidator.class));

        addChild(uiInputSet);
    }
View Full Code Here

        UIFormInputItemSelector<String> uiTemplateInput = new UIFormInputItemSelector<String>("PortalTemplate", null, String.class);
        addUIFormInput(uiTemplateInput);
        setSelectedTab(uiTemplateInput.getId());

        UIFormInputSet uiPortalSetting = this.<UIFormInputSet> getChildById("PortalSetting");
        UIFormStringInput uiNameInput = uiPortalSetting.getUIStringInput(FIELD_NAME);
        uiNameInput.setReadOnly(false);

        setSelectedTab(uiPortalSetting.getId());

        setActions(new String[] { "Save", "Close" });
View Full Code Here

        }
        Collections.sort(languages, new LanguagesComparator());

        UIFormInputSet uiSettingSet = new UIFormInputSet("PortalSetting");
        UIFormInputSet uiPropertiesSet = new UIFormInputSet("Properties");
        uiSettingSet.addUIFormInput(new UIFormStringInput(FIELD_NAME, FIELD_NAME, null).addValidator(MandatoryValidator.class)
                .addValidator(StringLengthValidator.class, 3, 30).addValidator(IdentifierValidator.class).setReadOnly(true));

        uiSettingSet.addUIFormInput(new UIFormStringInput(FIELD_LABEL, FIELD_LABEL, null)
                .addValidator(SpecialCharacterValidator.class));
        uiSettingSet.addUIFormInput(new UIFormStringInput(FIELD_DESCRIPTION, FIELD_DESCRIPTION, null));
        uiSettingSet.addUIFormInput(new UIFormSelectBox(FIELD_LOCALE, FIELD_LOCALE, languages)
                .addValidator(MandatoryValidator.class));

        List<SelectItemOption<String>> listSkin = new ArrayList<SelectItemOption<String>>();
        SkinService skinService = getApplicationComponent(SkinService.class);
        List<String> skinNames = new ArrayList<String>(skinService.getAvailableSkinNames());
        Collections.sort(skinNames);
        for (String skin : skinNames) {
            SelectItemOption<String> skinOption = new SelectItemOption<String>(skin, skin);
            listSkin.add(skinOption);
        }
        listSkin.get(0).setSelected(true);

        UIFormSelectBox uiSelectBox = new UIFormSelectBox(FIELD_SKIN, FIELD_SKIN, listSkin);
        uiSettingSet.addUIFormInput(uiSelectBox);

        addUIFormInput(uiSettingSet);

        // add to properties tab
        List<SelectItemOption<String>> listSessionAlive = new ArrayList<SelectItemOption<String>>();
        listSessionAlive.add(new SelectItemOption<String>(PortalProperties.SESSION_ALWAYS, PortalProperties.SESSION_ALWAYS));
        listSessionAlive.add(new SelectItemOption<String>(PortalProperties.SESSION_ON_DEMAND,
                PortalProperties.SESSION_ON_DEMAND));
        listSessionAlive.add(new SelectItemOption<String>(PortalProperties.SESSION_NEVER, PortalProperties.SESSION_NEVER));
        UIFormSelectBox uiSessionAliveBox = new UIFormSelectBox(FIELD_SESSION_ALIVE, FIELD_SESSION_ALIVE, listSessionAlive);
        uiSessionAliveBox.setValue(PortalProperties.SESSION_ON_DEMAND);
        uiPropertiesSet.addUIFormInput(uiSessionAliveBox);

        // TODO add more box for showPortletMode and showWindowState if needed
        UIFormCheckBoxInput<Boolean> uiShowInfobarBox = new UIFormCheckBoxInput<Boolean>(FIELD_SHOW_INFOBAR,
                FIELD_SHOW_INFOBAR, true);
        uiShowInfobarBox.setOnChange("CheckShowInfobar");
        uiPropertiesSet.addChild(uiShowInfobarBox);

        UIFormStringInput uiViewportInput = new UIFormStringInput(FIELD_VIEWPORT, FIELD_VIEWPORT, null);
        uiViewportInput.setReadOnly(false);
        uiPropertiesSet.addChild(uiViewportInput);

        addUIFormInput(uiPropertiesSet);

        List<SelectItemOption<String>> listSharedLayout = new ArrayList<SelectItemOption<String>>();
View Full Code Here

        return lastQuery_;
    }

    public Query<Page> getQuery(UIFormInputSet searchInputs) {
        Query<Page> query = new Query<Page>(null, null, null, null, Page.class);
        UIFormStringInput titleInput = (UIFormStringInput) searchInputs.getChild(0);
        UIFormStringInput siteNameInput = (UIFormStringInput) searchInputs.getChild(1);
        UIFormSelectBox select = (UIFormSelectBox) searchInputs.getChild(2);

        String siteName = siteNameInput.getValue();
        String title = titleInput.getValue();
        String ownerType = select.getValue();
        if (title != null) {
            query.setTitle(title.trim());
        }
View Full Code Here

        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);
View Full Code Here

    }

    // TODO: it looks like this method is not used
    public void setEditMode() {
        isEditMode = true;
        UIFormStringInput uiNameInput = getChildById(PAGE_NAME);
        uiNameInput.setReadOnly(true);
    }
View Full Code Here

    public String getSelectedLocale() {
        return selectedLocale;
    }

    public void invokeSetBindingBean(Object bean) throws Exception {
        UIFormStringInput nameTextBox = getUIStringInput(PAGE_NAME);
        // this help to ignore name textbox
        nameTextBox.setReadOnly(true);
        super.invokeSetBindingBean(bean);
        nameTextBox.setReadOnly(false);

        UserNode node = (UserNode) bean;

        if (getUICheckBoxInput(SWITCH_MODE).isChecked()) {
            node.setLabel(null);
View Full Code Here

        time = (cal != null) ? cal.getTimeInMillis() : -1;
        node.setEndPublicationTime(time);
    }

    public UserNode createUserNode(UserNode parent) throws Exception {
        UIFormStringInput nameTextBox = getUIStringInput(PAGE_NAME);
        String nodeName = nameTextBox.getValue();

        UserNode child = parent.addChild(nodeName);
        invokeSetBindingBean(child);
        return child;
    }
View Full Code Here

        UIFormInputItemSelector uiTemplateInput = new UIFormInputItemSelector("PortalTemplate", null);
        addUIFormInput(uiTemplateInput);
        setSelectedTab(uiTemplateInput.getId());

        UIFormInputSet uiPortalSetting = this.<UIFormInputSet> getChildById("PortalSetting");
        UIFormStringInput uiNameInput = uiPortalSetting.getUIStringInput(FIELD_NAME);
        uiNameInput.setReadOnly(false);

        setSelectedTab(uiPortalSetting.getId());

        setActions(new String[] { "Save", "Close" });
View Full Code Here

TOP

Related Classes of org.exoplatform.webui.form.UIFormStringInput

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.