Plone

published Nov 03, 2021

This is here to serve as contents for the atom/rss feed for Plone, also read by planet.plone.org.

Plog Wednesday morning

published May 02, 2012

What are some of the topics in the Plone Open Garden in Sorrento?

More info about PLOG 2012: http://www.abstract.it/abstract-en/initiative/plone-open-garden-2012/

Guido Stevens: a social approach to Plone

No real social networking support in Plone currently. Web 2.0 is less state driven, more event driven. I tried approaching this with ZeroMQ. Downside is that you need to setup extra services outside of Plone. You need to store this somewhere. You need to integrate it within Plone. You can pull it in using a view, but can you search it?

For a client I have built a activity/discussion stream on the front page, which was basically just plone.app.discussion under the hood. You can do similar stuff with favorites/likes. Let's just see how far we come with this low hanging fruit, just using standard content types. For thousands of users this may not scale and you may need to use other solutions outside of Plone, but that is not the initial use case we are after. A plone.social suite.

Matt: we have something similar at NetSight. Danger may be performance: it only starts begin interesting with enough users, but then performance may become a problem.

Fred: make storage flexible, so for small cases you can just annotate the Plone Site root, and for larger cases you use a separate Data.fs

Matt: plone.com

Our main website is http://plone.org. It tries to appeal to developers, decision makers, users, everyone. Last year the Plone Foundation acquired http://plone.com. We want to use this to show people why they should use Plone. It could be just twenty pages of content, translated into various languages. Leading this effort are: me, Mark Corum, Carol Ganz.

Two things to do here:

  • A feature list of Plone. The old hands take a lot of things for granted, like the permission system, or being able to drag a folder somewhere else. Also, go through these features and see whether they are interesting for developers or end users.
  • Show case sites. Show some good examples that give a good idea of what you can do with Plone.

Maurizio: Case management

A bit of a business buzzword currently. Gathering information about a case (health, jurisdictional, etc), determing what it is. Plone probably has 90 percent of what is needed already out of the box.

Matt: blogs

Make Plone blogging a bit more like Wordpress blogging. Just have a nice overview with a big button 'Add blog post'. Sometimes it is just terminology. Maybe make a product with a skin that turns Plone almost into WordPress. You don't have to patch Plone every week for a new security fix. Usually for our customers of course we already have Plone, so using a blog in Plone means we do not have to add an extra technology stack.

Guido: Plone Innovation Awards

An idea that may be used in the Plone Conference in Arnhem. Have an awards website where you can nominate new technologies or solutions that have surfaces in Plone. Maybe use twitter for voting. Have a ceremony at the conference.

Giampiero: Google Docs

Google Docs is not always an acceptable solution, but sending around Word files edited in Windows and Mac and Linux via email is also not always working; I have seen lots of problems, like not being able to view it anymore. Something like that would be good in Plone. There is some xmpp stuff from Jarn.

Python Users Netherlands

published Feb 16, 2012

PUN meeting 15 February 2012.

The Python Users Netherlands (PUN) meeting on Wednesday 15 February 2012 was organized by Maykin Media in Amsterdam.

Remko Wendt, Maykin Media: Logging with Logbook

(I missed the first part as I was buying books at the nearby American Book Center, related to the ABC Treehouse where this PUN meeting is hosted; they sponsor this location.)

Logbook is a handy alternative to the standard logging module.

It is easier to disable debug logging and make it hardly take any time, contrary to the standard debug logging.

You can define a MailHandler that mails you at most 3 times per 5 minutes for the same error.

FingersCrossedHandler: only output debug level info when there is a problem .

You can use Logbook in combination with Sentry. This gathers log messages from several applications in one place, with statistics. See http://www.getsentry.com

See the Logbook documentation.

Sylvain Viollon, Infrae: Good and bad code

[Hurray: Sylvain is wearing an Emacs shirt. :-)]

I do open source because I want to reuse existing code: code that works, that helps me build my project. For me good code is reliable code. Professionally I want a high quality application that works for my customer.

Bad code is code that I can't reuse, because it is broken or it doesn't do what it claims to do.

Writing good code is writing code that works and fits my needs. Publish your code on PyPI so I can use it. Test your code, verify that it works in real life, under real conditions. Do not write tests only to get 100 percent test coverage. Handle errors and test them. Write code that is easy to test.

Respect the standards that are applicable to your application, for example the WSGI standards. Be polite to other parts of the system that you interact with. Actually look at the standards, instead of just guessing what will be the correct way.

Don't write fantasy code, code for hypothetical use cases that are never actually used. Keep it simple. Refactor your code later if needed.

Write documentation. Write simple documentation to get started. For me, doctest is not good enough for simple documentation. Maintain a changelog that is easy to find.

Listen to your users, so they can use your code. Update your code to make it usable by them or delegate that role to someone who wants to do it. Or better: make your code extensible so your users can be independent of you and continue development without you needing to watch it or spend time on it. Use dictionaries instead of if-statements [not sure how that would look, Maurits]. Create setuptools entry points. Use the Zope Component Architecture (which in essence is a nested dictionary). Do not EVER hardcode anything.

Audience:

  • Remco: be iterative; start small and release it. Your package does not have to be perfect the first time around and contain everything. Do not let doubts about how good your code is hold you back.
  • Good code is code that does just one thing, instead of a package that does eight things out of which just one thing is relevant for me.
  • Use PEP8, please.
  • Make easy tasks easy and make hard tasks possible.
  • If I can choose between code hosted on Launchpad and code hosted on github, I choose github.
  • 100 percent test coverage is still better than 80 percent test coverage. Sylvain: sure, but your 100 percent may have tested that your code can correctly divide 2 by 2, but you may still miss the more important corner case of dividing by zero.
  • If you write documentation but do not keep it up to date, you should be shot.

Reinout van Rees, Nelen en Schuurmans: Laptop setup: explicit automation

Do not just fool around. Collect everything. It it is not version controlled, it does not exist. I have my stuff on github: https://github.com/reinout/tools

There is a directory with some tiny shell scripts that probably each save four of five seconds of work per time (e.g. editignores.sh: svn propedit svn:ignore .). Also python scripts.

Symlink your dotfiles (.bashrc, .pypirc, etc): pip install dotfiles. Separate: ~/.emacs.d: Google for the starter kit.

I have a lot of packages on github, bitbucket, pypi, etc. But my dotfiles? Maybe not. I use a private repository on an own Linux box, like ssh://vanrees.org/~/git/Dotfiles, ssh://vanrees.org/hg/preken. (Yes, I do need to have my ssh key somewhere.)

I counted: I have 31 git, 22 subversion and 9 mercurial checkouts. I use checkoutmanager so I do not have to do git pull, svn up, etc in each directory. Also, checkoutmanager out checks if I have changes that are committed but not yet pushed to the central server. It's on PyPI and bitbucket: http://pypi.python.org/pypi/checkoutmanager

Backups. You should automate this, too. I have mail that is coming in on an own server and is automatically copied to gmail. Use git/hg/svn. Use the Time Machine when you are on the Apple Mac. Synchronize with Ubuntu One. Backup your own server when you have it, for example with backupninja.

Write a blog entry on your setup, so you can Google it the next time you need it.

You can also put a gpg encrypted file with secrets (passwords) somewhere in a version control system.

Plone 3 versus 4.1 Compatibility

published Dec 14, 2011 , last modified Apr 02, 2012

Add Plone 4.1 compatibility while avoiding breaking Plone 3 compatibility.

I see a bit too often that some kind soul adds Plone 4.1 compatibility to a package and then does not notice that Plone 3 compatibility is destroyed. In at least one case this is totally not needed and easily avoided.

The problem that people try to solve is that on Plone 4.1 a lot of packages will need to explicitly load the permissions.zcml file of Products.CMFCore. That could be done like this, but this is bad:



The problem with this code is that it breaks Plone 3 compatibility: the Products.CMFCore version used in Plone 3 does not have a permissions.zcml file! You will get an error like this when you try to startup your Plone 3 site:

IOError: [Errno 2] No such file or directory: '.../Products.CMFCore-2.1.2-py2.4.egg/Products/CMFCore/permissions.zcml'

Note that on Plone 4.0 the loading of this file works fine but is not needed, so avoiding it is probably very slightly better in startup time. No big deal though.

The proper way is to load this file conditionally. This is easy enough, with just two extra lines:



Of course if you know that for other reasons your package is not Plone 3 compatible then you could safely omit the condition. But it does not hurt to keep it for clarity.

All this is shown in the Plone Upgrade Guide at http://plone.org/upgrade, specifically here.

Note that the plone-41 definition that is used in the zcml:condition is defined in the meta.zcml file of Products.CMFPlone 4.1.3 as follows:



    
    


So if you think you could use something similar in your code, this is where to start looking.

Actually, it can be done simpler; the following currently works in all Plone versions:


Meanwhile, loaded with this knowledge you can participate safely in the Plone TuneUp this Friday 16 December 2011, and update some packages for Plone 4. Thanks!

Python Users Netherlands meeting 20 October 2011

published Oct 25, 2011

Summary of the Python Users Netherlands (PUN) meeting at 20 October 2011 in Amsterdam.

This month's PUN was hosted by Minddistrict, which has acquired The Health Agency (THA). Jan-Jaap Driessen introduced the companies. They build online tools for health care. Are you looking for a position of 1, 2 or 3 years at the Leuphana University (close to Hamburg, Germany)? They have a spot available there.

Jan-Jaap Driessen: Connecting the bots

Now for something more technical. We use buildbot to test our software. We use Selenium (using gocept.selenium) to test in a real web browser, including javascript. Instead of checking the end result of clicking with Selenium by going to a page, you can also check the database directly. We have a local browser farm, so with several versions of several browsers on several operating systems. You can try setting up something yourself or use the saucelabs paid service for this. So we have this setup:

zc.buildout + buildbot + selenium = nightly testing on all browsers

When this is running on saucelabs you can actually see the screen of the browser that is being tested at that moment! You can also see a video of it later and share that with your client to show that your software is working or that this particular bug has been fixed. The saucelabs service is pretty cheap actually, cheaper than setting up some hosts in the cloud yourself and keeping them running.

Boaz Leskes: PyCounters

PyCounters is a light weight library to monitor performance and events in production systems. We started this project because we had a performance problem. We had lots of layers in the system, so it was challenging to see where the bottleneck is. PyCounters gives us that. It is a combination of light weight events, counters to collect needed statistics, and reporters to regularly output statistics. Short example to see how many times per second a function is being called:

from pycounters.shortcuts import frequency

@frequency("req_per_sec")
def serve_a_request():
    """do something interesting and serve a request"""
    pass

Some possibilities:

  • We can calculate frequencies, average values per time, simply counting.
  • There is JSON file output.
  • A helper class for Munin plugins.
  • Support for counting what happens in a single thread or for using multiple processes or servers.

Future plans:

  • Using context managers (the with statement) is now planned, as decorators are not always fine grained enough.
  • Django specific counters.
  • More output formats (suggestions welcome).

See documentation at http://pycounters.readthedocs.org/ and source code at https://bitbucket.org/bleskes/pycounters

Note from Maurits: do not confuse this with the pycounters module of François Beausoleil which does something different, though it seems to have overlapping functionality.

Steve Alexander: Celebration, Motivation, Distribution

"Now we're talking." I was a python programmer, then I worked for Launchpad, then Canonical (making Ubuntu), then I did acting classes and stuff. Then I started a company to talk about how we work. We have really complicated brains. I am using a metaphor: the hero's journey. George Lucas used that same story to create the Star Wars movies. When we go to work we also go on a journey and we should enjoy it.

Some of us work alone, some in a community or team. Who is my team? What is my value to the team? We need to achieve a goal, for example fixing a bug or other issue somewhere in a tracker. You fix or create something and that means you add value to the team. That is the outer journey. There is also an inner journey, some kind of transformation that goes on. (Insert some Star Wars and Indiana Jones jokes here.) You have some personal 'Aha!' moments, where you discover amazing things, or that you can do amazing things. What those moments tell you is your team's value to you.

I wrote a blog article about celebrating the hero's journey. See http://blog.nowtalking.nl/archives/55. Lots of different reactions are possible from colleagues or clients when you tell them "Hey, I fixed a bug."

Frank Niessink: Ran 160242 tests in 13.716s

Task Coach: your friendly task manager. This is a project that has been going on since 2005. Done in Python of course, and some Objective C. It is open source. Runs on Windows, Mac OS X, Linux, BSD, iPhone. We try to release often; last year about twice a month. We have quite some downloads, in total at least 2 million downloads. More than 4000 users use it daily. Over 4500 unit tests and with 40 languages over 160,000 language tests. Translatable strings can contain keyboard shortcuts; translating this wrongly (e.g. translating Ctrl into German as Strg instead of leaving it at Ctrl) can actually crash the program. We have generated a unit test for each translation, like checking whether a translator forgot to add ... when necessary or indeed checking for program crashes.

Vincent Pretre: collective.autosaveform

collective.autosaveform is an open source project for Plone. A user has entered a lot of data in a web form, his internet connection quits and he gets mad because he has lost everything. With collective.autosaveform we save the form every five seconds or every click. We use localstorage for this in the browser, supported by IE8 and higher and normal browsers. After ten local saves we also send the data to the server so in case the browser crashes or something like that the data can still be made available later. When something bad has happened and the user is loading the form again, we compare the local and remote database versions and use the most recent. You need to register the form for autosaving in Plone with a few lines, and use one jQuery line in your javascript. It's configurable, friendly on the server and for the user, supported on multiple browsers, supports all HTML inputs except file. It should be pretty doable to make it work in Django.

See the slides.

Sylvain Viollon: context managers and generators to work on lots of objects

This is code that is hard to summarize, but you can do interesting things with context managers and generators, at least with Python 2.6 and higher. You can save some memory but more importantly you can save a lot of lines of code with good use of these utilities.

See his code at http://pastebin.com/hgqiSTVz. The long stretches of white space between the code parts should be seen as separating different versions of the code.

Remco Wendt: showing two python tools

vcprompt: show in the command line prompt which version control system (vcs) you are using, which branch, etc. There is a binary one, but you should use the Python one.

dotfiles: define a repository of dotfiles that you have in a vcs, show what dotfiles you have managed already and allow you to sync or override them, especially handy when on a new system.

Nederlandse Plone gebruikersdag 2011

published Sep 21, 2011 , last modified Sep 26, 2011

Samenvatting Nederlandse Plone gebruikersdag 2011

Op dinsdag 20 september 2011 was de jaarlijkse Nederlandse Plone gebruikersdag 2011 in De Balie in Amsterdam. Deze dag werd georganiseerd in een samenwerking van diverse Plone bedrijven. Naast goede gesprekken bij de koffie- en lunchpauzes waren er natuurlijk presentaties. Hier volgt een korte samenvatting van die presentaties, met links naar uitgebreidere samenvattingen.

De toekomst van Plone

Maarten Kling van Four Digits presenteerde over "Plone Next", de toekomst van Plone. In welke versie alle wijzigingen precies gaan komen staat nog niet vast.

Plone 4.1 is de meest recente versie. Van Plone 4.2 is een tweede alpha versie beschikbaar met onder andere een betere weergave van zoekresultaten en nieuwe collecties (verzamelingen) die op een eenvoudigere manier te beheren zijn. Naast plannen voor Plone 4.3 zijn er spannender plannen voor verder in de toekomst, of dat nu Plone 5 gaat heten of iets anders: een handigere interface (Deco) met meer vrijheid voor de webmaster; makkelijker themen van een website; CMS UI: een balk aan de bovenkant waar je knoppen hebt voor bijvoorbeeld het bewerken van de pagina, workflow, toevoegen van content, enzovoorts. De rest van de week gaan we tijdens de Living Statues Sprint hieraan met diverse ontwikkelaars werken.

Lees meer: http://maurits.vanrees.org/weblog/archive/2011/09/toekomst-plone

SalesForce

Wieteke den Uijl van Proteon en Pierre Broekarts van Unit 4 Consist presenteren een case study over de integratie van SalesForce met Plone. Unit 4 Consist gebruikt SalesForce als CRM systeem voor intern gebruik en voor marketing, sales, servicedesk, rapportages. In de oude situatie was er veel handmatig werk, dus dat was foutgevoelig. De klant had ook geen inzicht in de status van afhandelingen.

Ze hadden dus wat wensen: volledige CMS functionaliteit en automatische invoer in SalesForce. Hier is voor Plone gekozen, met extra functionaliteit voor de koppeling met SalesForce. Klanten weten nu waar ze alles moeten zoeken, namelijk op dit ene systeem.

Lees meer: http://maurits.vanrees.org/weblog/archive/2011/09/salesforce

Naslagwerken in Plone: publiceren zonder zorgen

Jan Murre van Pareto presenteert een case study over naslagwerken in Plone. KNMP publiceert het Informatorium Medicamentorum, een boek met duizenden grote pagina's medische informatie. Dat beheren we nu in Plone. Daarin hebben we custom contenttypes gebouwd, gebruiken rollen, permissies, workflow, check-out/check-in (je wijzigt bijvoorbeeld de homepage en laat anderen de wijziging controleren terwijl de oorspronkelijke versie nog zichtbaar is), een WYSIWYG-editor en full-text search. Een mooi overzicht van wat er zoal mogelijk is met Plone op dit gebied.

Lees meer: http://maurits.vanrees.org/weblog/archive/2011/09/naslagwerken

Lightning talks

Traditioneel werd het inhoudelijke gedeelte van de dag afgesloten met lightning talks, praatjes van ongeveer vijf minuten.

  • Paul Roeland: van Joomla naar Plone. http://schonekleren.nl is nu nog een oude Joomla site. Wordt Plone. We gaan transmogrifier gebruiken om de content om te zetten.
  • Yadi Dragtsma: Free publicity. Je hebt een mooi persbericht, maar zelfs het lokale suffertje pikt het niet op. Wat moet je doen? Een paar redactiewetten en speltips.
  • Kees Hink: Diazo. Voor http://www.iederz.nl/ hebben we een nieuwe website gebouwd in Plone, met Diazo als theming methode. Diazo haalt stukjes uit de website (Plone) en hangt dat in het html ontwerp.
  • Maurits van Rees (ondergetekende): collective.depositbox. Een klein python pakket om een geheime sleutel op te slaan om acties mogelijk te maken zoals het herstellen van je wachtwoord in Plone.
  • Thijs Jonkman: Diazo. Voor het themen van een site met Diazo hebben wij het Compass style framework gebruikt (met Ruby) om wat css stylesheets te maken die aardig goed zijn voor de gemiddelde Plone site, zodat nieuwe sites gemakkelijker worden.

Lees meer: http://maurits.vanrees.org/weblog/archive/2011/09/lightning-talks

Al met al een mooie dag waarin gebruikers en ontwikkelaars van Plone in Nederland elkaar ontmoet hebben.