Package com.sourcetap.sfa.event

Examples of com.sourcetap.sfa.event.GenericEventProcessor


        int status = STATUS_CONTINUE;

        // Delete related Addresses.
        status = deleteOneRelated(userInfo, delegator, entityGV, "", "Address",
                originatingEntityName, new GenericEventProcessor());

        if (status != STATUS_CONTINUE) {
            return status;
        }

        // Delete related Parties.
        status = deleteOneRelated(userInfo, delegator, entityGV, "", "Party",
                originatingEntityName, new GenericEventProcessor());

        if (status != STATUS_CONTINUE) {
            return status;
        }

        // Delete related FileAttachments.  (Note: This must happen before the LeadFiles are deleted.)
        status = deleteOneRelated(userInfo, delegator, entityGV, "",
                "FileAttachment", originatingEntityName,
                new AbstractAttachmentEP());

        if (status != STATUS_CONTINUE) {
            return status;
        }

        // Delete related LeadFiles.  (Note: This must happen after the FileAttachments are deleted.)
        status = deleteOneRelated(userInfo, delegator, entityGV, "",
                "LeadFile", originatingEntityName, new GenericEventProcessor());

        if (status != STATUS_CONTINUE) {
            return status;
        }
View Full Code Here


        int status = STATUS_CONTINUE;

        // Delete related contacts.
        status = deleteOneRelated(userInfo, delegator, entityGV, "",
                "ActivityContact", originatingEntityName,
                new GenericEventProcessor());

        if (status != STATUS_CONTINUE) {
            return status;
        }

        // Delete related FileAttachments.  (Note: This must happen before the ActivityFiles are deleted.)
        status = deleteOneRelated(userInfo, delegator, entityGV, "",
                "FileAttachment", originatingEntityName,
                new AbstractAttachmentEP());

        if (status != STATUS_CONTINUE) {
            return status;
        }

        // Delete related ActivityFiles.  (Note: This must happen after the FileAttachments are deleted.)
        status = deleteOneRelated(userInfo, delegator, entityGV, "",
                "ActivityFile", originatingEntityName,
                new GenericEventProcessor());

        if (status != STATUS_CONTINUE) {
            return status;
        }
View Full Code Here

        int status = STATUS_CONTINUE;

        // Delete related Parties.
        status = deleteOneRelated(userInfo, delegator, entityGV, "", "Party",
                originatingEntityName, new GenericEventProcessor());

        if (status != STATUS_CONTINUE) {
            return status;
        }
View Full Code Here

  public List getListItems(UserInfo userInfo, int maxRows)
  {
    EntityListIterator eli = null;
   
    if ( eventProcessor == null)
      eventProcessor = new GenericEventProcessor();
   
    if ( queryInfo == null )
      throw new RuntimeException("You must call loadQueryInfo prior to getListItems");
   
    SecurityLinkInfo securityInfo = eventProcessor.getSecurityLinkInfo(userInfo, delegator);
View Full Code Here

  public List runReport(UserInfo userInfo, int maxRows)
  {
    EntityListIterator eli = null;
   
    if ( eventProcessor == null)
      eventProcessor = new GenericEventProcessor();
   
    if ( queryInfo == null )
      throw new RuntimeException("You must call loadQueryInfo prior to runReport");
   
    SecurityLinkInfo securityInfo = eventProcessor.getSecurityLinkInfo(userInfo, delegator);
View Full Code Here

          hasAccountInfo = true;

      if ( hasAccountInfo )
      {
      DataInfo dataInfo = (DataInfo) dataMatrixMap.get("ACCOUNT.AccountHeader");
      GenericEventProcessor eventProcessor = new AccountEventProcessor();
     
        if ( (accountId != null) && ( accountId.length() > 0) )
      {
        dataInfo.retrieveFromDB(userInfo, eventProcessor, new GenericPK( delegator.getModelEntity("Account"), UtilMisc.toMap("accountId", accountId)));
        dataInfo.processUpdate( userInfo, delegator, eventProcessor );     
      }
      else
      {
        dataInfo.loadData(userInfo, eventProcessor);
        dataInfo.processInsert( userInfo, delegator, eventProcessor )
      }
     
      GenericValue accountGV = dataInfo.dataMatrix.getCurrentBuffer().getGenericValue(0, "Account", false);
      accountId = accountGV.getString("accountId");
        accountName = accountGV.getString("accountName");
      }

      if ( getCreateContact())
      {
        DataInfo dataInfo = (DataInfo) dataMatrixMap.get("CONTACT.ContactHeader");
        GenericEventProcessor eventProcessor = new ContactEventProcessor();
       
        if ( (contactId != null) && (contactId.length() > 0))
        {
          dataInfo.retrieveFromDB(userInfo, eventProcessor, new GenericPK( delegator.getModelEntity("Contact"), UtilMisc.toMap("contactId", contactId)));
          if ( hasAccountInfo )
          {
              GenericValue contactGV = dataInfo.dataMatrix.getCurrentBuffer().getGenericValue(0, "Contact", false);
              String accountIdOrig = contactGV.getString("accountId");
              if ( ( accountIdOrig == null ) || ( accountIdOrig.length() < 1) )
                  contactGV.set("accountId", accountId);
          }
          dataInfo.processUpdate( userInfo, delegator, eventProcessor );
        }
        else
        {       
          dataInfo.loadData(userInfo, eventProcessor);
          if ( hasAccountInfo )
          dataInfo.dataMatrix.getCurrentBuffer().getGenericValue(0, "Contact", false).set("accountId", accountId);
          dataInfo.processInsert( userInfo, delegator, eventProcessor );
        }
 
        GenericValue contactGV = dataInfo.dataMatrix.getCurrentBuffer().getGenericValue(0, "Contact", false);
        contactId = contactGV.getString("contactId");
       
        // Add ContactEmploymentInfo if there is an account tied to this record
        if ( ( accountId != null) && ( accountId.length() > 0) )
        {
            GenericValue employmentGV = delegator.findByPrimaryKey("ContactEmployment", UtilMisc.toMap("contactEmploymentId", contactId + "-E"));
            if ( employmentGV == null )
            {
              employmentGV = new GenericValue( delegator.getModelEntity("ContactEmployment"));
              employmentGV.setDelegator(delegator);
              employmentGV.set("contactEmploymentId", contactId + "-E");
              employmentGV.set("contactId", contactId);
              employmentGV.set("title", leadGV.getString("title"));
              employmentGV.set("companyName", accountName);
              if ( addressGV != null )
              {
                  employmentGV.set("mailingAddress", addressGV.getString("mailingAddress"));
                  employmentGV.set("city", addressGV.getString("city"));
                  employmentGV.set("state", addressGV.getString("state"));
                  employmentGV.set("zip", addressGV.getString("zip"));
              }
             
              employmentGV.create();
            }
        }
      }

      if ( getCreateOpportunity() && hasAccountInfo)
      {     
        DataInfo dataInfo = (DataInfo) dataMatrixMap.get("OPPORTUNITIES.OpportunityHeader");
        GenericEventProcessor eventProcessor = new OpportunityEventProcessor();
        DataMatrix dataMatrix = dataInfo.loadData(userInfo, eventProcessor);
        GenericValue dealGV = dataMatrix.getCurrentBuffer().getGenericValue(0, "Deal", false);
        dealGV.set("accountId", accountId);
       
        if ( opportunityName != null)
View Full Code Here

TOP

Related Classes of com.sourcetap.sfa.event.GenericEventProcessor

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.