Package net.naijatek.myalumni.modules.common.presentation.form

Examples of net.naijatek.myalumni.modules.common.presentation.form.PrivateMessageForm


    if (!memberSecurityCheck(request, token)) {
      return mapping.findForward(BaseConstants.FWD_LOGIN);
    }
   
   
      PrivateMessageForm pmForm = (PrivateMessageForm) form;

      pmForm.setMessageToUserId(pmForm.getMessageToUserName());
      pmForm.setMessageFromUserId(token.getMemberId());
      MemberVO memberVO = memService.getMemberProfileByMemberId(pmForm.getMessageToUserId());
     
      if (memberVO != null){
        pmForm.setToMemberFirstName(memberVO.getFirstName());
        pmForm.setToMemberLastName(memberVO.getLastName());
      }
      else{
          errors.add(BaseConstants.WARN_KEY, new ActionMessage("message.membernotfound"));
          saveMessages(request, errors);    
          return mapping.getInputForward();         
      }
     
      pmForm.setSubject(token.getFirstName() + " " + token.getLastName() + " " + BaseConstants.CONTACT_SUBJECT)
   
    return mapping.findForward(BaseConstants.FWD_SUCCESS);

}   
View Full Code Here


        // check to see if the user logged on is a member
        if (!memberSecurityCheck(request, token)) {
            return mapping.findForward(BaseConstants.FWD_LOGIN);
        }

        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

    // check to see if the user logged on is a member
    if (token == null){
      guest = true;
    }

    PrivateMessageForm pmForm = (PrivateMessageForm)form;

    messageToUserId = BaseConstants.ADMIN_USERNAME_ID;
    toMemberFirstName = "";
    toMemberLastName = adminLastName;

    if (!guest) {
      messageFromUserId = token.getMemberId();
      fromFirstName = token.getFirstName();
      fromLastName = token.getLastName();
    }
    else {
      messageFromUserId = BaseConstants.GUEST_USERNAME_ID;
      fromFirstName = ""; // BaseConstants.GUEST_USERNAME;
      fromLastName = "";
    }

    pmForm.setMessageFromUserId(messageFromUserId);
    pmForm.setFromMemberFirstName(fromFirstName);
    pmForm.setFromMemberLastName(fromLastName);

    pmForm.setMessageToUserId(messageToUserId);
    pmForm.setToMemberFirstName(toMemberFirstName);
    pmForm.setToMemberLastName(toMemberLastName);
    return mapping.findForward(BaseConstants.FWD_SUCCESS);

    }   
View Full Code Here

    // check to see if the user logged on is a member
    if (!memberSecurityCheck(request,token)){
      return mapping.findForward(BaseConstants.FWD_LOGIN);
    }   

    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));
            }
          }
          else{
            ActionMessages errors = new ActionMessages();
            errors.add(BaseConstants.WARN_KEY, new ActionMessage("error.mailboxfull"));
            saveMessages(request, errors);
          }
        }
      }
      else if (pmVO.getType().equals("reply")) {
        pmVO.setMessageFromUserId(token.getMemberId());
        int quota = pmService.getQuotaRatioByMemberId(pmVO.getMessageToUserId());
        if (quota < SystemConfigConstants.MAIL_QUOTA ){
        pmVO.setMessageId(null); // setting to null becasue its a considered a new
          pmService.replyMail(pmVO, getLastModifiedBy(request),getCurrentIPAddress(request));
          SendMailUtil.memberNewMessageNotification(pmVO, sysConfigVO, toMemberEmail);
          //copy to sent
          if (pmForm.getCopyMe().equalsIgnoreCase(BaseConstants.BOOLEAN_YES)){
            pmService.copyMeOnReplyMail(pmVOCopy, getLastModifiedBy(request),getCurrentIPAddress(request));
          }
        }
        else{
        // TODO: Maybe save the message as a draft to be sent later
View Full Code Here

                                  HttpServletResponse response )
      throws Exception {

    MemberVO token = new MemberVO();

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

    BeanUtils.copyProperties(pmVO, pmForm);
  
   
View Full Code Here

  // --------------------------------------------------------------------------------------
  public boolean requiresDeleteId(Object bean, ValidatorAction va,
      Field field, ActionMessages messages, HttpServletRequest request) {
    String[] mailArray = new String[0];
   
    PrivateMessageForm pmForm = (PrivateMessageForm)bean;
    //mailArray = request.getParameterValues(appProp.getValue("var.privMsgsId"));  messageId
    // TODO: find a way not to hard code this variable, add string[] to form
    mailArray = request.getParameterValues("messageId")

    if (mailArray == null) {
View Full Code Here

  // --------------------------------------------------------------------------

  public boolean emailWebmasterEmailCheck(Object bean, ValidatorAction va,
      Field field, ActionMessages messages, HttpServletRequest request) {

    PrivateMessageForm pmForm = (PrivateMessageForm)bean;
   
    String email = pmForm.getGuestEmail();
    String memberFromUserId = pmForm.getMessageFromUserId();
    email = StringUtil.safeString(email);

    if (memberFromUserId.equals(BaseConstants.GUEST_USERNAME_ID)) {
      if (email.length() == 0) {
        messages.add(field.getKey(), Resources.getActionMessage(request, va, field));
View Full Code Here

TOP

Related Classes of net.naijatek.myalumni.modules.common.presentation.form.PrivateMessageForm

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.