Class CatalogServiceImpl
java.lang.Object
org.broadleafcommerce.core.catalog.service.CatalogServiceImpl
- All Implemented Interfaces:
CatalogService
@Service("blCatalogService")
public class CatalogServiceImpl
extends Object
implements CatalogService
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected CategoryDaoprotected CatalogServiceExtensionManagerprotected ProductDaoprotected ProductOptionDaoprotected SkuDao -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncountProductsUsingProductOptionById(Long productOptionId) protected CatalogContextDTOcreateProduct(ProductType productType) findActiveProductsByCategory(Category category) findActiveProductsByCategory(Category category, int limit, int offset) Same asCatalogService.findActiveProductsByCategory(Category)but allowing for pagination.findActiveProductsByCategory(Category category, Date currentDate, int limit, int offset) Deprecated, for removal: This API element is subject to removal in a future version.findActiveSubCategoriesByCategory(Category category) findActiveSubCategoriesByCategory(Category category, int limit, int offset) findAllCategories(int limit, int offset) findAllProducts(int limit, int offset) findAllSkus(int offset, int limit) findAllSubCategories(Category category) findAllSubCategories(Category category, int limit, int offset) Returns a list ofAssignedProductOptionDTOfound for given theProduct.findAssignedProductOptionsByProductId(Long productId) Returns a list ofAssignedProductOptionDTOfound for given the productId.Find all ProductBundles whose automatic attribute is set to true.findCategoriesByName(String categoryName) Retrieve a list ofCategoryinstance based on the name property.findCategoriesByName(String categoryName, int limit, int offset) Retrieve a list ofCategoryinstances based on the search criteriafindCategoryByExternalId(String externalId) findCategoryById(Long categoryId) findCategoryByName(String categoryName) Deprecated, for removal: This API element is subject to removal in a future version.findCategoryByURI(String uri) Returns a category associated with the passed in URI or null if no Category is mapped to this URI.findFilteredActiveProductsByCategory(Category category, Date currentDate, SearchCriteria searchCriteria) Deprecated, for removal: This API element is subject to removal in a future version.findFilteredActiveProductsByCategory(Category category, SearchCriteria searchCriteria) Given a category and a ProudctSearchCriteria, returns the appropriate matching productsfindFilteredActiveProductsByQuery(String query, Date currentDate, SearchCriteria searchCriteria) Deprecated, for removal: This API element is subject to removal in a future version.findFilteredActiveProductsByQuery(String query, SearchCriteria searchCriteria) Given a search query and a SearchCriteria, returns the appropriate matching productsfindProductByExternalId(String externalId) findProductById(Long productId) findProductByURI(String uri) Returns a product associated with the passed in URI or null if no Product is mapped to this URI.findProductIdsUsingProductOptionById(Long productId, int start, int pageSize) Returns a paginated list of Product Ids that are using the passed in ProductOption IDfindProductOptionById(Long productOptionId) findProductOptionValueById(Long productOptionValueId) findProductsByName(String searchName) findProductsByName(String searchName, int limit, int offset) Find a subset ofProductinstances whose name starts with or is equal to the passed in search parameter.findProductsForCategory(Category category) findProductsForCategory(Category category, int limit, int offset) findSkuByExternalId(String externalId) findSkuById(Long skuId) findSkuByUpc(String upc) Method to look up a Sku by the Universal Product Code (UPC).findSkuByURI(String uri) Returns a sku associated with the passed in URI or null if no sku is mapped to this URI.findSkusByIds(List<Long> ids) getChildCategoryURLMapByCategoryId(Long categoryId) Deprecated.voidremoveCategory(Category category) voidremoveProduct(Product product) voidsaveCategory(Category category) saveProduct(Product product) saveProductOption(ProductOption option) saveSkuFee(SkuFee fee) voidsetCategoryDao(CategoryDao categoryDao) voidsetProductDao(ProductDao productDao) voidtranslateItemAttributeValue(OrderItemAttribute itemAttribute, ProductOption productOption) Returns a translated String attribute value for OrderItemAttribute
-
Field Details
-
categoryDao
-
productDao
-
skuDao
-
productOptionDao
-
extensionManager
-
-
Constructor Details
-
CatalogServiceImpl
public CatalogServiceImpl()
-
-
Method Details
-
findProductById
- Specified by:
findProductByIdin interfaceCatalogService
-
findProductByExternalId
- Specified by:
findProductByExternalIdin interfaceCatalogService
-
findProductsByName
- Specified by:
findProductsByNamein interfaceCatalogService
-
findProductsByName
Description copied from interface:CatalogServiceFind a subset ofProductinstances whose name starts with or is equal to the passed in search parameter. Res- Specified by:
findProductsByNamein interfaceCatalogServicelimit- the maximum number of resultsoffset- the starting point in the record set- Returns:
- the list of product instances that fit the search criteria
-
findActiveProductsByCategory
- Specified by:
findActiveProductsByCategoryin interfaceCatalogService
-
findFilteredActiveProductsByCategory
public List<Product> findFilteredActiveProductsByCategory(Category category, SearchCriteria searchCriteria) Description copied from interface:CatalogServiceGiven a category and a ProudctSearchCriteria, returns the appropriate matching products- Specified by:
findFilteredActiveProductsByCategoryin interfaceCatalogService- Returns:
- the matching products
-
findFilteredActiveProductsByQuery
Description copied from interface:CatalogServiceGiven a search query and a SearchCriteria, returns the appropriate matching products- Specified by:
findFilteredActiveProductsByQueryin interfaceCatalogService- Returns:
- the matching products
-
findActiveProductsByCategory
Description copied from interface:CatalogServiceSame asCatalogService.findActiveProductsByCategory(Category)but allowing for pagination.- Specified by:
findActiveProductsByCategoryin interfaceCatalogService- Returns:
-
findFilteredActiveProductsByCategory
@Deprecated(forRemoval=true) public List<Product> findFilteredActiveProductsByCategory(Category category, Date currentDate, SearchCriteria searchCriteria) Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
findFilteredActiveProductsByCategoryin interfaceCatalogService- Returns:
-
findFilteredActiveProductsByQuery
@Deprecated(forRemoval=true) public List<Product> findFilteredActiveProductsByQuery(String query, Date currentDate, SearchCriteria searchCriteria) Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
findFilteredActiveProductsByQueryin interfaceCatalogService
-
findActiveProductsByCategory
@Deprecated(forRemoval=true) public List<Product> findActiveProductsByCategory(Category category, Date currentDate, int limit, int offset) Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
findActiveProductsByCategoryin interfaceCatalogService
-
findAutomaticProductBundles
Description copied from interface:CatalogServiceFind all ProductBundles whose automatic attribute is set to true.Automatic product bundles are collections of products that can receive special pricing. With automatic product bundles, if a customer adds all of the components of the bundle individually to the cart, they will automatically get assembeled into a bundle.
- Specified by:
findAutomaticProductBundlesin interfaceCatalogService- Returns:
-
saveProduct
- Specified by:
saveProductin interfaceCatalogService
-
findCategoryById
- Specified by:
findCategoryByIdin interfaceCatalogService
-
findCategoryByExternalId
- Specified by:
findCategoryByExternalIdin interfaceCatalogService
-
findCategoryByName
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:CatalogServiceRetrieve aCategoryinstance based on its name property.Broadleaf allows more than one category to have the same name. Calling this method could produce an exception in such situations. Use
CatalogService.findCategoriesByName(String)instead.- Specified by:
findCategoryByNamein interfaceCatalogService- Parameters:
categoryName- the category name to search by- Returns:
- the Category instance matching the categoryName
-
findCategoriesByName
Description copied from interface:CatalogServiceRetrieve a list ofCategoryinstance based on the name property.- Specified by:
findCategoriesByNamein interfaceCatalogService- Parameters:
categoryName- the category name to search by- Returns:
- the list of matching Category instances
-
findCategoriesByName
Description copied from interface:CatalogServiceRetrieve a list ofCategoryinstances based on the search criteria- Specified by:
findCategoriesByNamein interfaceCatalogService- Parameters:
categoryName- the name of the category to search bylimit- the maximum number of results to returnoffset- the starting point of the records to return- Returns:
- a list of category instances that match the search criteria
-
saveCategory
- Specified by:
saveCategoryin interfaceCatalogService
-
removeCategory
- Specified by:
removeCategoryin interfaceCatalogService
-
removeSku
- Specified by:
removeSkuin interfaceCatalogService
-
removeProduct
- Specified by:
removeProductin interfaceCatalogService
-
findAllCategories
- Specified by:
findAllCategoriesin interfaceCatalogService
-
findAllCategories
- Specified by:
findAllCategoriesin interfaceCatalogService
-
findTotalCategoryCount
- Specified by:
findTotalCategoryCountin interfaceCatalogService
-
findAllSubCategories
- Specified by:
findAllSubCategoriesin interfaceCatalogService
-
findAllSubCategories
- Specified by:
findAllSubCategoriesin interfaceCatalogService
-
findActiveSubCategoriesByCategory
- Specified by:
findActiveSubCategoriesByCategoryin interfaceCatalogService
-
findActiveSubCategoriesByCategory
- Specified by:
findActiveSubCategoriesByCategoryin interfaceCatalogService
-
findAllProducts
- Specified by:
findAllProductsin interfaceCatalogService
-
findAllProducts
- Specified by:
findAllProductsin interfaceCatalogService
-
findAllSkus
- Specified by:
findAllSkusin interfaceCatalogService
-
findAllSkus
- Specified by:
findAllSkusin interfaceCatalogService
-
findSkuById
- Specified by:
findSkuByIdin interfaceCatalogService
-
findSkuByExternalId
- Specified by:
findSkuByExternalIdin interfaceCatalogService
-
findSkuByUpc
Description copied from interface:CatalogServiceMethod to look up a Sku by the Universal Product Code (UPC).- Specified by:
findSkuByUpcin interfaceCatalogService- Returns:
-
saveSku
- Specified by:
saveSkuin interfaceCatalogService
-
saveSkuFee
- Specified by:
saveSkuFeein interfaceCatalogService
-
findSkusByIds
- Specified by:
findSkusByIdsin interfaceCatalogService
-
setProductDao
-
setSkuDao
-
findProductsForCategory
- Specified by:
findProductsForCategoryin interfaceCatalogService
-
findProductsForCategory
- Specified by:
findProductsForCategoryin interfaceCatalogService
-
setCategoryDao
-
getChildCategoryURLMapByCategoryId
Deprecated.Description copied from interface:CatalogServiceGet a hierarchical map of all child categories keyed on the url- Specified by:
getChildCategoryURLMapByCategoryIdin interfaceCatalogService- Parameters:
categoryId- the parent category to which the children belong- Returns:
- hierarchical map of all child categories
-
createCategory
- Specified by:
createCategoryin interfaceCatalogService
-
createSku
- Specified by:
createSkuin interfaceCatalogService
-
createProduct
- Specified by:
createProductin interfaceCatalogService
-
readAllProductOptions
- Specified by:
readAllProductOptionsin interfaceCatalogService
-
saveProductOption
- Specified by:
saveProductOptionin interfaceCatalogService
-
findProductOptionById
- Specified by:
findProductOptionByIdin interfaceCatalogService
-
findProductOptionValueById
- Specified by:
findProductOptionValueByIdin interfaceCatalogService
-
createCatalogContextDTO
-
findCategoryByURI
Description copied from interface:CatalogServiceReturns a category associated with the passed in URI or null if no Category is mapped to this URI.- Specified by:
findCategoryByURIin interfaceCatalogService- Returns:
-
findOriginalCategoryByURI
- Specified by:
findOriginalCategoryByURIin interfaceCatalogService
-
findProductByURI
Description copied from interface:CatalogServiceReturns a product associated with the passed in URI or null if no Product is mapped to this URI.- Specified by:
findProductByURIin interfaceCatalogService- Returns:
-
findOriginalProductByURI
- Specified by:
findOriginalProductByURIin interfaceCatalogService
-
findSkuByURI
Description copied from interface:CatalogServiceReturns a sku associated with the passed in URI or null if no sku is mapped to this URI.- Specified by:
findSkuByURIin interfaceCatalogService- Returns:
-
findAssignedProductOptionsByProductId
Description copied from interface:CatalogServiceReturns a list ofAssignedProductOptionDTOfound for given the productId.- Specified by:
findAssignedProductOptionsByProductIdin interfaceCatalogService- Returns:
-
findAssignedProductOptionsByProduct
Description copied from interface:CatalogServiceReturns a list ofAssignedProductOptionDTOfound for given theProduct.- Specified by:
findAssignedProductOptionsByProductin interfaceCatalogService- Returns:
-
countProductsUsingProductOptionById
- Specified by:
countProductsUsingProductOptionByIdin interfaceCatalogService
-
findProductIdsUsingProductOptionById
Description copied from interface:CatalogServiceReturns a paginated list of Product Ids that are using the passed in ProductOption ID- Specified by:
findProductIdsUsingProductOptionByIdin interfaceCatalogService- Returns:
-
translateItemAttributeValue
public String translateItemAttributeValue(OrderItemAttribute itemAttribute, ProductOption productOption) Description copied from interface:CatalogServiceReturns a translated String attribute value for OrderItemAttribute- Specified by:
translateItemAttributeValuein interfaceCatalogService- Returns:
-