Interface ApplicationCatalogService
- All Known Implementing Classes:
DefaultApplicationCatalogService
public interface ApplicationCatalogService
A convenience service intending to support the combined application + catalog management
functionality required by the Application Catalogs page for standard applications.
None of these operations can be performed from a global application context.
- Author:
- Samarth Dhruva (samarthd)
-
Method Summary
Modifier and TypeMethodDescriptioncreateCatalogAndAssignToApplication
(ApplicationCatalog applicationCatalog, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Creates the catalog provided inApplicationCatalog.getCatalog()
, and immediately assigns it to the application found in the contextInfo.void
deleteApplicationCatalogRef
(String applicationCatalogRefId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) For the application found in the contextInfo, scans itsApplication.getIsolatedCatalogs()
for the one with the given ID and removes it from the list.org.springframework.data.domain.Page<ApplicationCatalogRef>
readAllApplicationCatalogs
(com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo, String type) For the application found in the contextInfo, returns the full list of the application'sApplicationCatalogRefs
.org.springframework.data.domain.Page<ApplicationCatalogRef>
readAllApplicationCatalogs
(cz.jirutka.rsql.parser.ast.Node filters, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Deprecated.Filters are ignored for this entity since it's an embedded collection on Application.readApplicationCatalogRef
(String applicationCatalogRefId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) For the application found in the contextInfo, scans itsApplication.getIsolatedCatalogs()
and returns theApplicationCatalogRef
with the given ID.readApplicationCatalogRefsByCatalogId
(@NonNull String catalogId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) For all the applications, finds the list of applications that contain the given catalog ID in theirApplication.getIsolatedCatalogs()
.replaceApplicationCatalogRef
(String applicationCatalogRefId, ApplicationCatalogRef applicationCatalogRef, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) For the application found in the contextInfo, scans itsApplication.getIsolatedCatalogs()
for the one with the given ID and replaces it with the supplied replacement.
-
Method Details
-
readAllApplicationCatalogs
@Deprecated org.springframework.data.domain.Page<ApplicationCatalogRef> readAllApplicationCatalogs(@Nullable cz.jirutka.rsql.parser.ast.Node filters, @NonNull com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) throws InvalidApplicationContextException Deprecated.Filters are ignored for this entity since it's an embedded collection on Application. UsereadAllApplicationCatalogs(ContextInfo, String)
instead.For the application found in the contextInfo, returns the full list of the application'sApplicationCatalogRefs
.This operation is invalid for non-application contexts.
- Parameters:
filters
- additional filters to apply in the query, can be nullcontextInfo
- context information surrounding the sandboxing and multitenant state- Returns:
- all of the application's
ApplicationCatalogRefs
- Throws:
InvalidApplicationContextException
- if theapplication ID
in thecontext info's context request
is empty. This operation is invalid for non-application contextscom.broadleafcommerce.data.tracking.core.exception.EntityMissingException
- if the target application was not found
-
readAllApplicationCatalogs
org.springframework.data.domain.Page<ApplicationCatalogRef> readAllApplicationCatalogs(@NonNull com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo, @Nullable String type) throws InvalidApplicationContextException For the application found in the contextInfo, returns the full list of the application'sApplicationCatalogRefs
.This operation is invalid for non-application contexts.
- Parameters:
contextInfo
- context information surrounding the sandboxing and multitenant statetype
- TheCatalog.getType()
to filter the results by.- Returns:
- all of the application's
ApplicationCatalogRefs
- Throws:
InvalidApplicationContextException
- if theapplication ID
in thecontext info's context request
is empty. This operation is invalid for non-application contextscom.broadleafcommerce.data.tracking.core.exception.EntityMissingException
- if the target application was not found
-
createCatalogAndAssignToApplication
ApplicationCatalog createCatalogAndAssignToApplication(@NonNull ApplicationCatalog applicationCatalog, @NonNull com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) throws InvalidApplicationContextException Creates the catalog provided inApplicationCatalog.getCatalog()
, and immediately assigns it to the application found in the contextInfo.This operation is invalid for non-application contexts.
- Parameters:
applicationCatalog
- an object containing the catalog to create and the relationship fields required to associate that catalog to the application found in the contextInfocontextInfo
- context information surrounding the sandboxing and multitenant state- Returns:
- a
ApplicationCatalog
containing the created catalog and relationship - Throws:
InvalidApplicationContextException
- if theapplication ID
in thecontext info's context request
is empty. This operation is invalid for non-application contextscom.broadleafcommerce.data.tracking.core.exception.EntityMissingException
- if the target application was not foundcom.broadleafcommerce.common.error.validation.ValidationException
- if the request failed validation
-
readApplicationCatalogRef
ApplicationCatalog readApplicationCatalogRef(@NonNull String applicationCatalogRefId, @NonNull com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) throws InvalidApplicationContextException For the application found in the contextInfo, scans itsApplication.getIsolatedCatalogs()
and returns theApplicationCatalogRef
with the given ID.On the result, the catalog matching the
ApplicationCatalogRef.getId()
will be fully hydrated onApplicationCatalog.getCatalog()
.This operation is invalid for non-application contexts.
- Parameters:
applicationCatalogRefId
- theApplicationCatalogRef.getId()
of the target application catalog refcontextInfo
- context information surrounding the sandboxing and multitenant state- Returns:
- the application catalog ref matching the given ID with its catalog fully hydrated
- Throws:
InvalidApplicationContextException
- if theapplication ID
in thecontext info's context request
is empty. This operation is invalid for non-application contextscom.broadleafcommerce.data.tracking.core.exception.EntityMissingException
- if the target application was not found or if noApplicationCatalogRef
with the given ID was found for the application
-
replaceApplicationCatalogRef
ApplicationCatalog replaceApplicationCatalogRef(@NonNull String applicationCatalogRefId, @NonNull ApplicationCatalogRef applicationCatalogRef, @NonNull com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) throws InvalidApplicationContextException For the application found in the contextInfo, scans itsApplication.getIsolatedCatalogs()
for the one with the given ID and replaces it with the supplied replacement.On the result, the catalog matching the
ApplicationCatalogRef.getId()
will be fully hydrated onApplicationCatalog.getCatalog()
.This operation is invalid for non-application contexts.
- Parameters:
applicationCatalogRefId
- theApplicationCatalogRef.getId()
of the target application catalog refapplicationCatalogRef
- the replacementApplicationCatalogRef
contextInfo
- context information surrounding the sandboxing and multitenant state- Returns:
- the replaced application catalog ref with its catalog fully hydrated
- Throws:
InvalidApplicationContextException
- if theapplication ID
in thecontext info's context request
is empty. This operation is invalid for non-application contextscom.broadleafcommerce.data.tracking.core.exception.EntityMissingException
- if the target application was not found or if noApplicationCatalogRef
with the given ID was found for the application
-
deleteApplicationCatalogRef
void deleteApplicationCatalogRef(@NonNull String applicationCatalogRefId, @NonNull com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) throws InvalidApplicationContextException For the application found in the contextInfo, scans itsApplication.getIsolatedCatalogs()
for the one with the given ID and removes it from the list.This operation is invalid for non-application contexts.
- Parameters:
applicationCatalogRefId
- theApplicationCatalogRef.getId()
of the target application catalog refcontextInfo
- context information surrounding the sandboxing and multitenant state- Throws:
InvalidApplicationContextException
- if theapplication ID
in thecontext info's context request
is empty. This operation is invalid for non-application contextscom.broadleafcommerce.data.tracking.core.exception.EntityMissingException
- if the target application was not found or if noApplicationCatalogRef
with the given ID was found for the application
-
readApplicationCatalogRefsByCatalogId
List<ApplicationCatalogRef> readApplicationCatalogRefsByCatalogId(@NonNull @NonNull String catalogId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) For all the applications, finds the list of applications that contain the given catalog ID in theirApplication.getIsolatedCatalogs()
.- Parameters:
catalogId
- the catalog ID of the target application catalog refcontextInfo
- context information surrounding the sandboxing and multitenant state- Returns:
- the list of
ApplicationCatalogRef
for the given catalog ID
-