If you can't read please download the document
Upload
carlosdelaguardia
View
3.943
Download
2
Embed Size (px)
DESCRIPTION
What if you could use Plone only as a CMS and program a frontend in whichever Python web framework you want, with transparent access to the content? This way you get a proven, high-reward, low-maintenance CMS as a content backend and are free to write your application on top of that using the power and flexibility of your favorite web framework.
Citation preview
2. Why? 3. Plone is the best CMS that is NOT written in PHP 4. Plone has lots of great features
5. Python 6. but... 7. Plone is complex 8. Plone can be slow 9. Caching is not always the answer to traffic 10. Plone is NOT a general web development framework
11. Frankenplone 12. It doesn't have to be like this. You can work with your favorite tools. 13. Content Mirror by Kapil Thangavelu 14. Content Mirror serializes Plone content into a relational database
15. It's simple 16. Now we can:
17. And we can serve Plone content fast! 18. How does it work?
19. 20. Installation
21. Configure the database with ZCML 22. Configure custom content types For each custom content type installed on the site: 23. Generate tables and upload content dropdb plone createdb plone --encoding=UTF-8 # generate table definitions and create tables bin/instance run parts/productdistros/ContentMirror/ddl.py postgres > mirror.sql psql plone < /home/andy/plone/zinstance/mirror.sql # optionally, load existing content bin/instance run parts/productdistros/ContentMirror/bulk.py Plone 24. That's it. We're ready to rock & roll 25. The changes are sent synchronously to the database plone# select content_id, id, title from content where id = 'front-page'; content_id |id|title ------------+------------+---------------- 8 | front-page | Content Mirror sent this (1 row) 26. What kind of sites can take advantage of this strategy?
27. Repoze.BFG front end class WebSite(UserDict): implements(IWebSite,ILocation) __acl__ = [ (Allow, Everyone, 'view') ] def __init__(self, website_id): UserDict.__init__(self) self.__name__ = None self.__parent__ = None self.website_id = website_id session = Session() website =session.query( PloneContent ).with_polymorphic(PloneWebSite ).filter( PloneContent.id==website_id ).first() self.title = website.title 28. Plango, by Andy McKay from django.db import models from django.contrib.contenttypes.models import ContentType from utils import normalize_name class Content(models.Model): class Meta: db_table = u'content' content_id = models.IntegerField(primary_key=True, editable=False) id = models.CharField(max_length=256, editable=False) uid = models.CharField(unique=True, max_length=36, editable=False) portal_type = models.CharField(max_length=64, editable=False) status = models.CharField(max_length=64, editable=False, null=False) type = models.CharField(max_length=64, editable=False) container = models.ForeignKey('self', related_name="parent", editable=False) 29. Anyone?
30. Content Mirror is easily extended
31. By the way, don't worry about the Component Architecture. We have studied the Zope CA so you don't have to. 32. A Google App Engine frontend
33. GAE front end application import os import wsgiref.handlers from google.appengine.ext import webapp from google.appengine.ext.webapp import template from google.appengine.ext import db from google.appengine.ext.db import polymodel from google.appengine.api import users class PloneContent(polymodel.PolyModel): id = db.StringProperty() uid = db.StringProperty() portal_type = db.StringProperty() status = db.StringProperty() type = db.StringProperty() 34. Plone content in GAE 35. All discussed front ends will be made available during the sprints. Keep an eye on: http://contentmirror.googlecode.com/ 36. Case study The Library of Congress in Chile 37. Create multiple sites in one instance 38. Select content from a shared store 39. Define a unique site layout and style 40. Deploy sites using repoze.bfg 41. Let Plone be a part of the Python universe 42. Thank you! Carlos de la Guardia email:[email_address] twitter: cguardia blog: http://blog.delaguardia.com.mx