[Zope-dev] Z Classes hangup.

Jeff K.Hoffman jkhoffman@usa.net
11 May 99 12:08:14 EDT


Hello,

I recently posted a message on the Zope list asking a very important (to us)
question about Z Classes, and haven't received a response, so I thought I
would try zope-dev instead.

I need to be able to create the following setup:

Z Class:
+ MyBaseClass (inherits ObjectManager, isFolderish)
  Methods:
  - index_html (DTML Method)
  - doc_a (DTML Method)
  - doc_b (DTML Method)

where index_html is:

<!--#var doc_a-->
<!--#var doc_b-->

and doc_a is:

This is Base Document A.

and doc_b is:

This is Base Document B.

Now, when I make the following (in Zope Management interface):

+ / (Root Folder)
  - MyBaseClassInstance (MyBaseClass)

I can browse to http://localhost/MyBaseClassInstance/index_html and see:

This is Base Document A.
This is Base Document B.

So far so good. Now, here's where I am having problems. I need to override
doc_a in the INSTANCE ONLY, like:

+ / (Root Folder)
  + MyBaseClassInstance (MyBaseClass)
    - doc_a (DTML Method)

where doc_a is:

This is Instance Document A.

such that navigating to http://localhost/MyBaseClassInstance/index_html
yields:

This is Instance Document A.
This is Base Document B.

When I try to drop doc_a (DTML Method) in MyBaseClassInstance I get a "Bad
Request" message, telling me the id doc_a is already in use. :( 

I don't want to have to make a new Z Class, and I don't want to mess with
index_html or doc_b at all (though I may, in another instance, want to change
index_html to reverse the order of doc_a and doc_b, or just redefine doc_b
instead, etc. Each instance will be unique. Changing the base class should
change all instances, except those which have overloaded the changed aspect.
As I understand it, Z Classes already do this just fine.)

Making a new Z Class works, but I'll end up with 300 (NOT an exageration) Z
Classes, and my Zope Management UI will be quite ugly (plus, it will require
all of our web developers to work in Control Panel all the time, which isn't
the usual way of doing things.)

I tried being a bad boy and patching the source such that _checkId's allow_dup
parameter defaulted to 1, but it didn't do as I thought it would. I shouldn't
be messing around in there, anyways, since I'm not very familiar with Zope's
internals, yet.

If only I can get this to work, my company will be using Zope on two MAJOR
deals we just got. I can't mention names, now, but I promise DC would benefit
from the press involved once the projects are complete. 

This is the only hitch in our gitty-up at the moment. How frustrating to be
sooo close. :^) HEEELP! :^)

Thanks,

--jkh

____________________________________________________________________
Get free e-mail and a permanent address at http://www.netaddress.com/?N=1