2.2.3.26. XML Deployment

When a site is created, most of end-users want to see something in the page instead of a blank page, so you need this plugin to deploy some "default" contents, such as Banner, Footer, Navigation, Breadcrumb.

There are two main cases to use:

To use the plugin in the component configuration, you must use the following target-component:


<target-component>org.exoplatform.services.deployment.WCMContentInitializerService</target-component>

The configuration is applied mainly in samples/acme-website/webapp/src/main/webapp/WEB-INF/conf/acme-portal/wcm/deployment/acme-deployment-configuration.xml.

Sample configuration:


<external-component-plugins>
    <target-component>org.exoplatform.services.deployment.WCMContentInitializerService</target-component>
    <component-plugin>
        <name>Content Initializer Service</name>
        <set-method>addPlugin</set-method>
        <type>org.exoplatform.services.deployment.plugins.XMLDeploymentPlugin</type>
        <description>XML Deployment Plugin</description>
        <init-params>
            <value-param>
                <name>override</name>
                <description>The flag parameter to decide if portal metadata is overriden on restarting server</description>
                <value>${acme.portalConfig.metadata.override:false}</value>
            </value-param>
            <object-param>
                <name>ACME Logo data</name>
                <description>Deployment Descriptor</description>
                <object type="org.exoplatform.services.deployment.DeploymentDescriptor">
                    <field name="target">
                        <object type="org.exoplatform.services.deployment.DeploymentDescriptor$Target">
                            <field name="repository">
                                <string>repository</string>
                            </field>
                            <field name="workspace">
                                <string>collaboration</string>
                            </field>
                            <field name="nodePath">
                                <string>/sites/acme/web contents/site artifacts</string>
                            </field>
                        </object>
                    </field>
                    <field name="sourcePath">
                        <string>war:/conf/sample-portal/wcm/artifacts/site-resources/acme/Logo.xml</string>
                    </field>
                    <field name="versionHistoryPath">
                        <string>war:/conf/sample-portal/wcm/artifacts/site-resources/acme/Logo_versionHistory.zip
                        </string>
                    </field>
                    <field name="cleanupPublication">
                        <boolean>true</boolean>
                    </field>
                </object>
            </object-param>
        </init-params>
    </component-plugin>
</external-component-plugins>

In which:

Name Type Value Description
override boolean ${acme.portalConfig.metadata.override:false}

Decides if portal metadata is overriden on restarting server.

  • true: Before importing, check if the node exists in JCR, override it with the newer node from configuration.

  • false: Not override.

Name Type Value Description
target Object org.exoplatform.services.deployment.DeploymentDescriptor$Target (*) The target node which will contain the imported node.
sourcePath string war:/conf/sample-portal/wcm/artifacts/site-resources/acme/Logo.xml The absolute path of the XML file.
cleanupPublication boolean false

Decides when the publication lifecycle is cleaned up in the target folder after importing the data.

  • true: Allow.

  • false: Not allow.

versionHistoryPath string war:/conf/sample-portal/wcm/artifacts/site-resources/acme/Logo_versionHistory.zip The absolute path of the version history file.
Field Type Value Description
repository string repository The repository name of the target node.
workspace string collaboration The collaboration name of the target node.
nodePath string /sites/acme/web contents/site artifacts The path of the target node.
Copyright ©. All rights reserved. eXo Platform SAS
blog comments powered byDisqus