Class DefaultMerchCatalogService

    • Constructor Detail

      • DefaultMerchCatalogService

        public DefaultMerchCatalogService()
    • Method Detail

      • getCategories

        public java.util.List<CategoryHierarchy> getCategories​(java.lang.String baseSite,
                                                               java.lang.String catalogId,
                                                               java.lang.String catalogVersionId,
                                                               java.lang.String baseCatalogPageUrl)
        getCategories is a method for retrieving the category hierarchy (including subcategories).
        Specified by:
        getCategories in interface MerchCatalogService
        Parameters:
        baseSite - the base site we wish to retrieve the category hierarchy for.
        catalogId - the catalog we wish to retrieve the category hierarchy from.
        catalogVersionId - the catalog version we wish to retrieve the category hierarchy for.
        Returns:
        a List of CategoryHierarchy representing the categories.
      • createSearchQuery

        protected SearchQuery createSearchQuery​(IndexerBatchContext indexerBatchContext,
                                                MerchProductDirectoryConfigModel productDirectory)
        Method is used to generate an instance of SearchQuery to query Solr to retrieve updated product information.
        Parameters:
        indexerBatchContext - represents a context valid for the duration of an indexer batch.
        productDirectory - - this is the product directory we wish to export products for.
        Returns:
        SearchQuery
      • createIndexedPropertiesMapping

        protected java.util.Map<java.lang.String,​IndexedPropertyInfo> createIndexedPropertiesMapping​(IndexerBatchContext batchContext,
                                                                                                           SearchQuery searchQuery)
        Method used to retrieve a map of configured key value pairs for handling mapping between Solr internal data model
        Parameters:
        batchContext - indexerBatchContext represents a context valid for the duration of an indexer batch.
        searchQuery -
        Returns:
      • isToSynchronize

        protected boolean isToSynchronize​(java.util.List<CatalogVersionModel> catalogVersionsToExport,
                                          InputDocument document)
        Method to determine whether a given document is for the Online or Staging catalog.
        Parameters:
        catalogVersionsToExport -
        document -
        Returns:
      • createIndexedPropertyInfo

        protected IndexedPropertyInfo createIndexedPropertyInfo​(SearchQuery searchQuery,
                                                                IndexedProperty indexedProperty)
        Helper method to populate IndexedPropertyInfo based on configured under
        Parameters:
        searchQuery -
        indexedProperty -
        Returns:
      • getTranslatedFieldName

        protected java.lang.String getTranslatedFieldName​(SearchQuery searchQuery,
                                                          IndexedProperty indexedProperty)
      • createMerchFacetPropertiesMapping

        protected java.util.Map<java.lang.String,​FacetField> createMerchFacetPropertiesMapping​(IndexerBatchContext batchContext,
                                                                                                     SearchQuery searchQuery)
                                                                                              throws IndexerException
        createMerchFacetPropertiesMapping is a method for mapping facets to output for consumption by Merchandising.
        Parameters:
        batchContext -
        searchQuery -
        Returns:
        Throws:
        IndexerException
      • createMerchPropertiesMapping

        protected java.util.Map<java.lang.String,​java.lang.String> createMerchPropertiesMapping​(java.util.List<MerchPropertyModel> merchProperties,
                                                                                                      java.util.Map<java.lang.String,​IndexedPropertyInfo> indexedPropertiesMapping)
        createMerchPropertiesMapping is a method for mapping from the configured list of MerchPropertyModel to the indexed properties within Solr.
        Parameters:
        merchProperties -
        indexedPropertiesMapping -
        Returns:
      • processSubCategories

        protected void processSubCategories​(CategoryHierarchy toPopulate,
                                            CategoryModel category,
                                            boolean root,
                                            java.lang.String categoryUrl)
        processSubCategories is a method for taking a category model and recursively processing its sub categories.
        Parameters:
        toPopulate - the CategoryHierarchy we wish to populate.
        category - the CategoryModel representing the hierarchy.
        root - whether the category is a root category or not.
        categoryUrl - the URL to prefix the category with.
      • createActionForIndexOperation

        protected java.lang.String createActionForIndexOperation​(IndexOperation indexOperation)
        createActionForIndexOperation is a method for retrieving the action to use when sending to Merchandising for a given IndexOperation.
        Parameters:
        indexOperation - the operation to retrieve the value for.
        Returns:
        the action to use.
      • getUrl

        protected java.lang.String getUrl​(CategoryModel category,
                                          java.lang.String baseCategoryUrl)
        getUrl resolves the URL for a provided CategoryModel.
        Parameters:
        category - the category model to retrieve the URL for.
        Returns:
        a String containing the URL.
      • getBaseSiteService

        protected BaseSiteService getBaseSiteService()
        Gets the configured BaseSiteService, used to set the current site for the request.
        Returns:
        the injected base site service to use.
      • setBaseSiteService

        public void setBaseSiteService​(BaseSiteService baseSiteService)
        Sets the configured BaseSiteService, used to set the current site for the request.
        Parameters:
        baseSiteService - the injected base site service to use.
      • setCategoryUrlResolver

        public void setCategoryUrlResolver​(AbstractUrlResolver<CategoryModel> categoryUrlResolver)
        Sets the configured URL resolver for CategoryModel.
        Parameters:
        categoryUrlResolver - the resolver to return.
      • setFacetSearchService

        public void setFacetSearchService​(FacetSearchService facetSearchService)
      • setSearchQueryLanguageResolver

        public void setSearchQueryLanguageResolver​(SearchQueryLanguageResolver searchQueryLanguageResolver)
      • setSearchQueryCurrencyResolver

        public void setSearchQueryCurrencyResolver​(SearchQueryCurrencyResolver searchQueryCurrencyResolver)
      • setFieldNameTranslator

        public void setFieldNameTranslator​(FieldNameTranslator fieldNameTranslator)