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.

Using interfaces in a Plone Product

published Jun 01, 2007

The eXtremeManagement product has seen lots of updates recently. I am writing a report for school about that. I will put the report online as a pdf file when it is ready. But I thought it would be nice to publish some parts in advance. Feedback can help me to make a better report. The intended audience is mostly Plone (partly Zope) developers. The teachers at school who are going to give me a grade for this should also be able to follow it though and they do not know much about Zope and Plone. So this blog entry and some others like it should be fairly readable also for programmers new to Zope and Plone (and python probably).

In Zope 3, interfaces are important. Interfaces are classes that define functionality. Other classes that claim to implement that interface should provide that functionality. The simplest kind of interface is the marker interface. An example is in interfaces/xmstory.py:

from zope.interface import Interface

class IXMStory(Interface):
    """eXtremeManagement Story
    """

It is called a marker interface because you can mark a class with it. Marking means that you claim that a certain class implements this interface. We do that in content/Story.py:

from Products.eXtremeManagement.interfaces import IXMStory
...
class Story(OrderedBaseFolder):
    ...
    implements(IXMStory)

On its own this does absolutely nothing. But now we can do something with this interface in other parts of our code. For example, in browser/configure.zcml we register a certain view or page only for objects that implement this IXMStory interface:


Details aside, this now means that the page with the name story is available exclusively for objects implementing that interface, instead of all objects, which would be much less clean.

As a first step it is enough to define marker interfaces for all our content types. So in the interfaces/ directory we have defined interfaces IXMProject, IXMIteration, etcetera.

Interfaces can be much more than just markers, though. They can define functionality. Objects that implement this interface then promise to provide that functionality. In the file timing/interfaces.py we define an interface like this:

from zope.interface import Interface
from zope.interface import Attribute

class IActualHours(Interface):
    """Actual hours and minutes worked
    """

    actual_time = Attribute("Actual time")

    def recalc():
        """Recalculate the total of bookings/actual hours.
        """

Any class that claims to implement this IActualHours interface must at least have an attribute actual_time and a method recalc. This is true for our Booking class, so we can claim to implement the interface. Instead of saying this in python code, like in the example for IXMStory above, let's now say this in timing/configure.zcml:


  

We will later see how this is used in practice.

Nieuwe versie site

published May 23, 2007, last modified Jun 04, 2007

De nieuwe versie van mijn website is in de lucht!

Mijn website heeft een nogal grondige opknapbeurt gehad. De inhoud is eigenlijk niet veranderd. Maar onderhuids is de boel volledig overhoop gehaald.

Eerst draaide mijn website op het web applicatie framework Zope 2.7. Nu zit er Zope 2.9 onder en het CMS (Content Management Systeem) Plone 2.5. Twee andere belangrijke nieuwe onderdelen zijn het weblog product Quills en LinguaPlone. Quills gebruik ik voor dit weblog en voor het weblog (preeklog, podcast , preekcast) van mijn kerk. Met LinguaPlone regel ik wanneer er Engelse en wanneer Nederlandse vertalingen van de inhoud zichtbaar zijn.

Oude links zouden nog steeds moeten werken, soms via een redirect.  Zie je ergens (hier of op andere sites) verwijzingen die niet kloppen, meld dat dan bij mij. De officiële locaties van de atom feeds zijn overigens wel gewijzigd. Dus als je van de feeds gebruik maakt, pas die dan graag aan. Verkeer naar de oude feeds wordt wel correct doorgestuurd.

Veel plezier met deze vernieuwde site!

New version of site

published May 23, 2007, last modified Jun 04, 2007

The new version of my website is live.

My website has got a rather thorough refreshing. The contents have not really changed. But underneath the surface a lot has been improved.

At first my website was running on the web application framework Zope 2.7. Now I have Zope 2.9 and the CMS (Content Management System) Plone 2.5. Two other important new parts are the weblog product Quills and LinguaPlone. I am using Quills for this weblog and for the weblog (podcast) of Dutch sermons from my church. With LinguaPlone I make sure that English and Dutch translations of content are visible at the right time.

Old links should still work, possibly through redirects.  Should you find any broken links here or on other sites, please tell me. The official location of the atom feeds has changed by the way. So if you are using them, please change to the new locations (visible in the portlet when you view the weblog).

I hope you enjoy the new site!

My Year at Zest

published Jan 12, 2007, last modified May 18, 2007

I made a report for school, about what I did the past year at my work.

I made a report for school, about what I did the past year (well, about nine months) at Zest Software. You can download the report (pdf). Read on for the preface and abstract of the report.

Preface

This report spans the period of May 2006 till January 2007. During that time, I was working for Zest Software in Hoogvliet, The Netherlands. This was part of the "dual route" of my study Informatics at the Rotterdam Institute for Informatics Studies (RIVIO) of the Hogeschool Rotterdam. I worked four days a week for Zest, and studied on Fridays.

Zest Software is a Plone company, so my work there is mostly in Plone and in Zope and Python as underlying technologies. But other subjects pop to the surface from time to time, like subversion, LDAP and Linux administration in general.

The main goal of writing this report is to convince Hans Manni from the Hogeschool Rotterdam that I learned a lot and worked hard these past months at Zest Software and that I should receive a good number of study points. But I like to give some extra zest to this report by making it relevant for a bigger audience, specifically Plone developers. I will therefore focus on three subjects that I think give a broad overview of what I have been doing and are also interesting to the general Plone community.

Just like in my last report, I can say that I have learned and laughed a lot at Zest Software and I thank my colleagues for that. I look forward to working on my final study assignment with them.

Abstract

After the introduction, the first subject is subversion. Importing your product in the collective shows how to move the code of your product from your own subversion repository to the Plone collective (or any other repository) including all the history.

In ldapconfig: connecting Plone and LDAP we take on a subject that is always good for a lot of questions on Plone mailing lists. Connecting with LDAP (or Microsoft Active Directory) is certainly doable, but there are some gotchas. To make it easier for us and for Plone developers in general to get this to work, we made ldapconfig, a product that tries to reduce the complexity of this subject to a relatively simple configuration file. This product is presented in the third chapter.

Last but not least is a tutorial on Zope 3 technologies: Embrace and Extend: The Zope 3 Way. Slowly but surely Zope 2 is being replaced by the newer and cleaner Zope 3. This makes it possible to extend existing Zope (or Plone) products in a very clean, non-intrusive way, that is future-proof.

By personal convention and as service to the reader, I have included the most important files that I created for this report itself in the appendices.

Ubuntu Linux: from Dapper to Edgy

published Nov 07, 2006, last modified May 18, 2007

I just upgraded my desktop and laptop computer from work to the new Ubuntu release. Some notes on the upgrade.

  • I had some trouble upgrading my desktop as I had the opera browser package installed (not supported by Ubuntu). Ubuntu wanted to change some directory into a symlink, but an Opera file was in the way. Solution: uninstall opera before you start upgrading (and install it again later if you want):
      dpkg --remove opera
    
  • I had previously installed firefox-dom-inspector. Somehow the upgrade didn't go so well for that part. In Firefox, in the Extra-Addons menu item, the Dom Inspector was listed as broken. Reinstalling it solved the problem:
      aptitude reinstall firefox-dom-inspector
    
  • The fonts in my Emacs editor looked a bit ugly or in the case of my laptop they were simply boxes instead of characters. The cause is that fonts were moved to a different location. So you have to manually edit your /etc/X11/xorg.conf file and change lines like:
      FontPath  /usr/share/X11/fonts/misc
      into:
      FontPath  /usr/share/fonts/X11/misc
    

Those were the three problems I had. For the rest it went smooth as always. And it all seems to work just fine. Kudos to the Ubuntu community!

Oh, of course when you have compiled and installed some programs yourself, you may need to do that again. For instance I needed to reinstall some Zope versions, as the standard Ubuntu python version has been updated to 2.4.4. This version is not expected by e.g. Zope 2.9.5; it wants 2.4.2 or 2.4.3. This should not be a problem I guess, but it does mean that you need to do:

    ./configure --with-python=/usr/bin/python

That makes the configure script accept your python version. Then I tried to make Zope, but this gave lots of errors. This was solved by installing some development packages:

    aptitude install build-essential