blob: 9a6c8cf463b5b13150f3de1b42f8e064fa7d464a [file] [log] [blame]
<?xml version="1.0"?>
<document>
<properties>
<title>Jackrabbit Extension Framework - Deployment</title>
</properties>
<body>
<section name="Deployment">
<p>
This sample shows how an extension may be provided in
the repository for easy use by the Jackrabbit Extension
Framework.
</p>
<source><![CDATA[/extensions/sample -- node of type nt:folder, rep:extension
+-- rep:id = "org.apache.jackrabbit.sample"
+-- rep:name = "Sample1"
+-- rep:class = "org.apache.jackrabbit.sample.Sample1"
+-- rep:classpath = [ /extension/sample/sample.jar ]
+-- sample.jar -- node of type nt:file containing the JAR file
+-- rep:configuration -- node of type nt:file containing the configuration
+-- jcr:content
+-- jcr:data -- XML configuration file data]]></source>
<p>
When this extension is loaded, the
<code>sample.jar</code>
is added to the class loader of the
<i>org.apache.jackrabbit.sample</i>
extension type and the class
<code>org.apache.jackrabbit.sample.Sample1</code>
is loaded through that class loader. If the class
provides a public constructor taking an instance of
<code>ExtensionDescriptor</code>
the extension class may access the descriptor's node to
get at the configuration stored in the
<code>config</code>
child node. If the class provides a public setter method
for a field of type <code>ExtensionDescriptor</code>, that
method is called to set the descriptor.
</p>
<p>
This extension may easily be packaged, distributed and
deployed without requiring to hassle around with Jackrabbit
runtime configuration.
</p>
</section>
</body>
</document>