[Zope] Management interfaces for ZPatterns applications
Itai Tavor
itai@optusnet.com.au
Thu, 17 May 2001 16:15:41 +1000
Hi,
I'm struggling with finding the best way to implement a management
interface for a ZPatterns-based application. In the past I've
implemented a custom interface for every application, but to keep my
current project simple, I'd like to take advantage of the existing
management interface. Problem is, it's not easy.
First, the manageInstances_html methods of my Specialists need to be
integrated into the management tabs. But /manage on a Specialist
gives me the standard Specialist management tabs, so I would have to
create a custom Specialist-subclassed Product for every Specialist,
just to add in my own tabs.
Second, I can't get the tabs_path to show anything useful. My
management links use absolute_url. So if, for example, I'm viewing a
Task at /my_site/Tasks/123/manage_edit and I click on a subtask link,
I get /my_site/Subtasks/456/manage_edit - so the tabs_path doesn't
show the object's context. If I avoid using absolute_url, in the same
case I would get /my_site/Tasks/123/Subtasks/456/manage_edit, which
is a bit more useful but also ugly and confusing.
So, what does this leave me with? Create a Python Product for the top
level of the application and for every Specialist that needs to
display a UI for the classes it manages. Then, override
tabs_path_default with a method that somehow figures out the right
path to display. And how would that work? I still think management
links should use absolute urls, so I need to somehow build the path
back from the displayed object, without relying on the traversal
path. I could get every object supply a parent_id, then I would have
to scan all the Specialists to find that parent, display it, and go
on to locate its parent. KISS goes out the window.
Can anyone throw some ideas on how to simplify this mess? I'm
starting to think my life would be a lot easier if I didn't use
ZPatterns and just used object managers to store contained objects...
but I don't want to give up ZPatterns yet...
TIA, Itai
--
--
Itai Tavor -- "Je sautille, donc je suis." --
itai@optusnet.com.au -- - Kermit the Frog --
-- "What he needs now is understanding... and a confederate victory" --
-- Dr. Jacobi, Twin Peaks --