Package com.centraview.contact.entity

Examples of com.centraview.contact.entity.EntityVO


  {
    ArrayList arrlCVID = new ArrayList();
    try{
      if (isEntityModule(modulename)) {
        Iterator it = arrl.iterator();
        EntityVO VO = new EntityVO();
        while (it.hasNext()) {
          VO = (EntityVO) it.next();
          int ID = VO.getContactID();
          arrlCVID.add(new Integer(ID));
        }
      }
      else if (modulename.equals("Individual")) {
        Iterator it = arrl.iterator();
        IndividualVO VO = new IndividualVO();
        while (it.hasNext()) {
          VO = (IndividualVO) it.next();
          int ID = VO.getContactID();
          arrlCVID.add(new Integer(ID));
        }
      }
      else if (modulename.equals("Invoice")) {
        Iterator it = arrl.iterator();
        InvoiceVO VO = new InvoiceVO();
        while (it.hasNext()) {
          VO = (InvoiceVO) it.next();
          int ID = VO.getInvoiceId();
          arrlCVID.add(new Integer(ID));
        }
      }
      else if (modulename.equals("PurchaseOrder")) {
        Iterator it = arrl.iterator();
        PurchaseOrderVO VO = new PurchaseOrderVO();
        while (it.hasNext()) {
          VO = (PurchaseOrderVO) it.next();
          int ID = VO.getPurchaseOrderId();
          arrlCVID.add(new Integer(ID));
        }
      }
      else if (modulename.equals("Expense")) {
        Iterator it = arrl.iterator();
        ExpenseVO VO = new ExpenseVO();
        while (it.hasNext()) {
          VO = (ExpenseVO) it.next();
          int ID = VO.getExpenseID();
          arrlCVID.add(new Integer(ID));
        }
      }
      else if (isItemModule(modulename)) {
        Iterator it = arrl.iterator();
        ItemVO VO = new ItemVO();
        while (it.hasNext()) {
          VO = (ItemVO) it.next();
          int ID = VO.getItemId();
          arrlCVID.add(new Integer(ID));
        }
      }
      else if (modulename.equals("Payment")) {
        Iterator it = arrl.iterator();
        PaymentVO VO = new PaymentVO();
        while (it.hasNext()) {
          VO = (PaymentVO) it.next();
          int ID = VO.getPaymentID();
          arrlCVID.add(new Integer(ID));
        }
      }
      else if (modulename.equals("PaymentMethod")) {
        Iterator it = arrl.iterator();
        PaymentMethodVO VO = new PaymentMethodVO();
        while (it.hasNext()) {
          VO = (PaymentMethodVO) it.next();
          int ID = VO.getMethodID();
          arrlCVID.add(new Integer(ID));
        }
      }
      else if (modulename.equals("GLAccount")) {
        Iterator it = arrl.iterator();
        GLAccountVO VO = new GLAccountVO();
        while (it.hasNext()) {
          VO = (GLAccountVO) it.next();
          int ID = VO.getGlaccountID();
          arrlCVID.add(new Integer(ID));
        }
      }
    }catch(Exception e)
    {
View Full Code Here


    try
    {
      if (isEntityModule(modulename))
      {
        Iterator it = arrl.iterator();
        EntityVO VO = new EntityVO();
        while (it.hasNext())
        {
          VO = (EntityVO) it.next();
          String extID = VO.getExternalID();
          arrlExtID.add(extID);
        }
      }
      else if (modulename.equals("Individual"))
      {
        Iterator it = arrl.iterator();
        IndividualVO VO = new IndividualVO();
        while (it.hasNext())
        {
          VO = (IndividualVO) it.next();
          String extID = VO.getExternalID();
          arrlExtID.add(extID);
        }
      }
      else if (modulename.equals("Invoice"))
      {
        Iterator it = arrl.iterator();
        InvoiceVO VO = new InvoiceVO();
        while (it.hasNext())
        {
          VO = (InvoiceVO) it.next();
          String extID = VO.getExternalId();
          arrlExtID.add(extID);
        }
      }
      else if (modulename.equals("PurchaseOrder"))
      {
        Iterator it = arrl.iterator();
        PurchaseOrderVO VO = new PurchaseOrderVO();
        while (it.hasNext())
        {
          VO = (PurchaseOrderVO) it.next();
          String extID = VO.getExternalID();
          arrlExtID.add(extID);
        }
      }
      else if (modulename.equals("Expense"))
      {
        Iterator it = arrl.iterator();
        ExpenseVO VO = new ExpenseVO();
        while (it.hasNext())
        {
          VO = (ExpenseVO) it.next();
          String extID = VO.getExternalID();
          arrlExtID.add(extID);
        }
      }
      else if( isItemModule(modulename))
      {
        Iterator it = arrl.iterator();
        ItemVO VO = new ItemVO();
        while (it.hasNext())
        {
          VO = (ItemVO) it.next();
          String extID = VO.getExternalID();
          arrlExtID.add(extID);
        }
      }
      else if (modulename.equals("Payment"))
      {
        Iterator it = arrl.iterator();
        PaymentVO VO = new PaymentVO();
        while (it.hasNext())
        {
          VO = (PaymentVO) it.next();
          String extID = VO.getExternalID();
          arrlExtID.add(extID);
        }
      }
      else if (modulename.equals("PaymentMethod"))
      {
        Iterator it = arrl.iterator();
        PaymentMethodVO VO = new PaymentMethodVO();
        while (it.hasNext())
        {
          VO = (PaymentMethodVO) it.next();
          String extID = VO.getExternalID();
          arrlExtID.add(extID);
        }
      }
      else if (modulename.equals("GLAccount"))
      {
        Iterator it = arrl.iterator();
        GLAccountVO VO = new GLAccountVO();
        while (it.hasNext())
        {
          VO = (GLAccountVO) it.next();
          String extID = VO.getExternalID();
          arrlExtID.add(extID);
        }
      }
    }
    catch(Exception e)
View Full Code Here

      String primaryContact = "Yes";    // gets set to no if we're updating an existing entity
      if (createNewEntity)
      {
        // in this case, we didn't find a match to our entity name in the
        // database, so we'll create a new entity with any form information
        EntityVO newEntity = new EntityVO();
        newEntity.setContactType(1);    // contact type 1 = Entity
        newEntity.setName(companyName);
        newEntity.setSourceName((String)contactForm.get("entitySource"));
        newEntity.setExternalID((String)contactForm.get("entityID2"));

        // Entity Address information
        String eStreet1 = (String)contactForm.get("entityStreet1");
        String eStreet2 = (String)contactForm.get("entityStreet2");
        String eCity = (String)contactForm.get("entityCity");
        String eState = (String)contactForm.get("entityState");
        String eZipCode = (String)contactForm.get("entityZip");
        String eCountry = (String)contactForm.get("entityCountry");
        // only create an Address VO if ONE or MORE fields are filled in
        if ((eStreet1 != null && eStreet1.length() > 0) || (eStreet2 != null && eStreet2.length() > 0) ||
            (eCity != null && eCity.length() > 0) || (eState != null && eState.length() > 0) ||
            (eZipCode != null && eZipCode.length() > 0) || (eCountry != null && eCountry.length() > 0))
        {
          AddressVO ePrimaryAddress = new AddressVO();
          ePrimaryAddress.setIsPrimary("YES");
          ePrimaryAddress.setStreet1(eStreet1);
          ePrimaryAddress.setStreet2(eStreet2);
          ePrimaryAddress.setCity(eCity);
          ePrimaryAddress.setStateName(eState);
          ePrimaryAddress.setZip(eZipCode);
          ePrimaryAddress.setCountryName(eCountry);
          newEntity.setPrimaryAddress(ePrimaryAddress);
        }else{
          // if no entity address information was given, use individual address
          newEntity.setPrimaryAddress(primaryAddress);
        }

        // save email address
        String eEmail = (String)contactForm.get("entityEmail");
        if (eEmail != null && ! eEmail.equals(""))
        {
          MethodOfContactVO eEmailVO = new MethodOfContactVO();
          eEmailVO.setContent(eEmail);
          eEmailVO.setMocType(1);   // hardcoded to "Email" type
          eEmailVO.setIsPrimary("YES")// always set as the primary email address
          newEntity.setMOC(eEmailVO);
        }
       
        // set workPhone
        String eWorkPhone = (String)contactForm.get("entityWorkPhone");
        if (eWorkPhone != null && ! eWorkPhone.equals(""))
        {
          String eWorkPhoneExt = (String)contactForm.get("entityWorkPhoneExt");
          newEntity.setMOC(syncUtils.createNewPhoneMoc(eWorkPhone, eWorkPhoneExt, "Work", Constants.MOC_WORK));    // (content, ext, syncAs, mocType)
        }

        // set homePhone
        String eHomePhone = (String)contactForm.get("entityHomePhone");
        if (eHomePhone != null && ! eHomePhone.equals(""))
        {
          String eHomePhoneExt = (String)contactForm.get("entityHomePhoneExt");
          newEntity.setMOC(syncUtils.createNewPhoneMoc(eHomePhone, eHomePhoneExt, "Home", Constants.MOC_HOME));    // (content, ext, syncAs, mocType)
        }

        // set FaxPhone
        String eFaxPhone = (String)contactForm.get("entityFaxPhone");
        if (eFaxPhone != null && ! eFaxPhone.equals(""))
        {
          String eFaxPhoneExt = (String)contactForm.get("entityFaxPhoneExt");
          newEntity.setMOC(syncUtils.createNewPhoneMoc(eFaxPhone, eFaxPhoneExt, "Fax", Constants.MOC_FAX));    // (content, ext, syncAs, mocType)
        }

        // set OtherPhone
        String eOtherPhone = (String)contactForm.get("entityOtherPhone");
        if (eOtherPhone != null && ! eOtherPhone.equals(""))
        {
          String eOtherPhoneExt = (String)contactForm.get("entityOtherPhoneExt");
          newEntity.setMOC(syncUtils.createNewPhoneMoc(eOtherPhone, eOtherPhoneExt, "Other", Constants.MOC_OTHER));    // (content, ext, syncAs, mocType)
        }

        // set MainPhone
        String eMainPhone = (String)contactForm.get("entityMainPhone");
        if (eMainPhone != null && ! eMainPhone.equals(""))
        {
          String eMainPhoneExt = (String)contactForm.get("entityMainPhoneExt");
          newEntity.setMOC(syncUtils.createNewPhoneMoc(eMainPhone, eMainPhoneExt, "Main", Constants.MOC_MAIN));    // (content, ext, syncAs, mocType)
        }

        // set PagerPhone
        String ePagerPhone = (String)contactForm.get("entityPagerPhone");
        if (ePagerPhone != null && ! ePagerPhone.equals(""))
        {
          String ePagerPhoneExt = (String)contactForm.get("entityPagerPhoneExt");
          newEntity.setMOC(syncUtils.createNewPhoneMoc(ePagerPhone, ePagerPhoneExt, "Pager", Constants.MOC_PAGER));    // (content, ext, syncAs, mocType)
        }

        // set MobilePhone
        String eMobilePhone = (String)contactForm.get("entityMobilePhone");
        if (eMobilePhone != null && ! eMobilePhone.equals(""))
        {
          String eMobilePhoneExt = (String)contactForm.get("entityMobilePhoneExt");
          newEntity.setMOC(syncUtils.createNewPhoneMoc(eMobilePhone, eMobilePhoneExt, "Mobile", Constants.MOC_MOBILE));    // (content, ext, syncAs, mocType)
        }
       
        // custom fields
        this.addCustomFields(newEntity, mailRemote.getValidFields("Entity"), contactForm);
View Full Code Here

      ticketForm.setId(new Integer(ticketVO.getId()).toString());
      ticketForm.setEntityid(new Integer(ticketVO.getRefEntityId()).toString());
      ticketForm.setContactid(new Integer(ticketVO.getRefIndividualId()).toString());
      ticketForm.setContact(ticketVO.getRefIndividualName());

      EntityVO entityVO = ticketVO.getEntityVO();

      if (entityVO != null) {
        String entityName = entityVO.getName();
        ticketForm.setEntityname(entityName);
        Collection mocList = entityVO.getMOC();

        AddressVO primaryAdd = entityVO.getPrimaryAddress();

        if (primaryAdd != null) {
          String address = "";
          if (primaryAdd.getStreet1() != null && !primaryAdd.getStreet1().equals("")) {
            address += primaryAdd.getStreet1();
View Full Code Here

    HashMap names = new HashMap();
    try {
      ContactFacadeHome contactFacadeHome = (ContactFacadeHome)CVUtility.getHomeObject("com.centraview.contact.contactfacade.ContactFacadeHome", "ContactFacade");
      ContactFacade contactFacade = (ContactFacade)contactFacadeHome.create();
      contactFacade.setDataSource(dataSource);
      EntityVO entityVO = contactFacade.getEntity(1);
      entityName = entityVO.getName();
      IndividualVO individualVO = entityVO.getIndividualVO();
      StringBuffer individualName = new StringBuffer();
      if (individualVO != null) {
        individualName.append(individualVO.getFirstName());
        individualName.append(" ");
        individualName.append(individualVO.getLastName());
View Full Code Here

          ticketForm.setId(new Integer(ticketVO.getId()).toString());
          ticketForm.setEntityid(new Integer(ticketVO.getRefEntityId()).toString());
          ticketForm.setContactid(new Integer(ticketVO.getRefIndividualId()).toString());
          ticketForm.setContact(ticketVO.getRefIndividualName());
         
          EntityVO entityVO = ticketVO.getEntityVO();
          if (entityVO != null) {
            String entityName = entityVO.getName();
            ticketForm.setEntityname(entityName);
           
            AddressVO primaryAdd = entityVO.getPrimaryAddress();
           
            if (primaryAdd != null) {
              String address = "";
              if (primaryAdd.getStreet1() != null && !primaryAdd.getStreet1().equals("")) {
                address += primaryAdd.getStreet1();
              }
              if (primaryAdd.getStreet2() != null && !primaryAdd.getStreet2().equals("")) {
                address +=", "+ primaryAdd.getStreet2()+"\n";
              } else {
                address += "\n";
              }
              if (primaryAdd.getCity() != null && !primaryAdd.getCity().equals("")) {
                address += primaryAdd.getCity();
              }
              if (primaryAdd.getStateName() != null && !primaryAdd.getStateName().equals("")) {
                address += ", "+ primaryAdd.getStateName();
              }
              if (primaryAdd.getZip() != null && !primaryAdd.getZip().equals("")) {
                address += " "+ primaryAdd.getZip();
              }
              if (primaryAdd.getCountryName() != null && !primaryAdd.getCountryName().equals("")) {
                address += ", "+ primaryAdd.getCountryName();
              }
              ticketForm.setAddress(address);
              if (primaryAdd.getWebsite() != null) {
                ticketForm.setWebsite(primaryAdd.getWebsite());
              }
            }
           
            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());
View Full Code Here

      dynaForm.setEntityid(new Integer(tVO.getRefEntityId()).toString());
      dynaForm.setAssignedto(tVO.getAssignedToName());
      dynaForm.setAssignedtoid(new Integer(tVO.getAssignedToId()).toString());
      dynaForm.setContact(tVO.getRefIndividualName());
     
      EntityVO entityVO = tVO.getEntityVO();
      if (entityVO != null) {
        String entityName = entityVO.getName();
        dynaForm.setEntityname(entityName);
        AddressVO primaryAdd = entityVO.getPrimaryAddress();
       
        if (primaryAdd != null) {
          String address = "";
          if (primaryAdd.getStreet1() != null && !primaryAdd.getStreet1().equals("")) {
            address += primaryAdd.getStreet1();
          }
          if (primaryAdd.getStreet2() != null && !primaryAdd.getStreet2().equals("")) {
            address +=", "+ primaryAdd.getStreet2()+"\n";
          } else {
            address += "\n";
          }
          if (primaryAdd.getCity() != null && !primaryAdd.getCity().equals("")) {
            address += primaryAdd.getCity();
          }
          if (primaryAdd.getStateName() != null && !primaryAdd.getStateName().equals("")) {
            address += ", "+ primaryAdd.getStateName();
          }
          if (primaryAdd.getZip() != null && !primaryAdd.getZip().equals("")) {
            address += " "+ primaryAdd.getZip();
          }
          if (primaryAdd.getCountryName() != null && !primaryAdd.getCountryName().equals("")) {
            address += ", "+ primaryAdd.getCountryName();
          }
          dynaForm.setAddress(address);
          if (primaryAdd.getWebsite() != null) {
            dynaForm.setWebsite(primaryAdd.getWebsite());
          }
        }
       
        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
          {
View Full Code Here

    try {
      ContactFacade remote = (ContactFacade)cfh.create();
      remote.setDataSource(dataSource);
     
      // get the Entity record of the logged-in user's Entity
      EntityVO entityVO = (EntityVO)remote.getEntity(entityID);
     
      if (entityVO == null) {
        // let the user know something bad happened
        allErrors.add("error.general.databaseError", new ActionMessage("error.general.databaseError"));
        entityVO = new EntityVO();
      }
     
      IndividualVO primaryContactVO = entityVO.getIndividualVO();
      if (primaryContactVO == null) {
        // avoid null pointers
        primaryContactVO = new IndividualVO();
      }
     
      AddressVO primaryAddress = entityVO.getPrimaryAddress();
      if (primaryAddress == null) {
        // avoid null pointers
        primaryAddress = new AddressVO();
      }
     
      // now, populate the form bean with the data
      profileForm.set("entityName", entityVO.getName());
      profileForm.set("firstName", primaryContactVO.getFirstName());
      profileForm.set("middleName", primaryContactVO.getMiddleName());
      profileForm.set("lastName", primaryContactVO.getLastName());
      profileForm.set("title", primaryContactVO.getTitle());
      profileForm.set("street1", primaryAddress.getStreet1());
      profileForm.set("street2", primaryAddress.getStreet2());
      profileForm.set("city", primaryAddress.getCity());
      profileForm.set("zipCode", primaryAddress.getZip());
      profileForm.set("website", primaryAddress.getWebsite());
     
      GlobalMasterLists gml = GlobalMasterLists.getGlobalMasterLists(dataSource);
      Vector stateList = (Vector)gml.get("States");
      profileForm.set("state", primaryAddress.getStateName());
      Vector countryList = (Vector)gml.get("Country");
      profileForm.set("country", primaryAddress.getCountryName());
     
      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")) {
View Full Code Here

    try {
      long startTime = System.currentTimeMillis();
      contactFacadeHome = (ContactFacadeHome) CVUtility.getHomeObject("com.centraview.contact.contactfacade.ContactFacadeHome", "ContactFacade");
      ContactFacade contactRemote = contactFacadeHome.create();
      contactRemote.setDataSource(dataSource);
      EntityVO entityVO = contactRemote.getEntity(1);
      long endTime = System.currentTimeMillis();
      // How long it took to retreive data in milliseconds
      long msDataRetreival = (endTime - startTime);
      if (entityVO == null) {
        monitorMessage = "FAILED: Record Not Found";
      } else if (entityVO != null && entityVO.getName().equals("")) {
        monitorMessage = "FAILED: Default Entity Name is Empty";
      } else {
        monitorMessage = "PASSED: Entity data retreived in " + msDataRetreival + " milliseconds";
      }
    } catch (Exception e) {
View Full Code Here

      dynaForm.setEntityid(new Integer(tVO.getRefEntityId()).toString());
      dynaForm.setAssignedto(tVO.getAssignedToName());
      dynaForm.setAssignedtoid(new Integer(tVO.getAssignedToId()).toString());
      dynaForm.setContact(tVO.getRefIndividualName());

      EntityVO entityVO = tVO.getEntityVO();
     
      if (entityVO != null) {
        String entityName = entityVO.getName();
        dynaForm.setEntityname(entityName);
        AddressVO primaryAdd = entityVO.getPrimaryAddress();

        if (primaryAdd != null) {
          String address = "";
          if (primaryAdd.getStreet1() != null && !primaryAdd.getStreet1().equals("")) {
            address += primaryAdd.getStreet1();
          }
          if (primaryAdd.getStreet2() != null && !primaryAdd.getStreet2().equals("")) {
            address += ", " + primaryAdd.getStreet2() + "\n";
          }else{
            address += "\n";
          }
         
          if (primaryAdd.getCity() != null && !primaryAdd.getCity().equals("")) {
            address += primaryAdd.getCity();
          }
         
          if (primaryAdd.getStateName() != null && !primaryAdd.getStateName().equals("")) {
            address += ", " + primaryAdd.getStateName();
          }
         
          if (primaryAdd.getZip() != null && !primaryAdd.getZip().equals("")) {
            address += " " + primaryAdd.getZip();
          }
         
          if (primaryAdd.getCountryName() != null && !primaryAdd.getCountryName().equals("")) {
            address += ", " + primaryAdd.getCountryName();
          }
          dynaForm.setAddress(address);
          if (primaryAdd.getWebsite() != null) {
            dynaForm.setWebsite(primaryAdd.getWebsite());
          }
        }
       
        Collection mocList = entityVO.getMOC();
        Iterator iterator = mocList.iterator();
       
        while (iterator.hasNext()) {
          MethodOfContactVO moc = (MethodOfContactVO)iterator.next();
          if (moc.getMocType() == 1 && moc.getIsPrimary().equalsIgnoreCase("YES")) {
View Full Code Here

TOP

Related Classes of com.centraview.contact.entity.EntityVO

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.