com.elasticpath.cmweb.ajaxservice.impl
Class CatalogAjaxServiceImpl

java.lang.Object
  extended by com.elasticpath.service.impl.AbstractEpServiceImpl
      extended by com.elasticpath.cmweb.ajaxservice.impl.CatalogAjaxServiceImpl
All Implemented Interfaces:
CatalogAjaxService, EpService

public class CatalogAjaxServiceImpl
extends AbstractEpServiceImpl
implements CatalogAjaxService

This service provides access to functionality and data (beans) for manipulating catalog objects on the Javascript client Catalog page.


Constructor Summary
CatalogAjaxServiceImpl()
           
 
Method Summary
 void deleteProductAssociation(long productUidPk, long productAssociationUidPk)
          Removes a product association from a product.
 java.util.List findByCategoryUidMinimal(long categoryUid)
          Returns a list of ProductInfoAjaxBean carries basics info of the products based on the given category Uid.
 java.util.List findByCategoryUidMinimalPaginated(long categoryUid, int startIndex, int numProducts)
          Returns a list of ProductInfoAjaxBeans that carry basic info about the products based on the given category Uid.
 java.util.List findCategoryInfoByCriteria(CategorySearchCriteria categorySearchCriteria)
          Retrieve the list of categories, whose specified property contain the given criteria value.
 java.util.List findProducSkuAjaxBeanByProductUid(long productUid)
          Returns a list of ProductSkuAjaxBeans based on the given product Uid.
 java.util.List findProductInfoByCriteria(ProductSearchCriteria productSearchCriteria)
          Retrieve the list of ProductInfoAjaxBean carries basics info of the products matching the given criteria value.
 CategoryAjaxBean getCategoryAjaxBean(long uidPk)
          Get a bean containing a domain layer product object as well as other data needed for display on the Javascript UI.
 int getNumProductsInCategory(long categoryUid)
          Returns the number of products in the given category.
 ProductAjaxBean getProductAjaxBean(long uidPk)
          Get a bean containing a domain layer product object as well as other data needed for display on the Javascript UI.
 ProductSkuAjaxBean getProductSkuAjaxBean(long uidPk)
          Get a bean containing data needed for displaying a product sku on the Javascript UI.
 void setCategoryService(CategoryService categoryService)
          Set the category service used to retrieve category information.
 void setProductLoadTunerForDefaultCategory(ProductLoadTuner productLoadTunerForDefaultCategory)
          Sets the ProductLoadTuner for populating the default category.
 void setProductService(ProductService productService)
          Set the product service used to retrieve product information.
 void setProductSkuService(ProductSkuService productSkuService)
          Set the product sku service used to retrieve product sku information.
 void swapProductAssociationOrder(long productUidPk, long association1UidPk, long association2UidPk)
          Re-orders two product associations of the given product.
 
Methods inherited from class com.elasticpath.service.impl.AbstractEpServiceImpl
getElasticPath, setElasticPath
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.elasticpath.service.EpService
getElasticPath, setElasticPath
 

Constructor Detail

CatalogAjaxServiceImpl

public CatalogAjaxServiceImpl()
Method Detail

deleteProductAssociation

public void deleteProductAssociation(long productUidPk,
                                     long productAssociationUidPk)
Removes a product association from a product.

Specified by:
deleteProductAssociation in interface CatalogAjaxService
Parameters:
productUidPk - The UID of the product whose association is to be removed
productAssociationUidPk - the UID of the ProductAssociation to be removed

findByCategoryUidMinimal

public java.util.List findByCategoryUidMinimal(long categoryUid)
Returns a list of ProductInfoAjaxBean carries basics info of the products based on the given category Uid.

Specified by:
findByCategoryUidMinimal in interface CatalogAjaxService
Parameters:
categoryUid - the category Uid
Returns:
a list of product info

findByCategoryUidMinimalPaginated

public java.util.List findByCategoryUidMinimalPaginated(long categoryUid,
                                                        int startIndex,
                                                        int numProducts)
Returns a list of ProductInfoAjaxBeans that carry basic info about the products based on the given category Uid.

Specified by:
findByCategoryUidMinimalPaginated in interface CatalogAjaxService
Parameters:
categoryUid - the category Uid
startIndex - the starting index of the first product to be returned
numProducts - the number of products to be returned, starting from the start index
Returns:
a list of product info

findCategoryInfoByCriteria

public java.util.List findCategoryInfoByCriteria(CategorySearchCriteria categorySearchCriteria)
Retrieve the list of categories, whose specified property contain the given criteria value.

Specified by:
findCategoryInfoByCriteria in interface CatalogAjaxService
Parameters:
categorySearchCriteria - the categorySearchCriteria to search on.
Returns:
list of categories matching the given criteria, if the search results size is larger than defined max return size, only return max return size categories

findProducSkuAjaxBeanByProductUid

public java.util.List findProducSkuAjaxBeanByProductUid(long productUid)
Returns a list of ProductSkuAjaxBeans based on the given product Uid.

Specified by:
findProducSkuAjaxBeanByProductUid in interface CatalogAjaxService
Parameters:
productUid - the product Uid
Returns:
a list of ProductSkuAjaxBean

findProductInfoByCriteria

public java.util.List findProductInfoByCriteria(ProductSearchCriteria productSearchCriteria)
Retrieve the list of ProductInfoAjaxBean carries basics info of the products matching the given criteria value.

Specified by:
findProductInfoByCriteria in interface CatalogAjaxService
Parameters:
productSearchCriteria - the productSearchCriteria to search on.
Returns:
the list of ProductInfoAjaxBean carries basics info of the products.

getCategoryAjaxBean

public CategoryAjaxBean getCategoryAjaxBean(long uidPk)
Get a bean containing a domain layer product object as well as other data needed for display on the Javascript UI.

Specified by:
getCategoryAjaxBean in interface CatalogAjaxService
Parameters:
uidPk - the unique identifier for the product to be returned in the bean
Returns:
the ProductAjaxBean

getNumProductsInCategory

public int getNumProductsInCategory(long categoryUid)
Returns the number of products in the given category.

Specified by:
getNumProductsInCategory in interface CatalogAjaxService
Parameters:
categoryUid - The UID of the category whose number of products is to be returned.
Returns:
the number of products in the category

getProductAjaxBean

public ProductAjaxBean getProductAjaxBean(long uidPk)
Get a bean containing a domain layer product object as well as other data needed for display on the Javascript UI.

Specified by:
getProductAjaxBean in interface CatalogAjaxService
Parameters:
uidPk - the unique identifier for the product to be returned in the bean
Returns:
the ProductAjaxBean

getProductSkuAjaxBean

public ProductSkuAjaxBean getProductSkuAjaxBean(long uidPk)
Get a bean containing data needed for displaying a product sku on the Javascript UI.

Specified by:
getProductSkuAjaxBean in interface CatalogAjaxService
Parameters:
uidPk - the unique identifier for the product to be returned in the bean
Returns:
the ProductSkuAjaxBean

setCategoryService

public void setCategoryService(CategoryService categoryService)
Set the category service used to retrieve category information.

Parameters:
categoryService - the CategoryService

setProductLoadTunerForDefaultCategory

public void setProductLoadTunerForDefaultCategory(ProductLoadTuner productLoadTunerForDefaultCategory)
Sets the ProductLoadTuner for populating the default category.

Parameters:
productLoadTunerForDefaultCategory - the ProductLoadTuner for populating the default category.

setProductService

public void setProductService(ProductService productService)
Set the product service used to retrieve product information.

Specified by:
setProductService in interface CatalogAjaxService
Parameters:
productService - the ProductService

setProductSkuService

public void setProductSkuService(ProductSkuService productSkuService)
Set the product sku service used to retrieve product sku information.

Parameters:
productSkuService - the ProductSkuService

swapProductAssociationOrder

public void swapProductAssociationOrder(long productUidPk,
                                        long association1UidPk,
                                        long association2UidPk)
Re-orders two product associations of the given product. Note: Persists the ordering change but does not re-order the collection in the product parameter

Specified by:
swapProductAssociationOrder in interface CatalogAjaxService
Parameters:
productUidPk - the UID of the product whose associations are to be reordered
association1UidPk - the uid of one of the first product association that will take the position of the second
association2UidPk - the uid of the second product association that will take the position of the first