ModeShape/modeshape — pull request #394 by rhauch (2012-05-29 21:41:08+00:00)
Title: MODE-1491 Added support for sequencers specifying acceptable MIME types 

Added support for the sequencers to specify the set of MIME types for the binary content that they accept. Some sequencers (such as the DDL sequencer) do not specify any MIME types (for various reasons, often because there is no MIME type defined for the content types), and thus fall back to the old behavior where the sequencer attempts to process all matching input.

As before, the input node must first satisfy the path expression. However, sequencers that also specify one or more MIME types (either via defaults or overwritten in each sequencer configuration) are invoked only if the MIME type of the changed property matches can be found and is one of the sequencer's MIME types.

The MIME type of the changed property is found as follows:

- if the input node contains a single-valued 'jcr:mimeType' property, then the value of this property is considered the MIME type of the changed property; otherwise
- if the input node is named "jcr:content" and its parent contains a single-valued 'jcr:mimeType' property, then the value of this property is considered the MIME type of the changed property; otherwise
- if the changed property is a BINARY property, then the ModeShape-specific Binary interface is used to obtain the MIME type for the binary value, given the name of the parent node (or grandparent node, if the parent node is named "jcr:content"); otherwise
- the MIME type could not be determined and does not influence whether the sequencer is invoked