-
Type: New Feature
-
Status: Resolved
-
Priority: Minor
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: 5.2 M1
-
Component/s: None
There are cases when an extension point is too restrictive for the type of objects that can be contributed by extensions.
For example let say you have a transformer extension that should be contributed as
<transformer name="NAME" class="CLASS"/>
In some situations you may have complex transformers that need some configurations so the syntax above is not enough.
For example you may have a wiki2html ytransformer that can be customized to use 0 or more filters and macro engines.
In that case you may want to define the transformer as:
<transformer name="wiki2html" class="org.nuxeo...WikiSerializer">
<filter pattern="NXP-[0-9]+" replacement="<a href=\"http://jira.nuxeo.org/browse/$0\">$0</a>"/>
<macro name="freemarker" class="org.nuxeo..."/>
</transformer>
In this case you cannot contribute directly your extension to the transformer extension point since the target extension point is
accepting objects described by an incompatible XML:
<transformer name="NAME" class="CLASS"/>
This new feature provides a solution to that problem.
You can now define a new extension point that is extending the "transformer" extension point and change the type of the XML contribution it accepts.
The extended extension point will forward any contribution to the base extension point.
Then you contribute your "extended" XML extension to the overriding extension point (that will transform the XML into a java object and will forward the registration of that object to the extended extension point)
This means the contributed java object should be of a compatible type with the one expected by the original extension point.
You can see an example of the new extension point feature in
nuxeo-runtime-test/src/test/java/org/nuxeo/runtime/TestExtensionPoint.java