Package com.dotmarketing.portlets.user.model

Examples of com.dotmarketing.portlets.user.model.UserComment


    Date now = new Date();
    String webFormType = webForm.getFormType();
    String webFormId = webForm.getWebFormId();

    UserComment userComments = new UserComment();
    userComments.setUserId(userid);
    userComments.setCommentUserId(userid);
    userComments.setDate(now);
    if (request.getParameter("comments")!=null) {
      userComments.setComment(request.getParameter("comments"));
    }
    else if(UtilMethods.isSet(webForm.getFormType())) {
        userComments.setSubject("User submitted: " + webFormType);
      userComments.setComment("Web Form: " + webFormType + " - ID: " + webFormId);
    }
    else{
        userComments.setSubject("User submitted Form: Open Entry ");
        StringBuffer buffy = new StringBuffer();
        Enumeration x = request.getParameterNames();
        while(x.hasMoreElements()){
            String key = (String) x.nextElement();
            buffy.append(key);
            buffy.append(":\t");
            buffy.append(request.getParameter(key));
            buffy.append("\n");
            if(buffy.length() > 65000){
                break;
            }
        }
        userComments.setComment(buffy.toString());
       
    }
   
    userComments.setTypeComment(UserComment.TYPE_INCOMING);
    userComments.setMethod(UserComment.METHOD_WEB);
    userComments.setCommunicationId(null);
    UserCommentsFactory.saveUserComment(userComments);
  }
View Full Code Here




    //### 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"))){
View Full Code Here

      recipient.setLastMessage("Mail Sent");

      //add the comment to the user record
      Date today = new Date();
      String commentComment = "Campaign: "+comm.getTitle() + " sent on " + UtilMethods.dateToHTMLDate(today);
      UserComment comment = new UserComment();

      comment.setComment(commentComment);
      comment.setDate(today);
      comment.setMethod(UserComment.METHOD_MARKETING_LIST);
      comment.setTypeComment(UserComment.TYPE_OUTGOING);
      comment.setType("mailing_list");
      comment.setSubject(commentComment);
      comment.setCommentUserId(subscriber.getUserId());
      comment.setUserId(subscriber.getUserId());
      comment.setCommunicationId(comm.getInode());
      UserCommentsFactory.saveUserComment(comment);
    }
    HibernateUtil.commitTransaction();

    return sent;
View Full Code Here

    try
    {
      UserCommentsForm userCommentForm = (UserCommentsForm) form;
      String userCommentInodeString = req.getParameter("commentId");
      //long userCommentInode = Long.parseLong(userCommentInodeString);
      UserComment userComment = UserCommentsFactory.getComment(userCommentInodeString);
      String userProxyInode = userCommentForm.getUserProxy();
      UserCommentsFactory.deleteUserComment(userProxyInode,userComment);
    }
    catch(Exception ex)
    {
View Full Code Here

  }
 
  public void _saveWebAsset(ActionRequest req, ActionResponse res, PortletConfig config, ActionForm form, User user) throws Exception
  {
    UserCommentsForm userCommentForm = (UserCommentsForm) form;
    UserComment userComment = new UserComment();
    BeanUtils.copyProperties(userComment,userCommentForm);
   
    //Copy additional fields
    userComment.setCommentUserId(user.getUserId());
   
    Date now = new Date();
    userComment.setDate(now);
   
    UserProxy userProxy = com.dotmarketing.business.APILocator.getUserProxyAPI().getUserProxy(userCommentForm.getUserProxy(),APILocator.getUserAPI().getSystemUser(), false);
    userComment.setUserId(userProxy.getUserId());
   
    userComment.setMethod(userCommentForm.getMethod());
    userComment.setTypeComment(userCommentForm.getTypeComment());
    userComment.setSubject(userCommentForm.getSubject());
    userComment.setComment(userCommentForm.getComment());

    UserCommentsFactory.saveUserComment(userProxy.getInode(),userComment);
   
  }
View Full Code Here

 
  private static String COUNT_USER_COMMENTS = "SELECT count(*) as num_rows from user_comments where user_id = ?";

  public static UserComment getComment(String userCommentInode)
  {
    UserComment userComment = (UserComment) InodeFactory.getInode(userCommentInode,UserComment.class);
    return userComment;
  }
View Full Code Here

      userProxy.deleteChild(userComment);
    }
   
    public static void deleteUserComment(String userProxyInode,String userCommentInode) throws DotHibernateException
    {     
      UserComment userComment = UserCommentsFactory.getComment(userCommentInode);
      deleteUserComment(userProxyInode,userComment);                 
    }
View Full Code Here

TOP

Related Classes of com.dotmarketing.portlets.user.model.UserComment

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.