Portlets exporter and importer sections
=======================================
Portlets exporter and importer sections are used to migrate Plone 3 contextual
portlet assignments and blacklist settings.
The portlets exporter section blueprint name is
``quintagroup.transmogrifier.portletsexporter`` and importer section blueprint
name is ``quintagroup.transmogrifier.portletsimporter``.
Portlet assignments and blacklists are stored in XML format. Both sections need
relative path to the object with portlets assigned and importer also needs XML
data for updating them.
Both sections has ``path-key`` option which specifies key in item where path to
object is stored (``_path`` is default) and ``files-key`` option that gives
key where XML data will be or is stored.
>>> import pprint
>>> portlets = """
... [transmogrifier]
... pipeline =
... portletssource
... portletsexporter
... printer
... dataprinter
... portletsimporter
...
... [portletssource]
... blueprint = quintagroup.transmogrifier.tests.portletssource
...
... [portletsexporter]
... blueprint = quintagroup.transmogrifier.portletsexporter
...
... [printer]
... blueprint = collective.transmogrifier.sections.tests.pprinter
...
... [dataprinter]
... blueprint = quintagroup.transmogrifier.tests.dataprinter
... print =
... _files
... portlets
... data
...
... [portletsimporter]
... blueprint = quintagroup.transmogrifier.portletsimporter
... files-key = files
... """
>>> registerConfig(u'quintagroup.transmogrifier.tests.portlets', portlets)
>>> transmogrifier(u'quintagroup.transmogrifier.tests.portlets') # doctest: +ELLIPSIS, +REPORT_NDIFF
{}
{'_path': 'not/existing/bar'}
{'_path': 'spam/eggs/notassignable'}
{'_files': {'portlets': {'data': ...
'name': '.portlets.xml'}},
'_path': 'assignable'}
10
http://sumno.com/feeds/main-page/
RSS feed
60
{'_files': {'portlets': {'data': ...
'name': '.portlets.xml'}},
'_path': 'other-assignable',
'files': {'portlets': {'data': ...
'name': '.portlets.xml'}}}
10
http://sumno.com/feeds/main-page/
RSS feed
60
>>> 'habra-rss' in mapping
True
>>> mapping['habra-rss'].count
20
>>> mapping['habra-rss'].url
u'http://habrahabr.ru/rss/'
>>> mapping['habra-rss'].portlet_title
u'Habrahabr RSS feed'
>>> mapping['habra-rss'].timeout
120
>>> 'rss' in mapping
True
>>> mapping['rss'].count
10
>>> mapping['rss'].url
u'http://sumno.com/feeds/main-page/'
>>> mapping['rss'].portlet_title
u'RSS feed'
>>> mapping['rss'].timeout
60