Class DefaultBlobDispatcher

java.lang.Object
org.nuxeo.ecm.core.blob.DefaultBlobDispatcher
All Implemented Interfaces:
BlobDispatcher

public class DefaultBlobDispatcher extends Object implements BlobDispatcher
Default blob dispatcher, that uses the repository name as the blob provider.

Alternatively, it can be configured through properties to dispatch to a blob provider based on document properties instead of the repository name.

The property name is a list of comma-separated clauses, with each clause consisting of a property, an operator and a value. The property can be a Document xpath, ecm:repositoryName, ecm:path, or, to match the current blob being dispatched, blob:name, blob:mime-type, blob:encoding, blob:digest, blob:length or blob:xpath.

Comma-separated clauses are ANDed together. The special name default defines the default provider, and must be present.

Available operators between property and value are =, !=, <, <= ,>, >=, ~ and ^.

The operators =, !=, <, <=, > and >= work as numeric operators if the property is numeric, otherwise as string comparisons operators.

The operator ~ does glob matching using ? to match a single arbitrary character, and * to match any number of characters (including none). The operator ^ does full regexp matching.

For example, to dispatch to the "first" provider if dc:format is "video", to the "second" provider if the blob's MIME type is "video/mp4", to the "third" provider if the blob is stored as a secondary attached file, to the "fourth" provider if the lifecycle state is "approved", to the "fifth" provider if the blob's document is stored in under an "images" folder, and the document is in the default repository, and otherwise to the "other" provider:

 
 <property name="dc:format=video">first</property>
 <property name="blob:mime-type=video/mp4">second</property>
 <property name="blob:xpath~files/*&#47;file">third</property>
 <property name="ecm:repositoryName=default,ecm:lifeCycleState=approved">fourth</property>
 <property name="ecm:path^.*&#47images&#47.*">fifth</property>
 <property name="default">other</property>
 
 

You can make use of a record blob provider by using:

 
 <property name="records">records</property>
 <property name="default">other</property>
 
 
Since:
7.3