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 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. Use readAllApplicationCatalogs(ContextInfo, String) instead.
      For the application found in the contextInfo, returns the full list of the application's ApplicationCatalogRefs.

      This operation is invalid for non-application contexts.

      Parameters:
      filters - additional filters to apply in the query, can be null
      contextInfo - context information surrounding the sandboxing and multitenant state
      Returns:
      all of the application's ApplicationCatalogRefs
      Throws:
      InvalidApplicationContextException - if the application ID in the context info's context request is empty. This operation is invalid for non-application contexts
      com.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's ApplicationCatalogRefs.

      This operation is invalid for non-application contexts.

      Parameters:
      contextInfo - context information surrounding the sandboxing and multitenant state
      type - The Catalog.getType() to filter the results by.
      Returns:
      all of the application's ApplicationCatalogRefs
      Throws:
      InvalidApplicationContextException - if the application ID in the context info's context request is empty. This operation is invalid for non-application contexts
      com.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 in ApplicationCatalog.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 contextInfo
      contextInfo - context information surrounding the sandboxing and multitenant state
      Returns:
      a ApplicationCatalog containing the created catalog and relationship
      Throws:
      InvalidApplicationContextException - if the application ID in the context info's context request is empty. This operation is invalid for non-application contexts
      com.broadleafcommerce.data.tracking.core.exception.EntityMissingException - if the target application was not found
      com.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 its Application.getIsolatedCatalogs() and returns the ApplicationCatalogRef with the given ID.

      On the result, the catalog matching the ApplicationCatalogRef.getId() will be fully hydrated on ApplicationCatalog.getCatalog().

      This operation is invalid for non-application contexts.

      Parameters:
      applicationCatalogRefId - the ApplicationCatalogRef.getId() of the target application catalog ref
      contextInfo - 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 the application ID in the context info's context request is empty. This operation is invalid for non-application contexts
      com.broadleafcommerce.data.tracking.core.exception.EntityMissingException - if the target application was not found or if no ApplicationCatalogRef 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 its Application.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 on ApplicationCatalog.getCatalog().

      This operation is invalid for non-application contexts.

      Parameters:
      applicationCatalogRefId - the ApplicationCatalogRef.getId() of the target application catalog ref
      applicationCatalogRef - the replacement ApplicationCatalogRef
      contextInfo - context information surrounding the sandboxing and multitenant state
      Returns:
      the replaced application catalog ref with its catalog fully hydrated
      Throws:
      InvalidApplicationContextException - if the application ID in the context info's context request is empty. This operation is invalid for non-application contexts
      com.broadleafcommerce.data.tracking.core.exception.EntityMissingException - if the target application was not found or if no ApplicationCatalogRef 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 its Application.getIsolatedCatalogs() for the one with the given ID and removes it from the list.

      This operation is invalid for non-application contexts.

      Parameters:
      applicationCatalogRefId - the ApplicationCatalogRef.getId() of the target application catalog ref
      contextInfo - context information surrounding the sandboxing and multitenant state
      Throws:
      InvalidApplicationContextException - if the application ID in the context info's context request is empty. This operation is invalid for non-application contexts
      com.broadleafcommerce.data.tracking.core.exception.EntityMissingException - if the target application was not found or if no ApplicationCatalogRef with the given ID was found for the application