Plugin XML definition

The plugin definition file must be named components.xml. This XML file enables to provide a plugin description and to reference all the external elements needed for its execution (configuration, screens).

In the XML file, the root tag is plugin. Under this tag is the plugin definition with the child tags.

Tag controller

Java Class branching off the BasePluginController enabling to position bookmarks values accessible for the JSP renders, or other components such as the “iterator” and “conditional” components.

Tag scope

This tag is a section assigned to a “section provider” that permits to define the fields needed for the plugin scope construction. The notion of plugin scope corresponds to the plugin execution domain.

Example of plugin scope

A plugin having a plugin scope limited to a particular process would only display or process the documents assigned to this process.

Each section has field tags whose description is very similar to the one you can find in the Process screens. The provider assigned to this section lets, as in the Process screens; manage the dynamic aspect of the display. The base class to use is the section provider BaseSectionProvider.

Full name: com.axemble.vdoc.sdk.providers.BaseSectionProvider.

Tag root-plugin

The root-plugin tag enables to specify a global configuration of the plugin. This configuration will be valid for every plugin instances created on the site.

Example of plugin root configuration

In the following example two plugin instances are used: Articles_A and Articles_B. The root configuration indicates that if the user language is equal to the “en” value, the plugin instance used will be the one in the categories tree /en/catalog/ and named Articles_B. In every other cases, the Articles_A plugin instance will be used.

<configuration>
    <plugin uri="/fr/catalog/Articles_A">
        <rule uri="/en/catalog/Articles_B">
            <fieldgroup>
                <field name="${iSiteExecutionContext.Locale.Language}" operator="equals" value="en"/>
            </fieldgroup>
        </rule>
    </plugin>
</configuration>

Note also the presence of the custom tag which is only reserved for the specific developments. It is the indicated place to publish the global setting of the plugin.

Tag plugin-instance

The plugin-instance tag lets specify the configuration of a plugin instance. The standard instance configuration can be customized on the following four child entries:

  • <pages> : all the pages managed by the plugin. The « enable-stats » attribute let indicate the page will be taken into account in the statistics;
     <page id="content" uri="/article" enable-stats="true" />
  • <search> : configuration of search results columns;
    <search>
            <columns>
                    <column name="fldName" label="ezs.plugin.<project>.<plugin>.column.name" zone="title" />
                    <column name="fldCreatedDate" label="ezs.plugin.<project>.<plugin>.column.createddate" zone="date" displayLabel="true" />
                    <column name="fldSize" label="ezs.plugin.<project>.<plugin>.column.size" zone="author" displayLabel="true" />
            </columns>
    </search>
  • <components> : all the Process screens used and made available for the plugin. The defined Process screens must be present in the navigation file (ex : process.xml) ;
    <components>
            <view-component name="view.list">
                    <label>ezs.component.<project>.<plugin>.view.label</label>
                    <navigation screen="articles.view" />
            </view-component>
            <form-component name="form.edit">
                    <label>LG_BASKET_EDIT</label>
                    <navigation screen="basket.edit" />
            </form-component>
            <sheet-component name="sheet.edit">
                    <label>LG_SHEET_EDIT</label>
                    <navigation screen="configuration.edit" />
            </sheet-component>
            <wizard-component name="wizard.edit">
                    <label>LG_WIZARD_EDIT</label>
                    <navigation screen="process.generate" />
            </wizard-component>
            <screen-component name="screen.edit">
                    <label>LG_SCREEN_EDIT</label>
                    <navigation screen="article.edit" />
            </screen-component>
    </components>
  • <custom> : free configuration available for the specific developments.

Example of XML File

This example shows how to define a plugin. Please note the tags <project>, <plugin> will be replaced respectively by the project system name and the plugin system name. These names correspond to the folders created under the /custom/plugins. root.

<?xml version="1.0" encoding="UTF-8"?>
<plugin name="<project>.<plugin>">
    <def>
        <controller>com.vdocsoftware.<project>.plugins.<plugin>.SimplePluginController
        </controller>
        <scope>
            <section provider="com.vdocsoftware.<project>.plugins.<plugin>.SimpleSectionProvider">
                <fields>
                    <field name="fldNavigationScope" label="ezs.plugin.<project>.<plugin>.navigation.scope.label" ctrl="com.axemble.vdp.ui.core.document.fields.ComboBoxField" mandatory="true"/>
                </fields>
            </section>
        </scope>
        <root-plugin>
            <configuration/>
        </root-plugin>
        <plugin-instance>
            <configuration>
                <search>
                    <columns>
                        <column name="fldName" label="ezs.plugin.<project>.<plugin>.column.name" zone="title"/>
                        <column name="fldCreatedDate" label="ezs.plugin.<project>.<plugin>.column.createddate" zone="date" displayLabel="true"/>
                        <column name="fldSize" label="ezs.plugin.education.fs.column.size" zone="author" displayLabel="true"/>
                    </columns>
                </search>
                <pages>
                    <page id="index" uri="/index"/>
                    <page id="content" uri="/content"/>
                </pages>
                <!--
				<components>
						<view-component name="articles.list">
								<label>ezs.component.<project>.<plugin>.articles.label</label>
								<navigation screen="articles.view" />
						</view-component>
						<form-component name="form.edit">
								<label>LG_FORM_EDIT</label>
								<navigation screen="basket.edit" />
						</form-component>
						<sheet-component name="sheet.edit">
								<label>LG_SHEET_EDIT</label>
								<navigation screen="configuration.edit" />
						</sheet-component>
						<wizard-component name="wizard.edit">
								<label>LG_WIZARD_EDIT</label>
								<navigation screen="process.generate" />
						</wizard-component>
						<screen-component name="screen.edit">
								<label>LG_SCREEN_EDIT</label>
								<navigation screen="article.edit" />
						</screen-component>
				</components>
				-->
                <custom/>
            </configuration>
        </plugin-instance>
    </def>
</plugin>