Wednesday, January 12, 2011

Automatically deploy Alfresco WCM content to an FTP server

In Alfresco WCM, deploying means generating "baked" web content from XML content and templates, into a local FSR directory. Here is how to take this further and also deploy the content to your web server via FTP automatically.
  1. Make sure you have both Alfresco WCM and an FSR (now called File System Deployment Target) installed and working.
  2. Edit the Deployment Server's deployment/default-target.xml file and add a "postCommit" section linking to a postcommit script (example).
  3. Create the postcommit script, calling the lftp tool in mirror mode (example).
Unfortunately, the default Alfresco Deployment server does not report anything about the script's activity and potential errors. To see or log messages, please download Alfresco's source code, modify ProgramRunnable.java like this, recompile, overwrite alfresco-deployment-3.3.2.jar with the one you just generated, and then restart the server.

2 comments:

  1. Thank you !
    I was not aware of org.alfresco.deployment.ProgramRunnable and almost ended up writing my own custom class.

    ReplyDelete
  2. This comment has been removed by a blog administrator.

    ReplyDelete