Package com.centraview.contact.contactfacade

Examples of com.centraview.contact.contactfacade.ContactFacade


        Individual = "";
      }

      //Setting the Address
      ContactFacadeHome cfHome  = (ContactFacadeHome) CVUtility.getHomeObject("com.centraview.contact.contactfacade.ContactFacadeHome", "ContactFacade");
      ContactFacade cfRemote  = (ContactFacade) cfHome.create();
      cfRemote.setDataSource(dataSource);

      Vector stateList = cfRemote.getStates();
      Vector countryList = cfRemote.getCountry();

      String OwningEntity="";

      EntityVO entityVO = cfRemote.getEntity(1);



      if (entityVO  != null)
      {
View Full Code Here


    int currentPage = 1;
    try
    {

      ContactFacadeHome contactFacadeHome = (ContactFacadeHome) CVUtility.getHomeObject("com.centraview.contact.contactfacade.ContactFacadeHome", "ContactFacade");
      ContactFacade remote = contactFacadeHome.create();
      remote.setDataSource(dataSource);
      int listID = 1;

      if (req.getParameter("dbid") != null) {
        listID = Integer.parseInt(req.getParameter("dbid"));
      }
      else if (session.getAttribute("dbid") != null) {
        listID = Integer.parseInt((String)session.getAttribute("dbid"));
      }

      Vector allDBList = remote.getDBList(individualID);
      req.setAttribute("AllDBList", allDBList);
      session.setAttribute("dbid", "" + listID);
      req.setAttribute("dbid", "" + listID);

      ListPreference listpreference = userObject.getListPreference("Email");
View Full Code Here

        deletedIndividuals.add(new Integer(current.getContactID()));
      }
    }
   
    // Time to start using the EJB layer
    ContactFacade remoteContactFacade = null;
    try {
      ContactFacadeHome contactFacadeHome = (ContactFacadeHome)CVUtility.getHomeObject("com.centraview.contact.contactfacade.ContactFacadeHome", "ContactFacade");
      remoteContactFacade = contactFacadeHome.create();
      remoteContactFacade.setDataSource(dataSource);
    } catch (Exception e) {
      logger.error("[Exception] IndividualMerge.Execute Handler ", e);
      throw new ServletException(e);
    }
   
    ArrayList addressCheckList = new ArrayList();
    for (int i = 0; i < addressCheckBox.length; i++) {
      int addressId = Integer.parseInt(addressCheckBox[i]);
      addressCheckList.add(addressId+"");
      remoteContactFacade.changeAddressRelate(addressId, contactID, contactType);
    }
   
    // delete un-used addresses
    // Of course only delete the ones that weren't selected
    // thats what all the following convoluted code does
   
    for (int i = 0; i < addressVOs.size(); i++) {
      int currentId = ((AddressVO)addressVOs.get(i)).getAddressID();
      if (! addressCheckList.contains(currentId+"")) {
        try {
          remoteContactFacade.deleteAddress(currentId, contactID, individualId);
        } catch (RemoteException re) {
          logger.error("[Exception] IndividualMerge.Execute Handler ", re);
        } catch (AuthorizationFailedException afe) {
          logger.error("[Exception] IndividualMerge.Execute Handler ", afe);
        }
      }
    }
   
    ArrayList methodOfContactCheckList = new ArrayList();
    for (int i = 0; i < methodOfContactCheckBox.length; i++) {
      int mocId = Integer.parseInt(methodOfContactCheckBox[i]);
      methodOfContactCheckList.add(mocId+"");
      remoteContactFacade.changeMOCRelate(mocId, contactID, contactType);
    }
   
   
    // delete un-used mocs.
    // Of course only delete the ones that weren't selected
    // thats what all the following convoluted code does
    for (int i = 0; i < methodOfContactVOs.size(); i++) {
      int currentId = ((MethodOfContactVO)methodOfContactVOs.get(i)).getMocID();
     
      if (! methodOfContactCheckList.contains(currentId+"")) {
        try {
          remoteContactFacade.deleteMOC(currentId, contactID, individualId);
        } catch (RemoteException re) {
          logger.error("[Exception] IndividualMerge.Execute Handler ", re);
        } catch (AuthorizationFailedException afe) {
          logger.error("[Exception] IndividualMerge.Execute Handler ", afe);
        }
      }
    }
   
    MergedIndividualConfirmationBean mergedIndividualBean = (MergedIndividualConfirmationBean)session.getAttribute("mergedIndividual");
   
    // populate the individualVO
    int entityID = mergedIndividualBean.getEntityID();
   
    EntityVO entityVO = null;
    for (int i = 0; (entityVO == null) && (i < entityVOs.size()); i++) {
      EntityVO current = (EntityVO)entityVOs.get(i);
      if (current.getContactID() == entityID) {
        entityVO = current;
      }
    }
   
    int listID = mergedIndividualBean.getListID();
    if (entityID == 1) {
      listID = entityVO.getList();
    }
   
    individualVO.setFirstName(mergedIndividualBean.getFirstName());
    individualVO.setMiddleName(mergedIndividualBean.getMiddleName());
    individualVO.setLastName(mergedIndividualBean.getLastName());
    individualVO.setExternalID(mergedIndividualBean.getId2());
    individualVO.setSource(mergedIndividualBean.getSourceID());
    individualVO.setSourceName(mergedIndividualBean.getSourceName());
    individualVO.setEntityID(entityID);
    individualVO.setModifiedBy(individualId);
    individualVO.setList(listID);
    individualVO.clearMOC()// Don't make millions of MOCs
   
    // update the individualVO record information.
    try {
      remoteContactFacade.updateIndividual(individualVO, individualId);
      String entityIDs[] = new String[1];
      entityIDs[0] = entityID+"";
      // Reason for adminIndividualID to set as -1. We know that admin is a super user
      // he can move any thing. thats why its hard coded to -1
      int adminIndividualID = -1;
      remoteContactFacade.entityMove(adminIndividualID, listID, entityIDs);
    } catch (RemoteException re) {
      logger.error("[Exception] IndividualMerge.Execute Handler ", re);
    } catch (AuthorizationFailedException afe) {
      logger.error("[Exception] IndividualMerge.Execute Handler ", afe);
    }
   
    for (int i = 0; i < deletedIndividuals.size(); i++) {
      int currentId = ((Integer)deletedIndividuals.get(i)).intValue();
      try {
        remoteContactFacade.deleteIndividual(currentId, individualId);
      } catch (RemoteException re) {
        logger.error("[Exception] IndividualMerge.Execute Handler ", re);
      } catch (AuthorizationFailedException afe) {
        logger.error("[Exception] IndividualMerge.Execute Handler ", afe);
      } catch (RemoveException rme) {
View Full Code Here

  {
    ArrayList addressVOs = new ArrayList();
    try
    {
      ContactFacadeHome contactFacadeHome = (ContactFacadeHome)CVUtility.getHomeObject("com.centraview.contact.contactfacade.ContactFacadeHome", "ContactFacade");
      ContactFacade remoteContactFacade = contactFacadeHome.create();
      remoteContactFacade.setDataSource(dataSource);
      for (int i = 0; i < mergeIds.length; i++)
      {
        // Get a collection of all addresses for each
        // add that collection to the addressVOs
        ArrayList contactAddressVOs = (ArrayList)remoteContactFacade.getAllAddressVOs(Integer.parseInt(mergeIds[i]), contactType);
        addressVOs.addAll(contactAddressVOs);
      } // end for(int i = 0; i < mergeIds.length; i++)
    }
    catch (Exception e)
    {
View Full Code Here

  {
    ArrayList entityVOs = new ArrayList();
    try
    {
      ContactFacadeHome contactFacadeHome = (ContactFacadeHome)CVUtility.getHomeObject("com.centraview.contact.contactfacade.ContactFacadeHome", "ContactFacade");
      ContactFacade remoteContactFacade = contactFacadeHome.create();
      remoteContactFacade.setDataSource(dataSource);
      for (int i = 0; i < mergeIds.length; i++)
      {
        try
        {
          EntityVO entityVO = remoteContactFacade.getEntity(Integer.parseInt(mergeIds[i]));
          entityVOs.add(entityVO);
        } catch (NumberFormatException nfe) {} // only increment if there is actually an entityId
      }
    }
    catch (Exception e)
View Full Code Here

  {
    ArrayList individualVOs = new ArrayList();
    try
    {
      ContactFacadeHome contactFacadeHome = (ContactFacadeHome)CVUtility.getHomeObject("com.centraview.contact.contactfacade.ContactFacadeHome", "ContactFacade");
      ContactFacade remoteContactFacade = contactFacadeHome.create();
      remoteContactFacade.setDataSource(dataSource);
      for (int i = 0; i < mergeIds.length; i++)
      {
        IndividualVO individualVO = remoteContactFacade.getIndividual(Integer.parseInt(mergeIds[i]));
        individualVOs.add(individualVO);
      }
    }
    catch (Exception e)
    {
View Full Code Here

  {
    ArrayList individualVOs = new ArrayList();
    try
    {
      ContactFacadeHome contactFacadeHome = (ContactFacadeHome)CVUtility.getHomeObject("com.centraview.contact.contactfacade.ContactFacadeHome", "ContactFacade");
      ContactFacade remoteContactFacade = contactFacadeHome.create();
      remoteContactFacade.setDataSource(dataSource);
      for (int i = 0; i < mergeIds.length; i++)
      {
        ArrayList individuals = (ArrayList)remoteContactFacade.getAllIndividualVOs(Integer.parseInt(mergeIds[i]));
        individualVOs.addAll(individuals);
      }
    }
    catch (Exception e)
    {
View Full Code Here

        primaryContact.setEntityID(entityId);
      }
    }

    // Time to start using the EJB layer
    ContactFacade remoteContactFacade = null;
    ContactFacadeHome contactFacadeHome = (ContactFacadeHome)CVUtility.getHomeObject("com.centraview.contact.contactfacade.ContactFacadeHome", "ContactFacade");
    try {
      remoteContactFacade = contactFacadeHome.create();
      remoteContactFacade.setDataSource(dataSource);
    } catch (Exception e) {
      logger.error("[Exception] EntityMerge.Execute Handler ", e);
      throw new ServletException(e);
    }

    ArrayList addressCheckList = new ArrayList();
    for (int i = 0; i < addressCheckBox.length; i++) {
      int addressId = Integer.parseInt(addressCheckBox[i]);
      addressCheckList.add(addressId+"");
      remoteContactFacade.changeAddressRelate(addressId, entityId, contactType);
    }

    // delete un-used addresses
    // Of course only delete the ones that weren't selected
    // thats what all the following convoluted code does
    for (int i = 0; i < addressVOs.size(); i++) {
      int currentId = ((AddressVO)addressVOs.get(i)).getAddressID();
      if (!addressCheckList.contains(currentId+"")) {
        try {
          remoteContactFacade.deleteAddress(currentId, entityId, individualId);
        } catch (RemoteException re) {
          logger.error("[Exception] EntityMerge.Execute Handler ", re);
        } catch (AuthorizationFailedException afe) {
          logger.error("[Exception] EntityMerge.Execute Handler ", afe);
        }
      }
    }

    ArrayList methodOfContactCheckList = new ArrayList();
    for (int i = 0; i < methodOfContactCheckBox.length; i++) {
      int mocId = Integer.parseInt(methodOfContactCheckBox[i]);
      methodOfContactCheckList.add(mocId+"");
      remoteContactFacade.changeMOCRelate(mocId, entityId, contactType);
    }

    // delete un-used mocs.
    // Of course only delete the ones that weren't selected
    // thats what all the following convoluted code does
    for (int i = 0; i < methodOfContactVOs.size(); i++) {
      int currentId = ((MethodOfContactVO)methodOfContactVOs.get(i)).getMocID();

      if (!methodOfContactCheckList.contains(currentId+"")) {
        try {
          remoteContactFacade.deleteMOC(currentId, entityId, individualId);
        } catch (RemoteException re) {
          logger.error("[Exception] EntityMerge.Execute Handler ", re);
        } catch (AuthorizationFailedException afe) {
          logger.error("[Exception] EntityMerge.Execute Handler ", afe);
        }
      }
    }
   
    MergedEntityConfirmationBean mergedEntityBean = (MergedEntityConfirmationBean)session.getAttribute("mergedEntity");
   
    int listID = mergedEntityBean.getListID();

    // populate the surviving VO
    survivor.setName(mergedEntityBean.getEntityName());
    survivor.setExternalID(mergedEntityBean.getId2());
    survivor.setAccManager(mergedEntityBean.getAccountManagerID());
    survivor.setAccTeam(mergedEntityBean.getAccountTeamID());
    survivor.setSource(mergedEntityBean.getSourceID());
    survivor.setSourceName(mergedEntityBean.getSourceName());
    survivor.setIndividualID(primaryContactId);
    survivor.setIndividualVO(primaryContact);
    survivor.setModifiedBy(individualId);
    survivor.setList(listID);
    survivor.clearMOC()// Don't make millions of MOCs


    // Move all Individuals to the surviving record.
    // I can either update the IndividualVOs and call update
    // Or do a DB query.  For now I am going to do the former, but we
    // maybe should update to do the latter, to save precious Compute
    // resources.  But for now this is cleaner.
    for (int i = 0; i < individualVOs.size(); i++) {
      IndividualVO current = (IndividualVO)individualVOs.get(i);
      current.setEntityID(entityId);
      current.setList(listID);
      current.setIsPrimaryContact("NO");
     
      try {
        remoteContactFacade.updateIndividual(current, individualId);
      } catch (RemoteException re) {
        logger.error("[Exception] EntityMerge.Execute Handler ", re);
      } catch (AuthorizationFailedException afe) {
        logger.error("[Exception] EntityMerge.Execute Handler ", afe);
      }
    }

     // update the surviving record information.
    try {
      remoteContactFacade.updateEntity(survivor, individualId);
      String entityIDs[] = new String[1];
      entityIDs[0] = entityId + "";
      // Reason for adminIndividualID to set as -1. We know that admin is a super user
      // he can move any thing. thats why its hard coded to -1
      int adminIndividualID = -1;
      remoteContactFacade.entityMove(adminIndividualID, listID, entityIDs);
    } catch (RemoteException re) {
      logger.error("[Exception] EntityMerge.Execute Handler ", re);
    } catch (AuthorizationFailedException afe) {
      logger.error("[Exception] EntityMerge.Execute Handler ", afe);
    }


    // PURGE!!!!
    // As Nobushige drew his sword, Hakuin remarked, "Here open the gates of hell!"
    ArrayList deletedEntities = new ArrayList();
    for (int i = 0; i < entityVOs.size(); i++) {
      int currentId = ((EntityVO)entityVOs.get(i)).getContactID();
      if (currentId != entityId) {
        try {
          remoteContactFacade.deleteEntity(currentId, individualId);
        } catch (RemoteException re) {
          logger.error("[Exception] EntityMerge.Execute Handler ", re);
        } catch (AuthorizationFailedException afe) {
          logger.error("[Exception] EntityMerge.Execute Handler ", afe);
        }
View Full Code Here

    // get marketing lists from the EJB
    ArrayList marketingLists = null;
  ContactFacadeHome contactFacadeHome = (ContactFacadeHome)CVUtility.getHomeObject("com.centraview.contact.contactfacade.ContactFacadeHome", "ContactFacade");
    try
    {
      ContactFacade remoteContactFacade = contactFacadeHome.create();
      remoteContactFacade.setDataSource(dataSource);
      marketingLists = (ArrayList)remoteContactFacade.getAllMarketingList();
    } catch (Exception e) {
    logger.error("[Exception] MergeSearch.Execute Handler ", e);
        throw new ServletException(e);
    }
    // this should never be null worst case it should be an empty arraylist.
View Full Code Here

      } else {
        request.setAttribute("isPublic", "Yes");
      }

      ContactFacadeHome facadeHome = (ContactFacadeHome)CVUtility.getHomeObject("com.centraview.contact.contactfacade.ContactFacadeHome", "ContactFacade");
      ContactFacade cfremote = facadeHome.create();
      cfremote.setDataSource(dataSource);
     
      ArrayList employeeList = (ArrayList) cfremote.getEmployeeListDisplay();
      if (employeeList != null && employeeList.size() != 0) {
        Iterator i = employeeList.iterator();
        while (i.hasNext()) {
          Object employeeObject = i.next();
         
View Full Code Here

TOP

Related Classes of com.centraview.contact.contactfacade.ContactFacade

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.