[Zope-CMF] Types, meta_type, content_meta_type, etc...

Florent Guillaume fg@nuxeo.com
Tue, 9 Apr 2002 13:51:59 +0000 (UTC)

I'm under heavy deadline pressure right now so I'll throw in a few
keywords and get back on this later.

The core of it is: presentation and application logic must be kept separate.

Title is presentation.
Description is presentation.
DublinCore's Type is presentation.
TypeInformation's Type is presentation.
portal_type is application logic.
TypeInformation's id is application logic.

The fact that CMF uses Type for application logic is broken.
The fact that Title is confused with id is broken.
allowType should take a portal_type argument (i.e., TypeInformation's id).
The fact that allowedContentTypes does type checking on
  contentType.Type() is broken.
The fact that allowed_content_type, which should be application
  logic, stores things that are presentation, is broken.

folder_factories needes to get allowed content types,
 - for the user, thus presentation (in a non-English site
   it's totally unacceptable to see "News Item"),
 - to send it back to invokeFactory, thus application logic.

The current behavior mixes the two in an inextricable manner that
becomes apparent as soon as you go beyond the English language. Also
there was no problem until Tres (at my suggestion) enforced content type
filtering in invokeFactory, which only now reveals this deep mess
(actually I've had to deal with it for some time now).

More on this later, hopefully with patches (but the backward
compatibility problems are heavy).


Chris Withers  <chrisw@nipltd.com> wrote:
> Florent Guillaume wrote:
> > 
> > >   Finally, on this subject, I don't see why Type is catalogged, where
> > >   Metatype would be the correct one...
> > 
> > Forget that, I was confusing two things. Type is catalogged through
> > DublinCore and it's normal to have there the human readable information.
> The Type the DublinCore stuff uses is the same as that used by Type() everywhere
> else. It is, in effect, the content type as far as CMF is concerned.
> > The Metatype I was really thinking about was not meta_type but the one
> > in TypeInformation, that is, the content_meta_type. 
> That is merely the meta type of the python class used to create the python
> object. As Jeff already explained, there are plenty of cases where two content
> types will have the same metatype.
> > (But the skin news_box does a catalog search on Type=..., which is IMHO
> > a bit dubious.)
> What should it search on?
Florent Guillaume, Nuxeo (Paris, France)
+33 1 40 33 79 87  http://nuxeo.com  mailto:fg@nuxeo.com