public interface ProductService<T extends Product> extends ProductDao<T>, HierarchyService<T>
| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_PRODUCT_NAME
For attributes common across Products, we need a Base type that can act as a template for all Products that dont wish
to override base Product values.
|
static String |
PRODUCT_LOOKUP_CACHE_NAME
Cache for looking up Categories, top level
Products that
are called often in the project
On save the cache is updated (ideally, check admin code Key: Product.getId() or HierarchialDomainObject.getParentId() or Product.getName() |
static String |
PRODUCT_SEARCH_CACHE_NAME
Cache results of recently Search results.
For instance Home page default catalog results etc. |
FILTER_PARENTS, FILTER_PARENTS_IMMEDIATE| Modifier and Type | Method and Description |
|---|---|
void |
clearCache()
Clear all
Product related Cache |
T |
convertToCategory(T product)
Converts an existing Product in the hierarchy to a Category
|
org.springframework.cache.Cache |
getCache() |
<PD extends ProductDao<T>> |
getDao() |
List<T> |
getParents(T product,
boolean includeDefault,
boolean includeThis)
Get all parents for product, where immediate parent is first node, and last node is either top most or the DEFAULT product.
|
T |
getProduct(T queryObject)
A Convenience method that can identify a
Product uniquely by any unique key. |
Collection<T> |
getProducts(Collection<String> productNames)
For a given list of Product Names produce a Collection of Products matching those Names.
|
ProductIndexSearch<T> |
getSearchService(String indexName) |
void |
index()
Re-Index all the Products using Spider
|
List |
loadHierarchy(ProductReference rootNode,
boolean loadLeaves)
Same as
#loadHierarchy(Product, boolean), but supports ProductReference version |
Map<String,String> |
locateResourceForProduct(T productCategory,
String... resourceTypeAttributesIds)
A product may have associated resources; this tells us where one can find the resources for that product
|
T |
prepareNewProduct(T product,
Integer sequence)
Prepares a new product entity for sequence, hierarchy etc based on the parent set
Persistence depends on the implementation. |
List |
search(String indexName,
com.neurosys.spider.domain.SearchParams searchParams,
PageInfo pageInfo,
String... categoryNames)
Perform indexed/lucene based searches
|
int |
searchCount(String indexName,
com.neurosys.spider.domain.SearchParams searchParams,
String... categoryNames)
Perform indexed/lucene based searches
|
convert, countFilterParents, delete, deleteSubHierarchy, filterParents, getAliasForProduct, getLastChildHierarchyCode, getParents, isExistsAsParent, loadPage, makeSpaceForNodeInParent, move, save, savecount, getEntityInstance, query, query, queryPage, queryPageconvert, deleteSubHierarchy, getLastChildHierarchyCode, loadHierarchy, loadHierarchyFlat, moveaddChangeListener, getListeners, notifyAllListeners, setListenersstatic final String PRODUCT_LOOKUP_CACHE_NAME
Products that
are called often in the project
Product.getId() or HierarchialDomainObject.getParentId() or Product.getName()ProductServiceImpl#save(Product)}),
Constant Field Valuesstatic final String PRODUCT_SEARCH_CACHE_NAME
static final String DEFAULT_PRODUCT_NAME
List loadHierarchy(ProductReference rootNode, boolean loadLeaves)
#loadHierarchy(Product, boolean), but supports ProductReference versionrootNode - thisloadLeaves - T prepareNewProduct(T product, Integer sequence)
product - as Product @nullable false ;if HierarchialDomainObject.getParentId() is null then it will assume rootsequence - as Integer, an alternate order within the parent where this content will be created @nullable trueProduct objectT convertToCategory(T product)
product - Map<String,String> locateResourceForProduct(T productCategory, String... resourceTypeAttributesIds)
productCategory - as T. Resources are common for siblings under a category/parent, hence productCategory is request for.resourceTypeAttributesIds(s) - as String (ProductAttribute name)T getProduct(T queryObject) throws Exception
Product uniquely by any unique key. Results from this may also be eligible for Caching
Product.getId(), Product.getName(), HierarchialDomainObject.getHierarchy() and any unique identifiers added to the base Entitycriteria - ExceptionList<T> getParents(T product, boolean includeDefault, boolean includeThis)
ProductAlias (multiple categories); only primary parents are considered.product - as TincludeDefault - as boolean, if true will append the "DEFAULT" product @ the end of the output List (if it exists)includeThis - as boolean, if true will include this product in the list (first position = 0th index)List search(String indexName, com.neurosys.spider.domain.SearchParams searchParams, PageInfo pageInfo, String... categoryNames) throws Exception
indexName - as String @Nuallble true implies the default index wilt be searchedsearchParams - as SearchParams @nullable falsepageInfo - as PageIngo @nullable truecategoryNames - @nullable trueExceptionCollection<T> getProducts(Collection<String> productNames)
productNames - as List of Stringint searchCount(String indexName, com.neurosys.spider.domain.SearchParams searchParams, String... categoryNames) throws Exception
indexName - as String @Nuallble true implies the default index wilt be searchedsearchParams - as SearchParams @nullable falsecategoryNames - @nullable trueExceptionorg.springframework.cache.Cache getCache()
<PD extends ProductDao<T>> PD getDao()
ProductIndexSearch<T> getSearchService(String indexName)
Copyright © 2018. All rights reserved.