Extend with Zope 2
Brave New Content Type
----------------------
Alright, let's create a totally new content type, shall we? With
ArchGenXML_ we can easily create a basic new content type, let's call
it AudioEntry, that has the exact attributes that we need. Then
again, other people have already thought a lot about what a weblog
entry should contain and what it should do. We would introduce yet
another weblog application, which Plone does not really need and that
is currently only maintained by us. There are certainly occasions
where this is a splendid option, but not here.
.. _ArchGenXML: http://plone.org/products/archgenxml
The olden days of Zope 2
------------------------
Our second option is to extend Quills in the Zope 2 style: we create a
class AudioEntry that inherits from the Quills WeblogEntry. If our
class really offers something new, this is a fine choice. A good
example is RichDocument. This extends the Schema of ATDocument to add
a few attributes. The class inherits from ATDocument and so it uses
the functions already defined for that basic ATDocument and adds a few
functions that make sense for RichDocument. This is very well
documented in `Extending ATContentTypes`_ by Martin Aspeli.
.. _`Extending ATContentTypes`: http://plone.org/documentation/tutorial/richdocument/extending-atct
What would that mean for our use case of Extending Quills? AudioEntry
would inherit from WeblogEntry and extend it with two attributes for
the links. But it would not stop at that. For starters, a Quills
Weblog can currently only contain Folders and WeblogEntries. Adding
our AudioEntry there is not possible out of the box. Of course this
is changeable, but then we might also have to override the Weblog
class with our own AudioWeblog class. This can easily get out of hand
and result in a cascade of overrides. Also, when someone else has a
similar idea and introduces a VideoWeblogEntry, these two extension
products would be incompatible.
There are certainly use cases like RichDocument where this Zope 2 way
makes sense. But for our use case we simply want to add two links.
Is there no easier and less intrusive way to do this?
