Package com.centraview.contact.individual

Examples of com.centraview.contact.individual.IndividualVO


      methodOfContactCollection.add(currentMOC);
    } // end for (int i = 0; i < methodOfContactVOs.size(); i++)

    // populate bean with all related Individual vos
    for (int i = 0; i < individualVOs.size(); i++) {
      IndividualVO individual = (IndividualVO)individualVOs.get(i);
      StringBuffer individualLabel = new StringBuffer();
      individualLabel.append(individual.getFirstName());
      individualLabel.append(" ");
      individualLabel.append(individual.getLastName());
      LabelValueBean currentIndividual = new LabelValueBean(individualLabel.toString(), String.valueOf(individual.getContactID()));
      individualNameCollection.add(currentIndividual);
    } // end for (int i = 0; i < individualVOs.size(); i++)

    mergeEntityDetails.set("nameCollection", nameCollection);
    mergeEntityDetails.set("idCollection", idCollection);
View Full Code Here


    {

      arg1.setAttribute("statusid",oldTaskVO.getStat());
      arg1.setAttribute("projecttaskcount",new Long(oldTaskVO.getProjectTaskCount()));

      IndividualVO ivo = oldTaskVO.getCreatedByVO();

      if (ivo != null)
      {
        setCreated(ivo.getFirstName()+" " + ivo.getLastName());
        String createdbyname = ivo.getFirstName()+" " + ivo.getLastName();
        arg1.setAttribute("createdbyname", createdbyname);

        DateFormat df = new SimpleDateFormat("dd/MM/yyyy - h:mm a") ;
        String createdon= df.format(oldTaskVO.getCreatedOn());
        arg1.setAttribute("createdon" , createdon);
        arg1.setAttribute("createdby" ,""+oldTaskVO.getCreatedBy());
      }




      ivo = oldTaskVO.getModifiedByVO();
      if (ivo != null)
      {
        setModified(ivo.getFirstName()+" " + ivo.getLastName());
        String modifiedbyname = ivo.getFirstName()+" " + ivo.getLastName();
        arg1.setAttribute("modifiedbyname", modifiedbyname);

        DateFormat df = new SimpleDateFormat("dd/MM/yyyy - h:mm a") ;
        String modified= "";
        if(oldTaskVO.getModifiedOn() != null)
View Full Code Here

    ArrayList individualVOs = (ArrayList)mergeIndvidualDetails.get("individualVOs");
    ArrayList addressVOs = (ArrayList)mergeIndvidualDetails.get("addressVOs");
    ArrayList methodOfContactVOs = (ArrayList)mergeIndvidualDetails.get("methodOfContactVOs");
   
    // get the IndividualVO for the matching id we picked.  To serve as a starting point.
    IndividualVO individualVO = null;
    int contactID = Integer.parseInt(idSelect);
    ArrayList deletedIndividuals = new ArrayList();
   
    for (int i = 0; i < individualVOs.size(); i++) {
      IndividualVO current = (IndividualVO)individualVOs.get(i);
     
      if (current.getContactID() == contactID) {
        individualVO = current;
      } else {
        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();
View Full Code Here

        taskForm.setSelectedStatus(taskVO.getSelectedStatus());
        taskForm.setStatus(String.valueOf(taskVO.getStatus()));
        request.setAttribute("setstatus", taskVO.getSelectedStatus());
        taskForm.setSelectedStatus(taskVO.getSelectedStatus());

        IndividualVO workIndividual = taskVO.getCreatedByVO();
        if (workIndividual != null) {
          taskForm.setCreated(workIndividual.getFirstName() + " " + workIndividual.getLastName());
        }
        workIndividual = taskVO.getModifiedByVO();
        if (workIndividual != null) {
          taskForm.setModified(workIndividual.getFirstName() + " " + workIndividual.getLastName());
        }

        // TODO l10n date.
        DateFormat df = new SimpleDateFormat("dd/MM/yyyy - h:mm a");
        if (taskVO.getModifiedOn() != null) {
View Full Code Here

      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

      }
    }

    // Now we have our survivor, lets update the fields.

    IndividualVO primaryContact = null;
    int primaryContactId = 0;
    for (int i = 0; (primaryContact == null) && (i < individualVOs.size()); i++) {
      IndividualVO current = (IndividualVO)individualVOs.get(i);
      if (current.getContactID() == Integer.parseInt(primaryContactSelect)) {
        primaryContact = current;
        primaryContactId = current.getContactID();
        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);
View Full Code Here

      }

      SyncUtils syncUtils = new SyncUtils();

      // this will represent the new Individual we are creating
      IndividualVO individualVO = new IndividualVO();
     
      // general basic information
      individualVO.setFirstName(firstName);
      individualVO.setMiddleName((String)contactForm.get("middleInitial"));
      individualVO.setLastName(lastName);
      individualVO.setTitle((String)contactForm.get("title"));
      individualVO.setContactType(2);   // contactType 2 is "Individual"
      individualVO.setSourceName((String)contactForm.get("source"));
      individualVO.setExternalID((String)contactForm.get("ID2"));
     
      // Address information
      String street1 = (String)contactForm.get("street1");
      String street2 = (String)contactForm.get("street2");
      String city = (String)contactForm.get("city");
      String state = (String)contactForm.get("state");
      String zipCode = (String)contactForm.get("zip");
      String country = (String)contactForm.get("country");
      AddressVO primaryAddress = new AddressVO();
      // only create an Address VO if ONE or MORE fields are filled in
      if ((street1 != null && street1.length() > 0) || (street2 != null && street2.length() > 0) ||
          (city != null && city.length() > 0) || (state != null && state.length() > 0) ||
          (zipCode != null && zipCode.length() > 0) || (country != null && country.length() > 0))
      {
        primaryAddress.setIsPrimary("YES");
        primaryAddress.setStreet1(street1);
        primaryAddress.setStreet2(street2);
        primaryAddress.setCity(city);
        primaryAddress.setStateName(state);
        primaryAddress.setZip(zipCode);
        primaryAddress.setCountryName(country);
        individualVO.setPrimaryAddress(primaryAddress);
      }

      // save email address
      String email = (String)contactForm.get("email");
      if (email != null && ! email.equals(""))
      {
        MethodOfContactVO emailVO = new MethodOfContactVO();
        emailVO.setContent(email);
        emailVO.setMocType(Constants.MOC_EMAIL);   // hardcoded to "Email" type
        emailVO.setIsPrimary("YES")// always set as the primary email address
        individualVO.setMOC(emailVO);
      }

      // set workPhone
      String workPhone = (String)contactForm.get("workPhone");
      String workPhoneExt = (String)contactForm.get("workPhoneExt");    // will be needed later for entity, maybe
      if (workPhone != null && ! workPhone.equals(""))
      {
        individualVO.setMOC(syncUtils.createNewPhoneMoc(workPhone, workPhoneExt, "Work",Constants.MOC_WORK));    // (content, ext, syncAs, mocType)
      }

      // set homePhone
      String homePhone = (String)contactForm.get("homePhone");
      String homePhoneExt = (String)contactForm.get("homePhoneExt");
      if (homePhone != null && ! homePhone.equals(""))
      {
        individualVO.setMOC(syncUtils.createNewPhoneMoc(homePhone, homePhoneExt, "Home" , Constants.MOC_HOME));
      }

      // set faxPhone
      String faxPhone = (String)contactForm.get("faxPhone");
      String faxPhoneExt = (String)contactForm.get("faxPhoneExt");
      if (faxPhone != null && (! faxPhone.equals("")))
      {
        individualVO.setMOC(syncUtils.createNewPhoneMoc(faxPhone, faxPhoneExt, "Fax" , Constants.MOC_FAX));
      }

      // set otherPhone
      String otherPhone = (String)contactForm.get("otherPhone");
      String otherPhoneExt = (String)contactForm.get("otherPhoneExt");
      if (otherPhone != null && (! otherPhone.equals("")))
      {
        individualVO.setMOC(syncUtils.createNewPhoneMoc(otherPhone, otherPhoneExt, "Other" , Constants.MOC_OTHER));
      }

      // set mainPhone
      String mainPhone = (String)contactForm.get("mainPhone");
      String mainPhoneExt = (String)contactForm.get("mainPhoneExt");
      if (mainPhone != null && (! mainPhone.equals("")))
      {
        individualVO.setMOC(syncUtils.createNewPhoneMoc(mainPhone, mainPhoneExt, "Main" , Constants.MOC_MAIN));
      }

      // set pagerPhone
      String pagerPhone = (String)contactForm.get("pagerPhone");
      String pagerPhoneExt = (String)contactForm.get("pagerPhoneExt");
      if (pagerPhone != null && (! pagerPhone.equals("")))
      {
        individualVO.setMOC(syncUtils.createNewPhoneMoc(pagerPhone, pagerPhoneExt, "Pager" , Constants.MOC_PAGER));
      }

      // set mobilePhone
      String mobilePhone = (String)contactForm.get("mobilePhone");
      String mobilePhoneExt = (String)contactForm.get("mobilePhoneExt");
      if (mobilePhone != null && (! mobilePhone.equals("")))
      {
        individualVO.setMOC(syncUtils.createNewPhoneMoc(mobilePhone, mobilePhoneExt, "Mobile" , Constants.MOC_MOBILE));
      }

      // might as well create the EJB connections now...
      ContactFacadeHome cfh = (ContactFacadeHome)CVUtility.getHomeObject("com.centraview.contact.contactfacade.ContactFacadeHome","ContactFacade");
      ContactFacade cfremote = (ContactFacade)cfh.create();
      cfremote.setDataSource(dataSource);
     
      SyncFacadeHome syncHome = (SyncFacadeHome)CVUtility.getHomeObject("com.centraview.syncfacade.SyncFacadeHome", "SyncFacade");
      com.centraview.syncfacade.SyncFacade sfremote = (com.centraview.syncfacade.SyncFacade)syncHome.create();
      sfremote.setDataSource(dataSource);

      // first, we need to get the entityID based on the CompanyName
      // passed into the form. If the entity name doesn't match something
      // in the database, then set a flag to create a new entity.
      int finalEntityID = 0;
      boolean createNewEntity = false;
      if (companyName != null && (! companyName.equals("")))
      {
        finalEntityID = sfremote.findCompanyNameMatch(companyName, individualID);

        if (finalEntityID == 0)
        {
          createNewEntity = true;
        }
      }   // end if (companyName != null && (! companyName.equals("")))

      // now that we've got all the Individual's info set up properly in
      // the appropriate VO objects, let's create an Entity if necessary
      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);

        int newEntityID = cfremote.createEntity(newEntity, individualID);
        finalEntityID = newEntityID;
      }else{
        primaryContact = "No";
        // in this block, we're updating an existing entity
        // USE finalEntityID to update the existing entity
    // TODO: write code for updating existing entity       
      }

      // custom fields...
      this.addCustomFields(individualVO, mailRemote.getValidFields("Individual"), contactForm);

      // create the individual record via the ContactFacade
      individualVO.setEntityID(finalEntityID);
      individualVO.setIsPrimaryContact(primaryContact);
     
      newIndividualID = cfremote.createIndividual(individualVO, individualID);
     
      if (newIndividualID > 0)
      {
View Full Code Here

  public UserVO getCustomerUserFull(int userId) throws UserException
  {
    CVDal cvdl = new CVDal(dataSource);
    UserVO uv = null;
    IndividualVO iv = null;

    try {
      cvdl.setSql("user.getuser");
      cvdl.setInt(1, userId);

      Collection col = cvdl.executeQuery();
      HashMap hm = new HashMap();

      if (col != null) {
        Iterator iter = col.iterator();
        while (iter.hasNext()) {
          hm = (HashMap) iter.next();
          break;
        }
      }

      if (hm != null && hm.size() > 0) {
        uv = new UserVO();
        uv.setUserId(((Long) hm.get("UserId")).intValue());
        uv.setContactID(((Long) hm.get("IndividualID")).intValue());
        uv.setLoginName((String) hm.get("Name"));
        uv.setUserStatus((String) hm.get("userstatus"));
        uv.setUserType((String) hm.get("usertype"));

        String strPassword = (String) hm.get("Password");

        uv.setPassword(strPassword);
        uv.setFirstName((String) hm.get("firstname"));
        uv.setLastName((String) hm.get("lastname"));

        if (hm.get("IndividualID") != null) {
          int intIdTemp = ((Long) hm.get("IndividualID")).intValue();
          try {
            InitialContext ic = CVUtility.getInitialContext();
            IndividualLocalHome home = (IndividualLocalHome) ic.lookup("local/Individual");
            IndividualLocal remote = home.findByPrimaryKey(new IndividualPK(intIdTemp, this.dataSource));
            iv = remote.getIndividualVOWithBasicReferences();
          } catch (Exception e) {
            System.out.println("[Exception][UserEJB.getCustomerUserFull] Exception Thrown: " + e);
            e.printStackTrace();
          }
        }

        if (iv != null) {
          uv.setPrimaryAddress(iv.getPrimaryAddress());
          uv.setEntityID(iv.getEntityID());
          uv.setContactID(iv.getContactID());
          uv.setFirstName(iv.getFirstName());
          uv.setLastName(iv.getLastName());
          uv.setTitle(iv.getTitle());

          Collection mocColl = iv.getMOC();
          if (mocColl != null) {
            Iterator it = mocColl.iterator();
            uv.clearMOC();
            while (it.hasNext()) {
              uv.setMOC((MethodOfContactVO) it.next());
            }
          }

          uv.setCreatedBy(iv.getCreatedBy());
          uv.setModifiedBy(iv.getModifiedBy());
        }

        return uv;
      }
      throw new UserException(UserException.COULDNOT_CHANGE_PASSWORD, "Could not find user");
View Full Code Here

        * @param params HashMap type of operation + last synchronization date
        * @return ArrayList with individuals
        */
       public ArrayList getIndividuals(HashMap params)
       {
         IndividualVO indVO = null;
         ArrayList individuals = new ArrayList();
         ContactFacadeLocal indL = null;

         try
         {
View Full Code Here

        * @param indId int individual id
        * @return boolean status of operation
        */
       public boolean addIndividuals(ArrayList IVOs, int indId)
       {
         IndividualVO ivo = null;
         int newId = 0;
         ContactFacadeLocal indL = null;
         HrFacadeLocal empL = null;

         try
View Full Code Here

TOP

Related Classes of com.centraview.contact.individual.IndividualVO

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.