Science To Bfg

1,226 views

Published on

Published in: Technology, Self Improvement
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,226
On SlideShare
0
From Embeds
0
Number of Embeds
4
Actions
Shares
0
Downloads
6
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

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!

×