science to bfg
Post on 13-May-2015
1.026 Views
Preview:
TRANSCRIPT
Migrating a public NASA site to Repoze BFG
Chris Shentonkoansys.com
Talk Overview
• Science@NASA
• Repoze BFG
• S@N in BFG
science@nasa
• science.nasa.gov
• 13 years of stories
• 1.8 million visits/month
• manually maintained
• varying HTML formats over time
• no built-in search
s@n varying html
• 2009
s@n varying html
• 2003
s@n varying html
• 1996
CMS Wanted
• Folders, Pages
• Files, Images
• Search
• TTW Editor
• Permissions per object
Existing Plone Site
• nasascience.nasa.gov
• too complex
New Plone Site?
• Plone3’s become painful :-(
Repoze BFG?
• Same Zope Object Database
• Similar ZPT Templates
• Same Catalog index, search
• Tiny
• Fast
• Easy to learn
Repoze BFG• http://bfg.repoze.org/
• “Zope with the serial numbers filed off”
• Chris McDonough’s 4th implementation
• 100% test coverage
• Excellent, complete documenation
• Good fit for CMS-shaped data
• ZODB
• Traversal
ZODB
• Persistent object store
• Python objects
• Dictionaries, attributes
• children = page.items()
• parent = page.__parent__
ZODB forlightly structured data
sangria
recipes
Spanish seafood
paella grouper squid
on bbq cava red
ZODB: flexible
sangria
recipes
Spanish seafood
paella grouper squid
on bbq cava red
photo tastingnotes
Traversal: the way we think
sangria
recipes
Spanish seafood
paella grouper squid
on bbq cava red
/recipes/Spanish/sangria/cava/recipes/seafood/squid
TraversalWe don’t need no stinking ORM
Models: just Python
• Folderish Page
Models: just Python
• File
• Image
• subclass
• blobs
Views: fill templates
View: add, edit
TemplatesChameleon: ZPT on steroids
• ZPT, TAL, METAL
• http://chameleon.repoze.org/docs/zpt/
• http://www.zope.org/Documentation/Books/ZopeBook/2_6Edition/ZPT.stx
• http://wiki.zope.org/ZPT/TALSpecification14
Templates: O-wrap
• define-slot
Templates: page view
• fill-slot
Catalog: index
• define indices
Catalog: search
• view
Import science@nasa
• wget site
• import html
• use xpaths
But will it blend?
• Live demo!
top related