Package com.centraview.contact.individual

Examples of com.centraview.contact.individual.IndividualVO


          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


        }
      }
      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

      HttpSession session = request.getSession();
      UserObject userObject = (UserObject)session.getAttribute("userobject");
      int individualID = userObject.getIndividualID();

      IndividualVO individualVO;
      AddressVO addressVO = null;

      ContactFacadeHome cfh = (ContactFacadeHome)CVUtility.getHomeObject("com.centraview.contact.contactfacade.ContactFacadeHome", "ContactFacade");
      ContactFacade remote = (ContactFacade)cfh.create();
      remote.setDataSource(dataSource);

      session.setAttribute("highlightmodule", "preferences");
      individualVO = remote.getIndividual(individualID);
      individualVO.populateFormBean(dynaForm);     

      if (individualVO.getUserName() != null)
      {
        dynaForm.set("userName", individualVO.getUserName());
      }
      request.setAttribute(AdminConstantKeys.PREFERENCEPAGE, "USERPROFILE");
    }catch(Exception e){
      System.out.println("[Exception][DisplayUserProfileHandler.execute] Exception Thrown: " + e);
      e.printStackTrace();
View Full Code Here

      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());
      }
      names.put("entityName", entityName);
      names.put("individualName", individualName.toString());
    } catch (Exception e) {
      logger.error("[getEntityNameAndIndividualName] Exception thrown.", e);
View Full Code Here

        }
      }
      ContactFacadeHome cfh = (ContactFacadeHome)CVUtility.getHomeObject("com.centraview.contact.contactfacade.ContactFacadeHome", "ContactFacade");
      ContactFacade remote = (ContactFacade)cfh.create();
      remote.setDataSource(dataSource);
      IndividualVO individualVO = new IndividualVOX(form, request, dataSource);

      if (typeOfSave.equals("save"))
      {
        try {
          remote.updateIndividual(individualVO, individualId);
View Full Code Here

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

      SyncFacadeHome syncHome = (SyncFacadeHome)CVUtility.getHomeObject("com.centraview.syncfacade.SyncFacadeHome", "SyncFacade");
      com.centraview.syncfacade.SyncFacade sfremote = (com.centraview.syncfacade.SyncFacade)syncHome.create();
      sfremote.setDataSource(dataSource);

      // this will represent the new Individual we are creating
      IndividualVO individualVO = new IndividualVO();

      individualVO.setFirstName(firstName);
      individualVO.setMiddleName((String)contactForm.get("MI"));
      individualVO.setLastName(lastName);
      individualVO.setTitle((String)contactForm.get("title"));
      individualVO.setIsPrimaryContact(primaryContact);
      individualVO.setContactType(2);   // contactType 2 is "Individual"

      AddressVO primaryAddress = new AddressVO();

      primaryAddress.setIsPrimary("YES");
      primaryAddress.setStreet1((String)contactForm.get("street1"));
      primaryAddress.setStreet2((String)contactForm.get("street2"));
      primaryAddress.setCity((String)contactForm.get("city"));
      primaryAddress.setStateName((String)contactForm.get("state"));
      primaryAddress.setZip((String)contactForm.get("zipCode"));
      primaryAddress.setCountryName((String)contactForm.get("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");
      if (workPhone != null && (! workPhone.equals("")))
      {
        // create new MocVO object
        MethodOfContactVO workPhoneMocVO = new MethodOfContactVO();
       
        // set properties
        String workPhoneExt = (String)contactForm.get("workPhoneExt");
        if (workPhoneExt != null && ! workPhoneExt.equals(""))
        {
          workPhone = workPhone + "EXT" + workPhoneExt;
        }
        workPhoneMocVO.setContent(workPhone);
        workPhoneMocVO.setSyncAs("Work");
        workPhoneMocVO.setMocType(Constants.MOC_WORK);   // hardcoded to "Phone" type

        individualVO.setMOC(workPhoneMocVO);
      }

      // set homePhone
      String homePhone = (String)contactForm.get("homePhone");
      if (homePhone != null && (! homePhone.equals("")))
      {
        // create new MocVO object
        MethodOfContactVO homePhoneMocVO = new MethodOfContactVO();
       
        // set properties
        String homePhoneExt = (String)contactForm.get("homePhoneExt");
        if (homePhoneExt != null && ! homePhoneExt.equals(""))
        {
          homePhone = homePhone + "EXT" + homePhoneExt;
        }
        homePhoneMocVO.setContent(homePhone);
        homePhoneMocVO.setSyncAs("Home");
        homePhoneMocVO.setMocType(Constants.MOC_HOME);   // hardcoded to "Phone" type

        individualVO.setMOC(homePhoneMocVO);
      }

      // set faxPhone
      String faxPhone = (String)contactForm.get("faxPhone");
      if (faxPhone != null && (! faxPhone.equals("")))
      {
        // create new MocVO object
        MethodOfContactVO faxPhoneMocVO = new MethodOfContactVO();
       
        // set properties
        String faxPhoneExt = (String)contactForm.get("faxPhoneExt");
        if (faxPhoneExt != null && ! faxPhoneExt.equals(""))
        {
          faxPhone = faxPhone + "EXT" + faxPhoneExt;
        }
        faxPhoneMocVO.setContent(faxPhone);
        faxPhoneMocVO.setSyncAs("Fax");
        faxPhoneMocVO.setMocType(Constants.MOC_FAX);   // hardcoded to "Fax" type

        individualVO.setMOC(faxPhoneMocVO);
      }

      // set otherPhone
      String otherPhone = (String)contactForm.get("otherPhone");
      if (otherPhone != null && (! otherPhone.equals("")))
      {
        // create new MocVO object
        MethodOfContactVO otherPhoneMocVO = new MethodOfContactVO();
       
        // set properties
        String otherPhoneExt = (String)contactForm.get("otherPhoneExt");
        if (otherPhoneExt != null && ! otherPhoneExt.equals(""))
        {
          otherPhone = otherPhone + "EXT" + otherPhoneExt;
        }
        otherPhoneMocVO.setContent(otherPhone);
        otherPhoneMocVO.setSyncAs("Other");
        otherPhoneMocVO.setMocType(Constants.MOC_OTHER);   // hardcoded to "Phone" type

        individualVO.setMOC(otherPhoneMocVO);
      }

      // set mainPhone
      String mainPhone = (String)contactForm.get("mainPhone");
      if (mainPhone != null && (! mainPhone.equals("")))
      {
        // create new MocVO object
        MethodOfContactVO mainPhoneMocVO = new MethodOfContactVO();
       
        // set properties
        String mainPhoneExt = (String)contactForm.get("mainPhoneExt");
        if (mainPhoneExt != null && ! mainPhoneExt.equals(""))
        {
          mainPhone = mainPhone + "EXT" + mainPhoneExt;
        }
        mainPhoneMocVO.setContent(mainPhone);
        mainPhoneMocVO.setSyncAs("Main");
        mainPhoneMocVO.setMocType(Constants.MOC_MAIN);   // hardcoded to "Phone" type

        individualVO.setMOC(mainPhoneMocVO);
      }

      // set pagerPhone
      String pagerPhone = (String)contactForm.get("pagerPhone");
      if (pagerPhone != null && (! pagerPhone.equals("")))
      {
        // create new MocVO object
        MethodOfContactVO pagerPhoneMocVO = new MethodOfContactVO();
       
        // set properties
        String pagerPhoneExt = (String)contactForm.get("pagerPhoneExt");
        if (pagerPhoneExt != null && ! pagerPhoneExt.equals(""))
        {
          pagerPhone = pagerPhone + "EXT" + pagerPhoneExt;
        }
        pagerPhoneMocVO.setContent(pagerPhone);
        pagerPhoneMocVO.setSyncAs("Pager");
        pagerPhoneMocVO.setMocType(Constants.MOC_PAGER);   // hardcoded to "Phone" type

        individualVO.setMOC(pagerPhoneMocVO);
      }

      // set mobilePhone
      String mobilePhone = (String)contactForm.get("mobilePhone");
      if (mobilePhone != null && (! mobilePhone.equals("")))
      {
        // create new MocVO object
        MethodOfContactVO mobilePhoneMocVO = new MethodOfContactVO();
       
        // set properties
        String mobilePhoneExt = (String)contactForm.get("mobilePhoneExt");
        if (mobilePhoneExt != null && ! mobilePhoneExt.equals(""))
        {
          mobilePhone = mobilePhone + "EXT" + mobilePhoneExt;
        }
        mobilePhoneMocVO.setContent(mobilePhone);
        mobilePhoneMocVO.setSyncAs("Mobile");
        mobilePhoneMocVO.setMocType(Constants.MOC_MOBILE);   // hardcoded to "Mobile" type

        individualVO.setMOC(mobilePhoneMocVO);
      }

      // get notes field
      String notes = (String)contactForm.get("notes");
      boolean addNote = (notes != null && notes.length() > 0) ? true : false;

      // 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 companyID = 0;
      int finalEntityID = 0;
      boolean createNewEntity = false;
      if (companyName != null && (! companyName.equals("")))
      {
        companyID = sfremote.findCompanyNameMatch(companyName, individualID);

        if (companyID == 0)
        {
          createNewEntity = true;
        }else{
          finalEntityID = companyID;
        }
      }   // 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
      if (createNewEntity)
      {
        // we must have set the createNewEntity flag to true
        // above, when we checked for a matching entity name
        // in the database, and didn't find one.
        EntityVO newEntity = new EntityVO();
        newEntity.setContactType(1);    // contact type 1 = Entity
        newEntity.setName(companyName);

        // set the new Entity's primary Address equal to the
        // same data for the new Individual
        newEntity.setPrimaryAddress(primaryAddress);
       
        Vector indivMOCs = individualVO.getMOC();
        Iterator iter = indivMOCs.iterator();
        while (iter.hasNext())
        {
          // set the new Entity's methods of contacts equal
          // to the same data for the new Individual
          MethodOfContactVO tmpVO = (MethodOfContactVO)iter.next();
          newEntity.setMOC(tmpVO);
        }

        int newEntityID = remote.createEntity(newEntity, individualID);

        // Check to see if the user's preference is to create sync'ed
        // records as private. If so, delete all records from recordauthorisation
        // and publicrecords tables that link to the newly created records.
        if (syncAsPrivate)
        {
          ArrayList entityIDs = new ArrayList();
          try
          {
            entityIDs.add(new Integer(newEntityID));
          }catch(NumberFormatException nfe){
            // don't need to do anything, because we obviously didn't add an entity successfully.
          }
          sfremote.markRecordsPrivate(14, entityIDs);
        }

        finalEntityID = newEntityID;
        individualVO.setIsPrimaryContact("Yes");
      }
     
      // create the individual record via the ContactFacade
      individualVO.setEntityID(finalEntityID);
      int newIndividualID = remote.createIndividual(individualVO, individualID);
     
      if (newIndividualID != 0)
      {
        if (addNote)
View Full Code Here

    PrintTemplateField printTemplateField = new PrintTemplateField();
    try {
      ContactFacadeHome aa = (ContactFacadeHome) CVUtility.getHomeObject("com.centraview.contact.contactfacade.ContactFacadeHome", "ContactFacade");
      ContactFacade remote = aa.create();
      remote.setDataSource(dataSource);
      IndividualVO individualVOReference = remote.getIndividual(individualId);
      printTemplateField.setIndividualID(String.valueOf(individualId));
      printTemplateField.setEntityID(String.valueOf(individualVOReference.getEntityID()));
      int entityId = individualVOReference.getEntityID();
      if (entityId != 0) {
        EntityVO evo = remote.getEntity(entityId);
        printTemplateField.setCompany(evo.getName());
      }
      // set the Primary information of the individual
      printTemplateField.setFirstName(individualVOReference.getFirstName());
      printTemplateField.setMiddleInitial(individualVOReference.getMiddleName());
      printTemplateField.setLastName(individualVOReference.getLastName());
      printTemplateField.setTitle(individualVOReference.getTitle());
      printTemplateField.setExternalID(individualVOReference.getExternalID());
      printTemplateField.setSource(individualVOReference.getSourceName());

      AddressVO primaryAdd = individualVOReference.getPrimaryAddress();
      // Set the Address information
      if (primaryAdd != null) {
        printTemplateField.setStreet1(primaryAdd.getStreet1());
        printTemplateField.setStreet2(primaryAdd.getStreet2());
        printTemplateField.setCity(primaryAdd.getCity());
        String state = primaryAdd.getStateName();
        printTemplateField.setState(state);
        printTemplateField.setZip(primaryAdd.getZip());
        String country = primaryAdd.getCountryName();
        printTemplateField.setCountry(country);
        printTemplateField.setWebsite(primaryAdd.getWebsite());
      } // end if (primaryAdd != null)
      // set the Method of Contacts
      Collection mocList = individualVOReference.getMOC();
      Iterator iterator = mocList.iterator();
      while (iterator.hasNext()) {
        MethodOfContactVO moc = (MethodOfContactVO) iterator.next();
        // TODO Should we make an effort to see if the email address is the
        // primary???
View Full Code Here

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

            {
              remote.deleteIndividual( elementID,individualID);
            }
            else
            {
              IndividualVO individualVO = remote.getIndividual(elementID);
              this.individualUsers.add(individualVO.getFirstName() + " "
                + individualVO.getLastName());
            } //end of else statement (!remote.isIndividualAUser(individualIDMarkedForDeletion))
          }//end of try block
          catch(AuthorizationFailedException ae){
            String errorMessage = ae.getExceptionDescription();
            resultDeleteLog.add(errorMessage);
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.