wiki:quintagroup.transmogrifier/ContentTypeChange

Version 10 (modified by chervol, 13 years ago) (diff)

--

Changing the ContentType of object while migrating content with quintagroup.transmogrifier

Type conversion can be done on content import.

Item import process consists of two steps:

  1. the object has to be created
  2. object updated with field values and other attributes

The correction for first step can be done with substitution pipeline, second - with xslt pipeline. Alternatively you can use datacorrector pipeline but it will require registering specific corrector adapters.

The quintagroup.transmogrifier.substitution? blueprint used in tandem with quintagroup.transmogrifier.xslt?

In your import configuration (import.cfg) insert substitution exactly before the constructor pipeline, then xslt goes. And it should look like:

pipeline =
    ...
    substitution
    constructor
    xslt
    ...

We going to replace Large Plone Folder with Folder, it is basic example in getting Members folder imported into Plone 4. The item's key for content_type is _type and the old value is saved in _old_type.

[substitution]
blueprint = quintagroup.transmogrifier.substitution
key = _type
Large Plone Folder = Folder

In xslt section we also have to mention the keys as values for from-key and to-key options.

[xslt]
blueprint = quintagroup.transmogrifier.xslt
source = marshall
from-key = _old_type
to-key = _type

Detailed description of pipelines available here: