org.broadleafcommerce.core.catalog.service
Class CatalogServiceImpl
java.lang.Object
org.broadleafcommerce.core.catalog.service.CatalogServiceImpl
- All Implemented Interfaces:
- CatalogService
@Service(value="blCatalogService")
public class CatalogServiceImpl
- extends Object
- implements CatalogService
|
Method Summary |
Category |
createCategory()
|
Product |
createProduct(ProductType productType)
|
Sku |
createSku()
|
List<Product> |
findActiveProductsByCategory(Category category)
|
List<Product> |
findActiveProductsByCategory(Category category,
Date currentDate)
Deprecated. |
List<Product> |
findActiveProductsByCategory(Category category,
Date currentDate,
int limit,
int offset)
Deprecated. |
List<Product> |
findActiveProductsByCategory(Category category,
int limit,
int offset)
Same as CatalogService.findActiveProductsByCategory(Category) but allowing for pagination. |
List<Category> |
findActiveSubCategoriesByCategory(Category category)
|
List<Category> |
findActiveSubCategoriesByCategory(Category category,
int limit,
int offset)
|
List<Category> |
findAllCategories()
|
List<Category> |
findAllCategories(int limit,
int offset)
|
List<Category> |
findAllParentCategories()
|
List<Product> |
findAllProducts()
|
List<Product> |
findAllProducts(int limit,
int offset)
|
List<Sku> |
findAllSkus()
|
List<Category> |
findAllSubCategories(Category category)
|
List<Category> |
findAllSubCategories(Category category,
int limit,
int offset)
|
List<ProductBundle> |
findAutomaticProductBundles()
Find all ProductBundles whose automatic attribute is set to true. |
List<Category> |
findCategoriesByName(String categoryName)
Retrieve a list of Category instance based on the name
property. |
List<Category> |
findCategoriesByName(String categoryName,
int limit,
int offset)
Retrieve a list of Category instances based on the search criteria |
Category |
findCategoryById(Long categoryId)
|
Category |
findCategoryByName(String categoryName)
Deprecated. |
Category |
findCategoryByURI(String uri)
Returns a category associated with the passed in URI or null if no Category is
mapped to this URI. |
List<Product> |
findFilteredActiveProductsByCategory(Category category,
Date currentDate,
ProductSearchCriteria searchCriteria)
Deprecated. |
List<Product> |
findFilteredActiveProductsByCategory(Category category,
ProductSearchCriteria searchCriteria)
Given a category and a ProudctSearchCriteria, returns the appropriate matching products |
List<Product> |
findFilteredActiveProductsByQuery(String query,
Date currentDate,
ProductSearchCriteria searchCriteria)
Deprecated. |
List<Product> |
findFilteredActiveProductsByQuery(String query,
ProductSearchCriteria searchCriteria)
Given a search query and a ProductSearchCriteria, returns the appropriate matching products |
Product |
findProductById(Long productId)
|
Product |
findProductByURI(String uri)
Returns a product associated with the passed in URI or null if no Product is
mapped to this URI. |
ProductOption |
findProductOptionById(Long productOptionId)
|
ProductOptionValue |
findProductOptionValueById(Long productOptionValueId)
|
List<Product> |
findProductsByName(String searchName)
|
List<Product> |
findProductsByName(String searchName,
int limit,
int offset)
Find a subset of Product instances whose name starts with
or is equal to the passed in search parameter. |
List<Product> |
findProductsForCategory(Category category)
|
List<Product> |
findProductsForCategory(Category category,
int limit,
int offset)
|
Sku |
findSkuById(Long skuId)
|
List<Sku> |
findSkusByIds(List<Long> ids)
|
Map<String,List<Long>> |
getChildCategoryURLMapByCategoryId(Long categoryId)
Deprecated. |
List<ProductOption> |
readAllProductOptions()
|
void |
removeCategory(Category category)
|
Category |
saveCategory(Category category)
|
Product |
saveProduct(Product product)
|
ProductOption |
saveProductOption(ProductOption option)
|
Sku |
saveSku(Sku sku)
|
SkuFee |
saveSkuFee(SkuFee fee)
|
void |
setCategoryDao(CategoryDao categoryDao)
|
void |
setProductDao(ProductDao productDao)
|
void |
setSkuDao(SkuDao skuDao)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
categoryDao
protected CategoryDao categoryDao
productDao
protected ProductDao productDao
skuDao
protected SkuDao skuDao
productOptionDao
protected ProductOptionDao productOptionDao
CatalogServiceImpl
public CatalogServiceImpl()
findProductById
public Product findProductById(Long productId)
- Specified by:
findProductById in interface CatalogService
findProductsByName
public List<Product> findProductsByName(String searchName)
- Specified by:
findProductsByName in interface CatalogService
findProductsByName
public List<Product> findProductsByName(String searchName,
int limit,
int offset)
- Description copied from interface:
CatalogService
- Find a subset of
Product instances whose name starts with
or is equal to the passed in search parameter. Res
- Specified by:
findProductsByName in interface CatalogService
limit - the maximum number of resultsoffset - the starting point in the record set
- Returns:
- the list of product instances that fit the search criteria
findActiveProductsByCategory
public List<Product> findActiveProductsByCategory(Category category)
- Specified by:
findActiveProductsByCategory in interface CatalogService
findFilteredActiveProductsByCategory
public List<Product> findFilteredActiveProductsByCategory(Category category,
ProductSearchCriteria searchCriteria)
- Description copied from interface:
CatalogService
- Given a category and a ProudctSearchCriteria, returns the appropriate matching products
- Specified by:
findFilteredActiveProductsByCategory in interface CatalogService
- Returns:
- the matching products
findFilteredActiveProductsByQuery
public List<Product> findFilteredActiveProductsByQuery(String query,
ProductSearchCriteria searchCriteria)
- Description copied from interface:
CatalogService
- Given a search query and a ProductSearchCriteria, returns the appropriate matching products
- Specified by:
findFilteredActiveProductsByQuery in interface CatalogService
- Returns:
- the matching products
findActiveProductsByCategory
public List<Product> findActiveProductsByCategory(Category category,
int limit,
int offset)
- Description copied from interface:
CatalogService
- Same as
CatalogService.findActiveProductsByCategory(Category) but allowing for pagination.
- Specified by:
findActiveProductsByCategory in interface CatalogService
- Returns:
findActiveProductsByCategory
@Deprecated
public List<Product> findActiveProductsByCategory(Category category,
Date currentDate)
- Deprecated.
- Specified by:
findActiveProductsByCategory in interface CatalogService
- Returns:
findFilteredActiveProductsByCategory
@Deprecated
public List<Product> findFilteredActiveProductsByCategory(Category category,
Date currentDate,
ProductSearchCriteria searchCriteria)
- Deprecated.
- Specified by:
findFilteredActiveProductsByCategory in interface CatalogService
- Returns:
findFilteredActiveProductsByQuery
@Deprecated
public List<Product> findFilteredActiveProductsByQuery(String query,
Date currentDate,
ProductSearchCriteria searchCriteria)
- Deprecated.
- Specified by:
findFilteredActiveProductsByQuery in interface CatalogService
findActiveProductsByCategory
@Deprecated
public List<Product> findActiveProductsByCategory(Category category,
Date currentDate,
int limit,
int offset)
- Deprecated.
- Specified by:
findActiveProductsByCategory in interface CatalogService
findAutomaticProductBundles
public List<ProductBundle> findAutomaticProductBundles()
- Description copied from interface:
CatalogService
- Find 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:
findAutomaticProductBundles in interface CatalogService
- Returns:
saveProduct
@Transactional(value="blTransactionManager")
public Product saveProduct(Product product)
- Specified by:
saveProduct in interface CatalogService
findCategoryById
public Category findCategoryById(Long categoryId)
- Specified by:
findCategoryById in interface CatalogService
findCategoryByName
@Deprecated
public Category findCategoryByName(String categoryName)
- Deprecated.
- Description copied from interface:
CatalogService
- Retrieve a
Category instance 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:
findCategoryByName in interface CatalogService
- Parameters:
categoryName - the category name to search by
- Returns:
- the Category instance matching the categoryName
findCategoriesByName
public List<Category> findCategoriesByName(String categoryName)
- Description copied from interface:
CatalogService
- Retrieve a list of
Category instance based on the name
property.
- Specified by:
findCategoriesByName in interface CatalogService
- Parameters:
categoryName - the category name to search by
- Returns:
- the list of matching Category instances
findCategoriesByName
public List<Category> findCategoriesByName(String categoryName,
int limit,
int offset)
- Description copied from interface:
CatalogService
- Retrieve a list of
Category instances based on the search criteria
- Specified by:
findCategoriesByName in interface CatalogService
- 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
@Transactional(value="blTransactionManager")
public Category saveCategory(Category category)
- Specified by:
saveCategory in interface CatalogService
removeCategory
@Transactional(value="blTransactionManager")
public void removeCategory(Category category)
- Specified by:
removeCategory in interface CatalogService
findAllCategories
public List<Category> findAllCategories()
- Specified by:
findAllCategories in interface CatalogService
findAllCategories
public List<Category> findAllCategories(int limit,
int offset)
- Specified by:
findAllCategories in interface CatalogService
findAllParentCategories
public List<Category> findAllParentCategories()
- Specified by:
findAllParentCategories in interface CatalogService
findAllSubCategories
public List<Category> findAllSubCategories(Category category)
- Specified by:
findAllSubCategories in interface CatalogService
findAllSubCategories
public List<Category> findAllSubCategories(Category category,
int limit,
int offset)
- Specified by:
findAllSubCategories in interface CatalogService
findActiveSubCategoriesByCategory
public List<Category> findActiveSubCategoriesByCategory(Category category)
- Specified by:
findActiveSubCategoriesByCategory in interface CatalogService
findActiveSubCategoriesByCategory
public List<Category> findActiveSubCategoriesByCategory(Category category,
int limit,
int offset)
- Specified by:
findActiveSubCategoriesByCategory in interface CatalogService
findAllProducts
public List<Product> findAllProducts()
- Specified by:
findAllProducts in interface CatalogService
findAllProducts
public List<Product> findAllProducts(int limit,
int offset)
- Specified by:
findAllProducts in interface CatalogService
findAllSkus
public List<Sku> findAllSkus()
- Specified by:
findAllSkus in interface CatalogService
findSkuById
public Sku findSkuById(Long skuId)
- Specified by:
findSkuById in interface CatalogService
saveSku
@Transactional(value="blTransactionManager")
public Sku saveSku(Sku sku)
- Specified by:
saveSku in interface CatalogService
saveSkuFee
@Transactional(value="blTransactionManager")
public SkuFee saveSkuFee(SkuFee fee)
- Specified by:
saveSkuFee in interface CatalogService
findSkusByIds
public List<Sku> findSkusByIds(List<Long> ids)
- Specified by:
findSkusByIds in interface CatalogService
setProductDao
public void setProductDao(ProductDao productDao)
setSkuDao
public void setSkuDao(SkuDao skuDao)
findProductsForCategory
public List<Product> findProductsForCategory(Category category)
- Specified by:
findProductsForCategory in interface CatalogService
findProductsForCategory
public List<Product> findProductsForCategory(Category category,
int limit,
int offset)
- Specified by:
findProductsForCategory in interface CatalogService
setCategoryDao
public void setCategoryDao(CategoryDao categoryDao)
getChildCategoryURLMapByCategoryId
@Deprecated
public Map<String,List<Long>> getChildCategoryURLMapByCategoryId(Long categoryId)
- Deprecated.
- Description copied from interface:
CatalogService
- Get a hierarchical map of all child categories keyed on the url
- Specified by:
getChildCategoryURLMapByCategoryId in interface CatalogService
- Parameters:
categoryId - the parent category to which the children belong
- Returns:
- hierarchical map of all child categories
createCategory
public Category createCategory()
- Specified by:
createCategory in interface CatalogService
createSku
public Sku createSku()
- Specified by:
createSku in interface CatalogService
createProduct
public Product createProduct(ProductType productType)
- Specified by:
createProduct in interface CatalogService
readAllProductOptions
public List<ProductOption> readAllProductOptions()
- Specified by:
readAllProductOptions in interface CatalogService
saveProductOption
@Transactional(value="blTransactionManager")
public ProductOption saveProductOption(ProductOption option)
- Specified by:
saveProductOption in interface CatalogService
findProductOptionById
public ProductOption findProductOptionById(Long productOptionId)
- Specified by:
findProductOptionById in interface CatalogService
findProductOptionValueById
public ProductOptionValue findProductOptionValueById(Long productOptionValueId)
- Specified by:
findProductOptionValueById in interface CatalogService
findCategoryByURI
public Category findCategoryByURI(String uri)
- Description copied from interface:
CatalogService
- Returns a category associated with the passed in URI or null if no Category is
mapped to this URI.
- Specified by:
findCategoryByURI in interface CatalogService
- Returns:
findProductByURI
public Product findProductByURI(String uri)
- Description copied from interface:
CatalogService
- Returns a product associated with the passed in URI or null if no Product is
mapped to this URI.
- Specified by:
findProductByURI in interface CatalogService
- Returns:
Copyright © 2013. All Rights Reserved.