September 26, 2015

Mount support for further filesystem types into Plone (Dropbox, Local FS)

This is a followup posting to "Towards a generic integration of external data sources into Plone" that I wrote last year.

The key to mounting arbitrary filesystems (local and remote) into a Plone instance is my XML Director (xmldirector.plonecore) project. Don't be confused about the "XML" in the project but the project started as an integration solution for accessing XML databases from within Plone with a tight integration and access to Plone functionality. XML Director became very mature over the last month and works since some month smooth and without problems in production as part of the Onkopedia (www.onkopedia.com) project. The current release features support for accessing XML databases like eXistDB (2.2 and 3.0) and BaseX (8.2, 8.3). The integration is build on top of pyfilesystem which abstracts lots of different filesystem types and makes them accessible through a transparent and unified API. This means (in theory) that your code will run against a local filesystem in the same way as against S3 or a WebDAV server.

Levels of filesystem type integration with Plone

  • "Mounting" - an arbitrary filesystem can be mounted into Plone (very similar to Reflecto). A persistent "connector" object in Plone represents a mount point. You can use URL traversal through the "connector" object for accessing resources on the other filesystem
  • "Dexterity" - support for storing Dexterity values per-field on an a different filesystem (other than the ZODB). This mode uses its own directory layout on the other filesystem (which does not reflect any hierarchy aspect of Plone)

XML Director will see a new major release very soon that will extend the list of supported filesystems.

Current status

  • eXistdB (2.2, 3.0): fully supported, running production
  • BaseX (8.3): fully supported, running production

Under development

  • support for local filesystem access (similar to Reflecto): almost working
  • Owncloud: almost working
  • Dropbox: almost working (using DropDAV bridge)
  • Dropbox: testing phase (via native Dropbox Python driver for pyfilesystem)
  • AWS S3: under consideration, partly working
  • FTP/SFTP: under consideration, partly working

Quality assurance

XML Director has a huge testsuite of over 100 tests that are used to check the functionality of XML Director against all support filesystem types. A general problem that must be addressed in some way are encoded filenames. Many filesystem types support UTF-8 encoded filenames, others only support ASCII. The problem becomes even more complicated with different filesystem encodings on the host running Plone and of course the local filesystem (if you upload files from your local computer). XML Director is fully supported for Plone 4.3. Full support for Plone 5.0 is very close (some JS/CSS registry issues remaining).