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.

Science To Bfg

1,311 views

Published on

Published in: Technology, Self Improvement
  • Be the first to comment

  • Be the first to like this

Science To Bfg

  1. 1. Migrating a public NASA site to Repoze BFG Chris Shenton koansys.com
  2. 2. Talk Overview • Science@NASA • Repoze BFG • S@N in BFG
  3. 3. 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
  4. 4. s@n varying html • 2009
  5. 5. s@n varying html • 2003
  6. 6. s@n varying html • 1996
  7. 7. CMS Wanted • Folders, Pages • Files, Images • Search • TTW Editor • Permissions per object
  8. 8. Existing Plone Site • nasascience.nasa.gov • too complex
  9. 9. New Plone Site? • Plone3’s become painful :-(
  10. 10. Repoze BFG? • Same Zope Object Database • Similar ZPT Templates • Same Catalog index, search • Tiny • Fast • Easy to learn
  11. 11. 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
  12. 12. ZODB • Persistent object store • Python objects • Dictionaries, attributes • children = page.items() • parent = page.__parent__
  13. 13. ZODB for lightly structured data recipes Spanish seafood paella sangria grouper squid on bbq cava red
  14. 14. ZODB: flexible recipes Spanish seafood paella sangria grouper squid on bbq cava red tasting photo notes
  15. 15. Traversal: the way we think /recipes/Spanish/sangria/cava recipes /recipes/seafood/squid Spanish seafood paella sangria grouper squid on bbq cava red
  16. 16. Traversal We don’t need no stinking ORM
  17. 17. Models: just Python • Folderish Page
  18. 18. Models: just Python • File • Image • subclass • blobs
  19. 19. Views: fill templates
  20. 20. View: add, edit
  21. 21. Templates Chameleon: 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
  22. 22. Templates: O-wrap • define-slot
  23. 23. Templates: page view • fill-slot
  24. 24. Catalog: index • define indices
  25. 25. Catalog: search • view
  26. 26. Import science@nasa • wget site • import html • use xpaths
  27. 27. But will it blend? • Live demo!

×