Broadleaf Microservices
  • v1.0.0-latest-prod

Key Components

ContentResolverService

This is the base service API for fetching the actual digital contents of an Asset by their URLs.

This service should be used when the actual digital content related to an Asset needs to be retrieved. Implementations should rely on a StorageProvider to retrieve the location of the resource, and then return a handle to stream that resource.

StorageService

This interface exposes methods required to perform basic tasks involving processing of uploaded files. It is responsible for validation and pre-processing of files (such as unzipping and URL creation), but interacts with and relies on the StorageProvider to abstract away the details of file storage/management.

This service is also responsible for creating the Folders and ` Asset` for the files it processes.

StorageProvider

This interface exposes methods required for interacting with an asset storage provider, that is, to store, retrieve, and delete digital content. In other words, this service is responsible for supporting DefaultAssetStorageType#INTERNAL assets that Broadleaf has access and responsibility to store. It should be implemented for each type of storage provider to be used.

By default, there should only be a single implementation of this service used, meaning that there should only be one storage provider used by the Asset service.

Note this service’s use can be restricted by a MIME type whitelist (see isWhitelistedMimeType(String)). This means that implementors can restrict what kinds of files can be supported. This method is linked to a system property of the form broadleaf.asset.internal.storageProvider.mimeTypeWhitelist.

This service can handle creating new resources from either an InputStream, addResourceFromStream(InputStream, String), addResourcesFromStreams(Map) or by moving files from a temporary workspace moveResourceFromDirectory(File) moveResourcesFromDirectory(Iterable).

Also note that, in the case of failures while processing multiple resources in either the addResourcesFromStreams(Map) or deleteResources(Iterable) methods, the default implementation will try to process as many resources as possible before returning a composite exception with all files that failed and their causes (see BulkStorageException)

Sandboxing Configuration

At the time of this writing, there’s no sandboxable entities in this service. If a sandboxable entity is introduced in this service, the following configurations should be added:

spring:
  cloud:
    stream:
      bindings:
        persistenceOutput:
            triggeredJobEventInputPurgeSandbox:
              group: asset-purge-sandbox
              destination: triggeredJobEvent
broadleaf:
   transitionrequest:
     enabled: true
   changesummary:
     notification:
       active: true
   tracking:
     sandbox:
       purge:
         enabled: true

See Sandboxing In Detail for more details.

Note
These configurations typically only affect the Granular Deployment model. For Min and Balanced deployements, these configurations are likely already added at the flexpackage-level configuration.