Weblog
Jeroen Vloothuis and Jan Murre: Jamming with Plone and Django
By Jeroen Vloothuis and Jan Murre, Pareto, The Netherlands
This talk is about our experience with using both Plone and Django within several projects. We will tell what we did, how it worked and what didn't work.
We want to help you avoid make mistakes that we did when integration Plone and Django.
Step one in integration: buildout recipe for Django: djangorecipe.
In Apache we added rewrite rules to choose between Django and Plone. Watch out when creating an object in Plone that you can never reach because Apache rewrites that to Django.
We did a project for AcademicTransfer with Django and Plone. Job market niche for academic jobs. They had a 10-year old ColdFusion website. Vendor lock-in.
We used SOLR as a search engine. Django for the job board. Plone for the content management.
Django asks Plone for the base template, which is mostly the same as the main tamplate but with some regular expression replacements. Simple, but it breaks easily, so add unit tests. Complete control, but hard to debug. The alternative would have been Deliverance, but that technique was very young then.
Internationalization issues. Plone uses a cookie and Django uses a session. Solution: all language settings go through Django, using links.
User management was Django-only. Javascript based. The Plone users were only used for the content management. Browser does an ajax call to Plone to get the user name and Plone asks Django using the session. The javascript is cache-friendly: pages are the same for every logged in user.
RSS in portlets for the top vacancies and some more.
Another project with Django-Plone integration was for Zeelandia. They had a lot of Plone sites already, plus some Zope-only. They wanted SSO (single sign-on) with OpenId. Also a dashboard with SSO. Searching is done on multiple sites. Browser view on the Plone site is just an HTTP GET; scalable and fast. We should have used Open Search, but we only noticed that when we were done building. Security could be more advanced.
Plone user management with a PAS plugin. We made it possible to query the openid provider so we could search for users in the Plone UI. So we could have both normal and openid users.
Plone is kick-ass for content management. For more interactive stuff I would use Django.
Room: you could use server side includes to get the user information in the page so you don't use two requests from the browser.
Alec Mitchell: Why ask Plone the name and let Plone ask Django? You could ask Django directly.
Well, it was hard to test locally. We may change that. Could use JSON.
Eric Steele: A Look at Plone 4
By Eric Steele, WebLion Group, Penn State University, United States
An overview of the new features and benefits of Plone 4 and how we got here.
A PLIP is a PLone Improvement Proposal. The framework teams reviews these to see if they are fine for inclusion in Plone 4. A record 26 plips have made the cut and go into the new Plone 4.0. The framework team and implementers require a round of applause and beers!
New in Plone 4:
- Zope 2.12 (fully eggified, flexible storage options)
- python 2.6 (faster, better memory management, officially supported)
- CMF 2.2
- Better performance (improvement in median response time).
- SecureMailHost is made redundant by improvements in Products.MailHost. Optional mail queueing.
- plone.folder as new standard folder implementation, essentially Large Plone Folder but with ordering support.
- GS import for sharing page roles, so simpler to add new roles here.
- AddView support (port ofCMF functionality)
- Blob support: store file data outside of the Data.fs, much more efficient, managed by zodb.
- plone.app.imaging
- Deprecated CMFActionIcons: one less tool.
- plone.app.upgrade: use upgrade profiles to handle upgrades.
- flexible user registration: @@join_form is now a view, show/hide possible fields, utility lookup for extra fields.
- East Asian Language search was hard: for full text indexing we split words on spaces, which works in English, but not for these languages. Now it works.
- New default theme. Based on plone.org theme. Uses the deco grid system.
- Group dashboards: assign portlets to dashboards on per-group basis.
- Dublin Core properties: we now expose these metadata in the html.
- Show blocked portlets in the management interface.
- Show/hide portlets.
- Use real names: display user's full name in several spots.
- archetypes.referencebrowserwidget: replacement for Products.ATReferenceBrowserWidget. Large performance improvements, proper test coverage.
- jQueryTools integration: plone.app.jquerytools gives us tabs, tooltips, expose, overlay, scrollable, flashembed
- TinyMCE as default editor instead of kupu. Actively maintained, easily extendible, easy to theme. We still ship kupu too.
- Search form improvements: collapse advanced search options by default, hide options based on logged-in status.
- Set image id from title.
- Choose groups for new users.
- Mailing action variable substitutions. New variables: Workflow, Dublin Core.
- Email login: use your email address to login.
- New Zope front page that is much friendlier. Easily visible button to add Plone Site, instead of selecting it from a long list.
- 'bin/instance fg' automatically turns on debug mode for portal_css, portal_javascript and portal_kss.
- We will use distribute instead of setuptools.
When? We need releases for Zope 2.12.1 and CMF 2.2, we need to fix bugs in Plone. Hopefully we will get things fixed within a week.
Planned for 4.1:
- vs.events, recurring
- collective.controlpanel.edit_css: in Plone editing of css
- plone.app.discussion
- collective.amberjack
- collections: improved criteria selection UI, live update of results
Please join sprints for Plone 4 this weekend.
The development buildout is here: http://tr.im/TryPlone4
David Glick: Building Content Types with Dexterity
By David Glick, ONE/Northwest, USA
Over the past year and a half, Martin Aspeli and company have been hard at work creating Dexterity, the next-generation framework for developing content types in Plone. In this tutorial, you learn the basics of building content types with Dexterity, how it compares to Archetypes, and the current status of the project.
I am working for groundwire, formerly known as ONe/Northwest.
A content type is for example a page, document or image. It has a schema, custom view templates, miscelaneous settings (can you search for it, can you add comments, etc).
History lesson. CMF (Content Management Framework) is an underlying framework for registering types, assigning workflows. Not schema based. Archetypes came along and provided schemas, with schema based form generation. Not going away anytime soon. But it has some ugly bits. Not easy as basis for generating schemas TTW (through the web).
At the Plone Planning Summit we talked about how we were going to create content types in the future, still archetypes or not. So after that, Martin Aspeli started the Dexterity project. Make it possible to define a content type through the web, export it to the file system and be able to do this the other way around as well.
Products.Archetypes is big. plone.dexterity is small and you can extend it with just the extra parts you need.
Archetypes does a lot of what seems to be magic; a lot of code, like factories and methods, that are created on the fly.
Installing dexterity: add the plone.app.dexterity egg in your buildout.cfg and add http://good-py.appspot.com/release/dexterity/1.0a2 in your buildout extends lines.
Options for extending a content type are subclassing, archetypes.schemaextender, and now with dexterity you have a new concept called behaviors. A behavior can be something like: create the short name of the object from the title; add geolocation; add ownership.
You have to watch out when changing a content type, as existing objects are not automatically updated, for instance when you change a field name.
We don't create custom Add permissions yet through the web.
Example package: example.ploneconf09 at http://svn.plone.org/svn/plone//plone.dexterity/example.ploneconf09
The type definition can just be exported via portal_setup by exporting the types tool. We want some new UI for this. The schema will be in there, in escaped xml. You can also put this in a separate xml file, or define a zope 3 schema--use plone.directives.form for this.
Using a zope 3 schema: add five.grok as dependency and add package="." /> to your zcml. To move a field to a different fieldset, specify form.fieldset in the schema and list the fields you want to have on this tab.
With plone.directives.dexterity you can define read and write permissions.
Pieces
- plone.dexterity: base content class
- plone.autoform: makes it possible for a form to be composed by scheas and form hints from different sources, like base schema and behavior schema.
- plone.schemaeditor: UI for editing zope 3 interfaces TTW. Dexterity integrates this with its types control panel
- plone.supermodel: translates zope 3 schema into xml and the other way around. Easily extensible.
- plone.directives.dexterity: Grok directives for custom views and content classes.
- plone.folder: orderable Btree based folder implementation, will be used in Plone 4 as well.
- plone.behavior: register behaviors (conditional adapters). For dexterity the condition is whether the behavior is checked in the FTI.
- plone.rfc822: supports marshalling dexterity content into rfc822 (email) format.
- plone.app.dexterity: pulls in everything you need. Has the standard behaviors.
Status
- The core functionality is pretty solid.
- Schema serialization has a few issues, but works okay.
- Automatic form generation works fine.
- You can assign content rules to dexterity.
- Relations: not working between archetypes and dexterity content in the same site.
- Widgets are not as rich as archetypes yet, but better than formlib.
- TTW schema editing works fine, but needs more real-life use to iron out any bugs.
- Image and file support are done via plone.namedfile and plone.formwidget.namedfile; no support for image scaling yet, unlike archetypes.
- Text transform support via plone.app.textfield.
- Select field support; no way to define vocabularies TTW yet.
- Support for versioning and staging is in progress.
- No automatic migration from archetypes to dexterity yet.
- Multilingual: no support yet.
Second alpha release was on October 12th 2009. First beta coming soon.
Works on Plone 3. Support for Plone 4 coming soon.
Performance benchmarks are mostly better than archetypes, except the view, but I take that with a grain of salt. Loading an Add form is much faster.
Manuals here: http://plone.org/products/dexterity/documentation/manual
Get involved, code: http://code.google.com/p/dexterity/
google group: http://groups.google.com/group/dexterity-development
Dexterity objects are smaller than archetypes objects in the zodb.
See the slides.
Nate Aune: Deliverance - a compelling way to theme Plone sites
By Nate Aune, Jazkarta, USA
This talk will be a case study of how we used Deliverance to streamline the process of theming a Plone site. The customer requirement was to use an existing HTML/CSS design but replace the backend CMS with Plone. We were able to complete the theming part of the project in a fraction of the time that it would have taken had we replicated the theme as a Plone product.
Deliverance moves elements from your content into place holders in the theme. And you don't even have to touch the theme to do this.
The knowledge you need for this is html, css, firebug and an editor. The web designer does not need to learn templating in yet another CMS.
Who is using deliverance?
- http://plone.org/
- http://plone.tv/
- Harvard School of engineering
- http://ploneconf2009.org (temporary: http://temp.ploneconf2009.org/)
Our customer, HaiVision, wanted to move to Plone, but use their current design, and wanted to be able change the html and css themselves, and within two weeks. Deliverance to the rescue!
Seven steps to heaven:
Check out and run the Deliverance demo buildout:
svn co http://svn.plone.org/svn/collective/deliverancedemo/trunk delidemo
Prepare your HTML/CSS files.
Stick the static files in a static folder in your buildout.
Identify css selectors in the plone site. Firebug is fantastic for this, so http://www.getfirebug.com
and identify the css selectors in the static theme where you want to put them.
Create a rules file. Note: you must place drop rules before replace rules.
Setup an apache vhost. You must add ProxyPreserveHost there.
See the slides for details once they are up.
Performance:
- Deliverance respects caching headers.
- Pages load fast, because javascript and images that are not used in the theme are not loaded.
- Deliverance itself has a small memory footprint and hardly takes any server resources.
collective.dvsites: wsgi middleware that maps domains to different rules files:
[sites] domains = *.mysite.com %(here)s/mainrules.xml another.mysite.com %(here)s/another.xml
Banjo: jQuery-powered rules generation front-end. Sprint this weekend? jQuery help needed, python programmers wanted, and user interface gurus please.
Thanks to: Paul Everitt, Ian Bicking, Aaron Vanderlip, Jordan Baker, Eric Steele, Fred van Dijk, Reinout van Rees.
More info: http://deliverance.openplans.org
Example buildout: the plone conference website: http://svn.plone.org/svn/collective/ploneconf/buildout/ploneconf/trunk
Sally Kleinfeldt: Plone web services
By Sally Kleinfeldt and others (panel)
(I missed the first five minutes.)
Web services: SOAP, REST, microformats.
Products in Plone:
- Soap: the CIGNEX project
- REST: ATRest, gsxml
- Atom: Vice
- XML-RPC: wsapi4plone
wsapi4plone
Provide CRUD (create, read, update, delete) interface to Plone content. Future: also provide JSON-RPC.
AtomPub for Plone
The Zope 2 publisher only does HTTP GET and POST. AtomPub helps there.
Matt Hamilton: CMIS
Content Management Interoperability Services. Proposed by IBM, Microsoft, Alfresco and others. Allow people to switch between CMSs fairly easily. Get content in and out of a CMS. There are problems, like: will you be able to assign rights, get those rights out of the old and into the new system?
Should Plone support this? Should we participate in a public review process? "The system should support CMIS" might become a standard requirement in a CMS procurement process. Should we create a CMIS implementation? Should we get Plone Foundation support? If we participate, we legitimize it.
Some people describe it as SQL with bells on. SQL is almost expected as backend.
Alexander Limi: it may not be needed to completely support CMIS, as long as we have something similar that mostly solves the problem CMIS tries to solve.
True confessions
Alec Mitchell: for the website of a radio station we provide simple web services with a few simple browser views.
Calvin Hendryx-Parker: some simple Archetypes objects with fields are easy to create. The XML-RPC part of Zope is rock solid. We only had some problems with date conversions. We used RDF/XML to let the XULRunner of Firefox talk with Zope. JSON and SimpleJSON; newer Firefoxes have a very fast JSON version built-in. Also using jQuery.