Sections
You are here: Home Integrators & Developers Importing and Exporting Content

Importing and Exporting Content

Some basic information about transmogrifier - from the point of view of an integrator rather than a developer.

Transmogrifier is probably the most comprehensive tool for shifting content in and out of Plone sites. It is an extremely flexible tool, which, of course, means that it's fairly complicated to get your head around to begin with.

Pipelines, Sections and Blueprints

The principle of transmogrifier is to break up content export or import into small steps. This actually makes total sense - in that, when you're moving content around, you're likely to want to manipulate it in some way in the process. For example:

  • You've got content in one content-type and you want to switch it to another.
  • You've got content in a spreadsheet and you want to turn a comma separated string of keywords into a python list of keywords.
  • You only want content from one part of the site, or content in one particular format.
  • All of the above with any additional permutations you can think of....
Each step takes an item of content, processes it and then passes it onto the next step. A discrete set of steps - carrying out an import or export for your purposes - is termed a pipeline. An individual step is a transmogrifier section which is powered by a blueprint. The item of content passed through a pipeline is termed a pipeline item.
  • A pipeline takes the form of a configuration file (using similar syntax to a buildout configuration).
  • A transmogrifier blueprint is a component, comprising python code and a zcml registration.
  • A pipeline item should be thought of as a python dictionary - a set of key-value pairs.

Pre-packaged or roll-your-own

You can of course look at all your content problems as special and unique to you - in which case you can quite easily make your own transmogrifier blueprints. However, everyone else has probably already been there and done that, so you'll probably find sufficient pre-packaged transmogrifier blueprints to do what you want.

You'll be interested in three products in the first place:

1. collective.transmogrifier - has core / abstract blueprints, for example:

  • opening and loading a csv file, taking each row of the file and transforming that to a pipeline item
  • inserting a key-value pair into the pipeline item

2. plone.app.transmogrifier - has sections relevant for operating on plone content, for example:

  • adding criteria to a collection
  • updating or transitioning a content item through a workflow state

3. quintagroup.transmogrifier - has sections particularly relevant for manipulating Plone content through export and import, and is a little more user friendly for integrators. Use this for Plone to Plone transfer of content (where a zexp, for instance, wouldn't be of any use).

Each of these builds on the previous product, so if you get quintagroup.transmogrifier, you'll automatically install, and have available, collective.transmogrifier and plone.app.transmogrifier.

With the first two actually creating that pipeline configuration file is up to you. Quintagroup.transmogrifier is more complete, in that the pipeline is already there and tweakable.

How to find out what the sections do

There's no obvious integrator documentation per se, but if you look into the code of the products, you'll find a text file next to each of the blueprints which explains in detail how that particular section works. Quintagroup.transmogrifier has more extensive documentation on getting started in its wiki.

How to actually run a pipeline

If you're an integrator this isn't completely obvious either. If you're using quintagroup.transmogrifier, you need to visit portal_setup and the import or export tab. There you'll see the option to export or import content.

If you're using collective.transmogrifier on its own then you'll need to write your own pipeline configuration file and then register it for use through a generic_setup profile. This means, of course, that you're ready and willing to create a product with a generic setup profile (but isn't as hard as you think its going to be).