Weblog
Untested code is broken code
Plone conference 2007, Naples. Speakers: Philipp von Weitershausen and Martin Aspeli
Plone conference 2007, Naples. Speakers: Philipp von Weitershausen and Martin Aspeli
"I know I should write tests, but I will just let my customer or the community do that for me. They should just report bugs." Not a good idea, especially if your app only fails in some code that only gets executed by your boss. He will not be happy if it fails.
So first write a test, then start coding. That is Test Driven Development (TDD). Core developers should know that and should not need to follow this talk. :)
With TDD you catch design mistakes early on. It can keep your code simple: if the tests all pass, why would you add more code because you think you might need it in the future, complicating the code?
Tests should exercise API. Demonstrate how to use them. Other developers are happy with this kind of tested documentation. You do this with doctests. They look like a python interpreter session with some paragraphs in between. We use restructured text, so it can be turned into html and pdf and is still readable on its own.
We also have Documentation Driven Development (DDD). You write doctests first. You write a science fiction story. You tell it to an imaginary user. Just use the words "we" and "you". You can put that story on the product homepage (plone.org, PyPI). It helps you keep in mind who you are actually talking to, instead of making documentation that only you or some core developers can understand.
Now Martin Aspeli gave a demo. He just wrote to the attendees list giving some links. I am sure he will not mind if I quote him here so others can read it too:I've checked in the examples to my two talks in the collective:
- http://svn.plone.org/svn/collective/examples/policy-buildout/ contains the sample code for the "Extending and customising Plone 3" talk. The slides are there too, in PDF format.
- http://svn.plone.org/svn/collective/examples/example.tests/ contains boilerplate examples for the different types of tests covered in the "Untested code is broken code" talk, which I gave with Philipp von Weitershausen this morning. This may be useful as it has well-commented test setup examples. I always copy and paste this stuff between my products, so now hopefully we can keep this in one place.
Open Source and Open Society: using Plone to build community online
Plone conference 2007, Naples. Speaker: Tom Moroz From: Open Society Institute
Plone conference 2007, Naples. Speaker: Tom Moroz From: Open Society Institute
I hope at the end of this talk you will see that you are all part of the open society.
I am from the Open Society Institute (OSI; do not confuse this with the Open Source Initiative). We aim to shape public policy to promote democratic governance, human rights, and economic, legal, and social reform. On a local level we have several initiatives to support education and other things. We build alliances across borders.
We have national foundations is 32 countries. Founder is billionaire George Soros from Hungary. He was effected by the philosophy of Karl Popper. We have programs and give grants in over 60 countries.
Key initiatives
Some of our key initiatives are:
- advocacy
- education, scholarships, school building
- media, information
- local government, make them more effective
- human rights, we look at that in all the other programs
- justice
- public health, HIV/AIDS mostly in Africa, tuberculosis in Russia
Open Source
A broad definition of open source: a set of principles that promote open access to the design and production of goods and knowledge.
This applies to software development, but also government, media (blogs are part of this), education, and business.
Key elements of both open source and open society:
- Knowledge is provisional and fallible. You have to check it. You have to be able to check it. An open source release is not going to be perfect in the first release. That release brings more people to the software and they check how good the software/knowledge is.
- Responsiveness: fix reported bugs quickly. Get a deep understanding of the problem and then fix it, which is the same in open society.
- Transparency: the code is open or the information is open. We publish numbers of how much is being spent where to rebuild Iraq.
- Pluralistic and multi-cultural. We respect minorities. (Plone cares about internationalisation, ed.)
- High degree of responsibility. The individual should interpret her value. No-one is forcing anyone to do anything. You feel responsible anyway. You are involved and want to be a good member of the community.
- Freedom and human rights are at the foundation.
- Social mobility and a matter of openness. It does not matter where you come from.
The path to Karl
In 2001 we did an intranet study but not much was done. It was not felt needed: surely the OSI would not be needed in 2010 anymore so why build a knowledge base? We were wrong. In August 2005 we had a board meeting. Several programs were working on HIV, but not much knowledge was shared. So we needed something to help us here.
We looked at closed source options. In July 2006 we decided to go with an Open Source solution as this was in line with our own goals and vision. Plone was chosen. May 2007: launch of our website Karl, version 1.0. Next Monday we will have a new launch.
The name is the first name from Karl Popper and it is also an acronym for Knowledge And Resource Locator. About 160 communities are already using Karl. We are amazed at that. People were not at all resisting the change. They wanted to use it soon.
The path forward
OSI shows the future global potential of collaboration. We are like a caterpillar that needs to change into a butterfly. It takes people collaborating in order effect that change.
Now on Technorati (or not)
By popular request
As Christian Scholz and Reinout van Rees requested, I have now added technorati tags to my post and claimed my blog at technorati.com. Now my posts should show up there as well, increasing the post count especially for the Plone conference 2007 (tag: ploneconf2007). This post is actually one step in the process to claim my blog at technorati.
To make it more applicable to plone, here is some code that I added to Quills (which is the weblog product I use) so the posts get the proper technorati tags. This is code for the entry_macros.pt file.
Technorati tags:
rel="tag"tal:content="topic/title_or_id"tal:attributes="hrefstring:${techbase}/${topic/getId}">Link to the topic
The state of the Plone
Plone conference 2007 Keynote talk, Naples. Speaker: Alexander Limi, Alan Runyan
A lot of people here are on the Plone conference for the first time. Over the last 12 months 84 people committed code to core Plone. That is a lot. Plone is among the top two percent largest open source projects in the world.
Plone 3 has arrived! A great release with few bugs. For the details, see the talk of Jon Stahl of yesterday. Infoworld put us in spot number two a few days ago, after Alfredo.
Plone has a lot of Rock Stars, too much to list here.
A lot of smaller sites are using Plone. You cannot make the major press enthusiastic enough to talk about that though. We now have some major sites though. http://www.novell.com, http://www.cia.gov/ (they might be here at the conference but we will never know), http://discovermagazine.com/ (which is really beautiful).
We have a recent book by Martin Aspeli: Professional Plone Development. We also have Content Management with Plone: Handbook for authors and editors by Thomas Lotze and Christian Theune.
Our own website http://plone.org has gotten quite a bit of attention. It is stable, using caching (varnish). The subversion repository was moved to another server so it could not bring the site down.
What happened with the Plone Foundation. In the United States you can now donate money with tax exemption. We received about 20,000 dollars this years. We are clear about our licensing, enforcing it. We have thirty trademarks now, most importantly the name Plone. Plone Solutions also had rights to this. They graciously have changed their name to Jarn to show their commitment to the community and their support of the Plone Foundation..
On the http://plone.net/ web site we have 200 providers listed, in 44 countries, and over 800 sites listed. There is much cool information there. We can use more case studies there though (18 now), so get your information up there.
How many people here have there own Plone company? (About 80 hands showed I think). And how many of them are searching for new developers? Roughly 60 percent.
The Plone logo is very recognizable. It is a bit pale though. Jola Hyjek is working on that, making it far more readable. It still looks like the original, so that it good.
The documentation area on http://plone.org/documentation was revamped. We made new, clearer categories. Check it out. Sometimes the important thing is getting rid of 14 documents about LDAP and turning them into one really good document.
PloneSoftwareCenter was redesigned, making it much simpler. You can search for products that support Plone 3.0.
The release of Plone 3.0 has been managed by Wichert Akkerman (wiggy on irc). (Applause.) Also applause for Alec Mitchell, who is still managing Plone 2.5 and has released 2.5.4 a few days ago.
Trends. You should look at Lennert Regebro's talk about what Zope did wrong (and right). Philipp von Weitershausen will talk about Zope 3, Grok, Plone working together. Testing is improving. Let's give a round of applause to the original Zope developers. It is ten years old and still holding up very well. The ZODB is still perfect for storing objects.
Everyone is busy. There is huge demand for Plone. It makes a lot of money. A lot of other open source projects struggle there. We have to try to lower the barrier of entry though: make it easier for people to start with Plone and contribute.
We van do better with evangelism. Let people know that you are using Plone and why you are using it. When Plone 3.0 was released I encouraged people to digg it at http://digg.com and we made the top in about 12 hours. We have enough people to do things like that. Blog about it, talk about it, comment about it, link to it.
"The future is here already, it is just not evenly distributed." So what does the future hold? A lot of it is just continuation of current developments. Lots of soft issues instead of only hardcore programming. See the points about evangelism, communication. Jon Stahl: "Approachable Plone". Plone needs to be simple. Joel did a talk about Plone as a humane CMS. Hard things need to be addressed. Darci Hanning is not a coder. She works at a library and made Plone very usable for libraries. I like those stories.
Plone 3.0 was a necessary big lift. It took a lot of time. We pulled it off. Now we want to release 3.1 faster. Small, focused, 100 percent compatible with Plone 3.0. No real new things, but polishing up, making things simple, no risky changes. 3.1 should not break anything that works on 3.0. Big things will go in 4.0 (or 3.5, we will see about the version number).
A lot of people moved from Vignette to Plone. Why is that? What can we learn from other projects. Where are they cooler than us and where do they fail? I like to hear more about that. That can give us a roadmap, a vision.
Talk to other people on the conference here. Meet new friends, exchange good and bad points about Plone. Give that info to the Plone developers.
Thank you for being here (or reading this).
Content rules
Plone conference 2007, Naples. Speaker: Kamon Aveya Company: Ingeniweb
Plone conference 2007, Naples. Speaker: Kamon Aveya Company: Ingeniweb
In Plone Content is king. Content is a first class citizen. You manage content. But we still do a lot of stuff manually: content modification, reviewing, publishing, awareness of content/workflow changes, collaboration, etc. Of course you can add python code to do some things automatically.
"Content rules" to the rescue! This is a new feature in Plone 3. It allows the Manager of the site to automatically do things with content.
We have a content rules engine. Rules allow automatic actions based on triggers. Rules consist of three parts: if an event happens and if a condition is True, some action is taken.
The main events that are available to the rules engine are: an object is added to a container (folder), or removed from it, or moved to another container, an object is modified, or its workflow state has changed.
Possible use cases:
- Moving contents automatically.
- Log content modifications in the event log or somewhere else.
- Provide notifications as a status message.
- Send email messages.
You get these use cases out of the box with Plone 3. They work already. So some of the things that you were doing manually or by writing some custom code yourself are now available by default.
What you can do, is manage News items better. You can put News items anywhere. You can have a Collection for having a central folder that shows all News items. But having News items all over the site is not very nice. So you can use a content rule: when a News item is published, it is moved to a specific central folder.
In the Content rules configlet in the Plone Control Panel you add a new rule with the workflow change trigger. You select some conditions then: do this for the content type News item and only for the publish transition. And you select an action: move it to a folder of your choosing.
Now you go to the root of your site and as Manager you click the Rules Tab. At that point you can say which content rule you want to use here and in sub folders if the rule is not activated globally.
You can add an email action. That has a field where you can use things like ${title} and ${url}.
Other examples:
Track the removal of content. This works already.
Prepopulate a folder, for example a MemberFolder. You can write an action for that. The start of an implementation would be:
class IPopulateAction(Interface): skeleton_folder = schema.Choice(...)
It is powerful and extensible. Use it when it makes sense for your use case!