Package com.centraview.contact.helper

Examples of com.centraview.contact.helper.ContactVO


    String returnStatus = "failure";
    String rowID = null;
    boolean isEntity = false;
    try {
      ContactVO contactObject = new ContactVO();
      rowID = request.getParameter("rowId");
      isEntity = (request.getParameter("type") == null) ? false : true;

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

      ContactFacade remote = aa.create();
      remote.setDataSource(dataSource);
      DynaActionForm dynaForm = (DynaActionForm)form;
      String recordType = "";
      if (isEntity) {
        recordType = "Entity";
        EntityVO entityVO = remote.getEntity(Integer.parseInt(rowID));
        contactObject = entityVO;
        dynaForm.set("name", entityVO.getName());
        request.setAttribute("name", entityVO.getName());
      } else {
        recordType = "Individual";
        IndividualVO individualVO = remote.getIndividual(Integer.parseInt(rowID));
        contactObject = individualVO;
        dynaForm.set("name", individualVO.getFirstName() + " " + individualVO.getLastName());
        request
            .setAttribute("name", individualVO.getFirstName() + " " + individualVO.getLastName());
      }

      dynaForm.set("ContactID", Integer.toString(contactObject.getContactID()));
      dynaForm.set("EntityType", Boolean.toString(isEntity));

      request.setAttribute("EntityType", Boolean.toString(isEntity));
      request.setAttribute("closeWindow", request.getAttribute("closeWindow"));
      request.setAttribute("refreshWindow", request.getAttribute("refreshWindow"));

      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();
View Full Code Here


    }
    DynaActionForm dynaForm = (DynaActionForm)form;
    int contactID = Integer.parseInt((String)dynaForm.get("ContactID"));
    boolean isEntity = ((String)dynaForm.get("EntityType")).equalsIgnoreCase("TRUE");
    try {
      ContactVO contactObject = new ContactVO();
      ContactFacadeHome aa = (ContactFacadeHome)CVUtility.getHomeObject(
          "com.centraview.contact.contactfacade.ContactFacadeHome", "ContactFacade");

      ContactFacade remote = aa.create();
      remote.setDataSource(dataSource);

      if (isEntity) {
        EntityVO entityVO = remote.getEntity(contactID);
        contactObject = entityVO;
        dynaForm.set("name", entityVO.getName());
      } else {
        IndividualVO individualVO = remote.getIndividual(contactID);
        contactObject = individualVO;
        dynaForm.set("name", individualVO.getFirstName() + " " + individualVO.getLastName());
      }
      request.setAttribute("rowId", new String[] { Integer.toString(contactID) });
      String[] primaryEmailAddress = (String[])dynaForm.get("primaryEmailAddress");
      String[] primaryPhoneNumbers = (String[])dynaForm.get("primaryPhoneNumbers");
      // Putting the phone numbers in an arraylist because it's a bit easier to
      // deal with.
      ArrayList phoneNumbers = new ArrayList();
      for (int i = 0; i < primaryPhoneNumbers.length; i++) {
        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])) {
View Full Code Here

TOP

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

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.