Interface CatalogService<P extends Catalog>
- All Superinterfaces:
com.broadleafcommerce.data.tracking.core.service.CrudEntityService<P>,com.broadleafcommerce.data.tracking.core.service.RsqlCrudEntityService<P>
- All Known Implementing Classes:
DefaultCatalogService
public interface CatalogService<P extends Catalog>
extends com.broadleafcommerce.data.tracking.core.service.RsqlCrudEntityService<P>
Catalog business domain specific version of CrudEntityService.- Author:
- Jeff Fischer
-
Method Summary
Modifier and TypeMethodDescriptionreadAllByContextIds(List<String> catalogIds, cz.jirutka.rsql.parser.ast.Node filters, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Return all of the catalogs with IDs in the supplied list.org.springframework.data.domain.Page<P>readAllByOwningApplication(cz.jirutka.rsql.parser.ast.Node filters, org.springframework.data.domain.Pageable pageable, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Find and return the catalogs for the given owning application.org.springframework.data.domain.Page<P>readAllByOwningApplicationWithExclusion(String excludingCatalogId, cz.jirutka.rsql.parser.ast.Node filters, org.springframework.data.domain.Pageable pageable, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Find and return the catalogs for the given owning application.org.springframework.data.domain.Page<P>readAllByOwningApplicationWithVisibility(cz.jirutka.rsql.parser.ast.Node filters, org.springframework.data.domain.Pageable pageable, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Find and return the catalogs for the given owning application.org.springframework.data.domain.Page<P>readAllByOwningApplicationWithVisibilityAndExclusion(String excludingCatalogId, cz.jirutka.rsql.parser.ast.Node filters, org.springframework.data.domain.Pageable pageable, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Find and return the catalogs for the given owning application.readAllTopLevelNonApplicationCatalogsByType(String type, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Finds all catalogs by type and tenant ID that do not belong to an application & are top-level catalogs, meaning they do not have a parent.voidsendTenantSearchGroupNotification(P searchGroup, Tenant tenant, com.broadleafcommerce.data.tracking.core.type.OperationType operationType, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Sends a notification after creating or deleting aDefaultCatalogType.SEARCH_GROUPtypeCatalogwhen aTenantis created or deleted.Methods 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
-
Method Details
-
readAllByOwningApplication
@NonNull org.springframework.data.domain.Page<P> readAllByOwningApplication(@Nullable cz.jirutka.rsql.parser.ast.Node filters, @NonNull org.springframework.data.domain.Pageable pageable, @NonNull com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Find and return the catalogs for the given owning application. For global catalogs, owning application's id will be null. This will only return catalogs marked true forApplicationCatalogRef.isVisibleAsAssigned().- Parameters:
filters- additional filters to apply in the query. Should beEmptyNodeif no additional filters should be applied.pageable- the requested page of results from the databasecontext- context information surrounding sandboxing and multitenant state- Returns:
- catalogs for the given owning application
-
readAllByOwningApplicationWithVisibility
@NonNull org.springframework.data.domain.Page<P> readAllByOwningApplicationWithVisibility(@Nullable cz.jirutka.rsql.parser.ast.Node filters, @NonNull org.springframework.data.domain.Pageable pageable, @NonNull com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Find and return the catalogs for the given owning application. For global catalogs, owning application's id will be null. This will only return catalogs marked true forApplicationCatalogRef.isVisibleAsAssigned(). This implementation also filters out any catalogs where the hidden property is true (seeCatalog.isHidden()).- Parameters:
filters- additional filters to apply in the query. Should beEmptyNodeif no additional filters should be applied.pageable- the requested page of results from the databasecontext- context information surrounding sandboxing and multitenant state- Returns:
- catalogs for the given owning application
-
readAllByContextIds
@NonNull List<P> readAllByContextIds(@NonNull List<String> catalogIds, @Nullable cz.jirutka.rsql.parser.ast.Node filters, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Return all of the catalogs with IDs in the supplied list.- Parameters:
catalogIds- the catalog context IDs to search forfilters- additional filters to apply in the query. Should beEmptyNodeif no additional filters should be applied.context- context information surrounding sandboxing and multitenant state- Returns:
- the catalogs that matched with the IDs in the given list
-
readAllByOwningApplicationWithExclusion
@NonNull org.springframework.data.domain.Page<P> readAllByOwningApplicationWithExclusion(@NonNull String excludingCatalogId, @Nullable cz.jirutka.rsql.parser.ast.Node filters, @NonNull org.springframework.data.domain.Pageable pageable, @NonNull com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Find and return the catalogs for the given owning application. For global catalogs, owning application's id will be null. This will only return catalogs marked true forApplicationCatalogRef.isVisibleAsAssigned(). This will exclude the catalog supplied inexcludingCatalogIdand any of that catalog's children.The primary usage of this method is filtering out catalogs that would cause a cycle. For example, given catalogs A and B we would want to prevent a scenario where catalog A is a parent of B and B is a parent of A, or the simpler scenario where catalog A is a parent of itself.
- Parameters:
excludingCatalogId- The id of the catalog to exclude. This catalog, as well as any children of this catalog, will be filtered from the results.filters- additional filters to apply in the query. Should beEmptyNodeif no additional filters should be applied.pageable- the requested page of results from the databasecontext- context information surrounding sandboxing and multitenant state- Returns:
- catalogs for the given owning application
-
readAllByOwningApplicationWithVisibilityAndExclusion
@NonNull org.springframework.data.domain.Page<P> readAllByOwningApplicationWithVisibilityAndExclusion(@NonNull String excludingCatalogId, @Nullable cz.jirutka.rsql.parser.ast.Node filters, @NonNull org.springframework.data.domain.Pageable pageable, @NonNull com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Find and return the catalogs for the given owning application. For global catalogs, owning application's id will be null. This will only return catalogs marked true forApplicationCatalogRef.isVisibleAsAssigned(). Any catalogs where the hidden property is true (seeCatalog.isHidden()) will be filtered, as well as the catalog ID supplied inexcludeCatalogIdand any of that catalog's children.The primary usage of this method is filtering out catalogs that would cause a cycle. For example, given catalogs A and B we would want to prevent a scenario where catalog A is a parent of B and B is a parent of A, or the simpler scenario where catalog A is a parent of itself.
- Parameters:
excludingCatalogId- The id of the catalog to exclude. This catalog, as well as any children of this catalog, will be filtered from the results.filters- additional filters to apply in the query. Should beEmptyNodeif no additional filters should be applied.pageable- the requested page of results from the databasecontext- context information surrounding sandboxing and multitenant state- Returns:
- catalogs for the given owning application
-
readAllTopLevelNonApplicationCatalogsByType
List<P> readAllTopLevelNonApplicationCatalogsByType(@NonNull String type, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Finds all catalogs by type and tenant ID that do not belong to an application & are top-level catalogs, meaning they do not have a parent.- Parameters:
type- the type of catalog to filter oncontextInfo- the context info of this request- Returns:
- all top-level tenant catalogs of the specified type and tenant
-
sendTenantSearchGroupNotification
void sendTenantSearchGroupNotification(@NonNull P searchGroup, @NonNull Tenant tenant, @NonNull com.broadleafcommerce.data.tracking.core.type.OperationType operationType, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Sends a notification after creating or deleting aDefaultCatalogType.SEARCH_GROUPtypeCatalogwhen aTenantis created or deleted. There should be a single Search Group Catalog created for each Tenant or Application.- Parameters:
searchGroup- The affected search grouptenant- The parent tenantoperationType- The type of operation-create or delete.contextInfo- Additional context info.- Since:
- 2.1.0-GA
-
getRepositoryDomain
-