Package com.centraview.contact.individual

Examples of com.centraview.contact.individual.IndividualLocal


    try
    {
      InitialContext ic = new InitialContext();
      IndividualLocalHome home = (IndividualLocalHome)
        ic.lookup("local/Individual");
      IndividualLocal remote =  home.findByPrimaryKey(
        new IndividualPK(individualID, this.dataSource));
      individualVO = remote.getIndividualVOWithBasicReferences();
    } //end of try block
    catch (Exception e)
    {
      //Give empty information
      individualVO.setContactID(individualID);
View Full Code Here


    // This method fills in the oft standard Owner, Modifier, Creator details
    try
    {
      InitialContext ic = CVUtility.getInitialContext();
      IndividualLocalHome home = (IndividualLocalHome)ic.lookup("local/Individual");
      IndividualLocal remote;
      try
      {
        remote = home.findByPrimaryKey(new IndividualPK(this.owner, dataSource));
        this.setOwnerVO(remote.getIndividualVOBasic());
      } catch (FinderException e) {
        logger.debug("[fillAuditDetails] FinderException finding owner ID: "+this.owner);
      } catch (Exception e) {
        logger.error("[fillAuditDetails] Exception thrown.", e);
      }

      try
      {
        remote = home.findByPrimaryKey(new IndividualPK(this.createdBy, dataSource));
        this.setCreatedByVO(remote.getIndividualVOBasic());
      } catch (FinderException e) {
        logger.debug("[fillAuditDetails] FinderException finding creator ID: "+this.createdBy);
      } catch (Exception e) {
        logger.error("[fillAuditDetails] Exception thrown.", e);
      }

      try
      {
        remote = home.findByPrimaryKey(new IndividualPK(this.modifiedBy, dataSource));
        this.setModifiedByVO(remote.getIndividualVOBasic());
      } catch (FinderException e) {
        logger.debug("[fillAuditDetails] FinderException finding ModifiedBy ID: "+this.modifiedBy);
      } catch (Exception e) {
        logger.error("[fillAuditDetails] Exception thrown.", e);
      }
View Full Code Here

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

      //for Author
      if (flvo.getAuthorId() > 0) {
        try {
          //InitialContext ic = CVUtility.getInitialContext();
          IndividualLocalHome home = (IndividualLocalHome)ic.lookup("local/Individual");
          IndividualLocal remote = home.findByPrimaryKey(new IndividualPK(flvo.getAuthorId(), this.dataSource));
          flvo.setAuthorVO(remote.getIndividualVOBasic());
        } catch (Exception e) {
          // do nothing if not found
        }
      }

      //for RelateEntity
      if (flvo.getRelateEntity() > 0) {
        try {
          EntityLocalHome home = (EntityLocalHome)ic.lookup("local/Entity");
          EntityLocal remote = home.findByPrimaryKey(new EntityPK(flvo.getRelateEntity(), this.dataSource));
          flvo.setRelateEntityVO(remote.getEntityVOBasic());
        } catch (Exception e) {
          // do nothing if not found
        }
      }

      //for RelateIndividual
      if (flvo.getRelateIndividual() > 0) {
        try {
          IndividualLocalHome home = (IndividualLocalHome)ic.lookup("local/Individual");
          IndividualLocal remote = home.findByPrimaryKey(new IndividualPK(flvo.getRelateIndividual(), this.dataSource));
          flvo.setRelateIndividualVO(remote.getIndividualVOBasic());
        } catch (Exception e) {
          // do nothing if not found
        }
      }
View Full Code Here

    IndividualVO iv = null;
    try
    {
      InitialContext ic = CVUtility.getInitialContext();
      IndividualLocalHome home = (IndividualLocalHome)ic.lookup("local/Individual");
      IndividualLocal remote =  home.findByPrimaryKey(new IndividualPK(indId,this.dataSource));
      // the ejbLoad will take care of setting the dataSource on a findByPrimaryKey.
      iv = remote.getIndividualVOWithBasicReferences();
      CommonHelperLocalHome chhome= (CommonHelperLocalHome)ic.lookup("local/CommonHelper");
      CommonHelperLocal commonhelper= chhome.create();
      // we need to explicitly set the dataSource on a stateless session bean.
      commonhelper.setDataSource(dataSource);
      iv.setSourceName(commonhelper.getSourceName(iv.getSource()));
View Full Code Here

      InitialContext ic = CVUtility.getInitialContext();
      IndividualLocalHome home = (IndividualLocalHome)ic.lookup("local/Individual");

      ctx.getUserTransaction().begin();

      IndividualLocal remote =  home.create(indDetail,actionUserId,this.dataSource);
      IndividualVO vo = remote.getIndividualVOBasic();
      indID = vo.getContactID();

      ctx.getUserTransaction().commit();

       // The code to add the entry in DB is added to IndividualEJB
View Full Code Here

      throw new AuthorizationFailedException("[ContactFacadeEJB] updateIndividual() - canPerformRecordOperation() failed for individualID = " + individualID);
    }
    try {
      InitialContext ic = CVUtility.getInitialContext();
      IndividualLocalHome home = (IndividualLocalHome)ic.lookup("local/Individual");
      IndividualLocal remote = home.findByPrimaryKey(new IndividualPK(individualDet.getContactID(), this.dataSource));
      ctx.getUserTransaction().begin();
      remote.setIndividualVO(individualDet);
      ctx.getUserTransaction().commit();
      HashMap historyInfo = new HashMap();
      historyInfo.put("recordID", new Integer(individualDet.getContactID()));
      historyInfo.put("recordTypeID", new Integer(Constants.IndividualModuleID));
      historyInfo.put("operation", new Integer(Constants.UPDATED));
View Full Code Here

      throw new AuthorizationFailedException("Individual - deleteIndividual");
    }
    try{
      InitialContext ic = CVUtility.getInitialContext();
      IndividualLocalHome home = (IndividualLocalHome)ic.lookup("local/Individual");
      IndividualLocal remote =  home.findByPrimaryKey(new IndividualPK(individualId,this.dataSource));

      IndividualVO indVO = remote.getIndividualVOWithBasicReferences();

      HashMap hmDetails=new HashMap();
      hmDetails.put("title",indVO.getFirstName() + " " + indVO.getLastName());
      hmDetails.put("owner",new Integer(indVO.getOwner()));
      hmDetails.put("module",new Integer(1));
      hmDetails.put("recordtype",new Integer(2));

      InitialContext ctxl=CVUtility.getInitialContext();
      CvAtticLocalHome cahome=(CvAtticLocalHome)ctxl.lookup("local/CvAttic");

      CvAtticLocal caremote =cahome.create();
      caremote.setDataSource(this.dataSource);

      int transactionID=caremote.getAtticTransactionID(indID,Constants.CV_GARBAGE,hmDetails);

      HashMap hmind=new HashMap();
      hmind.put("IndividualID",(new Integer(indVO.getContactID())).toString());
      caremote.dumpData(indID,transactionID,"individual",hmind);

      AddressVO adv = indVO.getPrimaryAddress();
      if (adv != null)
      {
        HashMap hmaddr=new HashMap();
        hmaddr.put("AddressID",(new Integer(adv.getAddressID())).toString());
        caremote.dumpData(indID,transactionID,"address",hmaddr);

        HashMap addressRelateHashMap = new HashMap();
        addressRelateHashMap.put("Address",(new Integer(adv.getAddressID())).toString());
        caremote.dumpData(indID,transactionID,"addressrelate", addressRelateHashMap);
      }

      Vector mocvec = indVO.getMOC();
      if (mocvec != null)
      {
        Iterator it = mocvec.iterator();
        while (it.hasNext())
        {
          MethodOfContactVO mocv = (MethodOfContactVO)it.next();

          HashMap hmmocr=new HashMap();
          hmmocr.put("MOCID",(new Integer(mocv.getMocID())).toString());
          hmmocr.put("ContactType",(new Integer(2)).toString());
          hmmocr.put("ContactID",(new Integer(individualId)).toString());
          caremote.dumpData(indID, transactionID, "mocrelate", hmmocr);

          HashMap hmmoc=new HashMap();
          hmmoc.put("MOCID",(new Integer(mocv.getMocID())).toString());
          hmmoc.put("MOCType", Integer.toString(mocv.getMocType()));
          caremote.dumpData(indID, transactionID, "methodofcontact", hmmoc);
        }
      }

      Vector vec = indVO.getCustomField();
      if (vec != null)
      {
        Iterator it = vec.iterator();
        while (it.hasNext())
        {
          CustomFieldVO cfv = (CustomFieldVO)it.next();
          String cftablename = "customfieldscalar";
          if (cfv.getFieldType() == CustomFieldVO.MULTIPLE)
          {
            cftablename = "customfieldmultiple";
          }

          HashMap hmcfv=new HashMap();
          hmcfv.put("CustomFieldID",(new Integer(cfv.getFieldID())).toString());
          caremote.dumpData(indID,transactionID,cftablename,hmcfv);
        }
      }
      remote.setOperationIndividualId(individualId);

      ctx.getUserTransaction().begin();
      remote.remove();
      ctx.getUserTransaction().commit();

            HashMap historyInfo = new HashMap();
        historyInfo.put("recordID",new Integer(individualId));
        historyInfo.put("recordTypeID", new Integer(Constants.IndividualModuleID));
View Full Code Here

    HashMap hm=new HashMap();
    try
    {
      InitialContext ic = CVUtility.getInitialContext();
      IndividualLocalHome home = (IndividualLocalHome)ic.lookup("local/Individual");
      IndividualLocal remote =  home.findByPrimaryKey(new IndividualPK(indId,this.dataSource));
      hm = remote.getCustomerIndividualVOWithBasicReferences();
    }catch(Exception e){
      System.out.println("Failed in the ContactFacadewhile getting Individual ");
      //e.printStackTrace();
    }
    return hm;
View Full Code Here

        {
          HashMap individualList = (HashMap)iter.next();
          if (individualList != null)
          {
            int individualId = ((Number)individualList.get("EntityID")).intValue();
            IndividualLocal remote =  home.findByPrimaryKey(new IndividualPK(individualId,this.dataSource));
            ctx.getUserTransaction().begin();
            remote.remove();
            ctx.getUserTransaction().commit();
          }
        }
      }
    }catch(NamingException re){
View Full Code Here

TOP

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

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.