Manifest exporter and importer sections
=======================================
A manifest exporter and importer sections are used to generate and parse
manifest files - listings of objects contained in some folder in XML format.
These listings are needed to set portal types for pipeline items and also act
as filter on them - items not listed in manifest will be removed. Manifest
import section is also a source section - it will generate item for every
record seen in manifest which didn't have any corresponding item in the items
stream from previous source sections. The manifest exporter section blueprint name is
``quintagroup.transmogrifier.manifestsexporter`` and importer section blueprint
name is ``quintagroup.transmogrifier.manifestimporter``.
Both sections has ``files-key`` option that gives key in item where XML data
will be or is stored (default is ``_files``). Exporter section has
``entries-key`` option, which specifies key in item where list of
(object_id, portal_type) pairs that represents folder contents is stored
(default is ``_entries``). Importer section has ``path-key`` option which
specifies key in item where path to object is stored (default is ``_path``)
and ``type-key`` option that gives key to store item's portal type (default is
``_type``).
>>> manifest = """
... [transmogrifier]
... pipeline =
... manifestsource
... manifestexporter
... manifestimporter
... printer
... dataprinter
...
... [manifestsource]
... blueprint = quintagroup.transmogrifier.tests.manifestsource
...
... [manifestexporter]
... blueprint = quintagroup.transmogrifier.manifestexporter
...
... [manifestimporter]
... blueprint = quintagroup.transmogrifier.manifestimporter
... enable-source-behaviour = true
...
... [printer]
... blueprint = collective.transmogrifier.sections.tests.pprinter
...
... [dataprinter]
... blueprint = quintagroup.transmogrifier.tests.dataprinter
... print =
... _files
... manifest
... data
... """
>>> registerConfig(u'quintagroup.transmogrifier.tests.manifest',
... manifest)
>>> transmogrifier(u'quintagroup.transmogrifier.tests.manifest') # doctest: +ELLIPSIS, +REPORT_NDIFF
{'_entries': (('news', 'Folder'),
('events', 'Folder'),
('front-page', 'Document'),
('only-in-manifest', 'Document')),
'_files': {'manifest': {'data': ...
'name': '.objects.xml'}},
'_path': ''}
news
events
front-page
only-in-manifest
{'_entries': (('aggregator', 'Topic'), ('once-more', 'File')),
'_files': {'manifest': {'data': ...
'name': '.objects.xml'}},
'_path': 'news',
'_type': 'Folder'}
aggregator
once-more
{'_type': 'Topic', '_path': 'news/aggregator'}
{'_type': 'Folder', '_path': 'events'}
{'_type': 'Document', '_path': 'front-page'}
{'_type': 'Document', '_path': 'only-in-manifest'}
{'_type': 'File', '_path': 'news/once-more'}