Package com.centraview.contact.entity

Examples of com.centraview.contact.entity.EntityLocal


    EntityVO ev = null;
    try
    {
      InitialContext ic = CVUtility.getInitialContext();
      EntityLocalHome home = (EntityLocalHome)ic.lookup("local/Entity");
      EntityLocal remote =  home.findByPrimaryKey(new EntityPK(entId,this.dataSource));
      CommonHelperLocalHome chhome= (CommonHelperLocalHome)ic.lookup("local/CommonHelper");
      CommonHelperLocal commonhelper= chhome.create();
      // Explicitly set the dataSource on the stateless Session Bean.
      commonhelper.setDataSource(this.dataSource);
      ev = remote.getEntityVOWithBasicReferences();
      ev.setSourceName(commonhelper.getSourceName(ev.getSource()));
    } catch(Exception e)
    {
      System.out.println("[Exception][ContactFacadeEJB.getEntity] Exception Thrown: "+e);
      //e.printStackTrace();
View Full Code Here


    int entityID = 0;
    try {
      InitialContext ic = CVUtility.getInitialContext();
      EntityLocalHome home = (EntityLocalHome)ic.lookup("local/Entity");
      ctx.getUserTransaction().begin();
      EntityLocal remote =  home.create(entityDetails, ActionUserId, this.dataSource);
      EntityVO evo = remote.getEntityVOBasic();
      ctx.getUserTransaction().commit();

      entityID = evo.getContactID();

      HashMap historyInfo = new HashMap();
View Full Code Here

      throw new AuthorizationFailedException("Entity - updateEntity");
    }
    try {
        InitialContext ic = CVUtility.getInitialContext();
        EntityLocalHome home = (EntityLocalHome)ic.lookup("local/Entity");
        EntityLocal remote = home.findByPrimaryKey(new EntityPK(entityDetail.getContactID(), this.dataSource));
 
        ctx.getUserTransaction().begin();
        remote.setEntityVO(entityDetail);
        ctx.getUserTransaction().commit();
 
        HashMap historyInfo = new HashMap();
        historyInfo.put("recordID", new Integer(entityDetail.getContactID()));
        historyInfo.put("recordTypeID", new Integer(Constants.EntityModuleID));
View Full Code Here

    }

    try{
      InitialContext ic = CVUtility.getInitialContext();
      EntityLocalHome home = (EntityLocalHome)ic.lookup("local/Entity");
      EntityLocal remote =  home.findByPrimaryKey(new EntityPK(entityId,this.dataSource));

      EntityVO ev = remote.getEntityVOWithBasicReferences();

      HashMap hmDetails=new HashMap();
      hmDetails.put("title",ev.getName());
      hmDetails.put("owner",new Integer(ev.getOwner()));
      hmDetails.put("module",new Integer(1));
      hmDetails.put("recordtype",new Integer(1));

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

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

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

      HashMap hmentity=new HashMap();
      hmentity.put("EntityID",(new Integer(ev.getContactID())).toString());
      caremote.dumpData(individualID,transactionID,"entity",hmentity);

      AddressVO adv = ev.getPrimaryAddress();

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

      Vector vec = ev.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(individualID, transactionID, cftablename, hmcfv);
        }
      }

      Vector mocvec = ev.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(1)).toString());
          hmmocr.put("ContactID",(new Integer(entityId)).toString());
          caremote.dumpData(individualID,transactionID,"mocrelate",hmmocr);

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

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

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

        {
          HashMap entityList = (HashMap)iter.next();
          if (entityList != null)
          {
            int entityId = ((Number)entityList.get("EntityID")).intValue();
            EntityLocal remote =  home.findByPrimaryKey(new EntityPK(entityId,this.dataSource));
            ctx.getUserTransaction().begin();
            remote.remove();
            ctx.getUserTransaction().commit();
          }
        }
      }
    }catch(NamingException fe){
View Full Code Here

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

TOP

Related Classes of com.centraview.contact.entity.EntityLocal

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.