Wednesday, February 23, 2011

How to export a nested folder structure containing Files



Problem

I have a deeply nested folder structure containing file objects (.doc, .xls, .ppt etc.) and I want to export them to the file system


Approach

By declaring file objects to be IDAVAware, we could use GenericSetup to export them, an idea I got from here:

http://reinout.vanrees.org/weblog/2006/09/13/creating-content-with-genericsetup.html


Steps

1. Mark ATFile as IDAVAware by adding the following in your configure.zcml:

  
   <five:implements
      class="Products.ATContentTypes.content.file.ATFile"
      interface="Products.GenericSetup.interfaces.IDAVAware"
   />

2. Go to portal_setup at the root of the site

3. Go to the Export tab, select the step called Content

4. Click on Export Selected Steps at the bottom

Caveat

A small change in GenericSetup which will land in version 1.6.3 made this possible,

https://bugs.launchpad.net/zope-cmf/+bug/722726


No comments:

Post a Comment