Package net.naijatek.myalumni.modules.common.domain

Examples of net.naijatek.myalumni.modules.common.domain.PrivateMessageVO


    if (isCancelled(request)) {
      return mapping.findForward(BaseConstants.FWD_CANCEL);
    }
   
    PrivateMessageForm pmForm = (PrivateMessageForm)form;
    PrivateMessageVO pmVO = new PrivateMessageVO();
    BeanUtils.copyProperties(pmVO, pmForm);
    SystemConfigVO sysConfigVO = sysConfigSerivce.getSystemConfig();
   
   
    SendMailUtil.sendEmail(pmVO, sysConfigVO);
View Full Code Here


        return mapping.findForward(BaseConstants.FWD_ADMIN_LOGIN);
      }
 
      PrivateMessageForm pmForm = (PrivateMessageForm)form;
      String mailId = pmForm.getMessageId();
      PrivateMessageVO pmVO = pmService.prepareAdminReply(BaseConstants.ADMIN_USERNAME_ID, mailId);
 
 
      BeanUtils.copyProperties(pmForm, pmVO);
     
      if( !pmForm.getSubject().startsWith("Re: ")){
        pmForm.setSubject("Re: " + pmForm.getSubject());
        }
     
      pmForm.setMessageText("\n\n\n------------------------------------------------\n" + pmVO.getMessageToMember().getFirstName() + " " + pmVO.getMessageToMember().getLastName() + " wrote on " + DateFormatUtil.getDateYYYYMMMDDHHMMA(pmVO.getMessageDate()) + ":\n\n" +  pmVO.getMessageText());
   
      pmForm.setMessageToUserId(pmVO.getMessageToMember().getMemberId());       
      pmForm.setMessageFromUserId(BaseConstants.ADMIN_USERNAME_ID);
     
      // set message to name
      if (pmVO.getMessageFromUserId().equals(BaseConstants.GUEST_USERNAME_ID)){
        pmForm.setToMemberLastName(pmVO.getGuestName());
        pmForm.setToMemberFirstName("");
      }
      else{
        pmForm.setToMemberLastName(pmVO.getMessageToMember().getLastName());
        pmForm.setToMemberFirstName(pmVO.getMessageToMember().getFirstName());       
      }

       
      return mapping.findForward(BaseConstants.FWD_SUCCESS);
    }   
View Full Code Here

        if (!adminSecurityCheck(request)) {
            return mapping.findForward(BaseConstants.FWD_ADMIN_LOGIN);
        }
       
        String mailId = pmForm.getMessageId();
        PrivateMessageVO pmVO = pmService.readOneAdminMailByMemberId(BaseConstants.ADMIN_USERNAME_ID, mailId, getLastModifiedBy(request));
        BeanUtils.copyProperties(pmForm, pmVO);
        pmForm.setMessageDate(DateFormatUtil.getDateYYYYMMMDDHHMMA(pmVO.getMessageDate()));
        pmForm.setFromMemberFirstName(pmVO.getMessageFromMember().getFirstName());
        pmForm.setFromMemberLastName(pmVO.getMessageFromMember().getLastName());
       
        MyAlumniUserContainer container = (MyAlumniUserContainer)request.getSession().getAttribute(BaseConstants.USER_CONTAINER);
        PrivateMessageHelper pmHelper = pmService.getAdminMessageCenter(BaseConstants.ADMIN_USERNAME_ID, BaseConstants.FOLDER_INBOX, container );
        setSessionObject(request, BaseConstants.MESSAGE_CENTER , pmHelper);
View Full Code Here

      if (!adminSecurityCheck(request)){
        return mapping.findForward(BaseConstants.FWD_ADMIN_LOGIN);
      }

      PrivateMessageForm dynaForm = (PrivateMessageForm) form;
      PrivateMessageVO pmVO = new PrivateMessageVO();
     
      BeanUtils.copyProperties(pmVO, dynaForm);
     
      //String toMemberEmail = memService.getMemberEmailByMemberId(pm.getGuestEmail());
      SystemConfigVO sysConfigVO = sysConfigSerivce.getSystemConfig();
     
    String toMemberEmail = new String();
   
    if(pmVO.getType().equals("contact")){
      if (pmVO.getMessageToUserId() != null && pmVO.getMessageToUserId() != ""){
        toMemberEmail = memService.getMemberEmailByMemberId(pmVO.getMessageToUserId());
        pmVO.setToWebmaster(BaseConstants.BOOLEAN_NO);
        pmService.contactMail(pmVO, getLastModifiedBy(request),getCurrentIPAddress(request));
        SendMailUtil.memberNewMessageNotification(pmVO, sysConfigVO, toMemberEmail);
      }
      else{
        toMemberEmail = pmVO.getGuestEmail();
        SendMailUtil.sendEmail(pmVO, sysConfigVO);
     
    }
    else if (pmVO.getType().equals("reply")){
      String guestEmail = StringUtil.safeString(pmVO.getGuestEmail());
      if ( guestEmail.length() > 0 ){
        SendMailUtil.sendEmail(pmVO, sysConfigVO);
      }else{
        toMemberEmail = memService.getMemberEmailByMemberId(pmVO.getMessageToUserId());
        pmVO.setToWebmaster(BaseConstants.BOOLEAN_NO);
        pmService.replyMail(pmVO, getLastModifiedBy(request),getCurrentIPAddress(request))
        SendMailUtil.memberNewMessageNotification(pmVO, sysConfigVO, toMemberEmail);
      }
    }
    else{
View Full Code Here

        PrivateMessageForm pmForm = (PrivateMessageForm)form;

        String memberId = token.getMemberId();
        String mailId = pmForm.getMessageId();
        PrivateMessageVO pmVO = pmService.prepareReply(memberId, mailId);

        pmVO.setMessageToUserId(pmVO.getMessageFromMember().getMemberId());       
        pmVO.setMessageFromUserId(token.getMemberId());
       
        BeanUtils.copyProperties(pmForm, pmVO);
       
        if (!pmForm.getSubject().startsWith("Re: ")) {
          pmForm.setSubject("Re: " + pmForm.getSubject());
        }
       
        pmForm.setMessageText("\n\n\n------------------------------------------------\n" +
                pmVO.getMessageFromMember().getFirstName() + " " + pmVO.getMessageFromMember().getLastName() +
                " wrote on " + DateFormatUtil.getDateYYYYMMMDDHHMMA(pmVO.getMessageDate()) + ":\n\n" + pmVO.getMessageText());
       
        pmForm.setToMemberFirstName(pmVO.getMessageFromMember().getFirstName());
        pmForm.setToMemberLastName(pmVO.getMessageFromMember().getLastName());
       
        return mapping.findForward(BaseConstants.FWD_SUCCESS);

    }   
View Full Code Here

    }   

    PrivateMessageForm pmForm = (PrivateMessageForm) form;
    String memberId = token.getMemberId();
    String mailId =  pmForm.getMessageId();
    PrivateMessageVO pmVO = pmService.readOneMailByMemberId(memberId, mailId, getLastModifiedBy(request));
  
   
    if (pmVO != null){
        BeanUtils.copyProperties(pmForm, pmVO);
        pmForm.setFromMemberLastName(pmVO.getMessageFromMember().getLastName());
        pmForm.setFromMemberFirstName(pmVO.getMessageFromMember().getFirstName());
        pmForm.setMessageDate(DateFormatUtil.getDateYYYYMMMDDHHMMA(pmVO.getMessageDate()));
    }

    return mapping.findForward(BaseConstants.FWD_SUCCESS);

    }   
View Full Code Here

      if (isCancelled(request)){
         return mapping.findForward(BaseConstants.FWD_CANCEL);
      }
 
      PrivateMessageForm pmForm = (PrivateMessageForm) form;
      PrivateMessageVO pmVO = new PrivateMessageVO();
      PrivateMessageVO pmVOCopy = new PrivateMessageVO();
      BeanUtils.copyProperties(pmVO, pmForm);
      BeanUtils.copyProperties(pmVOCopy, pmForm);
 
      String toMemberEmail = memService.getMemberEmailByMemberId(pmVO.getMessageToUserId());
      SystemConfigVO sysConfigVO = sysConfigSerivce.getSystemConfig();
         
 
      if (pmVO.getType().equals("contact")) {
        if (!memService.isAccountActivatedByMemberId(pmVO.getMessageToUserId())) {
            ActionMessages errors = new ActionMessages();
            errors.add(BaseConstants.FATAL_KEY, new ActionMessage("message.mail.unactivatedmember"));
            saveMessages(request, errors);
            return mapping.getInputForward();
        }
        else {
          int quota = pmService.getQuotaRatioByMemberId(pmVO.getMessageToUserId());
          if (quota < SystemConfigConstants.MAIL_QUOTA ){
            pmVO.setMessageId(null);
            pmVOCopy.setMessageId(null);
            pmService.contactMail(pmVO, getLastModifiedBy(request), getCurrentIPAddress(request));
            SendMailUtil.memberNewMessageNotification(pmVO, sysConfigVO, toMemberEmail);
            //copy to sent
            if (pmForm.getCopyMe().equalsIgnoreCase(BaseConstants.BOOLEAN_YES)){
                pmService.copyMeOnContactMail(pmVOCopy, getLastModifiedBy(request),getCurrentIPAddress(request));
View Full Code Here

      throws Exception {

    MemberVO token = new MemberVO();

    PrivateMessageForm pmForm = (PrivateMessageForm)form;
    PrivateMessageVO pmVO = new PrivateMessageVO();

    BeanUtils.copyProperties(pmVO, pmForm);
  
   
    if(pmVO.getType().equals("contact")){
      if (pmVO.getMessageFromUserId().equalsIgnoreCase(BaseConstants.GUEST_USERNAME_ID)){
        pmService.contactAdminMail(pmVO, BaseConstants.GUEST_USERNAME_ID, getCurrentIPAddress(request));
      }
      else{
        pmService.contactAdminMail(pmVO, getLastModifiedBy(request), getCurrentIPAddress(request));
      }
    }
    else if (pmVO.getType().equals("reply")){
      if (pmVO.getMessageFromUserId().equalsIgnoreCase(BaseConstants.GUEST_USERNAME_ID)){
             pmVO.setMessageFromUserId(BaseConstants.GUEST_USERNAME_ID);
             pmService.replyMail(pmVO, BaseConstants.GUEST_USERNAME_ID, getCurrentIPAddress(request));
      }
      else{
             pmVO.setMessageFromUserId(token.getMemberId());
             pmService.replyMail(pmVO, getLastModifiedBy(request), getCurrentIPAddress(request));
      }     

    }
    else{
View Full Code Here

   
   
   
   
    public PrivateMessageVO readOneMailByMemberId(String memberId, String messageId, String lastModifiedBy) {
      PrivateMessageVO pm = pmDao.readOneMailByMemberId(memberId, messageId);
      pmDao.updateMessageRead(memberId, messageId, lastModifiedBy);
        return pm;
    }
View Full Code Here

      pmDao.updateMessageRead(memberId, messageId, lastModifiedBy);
        return pm;
    }
   
    public PrivateMessageVO readOneAdminMailByMemberId(String memberId, String messageId, String lastModifiedBy) {
      PrivateMessageVO pm = pmDao.readOneAdminMailByMemberId(memberId, messageId);
      pmDao.updateMessageRead(memberId, messageId, lastModifiedBy);
        return pm;
    }
View Full Code Here

TOP

Related Classes of net.naijatek.myalumni.modules.common.domain.PrivateMessageVO

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.