Package org.olat.user

Examples of org.olat.user.UserManager


   */
  public FormItem addFormItem(Locale locale, User user, String usageIdentifyer, boolean isAdministrativeUser,  FormItemContainer formItemContainer) {
    org.olat.core.gui.components.form.flexible.elements.DateChooser dateElem = null;
    dateElem = FormUIFactory.getInstance().addDateChooser(getName(), i18nFormElementLabelKey(), getInternalValue(user), formItemContainer);
    dateElem.setItemValidatorProvider(this);
    UserManager um = UserManager.getInstance();
    if ( um.isUserViewReadOnly(usageIdentifyer, this) && ! isAdministrativeUser) {
      dateElem.setEnabled(false);
    }
    if (um.isMandatoryUserProperty(usageIdentifyer, this)) {
      dateElem.setMandatory(true);
    }
   
    dateElem.setExampleKey("form.example.free", new String[] {Formatter.getInstance(locale).formatDate(new Date())});
    return dateElem;
View Full Code Here


  /**
   * @see org.olat.user.propertyhandlers.UserPropertyHandler#getFormElement(java.util.Locale, org.olat.core.id.User, java.lang.String, boolean)
   */
  public FormElement getFormElement(Locale locale, User user, String usageIdentifyer, boolean isAdministrativeUser) {
    UserManager um = UserManager.getInstance();
    StaticSingleSelectionElement ui = new StaticSingleSelectionElement(i18nFormElementLabelKey(), keys, getTranslatedValues(locale));
    updateFormElementFromUser(ui, user);   
    if ( um.isUserViewReadOnly(usageIdentifyer, this) && ! isAdministrativeUser) {
      ui.setReadOnly(true);
    }
    if (um.isMandatoryUserProperty(usageIdentifyer, this)) {
      ui.setMandatory(true);
    }
    return ui;
  }
View Full Code Here

      genderElem.select(this.getInternalValue(user), true);
    } else {
      genderElem.select("-", true);
    }
   
    UserManager um = UserManager.getInstance();
    if ( um.isUserViewReadOnly(usageIdentifyer, this) && ! isAdministrativeUser) {
      genderElem.setEnabled(false);
    }
    if (um.isMandatoryUserProperty(usageIdentifyer, this)) {
      genderElem.setMandatory(true);
    }
    return genderElem;
  }
View Full Code Here

TOP

Related Classes of org.olat.user.UserManager

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.