Package org.olat.core.id

Examples of org.olat.core.id.User


      private String mypickupV = pickupV;
      private Translator myTranslator = translator;

      @Override
      public void putVariablesInMailContext(VelocityContext context, Identity recipient) {// Put user variables into velocity context
        User user = recipient.getUser();
        context.put("firstname", user.getProperty(UserConstants.FIRSTNAME, null));
        context.put("lastname", user.getProperty(UserConstants.LASTNAME, null));
        context.put("login", recipient.getName());
        //make translator available instead of putting translated keys into context
        context.put("t", myTranslator);
        StringBuffer userPropsString = new StringBuffer();
        for (String[] keyValue : userprops) {
View Full Code Here


      }
    }

    // Create transient user without firstName,lastName, email
    UserManager um = UserManager.getInstance();
    User newUser = um.createUser(null, null, null);

    List<UserPropertyHandler> userProperties = userPropertyHandlers;
    int col = 4;
    String thisValue = "", stringValue;
    for (UserPropertyHandler userPropertyHandler : userProperties) {
      thisValue = singleUser.get(col);
      stringValue = userPropertyHandler.getStringValue(thisValue, getLocale());
      userPropertyHandler.setUserProperty(newUser, stringValue);
      col++;
    }
    // Init preferences
    newUser.getPreferences().setLanguage(lang);
    newUser.getPreferences().setInformSessionTimeout(true);
    // Save everything in database
    Identity ident = AuthHelper.createAndPersistIdentityAndUserWithUserGroup(login, pwd, newUser);
    return ident;
  }
View Full Code Here

      StringBuilder names = new StringBuilder("");
      if(event.getParticipants() == null || event.getParticipants().length < 1)
        return "";
      for( String participant : event.getParticipants() ) {
        Identity identity = ManagerFactory.getManager().findIdentityByName(participant);
        User user = identity.getUser();
        names.append(user.getProperty(UserConstants.LASTNAME, getLocale()) + ", " + user.getProperty(UserConstants.FIRSTNAME, getLocale()) + "<br>");
      }
      return names.toString();
    case 6:
      //usernames
      StringBuilder usernames = new StringBuilder("");
View Full Code Here

  /**
   * @see org.olat.core.gui.components.table.TableDataModel#getValueAt(int, int)
   */
  public final Object getValueAt(int row, int col) {
    Identity identity = (Identity) getObject(row);
    User user = identity.getUser();
    if (col == 0) {
      return identity.getName();     

    } else if ((col-1) < userPropertyHandlers.size()) {
      UserPropertyHandler userPropertyHandler = userPropertyHandlers.get(col-1);
View Full Code Here

  }

  private void doUserMessage(UserRequest ureq) {
    List users = new ArrayList();
    users.add(this.currentIdentity);
    User user = this.currentIdentity.getUser();
    Locale loc = I18nManager.getInstance().getLocaleOrDefault(user.getPreferences().getLanguage());
    doSendMessage(users, user.getProperty(UserConstants.FIRSTNAME, loc) + " " + user.getProperty(UserConstants.LASTNAME, loc), ureq);
    sendMessageVC.contextPut("title", getTranslator().translate("user.message", new String[] { this.currentIdentity.getUser().getProperty(UserConstants.FIRSTNAME, getLocale()),
        this.currentIdentity.getUser().getProperty(UserConstants.FIRSTNAME, getLocale()) }));
  }
View Full Code Here

  /**
   * @see org.olat.core.gui.components.table.TableDataModel#getValueAt(int, int)
   */
  public final Object getValueAt(int row, int col) {
    Identity identity = getIdentityAt(row);
    User user = identity.getUser();
    if (col == 0) {
      return identity.getName();

    } else if (col > 0 && col < userPropertyHandlers.size() + 1) {
      // get user property for this column
      UserPropertyHandler userPropertyHandler = userPropertyHandlers.get(col - 1);
      String value = userPropertyHandler.getUserProperty(user, getLocale());
      return (value == null ? "n/a" : value);

    } else if (col == userPropertyHandlers.size() + 1) {
      return identity.getLastLogin();
    } else if (col == userPropertyHandlers.size() + 2) {
      return user.getCreationDate();

    } else {
      return "error";
    }
  }
View Full Code Here

      // TODO Auto-generated method stub

    }

    public User getUser() {
      return new User(){
        Map<String, String> data = new HashMap<String, String>();
        {
          data.put(UserConstants.FIRSTNAME, "Zsuz Irchel");
          data.put(UserConstants.LASTNAME, "Druckerei Irchel");
          data.put(UserConstants.EMAIL, "drucki@zsuz.uzh.ch");
View Full Code Here

      // TODO Auto-generated method stub

    }

    public User getUser() {
      return new User(){
        Map<String, String> data = new HashMap<String, String>();
        {
          data.put(UserConstants.FIRSTNAME, "Zsuz Zentrum");
          data.put(UserConstants.LASTNAME, "Druckerei Zentrum");
          data.put(UserConstants.EMAIL, "druckz@zsuz.uzh.ch");
View Full Code Here

   * @param config The user's home page configuration (i.e. flags for publicly
   *          visible fields).
   * @param identity The user's identity
   */
  public void updateFromFormData(final HomePageConfig config, final Identity identity) {
    User user = identity.getUser();
    // For each user property...
    for (UserPropertyHandler userPropertyHandler : this.userPropertyHandlers) {

      // ...get the value from the form field and store it into the user
      // property...
View Full Code Here

   *
   * @param id The identity to be updated (transient, does not do any db calls)
   * @return the updated identity object
   */
  public Identity updateIdentityFromFormData(Identity id) {
    User user = id.getUser();
    // update each user field
    for (UserPropertyHandler userPropertyHandler : userPropertyHandlers) {
      FormItem formItem = this.formItems.get(userPropertyHandler.getName());

      userPropertyHandler.updateUserFromFormItem(user, formItem);
View Full Code Here

TOP

Related Classes of org.olat.core.id.User

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.