Package com.dotmarketing.beans

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("");
      userProxy.setOrganization("");
      userProxy.setUserId(user.getUserId());
      com.dotmarketing.business.APILocator.getUserProxyAPI().saveUserProxy(userProxy,APILocator.getUserAPI().getSystemUser(), false);
      // ### END CRETE USER_PROXY ###

      Role defaultRole = com.dotmarketing.business.APILocator.getRoleAPI().loadRoleByKey(Config
          .getStringProperty("CMS_VIEWER_ROLE"));
View Full Code Here


   * @param u user whom mailing lists are obtained
   * @return list of all the mailing list (private and public) where the user is susbcribed
   */
  @SuppressWarnings("unchecked")
  public static java.util.List<MailingList> getMailingListsBySubscriber(User u) {
    UserProxy up;
    try {
      up = com.dotmarketing.business.APILocator.getUserProxyAPI().getUserProxy(u,APILocator.getUserAPI().getSystemUser(), false);
    } catch (Exception e) {
      Logger.error(MailingListFactory.class, e.getMessage(), e);
      throw new DotRuntimeException(e.getMessage(), e);
View Full Code Here

            HibernateUtil.saveOrUpdate(r);

            Logger.debug(this, "Saved recipient with 500 last result" + r.getEmail());
           
            User user = APILocator.getUserAPI().loadByUserByEmail(r.getEmail(), APILocator.getUserAPI().getSystemUser(), false);
            UserProxy sub = com.dotmarketing.business.APILocator.getUserProxyAPI().getUserProxy(user,APILocator.getUserAPI().getSystemUser(), false);

            Logger.debug(this, "Subscriber =" + sub.getInode());

            if(InodeUtils.isSet(sub.getInode())){

                Logger.debug(this, "errorMessage: " +errorMessage);

              if(errorMessage == null){
                  sub.setLastMessage("Email Bounced");
              }
              else{
                  sub.setLastMessage(errorMessage.replaceAll("<","&lt;").replaceAll(">", "&gt;"));

              }
                sub.setLastResult(500);

                HibernateUtil.saveOrUpdate(sub);

                Campaign c = (Campaign) InodeFactory.getParentOfClass(r, Campaign.class);
                if(c != null && InodeUtils.isSet(c.getInode())) {
View Full Code Here

        List<Map<String, String>> users = retrieveUsers(htmlPage, startDate, endDate, user);
        for (Map<String, String> userCounts : users) {
            if (userCounts.get("user_id") != null) {
                String userId = (String) userCounts.get("user_id");
                User webUser = APILocator.getUserAPI().loadUserById(userId,APILocator.getUserAPI().getSystemUser(),false);
                UserProxy s = com.dotmarketing.business.APILocator.getUserProxyAPI().getUserProxy(webUser,APILocator.getUserAPI().getSystemUser(), false);
                MailingListFactory.addMailingSubscriber(ml, s, false);
            }
        }
       
        return ml.getMap();
View Full Code Here

        List<Map<String, String>> users = retrieveUsers(htmlPage, startDate, endDate, user);
        for (Map<String, String> userCounts : users) {
            if (userCounts.get("user_id") != null) {
                String userId = (String) userCounts.get("user_id");
                User webUser = APILocator.getUserAPI().loadUserById(userId,APILocator.getUserAPI().getSystemUser(),false);
                UserProxy s = com.dotmarketing.business.APILocator.getUserProxyAPI().getUserProxy(webUser,APILocator.getUserAPI().getSystemUser(), false);
                if (InodeUtils.isSet(s.getInode())) {
                  MailingListFactory.deleteUserFromMailingList(ml, s);
                }
            }
        }
View Full Code Here

      aRecord.put("name", user.getFullName());
      aRecord.put("firstName", user.getFirstName());
      aRecord.put("lastName", user.getLastName());
      aRecord.put("emailaddress", user.getEmailAddress());

      UserProxy up = uProxyWebAPI.getUserProxy(user, uWebAPI.getSystemUser(), !uWebAPI.isLoggedToBackend(request));
      aRecord.putAll(up.getMap());

      return aRecord;

    } catch (Exception e) {
      Logger.error(this, e.getMessage(), e);
View Full Code Here

      User user = uAPI.loadUserById(userId,uWebAPI.getLoggedInUser(request),false);

      UserProxyAPI uProxyAPI = APILocator.getUserProxyAPI();
      User u = uAPI.loadUserById(userId, uWebAPI.getLoggedInUser(request), !uWebAPI.isLoggedToBackend(request));
      UserProxy up = uProxyAPI.getUserProxy(u, uWebAPI.getLoggedInUser(request), !uWebAPI.isLoggedToBackend(request));


      if(!active && u.getUserId().equals(uWebAPI.getLoggedInUser(request).getUserId())){
        throw new DotRuntimeException(LanguageUtil.get(uWebAPI.getLoggedInUser(request),"deactivate-your-own-user-error"));
      }

      u.setActive(active);
      up.setPrefix(prefix);
      up.setSuffix(suffix);
      up.setTitle(title);
      up.setCompany(company);
      up.setWebsite(website);
      for(int i = 1; i <= additionalVars.length; i++) {
        up.setVar(i, additionalVars[i - 1]);
      }

      uAPI.save(u, uWebAPI.getLoggedInUser(request), !uWebAPI.isLoggedToBackend(request));
      uProxyAPI.saveUserProxy(up, uWebAPI.getLoggedInUser(request), !uWebAPI.isLoggedToBackend(request));
View Full Code Here

    WebContext ctx = WebContextFactory.get();
    HttpServletRequest request = ctx.getHttpServletRequest();
    UserProxyAPI userProxyAPI = APILocator.getUserProxyAPI();

    CategoryAPI catAPI = APILocator.getCategoryAPI();
    UserProxy uProxy = userProxyAPI.getUserProxy(userId, uWebAPI.getLoggedInUser(request), uWebAPI.isLoggedToBackend(request));
    List<Category> children = catAPI.getChildren(uProxy, uWebAPI.getLoggedInUser(request), uWebAPI.isLoggedToBackend(request));

    List<Map<String, Object>> toReturn = new ArrayList<Map<String,Object>>();
    for(Category child: children) {
      toReturn.add(child.getMap());
View Full Code Here

    User user = uWebAPI.getLoggedInUser(request);
    boolean respectFrontend = uWebAPI.isLoggedToBackend(request);

    CategoryAPI catAPI = APILocator.getCategoryAPI();
    UserProxy userProxy = userProxyAPI.getUserProxy(userId, uWebAPI.getLoggedInUser(request), uWebAPI.isLoggedToBackend(request));

    HibernateUtil.startTransaction();
    List<Category> myUserCategories = catAPI.getChildren(userProxy, user, respectFrontend);
    for (Object o : myUserCategories) {
      if(o instanceof Category && catAPI.canUseCategory((Category)o, user, respectFrontend)){
View Full Code Here

    User user = uWebAPI.getLoggedInUser(request);
    boolean respectFrontEndRoles = uWebAPI.isLoggedToBackend(request);

    HibernateUtil.startTransaction();
    UserProxy toUpdate = userProxyAPI.getUserProxy(userId, user, respectFrontEndRoles);
    toUpdate.setNoclicktracking(disabled);
    userProxyAPI.saveUserProxy(toUpdate, user, respectFrontEndRoles);
    HibernateUtil.commitTransaction();

  }
View Full Code Here

TOP

Related Classes of com.dotmarketing.beans.UserProxy

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.