Examples of UserProxy


Examples of com.dotmarketing.beans.UserProxy

   
    User user = APILocator.getUserAPI().loadUserById(userId,APILocator.getUserAPI().getSystemUser(),false);

    // Retriving info from db
    UserProxy userProxy = com.dotmarketing.business.APILocator.getUserProxyAPI().getUserProxy(user,APILocator.getUserAPI().getSystemUser(), false);
   
    if (!InodeUtils.isSet(userProxy.getInode())) {
      userProxy.setUserId(user.getUserId());
      HibernateUtil.saveOrUpdate(userProxy);
    }

    // Copy the attributes
    BeanUtils.copyProperties(form, user);
    BeanUtils.copyProperties(form, userProxy);
   

    // Extra user info
    form.setUserProxyInode(userProxy.getInode());

  }
View Full Code Here

Examples of com.dotmarketing.beans.UserProxy

  {
    ArrayList<UserProxy> userProxyList = new ArrayList<UserProxy>();
    String[] userIdArray = userIdList.split(",");
    for(String userId : userIdArray)
    {
      UserProxy userProxy;
      try {
        userProxy = com.dotmarketing.business.APILocator.getUserProxyAPI().getUserProxy(userId,APILocator.getUserAPI().getSystemUser(), false);
      } catch (Exception e) {
        Logger.error(UserManagerListBuilderFactory.class, e.getMessage(), e);
        throw new DotRuntimeException(e.getMessage(), e);
      }
      if(InodeUtils.isSet(userProxy.getInode()))
      {
        userProxyList.add(userProxy);
      }
    }
    return userProxyList;
View Full Code Here

Examples of com.dotmarketing.beans.UserProxy

  private UserProxyCache upc = CacheLocator.getUserProxyCache();
 
  @Override
  public UserProxy getUserProxy(String userId) throws DotRuntimeException, DotHibernateException{
        UserProxy up = null;
        up = upc.getUserProxyFromUserId(userId);
        if(!UtilMethods.isSet(up)){
      try {
        HibernateUtil dh = new HibernateUtil(UserProxy.class);
        dh.setQuery("from user_proxy in class com.dotmarketing.beans.UserProxy where user_id = ?");
        dh.setParam(userId);
 
        up = (UserProxy) dh.load();
        upc.addToUserProxyCache(up);
      } catch (Exception e) {
        throw new DotRuntimeException(e.getMessage(),e);
      }
     
          if (!InodeUtils.isSet(up.getInode())) {
          // if we don't have a user proxy, create one
          up.setUserId(userId);
          HibernateUtil.saveOrUpdate(up);
          upc.addToUserProxyCache(up);
        }
        }
    return up;
View Full Code Here

Examples of com.dotmarketing.beans.UserProxy

    return up;
  }

  @Override
  public UserProxy getUserProxyByLongLiveCookie(String dotCMSID) throws DotRuntimeException{
    UserProxy up = null;
    up = upc.getUserProxyFromLongCookie(dotCMSID);
        if(!UtilMethods.isSet(up)){
      try {
        HibernateUtil dh = new HibernateUtil(UserProxy.class);
        dh.setQuery("from user_proxy in class com.dotmarketing.beans.UserProxy where lower(long_lived_cookie) = lower(?)");
View Full Code Here

Examples of com.dotmarketing.beans.UserProxy

  }

  @Override
  public void saveUserProxy(UserProxy userProxy) throws DotRuntimeException, DotDataException{
    HibernateUtil hu = new HibernateUtil();
    UserProxy up = (UserProxy)hu.load(UserProxy.class, userProxy.getInode());
    try {
      BeanUtils.copyProperties(up, userProxy);
      up.setNoclicktracking(userProxy.isNoclicktracking());
    } catch (Exception e) {
      throw new DotRuntimeException(e.getMessage(), e);
    }
    HibernateUtil.saveOrUpdate(up);
    upc.remove(up);
View Full Code Here

Examples of com.dotmarketing.beans.UserProxy

                userId = _save(form, req, res);

                User user = retrieveMember(userId, userForm);
                Address address = retrieveAddress(user.getUserId());
                UserProxy userProxy = com.dotmarketing.business.APILocator.getUserProxyAPI().getUserProxy(user,APILocator.getUserAPI().getSystemUser(), false);

                UserManagerListSearchForm searchForm = new UserManagerListSearchForm();
                BeanUtils.copyProperties(searchForm, user);
                BeanUtils.copyProperties(searchForm, address);
                BeanUtils.copyProperties(searchForm, userProxy);
View Full Code Here

Examples of com.dotmarketing.beans.UserProxy

    User user = APILocator.getUserAPI().loadUserById(userId,APILocator.getUserAPI().getSystemUser(),false);

    if (user.getUserId() != null && !com.liferay.portal.util.Constants.SAVE.equals(cmd)) {

      // Retriving info from db
      UserProxy userProxy = com.dotmarketing.business.APILocator.getUserProxyAPI().getUserProxy(user,APILocator.getUserAPI().getSystemUser(), false);

      Address address = retrieveAddress(user.getUserId());

      // Copy the attributes
      BeanUtils.copyProperties(form, user);

      if(!UtilMethods.isSet(userProxy.getPrefix())){
        userProxy.setPrefix("other");
      }

      BeanUtils.copyProperties(form, userProxy);

      if(!UtilMethods.isSet(address.getDescription())){
        address.setDescription("other");
      }

      BeanUtils.copyProperties(form, address);

      // Extra user info
      userForm.setUserID(user.getUserId());


      List<Category> oldcategories = InodeFactory.getChildrenClass(userProxy,Category.class);

//      Add User Categories
      List<Category> catList = InodeFactory.getChildrenClass(userProxy,Category.class);
      if(catList.size() > 0){
        String[] categories = new String[catList.size()];
        for(int i = 0 ; i < catList.size() ;++i){
          Category cat = catList.get(i);
          categories[i] = String.valueOf(cat.getInode());
          userProxy.addChild(cat);
        }
      }
      BeanUtils.copyProperties(form, address);

      BeanUtils.copyProperties(form, address);
View Full Code Here

Examples of com.dotmarketing.beans.UserProxy

    String userId = userForm.getUserID();

    //Saving Personal Information
    String companyId = com.dotmarketing.cms.factories.PublicCompanyFactory.getDefaultCompany().getCompanyId();
    User user = APILocator.getUserAPI().loadUserById(userId,APILocator.getUserAPI().getSystemUser(),false);
    UserProxy userProxy = com.dotmarketing.business.APILocator.getUserProxyAPI().getUserProxy(user,APILocator.getUserAPI().getSystemUser(), false);

    //delete user tags
    List<TagInode> userTagsList = TagFactory.getTagInodeByInode(String.valueOf(userProxy.getInode()));
    for(TagInode tag : userTagsList){
        Tag retrievedTag = TagFactory.getTagByTagId(tag.getTagId());
      TagFactory.deleteTagInode(tag);
      TagFactory.deleteTag(retrievedTag.getTagId());
    }
View Full Code Here

Examples of com.dotmarketing.beans.UserProxy

    }

    if (user == null)
      user = retrieveMember(userId, userForm);

    UserProxy userProxy = com.dotmarketing.business.APILocator.getUserProxyAPI().getUserProxy(user,APILocator.getUserAPI().getSystemUser(), false);

    user.setFirstName(userForm.getFirstName());

    if (userForm.getMiddleName() != null)
      user.setMiddleName(userForm.getMiddleName());

    user.setLastName(userForm.getLastName());

    if (userForm.getDateOfBirthDate() != null)
      user.setBirthday(userForm.getDateOfBirthDate());

    if (userForm.getNickName() != null)
      user.setNickName(userForm.getNickName());

    if (userForm.getSex() != null)
      user.setMale(userForm.getSex().equalsIgnoreCase("M") ? true : false);

    if(UtilMethods.isSet(userForm.getChallengeQuestionId()) && UtilMethods.isInt(userForm.getChallengeQuestionId())){
      userProxy.setChallengeQuestionId(userForm.getChallengeQuestionId());
    }
    if(UtilMethods.isSet(userForm.getChallengeQuestionAnswer())){
      userProxy.setChallengeQuestionAnswer(userForm.getChallengeQuestionAnswer());
    }
    if (!userForm.getPrefix().equals("other"))
      userProxy.setPrefix(userForm.getPrefix());
    else
      userProxy.setPrefix(userForm.getOtherPrefix());

    userProxy.setSuffix(userForm.getSuffix());
    userProxy.setTitle(userForm.getTitle());
    userProxy.setCompany(companyId);

    if (userForm.getSchool() != null)
      userProxy.setSchool(userForm.getSchool());

    if (0 < userForm.getGraduation_year())
      userProxy.setGraduation_year(userForm.getGraduation_year());

    // User Name and password
    if (!UtilMethods.isSet(user.getEmailAddress()) || !user.getEmailAddress().equals(userForm.getEmailAddress()))
      user.setEmailAddress(userForm.getEmailAddress().trim().toLowerCase());

    if ((userForm.getNewPassword() != null) && (!userForm.getNewPassword().equals(""))) {
      user.setPassword(PublicEncryptionFactory.digestString(userForm.getNewPassword()));
      user.setPasswordEncrypted(true);
    }

    if (user.isNew() || userForm.getPassChanged().equals("true")) {
      user.setPassword(PublicEncryptionFactory.digestString(userForm.getPassword()));
      user.setPasswordEncrypted(true);
    }

    APILocator.getUserAPI().save(user,APILocator.getUserAPI().getSystemUser(),false);
       
    _setRolePermission(userProxy, req);
   
    if(!InodeUtils.isSet(userProxy.getInode()) ){
      userProxy.setUserId(user.getUserId());
      userProxy.setChallengeQuestionId("0");
      com.dotmarketing.business.APILocator.getUserProxyAPI().saveUserProxy(userProxy,APILocator.getUserAPI().getSystemUser(), false);
    } else {
      com.dotmarketing.business.APILocator.getUserProxyAPI().saveUserProxy(userProxy,APILocator.getUserAPI().getSystemUser(), false);

    }
View Full Code Here

Examples of com.dotmarketing.beans.UserProxy

    UserManagerForm userForm = new UserManagerForm();
    try {
      BeanUtils.copyProperties(userForm,form);

      UserProxy userProxy = com.dotmarketing.business.APILocator.getUserProxyAPI().getUserProxy(userForm.getUserID(),APILocator.getUserAPI().getSystemUser(), false);

      if (!userForm.getPrefix().equals("other"))
        userProxy.setPrefix(userForm.getPrefix());
      else
        userProxy.setPrefix(userForm.getOtherPrefix());

      userProxy.setSuffix(userForm.getSuffix());
      userProxy.setTitle(userForm.getTitle());
      userProxy.setSchool(userForm.getSchool());
      userProxy.setGraduation_year(userForm.getGraduation_year());

      HibernateUtil.saveOrUpdate(userProxy);

    } catch (IllegalAccessException e) {
      Logger.error(this,e.getMessage(),e);
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.