Dieser Inhalt ist in der von Ihnen ausgewählten Sprache nicht verfügbar.
15.2. Custom Sequencers
15.2.1. The Sequencer Framework Link kopierenLink in die Zwischenablage kopiert!
Link kopierenLink in die Zwischenablage kopiert!
A sequencer is actually a plain old Java object (POJO). To create a sequencer, create a Java class that extends a single abstract class, called
Sequencer
:
The abstract class also contains fields and getters (not shown above) for the name, description, and path expressions that are automatically set by the hierarchical database during repository initialization. The
initialize(...)
method is run upon repository initialization and can be overridden by an implementation to register (if required) any custom namespaces and node types required by the sequencer's generated output.
Note
The
outputNode
might belong to a different javax.jcr.Session
object than the inputProperty
, if the input and output paths of the sequencer configuration specify different workspaces. Therefore, be careful that all changes are made using the output node and its session.
The inputs to the sequencer depend on how it is configured, but often the
inputProperty
represents the jcr:data
BINARY property on the jcr:content
child of an nt:file
node. The outputNode
, however, will be one of two things:
- If there is no output path in the path expression, then the sequenced output is to be placed directly under the selected node, so therefore the
outputNode
will be the existing node being sequenced. In this case, the sequencer should place all content under the output node. In this case, the sequencers are not allowed to change the primary type. - Otherwise, the sequenced output is to be placed in a different location than the selected node. In this case, the hierarchical database uses the name of the selected node and creates a new node under the output path. This new node will have a primary type of
nt:unstructured
, but sequencers are allowed to change the primary type.
The final parameter to the
execute(...)
method is the SequencerContext
object, which is an interface containing some extra information often useful when sequencing files: