Package com.centraview.contact.helper

Examples of com.centraview.contact.helper.MethodOfContactVO


      } // end if (primaryAdd != null)
      // set the Method of Contacts
      Collection mocList = individualVOReference.getMOC();
      Iterator iterator = mocList.iterator();
      while (iterator.hasNext()) {
        MethodOfContactVO moc = (MethodOfContactVO) iterator.next();
        // TODO Should we make an effort to see if the email address is the
        // primary???
        if (moc.getMocType() == 1) // this is for email
        {
          printTemplateField.setEmail(moc.getContent());
        } else if (moc.getMocType() != 1) {
          String syncAs = moc.getSyncAs();
          if (syncAs != null) {
            if (syncAs.trim().equals("Fax")) {
              printTemplateField.setFax(moc.getContent());
            }
            if (syncAs.trim().equals("Home")) {
              printTemplateField.setHome(moc.getContent());
            }
            if (syncAs.trim().equals("Main")) {
              printTemplateField.setMain(moc.getContent());
            }
            if (syncAs.trim().equals("Mobile")) {
              printTemplateField.setMobile(moc.getContent());
            }
            if (syncAs.trim().equals("Other")) {
              printTemplateField.setOther(moc.getContent());
            }
            if (syncAs.trim().equals("Pager")) {
              printTemplateField.setPager(moc.getContent());
            }
            if (syncAs.trim().equals("Work")) {
              printTemplateField.setWork(moc.getContent());
            }
          } // end of if (syncAs != null)
        } // end of else statement (moc.getMocType() == 1)
      } // end of while
    } catch (Exception e) {
View Full Code Here


   * @return the Method of contact that is now representative for this ID
   * @author Kevin McAllister <kevin@centraview.com>
   */
  static public MethodOfContactVO updateMoc(DynaActionForm dynaForm, String number, HashMap currentMocVOs, int formMocId, boolean email)
  {
    MethodOfContactVO workingVO = null;
    String mocContent = "";
    int mocType = 0;
    if (email) {
      mocContent = (dynaForm.get("email") == null) ? "" : (String) dynaForm.get("email");
      mocType = 1;
    } else {
      mocContent = CVUtility.getMOCContent(dynaForm, number);
      mocType = Integer.parseInt((String) dynaForm.get("mocType" + number));
    }
    // the old code used form fields MocAllReadyPresent# to determine how to set
    // the updated and added flags. That stuff should eventually be removed
    // from the formbean and the JSP as it is worthless. given this more
    // accurate
    // way to determine that info, which follows:
    if (currentMocVOs.containsKey(new Integer(formMocId))) {
      workingVO = (MethodOfContactVO) currentMocVOs.get(new Integer(formMocId));
      if (mocContent.trim().length() == 0) {
        workingVO.delete(true);
        workingVO.updated(false);
        workingVO.added(false);
      } else {
        workingVO.delete(false);
        workingVO.updated(true);
        workingVO.added(false);
      }
    } else {
      workingVO = new MethodOfContactVO();
      workingVO.updated(false);
      workingVO.added(true);
      workingVO.delete(false);
      workingVO.setMocID(formMocId);
      workingVO.setIsPrimary("YES");
    }
    workingVO.setContent(mocContent);
    workingVO.setMocType(mocType);
    workingVO.setSyncAs(getSyncAs(mocType));

    return workingVO;
  }
View Full Code Here

    UserObject userObject = (UserObject)session.getAttribute("userobject");
    int individualID = userObject.getIndividualID();

    MethodOfContactVOX mocVOX = new MethodOfContactVOX(form);
    MethodOfContactVO moc = mocVOX.getVO();

    try {
      ContactFacadeHome aa = (ContactFacadeHome)CVUtility.getHomeObject(
          "com.centraview.contact.contactfacade.ContactFacadeHome", "ContactFacade");
      ContactFacade remote = aa.create();
View Full Code Here

      Iterator mocIterator = contactObject.getMOC().iterator();
      ArrayList phoneNumbers = new ArrayList();
      ArrayList emailAddresses = new ArrayList();
      String primaryEmailAddress = new String();
      while (mocIterator.hasNext()) {
        MethodOfContactVO methodOfContact = (MethodOfContactVO)mocIterator.next();
        if (methodOfContact.getMocType() == 1) // this is for email
        {
          // If the email address is a default email address,
          // add it at the begining of the list.
          if ((methodOfContact.getIsPrimary()).equalsIgnoreCase("YES")) {
            emailAddresses.add(0, methodOfContact);
            primaryEmailAddress = methodOfContact.getContent();
          } else {
            emailAddresses.add(methodOfContact);
          }
        } else {// phone number
          if (methodOfContact.getMocOrder() != null
              && phoneNumbers.size() >= Integer.parseInt(methodOfContact.getMocOrder())) {
            phoneNumbers.add(Integer.parseInt(methodOfContact.getMocOrder()), methodOfContact);
          } else {
            phoneNumbers.add(methodOfContact);
          }
        }
      }
View Full Code Here

        Collection mocList = entityVO.getMOC();
        Iterator iterator = mocList.iterator();
        String emailAddress = "";
        String phoneNumber = "";
        while (iterator.hasNext()) {
          MethodOfContactVO moc = (MethodOfContactVO) iterator.next();
          if (moc.getMocType() == 1 && moc.getIsPrimary().equalsIgnoreCase("YES")) // this
                                                                                    // is
                                                                                    // for
                                                                                    // email
          {
            emailAddress = moc.getContent();
          } // end of if statement (moc.getMocType() == 1)
          else if (moc.getMocType() == 4) {
            phoneNumber = moc.getContent();
          } // end of else statement (moc.getMocType() == 1)
        }// end of while
        Values.put("--Email--", emailAddress);
        Values.put("--Phone--", phoneNumber);
View Full Code Here

        phoneNumbers.add(i, primaryPhoneNumbers[i]);
      }

      Iterator mocIterator = contactObject.getMOC().iterator();
      while (mocIterator.hasNext()) {
        MethodOfContactVO methodOfContact = (MethodOfContactVO)mocIterator.next();
        if (methodOfContact.getMocType() == 1) // this is for email
        {
          if (methodOfContact.getMocID() == Integer.parseInt(primaryEmailAddress[0])) {
            methodOfContact.setIsPrimary("YES");
          } else {
            methodOfContact.setIsPrimary("NO");
          }
          remote.updateMOC(methodOfContact, contactID, individualID);
        } else {
          int index = phoneNumbers.indexOf(Integer.toString(methodOfContact.getMocID()));
          if (index != -1) {
            if (index < 3) {
              methodOfContact.setIsPrimary("YES");
            } else {
              methodOfContact.setIsPrimary("NO");
            }
            methodOfContact.setMocOrder(Integer.toString(index));
            remote.updateMOC(methodOfContact, contactID, individualID);
          }
        }
      }
      if (closeWindow) {
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);
      FORWARD_final = FORWARD_savenewthread;
View Full Code Here

      Collection mocList = individualVO.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
          dynaForm.set("email", moc.getContent());
          dynaForm.set("emailId", new Integer(moc.getMocID()).toString());
        } else if (count < 4 && moc.getMocType() != 1) {
          dynaForm.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"));
            mocContentExt = tempContent.substring(tempContent.indexOf("EXT") + 3, tempContent
                .length());
          } else {
            mocContentValue = mocContent;
          }

          dynaForm.set("mocContent" + count, mocContentValue);
          dynaForm.set("mocExt" + count, mocContentExt);
          dynaForm.set("mocId" + count, String.valueOf(moc.getMocID()));
          count++;
        }
      }

      primaryAdd = individualVO.getPrimaryAddress();
View Full Code Here

        CVUtility.getHostName(super.getServlet().getServletContext())).getDataSource();

    String returnStatus = ".view.error";

    try {
      MethodOfContactVO mcontactVO = new MethodOfContactVO();

      String rowId[] = null;

      if (request.getParameterValues("rowId") != null) {
        rowId = request.getParameterValues("rowId");
      } else {
        rowId[0] = new String(request.getParameter(Constants.PARAMID));
      }

      ContactFacadeHome aa = (ContactFacadeHome)CVUtility.getHomeObject(
          "com.centraview.contact.contactfacade.ContactFacadeHome", "ContactFacade");
      ContactFacade remote = aa.create();
      remote.setDataSource(dataSource);

      mcontactVO = remote.getMOC(Integer.parseInt(rowId[0]));

      DynaActionForm dynaForm = (DynaActionForm)form;
      dynaForm.set("select", new Integer(mcontactVO.getMocType()).toString());
      dynaForm.set("text3", mcontactVO.getContent());
      dynaForm.set("mocid", new Integer(mcontactVO.getMocID()).toString());
      dynaForm.set("text4", mcontactVO.getNote());
      dynaForm.set("syncas", mcontactVO.getSyncAs());

      returnStatus = ".view.contacts.new_contact_method";
    } catch (Exception e) {
      logger.error("[execute]: Exception", e);
    }
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
          dynaForm.set("email", moc.getContent());
          dynaForm.set("emailId", new Integer(moc.getMocID()).toString());
        } else if (count < 4 && moc.getMocType() != 1) {
          dynaForm.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"));
            mocContentExt = tempContent.substring(tempContent.indexOf("EXT") + 3, tempContent
                .length());
          } else {
            mocContentValue = mocContent;
          }

          dynaForm.set("mocContent" + count, mocContentValue);
          dynaForm.set("mocExt" + count, mocContentExt);
          dynaForm.set("mocId" + count, new Integer(moc.getMocID()).toString());
          count++;
        }
      }

      AddressVO primaryAdd = entityVO.getPrimaryAddress();
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.