outstanding zclass questions.
Maybe I'm getting tunnel vision after fudging about with zclasses for the better part of a week but can somebody pls enlighten me on the following (or better still offer pointers to the precise point in the documentation) : 1. Once you've created a Zclass, how do you modify the base classes ? 2. If you have a product containing several Zclasses within Zclasses, why must all of the zope permissions for these Zclasses stay in the root folder of the product ? 3. Are there are any caveats against renaming Zclasses ? I renamed a class and the instances created with it broke (ie. methods failed). That's SNAFU with Lotus Notes but I thought that Zope's Zclasses are truly OO and can handle it. 4. Is it possible to 'lose' orphans within the ODB (just like orphan documents in Lotus Notes) ? ie. or should class-level changes propagate through to all instances of the class including deletions ? (this is essentially the same as question 3.) 5. Zclasses and Zcatalog : once items have been added to a ZCatalog, why aren't there pulldowns or multiple select boxes under the MetaData Table and Indexes tabs so that people can choose which properties or objects are available ? DC did this so consistently for all other management screens in Zope that this omission makes me wonder if I'm missing something here. (It seems that such a feature would ease use and reduce error.) 6. As per previous email and post : what permissions need to be set in order to create a product that has a zclass within a zclass ? Has anyone got this working yet (other than Kevin Dangoor who didn't use the standard zope permissions in KmNews) ? Thank you very much - sorry for so many questions but I've really been chasing my tail for the past 3 days - and run out of documentation. chas
chas wrote:
Maybe I'm getting tunnel vision after fudging about with zclasses for the better part of a week but can somebody pls enlighten me on the following (or better still offer pointers to the precise point in the documentation) :
1. Once you've created a Zclass, how do you modify the base classes ?
Currently this can only be done in Python.
2. If you have a product containing several Zclasses within Zclasses, why must all of the zope permissions for these Zclasses stay in the root folder of the product ?
I didn't realize that was the behavior. There may be a reason for it, I'll ask Jim.
3. Are there are any caveats against renaming Zclasses ? I renamed a class and the instances created with it broke (ie. methods failed). That's SNAFU with Lotus Notes but I thought that Zope's Zclasses are truly OO and can handle it.
I belive you can rename them as long as the class id is the same. did the class id change also? This would break your instances.
4. Is it possible to 'lose' orphans within the ODB (just like orphan documents in Lotus Notes) ? ie. or should class-level changes propagate through to all instances of the class including deletions ? (this is essentially the same as question 3.)
Class level changes will propagate. I think any orphan situation were cleaned up when we added class ids.
5. Zclasses and Zcatalog : once items have been added to a ZCatalog, why aren't there pulldowns or multiple select boxes under the MetaData Table and Indexes tabs so that people can choose which properties or objects are available ? DC did this so consistently for all other management screens in Zope that this omission makes me wonder if I'm missing something here. (It seems that such a feature would ease use and reduce error.)
Because the Catalog assumes no forknowledge about the objects it can catalog. Any attribute of any set of object can be indexed. There is no way for the Catalog to know, in advance, what possible attributes can be indexed.
6. As per previous email and post : what permissions need to be set in order to create a product that has a zclass within a zclass ? Has anyone got this working yet (other than Kevin Dangoor who didn't use the standard zope permissions in KmNews) ?
This would need to be documented. Even I'm unclear on the details. Isn't this the same as question number 2? ;)
Thank you very much - sorry for so many questions but I've really been chasing my tail for the past 3 days - and run out of documentation.
Note that Zope 2.0 is the first system to have anything resembling ZClasses. They are sure to evolve over time, like all things. -Michel
Thanks for the speedy replies Michel,
2. If you have a product containing several Zclasses within Zclasses, why must all of the zope permissions for these Zclasses stay in the root folder of the product ?
I didn't realize that was the behavior. There may be a reason for it, I'll ask Jim.
Cheers.
3. Are there are any caveats against renaming Zclasses ? I renamed a class and the instances created with it broke (ie. methods failed). That's SNAFU with Lotus Notes but I thought that Zope's Zclasses are truly OO and can handle it.
I belive you can rename them as long as the class id is the same. did the class id change also? This would break your instances.
No, I just renamed them - but I'll presume that the errors were due to mistakes in my system... my site/odb is becoming a real mess with so many zclasses being created, edited, deleted. On this note, is there any equivalent (or need) for Notes' "compact" ? (I hope not). It's just that my ODB is getting fat/bloated very quickly and I'm wondering if deleting objects/instances completely frees all the space associated with them.
5. Zclasses and Zcatalog : once items have been added to a ZCatalog, why aren't there pulldowns or multiple select boxes under the MetaData Table and Indexes tabs so that people can choose which properties or objects are available ? DC did this so consistently for all other management screens in Zope that this omission makes me wonder if I'm missing something here. (It seems that such a feature would ease use and reduce error.)
Because the Catalog assumes no forknowledge about the objects it can catalog. Any attribute of any set of object can be indexed. There is no way for the Catalog to know, in advance, what possible attributes can be indexed.
Yes, the catalog can not know in advance what attributes to index. But we tell it what objects to catalog and so it should be able to just like the properties for these (in <object>.<property> format perhaps). Sorry I didn't explain this clearly enough. 1. create a new zcatalog instance 2. click on the 'find items to zcatalog' tab 3. add the classes that are to be cataloged and any filters now that the classes have been identified, you could list the properties in pulldowns/selections. i only mention it because it would : a) be easier than switching back to zclass definition to check what properties are available. b) offer confirmation to the user that s/he has indexed/cataloged the correct items (and not too many extraneous items). Anyway, it was just a thought.
6. As per previous email and post : what permissions need to be set in order to create a product that has a zclass within a zclass ? Has anyone got this working yet (other than Kevin Dangoor who didn't use the standard zope permissions in KmNews) ?
This would need to be documented. Even I'm unclear on the details. Isn't this the same as question number 2? ;)
Sort of - it all comes down to "how do we use zope permissions ?". But question 6 describes a situation that many people will find themselves in when building products with nested classes. Are they broken or is there some secret voodoo mantra that we must chant to get it to work ?
Thank you very much - sorry for so many questions but I've really been chasing my tail for the past 3 days - and run out of documentation.
Note that Zope 2.0 is the first system to have anything resembling ZClasses. They are sure to evolve over time, like all things.
Yes, I know - I wasn't meaning to complain... just trying to justify the long (and repeated) posts to the list. I guess that's why it's called the bleeding edge. ;) chas
On Sat, 11 Sep 1999, chas wrote:
6. As per previous email and post : what permissions need to be set in order to create a product that has a zclass within a zclass ? Has anyone got this working yet (other than Kevin Dangoor who didn't use the standard zope permissions in KmNews) ?
This would need to be documented. Even I'm unclear on the details. Isn't this the same as question number 2? ;)
Sort of - it all comes down to "how do we use zope permissions ?". But question 6 describes a situation that many people will find themselves in when building products with nested classes. Are they broken or is there some secret voodoo mantra that we must chant to get it to work ?
Ok, I've been playing around with this for the past two days, and here's what I've been able to figure out so far: 1) Create a Product. 2) Create a ZClass (Class1). 3) In Class1, create a ZClass (Class2). 4) Go back to Class1 and open the "Permissions" tab. Highlight "Add Class2". Click Change. 5) Go back to the "Methods" tab. Open "Class2_factory". Click Change (without changing anything). 6) Go to the root of your Zope installation and add Class1. Open Class1 and click Add. Works here! I think the key step in getting it to work correctly is top open "Class2_factory" and click Change. I don't think it's setting up the link to Class2_addForm correctly when it first gets created. Nick Garcia | ngarcia@codeit.com CodeIt Computing | http://codeit.com
participants (3)
-
chas -
Michel Pelletier -
Nick Garcia