Interface CommonCatalogService<P extends Catalog>
-
- All Superinterfaces:
CrudEntityService<P>
- All Known Implementing Classes:
DefaultCommonCatalogService
public interface CommonCatalogService<P extends Catalog> extends CrudEntityService<P>
Catalog
business domain specific version ofCrudEntityService
.- Author:
- Jeff Fischer
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description P
readApplicationOwnedInheritedCatalog(String startingCatalogId, String applicationId)
Find any application owned catalog that inherits from the starting catalog based on the requested application.List<P>
readByVendorRefs(Set<String> vendorRefs, ContextInfo contextInfo)
Finds all catalogs associated to the givenvendorRefs
viaCatalog.getVendorRef()
.List<String>
readCatalogChildren(String startingCatalogId)
Find one level deep of child catalogs whoseCatalog.getParents()
includes this catalog.InheritanceLines
readCatalogInheritanceGraph(List<org.springframework.data.util.Pair<String,String>> catalogRefs)
Given a list of catalog ids, find all parent catalog ids up the inheritance graph.Long
readLevel(String catalogContextId)
Find the calculated sorting level for the given catalogInheritanceLines
readTopDownCatalogInheritanceGraph(List<String> catalogRefs)
Given a list of catalog ids, find all child catalog ids down the inheritance graph.-
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, updateSort
-
-
-
-
Method Detail
-
readCatalogInheritanceGraph
InheritanceLines readCatalogInheritanceGraph(@NonNull List<org.springframework.data.util.Pair<String,String>> catalogRefs)
Given a list of catalog ids, find all parent catalog ids up the inheritance graph. This should demonstrate the full tree of catalogs up to the originating root nodes.- Parameters:
catalogRefs
- A list of catalog ids and immediate assigned mutabilities (seeMutabilityType
).- Returns:
- All parent catalog ids up the inheritance graph
-
readTopDownCatalogInheritanceGraph
InheritanceLines readTopDownCatalogInheritanceGraph(@NonNull List<String> catalogRefs)
Given a list of catalog ids, find all child catalog ids down the inheritance graph. This should demonstrate the full tree of catalogs down to leaf nodes.- Parameters:
catalogRefs
- A list of catalog ids.- Returns:
- All parent catalog ids up the inheritance graph
-
readCatalogChildren
List<String> readCatalogChildren(@NonNull String startingCatalogId)
Find one level deep of child catalogs whoseCatalog.getParents()
includes this catalog.- Parameters:
startingCatalogId
- The parent catalog whose immediate children will be returned- Returns:
- The immediate children
-
readApplicationOwnedInheritedCatalog
@Nullable P readApplicationOwnedInheritedCatalog(@NonNull String startingCatalogId, @NonNull String applicationId)
Find any application owned catalog that inherits from the starting catalog based on the requested application.- Parameters:
startingCatalogId
- The ancestor catalog from which to check inheritanceapplicationId
- The id of the application that should own the inherited catalog- Returns:
- The id of the application owned catalog
-
readLevel
Long readLevel(@NonNull String catalogContextId)
Find the calculated sorting level for the given catalog- Parameters:
catalogContextId
- The contextId for the catalog- Returns:
- The sorting level
-
readByVendorRefs
List<P> readByVendorRefs(@NonNull Set<String> vendorRefs, @Nullable ContextInfo contextInfo)
Finds all catalogs associated to the givenvendorRefs
viaCatalog.getVendorRef()
.- Parameters:
vendorRefs
- the set of vendor refs to find associated catalogs for. Must be non-empty.contextInfo
- context information surrounding sandboxing and multitenant state- Returns:
- all catalogs found for the given vendor refs
-
-