@Override
  protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
    formLayout.setElementCssClass("o_sel_pf_edit_assignment_form");

    List<Section> sections = portfolioService.getSections(binder);

    String selectedKey = null;
    int numOfSections = sections.size();
    String[] theKeys = new String[numOfSections];
    String[] theValues = new String[numOfSections];
    for (int i = 0; i < numOfSections; i++) {
      Long sectionKey = sections.get(i).getKey();
      theKeys[i] = sectionKey.toString();
      theValues[i] = (i + 1) + ". " + sections.get(i).getTitle();
      if (section != null && section.getKey().equals(sectionKey)) {
        selectedKey = theKeys[i];
      }
    }

    sectionsEl =
        uifactory.addDropdownSingleselect(
            "sections", "page.sections", formLayout, theKeys, theValues, null);
    if (selectedKey != null) {
      sectionsEl.select(selectedKey, true);
    }

    FormLayoutContainer buttonsCont =
        FormLayoutContainer.createButtonLayout("buttons", getTranslator());
    buttonsCont.setRootForm(mainForm);
    formLayout.add(buttonsCont);

    uifactory.addFormSubmitButton("move", buttonsCont);
    uifactory.addFormCancelButton("cancel", buttonsCont, ureq, getWindowControl());
  }
  @Override
  protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
    if (editable) {
      List<AccessMethod> methods =
          acService.getAvailableMethods(getIdentity(), ureq.getUserSession().getRoles());
      for (AccessMethod method : methods) {
        AccessMethodHandler handler = acModule.getAccessMethodHandler(method.getType());
        if (handler.isPaymentMethod() && !allowPaymentMethod) {
          continue;
        }

        String title = handler.getMethodName(getLocale());
        FormLink add =
            uifactory.addFormLink(
                "create." + handler.getType(),
                title,
                null,
                formLayout,
                Link.LINK | Link.NONTRANSLATED);
        add.setUserObject(method);
        add.setIconLeftCSS(("o_icon " + method.getMethodCssClass() + "_icon o_icon-lg").intern());
        addMethods.add(add);
        formLayout.add(add.getName(), add);
      }
      ((FormLayoutContainer) formLayout).contextPut("methods", addMethods);
    }

    String confPage = velocity_root + "/configuration_list.html";
    confControllerContainer =
        FormLayoutContainer.createCustomFormLayout("conf-controllers", getTranslator(), confPage);
    confControllerContainer.setRootForm(mainForm);
    formLayout.add(confControllerContainer);

    loadConfigurations();

    confControllerContainer.contextPut("confControllers", confControllers);

    if (!embbed) {
      setFormTitle("accesscontrol.title");
      setFormContextHelp(
          AccessConfigurationController.class.getPackage().getName(),
          "accesscontrol.html",
          "chelp.accesscontrol.hover");

      if (editable) {
        final FormLayoutContainer buttonGroupLayout =
            FormLayoutContainer.createButtonLayout("buttonLayout", getTranslator());
        buttonGroupLayout.setRootForm(mainForm);
        formLayout.add(buttonGroupLayout);
        formLayout.add("buttonLayout", buttonGroupLayout);

        uifactory.addFormSubmitButton("save", buttonGroupLayout);
      }
    }

    confControllerContainer.contextPut(
        "emptyConfigGrantsFullAccess", Boolean.valueOf(emptyConfigGrantsFullAccess));
  }
  /**
   * @see
   *     org.olat.core.gui.components.form.flexible.impl.FormBasicController#initForm(org.olat.core.gui.components.form.flexible.FormItemContainer,
   *     org.olat.core.gui.control.Controller, org.olat.core.gui.UserRequest)
   */
  @Override
  protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
    setFormDescription("group.search.description");

    search = uifactory.addTextElement("search.field", "search.field", 100, "", formLayout);

    if (isUsedInStepWizzard()) {
      searchLink = uifactory.addFormLink("search", formLayout, Link.BUTTON);
    } else {
      searchButton = uifactory.addFormSubmitButton("search", formLayout);
      uifactory.addSpacerElement("space", formLayout, false);
    }

    errorComp = uifactory.createSimpleErrorText("error", "");
    formLayout.add(errorComp);

    tableCont =
        FormLayoutContainer.createCustomFormLayout(
            "", getTranslator(), velocity_root + "/resulttable.html");
    tableCont.setRootForm(mainForm);
    formLayout.add(tableCont);

    // group rights
    FlexiTableColumnModel tableColumnModel =
        FlexiTableDataModelFactory.createFlexiTableColumnModel();
    tableColumnModel.addFlexiColumnModel(
        new DefaultFlexiColumnModel(Cols.groupName.i18n(), Cols.groupName.ordinal()));
    tableColumnModel.addFlexiColumnModel(
        new DefaultFlexiColumnModel(
            true,
            Cols.description.i18n(),
            Cols.description.ordinal(),
            false,
            null,
            FlexiColumnModel.ALIGNMENT_LEFT,
            new TextFlexiCellRenderer(EscapeMode.antisamy)));
    tableColumnModel.addFlexiColumnModel(
        new DefaultFlexiColumnModel(Cols.courses.i18n(), Cols.courses.ordinal()));
    tableColumnModel.addFlexiColumnModel(
        new DefaultFlexiColumnModel(Cols.tutor.i18n(), Cols.tutor.ordinal()));
    tableColumnModel.addFlexiColumnModel(
        new DefaultFlexiColumnModel(Cols.participant.i18n(), Cols.participant.ordinal()));

    tableDataModel =
        new GroupTableDataModel(Collections.<GroupWrapper>emptyList(), tableColumnModel);
    table =
        uifactory.addTableElement(ureq, getWindowControl(), "groupList", tableDataModel, tableCont);
    tableCont.add("groupList", table);

    if (!isUsedInStepWizzard()) {
      saveLink = uifactory.addFormLink("save", formLayout, Link.BUTTON);
    }
  }
Пример #4
0
  @Override
  protected void initForm(
      final FormItemContainer formLayout, final Controller listener, final UserRequest ureq) {
    setFormTitle("cpmd.flexi.formtitle");
    final int defaultDisplaySize = 32;

    // title-field
    final String titleString = page.getTitle();
    title = uifactory.addTextElement("title", "cpmd.flexi.title", 256, titleString, formLayout);
    title.setDisplaySize(defaultDisplaySize);
    title.setMandatory(true);
    title.setNotEmptyCheck("cpmd.flexi.mustbefilled");

    // description = formUIf.addTextAreaElement("descr", 256, 5, 2, true, metadata.getDescription(),
    // "cpmd.flexi.descr", formLayout);
    // description.setDisplaySize(defaultDisplaySize);
    //
    // // keywords-field
    // keywords = formUIf.addTextElement("keywords", 256, metadata.getKeywords(),
    // "cpmd.flexi.keywords", formLayout);
    // keywords.setDisplaySize(defaultDisplaySize);
    //
    // formUIf.addStaticTextElement("hr", "<hr />", formLayout);
    //
    // version = formUIf.addTextElement("version", 256, metadata.getVersion(), "cpmd.flexi.version",
    // formLayout);
    // status = formUIf.addTextElement("status", 256, metadata.getStatus(), "cpmd.flexi.status",
    // formLayout);
    // date = formUIf.addDateChooser("date", metadata.getDate(), formLayout);
    // format = formUIf.addTextElement("format", 256, metadata.getFormat(), "cpmd.flexi.format",
    // formLayout);
    // author = formUIf.addTextElement("author", 256, metadata.getAuthor(), "cpmd.flexi.author",
    // formLayout);

    final FormItemContainer buttonContainer =
        FormLayoutContainer.createHorizontalFormLayout("buttonContainer", getTranslator());
    formLayout.add(buttonContainer);

    // Submit buttons
    lSave = new FormLinkImpl("lSave", "lSave", "submit", Link.BUTTON);
    lSave.addActionListener(this, FormEvent.ONCLICK);

    lSaveandclose = new FormLinkImpl("lSaveandclose", "lSaveandclose", "saveandclose", Link.BUTTON);

    lSaveandclose.addActionListener(this, FormEvent.ONCLICK);
    buttonContainer.add(lSave);
    buttonContainer.add(lSaveandclose);
  }
Пример #5
0
  @Override
  protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
    setFormTitle("multi.sps.title");
    setFormDescription("multi.sps.desc");

    if (formLayout instanceof FormLayoutContainer) {
      FormLayoutContainer layoutContainer = (FormLayoutContainer) formLayout;
      rootSelection = initTreeRec(0, rootContainer, layoutContainer);
      layoutContainer.contextPut("nodeSelections", nodeSelections);
    }

    selectAll = uifactory.addFormLink("checkall", "form.checkall", null, formLayout, Link.LINK);
    deselectAll =
        uifactory.addFormLink("uncheckall", "form.uncheckall", null, formLayout, Link.LINK);

    FormLayoutContainer buttonLayout =
        FormLayoutContainer.createButtonLayout("ok-cancel", getTranslator());
    formLayout.add(buttonLayout);
    buttonLayout.setRootForm(mainForm);

    if (selectedNode.getParent() != null) {
      sameLevel = uifactory.addFormLink("multi.sps.sameLevel", buttonLayout, Link.BUTTON);
    }
    asChild = uifactory.addFormLink("multi.sps.asChild", buttonLayout, Link.BUTTON);
    uifactory.addFormCancelButton("cancel", buttonLayout, ureq, getWindowControl());
  }
Пример #6
0
  @Override
  protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
    if (formLayout instanceof FormLayoutContainer) {
      FormLayoutContainer layout = (FormLayoutContainer) formLayout;
      layout.contextPut("numOfMembers", Integer.toString(numOfMembers));

      FormLayoutContainer layoutCont =
          FormLayoutContainer.createDefaultFormLayout("confirm", getTranslator());
      formLayout.add("confirm", layoutCont);
      layoutCont.setRootForm(mainForm);

      StringBuilder message = new StringBuilder();
      for (RepositoryEntry row : rows) {
        if (message.length() > 0) message.append(", ");
        message.append(StringHelper.escapeHtml(row.getDisplayname()));
      }

      String[] acknowledge = new String[] {translate("details.read.only.acknowledge.msg")};
      acknowledgeEl =
          uifactory.addCheckboxesHorizontal(
              "confirm",
              "details.read.only.acknowledge",
              layoutCont,
              new String[] {""},
              acknowledge);

      FormLayoutContainer buttonsCont =
          FormLayoutContainer.createButtonLayout("buttons", getTranslator());
      layoutCont.add(buttonsCont);
      uifactory.addFormCancelButton("cancel", buttonsCont, ureq, getWindowControl());
      readOnlyButton = uifactory.addFormLink("details.closed", buttonsCont, Link.BUTTON);
    }
  }
  @Override
  protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
    // Add the "accept" checkbox to the form.
    acceptCheckbox =
        uifactory.addCheckboxesVertical(
            ACKNOWLEDGE_CHECKBOX_NAME,
            null,
            formLayout,
            new String[] {DCL_CHECKBOX_KEY},
            new String[] {translate(NLS_DISCLAIMER_ACKNOWLEDGED)},
            null,
            1);
    acceptCheckbox.setEscapeHtml(false);
    acceptCheckbox.setMandatory(false);
    acceptCheckbox.select(DCL_CHECKBOX_KEY, readOnly);

    // Add the additional checkbox to the form (depending on the configuration)
    if (CoreSpringFactory.getImpl(RegistrationModule.class).isDisclaimerAdditionalCheckbox()) {
      String additionalCheckboxText = translate("disclaimer.additionalcheckbox");
      if (additionalCheckboxText != null) {
        additionalCheckbox =
            uifactory.addCheckboxesVertical(
                ADDITIONAL_CHECKBOX_NAME,
                null,
                formLayout,
                new String[] {DCL_CHECKBOX_KEY2},
                new String[] {additionalCheckboxText},
                null,
                1);
        additionalCheckbox.setEscapeHtml(false);
        additionalCheckbox.select(DCL_CHECKBOX_KEY2, readOnly);
      }
    }

    if (readOnly) {
      // Disable when set to read only
      formLayout.setEnabled(!readOnly);
    } else {
      // Create submit and cancel buttons
      final FormLayoutContainer buttonLayout =
          FormLayoutContainer.createButtonLayout("buttonLayout", getTranslator());
      formLayout.add(buttonLayout);
      buttonLayout.setElementCssClass("o_sel_disclaimer_buttons");
      uifactory.addFormSubmitButton(DCL_ACCEPT, NLS_DISCLAIMER_OK, buttonLayout);
      uifactory.addFormCancelButton(NLS_DISCLAIMER_NOK, buttonLayout, ureq, getWindowControl());
    }
  }
  /** Initialize the form */
  @Override
  protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
    mail = uifactory.addTextElement("mail", "email.address", 255, "", formLayout);
    mail.setMandatory(true);

    // Button layout
    final FormLayoutContainer buttonLayout =
        FormLayoutContainer.createButtonLayout("button_layout", getTranslator());
    formLayout.add(buttonLayout);
    uifactory.addFormSubmitButton("submit.speichernUndweiter", buttonLayout);
    uifactory.addFormCancelButton("submit.cancel", buttonLayout, ureq, getWindowControl());
  }
Пример #9
0
  @Override
  protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
    setFormTitle("rest.title");
    setFormContextHelp("REST API");

    if (formLayout instanceof FormLayoutContainer) {
      FormLayoutContainer layoutContainer = (FormLayoutContainer) formLayout;

      boolean restEnabled = restModule.isEnabled();
      docLinkFlc =
          FormLayoutContainer.createCustomFormLayout(
              "doc_link", getTranslator(), velocity_root + "/docLink.html");
      layoutContainer.add(docLinkFlc);
      docLinkFlc.setVisible(restEnabled);

      String link =
          Settings.getServerContextPathURI() + RestSecurityHelper.SUB_CONTEXT + "/api/doc";
      docLinkFlc.contextPut("docLink", link);

      FormLayoutContainer accessDataFlc =
          FormLayoutContainer.createDefaultFormLayout("flc_access_data", getTranslator());
      layoutContainer.add(accessDataFlc);

      String[] values = new String[] {getTranslator().translate("rest.on")};
      enabled = uifactory.addCheckboxesHorizontal("rest.enabled", accessDataFlc, keys, values);
      enabled.select(keys[0], restEnabled);
      enabled.addActionListener(FormEvent.ONCHANGE);

      accessDataFlc.setVisible(true);
      formLayout.add(accessDataFlc);

      FormLayoutContainer managedFlc =
          FormLayoutContainer.createDefaultFormLayout("flc_managed", getTranslator());
      layoutContainer.add(managedFlc);

      String[] valueGrps = new String[] {getTranslator().translate("rest.on")};
      managedGroupsEl =
          uifactory.addCheckboxesHorizontal("managed.group", managedFlc, keys, valueGrps);
      managedGroupsEl.addActionListener(FormEvent.ONCHANGE);
      managedGroupsEl.select(keys[0], groupModule.isManagedBusinessGroups());

      String[] valueRes = new String[] {getTranslator().translate("rest.on")};
      managedRepoEl = uifactory.addCheckboxesHorizontal("managed.repo", managedFlc, keys, valueRes);
      managedRepoEl.addActionListener(FormEvent.ONCHANGE);
      managedRepoEl.select(keys[0], repositoryModule.isManagedRepositoryEntries());

      String[] valueCal = new String[] {getTranslator().translate("rest.on")};
      managedCalendarEl =
          uifactory.addCheckboxesHorizontal("managed.cal", managedFlc, keys, valueCal);
      managedCalendarEl.addActionListener(FormEvent.ONCHANGE);
      managedCalendarEl.select(keys[0], calendarModule.isManagedCalendars());
    }
  }
  @Override
  protected void initForm(
      FormItemContainer formLayout, Controller listener, final UserRequest ureq) {
    titleContainer = FormLayoutContainer.createHorizontalFormLayout("titleLayout", getTranslator());
    formLayout.add(titleContainer);

    // spacer
    formLayout.add(new SpacerElementImpl("spacer1"));

    long defaultWeekRange = numDaysRange_ * 24 * 60 * 60 * 1000;

    // from date
    fromDate =
        new JSDateChooser(
            "fromDate", new Date(new Date().getTime() - defaultWeekRange), getLocale());
    fromDate.setLabel("datechooser.bdate", null);
    fromDate.setExampleKey("datechooser.example.bdate", null);
    fromDate.setDisplaySize(fromDate.getExampleDateString().length());
    formLayout.add(fromDate);
    // end date
    toDate = new JSDateChooser("toDate", new Date(), getLocale());
    toDate.setLabel("datechooser.edate", null);
    toDate.setExampleKey("datechooser.example.edate", null);
    toDate.setDisplaySize(toDate.getExampleDateString().length());
    formLayout.add(toDate);

    // submit button
    subm = new FormSubmit("subm", "datechooser.generate");
    formLayout.add(subm);

    formLayout.add(new SpacerElementImpl("spacer2"));
  }
Пример #11
0
    @Override
    protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
      Boolean hasIdentitesToDelete = (Boolean) getFromRunContext("hasIdentitiesToDelete");
      FormLayoutContainer textContainer =
          FormLayoutContainer.createCustomFormLayout(
              "index", getTranslator(), velocity_root + "/delet_step01.html");
      formLayout.add(textContainer);
      textContainer.contextPut("hasIdentitesToDelete", hasIdentitesToDelete);
      if (hasIdentitesToDelete != null && !hasIdentitesToDelete.booleanValue()) {
        setNextStep(Step.NOSTEP);
        return;
      }

      Map<String, String> reqProbertyMap =
          new HashMap<String, String>(syncConfiguration.getUserAttributeMap());
      Collection<String> reqProberty = reqProbertyMap.values();
      reqProberty.remove(LDAPConstants.LDAP_USER_IDENTIFYER);

      @SuppressWarnings("unchecked")
      List<Identity> identitiesToDelete = (List<Identity>) getFromRunContext("identitiesToDelete");
      for (Identity identityToDelete : identitiesToDelete) {
        List<String> rowData = new ArrayList<>();
        rowData.add(identityToDelete.getName());
        for (String property : reqProberty) {
          rowData.add(identityToDelete.getUser().getProperty(property, null));
        }
      }

      FlexiTableColumnModel tableColumnModel =
          FlexiTableDataModelFactory.createFlexiTableColumnModel();
      int colPos = 0;
      tableColumnModel.addFlexiColumnModel(new DefaultFlexiColumnModel("username", 10000));
      List<UserPropertyHandler> handlers = new ArrayList<>();
      for (String property : reqProberty) {
        List<UserPropertyHandler> properHandlerList =
            UserManager.getInstance().getAllUserPropertyHandlers();
        for (UserPropertyHandler userProperty : properHandlerList) {
          if (userProperty.getName().equals(property)) {
            tableColumnModel.addFlexiColumnModel(
                new DefaultFlexiColumnModel(userProperty.i18nColumnDescriptorLabelKey(), colPos++));
            handlers.add(userProperty);
          }
        }
      }

      FlexiTableDataModel<Identity> tableDataModel =
          new IdentityFlexiTableModel(identitiesToDelete, tableColumnModel, handlers, getLocale());
      uifactory.addTableElement(
          getWindowControl(), "newUsers", tableDataModel, getTranslator(), formLayout);
    }
Пример #12
0
  @Override
  protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {

    // options
    String[] optionKeys = new String[] {OPTION_GUEST_ACCESS};
    String[] optionVals = new String[] {translate(OPTION_GUEST_ACCESS)};
    multiSelectOptions =
        uifactory.addCheckboxesVertical(
            "vc.options", "vc.options.label", formLayout, optionKeys, optionVals, 1);
    multiSelectOptions.select(OPTION_GUEST_ACCESS, config.isGuestAccessAllowed());
    multiSelectOptions.showLabel(false);

    submit = new FormSubmit("subm", "submit");

    formLayout.add(submit);
  }
 /**
  * @see
  *     org.olat.core.gui.components.form.flexible.impl.FormBasicController#initForm(org.olat.core.gui.components.form.flexible.FormItemContainer,
  *     org.olat.core.gui.control.Controller, org.olat.core.gui.UserRequest)
  */
 @Override
 protected void initForm(
     FormItemContainer formLayout,
     @SuppressWarnings("unused") Controller listener,
     @SuppressWarnings("unused") UserRequest ureq) {
   // A title, displayed in fieldset
   setFormTitle("configuration.management.package.delete.title");
   setFormDescription("configuration.management.package.delete.description");
   // Add cancel and submit in button group layout
   FormLayoutContainer buttonGroupLayout =
       FormLayoutContainer.createButtonLayout("buttonGroupLayout", getTranslator());
   formLayout.add(buttonGroupLayout);
   cancelButton = uifactory.addFormLink("cancel", buttonGroupLayout, Link.BUTTON);
   submitButton =
       uifactory.addFormSubmitButton("configuration.management.package.delete", buttonGroupLayout);
   submitButton.setEnabled(false); // enable as soon as something is checked
 }
  /**
   * @see
   *     org.olat.core.gui.components.form.flexible.impl.FormBasicController#initForm(org.olat.core.gui.components.form.flexible.FormItemContainer,
   *     org.olat.core.gui.control.Controller, org.olat.core.gui.UserRequest)
   */
  @Override
  @SuppressWarnings("unused")
  protected void initForm(
      final FormItemContainer formLayout, final Controller listener, final UserRequest ureq) {
    /*
     * create a form with a title and 4 input fields to enter some persons data
     */
    setFormTitle("guidemo_flexi_form_customlayout");
    final int defaultDisplaySize = 32;
    final boolean inputMode = !personData.isReadOnly();

    firstName =
        uifactory.addTextElement(
            "firstname",
            "guidemo.flexi.form.firstname",
            256,
            personData.getFirstName(),
            formLayout);
    firstName.setNotEmptyCheck("guidemo.flexi.form.mustbefilled");
    firstName.setMandatory(true);
    firstName.setEnabled(inputMode);

    lastName =
        uifactory.addTextElement(
            "lastname", "guidemo.flexi.form.lastname", 256, personData.getLastName(), formLayout);
    lastName.setNotEmptyCheck("guidemo.flexi.form.mustbefilled");
    lastName.setMandatory(true);
    lastName.setEnabled(inputMode);

    institution =
        uifactory.addTextElement(
            "institution",
            "guidemo.flexi.form.institution",
            256,
            personData.getInstitution(),
            formLayout);
    institution.setEnabled(inputMode);

    if (inputMode) {
      // submit only if in input mode
      submit = new FormSubmit("submit", "submit");
      formLayout.add(submit);
    }
  }
Пример #15
0
  /** {@inheritDoc} */
  @Override
  protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
    // create gui elements for all links
    for (int i = 0; i < linkList.size(); i++) {
      LLModel link = linkList.get(i);
      addNewFormLink(i, link);
    }

    flc.contextPut("linkList", linkList);
    flc.contextPut("lTargetInputList", lTargetInputList);
    flc.contextPut("lHtmlTargetInputList", lHtmlTargetInputList);
    flc.contextPut("lDescriptionInputList", lDescriptionInputList);
    flc.contextPut("lCommentInputList", lCommentInputList);
    flc.contextPut("lAddButtonList", lAddButtonList);
    flc.contextPut("lDelButtonList", lDelButtonList);
    flc.contextPut("lCustomMediaButtonList", lCustomMediaButtonList);

    subm = uifactory.addFormSubmitButton("submit", formLayout);
    formLayout.add(subm);
  }
 @Override
 protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
   // A title, displayed in fieldset
   setFormTitle("configuration.management.package.import.title");
   if (I18nModule.isTransToolEnabled()) {
     setFormDescription("configuration.management.package.import.description.transserver");
   } else {
     setFormDescription("configuration.management.package.import.description");
   }
   //
   // The import file upload
   importFile =
       uifactory.addFileElement("configuration.management.package.import.file", formLayout);
   importFile.setLabel("configuration.management.package.import.file", null);
   importFile.setMandatory(true, "configuration.management.package.import.file.error.mandatory");
   // Limit to jar files and set upload limit to 50 MB
   importFile.setMaxUploadSizeKB(
       50000, "configuration.management.package.import.file.error.size", null);
   Set<String> mimeTypes = new HashSet<String>();
   mimeTypes.add("application/java-archive");
   mimeTypes.add("application/x-jar");
   mimeTypes.add("application/x-java-jar");
   importFile.limitToMimeType(
       mimeTypes, "configuration.management.package.import.file.error.type", null);
   importFile.addActionListener(FormEvent.ONCHANGE); // trigger auto-upload	
   //
   // Add checkboxes for the found languages - hide so far
   String[] langKeys = new String[] {};
   importKeys =
       uifactory.addCheckboxesVertical(
           "configuration.management.package.import.select", flc, langKeys, langKeys, 1);
   importKeys.setVisible(false);
   //
   // Add cancel and submit in button group layout
   FormLayoutContainer buttonGroupLayout =
       FormLayoutContainer.createButtonLayout("buttonGroupLayout", getTranslator());
   formLayout.add(buttonGroupLayout);
   cancelButton = uifactory.addFormLink("cancel", buttonGroupLayout, Link.BUTTON);
   uifactory.addFormSubmitButton("configuration.management.package.import", buttonGroupLayout);
 }
Пример #17
0
    @Override
    protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
      fic =
          FormLayoutContainer.createCustomFormLayout(
              "cc01", this.getTranslator(), this.velocity_root + "/CcStep01_form.html");
      formLayout.add(fic);

      // load course
      ICourse course = CourseFactory.loadCourse(getRepoEntry());

      // show catalog selection tree
      if (course != null) {
        cic =
            new CatalogInsertController(
                ureq,
                getWindowControl(),
                RepositoryManager.getInstance().lookupRepositoryEntry(course, false),
                getCourseConfig());
        cic.addControllerListener(this);
        fic.put("cc", cic.getInitialComponent());
      }
      cic.init();
    }
Пример #18
0
  @Override
  protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
    askagainCheckbox =
        uifactory.addCheckboxesHorizontal(
            "askagain",
            null,
            formLayout,
            askagain_keys,
            new String[] {translate("askagain.label")});

    // Button layout
    FormLayoutContainer buttonLayout =
        FormLayoutContainer.createButtonLayout("button_layout", getTranslator());
    formLayout.add(buttonLayout);
    okButton = uifactory.addFormSubmitButton("submit", "resume.button", buttonLayout);
    okButton.setElementCssClass("o_sel_resume_yes");
    landingButton =
        uifactory.addFormLink("landing", "resume.button.landing", null, buttonLayout, Link.BUTTON);
    landingButton.setElementCssClass("o_sel_resume_landing");
    noButton =
        uifactory.addFormLink("cancel", "resume.button.cancel", null, buttonLayout, Link.BUTTON);
    noButton.setElementCssClass("o_sel_resume_cancel");
  }
Пример #19
0
  @Override
  protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
    setFormTitle("settings.title");
    formLayout.setElementCssClass("o_sel_course_forum_settings");

    if (forumModule.isAnonymousPostingWithPseudonymEnabled()) {
      String[] allowPseudonymValues = new String[] {translate("allow.pseudonym.post")};
      allowPseudonymEl =
          uifactory.addCheckboxesHorizontal(
              "allow.pseudonym", formLayout, allowKeys, allowPseudonymValues);
      allowPseudonymEl.setElementCssClass("o_sel_course_forum_allow_pseudo");
      allowPseudonymEl.setLabel(null, null);
      allowPseudonymEl.addActionListener(FormEvent.ONCHANGE);

      if ("true"
          .equals(
              foNode
                  .getModuleConfiguration()
                  .getStringValue(FOCourseNodeEditController.PSEUDONYM_POST_ALLOWED))) {
        allowPseudonymEl.select(allowKeys[0], true);
      }
    }

    String[] allowGuestValues = new String[] {translate("allow.guest.post")};
    allowGuestEl =
        uifactory.addCheckboxesHorizontal("allow.guest", formLayout, allowKeys, allowGuestValues);
    allowGuestEl.setElementCssClass("o_sel_course_forum_allow_guest");
    allowGuestEl.setLabel(null, null);
    allowGuestEl.addActionListener(FormEvent.ONCHANGE);
    if ("true"
        .equals(
            foNode
                .getModuleConfiguration()
                .getStringValue(FOCourseNodeEditController.GUEST_POST_ALLOWED))) {
      allowGuestEl.select(allowKeys[0], true);
    }
  }
Пример #20
0
  @Override
  protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
    rubricCtrl = new RubricController(ureq, getWindowControl(), rubric, mainForm);
    listenTo(rubricCtrl);
    formLayout.add("rubric", rubricCtrl.getInitialFormItem());

    settingsLayout = FormLayoutContainer.createDefaultFormLayout("settings", getTranslator());
    settingsLayout.setRootForm(mainForm);
    formLayout.add("settings", settingsLayout);

    String[] sliderTypeValues =
        new String[] {
          translate("slider.discrete"),
          translate("slider.discrete.slider"),
          translate("slider.continuous")
        };
    typeEl =
        uifactory.addDropdownSingleselect(
            "slider.type." + count.incrementAndGet(),
            "slider.type",
            settingsLayout,
            sliderTypeKeys,
            sliderTypeValues,
            null);
    typeEl.addActionListener(FormEvent.ONCHANGE);
    typeEl.setEnabled(!restrictedEdit);
    boolean typeSelected = false;
    if (rubric != null && rubric.getSliderType() != null) {
      for (String sliderTypeKey : sliderTypeKeys) {
        if (sliderTypeKey.equals(rubric.getSliderType().name())) {
          typeEl.select(sliderTypeKey, true);
          typeSelected = true;
        }
      }
    }
    if (!typeSelected) {
      typeEl.select(sliderTypeKeys[0], true);
    }

    stepsEl =
        uifactory.addDropdownSingleselect(
            "slider.steps." + count.incrementAndGet(),
            "slider.steps",
            settingsLayout,
            sliderStepKeys,
            sliderStepKeys,
            null);
    stepsEl.addActionListener(FormEvent.ONCHANGE);
    stepsEl.setEnabled(!restrictedEdit);
    boolean stepSelected = false;
    if (rubric != null && rubric.getSteps() > 0) {
      String steps = Integer.toString(rubric.getSteps());
      for (String sliderStepKey : sliderStepKeys) {
        if (sliderStepKey.equals(steps)) {
          stepsEl.select(sliderStepKey, true);
          stepSelected = true;
        }
      }
    }
    if (!stepSelected) {
      stepsEl.select(sliderStepKeys[4], true);
    }
    updateTypeSettings();
    updateSteps();

    for (Slider slider : rubric.getSliders()) {
      SliderRow row = forgeSliderRow(slider);
      sliders.add(row);
    }

    if (formLayout instanceof FormLayoutContainer) {
      FormLayoutContainer layoutCont = (FormLayoutContainer) formLayout;
      layoutCont.contextPut("sliders", sliders);
    }

    long postfix = CodeHelper.getRAMUniqueID();
    saveButton = uifactory.addFormLink("save_" + postfix, "save", null, formLayout, Link.BUTTON);
    if (!restrictedEdit) {
      addSliderButton =
          uifactory.addFormLink(
              "add.slider." + postfix, "add.slider", null, formLayout, Link.BUTTON);
      addSliderButton.setIconLeftCSS("o_icon o_icon-lg o_icon_add");
    }
    if (formLayout instanceof FormLayoutContainer) {
      FormLayoutContainer layoutCont = (FormLayoutContainer) formLayout;
      layoutCont.contextPut("postfix", Long.toString(postfix));
    }
  }
  /** Initialize form. */
  @Override
  protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {

    // create form elements
    projectTitle =
        uifactory.addTextElement(
            "title", "detailsform.title.label", 100, project.getTitle(), formLayout);

    // account-Managers
    StringBuilder projectLeaderString = new StringBuilder();
    for (Iterator iterator = project.getProjectLeaders().iterator(); iterator.hasNext(); ) {
      Identity identity = (Identity) iterator.next();
      String last = identity.getUser().getProperty(UserConstants.LASTNAME, getLocale());
      String first = identity.getUser().getProperty(UserConstants.FIRSTNAME, getLocale());
      if (projectLeaderString.length() > 0) {
        projectLeaderString.append(",");
      }
      projectLeaderString.append(first);
      projectLeaderString.append(" ");
      projectLeaderString.append(last);
    }
    projectLeaders =
        uifactory.addTextElement(
            "projectleaders",
            "detailsform.projectleaders.label",
            100,
            projectLeaderString.toString(),
            formLayout);
    projectLeaders.setEnabled(false);

    // add the learning objectives rich text input element
    projectDescription =
        uifactory.addRichTextElementForStringData(
            "description",
            "detailsform.description.label",
            project.getDescription(),
            10,
            -1,
            false,
            null,
            null,
            formLayout,
            ureq.getUserSession(),
            getWindowControl());
    projectDescription.setMaxLength(2500);

    stateLayout = FormLayoutContainer.createHorizontalFormLayout("stateLayout", getTranslator());
    stateLayout.setLabel("detailsform.state.label", null);
    formLayout.add(stateLayout);
    String stateValue =
        getTranslator()
            .translate(
                ProjectBrokerManagerFactory.getProjectBrokerManager()
                    .getStateFor(project, ureq.getIdentity(), projectBrokerModuleConfiguration));
    projectState =
        uifactory.addStaticTextElement(
            "detailsform.state", stateValue + "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;", stateLayout);
    projectState.setLabel(null, null);

    String keyDetailsformMax = null;
    if (projectBrokerModuleConfiguration.isAcceptSelectionManually()) {
      keyDetailsformMax = "detailsform.max.candidates.label";
    } else {
      keyDetailsformMax = "detailsform.max.members.label";
    }
    selectionMaxMembers =
        uifactory.addCheckboxesHorizontal(keyDetailsformMax, formLayout, keys, values, null);
    maxMembers =
        uifactory.addIntegerElement(
            "form.options.number.of.participants.per.topic_nbr",
            project.getMaxMembers(),
            formLayout);
    maxMembers.setMinValueCheck(0, null);
    maxMembers.setDisplaySize(3);
    if (project.getMaxMembers() == Project.MAX_MEMBERS_UNLIMITED) {
      maxMembers.setVisible(false);
      selectionMaxMembers.select(keys[0], false);
    } else {
      selectionMaxMembers.select(keys[0], true);
    }
    selectionMaxMembers.addActionListener(listener, FormEvent.ONCLICK);
    uifactory.addSpacerElement("spacer_1", formLayout, false);

    // customfields
    List<CustomField> customFields = projectBrokerModuleConfiguration.getCustomFields();
    int customFieldIndex = 0;
    for (Iterator<CustomField> iterator = customFields.iterator(); iterator.hasNext(); ) {
      CustomField customField = iterator.next();
      getLogger().debug("customField: " + customField.getName() + "=" + customField.getValue());
      StringTokenizer tok =
          new StringTokenizer(
              customField.getValue(), ProjectBrokerManager.CUSTOMFIELD_LIST_DELIMITER);
      if (customField.getValue() == null
          || customField.getValue().equals("")
          || !tok.hasMoreTokens()) {
        // no value define => Text-input
        // Add StaticTextElement as workaroung for non translated label
        uifactory.addStaticTextElement(
            "customField_label" + customFieldIndex,
            null,
            customField.getName(),
            formLayout); // null > no label
        TextElement textElement =
            uifactory.addTextElement(
                "customField_" + customFieldIndex,
                "",
                150,
                project.getCustomFieldValue(customFieldIndex),
                formLayout);
        textElement.setDisplaySize(60);
        //				textElement.setTranslator(null);
        //				textElement.setLabel(customField.getName(), null);
        textElement.showLabel(false);
        customfieldElementList.add(textElement);
      } else {
        // values define => dropdown selection
        List<String> valueList = new ArrayList<String>();
        while (tok.hasMoreTokens()) {
          String value = tok.nextToken();
          valueList.add(value);
          getLogger().debug("valueList add: " + value);
        }
        String[] theValues = new String[valueList.size() + 1];
        String[] theKeys = new String[valueList.size() + 1];
        int arrayIndex = 0;
        theValues[arrayIndex] = translate(DROPDOWN_NO_SELECETION);
        theKeys[arrayIndex] = DROPDOWN_NO_SELECETION;
        arrayIndex++;
        for (Iterator<String> iterator2 = valueList.iterator(); iterator2.hasNext(); ) {
          String value = iterator2.next();
          theValues[arrayIndex] = value;
          theKeys[arrayIndex] = Integer.toString(arrayIndex);
          arrayIndex++;
        }
        // Add StaticTextElement as workaround for non translated label
        uifactory.addStaticTextElement(
            "customField_label" + customFieldIndex,
            null,
            customField.getName(),
            formLayout); // null > no label
        SingleSelection selectionElement =
            uifactory.addDropdownSingleselect(
                "customField_" + customFieldIndex, null, formLayout, theKeys, theValues, null);
        if (project.getCustomFieldValue(customFieldIndex) != null
            && !project.getCustomFieldValue(customFieldIndex).equals("")) {
          if (valueList.contains(project.getCustomFieldValue(customFieldIndex))) {
            String key =
                Integer.toString(
                    valueList.indexOf(project.getCustomFieldValue(customFieldIndex))
                        + 1); // '+1' because no-selection at the beginning
            selectionElement.select(key, true);
          } else {
            this.showInfo(
                "warn.customfield.key.does.not.exist",
                project.getCustomFieldValue(customFieldIndex));
          }
        }
        customfieldElementList.add(selectionElement);
      }
      uifactory.addSpacerElement("customField_spacer" + customFieldIndex, formLayout, false);
      customFieldIndex++;
    }

    // Events
    for (Project.EventType eventType : Project.EventType.values()) {
      if (projectBrokerModuleConfiguration.isProjectEventEnabled(eventType)) {
        ProjectEvent projectEvent = project.getProjectEvent(eventType);
        DateChooser dateChooserStart =
            uifactory.addDateChooser(
                eventType + "start", eventType.getI18nKey() + ".start.label", null, formLayout);
        dateChooserStart.setDateChooserTimeEnabled(true);
        dateChooserStart.setDisplaySize(CUSTOM_DATE_FORMAT.length());
        getLogger().info("Event=" + eventType + ", startDate=" + projectEvent.getStartDate());
        dateChooserStart.setDate(projectEvent.getStartDate());
        eventStartElementList.put(eventType, dateChooserStart);
        DateChooser dateChooserEnd =
            uifactory.addDateChooser(
                eventType + "end", eventType.getI18nKey() + ".end.label", null, formLayout);
        dateChooserEnd.setDateChooserTimeEnabled(true);
        dateChooserEnd.setDisplaySize(CUSTOM_DATE_FORMAT.length());
        getLogger().debug("Event=" + eventType + ", endDate=" + projectEvent.getEndDate());
        dateChooserEnd.setDate(projectEvent.getEndDate());
        eventEndElementList.put(eventType, dateChooserEnd);
        uifactory.addSpacerElement(eventType + "spacer", formLayout, false);
      }
    }

    attachmentFileName =
        uifactory.addFileElement("detailsform.attachmentfilename.label", formLayout);
    attachmentFileName.setLabel("detailsform.attachmentfilename.label", null);
    if (project.getAttachmentFileName() != null && !project.getAttachmentFileName().equals("")) {
      attachmentFileName.setInitialFile(new File(project.getAttachmentFileName()));
      removeAttachmentLink =
          uifactory.addFormLink("detailsform.remove.attachment", formLayout, Link.BUTTON_XSMALL);
    }
    attachmentFileName.addActionListener(this, FormEvent.ONCHANGE);

    mailNotification =
        uifactory.addCheckboxesHorizontal(
            "detailsform.mail.notification.label", formLayout, keys, values, null);
    mailNotification.select(keys[0], project.isMailNotificationEnabled());

    FormLayoutContainer buttonGroupLayout =
        FormLayoutContainer.createButtonLayout("buttonGroupLayout", getTranslator());
    formLayout.add(buttonGroupLayout);
    uifactory.addFormSubmitButton("save", buttonGroupLayout);
    if (this.enableCancel) {
      uifactory.addFormCancelButton(
          "cancel",
          buttonGroupLayout,
          ureq,
          getWindowControl()); // TODO: Frage an PB: Warum flc hier noetig ???
    }
  }
  @Override
  protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
    setFormTitle("option.desc");
    setFormContextHelp(
        this.getClass().getPackage().getName(),
        "display-options.html",
        "chelp.display-options.title");

    String[] inheritValues = new String[] {translate("inherit"), translate("custom")};
    inheritEl =
        uifactory.addRadiosVertical("inherit.label", formLayout, inheritKeys, inheritValues);
    inheritEl.addActionListener(this, FormEvent.ONCHANGE);
    if (config != null && config.getInherit() != null && config.getInherit().booleanValue()) {
      inheritEl.select(inheritKeys[0], true);
    } else {
      inheritEl.select(inheritKeys[1], true);
    }
    if (parentConfig == null) {
      inheritEl.setVisible(false);
    } else {
      inheritEl.setVisible(true);
      uifactory.addSpacerElement("spacer.mode", formLayout, false);
    }

    String[] standardModeValues =
        new String[] {translate("mode.standard"), translate("mode.configured")};
    standardModeEl =
        uifactory.addRadiosVertical("mode", formLayout, standardModeKeys, standardModeValues);
    standardModeEl.addActionListener(this, FormEvent.ONCHANGE);

    uifactory.addSpacerElement("spacer.js", formLayout, false);

    String[] jsValues =
        new String[] {
          translate("option.js.none"),
          translate("option.js.jQuery"),
          translate("option.js.prototypejs")
        };
    jsOptionEl = uifactory.addRadiosVertical("option.js", formLayout, jsKeys, jsValues);
    jsOptionEl.addActionListener(this, FormEvent.ONCHANGE);

    glossarEl =
        uifactory.addCheckboxesHorizontal(
            "option.glossary", formLayout, new String[] {"on"}, new String[] {""}, null);

    String[] values =
        new String[] {
          translate("height.auto"),
          "460px",
          "480px",
          "500px",
          "520px",
          "540px",
          "560px",
          "580px",
          "600px",
          "620px",
          "640px",
          "660px",
          "680px",
          "700px",
          "720px",
          "730px",
          "760px",
          "780px",
          "800px",
          "820px",
          "840px",
          "860px",
          "880px",
          "900px",
          "920px",
          "940px",
          "960px",
          "980px",
          "1000px",
          "1020px",
          "1040px",
          "1060px",
          "1080px",
          "1100px",
          "1120px",
          "1140px",
          "1160px",
          "1180px",
          "1200px",
          "1220px",
          "1240px",
          "1260px",
          "1280px",
          "1300px",
          "1320px",
          "1340px",
          "1360px",
          "1380px"
        };
    heightEl =
        uifactory.addDropdownSingleselect("height", "height.label", formLayout, keys, values, null);

    String[] cssValues =
        new String[] {translate("option.css.none"), translate("option.css.openolat")};
    cssOptionEl = uifactory.addRadiosVertical("option.css", formLayout, cssKeys, cssValues);

    uifactory.addSpacerElement("spaceman", formLayout, false);

    Map<String, Charset> charsets = Charset.availableCharsets();
    int numOfCharsets = charsets.size() + 1;

    encodingContentKeys = new String[numOfCharsets];
    encodingContentKeys[0] = NodeEditController.CONFIG_CONTENT_ENCODING_AUTO;

    String[] encodingContentValues = new String[numOfCharsets];
    encodingContentValues[0] = translate("encoding.auto");

    encodingJSKeys = new String[numOfCharsets];
    encodingJSKeys[0] = NodeEditController.CONFIG_JS_ENCODING_AUTO;

    String[] encodingJSValues = new String[numOfCharsets];
    encodingJSValues[0] = translate("encoding.same");

    int count = 1;
    Locale locale = getLocale();
    for (Map.Entry<String, Charset> charset : charsets.entrySet()) {
      encodingContentKeys[count] = charset.getKey();
      encodingContentValues[count] = charset.getValue().displayName(locale);
      encodingJSKeys[count] = charset.getKey();
      encodingJSValues[count] = charset.getValue().displayName(locale);
      count++;
    }

    encodingContentEl =
        uifactory.addDropdownSingleselect(
            "encoContent",
            "encoding.content",
            formLayout,
            encodingContentKeys,
            encodingContentValues,
            null);
    encodingJSEl =
        uifactory.addDropdownSingleselect(
            "encoJS", "encoding.js", formLayout, encodingJSKeys, encodingJSValues, null);

    FormLayoutContainer buttonsLayout =
        FormLayoutContainer.createButtonLayout("buttons", getTranslator());
    buttonsLayout.setRootForm(mainForm);
    formLayout.add(buttonsLayout);
    uifactory.addFormSubmitButton("save", buttonsLayout);
  }
  /**
   * @see
   *     org.olat.core.gui.components.form.flexible.impl.FormBasicController#initForm(org.olat.core.gui.components.form.flexible.FormItemContainer,
   *     org.olat.core.gui.control.Controller, org.olat.core.gui.UserRequest)
   */
  @Override
  protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
    // Create the business group name input text element
    if (bulkMode) {
      businessGroupName =
          uifactory.addTextElement(
              "create.form.title.bgnames",
              "create.form.title.bgnames",
              10 * BusinessGroup.MAX_GROUP_NAME_LENGTH,
              "",
              formLayout);
      businessGroupName.setExampleKey("create.form.message.example.group", null);
    } else {
      businessGroupName =
          uifactory.addTextElement(
              "create.form.title.bgname",
              "create.form.title.bgname",
              BusinessGroup.MAX_GROUP_NAME_LENGTH,
              "",
              formLayout);
      businessGroupName.setNotLongerThanCheck(
          BusinessGroup.MAX_GROUP_NAME_LENGTH, "create.form.error.nameTooLong");
      businessGroupName.setRegexMatchCheck(
          BusinessGroup.VALID_GROUPNAME_REGEXP, "create.form.error.illegalName");
    }
    businessGroupName.setElementCssClass("o_sel_group_edit_title");
    businessGroupName.setMandatory(true);
    businessGroupName.setEnabled(
        !BusinessGroupManagedFlag.isManaged(businessGroup, BusinessGroupManagedFlag.title));

    formLayout.setElementCssClass("o_sel_group_edit_group_form");

    // Create the business group description input rich text element
    businessGroupDescription =
        uifactory.addRichTextElementForStringDataMinimalistic(
            "create.form.title.description",
            "create.form.title.description",
            "",
            10,
            -1,
            formLayout,
            getWindowControl());
    businessGroupDescription.setEnabled(
        !BusinessGroupManagedFlag.isManaged(businessGroup, BusinessGroupManagedFlag.description));

    if (businessGroup != null && !bulkMode) {
      // link to group direct jump in business path
      BusinessControlFactory bcf = BusinessControlFactory.getInstance();
      List<ContextEntry> entries =
          bcf.createCEListFromString("[BusinessGroup:" + businessGroup.getKey() + "]");
      String url = bcf.getAsURIString(entries, true);
      StaticTextElement urlEl =
          uifactory.addStaticTextElement("create.form.businesspath", url, formLayout);
      urlEl.setElementCssClass("o_sel_group_url");
      // link to group visiting card
      bcf = BusinessControlFactory.getInstance();
      entries = bcf.createCEListFromString("[GroupCard:" + businessGroup.getKey() + "]");
      url = bcf.getAsURIString(entries, true);
      StaticTextElement cardEl =
          uifactory.addStaticTextElement("create.form.groupcard", url, formLayout);
      cardEl.setElementCssClass("o_sel_group_card_url");
    }

    uifactory.addSpacerElement("myspacer", formLayout, true);

    // Minimum members input
    businessGroupMinimumMembers =
        uifactory.addTextElement(
            "create.form.title.min", "create.form.title.min", 5, "", formLayout);
    businessGroupMinimumMembers.setDisplaySize(6);
    businessGroupMinimumMembers.setVisible(false); // currently the minimum feature is not enabled
    businessGroupMinimumMembers.setElementCssClass("o_sel_group_edit_min_members");

    // Maximum members input
    businessGroupMaximumMembers =
        uifactory.addTextElement(
            "create.form.title.max", "create.form.title.max", 5, "", formLayout);
    businessGroupMaximumMembers.setDisplaySize(6);
    businessGroupMaximumMembers.setElementCssClass("o_sel_group_edit_max_members");

    // Checkboxes
    enableWaitingList =
        uifactory.addCheckboxesHorizontal(
            "create.form.enableWaitinglist", null, formLayout, waitingListKeys, waitingListValues);
    enableWaitingList.setElementCssClass("o_sel_group_edit_waiting_list");
    enableAutoCloseRanks =
        uifactory.addCheckboxesHorizontal(
            "create.form.enableAutoCloseRanks", null, formLayout, autoCloseKeys, autoCloseValues);
    enableAutoCloseRanks.setElementCssClass("o_sel_group_edit_auto_close_ranks");

    // Enable only if specification of min and max members is possible
    businessGroupMinimumMembers.setVisible(false); // currently the minimum feature is not enabled
    businessGroupMaximumMembers.setVisible(true);
    enableWaitingList.setVisible(true);
    enableAutoCloseRanks.setVisible(true);

    boolean managedSettings =
        BusinessGroupManagedFlag.isManaged(businessGroup, BusinessGroupManagedFlag.settings);
    businessGroupMinimumMembers.setEnabled(!managedSettings);
    businessGroupMaximumMembers.setEnabled(!managedSettings);
    enableWaitingList.setEnabled(!managedSettings);
    enableAutoCloseRanks.setEnabled(!managedSettings);

    if ((businessGroup != null) && (!bulkMode)) {
      businessGroupName.setValue(businessGroup.getName());
      businessGroupDescription.setValue(businessGroup.getDescription());
      Integer minimumMembers = businessGroup.getMinParticipants();
      Integer maximumMembers = businessGroup.getMaxParticipants();
      businessGroupMinimumMembers.setValue(
          minimumMembers == null || minimumMembers.intValue() <= 0
              ? ""
              : minimumMembers.toString());
      businessGroupMaximumMembers.setValue(
          maximumMembers == null || maximumMembers.intValue() < 0 ? "" : maximumMembers.toString());
      if (businessGroup.getWaitingListEnabled() != null) {
        enableWaitingList.select(
            "create.form.enableWaitinglist", businessGroup.getWaitingListEnabled());
      }
      if (businessGroup.getAutoCloseRanksEnabled() != null) {
        enableAutoCloseRanks.select(
            "create.form.enableAutoCloseRanks", businessGroup.getAutoCloseRanksEnabled());
      }
    }

    if (!embbeded) {
      // Create submit and cancel buttons
      final FormLayoutContainer buttonLayout =
          FormLayoutContainer.createButtonLayout("buttonLayout", getTranslator());
      formLayout.add(buttonLayout);
      FormSubmit submit = uifactory.addFormSubmitButton("finish", buttonLayout);
      submit.setEnabled(
          !BusinessGroupManagedFlag.isManaged(businessGroup, BusinessGroupManagedFlag.details));
      uifactory.addFormCancelButton("cancel", buttonLayout, ureq, getWindowControl());
    }

    if ((businessGroup != null) && (!bulkMode)) {
      // managed group information
      boolean managed =
          StringHelper.containsNonWhitespace(businessGroup.getExternalId())
              || businessGroup.getManagedFlags().length > 0;
      if (managed) {
        uifactory.addSpacerElement("managedspacer", formLayout, false);

        String extId = businessGroup.getExternalId() == null ? "" : businessGroup.getExternalId();
        StaticTextElement externalIdEl =
            uifactory.addStaticTextElement("create.form.externalid", extId, formLayout);
        externalIdEl.setElementCssClass("o_sel_group_external_id");

        FormLayoutContainer flagsFlc =
            FormLayoutContainer.createHorizontalFormLayout("flc_flags", getTranslator());
        flagsFlc.setLabel("create.form.managedflags", null);
        formLayout.add(flagsFlc);

        String flags =
            businessGroup.getManagedFlagsString() == null
                ? ""
                : businessGroup.getManagedFlagsString().trim();
        String flagsFormatted = null;
        if (flags.length() > 0) {
          // use translator from REST admin package to import managed flags context help strings
          Translator managedTrans =
              Util.createPackageTranslator(RestapiAdminController.class, ureq.getLocale());
          StringBuffer flagList = new StringBuffer();
          flagList.append("<p class=\"o_important\">");
          flagList.append(translate("create.form.managedflags.intro"));
          flagList.append("</div>");
          flagList.append("<ul>");
          for (String flag : flags.split(",")) {
            flagList.append("<li>");
            flagList.append(managedTrans.translate("managed.flags.group." + flag));
            flagList.append("</li>");
          }

          flagsFormatted = flagList.toString();

        } else {
          flagsFormatted = flags;
        }

        StaticTextElement flagsEl =
            uifactory.addStaticTextElement("create.form.managedflags", flagsFormatted, flagsFlc);
        flagsEl.showLabel(false);
        flagsEl.setElementCssClass("o_sel_group_managed_flags");
      }
    }
  }
  @Override
  protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
    boolean firstGroup = true;

    List<UserPropertyHandler> homepagePropertyHanders =
        userManager.getUserPropertyHandlersFor(
            HomePageConfig.class.getCanonicalName(), isAdministrativeUser);

    Map<String, FormLayoutContainer> groupContainerMap = new HashMap<>();
    HomePageConfig conf = hpcm.loadConfigFor(identityToModify.getName());
    for (UserPropertyHandler userPropertyHandler : userPropertyHandlers) {
      if (userPropertyHandler == null) {
        continue;
      }

      // add spacer if necessary (i.e. when group name changes)
      String group = userPropertyHandler.getGroup();
      FormLayoutContainer groupContainer;
      if (groupContainerMap.containsKey(group)) {
        groupContainer = groupContainerMap.get(group);
      } else {
        groupContainer =
            FormLayoutContainer.createDefaultFormLayout("group." + group, getTranslator());
        groupContainer.setFormTitle(translate("form.group." + group));
        formLayout.add(groupContainer);
        groupContainerMap.put(group, groupContainer);
        if (firstGroup) {
          groupContainer.setFormContextHelp("Configuration");
          firstGroup = false;
        }
      }

      if (homepagePropertyHanders.contains(userPropertyHandler)) {
        // add checkbox to container if configured for homepage usage identifier
        String checkboxName = userPropertyHandler.getName();
        MultipleSelectionElement publishCheckbox =
            uifactory.addCheckboxesHorizontal(
                checkboxName,
                userPropertyHandler.i18nFormElementLabelKey(),
                groupContainer,
                checkKeys,
                checkValues);

        boolean isEnabled = conf.isEnabled(userPropertyHandler.getName());
        publishCheckbox.select(checkKeys[0], isEnabled);
        publishCheckbox.setUserObject(userPropertyHandler.getName());

        // Mandatory homepage properties can not be changed by user
        if (userManager.isMandatoryUserProperty(
            HomePageConfig.class.getCanonicalName(), userPropertyHandler)) {
          publishCheckbox.select(checkKeys[0], true);
          publishCheckbox.setEnabled(false);
        } else {
          publishCheckbox.addActionListener(FormEvent.ONCHANGE);
        }
      }
    }

    String previewPage = velocity_root + "/homepage_preview.html";
    previewContainer =
        FormLayoutContainer.createCustomFormLayout("preview", getTranslator(), previewPage);
    previewContainer.setFormTitle(translate("tab.preview"));
    previewContainer.setRootForm(mainForm);
    formLayout.add(previewContainer);
    updatePreview(ureq);
  }
  @Override
  protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {

    FormLayoutContainer groupGradingCont =
        FormLayoutContainer.createDefaultFormLayout("groupGrading", getTranslator());
    groupGradingCont.setRootForm(mainForm);
    formLayout.add(groupGradingCont);

    applyToAllEl =
        uifactory.addCheckboxesHorizontal(
            "applytoall", "group.apply.toall", groupGradingCont, onKeys, onValues);
    applyToAllEl.addActionListener(FormEvent.ONCHANGE);
    applyToAllEl.setElementCssClass("o_sel_course_gta_apply_to_all");

    if (withPassed && cutValue == null) {
      groupPassedEl =
          uifactory.addCheckboxesHorizontal(
              "checkgroup", "group.passed", groupGradingCont, onKeys, onValues);
      groupPassedEl.setElementCssClass("o_sel_course_gta_group_passed");
    }

    if (withScore) {
      String pointVal = "";
      groupScoreEl =
          uifactory.addTextElement("pointgroup", "group.score", 5, pointVal, groupGradingCont);
      groupScoreEl.setElementCssClass("o_sel_course_gta_group_score");
    }

    if (withComment) {
      String comment = "";
      groupCommentEl =
          uifactory.addTextAreaElement(
              "usercomment", "group.comment", 2500, 5, 40, true, comment, groupGradingCont);
      groupCommentEl.setElementCssClass("o_sel_course_gta_group_comment");
    }

    FlexiTableColumnModel columnsModel = FlexiTableDataModelFactory.createFlexiTableColumnModel();
    if (isAdministrativeUser) {
      columnsModel.addFlexiColumnModel(
          new DefaultFlexiColumnModel(Cols.username.i18nKey(), Cols.username.ordinal()));
    }

    int i = 0;
    for (UserPropertyHandler userPropertyHandler : userPropertyHandlers) {
      int colIndex = GTACoachedGroupGradingController.USER_PROPS_OFFSET + i++;
      if (userPropertyHandler == null) continue;

      String propName = userPropertyHandler.getName();
      boolean visible =
          userManager.isMandatoryUserProperty(
              GTACoachedGroupGradingController.USER_PROPS_ID, userPropertyHandler);
      if (visible) {
        FlexiColumnModel col;
        if (UserConstants.FIRSTNAME.equals(propName) || UserConstants.LASTNAME.equals(propName)) {
          col =
              new DefaultFlexiColumnModel(
                  userPropertyHandler.i18nColumnDescriptorLabelKey(),
                  colIndex,
                  userPropertyHandler.getName(),
                  true,
                  propName,
                  new StaticFlexiCellRenderer(
                      userPropertyHandler.getName(), new TextFlexiCellRenderer()));
        } else {
          col =
              new DefaultFlexiColumnModel(
                  true,
                  userPropertyHandler.i18nColumnDescriptorLabelKey(),
                  colIndex,
                  true,
                  propName);
        }
        columnsModel.addFlexiColumnModel(col);
      }
    }

    if (withPassed && cutValue == null) {
      columnsModel.addFlexiColumnModel(
          new DefaultFlexiColumnModel(Cols.passedEl.i18nKey(), Cols.passedEl.ordinal()));
    }

    if (withScore) {
      columnsModel.addFlexiColumnModel(
          new DefaultFlexiColumnModel(Cols.scoreEl.i18nKey(), Cols.scoreEl.ordinal()));
    }

    if (withComment) {
      columnsModel.addFlexiColumnModel(
          new DefaultFlexiColumnModel(Cols.commentEl.i18nKey(), Cols.commentEl.ordinal()));
    }

    model = new GroupAssessmentModel(gtaNode, userPropertyHandlers, getLocale(), columnsModel);
    table =
        uifactory.addTableElement(
            getWindowControl(), "group-list", model, getTranslator(), formLayout);
    table.setCustomizeColumns(true);
    table.setEditMode(true);
    table.setAndLoadPersistedPreferences(ureq, "gtagroup-assessment");

    FormLayoutContainer buttonsCont =
        FormLayoutContainer.createButtonLayout("buttons", getTranslator());
    formLayout.add(buttonsCont);
    uifactory.addFormSubmitButton("save", buttonsCont);
    saveAndDoneButton = uifactory.addFormLink("save.done", buttonsCont, Link.BUTTON);
    uifactory.addFormCancelButton("cancel", buttonsCont, ureq, getWindowControl());
  }
 @Override
 protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
   formLayout.add(permissionCtrl.getInitialFormItem());
 }