Package org.olat.user

Examples of org.olat.user.UserManager


          ImPreferences imPrefs = ipm.loadOrCreatePropertiesFor(changeableIdentity);
          onlineListForm.updateImPreferencesFromFormData(imPrefs);
          ipm.updatePropertiesFor(changeableIdentity, imPrefs);
         
          UserManager um = UserManager.getInstance();
          um.updateUserFromIdentity(changeableIdentity);
        
        fireEvent(ureq, Event.DONE_EVENT);
      } else if (event == Form.EVNT_FORM_CANCELLED) {
        // Form is cancelled
        fireEvent(ureq, Event.CANCELLED_EVENT);
View Full Code Here


  public FormItem addFormItem(Locale locale, User user, String usageIdentifyer, boolean isAdministrativeUser,
      FormItemContainer formItemContainer) {
    SelectionElement sElem = null;
    sElem = FormUIFactory.getInstance().addCheckboxesVertical(getName(), i18nFormElementLabelKey(), formItemContainer, new String[] { getName() }, new String[]{ "" }, null, 1);
   
    UserManager um = UserManager.getInstance();
    if ( um.isUserViewReadOnly(usageIdentifyer, this) && ! isAdministrativeUser) {
      sElem.setEnabled(false);
    }
    if (um.isMandatoryUserProperty(usageIdentifyer, this)) {
      sElem.setMandatory(true);
    }
    return sElem;
  }
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) {
    CheckBoxElement ui = null;
    UserManager um = UserManager.getInstance();
   
    String value = getInternalValue(user);
    boolean isEnabled = value != null && value.equals("true") ? Boolean.TRUE : Boolean.FALSE;
    ui = new CheckBoxElement(i18nFormElementLabelKey(), isEnabled);
    if ( um.isUserViewReadOnly(usageIdentifyer, this) && ! isAdministrativeUser) {
      ui.setReadOnly(true);
    }
    if (um.isMandatoryUserProperty(usageIdentifyer, this)) {
      ui.setMandatory(true);
    }
    return ui;
  }
View Full Code Here

      return false;
    }
    /*
     * make an archive of the course nodes with valuable data
     */
    UserManager um = UserManager.getInstance();
    String charset = um.getUserCharset(ureq.getIdentity());
    CourseFactory.archiveCourse(res,charset,ureq.getLocale(),ureq.getIdentity());
    /*
     *
     */
    return true;
View Full Code Here

        final boolean logStatisticChecked = logFileChooserForm.logStatChecked();
       
        final Date begin = logFileChooserForm.getBeginDate();
        final Date end = logFileChooserForm.getEndDate();
       
        UserManager um = UserManager.getInstance();
        final String charset = um.getUserCharset(ureq.getIdentity());
       
        ICourse course = CourseFactory.loadCourse(ores);
        final String courseTitle = course.getCourseTitle();
        final String targetDir = CourseFactory.getOrCreateDataExportDirectory(ureq.getIdentity(), courseTitle).getPath();
       
View Full Code Here

  }

  protected boolean archiveNode(UserRequest ureq) {
    ICourse course = CourseFactory.loadCourse(ores);
    File exportDir = CourseFactory.getOrCreateDataExportDirectory(ureq.getIdentity(), course.getCourseTitle());
    UserManager um = UserManager.getInstance();
    String charset = um.getUserCharset(ureq.getIdentity());
    currentCourseNode.archiveNodeData(ureq.getLocale(), course, exportDir, charset);
    return true;
  }
View Full Code Here

  }
 
  private boolean archiveForumNode(UserRequest ureq){
    ICourse course = CourseFactory.loadCourse(ores);
    File exportDir = CourseFactory.getOrCreateDataExportDirectory(ureq.getIdentity(), course.getCourseTitle());
    UserManager um = UserManager.getInstance();
    String charset = um.getUserCharset(ureq.getIdentity());
    currentCourseNode.archiveNodeData(ureq.getLocale(), course, exportDir, charset);
    return true;
  }
View Full Code Here

    //
    /*
     * remove new nodes which were marked as delete and deletion is published.
     */
    File exportDirectory = CourseFactory.getOrCreateDataExportDirectory(identity, course.getCourseTitle());
    UserManager um = UserManager.getInstance();
    String charset = um.getUserCharset(identity);
    if (editorModelDeletedNodes.size() > 0) {
      for (Iterator<CourseEditorTreeNode> iter = editorModelDeletedNodes.iterator(); iter.hasNext();) {
        CourseEditorTreeNode cetn = iter.next();
        CourseNode cn = cetn.getCourseNode();
        CourseNode oldCn = existingCourseRun.getNode(cetn.getIdent());
View Full Code Here

   * @param wikiPage
   * @return
   */
  public static Document createDocument(SearchResourceContext searchResourceContext, Identity identity) {   

    UserManager userMgr = UserManager.getInstance();
    User user = identity.getUser();
   
    HomePageConfigManager homepageMgr = HomePageConfigManagerImpl.getInstance();
    HomePageConfig publishConfig = homepageMgr.loadConfigFor(identity.getName());

    IdentityDocument identityDocument = new IdentityDocument();
    identityDocument.setTitle(identity.getName());
    identityDocument.setCreatedDate(user.getCreationDate());
   
    // loop through all user properties and collect the content string and the last modified
    List<UserPropertyHandler> userPropertyHanders = userMgr.getUserPropertyHandlersFor(IdentityDocument.class.getName(), false);
    StringBuilder content = new StringBuilder();
    for (UserPropertyHandler userPropertyHandler : userPropertyHanders) {
      String propertyName = userPropertyHandler.getName();
      // only index fields the user has published!
      if (publishConfig.isEnabled(propertyName)) {
View Full Code Here

  public UserSearchForm(String name, Translator translator, boolean isAdmin, boolean cancelbutton, boolean statusEnabled) {
    super(name, translator);
    this.isAdmin = isAdmin;
    addFormElement("login", new TextElement("search.form.login", 128));
   
    UserManager um = UserManager.getInstance();
    userPropertyHandlers = um.getUserPropertyHandlersFor(formIdentifyer, isAdmin);
    // Add all available user fields to this form
    for (UserPropertyHandler userPropertyHandler : userPropertyHandlers) {
      if (userPropertyHandler == null) continue;
      FormElement ui = userPropertyHandler.getFormElement(getLocale(), null, formIdentifyer, false);
      addFormElement(userPropertyHandler.getName(), ui);
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.