Ross Boylan wrote:
>
> I have a log composed of sublogs, and so on. I would like for people to be
> able to see some kind of summary (e.g., short versions of the logs down n
> levels) on the screen and then click on one of interest and see a fuller
> display of it.
>
> Is there a good way to do this using dtml?
>
> I've thought of two approaches. The "standard" zope
having recently debugged company's zope server, i can safely say that
there is no 'standard'.
> way seems to be to
> make each log folderish, and give each entry an id. Then I can embed the
> address in the html. The problem with this is that I would have to make up
> the id's and add extra machinery that the logs don't really need.
> I'm leaning toward a second approach, of getting an object id and putting
> it in the html. This also raises some issue.
you lost me. your problem with the first method is having ids for your
log entries and your second method starts with getting ids for your
objects.
looking ahead, YIKES, you just went from can i do this in dtml to
messing with python code in the guts of the ZODB. that was a SERIOUS
leap. IMO i'd highly recommend against messing with the zodb stuff, _p_
attrs are supposed to be reserved. i understand you want to treat them
as read only, but i wouldn't even go near it if it could be implemented
easily otherwise or i had developed a strong masochistic tendency and
already knew the zodb well (well enough to know the answers to the below
questions).
> This also raises some issue.
> * Will the id be stable in the face of the db potentially
> dematerializing objects underneath?
what id?
> * If I use a persistent id (_p_oid, I think), will that be stable?
see above commentX2.
> * (Also, I'll need to be sure everything has persisted, but I think I
> can do that by forcing a transaction end before getting the _p_oid).
transactions are important, but also telling it before hand that the
object is dirty and needs to be saved. you might want to read jim's
paper on the zodb. it and alot of other good material are linked from
http://www.zope.org/Members/itamar/LearningZope/LearningZope.html
> * Can I map from object id back to object? (_p_jar.something or other)
this is getting worse(scarier?) as i go on... i have no idea. consider
also that a url is also a unique persistent object id that maps into the
zodb, why your first method works.
> * Will this be robust across database changes (minimally, from ZODB to
> ZEO)?
> * Will the object id consist of characters which can be embedded easily
> in html?
>
...
there are alot of other ways to do this... of the top of my head
you could always store log entries in a sql db.
since you seem not adverse to doing it in python, despite your original
question...
so why not just write a python class for the log folder thats
persistent, add some methods for managing/storing log entries in a some
attr (maybe list of dicts) of the logfolder. write some dtml accessible
accessor methods to the attrs. write a dtml page for summary and one for
details.
kapil
_______________________________________________
Zope-Dev maillist - [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
** No cross posts or HTML encoding! **
(Related lists -
http://lists.zope.org/mailman/listinfo/zope-announce
http://lists.zope.org/mailman/listinfo/zope )