Plone
This is here to serve as contents for the atom/rss feed for Plone, also read by planet.plone.org.
Nejc Zupan - plone.api
Talk during the Plone Conference 2012.
Nejc Zupan talks about plone.api during the Plone conference 2012.
This is a story about how Plone development went to a bit of a dark place and is now coming into the light again.
http://eestec.net is a website for more than 2500 European engineering students. Running in Plone 3. Two of those engineers stayed in Plone. The main reason was that we switched to Plone 3 during development. It got harder to train people. Plone 4 has improvements, but there are still problems.
You always have to remember from where you should import that function or class. Copying or moving objects is hard to remember how to do programmatically. Sample code is harder to read because of this.
So the idea of plone.api was born during the Plone Konferenz in Munich early this year. Work was done during the Belgium Beer Sprint. Eestec students new to Plone were working on rewriting the site in Plone 4. They gave feedback about what should become part of plone.api.
Inspiration came from:
- PEP20 (import this)
- PEP8
- Pareto principle: we document and support the 20 percent of tasks that you use 80 percent of the time.
- Documentation first.
Getting the site root: api.portal.get().
Moving an item: api.content.move(source=..., target=...).
It is documented. We document first. We write narrative documentation. The online documentation is pulled from the code and the comments in the code.
It is tested. We have about 95 percent test coverage. Narrative documentation is included in the tests. We have Continuous Integration set up with Travis CI.
Import and usage style:
from plone import api portal = api.portal.get() user = api.user.create(username='bob')
We have api.content, api.user, api.group.
It is used in the wild. There is tutorial.todoapp as a tutorial application you can try out. eestec.portal uses it. We have been using it in production for about a month on a portal with 100k objects and 300 users. No problems, although it is alpha code.
Where should you use it? In integration code? Yes. In add-on code? Likely. In core code? No.
In the future we should get api.role:
with api.role('Manager'): # Do something as manager
- api.env.debug_mode(), api.env.plone_version()
- api.system for running upgrades and things like that
We could create plone.jsonapi to package code around json.
We need lots of help.
- We want more translations of the documentation.
- Multilingual Sphinx on readthedocs.org?
- Show us your home-baked maintenance scripts.
- Sprint on this during the conference sprints.
Utopia would be that the Plone learning curve gets lower because of this and we can put up a small cheat sheet for new (or old) developers.
Fight for your rights as a developer!
Download plone.api and give it a spin on your development environment.
Code: https://github.com/plone/plone.api
Documentation: https://readthedocs.org/docs/ploneapi/en/latest/index.html
Steve and Andy: I think we should actually use this in the core code too. At least if a new package is using plone.api and this package gets moved into the core, then we should not require a rewrite without plone.api before it is accepted into the core.
Lightning talks
Lightning talks Wednesday at the Plone Conference 2012
Lightning talks on Wednesday during the Plone conference 2012.
Enrico: plone.gov.br
We love Plone. Brazil is the country of Plone. What about a Plone Conference in a sunny place? We present our bid for hosting the conference in Brasilia, in October 2013. We should be able to save some people at the Python Brasil conference. It's going to be a family enabled conference. Bring your family. Or maybe you can find a family there. We want to lower the total travel costs, arranging a plane for Plonistas. We are planning to get the conference paid partly with sponsorships. There is internet in this country. There are no monkeys on the street. So if you want to volunteer to spend three months there to help us out, you are welcome.
plone.edu
If you are in a university, please join our effort. June 2nd through 9th there is Plone Symposium East. We want to see a much larger foot print of Plone in education. Tomorrow there is an open space session.
Universities usually have a lot of portals and just a few people who handle them. Meetups can help us. We met at the Plone Konferenz in Munich. There will be a meetup at Pycon DE this year.
Dylan Jay- Earthquake
I work at Preta Web. Victorian SES wanted a CMS, multisite, secure, theming themselves, no failure in case of a disaster like an earthquake, with 99.99 percent uptime. It was offline during some fires and they wanted more, so they gave a tender for this. We won it. They made the Diazo rules themselves. We use lots of pipes: CDN, nginx, varnish, etcetera. Hosted in two data centers. In case of an earthquake everyone will hit this site at once. Taking a few minutes to get up a new cloud instance is too much here. We cached for a minute, which helps lots for handling this kind of traffic. Really easy and effective. First checked with Funkload, which is nice, but not enough traffic for us. So we got the hoster to test it for us. We handle a crap load of data. It spiked to 200,000 connections.
Godefroid Chapelle - collective.jekyll
Diagnose the content of your website. It shows information for editors about possible problems with content, like a too long title. It also shows information in collections.
Davide Moro - Ploomcake
Plone installer with several extra packages. Easy form generation with PloneFormGen. Slide show support. Easy for people who quickly want to try out Plone.
Domen Kozar - Substance D management interface demo
Application development environment built using Pyramid. I worked on this during Google Summer of Code this year. Kotti uses SQLAlchemy, where Substance D uses the ZODB.
Why make this? It has new concepts. I use it for customers who need only a basic feature set.
Patrick Gerken - Sentry
Sentry is a log server. Use raven for configuration (raven.contrib.zope). You see error messages coming in from your Plone instances. You get lots of extra information, like on which browser it happens.
Maurits van Rees - several packages
That would be me. Several packages quickly shown.
https://github.com/mauritsvanrees/talks/blob/master/fivepackages.rst
Open space: Diazo, Dexterity, Deco
Open space during the Plone Conference 2012.
This is an open space, actually two, during the Plone conference 2012.
Diazo
Execution of some diazo rules can be slow. Laurence Rowe has fixed some of this. Selecting body.someclass is faster than .someclass in diazo. Maybe we can add some debugging information to help in seeing which parts of the rules slow things down, but that is probably hard. collective.stats might be able to help there. There is a new lxml version that should have speed improvements, though maybe wait for the next dot release.
There is a branch of Diazo which has debug info. It should be possible to use this to present feedback in Plone itself, for example in the theme editor. Maybe in plone.app.debugtoolbar.
Moving html around in the content is difficult to do. Specifying the rules is probably the most tricky part, like what happens when a drop rule matches the same content.
Diazo is intended to replace macros, viewlets, and an alternative to customizing the main_template. For more specific pages, you may want to customize that page template after all.
The main Plone theme could be a Diazo theme. We could do that for Plone 5.
Diazo really makes things easier. You can let a php programmer do the theming in Diazo, without having them know Plone.
With plone.app.themingplugins you can create simple zope page templates and have them available as views in your Diazo theme without needing zcml registration. It does not work yet when you want to create this in the theme editor. That may be a good thing to sprint on.
Pick up and use plone.app.debugtoolbar and the theme editor and use it and we can make it better.
Just one more small trick: you can use an xsl variable to calculate an expression once and reference that in your diazo rules.
Using diazo as standalone option outside of Plone, without plone.app.theming, is still also possible.
You can use ESI, edge side includes. Currently that still requires nginx in the middle.
Diazo, Dexterity and Deco
We have lots of moving parts. We have not always weaved them together nicely. Aim: let's see what is left to do before we feel we have a more complete story.
Diazo is basically complete. Theme editor is mostly done. Theming the editing interface is still not something you like to do. We have CMSUI that can help here, getting the editing stuff out of the page. That needs more love.
Dexterity is pretty far along. On the filesystem it is fine. Once you get used to it, it is much easier. Archetypes widgets are mostly better. z3c.form has sensible stuff, but it has a lot of it. The TTW story for dexterity is fairly good as well. Creating a custom view for it is still something you need to do by hand, unless you use Diazo to transform the standard view we give you. You can still add a template in portal_skins, but apparently we broke something here that needs to be fixed.
Deco is supposed to solve some problems that we were using viewlets and portlets for. Have you seen what came out of the recent Sea Sprint? That is very usable. I believe tiles are a good technology. They feel better than portlets and viewlets. Changing the logo should become: change the logo tile instead of the logo viewlet.
Some things can go out at some point:
- portlets and viewlets
- core types replaced by deco
- Archetypes
- skin layers
- Python through the web? Replace with emergency script solution.
We need to figure out the migration story. If we remove this stuff, we need to have a migration path.
Installing extension packages without needing to run buildout or maybe not even restarting Plone would be good.
There are so many sites out there that do not need to have custom python or zcml. Some people will rather do without some features that require them to know those techniques.
Encolpe Degoute - Ways to investigate for the future of Plone
Talk from Plone Conference 2012.
Encolpe Degoute talks about ways to investigate for the future of Plone, during the Plone conference 2012. Let's look at Plone on various levels, from low to high, and see what can be changed.
Plone uses Python and C code.
What is the next Python to use? Options could be:
- CPython 2.7
- CPython 3.3
- Pypy
- Stackless Python
I think we should head for CPython 3.3 or Stackless Python.
Pypy does not (currently) use distutils, which is a big problem for Plone.
Does someone want to remove the GIL, Global Interpreter Lock? It would be good for performance, allowing you to use multiple CPUs, but it is hard to do.
For the network layer, Twisted is one of the worst frameworks to use. But it is written in Zope. So we should improve that, or switch. Synchronous versus Asynchronous. In Django you can switch the code that handles the network layer, for example Gunicorn. It is a big work, to be done in Zope 4 or Bluebream.
For storage we use the ZODB, storing objects as Python pickles. It uses a simple file (Data.fs) or a database (using RelStorage). A problem is that all transactions are stored in the ZODB, also when they are not useful anymore, which is why you need to pack the ZODB regularly.
Why Pickle? It is a Python specific format that can store binary objects. For more speed you need cPickle. If you want to replace it, you could use:
- JSON. It lacks schema validation. There is some variation in binary format.
- XML. You can use this to exchange messages, but it can be used as a storage format too. That should fit all the needs.
What can we improve in the ZODB?
- For B-Trees we can use stratified B-Trees, which is interesting for bigger sites.
- Better catalog indexes: use relational database power with RelStorage. The main developer of RelStorage does not want this in the core, it should be an extra package.
- Pack the ZODB: have a sub process that automatically cleans up old transactions.
Can we replace the ZODB? There are some production ready alternative databases, but they cannot completely replace the ZODB:
- Cassandra
- MongoDB
What about the basic framework, what can we improve there?
Have you looked with ZopeProfiler at a Plone site? Lots of things are called lots of times.
For a function of five lines, the initializing of the function normally takes more times than the execution. So we may want to use less functions. We need to use more Zope functions directly.
We need more asynchronouw services in Plone:
- Mail service
- transaction cleanup
- REST api
Can we switch to Bluebream and the ZTK instead of Zope 2? Are we ready for Zope 4?
For Plone, should we keep the CMF or push it in the ZTK? It was agreed that it was useful, but nobody wanted to do the work.
Which visual editor should we use? There are several options:
- TinyMCE
- FCKeditor
- Aloah
- VIE and Create.js
Main problem of all of them: integration.
In Plone we can use dexterity. We could switch everything to this instead of Archetypes. There is no toolkit currently to migrate content types and content objects from Archetypes to dexterity. That would be good to work on.
Have som file format integration. Plone should be able to create a documents from its internal format, like Open Document and PDF.
What about semantics? For example Schema.org. How can we include microformats in a Plone site? Did somebody work with Virtuoso?
So: lots of things that we could work on!
Asko Soukka and Jukka Ojaniemi - Plone, RabbitMQ and messaging that just works
Talk during the Plone Conference 2012.
Asko Soukka and Jukka Ojaniemi talk about Plone, RabbitMQ and messaging that just works, during the Plone conference 2012.
Why message queues? We needed to run asynchronous tasks. Difficult to do well within the ZODB, once you are talking about a decent amount of requests. So we use something external.
AMQP is like a postbox: Advanced Message Queue Protocol.
- A message consists of a label and payload.
- Producer is a program which sends messages to exchange.
- Consumer is a program which waits to receive the messages.
- Exchange sits between producer and consumer
- Bindings are routes from exchange to a queue.
- Queues store messages.
You can build several messaging systems, like publication/subscription and RPC (client to server and then back to client).
RabbitMQ implements AMQP. Written in Erlang. Industry tested and reliable.
Sounds difficult? Well, messaging in Plone can be easy.
Example with collective.zamqp for publish and subscribe announcement. Get a utility, register a producer and publish a message in basically three lines. Handling incoming messages: register an event handler for IMessageArrivedEvent.
Beaker comes with an asynchronous connection utility. Zope uses a similar technique under the hood, which handles transactions for us. To use collective.zamqp you need to define some additional zope configuration in your buildout.
Code and demos: https://github.com/datakurre/collective.zamqp https://github.com/datakurre/collective.zamqpdemos https://github.com/datakurre/chatbehavior
Other relevant links: https://www.rabbitmq.com/getstarted.html https://www.amqp.org/about/examples
Slides of this talk: http://goo.gl/RDYZc