Platform Explorer / Nuxeo Platform 11.3

Extension point resources

Documentation

The resources extension point allows to declare typed resources, with dependencies.

Example:

    <resource name="foldable-box.js">
        <path>scripts/foldable-box.js</path>
        <require>effects</require>
    </resource>

There are several ways to declare the resource type. It can be retrieved from the resource name ('js' for above example) or declared explicitely, for instance the following declaration is almost equivalent (the resource name changes).

    <resource name="foldable-box" type="js">
        <path>scripts/foldable-box.js</path>
        <require>effects</require>
    </resource>

The above example also specifies a dependency on a resource named "effects", any number of dependencies can be piled up on the declaration:

    <resource name="foldable-box" type="js">
        <path>scripts/foldable-box.js</path>
        <require>effects</require>
        <require>jquery</require>
    </resource>

When aggregating resources with dependencies, order will be respected: for instance, the effects and jquery resources will be declared *before* the foldable-box resource in above example.

The "path" element resolves the resource inside the jar that holds the extension point contribution declaration. An alternative way can be used to reference the resource path in the nuxeo.war directory:

    <resource name="foldable-box.js">
        <uri>/scripts/foldable-box.js</uri>
    </resource>

Notice the "uri" element instead of the "path", and leading slash (making the resource lookup from the war directory root).

When only the path is filled, the resource uri is filled automatically with the resource classpath uri in the corresponding runtime bundle context.

When using the uri element, wildcard are supported, for instance:

    <resource name="scripts.js">
        <uri>/scripts/*.js</uri>
    </resource>

Alternatively, classpath, file URL and external URLs are allowed:

    <uri>classpath:com/mycompany/resources/script.js</uri>
    <uri>file:c:/temp/file.css</uri>
    <uri>http://www.site.com/static/style.css</uri>

Minimization, URL rewriting, etc... processing of resources can be applied implicitly to all resources of a given type. Resources definition can also explicitly reference processors that should to be applied to them, see the "processors" extension point documentation.

    <resource name="foldable-box.css">
        <path>css/foldable-box.css</path>
        <processors>
            <processor>flavor</processor>
        </processors>
    </resource>

Contribution Descriptors

Contributions

No known contributions.