Package com.centraview.contact.helper

Examples of com.centraview.contact.helper.AddressVO


    return col;
  }   // end getSyncAs() method

  public AddressVO getAddress(int addressId)
  {
    AddressVO avo = null;

    try
    {
      InitialContext ic = CVUtility.getInitialContext();
      ContactHelperLocalHome home = (ContactHelperLocalHome)ic.lookup("local/ContactHelper");
View Full Code Here


  }   // end getAddress() method


  public AddressVO getRelatedAddress(int addressId, int contactType, int contactID)
  {
    AddressVO avo = null;

    try
    {
      InitialContext ic = CVUtility.getInitialContext();
      ContactHelperLocalHome home = (ContactHelperLocalHome)ic.lookup("local/ContactHelper");
View Full Code Here

      }
      if (individualVO.getTitle() != null) {
        entityForm.set("pcTitle", individualVO.getTitle());
      }
    }
    AddressVO address = this.getPrimaryAddress();
    if (address != null) {
      if (address.getAddressID() != 0) {
        entityForm.set("addressId", new Integer(address.getAddressID()));
      }
      if (address.getStreet1() != null) {
        entityForm.set("street1", address.getStreet1());
      }
      if (address.getStreet2() != null) {
        entityForm.set("street2", address.getStreet2());
      }
      if (address.getCity() != null) {
        entityForm.set("city", address.getCity());
      }
      if (address.getStateName() != null) {
        entityForm.set("state", address.getStateName());
      }
      if (address.getZip() != null) {
        entityForm.set("zip", address.getZip());
      }
      if (address.getCountryName() != null) {
        entityForm.set("country", address.getCountryName());
      }
      if (address.getWebsite() != null) {
        entityForm.set("website", address.getWebsite());
      }
    }
    if (this.getSourceName() != null) {
      entityForm.set("sourceName", this.getSourceName());
    }
View Full Code Here

      if (CVUtility.updateFieldPermitted(entityRights, "id2")) {
        this.setExternalID((String)dynaForm.get("id2"));
      }

      AddressVO primaryAddress = this.getPrimaryAddress();
      if (CVUtility.updateFieldPermitted(entityRights, "address")) {
        primaryAddress.setStreet1((String)dynaForm.get("street1"));
        primaryAddress.setStreet2((String)dynaForm.get("street2"));
        primaryAddress.setCity((String)dynaForm.get("city"));
        primaryAddress.setStateName((String)dynaForm.get("state"));
        primaryAddress.setZip((String)dynaForm.get("zip"));
        primaryAddress.setCountryName((String)dynaForm.get("country"));
        String webSiteForm = (dynaForm.get("website") == null || dynaForm.get("website") == null) ? "" : (String)dynaForm.get("website");
        String webSite = "";
        if (webSiteForm.matches("^https?://.+")) {
          webSite = webSiteForm;
        } else if (webSiteForm.trim().length() > 0) {
          webSite = "http://" + webSiteForm;
        }
        primaryAddress.setWebsite(webSite);
        Integer addressId = dynaForm.get("addressId") == null ? new Integer(-1) : (Integer)dynaForm.get("addressId");
        primaryAddress.setAddressID(addressId.intValue());
        primaryAddress.setIsPrimary("YES");
        if (!primaryAddress.isEmpty()) {
        this.setPrimaryAddress(primaryAddress);
      }
      }

      if (CVUtility.updateFieldPermitted(entityRights, "source")) {
        Integer sourceIdInteger = (Integer)dynaForm.get("sourceId");
        int sourceId = sourceIdInteger == null ? 0 : sourceIdInteger.intValue();
        this.setSource(sourceId);
        this.setSourceName((String)dynaForm.get("sourceName"));
      }

      if (CVUtility.updateFieldPermitted(entityRights, "acctmanager")) {
        this.setAccManager(((Integer)dynaForm.get("accountManagerId")).intValue());
        this.setAcctMgrName((String)dynaForm.get("accountManagerName"));
      }

      if (CVUtility.updateFieldPermitted(entityRights, "acctteam")) {
        this.setAccTeam(((Integer)dynaForm.get("accountTeamId")).intValue());
        this.setAcctTeamName((String)dynaForm.get("accountTeamName"));
      }

      String pcFName = dynaForm.get("pcFirstName") == null ? "" : (String)dynaForm.get("pcFirstName");
      String pcMName = dynaForm.get("pcMiddleInitial") == null ? "" : (String)dynaForm.get("pcMiddleInitial");
      String pcLName = dynaForm.get("pcLastName") == null ? "" : (String)dynaForm.get("pcLastName");
      String pcTitle = dynaForm.get("pcTitle") == null ? "" : (String)dynaForm.get("pcTitle");

      IndividualVO individualVO = null;
      int individualId = dynaForm.get("pcIndividualId") == null ? 0 : ((Integer)dynaForm.get("pcIndividualId")).intValue();
      if (individualId != 0) {
        individualVO = contactFacadeRemote.getIndividual(individualId);
        // In certain cases (when the individual was imported via marketing list)
        // The individual and the Entity share the same (exact) Address  Therefore
        // If that is the case, I must make sure the IndividualVO address is updated also
        // otherwise the crapiness of the Entity and Individual EJB interaction. will
        // cause a condition, which always reverts the common address to the old one
        // if it were changed.
        // The real solution is probably to delete this code, and make a method on the
        // Individual EJB that simply updates the potentially changed fields on the Individual.
        AddressVO individualPrimaryAddress = individualVO.getPrimaryAddress();
        if (individualPrimaryAddress.getAddressID() == primaryAddress.getAddressID()) {
          individualVO.setPrimaryAddress(primaryAddress);
        }

        // We must clear the mocs on this Individual otherwise we will create new mocs
        // associated with the Individual
View Full Code Here

      int cntType = 1;
      int cntId = this.envo.getContactID();

      // TODO: hardocoded userid!
      AddressVO adr = remote.getPrimaryAddressForContact(1, cntId, cntType); //user ID HardCoded
      this.envo.setPrimaryAddress(adr);

      // TODO: hardocoded userid!
      Collection cl = remote.getAllMOCForContact(1, cntId, cntType);
      this.envo.clearMOC();
View Full Code Here

        ContactHelperLocalHome home = (ContactHelperLocalHome)ic.lookup("local/ContactHelper");
        ContactHelperLocal remote = home.create();
        remote.setDataSource(this.dataSource);

        int cntType = this.envo.getContactType();
        AddressVO adr = this.envo.getPrimaryAddress();
        if (adr != null) {
          int addID = adr.getAddressID();
          if (addID > 0) {
            // The boolean value false tells the ContactHelperEJB to NOT
            // update the 'entity.Modified' field, since we are already
            // updating that record at this time.
            remote.updateAddress(this.envo.getPrimaryAddress(), entId, modBy, false);
View Full Code Here

      {
        getEntityVOWithBasicReferences();
      }

      // delete Address
      AddressVO addVO = this.envo.getPrimaryAddress();
      if (addVO != null)
      {
        // The boolean value false tells the ContactHelperEJB to NOT
        // update the 'entity.Modified' field, since we are already
        // updating that record at this time.
        remote.deleteAddress(addVO.getAddressID(), this.envo.getContactID(), 1, false);
      }

      // All Method of Contact is to deleted.
      Iterator mi = this.envo.getMOC().iterator();
      while (mi.hasNext())
View Full Code Here

      historyInfo.put("referenceActivityID", new Integer(0));
      historyInfo.put("recordName", individualDetail.getFirstName() + " " + individualDetail.getMiddleName() + " " + individualDetail.getLastName());
      CVUtility.addHistoryRecord(historyInfo, ds);

      // Create the address.
      AddressVO addVO = individualDetail.getPrimaryAddress();
      ContactHelperLocalHome home = (ContactHelperLocalHome)ic.lookup("local/ContactHelper");
      ContactHelperLocal remote = home.create();
      remote.setDataSource(ds);
      // if there is no address filled in, automatically fill in the address
      // from the associated entity.
      if ((addVO.getCity() == null || addVO.getCity().equals("")) &&
          (addVO.getCountryName() == null || addVO.getCountryName().equals("")) &&
          (addVO.getStateName() == null || addVO.getStateName().equals("")) &&
          (addVO.getStreet1() == null || addVO.getStreet1().equals("")) &&
          (addVO.getStreet2() == null || addVO.getStreet2().equals("")) &&
          (addVO.getZip() == null || addVO.getZip().equals("")))
      {
        // This of course creates a copy of the address from the entity, therefore
        // it is possible to be changed independently of Entities, however it will
        // not be in sync with changes to the entities.
        addVO = remote.getPrimaryAddressForContact(userID, individualDetail.getEntityID(), 1);
        addVO.setIsPrimary("YES");
      }


      // We are passing the Extra boolean value to the method. if the boolean
      // value is false then we wil not update the individual table
View Full Code Here

        ContactHelperLocalHome home = (ContactHelperLocalHome)ic.lookup("local/ContactHelper");
        ContactHelperLocal remote = home.create();
        remote.setDataSource(this.dataSource);

        int cntType = this.indVo.getContactType();
        AddressVO av = this.indVo.getPrimaryAddress();
        if (av != null) {
          if (av.getAddressID() == 0) {
            av.setIsPrimary("YES");
            //We are passing the Extra boolean value to the method. if the
            // boolean value is false then we wil not update the individual
            // table
            remote.addAddress(av, indVo.getContactID(), 2, 1, false);
          } else {
View Full Code Here

        if (!basicReferanceFilled) {
          getIndividualVOWithBasicReferences();
        }

        // delete Address
        AddressVO addVO = this.indVo.getPrimaryAddress();
        if (addVO != null) {
          //We are passing the Extra boolean value to the method. if the
          // boolean value is false then we wil not update the individual table
          remote.deleteAddress(addVO.getAddressID(), this.indVo.getContactID(), this.operationIndividualId, false);
        }

        // All Method od Contact is to deleted.
        Iterator mi = this.indVo.getMOC().iterator();
        while (mi.hasNext()) {
View Full Code Here

TOP

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

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.