How to create and deploy pre-defined contents in WCM

1 Create contents

  • Open /portal/WEB-INF/conf/configuration.xml, and replace this one
<import>war:/conf/wcm/publication-configuration.xml</import>

by this one

//<import>war:/conf/wcm/publication-configuration.xml</import>

  • Run WCM with a clean database
  • Go to Site explorer and choose any drive but we recommend you should go to Sites management drive.
  • Click on Add content and choose Free layout web content as template.
  • Input your HTML, CSS and Javascript data then Save
  • Switch to System tab, click on Export node
  • Click Export to export content, and you will have an XML file.
  • Do these steps again and again to export all contents you want.
  • Open /portal/WEB-INF/conf/configuration.xml, and replace this one
//<import>war:/conf/wcm/publication-configuration.xml</import>

by this one

<import>war:/conf/wcm/publication-configuration.xml</import>

2 Deploy contents

  • You can setup for the deployment like this
<external-component-plugins>
 <target-component>org.exoplatform.services.wcm.deployment.WCMContentInitializerService</target-component>    
 <component-plugin> 
  <name>Content Initializer Service</name>
  <set-method>addPlugin</set-method>
  <type>org.exoplatform.services.wcm.deployment.plugins.XMLDeploymentPlugin</type>
  <description>XML Deployment Plugin</description>
  <init-params>
   <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 content/live/acme/web contents/site artifacts</string></field>
      </object>
     </field>
     <field  name="sourcePath"><string>war:/conf/wcm/artifacts/site-resources/acme/Logo.xml</string></field>
    </object>
   </object-param>
   <object-param>        
    <name>ACME Signin 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 content/live/acme/web contents/site artifacts</string></field>
      </object>
     </field>
     <field  name="sourcePath"><string>war:/conf/wcm/artifacts/site-resources/acme/Signin.xml</string></field>
    </object>
   </object-param>
  </init-params>  
 </component-plugin> 
</external-component-plugins>

  • Node:
    • target-component: always is org.exoplatform.services.wcm.deployment.WCMContentInitializerService
    • component-plugin/name: anything
    • component-plugin/set-method: always is addPlugin
    • component-plugin/type: always is org.exoplatform.services.wcm.deployment.plugins.XMLDeploymentPlugin
    • component-plugin/description: anything
    • object-param/name: the name of the content will be deployed (unique)
    • object-param/description: anything
    • object/field repository: the current repository name
    • object/field workspace: the current workspace name
    • object/field nodePath: the folder which content will be deployed inside
    • object-param/field sourcePath: the path to the XML file
  • Hint: You can see an example in this file /portal/WEB-INF/conf/wcm/deployment/acme-deployment-configuration.xml
Recently Modified

Creator: Phan Lê Thanh Chương on 12/09/2009
Copyright (c) 2000-2009. Allright reserved - eXo platform SAS
1.6.13286