Transmogrifier is a tool that gives you the ability to create a configurable pipeline to import and export from various systems. Each section of the pipe can be turned into a re-usable blueprint that can be given back to the community. This gives us the ability to quickly create migration paths for existing systems and maintain them as Python packages.
11. PLONE CONFERENCE 2010blueprint.py
from zope.interface import implements
from zope.interface import classProvides
from collective.transmogrifier.interfaces import ISection
from collective.transmogrifier.interfaces import ISectionBlueprint
class MySection(object):
"""A blueprint for importing something into plone
"""
classProvides(ISectionBlueprint)
implements(ISection)
def __iter___(self):
# add any other sources into the stream
for item in self.previous:
# Do something with each item
# Pass it on to the next blueprint
yield item
Thursday, October 28, 2010
12. PLONE CONFERENCE 2010Items
• Each item is a mapping
• Keys are fields
• Keys with a leading underscore are controllers
Thursday, October 28, 2010