Package org.entando.entando.aps.system.services.userprofile.model

Examples of org.entando.entando.aps.system.services.userprofile.model.IUserProfile


  }
 
  protected String getMailAddress(String username) throws Throwable {
    String email = null;
    IUserProfileManager profileManager = (IUserProfileManager) super.getBeanFactory().getBean(SystemConstants.USER_PROFILE_MANAGER);
    IUserProfile profile = profileManager.getProfile(username);
    if (null != profile) {
      ITextAttribute mailAttribute = (ITextAttribute) profile.getAttributeByRole(SystemConstants.USER_PROFILE_ATTRIBUTE_ROLE_MAIL);
      if (null != mailAttribute && mailAttribute.getText().trim().length() > 0) {
        email = mailAttribute.getText();
      }
    }
    return email;
View Full Code Here


 
  public void testSaveEditSuccessful() throws Throwable {
    try {
      String username = "editorCoach";
      Date birthdate = this._helper.setBirthdate(1982, 10, 25);
      IUserProfile profile = this._helper.createUserProfile("1", "name surname", "email", birthdate, "it");
      IContact contact = this._helper.createContact(profile.getId(), username, true, profile);
      this._addressBookManager.addContact(contact);
     
      String result = this.executeEdit(username, contact.getId());
      assertEquals(Action.SUCCESS, result);
     
      Map<String, Object> params = new HashMap<String, Object>();
      params.put("Monotext:fullname", "nameMOD surnameMOD");
      params.put("Monotext:email", "email@eeeeeeemail.it");
      params.put("Date:birthdate", "10/09/1986");
      params.put("Monotext:language", "langMOD");
      result = this.executeSave(username, params);
      assertEquals(Action.SUCCESS, result);
     
      List<String> contactIds = this._addressBookManager.getAllowedContacts(username, null);
      assertEquals(1, contactIds.size());
      contact = this._addressBookManager.getContact(contactIds.get(0));
      assertEquals(username, contact.getOwner());
      assertEquals(true, contact.isPublicContact());
      profile = contact.getContactInfo();
      assertEquals("nameMOD surnameMOD", ((ITextAttribute) profile.getAttribute("fullname")).getText());
      assertEquals("email@eeeeeeemail.it", ((ITextAttribute) profile.getAttribute("email")).getText());
      assertEquals("10/09/1986", ((DateAttribute) profile.getAttribute("birthdate")).getFormattedDate("dd/MM/yyyy"));
      assertEquals("langMOD", ((ITextAttribute) profile.getAttribute("language")).getText());
    } catch (Throwable t) {
      throw t;
    } finally {
      this._helper.cleanAddressBook();
    }
View Full Code Here

    }
  }
 
  public void addContact(String id, String owner,
      boolean publicContact, String fullname, String email, Date birthdate, String lang) {
    IUserProfile profile = this.createUserProfile(id, fullname, email, birthdate, lang);
    Contact contact = this.createContact(id, owner, publicContact, profile);
    this._addressBookDAO.addContact(contact);
  }
View Full Code Here

TOP

Related Classes of org.entando.entando.aps.system.services.userprofile.model.IUserProfile

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.