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

Class SyncProductSetForCategoryHelper



  • public class SyncProductSetForCategoryHelper
    extends SyncProductSetHelper
    This utility class is used to synchronize the affected product sets when a catalog group to catalog group relationship is created/changed/deleted in the master catalog.
    • For each catalog group being reparented, the caller needs to call addParentCategory to add the pair of source/target parent category of the category being reparented. When the caller is ready to synchronize the product sets, method syncProductSet can be called to synchronize the product sets.
    • When a category is deleted, the method deleteProductSetPolicy can be called the delete the product set business policies defined for this given category.
    • Constructor Detail

      • SyncProductSetForCategoryHelper

        public SyncProductSetForCategoryHelper()
        The default constructor of the class.
    • Method Detail

      • addParentCategory

        public void addParentCategory(java.lang.Long anCatalogId,
                                      java.lang.Long anCategoryId,
                                      java.lang.Long anTargetParentCategoryId)
                               throws DataMediatorException,
                                      CatalogApplicationException
        This adds the pair of source/target parent category of the category being reparented.
        Parameters:
        anCatalogId - The catalog id of the category being reparent.
        anCategoryId - The category id of the category being reparent.
        anTargetParentCategoryId - The new or target parent category of the category being reparent.
        Throws:
        DataMediatorException - If an exception occurs while updating the data.
        CatalogApplicationException
      • getUncommonParentCatGroups

        public static final java.util.Vector getUncommonParentCatGroups(java.util.Vector vecSourceParentGroup,
                                                                        java.util.Vector vecTargetParentGroup)
        Finds the parent groups in vecSourceParentGroup which is not common in the target parent groups vecTargetParentGroup. This will be sourceParentGroup - (intersection of sourceParentGroup and targetParentGroup). e.g(p1,p2,p4,p5) and (p1,p2,p3,p6) => (p4, p5)
        Parameters:
        vecSourceParentGroup - the source parent groups.
        vecTargetParentGroup - the target parent groups.
        Returns:
        the parent groups in the vecSourceParentGroup which is not common in the target parent groups.
      • deleteProductSetPolicy

        public void deleteProductSetPolicy(java.lang.Long anCatalogId,
                                           java.lang.Long anCatGroupId)
                                    throws DataMediatorException
        Delete the product set policy related to the given catalog and catalog group.
        Parameters:
        anCatalogId - The catalog id.
        anCatGroupId - The catalog group id.
        Throws:
        DataMediatorException - If an exception occurs while deleting the data.