|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.elasticpath.service.impl.AbstractEpServiceImpl com.elasticpath.service.impl.AbstractEpPersistenceServiceImpl com.elasticpath.service.catalog.impl.CategoryServiceImpl
public class CategoryServiceImpl
The default implementation of CategoryService
.
Constructor Summary | |
---|---|
CategoryServiceImpl()
|
Method Summary | |
---|---|
Category |
add(Category category)
Adds the given category. |
java.util.List |
findAllUids()
Returns all category uids as a list. |
java.util.Set |
findAncestorCategoryUidsByCategoryUid(long categoryUid)
Returns the set of category uids, which are ancestors of the given category uid. |
java.util.Set |
findAncestorCategoryUidsByProductUid(long productUid)
Returns the set of category uids, which are ancestors of the given product uid. |
java.util.List |
findAvailableUids()
Returns all available category uids as a list. |
Category |
findByGuid(java.lang.String guid)
Retrieve the category with the given guid. |
java.util.List |
findByUids(java.util.Collection categoryUids,
CategoryLoadTuner loadTuner)
Returns a list of Category based on the given uids. |
java.util.List |
findCategoryByCriteria(CategorySearchCriteria categorySearchCriteria)
Retrieve the list of categories, whose specified property contain the given criteria value. |
java.util.List |
findCategoryLike(java.lang.String propertyName,
java.lang.String criteriaValue)
Retrieve the list of categories, whose specified property contain the given criteria value. |
java.util.List |
findDecendantCategoryUids(java.util.List categoryUids)
Retrieve all decendant category uids of the given category uids. |
java.util.List |
findDecendantCategoryUids(long categoryUid)
Retrieve all the uids of direct and indirct subcategories. |
java.util.List |
findFeaturedProductUidList(long categoryUid)
Get a list of featured product uid by the category uid. |
long |
findUidById(java.lang.String categoryId)
Get the category UID of the given category identifier. |
java.util.List |
findUidsByDeletedDate(java.util.Date date)
Retrieves list of category uids where the deleted date is later than the specified date. |
java.util.List |
findUidsByModifiedDate(java.util.Date date)
Retrieves list of Category uids where the last modified date is later than the specified date. |
Category |
get(long categoryUid)
Get the category with the given UID. |
CategoryLoadTuner |
getCategoryLoadTunerAll()
Returns the CategoryLoadTuner for populating all data. |
CategoryLoadTuner |
getCategoryLoadTunerDefault()
Returns the default CategoryLoadTuner . |
CategoryLoadTuner |
getCategoryLoadTunerMinimal()
Returns the CategoryLoadTuner for populating minimal data. |
Category |
getCategoryWithAttribute(long categoryUid)
Get the category with the given UID. |
Category |
getCategoryWithSubCategories(long categoryUid)
Get the category with the given UID. |
java.util.List |
getFeaturedProductsList(long categoryUid)
Get a list of featured product by the category uid. |
java.lang.Object |
getObject(long uid)
Generic get method for all persistable domain models. |
java.util.List |
getSubCategories(long categoryUid)
Retrieve the list of sub-categories of the current category. |
Utility |
getUtility()
Returns the utility instance. |
boolean |
guidExists(java.lang.String guid)
Checks whether the given category guid exists or not, for category, i.e. |
boolean |
hasProduct(long categoryUid)
Check if the category has product. |
boolean |
isProductInCategory(long productUid,
long categoryUid)
Return true if the product with the given productuid is in the category with the given categoryuid. |
java.util.List |
listRootCategories(boolean availableOnly)
Retrieve all root categories. |
java.util.List |
listRootCategoriesWithTree(boolean availableOnly)
Retrieve root categories with the entire tree of children loaded. |
Category |
load(long categoryUid)
Load the category with the given Uid. |
void |
removeCategoryTree(long categoryUid)
Deletes the category and all sub categories and products with the default category set. |
void |
saveOrUpdate(Category category)
Save or update the given category. |
void |
setCategoryLoadTunerAll(CategoryLoadTuner categoryLoadTunerAll)
Sets the CategoryLoadTuner for populating all data. |
void |
setCategoryLoadTunerDefault(CategoryLoadTuner categoryLoadTunerDefault)
Sets the default CategoryLoadTuner . |
void |
setCategoryLoadTunerMinimal(CategoryLoadTuner categoryLoadTunerMinimal)
Sets the CategoryLoadTuner for populating minimal data. |
void |
setIndexSearchService(IndexSearchService indexSearchService)
Sets the index search service. |
void |
setLazyLoadHelper(LazyLoadHelper lazyLoadHelper)
Sets the lazy load helper. |
void |
setUtility(Utility utility)
Sets the utility. |
void |
update(Category category)
Updates the given category. |
void |
updateOrder(long uidOne,
long uidTwo)
Re orders (swaps the ordering field) of the two parameter categories. |
void |
updatePosition(long uidPk,
long oldParentUid,
long newParentUid,
java.lang.Long newPreviousCategoryUid)
Updates the position (parent category) and ordering of category after a drag and drop. |
Methods inherited from class com.elasticpath.service.impl.AbstractEpPersistenceServiceImpl |
---|
getPersistenceEngine, setPersistenceEngine |
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.EpPersistenceService |
---|
getPersistenceEngine, setPersistenceEngine |
Methods inherited from interface com.elasticpath.service.EpService |
---|
getElasticPath, setElasticPath |
Constructor Detail |
---|
public CategoryServiceImpl()
Method Detail |
---|
public Category add(Category category) throws EpServiceException
add
in interface CategoryService
category
- the category to add
EpServiceException
- - in case of any errorspublic java.util.List findAllUids()
findAllUids
in interface CategoryService
public java.util.Set findAncestorCategoryUidsByCategoryUid(long categoryUid)
findAncestorCategoryUidsByCategoryUid
in interface CategoryService
categoryUid
- the category uid
public java.util.Set findAncestorCategoryUidsByProductUid(long productUid)
findAncestorCategoryUidsByProductUid
in interface CategoryService
productUid
- the product uid
public java.util.List findAvailableUids()
findAvailableUids
in interface CategoryService
public Category findByGuid(java.lang.String guid) throws EpServiceException
findByGuid
in interface CategoryService
guid
- the guid of the category
EpServiceException
- in case of any errorpublic java.util.List findByUids(java.util.Collection categoryUids, CategoryLoadTuner loadTuner)
Category
based on the given uids. The returned category will be populated based on the given load tuner.
findByUids
in interface CategoryService
categoryUids
- a collection of category uidsloadTuner
- the load tuner
Category
spublic java.util.List findCategoryByCriteria(CategorySearchCriteria categorySearchCriteria)
findCategoryByCriteria
in interface CategoryService
categorySearchCriteria
- criteria for category search.
public java.util.List findCategoryLike(java.lang.String propertyName, java.lang.String criteriaValue) throws EpServiceException
findCategoryLike
in interface CategoryService
propertyName
- category property to search on.criteriaValue
- criteria value to be used for searching.
EpServiceException
- in case of any errorpublic java.util.List findDecendantCategoryUids(java.util.List categoryUids)
findDecendantCategoryUids
in interface CategoryService
categoryUids
- the category uids.
public java.util.List findDecendantCategoryUids(long categoryUid)
findDecendantCategoryUids
in interface CategoryService
categoryUid
- the start category uid.
public java.util.List findFeaturedProductUidList(long categoryUid)
findFeaturedProductUidList
in interface CategoryService
categoryUid
- the category uid.
public long findUidById(java.lang.String categoryId) throws EpServiceException
long
value, itself will be dealt as UID.
findUidById
in interface CategoryService
categoryId
- the category Guid or UID.
EpServiceException
- - in case of any errorspublic java.util.List findUidsByDeletedDate(java.util.Date date)
findUidsByDeletedDate
in interface CategoryService
date
- date to compare with the deleted date
public java.util.List findUidsByModifiedDate(java.util.Date date)
Category
uids where the last modified date is later than the specified date.
findUidsByModifiedDate
in interface CategoryService
date
- date to compare with the last modified date
Category
whose last modified date is later than the specified datepublic Category get(long categoryUid) throws EpServiceException
get
in interface CategoryService
categoryUid
- the category UID
EpServiceException
- - in case of any errorspublic CategoryLoadTuner getCategoryLoadTunerAll()
CategoryLoadTuner
for populating all data.
CategoryLoadTuner
for populating all datapublic CategoryLoadTuner getCategoryLoadTunerDefault()
CategoryLoadTuner
.
CategoryLoadTuner
public CategoryLoadTuner getCategoryLoadTunerMinimal()
CategoryLoadTuner
for populating minimal data.
CategoryLoadTuner
for populating minimal datapublic Category getCategoryWithAttribute(long categoryUid) throws EpServiceException
getCategoryWithAttribute
in interface CategoryService
categoryUid
- the category UID
EpServiceException
- - in case of any errorspublic Category getCategoryWithSubCategories(long categoryUid) throws EpServiceException
getCategoryWithSubCategories
in interface CategoryService
categoryUid
- the category UID
EpServiceException
- - in case of any errorspublic java.util.List getFeaturedProductsList(long categoryUid)
getFeaturedProductsList
in interface CategoryService
categoryUid
- the category uidPk.
Product
public java.lang.Object getObject(long uid) throws EpServiceException
getObject
in interface EpPersistenceService
uid
- the persisted instance uid
EpServiceException
- - in case of any errorspublic java.util.List getSubCategories(long categoryUid)
getSubCategories
in interface CategoryService
categoryUid
- the current category
public Utility getUtility()
public boolean guidExists(java.lang.String guid) throws EpServiceException
guidExists
in interface CategoryService
guid
- the category code.
EpServiceException
- - in case of any errorspublic boolean hasProduct(long categoryUid) throws EpServiceException
hasProduct
in interface CategoryService
categoryUid
- the Uid of the category to be checked.
EpServiceException
- in case of any errorpublic boolean isProductInCategory(long productUid, long categoryUid)
true
if the product with the given productuid is in the category with the given categoryuid. Otherwise,
false
isProductInCategory
in interface CategoryService
productUid
- the product uidcategoryUid
- the category uid
true
if the product with the given productuid is in the category with the given categoryuid. Otherwise,
false
public java.util.List listRootCategories(boolean availableOnly)
listRootCategories
in interface CategoryService
availableOnly
- set it to true
to only list available root categories
public java.util.List listRootCategoriesWithTree(boolean availableOnly)
listRootCategoriesWithTree
in interface CategoryService
availableOnly
- set it to true
to only list available categories
public Category load(long categoryUid) throws EpServiceException
load
in interface CategoryService
categoryUid
- the category Uid
EpServiceException
- - in case of any errorspublic void removeCategoryTree(long categoryUid) throws EpServiceException
removeCategoryTree
in interface CategoryService
categoryUid
- the uid of the category to remove
EpServiceException
- - in case of any errorspublic void saveOrUpdate(Category category) throws EpServiceException
saveOrUpdate
in interface CategoryService
category
- the category to save or update
EpServiceException
- - in case of any errorspublic void setCategoryLoadTunerAll(CategoryLoadTuner categoryLoadTunerAll)
CategoryLoadTuner
for populating all data.
categoryLoadTunerAll
- the CategoryLoadTuner
for populating all data.public void setCategoryLoadTunerDefault(CategoryLoadTuner categoryLoadTunerDefault)
CategoryLoadTuner
.
categoryLoadTunerDefault
- the default CategoryLoadTuner
public void setCategoryLoadTunerMinimal(CategoryLoadTuner categoryLoadTunerMinimal)
CategoryLoadTuner
for populating minimal data.
categoryLoadTunerMinimal
- the CategoryLoadTuner
for populating minimal data.public void setIndexSearchService(IndexSearchService indexSearchService)
indexSearchService
- the index search service.public void setLazyLoadHelper(LazyLoadHelper lazyLoadHelper)
lazyLoadHelper
- the lazy load helperpublic void setUtility(Utility utility)
utility
- the utility to setpublic void update(Category category) throws EpServiceException
update
in interface CategoryService
category
- the category to update
EpServiceException
- - in case of any errorspublic void updateOrder(long uidOne, long uidTwo)
updateOrder
in interface CategoryService
uidOne
- uid of a category to reorderuidTwo
- uid of a category to reorderpublic void updatePosition(long uidPk, long oldParentUid, long newParentUid, java.lang.Long newPreviousCategoryUid)
updatePosition
in interface CategoryService
uidPk
- uid of categoryoldParentUid
- uid of old parentnewParentUid
- uid of new parentnewPreviousCategoryUid
- uid of category directly in front of category (ordering-wise).
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |