For quite a while I wanted to do a little writeup on plone.commenting actually :-)
What is it?
As you might have noticed the exisiting commenting framework in CMF/Plone is quite dated and has several drawbacks like
- it does not allow to workflow comments (you might want moderation for various reasons)
- it does not allow to insert spam protection mechanisms on various levels (e.g. Captchas or Akismet)
- it does not allow to be very much configured in any way
- it does not have a central management screen like for moderating or deleting events
As a matter of age it is of course also not written in a Zope 3 component compatible way.
Now that creating conversations on the net gets more and more important it is a big hurdle to have this old system in place. In fact if you look around the Plone blogosphere you will notice many blogs which have either no comments enable at all (are these blogs?) or only comments if you are registered and logged in. This is problematic of course because you want to make the barrier for commenting as low as possible.
How to solve it?
There have been some attempts to solve the problems before (e.g. EasyCommenting by Kai Diefenbach) and now it seems to be the time to take a step backwards to look at them, retrieve the good parts, learn from what might have been problematic and create an official Plone Commenting component. plone.commenting is born :-)
In fact the project was born during the Naples post conference sprint and me, Tom Lazar, Vidar and Kai have been discussing quite a bit what the use cases should be and how the structure should look like. The result can be read on the plone.commenting wiki page. Of course we didn’t just discuss, we also started coding although that is not yet too far but a start is made.
So here is what we have right now (mostly in the core package and thus no UI yet):
- plone.commenting is the core package
- plone.app.commenting is the Plone package depending on the core package
- comments can be created now (stored as an annotation on the actual object)
- comments can be nested, e.g. replied to.
- for each comment we now can retrieve their parent ids and child ids (parents are all the comments up to the actual object)
So the basics are sort of there although we might refactor quite mercely at some point. All these things are implemented as adapters, so for creating a comment you can simply write:
>>> comment = Comment(message=u"Uno cappuco, per favore!") >>> comment_manager = ICommentManager(obj) >>> comment_manager.add_comment(comment)
and so on. This can all be read in the doctests.
What is missing?
So what is missing at the infrastructure level is some sort of utility which keeps track of the comments of not only one object but of a whole tree or subtree of objects. It probably will be some sort of catalog as it needs to provide all necessary information for e.g. the global (or local) management screen. We also need to make sure the implementation here is efficient which means that we should have to wake up as few comment objects as possible (because a) you might have 10000 comments on one object and b) comments in the future might be audio or video as well). This will probably be the next big step.
After that we need some more work in plone.app.commenting which means defining the UI (wondering if we can use formlib and if we can somehow make it extensible as e.g. a captcha needs to hook in somewhere) and the workflow as well as a couple of views.
Spam protection will then be either done via workflow (one state should call akismet and decide where to go based on the result) or via some plugin which rejects the comment before even saving it (captcha). Moderation is of course workflow based then. We plan to use a normal DC Workflow here.
The plan is to mainly work on it at the Snow Sprint (Tom and I at least, not sure who else might come) but of course also before that if time permits.
So this is the state. If you want to check it you, have a look at the repositories for plone.commenting or plone.app.commenting. There is also a buildout you can use to setup your own sandbox (simply check it out, run ‚python bootstrap.py‘ followed by a ‚bin/buildout‘).