Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
TRANSMOGRIFIER
Content Migration
&
Time Traveling
PloneConf 2013
Brasilia
Content Migration
One fundamental need of a CMS is Content – where does it 
come from?
Legacy systems
Static HTML
Legacy P...
Content Migration
Normally  you could think on code like this:
for content_item in item_source:
    content_item = normali...
Enters the TRANSMOGRIFIER
…
Enters the TRANSMOGRIFIER
…
The same code Idea – but each stage of the transform needed
Is encapsulated in a “blueprint”
S...
TRANSMOGRIFIER
…
[transmogrifier]
pipeline =
    contents
    authorize
    skipnotify
    decoder
    unescape
    parset...
TRANSMOGRIFIER
…
Advantages and Drawbacks of a configuration file:
- Advantages: No code
- Drawbacks: NO CODE (but that is...
TRANSMOGRIFIER
…
Inner workings:
class MyBluePrint(object):
    def __init__(self, transmogrifier, name, options, previous...
TRANSMOGRIFIER
…
Lots of existing Packages – with lots of Blueprints
sc.transmogrifier
plone.app.transmogrifier
mr.migrato...
Running TRANSMOGRIFIER
…
Use a debugging zope instance, and trigger it right from the core
(but that is just me:-) )
SC.TRANSMOGRIFIER
…
Inner workings:
@blueprint
class MyBluePrint(BluePrintBoiler):
    OPTIONS = {“path”:(“/home”,),  }
  ...
SC.TRANSMOGRIFIER.
WHITEHOLE
Blueprint…
When you need to dispatch contents BACK in the pipeline
SC.TRANSMOGRIFIER.
WHITEHOLE
Blueprint…
  def __iter__(self):
      for item in self.previous:
          for time_traveler...
Transmogrifier
Ploneconf 2013
Brasilia
João S. O. Bueno
jsbueno@simplesconsultoria.com.br
Upcoming SlideShare
Loading in …5
×

Transmogrifier: content migration and time traveling

980 views

Published on

Words on what is, how to use, and some sucessfull practices using collective.transmogrifier for importing legacy content into Plone.

Published in: Technology
  • Be the first to comment

Transmogrifier: content migration and time traveling

  1. 1. TRANSMOGRIFIER Content Migration & Time Traveling PloneConf 2013 Brasilia
  2. 2. Content Migration One fundamental need of a CMS is Content – where does it  come from? Legacy systems Static HTML Legacy Plone
  3. 3. Content Migration Normally  you could think on code like this: for content_item in item_source:     content_item = normalize_unicode(content_item)     content_item = sanitize_html(content_item)     item_location = infer_item_path(content_item)     ...     content_item, related_links =  extract_links_from_content(content_item)     create_plone_content(item_location, content_item)     setup_related_items(item_location, related_links)     ...     log_creation(content_item) …
  4. 4. Enters the TRANSMOGRIFIER …
  5. 5. Enters the TRANSMOGRIFIER … The same code Idea – but each stage of the transform needed Is encapsulated in a “blueprint” Só you have one blueprint to fetch each content item One blueprint to normalize the text encoding One blueprint to filter the html And instead of configuring them in a hardcoded procedure, You write a “transmogrifier configuration file”
  6. 6. TRANSMOGRIFIER … [transmogrifier] pipeline =     contents     authorize     skipnotify     decoder     unescape     parsetosoup     …    constructor     schema_update    workflow [contents] limit = 50 base_path = /home/.../simples/content_dir upload_path = /Plone/News blueprint = example.transmogrifier.filesource
  7. 7. TRANSMOGRIFIER … Advantages and Drawbacks of a configuration file: - Advantages: No code - Drawbacks: NO CODE (but that is just me :-) )
  8. 8. TRANSMOGRIFIER … Inner workings: class MyBluePrint(object):     def __init__(self, transmogrifier, name, options, previous):         self.previous = previous         ...                def __iter__(self):         for item in self.previous:             # Do things             yield item # grok boilerplate
  9. 9. TRANSMOGRIFIER … Lots of existing Packages – with lots of Blueprints sc.transmogrifier plone.app.transmogrifier mr.migrator Funnelweb dexterity.transmogrify collective.jsonmigrator/jsonify sc.transmogrifier
  10. 10. Running TRANSMOGRIFIER … Use a debugging zope instance, and trigger it right from the core (but that is just me:-) )
  11. 11. SC.TRANSMOGRIFIER … Inner workings: @blueprint class MyBluePrint(BluePrintBoiler):     OPTIONS = {“path”:(“/home”,),  }     def transmogrify(self, item): # Do things        return item # grok boilerplate
  12. 12. SC.TRANSMOGRIFIER. WHITEHOLE Blueprint… When you need to dispatch contents BACK in the pipeline
  13. 13. SC.TRANSMOGRIFIER. WHITEHOLE Blueprint…   def __iter__(self):       for item in self.previous:           for time_traveler in self.storage["wormhole"].iterpop():               logger.info(...)               yield time_traveler           yield item
  14. 14. Transmogrifier Ploneconf 2013 Brasilia João S. O. Bueno jsbueno@simplesconsultoria.com.br

×