Package org.exoplatform.webui.form

Examples of org.exoplatform.webui.form.UIFormInputSet


      if (index + length > list.size())
         throw new IllegalArgumentException(
            "Illegal index or length: sum of the index and the length cannot be greater than the list size");

      UIFormInputSet result[] = new UIFormInputSet[length];
      for (int i = 0; i < length; i++)
         result[i] = list.get(i + index);

      return result;
   }
View Full Code Here


   public UIUserInfo() throws Exception
   {
      super("UIUserInfo");

      UIFormInputSet accountInputSet = new UIAccountEditInputSet("UIAccountEditInputSet");
      addChild(accountInputSet);
      setSelectedTab(accountInputSet.getId());

      UIFormInputSet userProfileSet = new UIUserProfileInputSet("UIUserProfileInputSet");
      addChild(userProfileSet);

      UIFormInputContainer<?> uiUserMembershipSelectorSet = new UIUserMembershipSelector();
      addChild(uiUserMembershipSelectorSet);
View Full Code Here

   private ApplicationCategory category_ = null;

   public UICategoryForm() throws Exception
   {
      super("UICategoryForm");
      UIFormInputSet uiCategorySetting = new UIFormInputSet(FIELD_SETTING);
      uiCategorySetting.addUIFormInput(new UIFormStringInput(FIELD_NAME, FIELD_NAME, null).addValidator(
         MandatoryValidator.class).addValidator(StringLengthValidator.class, 3, 30).addValidator(
         IdentifierValidator.class));
      uiCategorySetting.addUIFormInput(new UIFormStringInput(FIELD_DISPLAY_NAME, FIELD_DISPLAY_NAME, null)
         .addValidator(StringLengthValidator.class, 3, 30));
      uiCategorySetting.addUIFormInput(new UIFormTextAreaInput(FIELD_DESCRIPTION, FIELD_DESCRIPTION, null)
         .addValidator(StringLengthValidator.class, 0, 255));
      addChild(uiCategorySetting);
      setSelectedTab(uiCategorySetting.getId());

      UIFormInputSet uiPermissionSetting = new UIFormInputSet(FIELD_PERMISSION);
      UIListPermissionSelector uiListPermissionSelector = createUIComponent(UIListPermissionSelector.class, null, null);
      uiListPermissionSelector.configure("UIListPermissionSelector", "accessPermissions");
      uiListPermissionSelector.addValidator(EmptyIteratorValidator.class);
      uiPermissionSetting.addChild(uiListPermissionSelector);
      addUIComponentInput(uiPermissionSetting);
   }
View Full Code Here

      addUIComponentInput(uiPermissionSetting);
   }

   public void setValue(ApplicationCategory category) throws Exception
   {
      UIFormInputSet uiSetting = getChildById(FIELD_SETTING);
      UIFormInputSet uiPermission = getChildById(FIELD_PERMISSION);
      uiSetting.reset();
      uiPermission.getChild(UIListPermissionSelector.class).setValue(new String[]{});
      setSelectedTab(uiSetting.getId());
      if (category == null)
      {
         category_ = null;
         uiSetting.getUIStringInput(FIELD_NAME).setEditable(true);
         return;
      }
      category_ = category;
      uiSetting.getUIStringInput(FIELD_NAME).setEditable(false).setValue(category_.getName());
      uiSetting.getUIStringInput(FIELD_DISPLAY_NAME).setValue(category_.getDisplayName());
      uiSetting.getUIFormTextAreaInput(FIELD_DESCRIPTION).setValue(category_.getDescription());
      List<String> accessPermissions = category_.getAccessPermissions();
      String[] per = new String[accessPermissions.size()];
      if (accessPermissions != null && accessPermissions.size() > 0)
      {
         uiPermission.getChild(UIListPermissionSelector.class).setValue(accessPermissions.toArray(per));
      }
   }
View Full Code Here

         boolean isCreateNew = category == null;
         if (isCreateNew)
         {
            category = new ApplicationCategory();
         }
         UIFormInputSet uiSetting = uiForm.getChildById(FIELD_SETTING);
         UIFormInputSet uiPermission = uiForm.getChildById(FIELD_PERMISSION);
         category.setName(uiSetting.getUIStringInput(FIELD_NAME).getValue());
         String displayName = uiSetting.getUIStringInput(FIELD_DISPLAY_NAME).getValue();
         if (displayName == null || displayName.length() < 1)
         {
            category.setDisplayName(category.getName());
         }
         else
         {
            category.setDisplayName(displayName);
         }
         category.setDescription(uiSetting.getUIFormTextAreaInput(FIELD_DESCRIPTION).getValue());

         UIListPermissionSelector uiListPermissionSelector = uiPermission.getChild(UIListPermissionSelector.class);
         ArrayList<String> pers = new ArrayList<String>();
         if (uiListPermissionSelector.getValue() != null)
         {
            for (String per : uiListPermissionSelector.getValue())
            {
View Full Code Here

      uiTableInputSet.setName(getClass().getSimpleName());
      uiTableInputSet.setId(getClass().getSimpleName());
      uiTableInputSet.setColumns(TABLE_COLUMNS);
      addChild(uiTableInputSet);

      UIFormInputSet uiInputSet;
      UIFormCheckBoxInput<Boolean> checkBoxInput;
      UIFormInputInfo uiInfo;

      //
      ApplicationRegistryService appRegService = getApplicationComponent(ApplicationRegistryService.class);
      List<ApplicationCategory> categories = getAllCategories();
      List<UIFormInputSet> uiInputSetList = new ArrayList<UIFormInputSet>();
      for (ApplicationCategory category : categories)
      {
         uiInputSet = new UIFormInputSet(category.getName());
         boolean defaultValue = false;
         if (application != null)
         {
            String definitionName = application.getDisplayName().replace(' ', '_');
            defaultValue = appRegService.getApplication(category.getName(), definitionName) != null;
         }
         checkBoxInput = new UIFormCheckBoxInput<Boolean>("category_" + category.getName(), null, defaultValue);
         uiInfo = new UIFormInputInfo("categoryName", null, category.getDisplayName());
         uiInputSet.addChild(checkBoxInput);
         uiInputSet.addChild(uiInfo);
         uiTableInputSet.addChild(uiInputSet);
         uiInputSetList.add(uiInputSet);
      }
     
      UIFormPageIterator uiIterator = uiTableInputSet.getChild(UIFormPageIterator.class);
View Full Code Here

    public void initPortalTemplateTab() throws Exception {
        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" });

        UserPortalConfigService configService = this.getApplicationComponent(UserPortalConfigService.class);
        Set<String> portalTemplates = configService.getPortalTemplates();
View Full Code Here

            }
            languages.add(option);
        }
        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);
        for (String skin : skinService.getAvailableSkinNames()) {
            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>>();
        listSharedLayout.add(new SelectItemOption<String>(PortalProperties.SHARED_LAYOUT_ALL, PortalProperties.SHARED_LAYOUT_ALL));
        listSharedLayout.add(new SelectItemOption<String>(PortalProperties.SHARED_LAYOUT_ADMINS, PortalProperties.SHARED_LAYOUT_ADMINS));
        UIFormSelectBox sharedLayoutSelectBox = new UIFormSelectBox(FIELD_SHARED_LAYOUT, FIELD_SHARED_LAYOUT, listSharedLayout);
        sharedLayoutSelectBox.setValue(PortalProperties.SHARED_LAYOUT_ALL);
        uiPropertiesSet.addUIFormInput(sharedLayoutSelectBox);

        UIFormInputSet uiPermissionSetting = createUIComponent(UIFormInputSet.class, "PermissionSetting", null);
        addUIComponentInput(uiPermissionSetting);

        UIListPermissionSelector uiListPermissionSelector = createUIComponent(UIListPermissionSelector.class, null, null);
        uiListPermissionSelector.configure("PortalPermissionSelector", "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.configure("UIPermissionSelector", "editPermission");
        uiPermissionSetting.addChild(uiEditPermission);
    }
View Full Code Here

    }

    public static class CheckShowActionListener extends EventListener<UIPortalForm> {
        public void execute(Event<UIPortalForm> event) throws Exception {
            UIPortalForm uiForm = event.getSource();
            UIFormInputSet InfoForm = uiForm.getChildById("Properties");
            UIFormCheckBoxInput<Boolean> showInfobarForm = InfoForm.getUIFormCheckBoxInput(UIPortalForm.FIELD_SHOW_INFOBAR);

            // TODO: When we need to implement for showPortletMode or showWindowState
            // we can change how to get/set value for showInfobarForm (as well as of PortalConfig)
            showInfobarForm.setValue(showInfobarForm.isChecked());
            event.getRequestContext().addUIComponentToUpdateByAjax(uiForm);
View Full Code Here

    private static final String FIELD_PORTLET_PREF = "PortletPref";

    @SuppressWarnings("unchecked")
    public UIPortletForm() throws Exception {
        super("UIPortletForm");
        UIFormInputSet uiPortletPrefSet = new UIFormInputSet(FIELD_PORTLET_PREF).setRendered(false);
        addUIFormInput(uiPortletPrefSet);
        UIFormInputSet uiSettingSet = new UIFormInputSet("PortletSetting");
        uiSettingSet
                .addUIFormInput(new UIFormInputInfo("displayName", "displayName", null))
                .addUIFormInput(
                        new UIFormStringInput("title", "title", null).addValidator(StringLengthValidator.class, 3, 60)
                                .addValidator(NotHTMLTagValidator.class, "UIPortletForm.msg.InvalidPortletTitle"))
                .addUIFormInput(
                        new UIFormStringInput("width", "width", null).addValidator(ExpressionValidator.class,
                                "(^([1-9]\\d*)(?:px)?$)?", "UIPortletForm.msg.InvalidWidthHeight"))
                .addUIFormInput(
                        new UIFormStringInput("height", "height", null).addValidator(ExpressionValidator.class,
                                "(^([1-9]\\d*)(?:px)?$)?", "UIPortletForm.msg.InvalidWidthHeight"))
                .addUIFormInput(new UICheckBoxInput("showInfoBar", "showInfoBar", false))
                .addUIFormInput(new UICheckBoxInput("showPortletMode", "showPortletMode", false))
                .addUIFormInput(new UICheckBoxInput("showWindowState", "showWindowState", false))
                .addUIFormInput(
                        new UIFormTextAreaInput("description", "description", null).addValidator(NotHTMLTagValidator.class,
                                "UIPortletForm.msg.InvalidPortletDescription"));
        addUIFormInput(uiSettingSet);
        UIFormInputIconSelector uiIconSelector = new UIFormInputIconSelector("Icon", "icon");
        addUIFormInput(uiIconSelector);

        UIFormInputThemeSelector uiThemeSelector = new UIFormInputThemeSelector(FIELD_THEME, null);
        SkinService skinService = getApplicationComponent(SkinService.class);
        uiThemeSelector.getChild(UIItemThemeSelector.class).setValues(skinService.getPortletThemes());
        addUIFormInput(uiThemeSelector);

        UIListPermissionSelector uiListPermissionSelector = createUIComponent(UIListPermissionSelector.class, null, null);
        uiListPermissionSelector.configure("PortletPermissionSelector", "accessPermissions");
        uiListPermissionSelector.addValidator(EmptyIteratorValidator.class);
        UIFormInputSet uiPermissionSet = createUIComponent(UIFormInputSet.class, "PortletPermission", null);
        uiPermissionSet.addChild(uiListPermissionSelector);
        addUIFormInput(uiPermissionSet);
    }
View Full Code Here

TOP

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

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.