Package com.centraview.contact.helper

Examples of com.centraview.contact.helper.MethodOfContactVO


          }
        }

        Iterator iterator = mocList.iterator();
        while (iterator.hasNext()) {
          MethodOfContactVO moc = (MethodOfContactVO) iterator.next();
          if (moc.getMocType() == 1 && moc.getIsPrimary().equalsIgnoreCase("YES")) {
            ticketForm.setEmail(moc.getContent());
          } else if (moc.getMocType() == 4) {
            ticketForm.setPhone(moc.getContent());
          }
        }
      }
      request.setAttribute("ticketform", ticketForm);
      DynaActionForm dynaForm = (DynaActionForm) form;
View Full Code Here


            }
           
            Collection mocList = entityVO.getMOC();
            Iterator iterator = mocList.iterator();
            while (iterator.hasNext()) {
              MethodOfContactVO moc  = (MethodOfContactVO) iterator.next();
              if (moc.getMocType() == 1 && moc.getIsPrimary().equalsIgnoreCase("YES")) {
                ticketForm.setEmail(moc.getContent());
              } else if (moc.getMocType() == 4) {
                ticketForm.setPhone(moc.getContent());
              }
            }
          }
          request.setAttribute("ticketform", ticketForm);
         
View Full Code Here

     
      Collection mocList = entityVO.getMOC();
      Iterator iterator = mocList.iterator();
      int count = 1;
      while (iterator.hasNext()) {
        MethodOfContactVO moc = (MethodOfContactVO)iterator.next();
        if (moc.getMocType() == 1 && moc.getIsPrimary().equalsIgnoreCase("YES")) {
          // this is for email
          profileForm.set("email", moc.getContent());
        } else if (count < 4 && moc.getMocType() != 1) {
          profileForm.set("mocType" + count, new Integer(moc.getMocType()).toString());
          String mocContent = moc.getContent();
          String mocContentValue = "";
          String mocContentExt = "";
          if (mocContent.indexOf("EXT") != -1) {
            String tempContent = mocContent;
            mocContentValue = tempContent.substring(0,tempContent.indexOf("EXT"));
View Full Code Here

   * @return A fully populated MethodOfContactVO object.
   */
  public MethodOfContactVO createNewPhoneMoc(String mocContent, String mocExt, String syncAs, int mocType)
  {
    // create new MocVO object
    MethodOfContactVO newMocVO = new MethodOfContactVO();
   
    // set properties
    if (mocExt != null && ! mocExt.equals(""))
    {
      mocContent = mocContent + "EXT" + mocExt;
    }
    newMocVO.setContent(mocContent);
    newMocVO.setSyncAs(syncAs);
    newMocVO.setMocType(mocType);
    return newMocVO;
  }   // end createNewMoc(String) method
View Full Code Here

       
        Collection mocList = entityVO.getMOC();
        Iterator iterator = mocList.iterator();
       
        while (iterator.hasNext()) {
          MethodOfContactVO moc = (MethodOfContactVO)iterator.next();
          if (moc.getMocType() == 1 && moc.getIsPrimary().equalsIgnoreCase("YES")) {
            dynaForm.setEmail(moc.getContent());
          }else if (moc.getMocType() == 4){
            dynaForm.setPhone(moc.getContent());
          }
        }
      }
     
      dynaForm.setContactid(new Integer(tVO.getRefIndividualId()).toString());
View Full Code Here

     
      Collection mocList = userVO.getMOC();
      Iterator iterator = mocList.iterator();
      int count = 1;
      while (iterator.hasNext()) {
        MethodOfContactVO moc = (MethodOfContactVO)iterator.next();
        if (moc.getMocType() == 1 && moc.getIsPrimary().equalsIgnoreCase("YES")) {
          userForm.set("email", moc.getContent());
        } else if (count < 4 && moc.getMocType() != 1) {
          userForm.set("mocType" + count, new Integer(moc.getMocType()).toString());
          String mocContent = moc.getContent();
          String mocContentValue = "";
          String mocContentExt = "";
         
          if (mocContent.indexOf("EXT"!= -1)  {
            String tempContent = mocContent;
View Full Code Here

      // save email address
      String email = (String)contactForm.get("email");
      if (email != null && ! email.equals(""))
      {
        MethodOfContactVO emailVO = new MethodOfContactVO();
        emailVO.setContent(email);
        emailVO.setMocType(Constants.MOC_EMAIL);   // hardcoded to "Email" type
        emailVO.setIsPrimary("YES")// always set as the primary email address
        individualVO.setMOC(emailVO);
      }

      // set workPhone
      String workPhone = (String)contactForm.get("workPhone");
      if (workPhone != null && (! workPhone.equals("")))
      {
        // create new MocVO object
        MethodOfContactVO workPhoneMocVO = new MethodOfContactVO();
       
        // set properties
        String workPhoneExt = (String)contactForm.get("workPhoneExt");
        if (workPhoneExt != null && ! workPhoneExt.equals(""))
        {
          workPhone = workPhone + "EXT" + workPhoneExt;
        }
        workPhoneMocVO.setContent(workPhone);
        workPhoneMocVO.setSyncAs("Work");
        workPhoneMocVO.setMocType(Constants.MOC_WORK);   // hardcoded to "Phone" type

        individualVO.setMOC(workPhoneMocVO);
      }

      // set homePhone
      String homePhone = (String)contactForm.get("homePhone");
      if (homePhone != null && (! homePhone.equals("")))
      {
        // create new MocVO object
        MethodOfContactVO homePhoneMocVO = new MethodOfContactVO();
       
        // set properties
        String homePhoneExt = (String)contactForm.get("homePhoneExt");
        if (homePhoneExt != null && ! homePhoneExt.equals(""))
        {
          homePhone = homePhone + "EXT" + homePhoneExt;
        }
        homePhoneMocVO.setContent(homePhone);
        homePhoneMocVO.setSyncAs("Home");
        homePhoneMocVO.setMocType(Constants.MOC_HOME);   // hardcoded to "Phone" type

        individualVO.setMOC(homePhoneMocVO);
      }

      // set faxPhone
      String faxPhone = (String)contactForm.get("faxPhone");
      if (faxPhone != null && (! faxPhone.equals("")))
      {
        // create new MocVO object
        MethodOfContactVO faxPhoneMocVO = new MethodOfContactVO();
       
        // set properties
        String faxPhoneExt = (String)contactForm.get("faxPhoneExt");
        if (faxPhoneExt != null && ! faxPhoneExt.equals(""))
        {
          faxPhone = faxPhone + "EXT" + faxPhoneExt;
        }
        faxPhoneMocVO.setContent(faxPhone);
        faxPhoneMocVO.setSyncAs("Fax");
        faxPhoneMocVO.setMocType(Constants.MOC_FAX);   // hardcoded to "Fax" type

        individualVO.setMOC(faxPhoneMocVO);
      }

      // set otherPhone
      String otherPhone = (String)contactForm.get("otherPhone");
      if (otherPhone != null && (! otherPhone.equals("")))
      {
        // create new MocVO object
        MethodOfContactVO otherPhoneMocVO = new MethodOfContactVO();
       
        // set properties
        String otherPhoneExt = (String)contactForm.get("otherPhoneExt");
        if (otherPhoneExt != null && ! otherPhoneExt.equals(""))
        {
          otherPhone = otherPhone + "EXT" + otherPhoneExt;
        }
        otherPhoneMocVO.setContent(otherPhone);
        otherPhoneMocVO.setSyncAs("Other");
        otherPhoneMocVO.setMocType(Constants.MOC_OTHER);   // hardcoded to "Phone" type

        individualVO.setMOC(otherPhoneMocVO);
      }

      // set mainPhone
      String mainPhone = (String)contactForm.get("mainPhone");
      if (mainPhone != null && (! mainPhone.equals("")))
      {
        // create new MocVO object
        MethodOfContactVO mainPhoneMocVO = new MethodOfContactVO();
       
        // set properties
        String mainPhoneExt = (String)contactForm.get("mainPhoneExt");
        if (mainPhoneExt != null && ! mainPhoneExt.equals(""))
        {
          mainPhone = mainPhone + "EXT" + mainPhoneExt;
        }
        mainPhoneMocVO.setContent(mainPhone);
        mainPhoneMocVO.setSyncAs("Main");
        mainPhoneMocVO.setMocType(Constants.MOC_MAIN);   // hardcoded to "Phone" type

        individualVO.setMOC(mainPhoneMocVO);
      }

      // set pagerPhone
      String pagerPhone = (String)contactForm.get("pagerPhone");
      if (pagerPhone != null && (! pagerPhone.equals("")))
      {
        // create new MocVO object
        MethodOfContactVO pagerPhoneMocVO = new MethodOfContactVO();
       
        // set properties
        String pagerPhoneExt = (String)contactForm.get("pagerPhoneExt");
        if (pagerPhoneExt != null && ! pagerPhoneExt.equals(""))
        {
          pagerPhone = pagerPhone + "EXT" + pagerPhoneExt;
        }
        pagerPhoneMocVO.setContent(pagerPhone);
        pagerPhoneMocVO.setSyncAs("Pager");
        pagerPhoneMocVO.setMocType(Constants.MOC_PAGER);   // hardcoded to "Phone" type

        individualVO.setMOC(pagerPhoneMocVO);
      }

      // set mobilePhone
      String mobilePhone = (String)contactForm.get("mobilePhone");
      if (mobilePhone != null && (! mobilePhone.equals("")))
      {
        // create new MocVO object
        MethodOfContactVO mobilePhoneMocVO = new MethodOfContactVO();
       
        // set properties
        String mobilePhoneExt = (String)contactForm.get("mobilePhoneExt");
        if (mobilePhoneExt != null && ! mobilePhoneExt.equals(""))
        {
          mobilePhone = mobilePhone + "EXT" + mobilePhoneExt;
        }
        mobilePhoneMocVO.setContent(mobilePhone);
        mobilePhoneMocVO.setSyncAs("Mobile");
        mobilePhoneMocVO.setMocType(Constants.MOC_MOBILE);   // hardcoded to "Mobile" type

        individualVO.setMOC(mobilePhoneMocVO);
      }

      // get notes field
      String notes = (String)contactForm.get("notes");
      boolean addNote = (notes != null && notes.length() > 0) ? true : false;

      // first, we need to get the entityID based on the CompanyName
      // passed into the form. If the entity name doesn't match something
      // in the database, then set a flag to create a new entity.
      int companyID = 0;
      int finalEntityID = 0;
      boolean createNewEntity = false;
      if (companyName != null && (! companyName.equals("")))
      {
        companyID = sfremote.findCompanyNameMatch(companyName, individualID);

        if (companyID == 0)
        {
          createNewEntity = true;
        }else{
          finalEntityID = companyID;
        }
      }   // end  if (companyName != null && (! companyName.equals("")))

      // now that we've got all the Individual's info set
      // up properly in the appropriate VO objects, let's
      // create an Entity if necessary
      if (createNewEntity)
      {
        // we must have set the createNewEntity flag to true
        // above, when we checked for a matching entity name
        // in the database, and didn't find one.
        EntityVO newEntity = new EntityVO();
        newEntity.setContactType(1);    // contact type 1 = Entity
        newEntity.setName(companyName);

        // set the new Entity's primary Address equal to the
        // same data for the new Individual
        newEntity.setPrimaryAddress(primaryAddress);
       
        Vector indivMOCs = individualVO.getMOC();
        Iterator iter = indivMOCs.iterator();
        while (iter.hasNext())
        {
          // set the new Entity's methods of contacts equal
          // to the same data for the new Individual
          MethodOfContactVO tmpVO = (MethodOfContactVO)iter.next();
          newEntity.setMOC(tmpVO);
        }

        int newEntityID = remote.createEntity(newEntity, individualID);
View Full Code Here

            }
           
            Collection mocList = entityVO.getMOC();
            Iterator iterator = mocList.iterator();
            while (iterator.hasNext()) {
              MethodOfContactVO moc  = (MethodOfContactVO) iterator.next();
              if (moc.getMocType() == 1 && moc.getIsPrimary().equalsIgnoreCase("YES")) {
                ticketForm.setEmail(moc.getContent());
              } else if (moc.getMocType() == 4) {
                ticketForm.setPhone(moc.getContent());
              }
            }
          }
          request.setAttribute("ticketform", ticketForm);
        }
View Full Code Here

    ticketForm.setEntityname(entityName);
    Collection mocList = entityVO.getMOC();
    Iterator iterator = mocList.iterator();
    while (iterator.hasNext())
    {
      MethodOfContactVO moc  = (MethodOfContactVO) iterator.next();
      if (moc.getMocType() == 1 && moc.getIsPrimary().equalsIgnoreCase("YES")) // this is for email
      {
        ticketForm.setEmail(moc.getContent());
      } //end of if statement (moc.getMocType() == 1)
      else if (moc.getMocType() == 4)
      {
        ticketForm.setPhone(moc.getContent());
      } //end of else statement (moc.getMocType() == 1)
    }// end of while
    }

      request.setAttribute("ticketform", ticketForm);
View Full Code Here

        }
       
        Collection mocList = entityVO.getMOC();
        Iterator iterator = mocList.iterator();
        while (iterator.hasNext()) {
          MethodOfContactVO moc  = (MethodOfContactVO) iterator.next();
          if (moc.getMocType() == 1 && moc.getIsPrimary().equalsIgnoreCase("YES")) // this is for email
          {
            dynaForm.setEmail(moc.getContent());
          } else if (moc.getMocType() == 4) {
            dynaForm.setPhone(moc.getContent());
          }
        }
      }

      dynaForm.setContactid(new Integer(tVO.getRefIndividualId()).toString());
View Full Code Here

TOP

Related Classes of com.centraview.contact.helper.MethodOfContactVO

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.