org.broadleafcommerce.core.web.api.endpoint.catalog
Class CatalogEndpoint

java.lang.Object
  extended by org.broadleafcommerce.core.web.api.endpoint.catalog.CatalogEndpoint
All Implemented Interfaces:
org.springframework.beans.factory.Aware, org.springframework.context.ApplicationContextAware

@Component(value="blRestCatalogEndpoint")
@Scope(value="singleton")
public class CatalogEndpoint
extends Object
implements org.springframework.context.ApplicationContextAware

This class exposes catalog services as RESTful APIs. It is dependent on a JAX-RS implementation such as Jersey. This class has to be in a war, with appropriate configuration to ensure that it is delegated requests from the servlet. User: Kelly Tisdell


Constructor Summary
CatalogEndpoint()
           
 
Method Summary
 CategoriesWrapper findActiveSubCategories(javax.servlet.http.HttpServletRequest request, Long id, int limit, int offset)
           
 CategoriesWrapper findAllCategories(javax.servlet.http.HttpServletRequest request, String name, int limit, int offset)
           
 List<CategoryAttributeWrapper> findCategoryAttributesForCategory(javax.servlet.http.HttpServletRequest request, Long id)
           
 CategoryWrapper findCategoryById(javax.servlet.http.HttpServletRequest request, Long id, int productLimit, int productOffset, int subcategoryLimit, int subcategoryOffset, int subcategoryDepth)
           
 List<RelatedProductWrapper> findCrossSaleProductsByProduct(javax.servlet.http.HttpServletRequest request, Long id, int limit, int offset)
           
 SkuWrapper findDefaultSkuByProductId(javax.servlet.http.HttpServletRequest request, Long id)
           
 List<MediaWrapper> findMediaForCategory(javax.servlet.http.HttpServletRequest request, Long id)
           
 List<MediaWrapper> findMediaForProduct(javax.servlet.http.HttpServletRequest request, Long id)
           
 List<MediaWrapper> findMediaForSku(javax.servlet.http.HttpServletRequest request, Long id)
           
 CategoriesWrapper findParentCategoriesForProduct(javax.servlet.http.HttpServletRequest request, Long id)
           
 List<ProductAttributeWrapper> findProductAttributesForProduct(javax.servlet.http.HttpServletRequest request, Long id)
           
 ProductWrapper findProductById(javax.servlet.http.HttpServletRequest request, Long id)
          Search for Product by product id
 List<ProductWrapper> findProductsByName(javax.servlet.http.HttpServletRequest request, String name, int limit, int offset)
          Search for Product instances whose name starts with or is equal to the passed in product name.
 List<ProductWrapper> findProductsForCategory(javax.servlet.http.HttpServletRequest request, Long id, int limit, int offset, boolean activeOnly)
           
 List<SkuAttributeWrapper> findSkuAttributesForSku(javax.servlet.http.HttpServletRequest request, Long id)
           
 SkuWrapper findSkuById(javax.servlet.http.HttpServletRequest request, Long id)
           
 List<SkuWrapper> findSkusByProductById(javax.servlet.http.HttpServletRequest request, Long id)
          Search for Sku instances for a given product
 CategoriesWrapper findSubCategories(javax.servlet.http.HttpServletRequest request, Long id, int limit, int offset, boolean active)
           
 List<RelatedProductWrapper> findUpSaleProductsByProduct(javax.servlet.http.HttpServletRequest request, Long id, int limit, int offset)
           
 void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CatalogEndpoint

public CatalogEndpoint()
Method Detail

findProductById

public ProductWrapper findProductById(@Context
                                      javax.servlet.http.HttpServletRequest request,
                                      Long id)
Search for Product by product id

Parameters:
id - the product id
Returns:
the product instance with the given product id

findProductsByName

public List<ProductWrapper> findProductsByName(@Context
                                               javax.servlet.http.HttpServletRequest request,
                                               String name,
                                               int limit,
                                               int offset)
Search for Product instances whose name starts with or is equal to the passed in product name.

Parameters:
name -
limit - the maximum number of results, defaults to 20
offset - the starting point in the record set, defaults to 0
Returns:
the list of product instances that fit the search criteria

findSkusByProductById

public List<SkuWrapper> findSkusByProductById(@Context
                                              javax.servlet.http.HttpServletRequest request,
                                              Long id)
Search for Sku instances for a given product

Parameters:
id -
Returns:
the list of sku instances for the product

findDefaultSkuByProductId

public SkuWrapper findDefaultSkuByProductId(@Context
                                            javax.servlet.http.HttpServletRequest request,
                                            Long id)

findAllCategories

public CategoriesWrapper findAllCategories(@Context
                                           javax.servlet.http.HttpServletRequest request,
                                           String name,
                                           int limit,
                                           int offset)

findSubCategories

public CategoriesWrapper findSubCategories(@Context
                                           javax.servlet.http.HttpServletRequest request,
                                           Long id,
                                           int limit,
                                           int offset,
                                           boolean active)

findActiveSubCategories

public CategoriesWrapper findActiveSubCategories(@Context
                                                 javax.servlet.http.HttpServletRequest request,
                                                 Long id,
                                                 int limit,
                                                 int offset)

findCategoryById

public CategoryWrapper findCategoryById(@Context
                                        javax.servlet.http.HttpServletRequest request,
                                        Long id,
                                        int productLimit,
                                        int productOffset,
                                        int subcategoryLimit,
                                        int subcategoryOffset,
                                        int subcategoryDepth)

findCategoryAttributesForCategory

public List<CategoryAttributeWrapper> findCategoryAttributesForCategory(@Context
                                                                        javax.servlet.http.HttpServletRequest request,
                                                                        Long id)

findProductsForCategory

public List<ProductWrapper> findProductsForCategory(@Context
                                                    javax.servlet.http.HttpServletRequest request,
                                                    Long id,
                                                    int limit,
                                                    int offset,
                                                    boolean activeOnly)

findUpSaleProductsByProduct

public List<RelatedProductWrapper> findUpSaleProductsByProduct(@Context
                                                               javax.servlet.http.HttpServletRequest request,
                                                               Long id,
                                                               int limit,
                                                               int offset)

findCrossSaleProductsByProduct

public List<RelatedProductWrapper> findCrossSaleProductsByProduct(@Context
                                                                  javax.servlet.http.HttpServletRequest request,
                                                                  Long id,
                                                                  int limit,
                                                                  int offset)

findProductAttributesForProduct

public List<ProductAttributeWrapper> findProductAttributesForProduct(@Context
                                                                     javax.servlet.http.HttpServletRequest request,
                                                                     Long id)

findSkuAttributesForSku

public List<SkuAttributeWrapper> findSkuAttributesForSku(@Context
                                                         javax.servlet.http.HttpServletRequest request,
                                                         Long id)

findMediaForSku

public List<MediaWrapper> findMediaForSku(@Context
                                          javax.servlet.http.HttpServletRequest request,
                                          Long id)

findSkuById

public SkuWrapper findSkuById(@Context
                              javax.servlet.http.HttpServletRequest request,
                              Long id)

findMediaForProduct

public List<MediaWrapper> findMediaForProduct(@Context
                                              javax.servlet.http.HttpServletRequest request,
                                              Long id)

findMediaForCategory

public List<MediaWrapper> findMediaForCategory(@Context
                                               javax.servlet.http.HttpServletRequest request,
                                               Long id)

findParentCategoriesForProduct

public CategoriesWrapper findParentCategoriesForProduct(@Context
                                                        javax.servlet.http.HttpServletRequest request,
                                                        Long id)

setApplicationContext

public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
                           throws org.springframework.beans.BeansException
Specified by:
setApplicationContext in interface org.springframework.context.ApplicationContextAware
Throws:
org.springframework.beans.BeansException


Copyright © 2013. All Rights Reserved.