org.broadleafcommerce.admin.server.service
Class AdminCatalogRemoteService

java.lang.Object
  extended by org.broadleafcommerce.admin.server.service.AdminCatalogRemoteService
All Implemented Interfaces:
com.google.gwt.user.client.rpc.RemoteService, AdminCatalogService

@Service(value="blAdminCatalogRemoteService")
public class AdminCatalogRemoteService
extends Object
implements AdminCatalogService

Author:
Phillip Verheyden

Field Summary
protected  CatalogService catalogService
           
protected  javax.persistence.EntityManager em
           
protected  SkuDao skuDao
           
 
Constructor Summary
AdminCatalogRemoteService()
           
 
Method Summary
 Boolean cloneProduct(Long productId)
          This will create a new product along with a new Sku for the defaultSku, along with new Skus for all of the additional Skus.
 List<List<ProductOptionValue>> generatePermutations(int currentTypeIndex, List<ProductOptionValue> currentPermutation, List<ProductOption> options)
          Generates all the possible permutations for the combinations of given ProductOptions
 Integer generateSkusFromProduct(Long productId)
          Clear out any Skus that are already attached to the Product if there were any there and generate a new set of Skus based on the permutations of ProductOptions attached to this Product
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

catalogService

protected CatalogService catalogService

skuDao

protected SkuDao skuDao

em

protected javax.persistence.EntityManager em
Constructor Detail

AdminCatalogRemoteService

public AdminCatalogRemoteService()
Method Detail

generateSkusFromProduct

public Integer generateSkusFromProduct(Long productId)
Description copied from interface: AdminCatalogService
Clear out any Skus that are already attached to the Product if there were any there and generate a new set of Skus based on the permutations of ProductOptions attached to this Product

Specified by:
generateSkusFromProduct in interface AdminCatalogService
Parameters:
productId - - the Product to generate Skus from
Returns:
the number of generated Skus from the ProductOption permutations

generatePermutations

public List<List<ProductOptionValue>> generatePermutations(int currentTypeIndex,
                                                           List<ProductOptionValue> currentPermutation,
                                                           List<ProductOption> options)
Generates all the possible permutations for the combinations of given ProductOptions

Parameters:
currentTypeIndex -
currentPermutation -
options -
Returns:
a list containing all of the possible combinations of ProductOptionValues based on grouping by the ProductOptionValue

cloneProduct

public Boolean cloneProduct(Long productId)
Description copied from interface: AdminCatalogService
This will create a new product along with a new Sku for the defaultSku, along with new Skus for all of the additional Skus. This is achieved by simply detaching the entities from the persistent session, resetting the primary keys and then saving the entity. Note: Media for the product is not saved separately, meaning if you make a change to the original product's media items (the one specified by productId) it will change the cloned product's media and vice-versa.

Specified by:
cloneProduct in interface AdminCatalogService
Returns:


Copyright © 2013. All Rights Reserved.