Class DefaultStarredItemService<P extends StarredItem>
java.lang.Object
com.broadleafcommerce.data.tracking.core.service.BaseCrudEntityService<P>
com.broadleafcommerce.data.tracking.core.service.BaseRsqlCrudEntityService<P>
com.broadleafcommerce.content.service.DefaultStarredItemService<P>
- All Implemented Interfaces:
 StarredItemService<P>,com.broadleafcommerce.data.tracking.core.service.CrudEntityService<P>,com.broadleafcommerce.data.tracking.core.service.RsqlCrudEntityService<P>
public class DefaultStarredItemService<P extends StarredItem>
extends com.broadleafcommerce.data.tracking.core.service.BaseRsqlCrudEntityService<P>
implements StarredItemService<P>
- Author:
 - Susana Cruz (susanaccruz)
 
- 
Constructor Summary
ConstructorsConstructorDescriptionDefaultStarredItemService(StarredItemRepository<com.broadleafcommerce.data.tracking.core.Trackable> repository, ContentItemService<ContentItem> contentItemService, com.broadleafcommerce.data.tracking.core.service.RsqlCrudEntityHelper helper, com.broadleafcommerce.common.extension.TypeFactory typeFactory, com.broadleafcommerce.data.tracking.core.tenant.service.CommonCatalogService<com.broadleafcommerce.data.tracking.core.tenant.domain.Catalog> catalogService)  - 
Method Summary
Modifier and TypeMethodDescriptioncreateAll(@NonNull String userId, @NonNull List<String> contentItemIds, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) CreateStarredItemsbased on the supplied user id and content item ids.protected PcreateStarredItem(String userId, String contentItemId) createStarredItems(String userId, List<String> contentItemIds) protected com.broadleafcommerce.data.tracking.core.tenant.service.CommonCatalogService<com.broadleafcommerce.data.tracking.core.tenant.domain.Catalog>protected ContentItemService<ContentItem>protected StarredItemRepository<com.broadleafcommerce.data.tracking.core.Trackable>protected com.broadleafcommerce.common.extension.TypeFactoryprotected voidhydrateCatalogInfoInAppContext(@NonNull com.broadleafcommerce.data.tracking.core.context.ContextInfo context, @NonNull ContentItem contentItem) When performing a starring operation, typically for bulk starring in an application context, it is not necessarily possible for the caller to identify which assigned catalog (a.k.a., profile) the starred xref should belong to since multiple items may be getting starred and multiple catalogs can be assigned to the application.readAllByUserId(@NonNull String userId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Read allStarredItems, optionally filtered by name.readAllByUserIdAndContentItemIds(@NonNull String userId, @NonNull List<String> contentItemIds, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Read allStarredItems, optionally filtered by user id and content item ids.Methods inherited from class com.broadleafcommerce.data.tracking.core.service.BaseRsqlCrudEntityService
getRsqlHelper, readAll, readAll, readAll, readAllMethods inherited from class com.broadleafcommerce.data.tracking.core.service.BaseCrudEntityService
convertFromPersistentDomain, convertToPersistentDomain, create, createAll, createAllAllowingPartialSuccess, delete, getHelper, getSortPositionStrategy, readAll, readAll, readAll, readAllByContextId, readByContextId, replace, replaceAll, replaceAllAllowingPartialSuccess, setSortPositionStrategy, update, updateAll, updateAllAllowingPartialSuccess, updateSortMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.broadleafcommerce.data.tracking.core.service.CrudEntityService
create, createAll, createAllAllowingPartialSuccess, delete, readAll, readAll, readAll, readAllByContextId, readByContextId, replace, replaceAll, replaceAllAllowingPartialSuccess, update, updateAll, updateAllAllowingPartialSuccess, updateSortMethods inherited from interface com.broadleafcommerce.data.tracking.core.service.RsqlCrudEntityService
readAll, readAll, readAll, readAll 
- 
Constructor Details
- 
DefaultStarredItemService
public DefaultStarredItemService(StarredItemRepository<com.broadleafcommerce.data.tracking.core.Trackable> repository, ContentItemService<ContentItem> contentItemService, com.broadleafcommerce.data.tracking.core.service.RsqlCrudEntityHelper helper, com.broadleafcommerce.common.extension.TypeFactory typeFactory, com.broadleafcommerce.data.tracking.core.tenant.service.CommonCatalogService<com.broadleafcommerce.data.tracking.core.tenant.domain.Catalog> catalogService)  
 - 
 - 
Method Details
- 
readAllByUserId
public List<P> readAllByUserId(@NonNull @NonNull String userId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:StarredItemServiceRead allStarredItems, optionally filtered by name.- Specified by:
 readAllByUserIdin interfaceStarredItemService<P extends StarredItem>- Parameters:
 userId- the user ID to filter bycontextInfo- context information surrounding sandboxing and multitenant state- Returns:
 - all 
StarredItems, optionally filtered by name 
 - 
readAllByUserIdAndContentItemIds
public List<P> readAllByUserIdAndContentItemIds(@NonNull @NonNull String userId, @NonNull @NonNull List<String> contentItemIds, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Description copied from interface:StarredItemServiceRead allStarredItems, optionally filtered by user id and content item ids.- Specified by:
 readAllByUserIdAndContentItemIdsin interfaceStarredItemService<P extends StarredItem>- Parameters:
 userId- the user ID to filter bycontentItemIds- the content item IDs to filter bycontext- context information surrounding sandboxing and multitenant state- Returns:
 - all 
StarredItems, optionally filtered by user id and content item ids 
 - 
createAll
public List<P> createAll(@NonNull @NonNull String userId, @NonNull @NonNull List<String> contentItemIds, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Description copied from interface:StarredItemServiceCreateStarredItemsbased on the supplied user id and content item ids.- Specified by:
 createAllin interfaceStarredItemService<P extends StarredItem>- Parameters:
 userId- the user ID to create the starred items withcontentItemIds- the content item IDs to create the starred items withcontext- context information surrounding sandboxing and multitenant state- Returns:
 - all newly created 
StarredItems 
 - 
createStarredItem
 - 
createStarredItems
 - 
hydrateCatalogInfoInAppContext
protected void hydrateCatalogInfoInAppContext(@NonNull @NonNull com.broadleafcommerce.data.tracking.core.context.ContextInfo context, @NonNull @NonNull ContentItem contentItem) When performing a starring operation, typically for bulk starring in an application context, it is not necessarily possible for the caller to identify which assigned catalog (a.k.a., profile) the starred xref should belong to since multiple items may be getting starred and multiple catalogs can be assigned to the application. Therefore, the items could be from different catalogs. To handle this, the item being starred will be consulted to glean its catalog. Then, this method will resolve the implicit catalog matching the original but which belongs to the current application. This will be set on theContextRequest.- Parameters:
 context- The request'sContextInfothat needs to be hydrated.contentItem- The item to be starred.- Throws:
 com.broadleafcommerce.data.tracking.core.exception.NotPermittedException- when the original item's catalog has no implicit catalog belonging to the current application.
 - 
getRepository
- Overrides:
 getRepositoryin classcom.broadleafcommerce.data.tracking.core.service.BaseCrudEntityService<P extends StarredItem>
 - 
getContentItemService
 - 
getTypeFactory
protected com.broadleafcommerce.common.extension.TypeFactory getTypeFactory() - 
getCatalogService
protected com.broadleafcommerce.data.tracking.core.tenant.service.CommonCatalogService<com.broadleafcommerce.data.tracking.core.tenant.domain.Catalog> getCatalogService() 
 -