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

Class RuleBasedCategoryHelper



  • public class RuleBasedCategoryHelper
    extends CatalogGroupLinkHelper

    This class will provide helpers to save the child catalog entries for a rule based category.

    • Field Detail

      • COPYRIGHT

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

        public static final java.lang.String SYNC_TYPE_DELTA
        A flag indicating that the rule based category evaluation should perform a delta replacement when determining category children.
        See Also:
        Constant Field Values
      • SYNC_TYPE_REFRESH

        public static final java.lang.String SYNC_TYPE_REFRESH
        A flag indicating that the rule based category evaluation should perform a full replacement when determining category children.
        See Also:
        Constant Field Values
      • EVALDATE_TIMESTAMP_FORMAT

        public static final java.lang.String EVALDATE_TIMESTAMP_FORMAT
        The date format to use for EVALTIME.
        See Also:
        Constant Field Values
    • Constructor Detail

      • RuleBasedCategoryHelper

        public RuleBasedCategoryHelper()
    • Method Detail

      • determineRuleBasedCategoryChildren

        public static void determineRuleBasedCategoryChildren(java.lang.String workspaceId,
                                                              java.lang.String taskGroupId,
                                                              java.lang.String taskId,
                                                              java.util.List<java.lang.String> categoryIdList,
                                                              java.lang.String catalogId,
                                                              java.lang.String storeId)
                                                       throws java.lang.Exception

        This method will determine and populate the child catalog entries for a rule based category.

        Parameters:
        workspaceId - The workspace internal identifier.
        taskGroupId - The task group internal identifier.
        taskId - The task internal identifier.
        categoryIdList - The list of category internal identifiers to process. If NULL, all rule based categories will be processed.
        catalogId - The catalog internal identifier.
        storeId - The store internal identifier.
        Throws:
        java.lang.Exception - Error thrown during processing.
      • createCGCERelationships

        public void createCGCERelationships(java.lang.String storeId,
                                            java.lang.String catGroupId,
                                            java.lang.String catEntryId,
                                            java.lang.String catalogId,
                                            java.lang.String sequence)
                                     throws java.lang.Exception
        Create catalog group to catalog entry relationship (catgpenrel) for a catalog entry. By default, it will not add any product-SKUs or PDK children into the category.

        Parameters:
        storeId - Store ID
        catGroupId - Catalog group ID.
        catEntryId - Catalog Entry ID.
        catalogId - Source catalog ID.
        sequence - Display sequence of catalog entry in parent catalog group.
        Throws:
        java.lang.Exception - Error thrown during processing by data services.
      • createCGCERelationships

        public void createCGCERelationships(java.lang.String storeId,
                                            java.lang.String catGroupId,
                                            java.lang.String catEntryId,
                                            java.lang.String catalogId,
                                            java.lang.String sequence,
                                            boolean includeSKUs)
                                     throws java.lang.Exception
        Create catalog group to catalog entry relationship (catgpenrel) for a catalog entry. If the catalog entry is a product, it will also add the child SKUs to the category.

        Parameters:
        storeId - Store ID
        catGroupId - Catalog group ID.
        catEntryId - Catalog Entry ID.
        catalogId - Source catalog ID.
        sequence - Display sequence of catalog entry in parent catalog group.
        includeSKUs - If true, then the SKUS for products are included into the sales category.
        Throws:
        java.lang.Exception - Error thrown during processing by data services.
      • removeCGCEForProductAndSKUs

        public void removeCGCEForProductAndSKUs(java.lang.String storeId,
                                                java.lang.String catGroupId,
                                                java.lang.String catEntryId,
                                                java.lang.String catalogId)
                                         throws java.lang.Exception
        Removes Catalog group to catalog entry relations for a list of links. If the catalog entry is a product, the relationship to child items will also be removed.
        Parameters:
        storeId - The store for the sales catalog/category.
        catGroupId - The parent catalog group ID.
        catEntryId - A catalog entry ID.
        catalogId - The catalog ID to add relationship within.
        Throws:
        java.lang.Exception - Error detected by data service during processing
      • removeCGCEForProductAndSKUsList

        public void removeCGCEForProductAndSKUsList(java.lang.String storeId,
                                                    java.lang.String catGroupId,
                                                    java.util.List<java.lang.String> catEntryIdList,
                                                    java.lang.String catalogId)
                                             throws java.lang.Exception
        Removes Catalog group to catalog entry relations for a list of links. If catalog entries are a product, the relationship to children items will also be removed.
        Parameters:
        storeId - The store for the sales catalog/category.
        catGroupId - The parent catalog group ID.
        catEntryIdList - A list of catalog entry IDs.
        catalogId - The catalog ID to add relationship within.
        Throws:
        java.lang.Exception - Error detected by data service during processing
      • updateCGCERelationships

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

        Parameters:
        storeId - The store for the sales catalog/category.
        catGroupId - The parent catalog group ID.
        catEntryId - The child catalog entry ID.
        catalogId - The catalog ID.
        sequence - Display sequence.
        Throws:
        java.lang.Exception
      • raiseSOLREvent

        public void raiseSOLREvent(java.lang.String storeId,
                                   java.lang.String catEntryId)
                            throws java.lang.Exception
        Create CGCE relationship objects to a catalog entry and child SKUs for a product.

        Parameters:
        storeId - The store for the sales catalog/category.
        catEntryId - The child catalog entry ID.
        Throws:
        java.lang.Exception - Exception thrown during processing.
      • isEvaluating

        public boolean isEvaluating(java.lang.String categoryId)
                             throws java.lang.Exception

        This method will return true if the category is currently being evaluated, or false otherwise.

        Parameters:
        categoryId - The category ID.
        Returns:
        Return true if the category is currently being evaluated, or false otherwise.
        Throws:
        java.lang.Exception - An error will be thrown if there was a problem selecting the column.
      • setEvaluating

        public void setEvaluating(int evaluating,
                                  java.lang.String categoryId)
                           throws java.lang.Exception

        This method will set the evaluating column in the catgrprule table for this category.

        Parameters:
        evaluating - The value to set for the column 'EVALUATING' in the table CATGRPRULE.
        categoryId - The category ID.
        Throws:
        java.lang.Exception - An error will be thrown if there was a problem updating the column.
      • finishEvaluating

        public void finishEvaluating(java.lang.String categoryId)
                              throws java.lang.Exception

        This method will set evaluating to 0 and the evaltime column in the catgrprule table for this category.

        Parameters:
        categoryId - The category ID.
        Throws:
        java.lang.Exception - An error will be thrown if there was a problem updating the column.
      • setEvaluateAllAndIgnoreTimeInterval

        public void setEvaluateAllAndIgnoreTimeInterval()
                                                 throws java.lang.Exception

        This method will set the evaluating column to '2' for all rule based sales categories.

        Throws:
        java.lang.Exception - An error will be thrown if there was a problem updating the column.