Package com.centraview.contact.helper

Examples of com.centraview.contact.helper.ContactHelperLocalHome


    try{
      MailMessageVO mailMessageVO = new MailMessageVO();
      ArrayList toList = new ArrayList();

      InitialContext ic = CVUtility.getInitialContext();
      ContactHelperLocalHome contactHome = (ContactHelperLocalHome)ic.lookup("local/ContactHelper");
      ContactHelperLocal contactRemote = (ContactHelperLocal)contactHome.create();
      contactRemote.setDataSource(dataSource);
      toList = contactRemote.getEmailContactForIndividuals(individualIDs);
      String fromAddress = contactRemote.getPrimaryEmailAddress(individualID,2);

      if (fromAddress != null && !fromAddress.equals("") && toList != null && toList.size() != 0)
View Full Code Here


      String strAssignedID = appRemote.getApplicationSettings("DEFAULTOWNER");
      appRemote = null;
      appHome = null;

      // Used to get the Entity information when passing the EmailAddress
      ContactHelperLocalHome contactHelperHome = (ContactHelperLocalHome)ic.lookup("local/ContactHelper");
      ContactHelperLocal contactHelperRemote =  contactHelperHome.create();
      contactHelperRemote.setDataSource(this.dataSource);

      // Setting the Record Permission for newly Created record.
      AuthorizationLocalHome authHome=(AuthorizationLocalHome)ic.lookup("local/Authorization");
      AuthorizationLocal authRemote=(AuthorizationLocal)authHome.create();
View Full Code Here

    // In-case if we are updating the individual's List then we must have to update the entity's List ID
    // same thing for entity.
    if(displayName != null && displayName.equals("Marketing List") && queryTableID != 0){
     
      //intialize the ContactHelperLocal
      ContactHelperLocalHome contactHelperLocalHome = (ContactHelperLocalHome)ic.lookup("local/ContactHelper");
      ContactHelperLocal contactHelperLocal =  contactHelperLocalHome.create();
      contactHelperLocal.setDataSource(this.dataSource);

      ArrayList recordIDs= new ArrayList();     
      for (int i = 0; i < resultsIDs.size(); i++)
      {
View Full Code Here

   */
  public void setJurisdictionForAddress(int addressID, int jurisdictionID)
  {
    try {
      InitialContext ic = CVUtility.getInitialContext();
      ContactHelperLocalHome home = (ContactHelperLocalHome) ic.lookup("local/ContactHelper");
      ContactHelperLocal remote = home.create();
      remote.setDataSource(this.dataSource);
      remote.setJurisdictionForAddress(addressID, jurisdictionID);
    } catch (Exception e) {
      logger.error("[setJurisdictionForAddress]: Exception", e);
    }
View Full Code Here

      String line = "";
      boolean entityPrimaryFlag = false;

      // Collect the State, country, source, group, user, Method of Contact List
      InitialContext ic = CVUtility.getInitialContext();
      ContactHelperLocalHome homeContact = (ContactHelperLocalHome)ic.lookup("local/ContactHelper");
      ContactHelperLocal remoteContact =  homeContact.create();
      remoteContact.setDataSource(this.dataSource);

      CommonHelperLocalHome homeCommon = (CommonHelperLocalHome)ic.lookup("local/CommonHelper");
      CommonHelperLocal remoteCommon =  homeCommon.create();
      remoteCommon.setDataSource(this.dataSource);
View Full Code Here

          int taxClassId = item.getTaxClassId();
          int taxJurisdictionId = 0;

          if (invoiceVO.getShipToId()!=0)
          {
            ContactHelperLocalHome home1 = ( ContactHelperLocalHome )ic.lookup("local/ContactHelper");
            ContactHelperLocal contactHelperLocal = home1.create();
            contactHelperLocal.setDataSource(this.dataSource);

            AddressVO addVO = contactHelperLocal.getAddress(invoiceVO.getShipToId());
            taxJurisdictionId = 0;
            if (taxJurisdictionId !=0)
            {
              taxRate = getTax(taxClassId, taxJurisdictionId);
            }//if (taxJurisdictionId !=0)
          }//if InvoiceVO.shipToId!=null
          ((FloatMember)ie.get("UnitTaxrate")).setMemberValue(taxRate);
        }catch (Exception e)
        {
          ((FloatMember)ie.get("UnitTaxrate")).setMemberValue(0.0f);

        }
      }//while


    }//if counter!=0


    if (newItemID != null && !newItemID.equals("") )
      {
        st = new StringTokenizer(newItemID, ",");

        while (st.hasMoreTokens())
        {
          try
          {
          float taxRate = 0.0f;
          token   = (String)st.nextToken();
          int intToken = Integer.parseInt(token);
          InitialContext ic = CVUtility.getInitialContext();
          ItemLocalHome home = (ItemLocalHome)ic.lookup("local/Item");
          ItemLocal itemLocal = home.create();
          itemLocal.setDataSource(this.dataSource);
          ItemVO item = itemLocal.getItem(userId,intToken);


          //Get the Required Fields from the Item VO
          String name = item.getItemName();
          String sku = item.getSku();
          float price = (float)item.getPrice();
          int id = item.getItemId();
          int taxClassId = item.getTaxClassId();
          int taxJurisdictionId = 0;
          if (invoiceVO.getShipToId()!=0)
          {
            try
            {
            ContactHelperLocalHome home2 =( ContactHelperLocalHome)ic.lookup("local/ContactHelper");
            ContactHelperLocal contactHelperLocal = home2.create();
            contactHelperLocal.setDataSource(this.dataSource);
            AddressVO addVO = contactHelperLocal.getAddress(invoiceVO.getShipToId());
            taxJurisdictionId = 0;
            if (taxJurisdictionId !=0)
            {
View Full Code Here

          int taxClassId = item.getTaxClassId();
          int taxJurisdictionId = 0;

          if (orderVO.getShipToAddIdValue()!=0)
          {
            ContactHelperLocalHome home1 = ( ContactHelperLocalHome )ic.lookup("local/ContactHelper");
            ContactHelperLocal contactHelperLocal = home1.create();
            contactHelperLocal.setDataSource(this.dataSource);
            AddressVO addVO = contactHelperLocal.getAddress(orderVO.getShipToAddIdValue());
            taxJurisdictionId = 0;
            if (taxJurisdictionId !=0)
            {
              taxRate = getTax(taxClassId, taxJurisdictionId);
            }//if (taxJurisdictionId !=0)
          }//if InvoiceVO.shipToId!=null
          ((FloatMember)ie.get("UnitTaxrate")).setMemberValue(taxRate);
        }catch (Exception e)
        {
          ((FloatMember)ie.get("UnitTaxrate")).setMemberValue(0.0f);
          System.out.println("[Exception][AccountHelperEJB.calculateOrderItems] Exception Thrown: "+e);
        }
      }//while


    }//if counter!=0


    if (newItemID != null && !newItemID.equals("") )
      {
        st = new StringTokenizer(newItemID, ",");

        while (st.hasMoreTokens())
        {
          try
          {
          float taxRate = 0.0f;
          token   = (String)st.nextToken();
          int intToken = Integer.parseInt(token);
          InitialContext ic = CVUtility.getInitialContext();
          ItemLocalHome home = (ItemLocalHome)ic.lookup("local/Item");
          ItemLocal itemLocal = home.create();
          itemLocal.setDataSource(this.dataSource);
          ItemVO item = itemLocal.getItem(userId,intToken);


          //Get the Required Fields from the Item VO
          String name = item.getItemName();
          String sku = item.getSku();
          float price = (float)item.getPrice();
          int id = item.getItemId();
          int taxClassId = item.getTaxClassId();
          int taxJurisdictionId = 0;
          if (orderVO.getShipToAddIdValue()!=0)
          {
            try
            {
            ContactHelperLocalHome home2 =( ContactHelperLocalHome)ic.lookup("local/ContactHelper");
            ContactHelperLocal contactHelperLocal = home2.create();
            contactHelperLocal.setDataSource(this.dataSource);
            AddressVO addVO = contactHelperLocal.getAddress(orderVO.getShipToAddIdValue());
            taxJurisdictionId = 0;
            if (taxJurisdictionId !=0)
            {
View Full Code Here

          ItemVO item = itemLocal.getItem(userId,id);
          int taxClassId = item.getTaxClassId();
          int taxJurisdictionId = 0;
          if (purchaseOrderVO.getShipToId()!=0)
          {
            ContactHelperLocalHome home1 = ( ContactHelperLocalHome )ic.lookup("local/ContactHelper");
            ContactHelperLocal contactHelperLocal = home1.create();
            contactHelperLocal.setDataSource(this.dataSource);
            AddressVO addVO = contactHelperLocal.getAddress(purchaseOrderVO.getShipToId());
            taxJurisdictionId = 0;
            if (taxJurisdictionId !=0)
            {
              taxRate = getTax(taxClassId, taxJurisdictionId);
            }//if (taxJurisdictionId !=0)
          }//if InvoiceVO.shipToId!=null
          ((FloatMember)ie.get("UnitTaxrate")).setMemberValue(taxRate);
        }catch (Exception e)
        {
          ((FloatMember)ie.get("UnitTaxrate")).setMemberValue(0.0f);
          System.out.println("[Exception][AccountHelperEJB.calculatePurchaseOrderItems] Exception Thrown: "+e);
        }
      }//while


    }//if counter!=0


    if (newItemID != null && !newItemID.equals("") )
      {
        st = new StringTokenizer(newItemID, ",");

        while (st.hasMoreTokens())
        {
          try
          {
          float taxRate = 0.0f;
          token   = (String)st.nextToken();
          int intToken = Integer.parseInt(token);
          InitialContext ic = CVUtility.getInitialContext();
          ItemLocalHome home = (ItemLocalHome)ic.lookup("local/Item");
          ItemLocal itemLocal = home.create();
          itemLocal.setDataSource(this.dataSource);
          ItemVO item = itemLocal.getItem(userId,intToken);


          //Get the Required Fields from the Item VO
          String name = item.getItemName();
          String sku = item.getSku();
          float price = (float)item.getPrice();
          int id = item.getItemId();
          int taxClassId = item.getTaxClassId();
          int taxJurisdictionId = 0;
          if (purchaseOrderVO.getShipToId()!=0)
          {
            try
            {
            ContactHelperLocalHome home2 =( ContactHelperLocalHome)ic.lookup("local/ContactHelper");
            ContactHelperLocal contactHelperLocal = home2.create();
            contactHelperLocal.setDataSource(this.dataSource);
            AddressVO addVO = contactHelperLocal.getAddress(purchaseOrderVO.getShipToId());
            taxJurisdictionId = 0;
            if (taxJurisdictionId !=0)
            {
View Full Code Here

                }
              }
            }
          }
          InitialContext ic = CVUtility.getInitialContext();
          ContactHelperLocalHome home = (ContactHelperLocalHome)ic.lookup("local/ContactHelper");
          ContactHelperLocal remote = home.create();
          remote.setDataSource(this.dataSource);
          String ownerName = remote.getIndividualName(act.getOwner());
          act.setOwnerID(act.getOwner());
          act.setOwnerName(ownerName);
        } catch (Exception e) {
View Full Code Here

          if (hm.get("RecordID") != null) {
            linkId = ((Number)hm.get("RecordID")).intValue();
            switch (recordType) {
              case ActivityVO.ACTIVITY_LINK_ENTITY : // entity
                try {
                  ContactHelperLocalHome home = (ContactHelperLocalHome)ic.lookup("local/ContactHelper");
                  ContactHelperLocal remote = home.create();
                  remote.setDataSource(this.dataSource);
                  String entityName = remote.getEntityName(linkId);
                  app.setEntityName(entityName);
                  app.setEntityID(linkId);
                } catch (Exception e) {
                  logger.error("[Exception] ActivityHelperEJB.getActivityLink: ", e);
                }
                break;
              case ActivityVO.ACTIVITY_LINK_INDIVIDUAL : // Individual
                try {
                  ContactHelperLocalHome home = (ContactHelperLocalHome)ic.lookup("local/ContactHelper");
                  ContactHelperLocal remote = home.create();
                  remote.setDataSource(this.dataSource);
                  String individualName = remote.getIndividualName(linkId);
                  app.setIndividualName(individualName);
                  Collection contacts = remote.getPrimaryMOCForContact(0, linkId, 2);
                  app.setIndividualPrimaryContact("");
                  if(contacts.size() > 0){
                    MethodOfContactVO mc = (MethodOfContactVO) contacts.toArray()[0];
                    app.setIndividualPrimaryContact(mc.getContent());                   
                  }
                  app.setIndividualID(linkId);
                } catch (Exception e) {
                  logger.error("[Exception] ActivityHelperEJB.getActivityLink: ", e);
                }
                break;
              case ActivityVO.ACTIVITY_LINK_FILE : // File
                try {
                  CvFileLocalHome fh = (CvFileLocalHome)ic.lookup("local/CvFile");
                  CvFileLocal fr = fh.create();
                  fr.setDataSource(this.dataSource);
                  CvFileVO flvo = fr.getFileBasic(gbUserId, linkId);
                  app.setAttachmentVec(flvo);
                } catch (Exception e) {
                  logger.error("[Exception] ActivityHelperEJB.getActivityLink: ", e);
                }
                break;
              case ActivityVO.ACTIVITY_LINK_OPPORTUNITY : // Opportunity - from module table
                try {
                  OpportunityLocalHome home = (OpportunityLocalHome)ic.lookup("local/Opportunity");
                  OpportunityLocal local = home.create();
                  local.setDataSource(this.dataSource);
                  String opportunityName = local.getOpportunityName(linkId);
                  app.setRelatedFieldID(linkId);
                  app.setRelatedFieldValue(opportunityName);
                  app.setRelatedTypeID(ActivityVO.ACTIVITY_LINK_OPPORTUNITY);
                  app.setRelatedTypeValue("Opportunity");
                } catch (Exception e) {
                  logger.error("[Exception] ActivityHelperEJB.getActivityLink: ", e);
                }
                break;
              case ActivityVO.ACTIVITY_LINK_PROJECT : // Projects - from module table
                try {
                  ProjectLocalHome home = (ProjectLocalHome)ic.lookup("local/Project");
                  ProjectLocal remote = (ProjectLocal)home.create();
                  remote.setDataSource(this.dataSource);
                  String projectTitle = remote.getProjectName(linkId);
                  app.setRelatedFieldID(linkId);
                  app.setRelatedFieldValue(projectTitle);
                  app.setRelatedTypeID(ActivityVO.ACTIVITY_LINK_PROJECT);
View Full Code Here

TOP

Related Classes of com.centraview.contact.helper.ContactHelperLocalHome

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.