[Zope] ZClasses derived from ObjectManager and Factories

Martijn Pieters mj@antraciet.nl
Tue, 11 May 1999 13:37:24 +0200


At 19:54 10/05/99 , Michel Pelletier wrote:


> > -----Original Message-----
> > From: Martijn Pieters [mailto:mj@antraciet.nl]
> > Sent: Monday, May 10, 1999 10:54 AM
> > To: Zope Mailinglist
> > Subject: [Zope] ZClasses derived from ObjectManager and Factories
> >
> >
> > This is more a question for DC than for the list:
> >
> > Will it be possible in the future to limit in what places
> > users can add
> > ZClass instances? I have one ZClass derived from
> > ObjectManager, let's call
> > it Container, and another called Element, a simple object,
> > and I want to be
> > able to add instances of Element to Container, but not to any other
> > ObjectManager derived objects (including Folders). Right now,
> > this means I
> > have to provide an alternative to manage_main..
>
>Here's a hint, Put a ZClass in another ZClasses method tab, create a
>constructor, and hange munge the Add select box for your Parent ZClasses
>manage_main (or whatever).

The hint helped :)

When you add a ZClass to the Methods tab of a Container ZClass (a class 
derived from ZObjectManager), and add a factory object to the same tab (the 
latest CVS version of ZClasses does this automatically, way to go Jim), 
then that ZClass is automatically addible to the contents of the container 
ZClass. You donīt even have to specify the class on the Subobjects tab.

ZClasses are absolutely great.

Now, about property sheets...

How can I add a PropertySheet that is extensible? I want to be able to 
extend the properties on certain objects from within a Zope application. I 
am developing a Template System, which I want to use in, say, a Press 
release module, and in a Job Offerings module. Either module may want to 
add itīs own properties. But I donīt want to have to subclass the Template 
Classes. I just want to treat them like DTML Documents, and inheriting from 
both DTML Document and ObjectManager creates all sorts of problems, and I 
donīt want to inherit from Folder either!

And about permissions:

Iīd like to be able to control who can add the newly created ZClasses, i.e. 
I want to specify the īAdd <ZClass Name>ī permission, and attach it to the 
methods that create my new object.

I also donīt see my newly created permissions on the security tab of any 
object outside instances of my ZClasses, so I canīt set permissions that 
are to be acquired from, say, the root folder. I also canīt set default 
Roles for my permissions.



--
Martijn Pieters, Web Developer
| Antraciet http://www.antraciet.nl
| Tel: +31-35-6254545 Fax: +31-35-6254555
| mailto:mj@antraciet.nl http://www.antraciet.nl/~mj
| PGP: http://wwwkeys.nl.pgp.net:11371/pks/lookup?op=get&search=0xA8A32149
------------------------------------------