Examples of UserProxy


Examples of com.dotmarketing.beans.UserProxy

      }
      APILocator.getUserAPI().save(user,APILocator.getUserAPI().getSystemUser(),false);
      // ### END CREATE USER ###

      // ### CREATE USER_PROXY ###
      UserProxy userProxy = com.dotmarketing.business.APILocator.getUserProxyAPI().getUserProxy(user.getUserId(),APILocator.getUserAPI().getSystemUser(), false);
      userProxy.setPrefix("");
      userProxy.setTitle(form.getTitle());
      userProxy.setOrganization(form.getOrganization());
      userProxy.setUserId(user.getUserId());
      com.dotmarketing.business.APILocator.getUserProxyAPI().saveUserProxy(userProxy,APILocator.getUserAPI().getSystemUser(), false);
      // ### END CRETE USER_PROXY ###

      // saving user inode on web form
      form.setUserInode(userProxy.getInode());
      if(UtilMethods.isSet(form.getFormType())){
      HibernateUtil.saveOrUpdate(form);
      }

      ///// WE CAN DO THIS! BUT WE NEED TO ADD CATEGORIES TO WEBFORM AND ALSO CHANGE THE PROCESSES THAT
View Full Code Here

Examples of com.dotmarketing.beans.UserProxy

    }

    private void subscribeToMailingLists(User u, String[] mailingListsInodes, boolean unsubscribeFromAll)throws Exception {

      MailingList ml;
      UserProxy s = com.dotmarketing.business.APILocator.getUserProxyAPI().getUserProxy(u,APILocator.getUserAPI().getSystemUser(), false);

      if (InodeUtils.isSet(s.getInode()))  {
      List<MailingList> mailingLists = MailingListFactory.getAllPublicLists();
      Iterator<MailingList> it = mailingLists.iterator();
      while (it.hasNext()) {
        ml = (MailingList) it.next();
        MailingListFactory.deleteUserFromMailingList(ml, s);
View Full Code Here

Examples of com.dotmarketing.beans.UserProxy

    }
    APILocator.getUserAPI().save(user,APILocator.getUserAPI().getSystemUser(),false);


    //### CREATE USER_PROXY ###       
    UserProxy userProxy = com.dotmarketing.business.APILocator.getUserProxyAPI().getUserProxy(user.getUserId(),APILocator.getUserAPI().getSystemUser(), false);
    userProxy.setUserId(user.getUserId());
    userProxy.setPrefix(createAccountForm.getPrefix());
    userProxy.setSuffix(createAccountForm.getSuffix());
    userProxy.setTitle(createAccountForm.getTitle());
    userProxy.setSchool(createAccountForm.getSchool());
    userProxy.setGraduationYear(createAccountForm.getGraduationYear());
    userProxy.setOrganization(createAccountForm.getOrganization());
    userProxy.setCompany(createAccountForm.getOrganization());
    userProxy.setWebsite(createAccountForm.getWebsite());
    userProxy.setHowHeard(createAccountForm.getHowHeard());

    userProxy.setVar1(createAccountForm.getVar1());
    userProxy.setVar2(createAccountForm.getVar2());
    userProxy.setVar3(createAccountForm.getVar3());
    userProxy.setVar4(createAccountForm.getVar4());
    userProxy.setVar5(createAccountForm.getVar5());
    userProxy.setVar6(createAccountForm.getVar6());
    userProxy.setVar7(createAccountForm.getVar7());
    userProxy.setVar8(createAccountForm.getVar8());
    userProxy.setVar9(createAccountForm.getVar9());
    userProxy.setVar10(createAccountForm.getVar10());
    userProxy.setVar11(createAccountForm.getVar11());
    userProxy.setVar12(createAccountForm.getVar12());
    userProxy.setVar13(createAccountForm.getVar13());
    userProxy.setVar14(createAccountForm.getVar14());
    userProxy.setVar15(createAccountForm.getVar15());
    userProxy.setVar16(createAccountForm.getVar16());
    userProxy.setVar17(createAccountForm.getVar17());
    userProxy.setVar18(createAccountForm.getVar18());
    userProxy.setVar19(createAccountForm.getVar19());
    userProxy.setVar20(createAccountForm.getVar20());
    userProxy.setVar21(createAccountForm.getVar21());
    userProxy.setVar22(createAccountForm.getVar22());
    userProxy.setVar23(createAccountForm.getVar23());
    userProxy.setVar24(createAccountForm.getVar24());
    userProxy.setVar25(createAccountForm.getVar25());

    if (UtilMethods.isSet(createAccountForm.getDescription()) ||
        UtilMethods.isSet(createAccountForm.getStreet1()) ||
        UtilMethods.isSet(createAccountForm.getStreet2()) ||
        UtilMethods.isSet(createAccountForm.getCity()) ||
        UtilMethods.isSet(createAccountForm.getState()) ||
        UtilMethods.isSet(createAccountForm.getZip()) ||
        UtilMethods.isSet(createAccountForm.getCountry()) ||
        UtilMethods.isSet(createAccountForm.getPhone()) ||
        UtilMethods.isSet(createAccountForm.getFax()) ||
        UtilMethods.isSet(createAccountForm.getCell())) {
      try {
        List<Address> addresses = PublicAddressFactory.getAddressesByUserId(user.getUserId());
        Address address = (addresses.size() > 0 ? addresses.get(0) : PublicAddressFactory.getInstance());
        address.setDescription(createAccountForm.getDescription() == null ? "" : createAccountForm.getDescription());
        address.setStreet1(createAccountForm.getStreet1() == null ? "" : createAccountForm.getStreet1());
        address.setStreet2(createAccountForm.getStreet2() == null ? "" : createAccountForm.getStreet2());
        address.setCity(createAccountForm.getCity() == null ? "" : createAccountForm.getCity());
        address.setState(createAccountForm.getState() == null ? "" : createAccountForm.getState());
        address.setZip(createAccountForm.getZip() == null ? "" : createAccountForm.getZip());
        address.setCountry(createAccountForm.getCountry() == null ? "" : createAccountForm.getCountry());
        address.setPhone(createAccountForm.getPhone() == null ? "" : createAccountForm.getPhone());
        address.setFax(createAccountForm.getFax() == null ? "" : createAccountForm.getFax());
        address.setCell( createAccountForm.getCell() == null ? "" :  createAccountForm.getCell());
        address.setUserId(user.getUserId());
        address.setCompanyId(company.getCompanyId());
        PublicAddressFactory.save(address);
      } catch (Exception e) {
        Logger.warn(this, e.toString());
      }
    }

    userProxy.setMailSubscription(createAccountForm.isMailSubscription());
    com.dotmarketing.business.APILocator.getUserProxyAPI().saveUserProxy(userProxy,APILocator.getUserAPI().getSystemUser(), false);       
    //### END CRETE USER_PROXY ###


    String[] arr = form.getCategories();
    if (arr != null) {
      for (int i = 0; i < arr.length; i++) {
        try {
          Category node = (Category) InodeFactory.getInode(arr[i], Category.class);
          node.addChild(userProxy);
        } catch (Exception e) {
          Logger.warn(this, e.toString());
        }
      }
    }




    //### END CREATE USER COMMENT###
    if(UtilMethods.isSet(form.getComments())){
      UserComment userComments = new UserComment();
      userComments.setUserId(userProxy.getUserId());
      userComments.setCommentUserId(user.getUserId());
      userComments.setDate(new java.util.Date());
      userComments.setComment(form.getComments());
      userComments.setTypeComment("incoming");
      userComments.setSubject("User Comment");
      userComments.setMethod("Regular");
      userComments.setCommunicationId(null);
      UserCommentsFactory.saveUserComment(userProxy.getInode(),userComments);
    }       
    if (form.isMailSubscription()) {
      //Subscribe to the mailing list
      if(UtilMethods.isSet(Config.getStringProperty("CREATE_ACCOUNT_MAILING_LIST"))){
        List<MailingList> list = MailingListFactory.getAllMailingLists();
View Full Code Here

Examples of com.dotmarketing.beans.UserProxy

  }
 
  public List getTagsByUser(User user) {
    List tagsUser = (List) request.getSession().getAttribute(WebKeys.LOGGED_IN_USER_TAGS);
    if (!UtilMethods.isSet(tagsUser) || tagsUser.size() == 0) {
      UserProxy up;
      try {
        up = com.dotmarketing.business.APILocator.getUserProxyAPI().getUserProxy(user.getUserId(),APILocator.getUserAPI().getSystemUser(), false);
      } catch (Exception e) {
        Logger.error(this, e.getMessage(), e);
        return new ArrayList();
     
      tagsUser = TagFactory.getTagInodeByInode(String.valueOf(up.getInode()));
      request.getSession().setAttribute(WebKeys.LOGGED_IN_USER_TAGS, tagsUser);
    }
    return tagsUser;
  }
View Full Code Here

Examples of com.dotmarketing.beans.UserProxy

  }

  @Override
  protected UserProxy getUserProxyFromUserId(String userId) {
    String key = primaryGroup + userId;
    UserProxy up = null;
      try{
        up = (UserProxy) cache.get(key, primaryGroup);
      }catch (DotCacheException e) {
      Logger.debug(this,"Cache Entry not found", e);
    }
View Full Code Here

Examples of com.dotmarketing.beans.UserProxy

  }

  @Override
  protected UserProxy getUserProxyFromLongCookie(String longLivedCookie) {
    String key = cookieGroup + longLivedCookie;
    UserProxy up = null;
      try{
        up = (UserProxy) cache.get(key, cookieGroup);
      }catch (DotCacheException e) {
      Logger.debug(this,"Cache Entry not found", e);
    }
View Full Code Here

Examples of com.dotmarketing.beans.UserProxy

 
  public UserProxy getUserProxy(String userId, User user, boolean respectFrontEndRoles) throws DotRuntimeException, DotSecurityException, DotDataException{
    if(userId == null){
      return null;
    }
    UserProxy up = upf.getUserProxy(userId);
   
    if(perAPI.doesUserHavePermission(up, PermissionAPI.PERMISSION_READ, user, respectFrontEndRoles)){
      return up;
    }else{
      throw new DotSecurityException("User doesn't have permissions to retrieve UserProxy");
View Full Code Here

Examples of com.dotmarketing.beans.UserProxy

  {   
    return (UserProxy) InodeFactory.getInode(userProxyInode,UserProxy.class);
  }*/
 
  public UserProxy getUserProxyByLongLiveCookie(String dotCMSID, User user, boolean respectFrontEndRoles) throws DotRuntimeException, DotSecurityException, DotDataException{
    UserProxy up =  upf.getUserProxyByLongLiveCookie(dotCMSID);
    if(perAPI.doesUserHavePermission(up, PermissionAPI.PERMISSION_READ, user, respectFrontEndRoles)){
      return up;
    }else{
      throw new DotSecurityException("User doesn't have permissions to retrieve UserProxy");
    }
View Full Code Here

Examples of com.dotmarketing.beans.UserProxy

    Iterator it = allUsers.iterator();
    for (int i = 0; it.hasNext(); i++) {
      User user = null;
      String userId = (String) ((Map)it.next()).get("userid");
      user = APILocator.getUserAPI().loadUserById(userId,APILocator.getUserAPI().getSystemUser(),false);
      UserProxy userProxy = com.dotmarketing.business.APILocator.getUserProxyAPI().getUserProxy(user,APILocator.getUserAPI().getSystemUser(), false);
      userProxies.add(userProxy);
    }
    return userProxies;
  }
View Full Code Here

Examples of com.dotmarketing.beans.UserProxy

        String user_Id = (String) map.get("user_id");
        String tagName = (String) map.get("tagname");
        String firstName = (String) map.get("firstname");
        String lastName = (String) map.get("lastname");
        user = APILocator.getUserAPI().loadUserById(user_Id,APILocator.getUserAPI().getSystemUser(),false);
        UserProxy userProxy = com.dotmarketing.business.APILocator.getUserProxyAPI().getUserProxy(user,APILocator.getUserAPI().getSystemUser(), false);

        String[] match = new String[6];
        match[0] = (user_Id==null)?"":user_Id;
        match[1] = (tagName==null)?"":tagName;
        match[2] = (firstName==null)?"":firstName;
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.