[Zope-PTK] PTK Architecture (was Re: [Zope-PTK] ptk/zope newbie question- pleaseread)read)

Chris Withers chrisw@nipltd.com
Wed, 12 Jul 2000 23:33:06 +0100

"Dan L. Pierson" wrote:
> OK. The starting set of PTK document types (that can be created by
> members) are: News Item, Document, Link, File and Image.  

How would you go about adding new types of cotnent as a PTK User?

> They all
> inherit from PortalContent 

So, the PTK is, in essence, this class. Everything else (content review,
membership, etc) can be syphoned off and used elsewhere?

> and are defined by the following files in
> PTKBase: Document.py, File.py, Image.py, Link.py and NewsItem.py.
> The way that each of them is displayed is controlled by one of the
> following files in PTKBase/dtml: documentView.dtml, fileView.dtml,
> imageView.dtml, linkView.dtml or newsView.dtml (there are also
> similarly named *Edit.dtml files).

Yurch! ;-)

There was some talk of converting PortalContent to ZPatterns. would this
help solve this problem? (I'm still not up to scratch on ZPatterns ;-)

> This all means that to something like change the way the title of a
> news item is displayed, you have one of two choices: create a new
> Chrome (essentially a CSS style sheet) and have all your members use
> that (or edit the default chrome), or if you can't do what you need
> with the predefined CSS choices, 

But surely CSS can only control presentation style, not actual
presentation? What if you want to include your own bitmap on a page?

> edit files in Products/PTKBase/dtml
> directly.

Yurch! again ;-)

> Shane has said that he plans to make all of the base document types
> ZClasses, which would be a huge improvement.  

Do you mean register them as Base Classes so users can subclass them
using ZClasses?

> The main unclear
> remaining area is how much it will be possible to configure these
> ZClasses inside a Portal installation as opposed to editing the ZClass
> definition.  

I think this problem would go away if you could override methods of a
ZClass in an instance

...actually, that probably won't help here, except for methods of the
actual Portal object

> the best solution in the later case may be to make two subclasses of
> each relevant "master" ZClass.

Yeah, so basically you create a ZClass for each of your Portals that
inherits from one of the PTK Base classes. That seems the best way...

...of course, it'd be nice if you could do it from Python Products as
well, since ZClasses are so unstable right now ;-)



PS: This raises the issues of how you'd distribute your custom ZClases
as a distribution rather than as a bundle of zexp's that have to be
imported one by one ;-)