@Service(value="blAdminCatalogService") public class AdminCatalogServiceImpl extends Object implements AdminCatalogService
| Modifier and Type | Field and Description |
|---|---|
protected CatalogService |
catalogService |
protected javax.persistence.EntityManager |
em |
protected AdminCatalogServiceExtensionManager |
extensionManager |
static String |
FAILED_SKU_GENERATION_KEY |
static String |
INCONSISTENT_PERMUTATIONS_KEY |
static String |
MAX_SKU_GENERATION_KEY |
static String |
NO_PRODUCT_OPTIONS_GENERATED_KEY |
static String |
NO_SKUS_GENERATED_KEY |
static String |
NUMBER_SKUS_GENERATED_KEY |
protected SkuDao |
skuDao |
protected int |
skuMaxGeneration |
| Constructor and Description |
|---|
AdminCatalogServiceImpl() |
| Modifier and Type | Method and Description |
|---|---|
protected List<List<ProductOptionValue>> |
checkForInconsistentPermutations(List<List<ProductOptionValue>> allPermutations,
List<List<ProductOptionValue>> previouslyGeneratedPermutations) |
protected boolean |
checkSkuMaxGeneration(List<ProductOption> productOptions) |
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
|
Map<String,Object> |
generateSkus(Long productId)
Create new Skus based on a product's ProductOptions by permutation and add them to existing ones.
|
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
|
protected boolean |
isSamePermutation(List<ProductOptionValue> perm1,
List<ProductOptionValue> perm2) |
public static String NO_SKUS_GENERATED_KEY
public static String MAX_SKU_GENERATION_KEY
public static String NO_PRODUCT_OPTIONS_GENERATED_KEY
public static String FAILED_SKU_GENERATION_KEY
public static String NUMBER_SKUS_GENERATED_KEY
public static String INCONSISTENT_PERMUTATIONS_KEY
@Value(value="${product.sku.generation.max:400}")
protected int skuMaxGeneration
protected CatalogService catalogService
protected SkuDao skuDao
protected javax.persistence.EntityManager em
protected AdminCatalogServiceExtensionManager extensionManager
public Integer generateSkusFromProduct(Long productId)
AdminCatalogServicegenerateSkusFromProduct in interface AdminCatalogServiceproductId - - the Product to generate Skus frompublic Map<String,Object> generateSkus(Long productId)
AdminCatalogServicegenerateSkus in interface AdminCatalogServiceproductId - - Product ID to create SKUsprotected List<List<ProductOptionValue>> checkForInconsistentPermutations(List<List<ProductOptionValue>> allPermutations, List<List<ProductOptionValue>> previouslyGeneratedPermutations)
protected boolean checkSkuMaxGeneration(List<ProductOption> productOptions)
protected boolean isSamePermutation(List<ProductOptionValue> perm1, List<ProductOptionValue> perm2)
public List<List<ProductOptionValue>> generatePermutations(int currentTypeIndex, List<ProductOptionValue> currentPermutation, List<ProductOption> options)
currentTypeIndex - currentPermutation - options - public Boolean cloneProduct(Long productId)
AdminCatalogServicecloneProduct in interface AdminCatalogServiceCopyright © 2025. All rights reserved.