org.broadleafcommerce.core.catalog.service
Class RelatedProductsServiceImpl

java.lang.Object
  extended by org.broadleafcommerce.core.catalog.service.RelatedProductsServiceImpl
All Implemented Interfaces:
RelatedProductsService

@Service(value="blRelatedProductsService")
public class RelatedProductsServiceImpl
extends Object
implements RelatedProductsService


Field Summary
protected  CatalogService catalogService
           
protected  CategoryDao categoryDao
           
protected  ProductDao productDao
           
 
Constructor Summary
RelatedProductsServiceImpl()
           
 
Method Summary
protected  List<? extends PromotableProduct> buildCrossSaleProductsList(Product product, Category category, RelatedProductDTO relatedProductDTO)
          Returns the crossSale products for the past in product/category
protected  List<? extends PromotableProduct> buildFeaturedProductsList(Product product, Category category, RelatedProductDTO relatedProductDTO)
          Returns the featured products for the past in product/category
protected  List<? extends PromotableProduct> buildUpSaleProductsList(Product product, Category category, RelatedProductDTO relatedProductDTO)
          Returns the upSale products for the past in product/category
 List<? extends PromotableProduct> findRelatedProducts(RelatedProductDTO relatedProductDTO)
          Uses the data in the passed in DTO to return a list of relatedProducts.
protected  Category lookupCategory(RelatedProductDTO relatedProductDTO)
           
protected  Product lookupProduct(RelatedProductDTO relatedProductDTO)
           
protected  List<? extends PromotableProduct> resizeList(List<? extends PromotableProduct> originalList, Integer qty)
          Resizes the list to match the passed in quantity.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

categoryDao

protected CategoryDao categoryDao

productDao

protected ProductDao productDao

catalogService

protected CatalogService catalogService
Constructor Detail

RelatedProductsServiceImpl

public RelatedProductsServiceImpl()
Method Detail

findRelatedProducts

public List<? extends PromotableProduct> findRelatedProducts(RelatedProductDTO relatedProductDTO)
Description copied from interface: RelatedProductsService
Uses the data in the passed in DTO to return a list of relatedProducts. For example, upSale, crossSale, or featured products.

Specified by:
findRelatedProducts in interface RelatedProductsService
Returns:

buildFeaturedProductsList

protected List<? extends PromotableProduct> buildFeaturedProductsList(Product product,
                                                                      Category category,
                                                                      RelatedProductDTO relatedProductDTO)
Returns the featured products for the past in product/category

Parameters:
product -
category -
relatedProductDTO -
Returns:

buildUpSaleProductsList

protected List<? extends PromotableProduct> buildUpSaleProductsList(Product product,
                                                                    Category category,
                                                                    RelatedProductDTO relatedProductDTO)
Returns the upSale products for the past in product/category

Parameters:
product -
category -
relatedProductDTO -
Returns:

buildCrossSaleProductsList

protected List<? extends PromotableProduct> buildCrossSaleProductsList(Product product,
                                                                       Category category,
                                                                       RelatedProductDTO relatedProductDTO)
Returns the crossSale products for the past in product/category

Parameters:
product -
category -
relatedProductDTO -
Returns:

resizeList

protected List<? extends PromotableProduct> resizeList(List<? extends PromotableProduct> originalList,
                                                       Integer qty)
Resizes the list to match the passed in quantity. If the quantity is greater than the size of the list or null, the originalList is returned.

Parameters:
originalList -
qty -
Returns:

lookupProduct

protected Product lookupProduct(RelatedProductDTO relatedProductDTO)

lookupCategory

protected Category lookupCategory(RelatedProductDTO relatedProductDTO)


Copyright © 2012. All Rights Reserved.