Examples of IUserProfile


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

    this._userManager.addUser(user);
    this.addProfile(username, nome, cognome, email, cat1, cat2);
  }
 
  public void addProfile(String username, String nome, String cognome, String email, boolean cat1, boolean cat2) throws ApsSystemException {
    IUserProfile profile = this.createProfile(nome, cognome, email, cat1, cat2);
    this._profileManager.addProfile(username, profile);
  }
View Full Code Here

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

      }
    }
  }
 
  protected IUserProfile createProfile(String nome, String cognome, String email, boolean cat1, boolean cat2) {
    IUserProfile profile = _profileManager.getDefaultProfileType();
    ITextAttribute fullnameAttr = (ITextAttribute) profile.getAttribute("fullname");
    fullnameAttr.setText(nome, null);
    ITextAttribute emailAttr = (ITextAttribute) profile.getAttribute("email");
    emailAttr.setText(email, null);
    BooleanAttribute boolean1 = (BooleanAttribute) profile.getAttribute("boolean1");
    boolean1.setBooleanValue(new Boolean(cat1));
    BooleanAttribute boolean2 = (BooleanAttribute) profile.getAttribute("boolean2");
    boolean2.setBooleanValue(new Boolean(cat2));
    return profile;
  }
View Full Code Here

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

    String hash = null;
    try {
      if (null == username) {
        return null;
      }
      IUserProfile profile = (IUserProfile) this.getUserProfileManager().getProfile(username);
      if (null != profile) {
        String emailAttr = profile.getMailAttributeName();
        if (null == emailAttr) {
          return null;
        }
        String email = (String) profile.getValue(emailAttr);
        if (null != email) {
          hash = MD5Util.md5Hex(email);
        }
      }
    } catch (Throwable t) {
View Full Code Here

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

  private List<Content> extractContentsForUser(UserDetails user, String eMail, List<Content> contents,
      Map<String, List<String>> profileAttributes, NewsletterReport newsletterReport) throws ApsSystemException {
    NewsletterConfig config = this.getConfig();
    List<Content> userContents = new ArrayList<Content>();
    String username = user.getUsername();
    IUserProfile profile = (IUserProfile) user.getProfile();
    if (profile != null) {
      String allContentsAttribute = config.getAllContentsAttributeName();
      boolean allContents = false;
      if (null != allContentsAttribute) {
        Boolean value = (Boolean) profile.getValue(allContentsAttribute);
        allContents = value != null && value.booleanValue();
      }
      List<String> groupNames = this.extractUserGroupNames(user);
      boolean isGroupAdmin = groupNames.contains(Group.ADMINS_GROUP_NAME);
      for (int i=0; i<contents.size(); i++) {
        Content content = contents.get(i);
        String contentId = content.getId();
        List<String> contentProfileAttributes = profileAttributes.get(contentId);
        ContentReport contentReport = newsletterReport.getContentReport(contentId);
        if (contentReport != null && (isGroupAdmin || this.checkUserAllowedOnContent(groupNames, content))) {
          if (allContents) {
            userContents.add(content);
            contentReport.addRecipient(username, eMail);
          } else if (contentProfileAttributes!=null && contentProfileAttributes.size() > 0) {
            for (String profileAttrName : contentProfileAttributes) {
              Boolean value = (Boolean) profile.getValue(profileAttrName);
              if (value != null && value.booleanValue()) {
                userContents.add(content);
                contentReport.addRecipient(username, eMail);
                break;
              }
View Full Code Here

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

  }

  @Override
  public String testMail() {
    if (hasEmailCurrentUser()) {
      IUserProfile userProfile = (IUserProfile) this.getCurrentUser().getProfile();
      String mail = (userProfile).getValue(userProfile.getMailAttributeName()).toString();
      String mailText = this.getText("test.mail.subject");
      String mailSubject = this.getText("test.mail.text");
      String[] mailAddresses = {mail};
      try {
        this.getMailManager().sendMailForTest(mailText, mailSubject, mailAddresses, "CODE1");
View Full Code Here

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

    }
    return config;
  }

  public boolean hasEmailCurrentUser() {
    IUserProfile userProfile = (IUserProfile) this.getCurrentUser().getProfile();
    if (null != userProfile) {
      Object mailAttribute = userProfile.getValue(userProfile.getMailAttributeName());
      if (null != mailAttribute && StringUtils.isNotBlank(mailAttribute.toString())) {
        return true;
      }
    }
    return false;
View Full Code Here

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

      _userRegDAO.clearTokenByUsername(username);
    }
  }
 
  private void insertTestUserProfile(String username) throws Exception {
    IUserProfile profile = _userProfileManager.getDefaultProfileType();
    profile.setId(username);
    MonoTextAttribute fullnameAttr = (MonoTextAttribute) profile.getAttribute("fullname");
    fullnameAttr.setText("nametest surnametest");
    MonoTextAttribute emailAttr = (MonoTextAttribute) profile.getAttribute("email");
    emailAttr.setText(JpUserRegTestHelper.EMAIL);
    DateAttribute dateAttr = (DateAttribute) profile.getAttribute("birthdate");
    dateAttr.setDate(this.getBirthdate(1985, 11, 21));
    MonoTextAttribute languageAttr = (MonoTextAttribute) profile.getAttribute("language");
    languageAttr.setText("en");
    _userRegManager.regAccount(profile);
  }
View Full Code Here

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

  private void sendNewsletterToUser(String username, List<Content> contents,
      Map<String, List<String>> profileAttributes, NewsletterReport newsletterReport) {
    NewsletterConfig config = this.getConfig();
    try {
      UserDetails user = this.getUserManager().getUser(username);
      IUserProfile profile = (IUserProfile) user.getProfile();
      if (profile != null) {
        String eMail = (String) profile.getValue(config.getMailAttrName());
        if (eMail != null && eMail.length() > 0) {
          List<Content> userContents = this.extractContentsForUser(user, eMail, contents, profileAttributes, newsletterReport);
          if (userContents.size() > 0) {
            String[] emailAddresses = { eMail };
            String simpleText = this.prepareMailBody(userContents, newsletterReport, false);
View Full Code Here

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

public class CurrentAvatarAction extends UserAvatarAction {
 
  @Override
  protected IUserProfile getUserProfile() throws ApsSystemException {
    UserDetails currentUser = super.getCurrentUser();
    IUserProfile profile = (null != currentUser && null != currentUser.getProfile())
        ? (IUserProfile) currentUser.getProfile()
        : null;
    return profile;
  }
View Full Code Here

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

  }

  @Override
  public void reactivationByUserName(String username) throws ApsSystemException {
    try {
      IUserProfile profile = this.getUserProfileManager().getProfile(username);
      if (null != profile) {
        String token = this.createToken(username);
        this.getUserRegDAO().clearTokenByUsername(username);
        this.getUserRegDAO().addActivationToken(username, token, new Date(), IUserRegDAO.REACTIVATION_RECOVER_TOKEN_TYPE);
        this.sendAlertReactivateUser(username, profile, token);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.