[Zope] ZCatalog, CatalogAware, and ZClasses
gtk
gtk@well.com
Mon, 18 Oct 1999 04:04:48 +1000
This is a multi-part message in MIME format.
------=_NextPart_000_00B9_01BF191D.EB46E0A0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
Okay, I'm completely stuck on this issue of how to create container classes
which can catalog the specific objects that are only available to that
container (ie one ZClass inside another).
Please excuse the attachment. I figure at 4K it's not much bigger than many
messages here and should be middling-okay. If you're reeeeally curious and
want to wade through the code, there it is.
> I have a project in development right now that uses a ZClass based on
> ZCatalog and ObjectManager. Works great.
I just tried that. Maybe it was the inheritance order, but I couldn't get to
any of the catalog management views. <checks something> Aha! Inherit
ZCatalog, THEN ObjectManager.
- create product "fooproduct"
- create ZClass fooproduct/foocontainer from ZCatalog, ObjectManager
- create ZClass fooproduct/foocontainer/foo from CatalogAware
- visit fooproduct/foocontainer_factory and click "change" (probably
un-necessary)
- visit fooproduct/foocontainer/foo_factory and click "change"
- visit fooproduct/foocontainer:permissions and change the permissions from
"add foocontainers" (why is that there?) to "add foos".
- visit fooproduct/foocontainer:subobjects and...
Problem #1: I can't put "foo" up as a subobject of foocontainer. Why not?
Problem #2: By hacking an index_html with a link to foo_addForm, I can add a
foo (so why can't I put foo in the list of subobjects?). Cool.
Unfortunately, this code in foo_add doesn't result in anything going in the
catalog:
<dtml-with "foo.createInObjectManager(REQUEST['id'], REQUEST)">
<dtml-call setCatalog(PARENTS[0],REQUEST)>
<dtml-call index_object()>
Changing the first argument to setCatalog doesn't make a shred of
difference.
Finally;
Problem #3: "Find items to ZCatalog" in an instance of foocontainer doesn't
permit me to add foos. Why not?
> In it I have one ZClass that inherits from CatalogAware, and with some
> twiddling in the constructor methods instances of the CatalogAware classes
> are indexing themselves in the container ZClass just fine.
I don't suppose you're willing to HowTo that one?
I'm trying to get a decent level of abstraction here by creating a
Regards,
Garth.
--
<gtk@well.com>
------=_NextPart_000_00B9_01BF191D.EB46E0A0
Content-Type: application/x-zip-compressed;
name="fooproduct.zip"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename="fooproduct.zip"
UEsDBBQAAAAIAFB/UicFhUye3g0AAIsxAAAPAAAAZm9vcHJvZHVjdC56ZXhw7RrJchvHlRBJgBxw
JyWRWuwWJJkjmwJl2bItB6SjhZQYiYtItmzTYSZDzFAYG8CgZxqCqCpccsoX5JRj8g2pVMV2vPua
pZKT9zWXVKpyyCWp5PUymB5gKNGUErsqQknsmen33rx+7/XbetZmXlhq47/Ub8TYPq7rOH2uUsku
ea5VzVOSwKngcg8l7Qs0WycdOh7ZdN28W6amU7Y9w7SsWdcrkU4dd0mCvyVJHfctzq5kL67OX523
acG1SApryl0XpdeaCG2aeep6W6Q7JPQG0SRLs3IyjVPBZQ8jscexSC/WgFBFctqHhwzDzBtFN28W
Dc8t2r5hkP46GcDdt92KbVolp0wG18kQ7lyswYvJsOnjLsPdeNnOU5+M6HWyV8fdJZuaBt2q2GQf
Tq2hC0XT98n+Qi/uUbkmo9U6GdML+3CarQ7J5R0AuHgxHQT4QwBfYCADzSDkMEw/xMj1rwGvaMn2
So7vO26ZPAzwB5vhjUoIgAD1CEPt4aiBmDItrASCPgoIxxgrjPQQgDRTPF6ld37lI6Gq3iLjoHNu
PeG8jjXl7gRTWFR6j4YE3iSP6bBqLmfbz4oLMoGT8uokw47jMhvS+IBM6oXoS08xtE7q0KJNHsfp
WddFgU2fjpH/EyGxt8mTeiFqtWeAWDUbWLkY95zSW409EUFTN49kpRMfVd+N4MqnXpUpBjnlSpWi
TWYtSdzumTWSWl1OtLXlLgPJaaTlLs+cuzidW51bvTozfc6ykEopNyme5yY5FECfX7z4Ijp/6cLi
1cXlqczRWf7LoKtzC1fg9hT8zp7NoOvy/gz/ZfhrTsdQh4cwxZhDYEYg4alMsxAz0zlqbhRtBkg9
uClMz1m5SRiQhuCXo9Z0TiyS7a8pat+iqGyW7CkHJiZhFhAnATPAl0+b8fzqRsmh6KZZrNpTGcR4
zUhIiT0p+MhNMn75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