com.ibm.commerce.marketing.content.resources

Class EMarketingSpotResourceManager

  • java.lang.Object
    • com.ibm.commerce.context.content.resources.AbstractResourceManagerImpl
      • com.ibm.commerce.context.content.resources.AbstractEntityBeanResourceManagerImpl
        • com.ibm.commerce.marketing.content.resources.EMarketingSpotResourceManager
  • All Implemented Interfaces:
    com.ibm.commerce.context.content.resources.postpublish.PostPublishDataProcessor, com.ibm.commerce.context.content.resources.ResourceManager


    public class EMarketingSpotResourceManager
    extends com.ibm.commerce.context.content.resources.AbstractEntityBeanResourceManagerImpl
    This is a manager class for EMarketingSpot resource. This resource manager can be used to create, read, update and delete EMarketingSpot in content managed environment.
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      static java.lang.String COPYRIGHT
      IBM copyright notice field.
      static java.lang.String INVALIDATED_ENTRY_FLAG
      The value in a map to indicate that an entry has been invalidated
      • Fields inherited from class com.ibm.commerce.context.content.resources.AbstractResourceManagerImpl

        CONTENT_CANCEL, CONTENT_DELETE, CONTENT_NEW, CONTENT_PROMOTE, CONTENT_UPDATE, RESOURCE_COMMIT, RESOURCE_DELETE, RESOURCE_NEW, RESOURCE_ROLLBACK, RESOURCE_UPDATE, STRING_CONTENT_DELETE, STRING_CONTENT_NEW, STRING_CONTENT_UPDATE
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      void commit(com.ibm.commerce.context.content.events.ContentData contentData)
      This method commits the changes in the workspace to the base edition.
      com.ibm.commerce.context.content.resources.ManagedResourceKey getManagedResourceKey(java.util.Map boKeyMap)
      Returns the business object key.
      com.ibm.commerce.context.content.resources.ManagedResourceKey getManagedResourceKey(java.lang.Object resource)
      Returns the business object key.
      java.util.Map handleUniqueIndexViolations(com.ibm.commerce.context.content.events.ContentData contentData)
      This method will compare UI conflicts within the EMSPOT table in the workspace and will modify them based on action from configuration.
      static void invalidate(java.sql.Connection productionConnection, java.lang.String baseCacheInvalidationKey, java.lang.String marketingCacheInvalidationKey, java.lang.String dataId)
      This method invalidates cached marketing information.
      static void issueEMarketingSpotNameInvalidations(java.util.Map<java.lang.String,java.lang.String> invalidatedEMarketingSpotEntries, com.ibm.commerce.context.content.events.ContentData contentData, java.sql.Connection authoringConnection, java.sql.Connection productionConnection)
      This method will invalidate individual entries in the base cache related to e-Marketing Spots.
      void issueInvalidations(com.ibm.commerce.context.content.events.ContentData contentData, boolean setupProductionInvalidations)
      This method will invalidate individual entries related to e-Marketing Spot changes made in a workspace.
      static void issueInvalidationsBasedOnMarketingContent(java.util.Map contentEntries, com.ibm.commerce.context.content.events.ContentData contentData, java.sql.Connection authoringConnection, java.sql.Connection productionConnection)
      This method will invalidate individual entries in the base and marketing caches related to content changes made in a workspace.
      java.lang.String postPublish(com.ibm.commerce.context.content.events.ContentData contentData)
      This method will setup invalidations on the production environment for individual entries in the base dynacache and marketing distributed map related to e-Marketing Spot changes made in a workspace.
      void processPostPublishData(java.lang.String postPublishData)
      Process the post-publish data on production server.
      void rollback(com.ibm.commerce.context.content.events.ContentData contentData)
      This method rolls back the workspace by undoing all changes.
      static java.util.List setupInvalidation(java.sql.Connection authoringConnection, java.sql.Connection productionConnection, com.ibm.commerce.context.content.events.ContentData contentData, java.lang.String tableName, java.lang.String primaryKeyColumnName, java.lang.String baseCacheInvalidationKey, java.lang.String marketingCacheInvalidationKey, java.lang.String uniqueIdentifierColumnName, java.lang.String uniqueIdentifierInvalidationKey, java.util.Map invalidatedEntries, java.lang.String customSql)
      This method will query the authoring database to get the changes made in the workspace for the specified table.
      • Methods inherited from class com.ibm.commerce.context.content.resources.AbstractResourceManagerImpl

        createManagedResource, deleteManagedResource, deleteRelatedManagedResources, fetchUniqueIndexViolations, getLockData, getLockData, getManagedResourceData, getManagedResourceDataCount, getMetaData, getResourceContainer, handleForeignKeyViolations, handleUniqueIndexViolations, isLocked, isLocked, lockManagedResource, publish, relockManagedResource, setMetaData, setResourceContainer, synchronize, unlockManagedResource, updateManagedResource
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface com.ibm.commerce.context.content.resources.ResourceManager

        createManagedResource, deleteManagedResource, getLockData, getLockData, getManagedResourceData, getManagedResourceDataCount, getMetaData, getResourceContainer, isLocked, isLocked, lockManagedResource, publish, relockManagedResource, setMetaData, setResourceContainer, synchronize, unlockManagedResource, updateManagedResource
    • Field Detail

      • COPYRIGHT

        public static final java.lang.String COPYRIGHT
        IBM copyright notice field.
        See Also:
        Constant Field Values
      • INVALIDATED_ENTRY_FLAG

        public static final java.lang.String INVALIDATED_ENTRY_FLAG
        The value in a map to indicate that an entry has been invalidated
        See Also:
        Constant Field Values
    • Constructor Detail

      • EMarketingSpotResourceManager

        public EMarketingSpotResourceManager()
    • Method Detail

      • commit

        public void commit(com.ibm.commerce.context.content.events.ContentData contentData)
                    throws com.ibm.commerce.context.content.resources.exception.ResourceException
        This method commits the changes in the workspace to the base edition. This method is overridden for the cases where generated eSpots are done from within the page layout component. If duplicate eSpots for the same page are generated with different primary keys, resolve the committing eSpot id to the one that already exists in the base schema.
        Specified by:
        commit in interface com.ibm.commerce.context.content.resources.ResourceManager
        Overrides:
        commit in class com.ibm.commerce.context.content.resources.AbstractResourceManagerImpl
        Parameters:
        contentData - The content data to commit.
        Throws:
        ResourceUpdateException - This is thrown when there is a problem performing the commit operation. This usually occurs when the commit causes data integrity problems.
        com.ibm.commerce.context.content.resources.exception.ResourceException
        See Also:
        ResourceManager.commit(com.ibm.commerce.context.content.events.ContentData)
      • getManagedResourceKey

        public com.ibm.commerce.context.content.resources.ManagedResourceKey getManagedResourceKey(java.util.Map boKeyMap)
                                                                                            throws java.lang.Exception
        Returns the business object key.
        Parameters:
        boKeyMap - A map that represents the business object.
        Returns:
        Returns a business object key.
        Throws:
        java.lang.Exception - - Problem when resolving the managed resource key.
      • getManagedResourceKey

        public com.ibm.commerce.context.content.resources.ManagedResourceKey getManagedResourceKey(java.lang.Object resource)
                                                                                            throws java.lang.Exception
        Returns the business object key.
        Parameters:
        resource - The business object access bean.
        Returns:
        Returns a business object key.
        Throws:
        java.lang.Exception - - Problem when resolving the managed resource key.
      • handleUniqueIndexViolations

        public java.util.Map handleUniqueIndexViolations(com.ibm.commerce.context.content.events.ContentData contentData)
                                                  throws com.ibm.commerce.context.content.resources.exception.ResourceException
        This method will compare UI conflicts within the EMSPOT table in the workspace and will modify them based on action from configuration. This will also fix any related tables with foreign keys and tables referencing the corrected records of ths resource.
        Overrides:
        handleUniqueIndexViolations in class com.ibm.commerce.context.content.resources.AbstractResourceManagerImpl
        Parameters:
        contentData - The content data of workspace/task group/task to check for UI violations.
        Returns:
        map containing key / value pairs indicating the unique index violations for specified table in the workspace/task group. The 'key' is the base table primary key and the value is the corresponding 'workspace' primary key for a conflicting UI.
        Throws:
        com.ibm.commerce.context.content.resources.exception.ResourceException - This is thrown when there is a problem performing the primary key delete/update operation.
        See Also:
        com.ibm.commerce.context.content.resources.ResourceManager#
      • invalidate

        public static void invalidate(java.sql.Connection productionConnection,
                                      java.lang.String baseCacheInvalidationKey,
                                      java.lang.String marketingCacheInvalidationKey,
                                      java.lang.String dataId)
                               throws java.sql.SQLException
        This method invalidates cached marketing information. If the productionConnection parameter is not null, then a row is inserted in the CACHEIVL database table on the production database. That will allow the cached entry to be invalidated when the DynaCacheInvalidation scheduled job runs on the production database. If the productionConnection parameter is null, then invalidations are issued to the local base dynacache and marketing distributed maps. An invalidation is issued against the base cache when the baseCacheInvalidationKey parameter is specified. The invalidation will have the format baseCacheInvalidationKey:dataId when dataId is specified, otherwise the invalidation will be baseCacheInvalidationKey. An invalidation is issued against the marketing cache when the marketingCacheInvalidationKey parameter is specified. The invalidation will have the format marketingCacheInvalidationKey:dataId when dataId is specified, otherwise the invalidation will be marketingCacheInvalidationKey.
        Parameters:
        productionConnection - The connection to the production database. Provide a value to create entries in the production environment CACHEIVL database table. Set to null to issue invalidations in the authoring environment.
        baseCacheInvalidationKey - The text to use for invalidation against the base cache.
        marketingCacheInvalidationKey - The text to use for invalidation against the marketing cache.
        dataId - The ID of the object for which to issue the invalidation.
        Throws:
        java.sql.SQLException
      • issueEMarketingSpotNameInvalidations

        public static void issueEMarketingSpotNameInvalidations(java.util.Map<java.lang.String,java.lang.String> invalidatedEMarketingSpotEntries,
                                                                com.ibm.commerce.context.content.events.ContentData contentData,
                                                                java.sql.Connection authoringConnection,
                                                                java.sql.Connection productionConnection)
                                                         throws com.ibm.commerce.context.content.resources.exception.ResourceException
        This method will invalidate individual entries in the base cache related to e-Marketing Spots. During a workspace commit, invalidations are issued in the authoring environment for for the e-Marketing Spot name (emsName) for the specified e-Marketing Spots. During a quick publish, entries are created in the CACHEIVL table on the production database for the required invalidations. This allows the DynaCacheInvalidation scheduled job to issue the necessary invalidation on the production environment.
        Parameters:
        invalidatedEMarketingSpotEntries - A map where the keys are e-Marketing Spot IDs.
        contentData - The content data.
        authoringConnection - The connection to the authoring database.
        productionConnection - The connection to the production database.
        Throws:
        com.ibm.commerce.context.content.resources.exception.ResourceException - A problem occurs in the invalidation processing.
      • issueInvalidations

        public void issueInvalidations(com.ibm.commerce.context.content.events.ContentData contentData,
                                       boolean setupProductionInvalidations)
                                throws com.ibm.commerce.context.content.resources.exception.ResourceException
        This method will invalidate individual entries related to e-Marketing Spot changes made in a workspace. During a workspace commit, invalidations are issued for e-Marketing Spot changes in the task group in the authoring environment. During a quick publish, entries are created in the CACHEIVL table on the production database. This allows the DynaCacheInvalidation scheduled job to issue the necessary invalidation on the production environment.
        Parameters:
        contentData - The content data.
        setupProductionInvalidations - If this is true, then the CACHEIVL entries will be created on the production database. This is used for a Quick Publish. If this parameter if false, then the local dynacache base cache and distributed map invalidations will be issued.
        Throws:
        com.ibm.commerce.context.content.resources.exception.ResourceException - A problem occurs in the invalidation processing.
      • issueInvalidationsBasedOnMarketingContent

        public static void issueInvalidationsBasedOnMarketingContent(java.util.Map contentEntries,
                                                                     com.ibm.commerce.context.content.events.ContentData contentData,
                                                                     java.sql.Connection authoringConnection,
                                                                     java.sql.Connection productionConnection)
                                                              throws com.ibm.commerce.context.content.resources.exception.ResourceException
        This method will invalidate individual entries in the base and marketing caches related to content changes made in a workspace. During a workspace commit, invalidations are issued in the authoring environment for for the e-Marketing Spot ID (emsId) and the e-Marketing Spot name (emsName) for all e-Marketing Spots scheduled to the activities associated with the content, e-Marketing Spot for which the content is the default content, and e-Marketing Spot for which the content is the default title. During a quick publish, entries are created in the CACHEIVL table on the production database for the required invalidations. This allows the DynaCacheInvalidation scheduled job to issue the necessary invalidation on the production environment.
        Parameters:
        contentEntries - A map where the keys are the collateral IDs associated with the changed content.
        contentData - The content data.
        authoringConnection - The connection to the authoring database.
        productionConnection - The connection to the production database.
        Throws:
        com.ibm.commerce.context.content.resources.exception.ResourceException - A problem occurs in the invalidation processing.
      • postPublish

        public java.lang.String postPublish(com.ibm.commerce.context.content.events.ContentData contentData)
                                     throws com.ibm.commerce.context.content.resources.exception.ResourceException
        This method will setup invalidations on the production environment for individual entries in the base dynacache and marketing distributed map related to e-Marketing Spot changes made in a workspace. From the authoring environment, invalidations are determined for e-Marketing Spot changes in the task group. For these required invalidations, entries are created in the CACHEIVL table on the production database. This allows the DynaCacheInvalidation scheduled job to issue the necessary invalidation on the production environment.
        Specified by:
        postPublish in interface com.ibm.commerce.context.content.resources.ResourceManager
        Overrides:
        postPublish in class com.ibm.commerce.context.content.resources.AbstractResourceManagerImpl
        Parameters:
        contentData - The content data.
        Returns:
        This method returns null. It does not use the common base event infrastructure to issue invalidations. Instead it uses the CACHEIVL table.
        Throws:
        com.ibm.commerce.context.content.resources.exception.ResourceException - A problem occurs in the post-publish event processing.
      • processPostPublishData

        public void processPostPublishData(java.lang.String postPublishData)
                                    throws com.ibm.commerce.exception.ECException
        Process the post-publish data on production server.
        Specified by:
        processPostPublishData in interface com.ibm.commerce.context.content.resources.postpublish.PostPublishDataProcessor
        Overrides:
        processPostPublishData in class com.ibm.commerce.context.content.resources.AbstractResourceManagerImpl
        Parameters:
        postPublishData - the post-publish data to be processed.
        Throws:
        com.ibm.commerce.exception.ECException - an exception may be thrown when processing the data.
      • rollback

        public void rollback(com.ibm.commerce.context.content.events.ContentData contentData)
                      throws com.ibm.commerce.context.content.resources.exception.ResourceException
        This method rolls back the workspace by undoing all changes. However before that, it calls the method issueInvalidations to issue invalidations to the base dynacache (if enabled) and the marketing distributed map in the authoring environment.
        Specified by:
        rollback in interface com.ibm.commerce.context.content.resources.ResourceManager
        Overrides:
        rollback in class com.ibm.commerce.context.content.resources.AbstractResourceManagerImpl
        Parameters:
        contentData - The content data to commit.
        Throws:
        com.ibm.commerce.context.content.resources.exception.ResourceException - This is thrown when there is a problem performing the rollback.
        See Also:
        ResourceManager.rollback(com.ibm.commerce.context.content.events.ContentData)
      • setupInvalidation

        public static java.util.List setupInvalidation(java.sql.Connection authoringConnection,
                                                       java.sql.Connection productionConnection,
                                                       com.ibm.commerce.context.content.events.ContentData contentData,
                                                       java.lang.String tableName,
                                                       java.lang.String primaryKeyColumnName,
                                                       java.lang.String baseCacheInvalidationKey,
                                                       java.lang.String marketingCacheInvalidationKey,
                                                       java.lang.String uniqueIdentifierColumnName,
                                                       java.lang.String uniqueIdentifierInvalidationKey,
                                                       java.util.Map invalidatedEntries,
                                                       java.lang.String customSql)
                                                throws java.sql.SQLException
        This method will query the authoring database to get the changes made in the workspace for the specified table. Invalidations will be set up on the production database for these changes, and invalidations will be issued in the local authoring environment.
        Parameters:
        authoringConnection - The connection to the authoring database.
        productionConnection - The connection to the production database.
        contentData - The content data.
        tableName - The name of the database table for which to get workspace changes.
        primaryKeyColumnName - The column associated with the primary key of the database table.
        baseCacheInvalidationKey - The text to use for invalidation against the base cache.
        marketingCacheInvalidationKey - The text to use for invalidation against the marketing cache.
        uniqueIdentifierColumnName - The column name associated with the unique identifier of the database table. This is an optional field. This is used by e-Marketing Spots which issue invalidations based on the e-Marketing Spot name when an e-Marketing Spot is created. Invalidations for updates and deletions use the e-Marketing Spot ID.
        uniqueIdentifierInvalidationKey - The text to use for invalidation against the base cache when an e-Marketing is created. This is an optional field and should only be specified when uniqueIdentifierColumnName is specified.
        invalidatedEntries - This is a map of the unique IDs of entries that have already been determined that require invalidation.
        customSql - An alternative to passing a single tableName and primaryKeyColumnName, a custom SQL can be provided to query the modified resources.
        Returns:
        This method returns a list of strings which contain the IDs of the objects that were changed in the workspace.
        Throws:
        java.sql.SQLException