com.ibm.commerce.catalog.facade.server.helpers

Class CatalogGroupLinkHelper

  • java.lang.Object
    • com.ibm.commerce.catalog.facade.server.helpers.CatalogGroupLinkHelper
  • Direct Known Subclasses:
    RuleBasedCategoryHelper


    public class CatalogGroupLinkHelper
    extends java.lang.Object
    A helper utility class to handle links between catalog groups.
    • Constructor Summary

      Constructors 
      Constructor and Description
      CatalogGroupLinkHelper()
      Default constructor for CatalogGroupLinkHelper.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      void addChildCatalogEntry(java.lang.Long catGroupId, java.lang.Long parentCatEntryId, java.lang.Long childId, java.lang.Long catalogId, double sequence)
      Link synchronization when a catalog entry is added as a child to a catalog group.
      void addChildCatalogGroup(java.lang.Long catGroupId, java.lang.Long childId, java.lang.Long catalogId, double sequence)
      Link synchronization when a child catalog group is added to a catalog group.
      void copyCatalogGroup(java.lang.Long srcCatGroupId, java.lang.Long catGroupId, java.lang.Long srcCatalogId, java.lang.Long catalogId, double sequence)
      Performs a deep copy of a catalog group including the hierarchy underneaths it and adds it to a sales catalog.
      void copyCatalogGroup(java.lang.Long srcCatGroupId, java.lang.Long catGroupId, java.lang.Long srcCatalogId, java.lang.Long catalogId, double sequence, boolean preserveCatEntryRelationship)
      Performs a deep copy of a catalog group including the hierarchy underneaths it and adds it to a sales catalog.
      void createCatalogEntry(java.lang.Long catEntryId, java.lang.Long catGroupId, java.lang.Long parentCatEntryId, java.lang.Long catalogId, double sequence)
      Link synchronization processing when creating a catalog entry.
      void createCatalogGroup(java.lang.Long catgroupId, java.lang.Long parentId, java.lang.Long catalogId, double sequence)
      Link synchronization processing when creating a new catalog group.
      void deleteCatalogEntry(java.lang.Long catEntryId, java.lang.Long catalogId)
      Link synchronization processing when a catalog entry is deleted.
      void deleteCatalogGroup(java.lang.Long catGroupId, java.lang.Long catalogId)
      Link synchronization processing when a catalog group is deleted.
      void deleteNonProductCatalogEntry(java.lang.Long catEntryId, java.lang.Long catalogId)
      Link synchronization processing when a catalog entry of type other than a product is deleted.
      static CatalogGroup fetchCatGroupParent(java.lang.Long catGroupId, java.lang.Long catalogId)
      Gets a physical catalog group object with its parents.
      static boolean isAncestor(java.lang.Long catGroupId, java.lang.Long catalogId, long testCatGroupId)
      Check to see if the test catalog group is an ancestor of a catalog group in a catalog.
      void linkCatalogGroup(java.lang.Long toCatGroupId, java.lang.Long fromCatGroupId, java.lang.Long toCatalogId, java.lang.Long fromCatalogId, double sequence)
      Disconnect the link between a source catalog group and a target catalog group or a catalog root.
      void linkCatalogGroup(java.lang.Long toCatGroupId, java.lang.Long fromCatGroupId, java.lang.Long toCatalogId, java.lang.Long fromCatalogId, double sequence, boolean restrictLink)
      Create a link from a catalog group in a sales catalog to another catalog group in another catalog with an option to restrict only 1 link to a catalog group from the same target catalog.
      void linkCatalogGroupSynchronized(java.lang.Long toCatGroupId, java.lang.Long fromCatGroupId, java.lang.Long toCatalogId, java.lang.Long fromCatalogId, double sequence)
      Create a link from a catalog group in a sales catalog to another catalog group in the same or another catalog.
      void removeChildCatalogEntry(java.lang.Long catGroupId, java.lang.Long parentCatEntryId, java.lang.Long childId, java.lang.Long catalogId)
      Link synchronization when a child catalog entry is removed from a catalog group or parent catalog entry.
      void removeChildCatalogGroup(java.lang.Long catGroupId, java.lang.Long childId, java.lang.Long catalogId)
      Link synchronization when a navigation relationship for a child catalog group is removed.
      void unlinkCatalogGroup(java.lang.Long toCatGroupId, java.lang.Long fromCatGroupId, java.lang.Long toCatalogId, java.lang.Long fromCatalogId)
      Disconnect the link between a source catalog group and a target catalog group or a catalog root.
      void unlinkCatalogGroupSynchronized(java.lang.Long toCatGroupId, java.lang.Long fromCatGroupId, java.lang.Long toCatalogId, java.lang.Long fromCatalogId)
      Disconnect the link between a source catalog group and a target catalog group or a catalog root.
      void updateCatalogEntry(java.lang.Long catEntryId, java.lang.Long catGroupId, java.lang.Long parentCatEntryId, java.lang.Long catalogId, double sequence)
      Link synchronization processing when updating parent of a catalog entry.
      void updateCatalogEntryToCatalogGroupRelationship(java.lang.Long catGroupId, java.lang.Long catEntryId, java.lang.Long catalogId, double sequence)
      Link synchronization when the display sequence of a child catalog entry is changed.
      void updateCatalogGroup(java.lang.Long catGroupId, java.lang.Long parentCatGroupId, java.lang.Long catalogId, double sequence)
      Link synchronization processing when updating parent of a catalog group.
      void updateCatalogGroupToCatalogGroupRelationship(java.lang.Long catGroupId, java.lang.Long childId, java.lang.Long catalogId, double sequence)
      Link synchronization when the display sequence of a child catalog group is changed.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • CatalogGroupLinkHelper

        public CatalogGroupLinkHelper()
        Default constructor for CatalogGroupLinkHelper.

    • Method Detail

      • fetchCatGroupParent

        public static CatalogGroup fetchCatGroupParent(java.lang.Long catGroupId,
                                                       java.lang.Long catalogId)
                                                throws DataMediatorException
        Gets a physical catalog group object with its parents.
        Parameters:
        catGroupId - Catalog group ID.
        catalogId - Catalog ID.
        Returns:
        Returns a physical CatalogGroup object.
        Throws:
        DataMediatorException - Exception thrown by data service during the read operation
      • isAncestor

        public static boolean isAncestor(java.lang.Long catGroupId,
                                         java.lang.Long catalogId,
                                         long testCatGroupId)
                                  throws DataMediatorException
        Check to see if the test catalog group is an ancestor of a catalog group in a catalog.

        Parameters:
        catGroupId - ID of a catalog group.
        catalogId - ID of a catalog.
        testCatGroupId - ID of catalog group ID to be checked.
        Returns:
        Returns true of the test catalog group ID is an ancestor of the catalog group.
        Throws:
        DataMediatorException - Error detected during database read operations.
      • linkCatalogGroupSynchronized

        public void linkCatalogGroupSynchronized(java.lang.Long toCatGroupId,
                                                 java.lang.Long fromCatGroupId,
                                                 java.lang.Long toCatalogId,
                                                 java.lang.Long fromCatalogId,
                                                 double sequence)
                                          throws BusinessObjectMediatorException,
                                                 CatalogApplicationException
        Create a link from a catalog group in a sales catalog to another catalog group in the same or another catalog. Linking a catalog group from another catalog group or the root of a catalog allows one to navigate to an existing catalog group and its children created in another catalog. This method is synchronized and is called by ScheduledCatalogGroupLinkCmd.

        Parameters:
        toCatGroupId - The source catalog group ID to link to.
        fromCatGroupId - The target catalog group ID. Will link as a top category if this is NULL.
        toCatalogId - The source catalog ID.
        fromCatalogId - The target catalog ID.
        sequence - Display sequence of catalog group in parent catalog group.
        Throws:
        BusinessObjectMediatorException - Error detected by data service during processing.
        CatalogApplicationException - Application error detected during link operation.
      • unlinkCatalogGroupSynchronized

        public void unlinkCatalogGroupSynchronized(java.lang.Long toCatGroupId,
                                                   java.lang.Long fromCatGroupId,
                                                   java.lang.Long toCatalogId,
                                                   java.lang.Long fromCatalogId)
                                            throws BusinessObjectMediatorException,
                                                   CatalogApplicationException
        Disconnect the link between a source catalog group and a target catalog group or a catalog root.

        This method is synchronized and is called by ScheduledCatalogGroupUnLinkCmd.

        Parameters:
        toCatGroupId - The source catalog group ID.
        fromCatGroupId - The target catalog group ID. The link is a top category link if this is NULL.
        toCatalogId - The source catalog ID.
        fromCatalogId - The target catalog ID.
        Throws:
        BusinessObjectMediatorException - Error detected by data service during unlink operation.
        CatalogApplicationException - Application error detected during unlink operation.
      • linkCatalogGroup

        public void linkCatalogGroup(java.lang.Long toCatGroupId,
                                     java.lang.Long fromCatGroupId,
                                     java.lang.Long toCatalogId,
                                     java.lang.Long fromCatalogId,
                                     double sequence)
                              throws BusinessObjectMediatorException,
                                     CatalogApplicationException
        Disconnect the link between a source catalog group and a target catalog group or a catalog root.

        Parameters:
        toCatGroupId - The source catalog group ID.
        fromCatGroupId - The target catalog group ID. The link is a top category link if this is NULL.
        toCatalogId - The source catalog ID.
        fromCatalogId - The target catalog ID.
        sequence - Display sequence of catalog group in parent catalog group.
        Throws:
        BusinessObjectMediatorException - Error detected by data service during unlink operation.
        CatalogApplicationException - Application error detected during unlink operation.
      • linkCatalogGroup

        public void linkCatalogGroup(java.lang.Long toCatGroupId,
                                     java.lang.Long fromCatGroupId,
                                     java.lang.Long toCatalogId,
                                     java.lang.Long fromCatalogId,
                                     double sequence,
                                     boolean restrictLink)
                              throws BusinessObjectMediatorException,
                                     CatalogApplicationException
        Create a link from a catalog group in a sales catalog to another catalog group in another catalog with an option to restrict only 1 link to a catalog group from the same target catalog.

        Parameters:
        toCatGroupId - The source catalog group ID.
        fromCatGroupId - The target catalog group ID. Will link as a top category if this is NULL.
        toCatalogId - The source catalog ID.
        fromCatalogId - The target catalog ID.
        sequence - Display sequence of catalog group in parent catalog group.
        restrictLink - If true,indicates that link restriction is to be enforced.
        Throws:
        BusinessObjectMediatorException - Error detected during link operation.
        CatalogApplicationException - Application error detected during link operation.
      • unlinkCatalogGroup

        public void unlinkCatalogGroup(java.lang.Long toCatGroupId,
                                       java.lang.Long fromCatGroupId,
                                       java.lang.Long toCatalogId,
                                       java.lang.Long fromCatalogId)
                                throws BusinessObjectMediatorException,
                                       CatalogApplicationException
        Disconnect the link between a source catalog group and a target catalog group or a catalog root.

        Parameters:
        toCatGroupId - The source catalog group ID.
        fromCatGroupId - The target catalog group ID. The link is a top category link if this is NULL.
        toCatalogId - The source catalog ID.
        fromCatalogId - The target catalog ID.
        Throws:
        BusinessObjectMediatorException - Error detected by data service during unlink operation.
        CatalogApplicationException - Application error detected during unlink operation.
      • createCatalogEntry

        public void createCatalogEntry(java.lang.Long catEntryId,
                                       java.lang.Long catGroupId,
                                       java.lang.Long parentCatEntryId,
                                       java.lang.Long catalogId,
                                       double sequence)
                                throws BusinessObjectMediatorException
        Link synchronization processing when creating a catalog entry.

        Parameters:
        catEntryId - ID of Catalog entry.
        catGroupId - ID of parent catalog group.
        parentCatEntryId - ID of parent catalog entry.
        catalogId - ID of catalog where the catalog entry is created in.
        sequence - Display sequence of catalog entry.
        Throws:
        BusinessObjectMediatorException - Error detected by the data service during the link synchronization operation.
      • createCatalogGroup

        public void createCatalogGroup(java.lang.Long catgroupId,
                                       java.lang.Long parentId,
                                       java.lang.Long catalogId,
                                       double sequence)
                                throws BusinessObjectMediatorException
        Link synchronization processing when creating a new catalog group.

        Parameters:
        catgroupId - ID of the catalog group created.
        parentId - Parent catalog group ID, null is this is a top category.
        catalogId - ID of catalog where catalog group is created in.
        sequence - Display sequence of catalog group in parent catalog group.
        Throws:
        BusinessObjectMediatorException - Error detected by the data service during the link synchronization operation.
      • deleteCatalogEntry

        public void deleteCatalogEntry(java.lang.Long catEntryId,
                                       java.lang.Long catalogId)
                                throws BusinessObjectMediatorException
        Link synchronization processing when a catalog entry is deleted.

        Parameters:
        catEntryId - ID of catalog entry to be deleted.
        catalogId - ID of catalog where the catalog group is being updated.
        Throws:
        BusinessObjectMediatorException - Error detected by the data service during the link synchronization operation.
      • deleteNonProductCatalogEntry

        public void deleteNonProductCatalogEntry(java.lang.Long catEntryId,
                                                 java.lang.Long catalogId)
                                          throws BusinessObjectMediatorException
        Link synchronization processing when a catalog entry of type other than a product is deleted.

        Parameters:
        catEntryId - ID of catalog entry to be deleted.
        catalogId - ID of catalog where the catalog group is being updated.
        Throws:
        BusinessObjectMediatorException - Error detected by the data service during the link synchronization operation.
      • deleteCatalogGroup

        public void deleteCatalogGroup(java.lang.Long catGroupId,
                                       java.lang.Long catalogId)
                                throws BusinessObjectMediatorException
        Link synchronization processing when a catalog group is deleted.

        Parameters:
        catGroupId - Catalog group ID.
        catalogId - ID of catalog where the catalog group is being updated.
        Throws:
        BusinessObjectMediatorException - Error detected by the data service during the link synchronization operation.
      • addChildCatalogEntry

        public void addChildCatalogEntry(java.lang.Long catGroupId,
                                         java.lang.Long parentCatEntryId,
                                         java.lang.Long childId,
                                         java.lang.Long catalogId,
                                         double sequence)
                                  throws BusinessObjectMediatorException
        Link synchronization when a catalog entry is added as a child to a catalog group.

        Parameters:
        catGroupId - The parent catalog group ID.
        parentCatEntryId - The parent catalog entry ID.
        childId - The child catalog entry ID.
        catalogId - The catalog ID.
        sequence - Display sequence.
        Throws:
        BusinessObjectMediatorException - Error detected by the data service during the link synchronization operation.
      • addChildCatalogGroup

        public void addChildCatalogGroup(java.lang.Long catGroupId,
                                         java.lang.Long childId,
                                         java.lang.Long catalogId,
                                         double sequence)
                                  throws BusinessObjectMediatorException
        Link synchronization when a child catalog group is added to a catalog group.
        Parameters:
        catGroupId - The parent catalog group ID.
        childId - The child catalog group.
        catalogId - The catalog ID.
        sequence - Display sequence.
        Throws:
        BusinessObjectMediatorException - Error detected by the data service during the link synchronization operation.
      • removeChildCatalogEntry

        public void removeChildCatalogEntry(java.lang.Long catGroupId,
                                            java.lang.Long parentCatEntryId,
                                            java.lang.Long childId,
                                            java.lang.Long catalogId)
                                     throws BusinessObjectMediatorException
        Link synchronization when a child catalog entry is removed from a catalog group or parent catalog entry.

        Parameters:
        catGroupId - The parent catalog group ID.
        parentCatEntryId - Parent catalog entry ID.
        childId - The ID of the catalog entry to be removed.
        catalogId - The catalog ID.
        Throws:
        BusinessObjectMediatorException - Error detected by the data service during the link synchronization operation.
      • updateCatalogGroupToCatalogGroupRelationship

        public void updateCatalogGroupToCatalogGroupRelationship(java.lang.Long catGroupId,
                                                                 java.lang.Long childId,
                                                                 java.lang.Long catalogId,
                                                                 double sequence)
                                                          throws BusinessObjectMediatorException
        Link synchronization when the display sequence of a child catalog group is changed.

        Parameters:
        catGroupId - The parent catalog group ID.
        childId - The child catalog group ID.
        catalogId - The catalog ID.
        sequence - Display sequence.
        Throws:
        BusinessObjectMediatorException - Error detected by data service during processing.
      • updateCatalogEntryToCatalogGroupRelationship

        public void updateCatalogEntryToCatalogGroupRelationship(java.lang.Long catGroupId,
                                                                 java.lang.Long catEntryId,
                                                                 java.lang.Long catalogId,
                                                                 double sequence)
                                                          throws java.lang.Exception
        Link synchronization when the display sequence of a child catalog entry is changed.

        Parameters:
        catGroupId - The parent catalog group ID.
        catEntryId - The child catalog entry ID.
        catalogId - The catalog ID.
        sequence - Display sequence.
        Throws:
        java.lang.Exception
      • removeChildCatalogGroup

        public void removeChildCatalogGroup(java.lang.Long catGroupId,
                                            java.lang.Long childId,
                                            java.lang.Long catalogId)
                                     throws BusinessObjectMediatorException
        Link synchronization when a navigation relationship for a child catalog group is removed.

        Parameters:
        catGroupId - The parent catalog group ID.
        childId - The child catalog group.
        catalogId - The catalog ID.
        Throws:
        BusinessObjectMediatorException - Error detected by data service during processing.
      • updateCatalogEntry

        public void updateCatalogEntry(java.lang.Long catEntryId,
                                       java.lang.Long catGroupId,
                                       java.lang.Long parentCatEntryId,
                                       java.lang.Long catalogId,
                                       double sequence)
                                throws BusinessObjectMediatorException
        Link synchronization processing when updating parent of a catalog entry.

        Parameters:
        catEntryId - ID of catalog entry.
        catGroupId - ID of catalog group.
        parentCatEntryId - ID of catalog entry.
        catalogId - ID of catalog where the catalog entry is created in.
        sequence - Display sequence of catalog entry in parent catalog group.
        Throws:
        BusinessObjectMediatorException - Error detected by data service during processing.
      • updateCatalogGroup

        public void updateCatalogGroup(java.lang.Long catGroupId,
                                       java.lang.Long parentCatGroupId,
                                       java.lang.Long catalogId,
                                       double sequence)
                                throws BusinessObjectMediatorException
        Link synchronization processing when updating parent of a catalog group. If parentCatGroupId is an existing parent, then no need to reparentCatalogGroup.

        Parameters:
        catGroupId - Catalog group ID.
        parentCatGroupId - Parent catalog group ID, null if this is a top category.
        catalogId - ID of catalog where the catalog group is being updated.
        sequence - Display sequence of catalog group in parent catalog group.
        Throws:
        BusinessObjectMediatorException - Error detected by data service during processing.
      • copyCatalogGroup

        public void copyCatalogGroup(java.lang.Long srcCatGroupId,
                                     java.lang.Long catGroupId,
                                     java.lang.Long srcCatalogId,
                                     java.lang.Long catalogId,
                                     double sequence,
                                     boolean preserveCatEntryRelationship)
                              throws BusinessObjectMediatorException,
                                     CatalogApplicationException
        Performs a deep copy of a catalog group including the hierarchy underneaths it and adds it to a sales catalog. The catalog group to catalog entry relationships will not be copied.

        Parameters:
        srcCatGroupId - source catalog group ID of the catalog group to copy.
        catGroupId - Catalog group ID of the target catalog group. Null for top category.
        srcCatalogId - Source catalog ID.
        catalogId - Target catalog ID.
        sequence - Display sequence of the copied catalog group.
        preserveCatEntryRelationship - Preserve relationship to catalog entry if set to true.
        Throws:
        BusinessObjectMediatorException - Error detected by the data service during the copy operation
        CatalogApplicationException - Application error detected during the copy operation
      • copyCatalogGroup

        public void copyCatalogGroup(java.lang.Long srcCatGroupId,
                                     java.lang.Long catGroupId,
                                     java.lang.Long srcCatalogId,
                                     java.lang.Long catalogId,
                                     double sequence)
                              throws BusinessObjectMediatorException,
                                     CatalogApplicationException
        Performs a deep copy of a catalog group including the hierarchy underneaths it and adds it to a sales catalog. The catalog group to catalog entry relationships will be preserved.

        Parameters:
        srcCatGroupId - source catalog group ID of the catalog group to copy.
        catGroupId - Catalog group ID of the target catalog group. Null for top category.
        srcCatalogId - Source catalog ID.
        catalogId - Target catalog ID.
        sequence - Display sequence of the copied catalog group.
        Throws:
        BusinessObjectMediatorException - Error detected by the data service during the copy operation.
        CatalogApplicationException - Application error detected during copy operation.