Transmogrifier: content migration and time traveling
Upcoming SlideShare
Loading in...5
×
 

Transmogrifier: content migration and time traveling

on

  • 544 views

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

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

Statistics

Views

Total Views
544
Views on SlideShare
511
Embed Views
33

Actions

Likes
1
Downloads
5
Comments
0

1 Embed 33

https://twitter.com 33

Accessibility

Categories

Upload Details

Uploaded via as OpenOffice

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Transmogrifier: content migration and time traveling Transmogrifier: content migration and time traveling Presentation Transcript

  • 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 Plone
  • 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) …
  • Enters the TRANSMOGRIFIER …
  • 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”
  • 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
  • TRANSMOGRIFIER … Advantages and Drawbacks of a configuration file: - Advantages: No code - Drawbacks: NO CODE (but that is just me :-) )
  • 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
  • TRANSMOGRIFIER … Lots of existing Packages – with lots of Blueprints sc.transmogrifier plone.app.transmogrifier mr.migrator Funnelweb dexterity.transmogrify collective.jsonmigrator/jsonify sc.transmogrifier
  • 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”,),  }     def transmogrify(self, item): # Do things        return item # grok boilerplate
  • 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 in self.storage["wormhole"].iterpop():               logger.info(...)               yield time_traveler           yield item
  • Transmogrifier Ploneconf 2013 Brasilia João S. O. Bueno jsbueno@simplesconsultoria.com.br