Hi folks,

I looked into Zope quite recently and I'm very impressed of all its features.
After getting started with some basics, I'd like to make a real-world application,
migrating from a set of CGI-scripts written in Python but I'm still puzzled how to actually
solve my problem, especially using the dtml-tree.

I want to access information in a CORBA server which is more or less hierarchically structured,
so I'd like to use the neat trees to display the hierarchy and selecting one of the items in the
hierarchy directly should open a page with further information about that object.

As I have to use CORBA, an external method written in Python seems the only possible way
to make a connection from the tree to the server. In the How-To's, I found the following example
(http://www.zope.org/Members/anthony/tree-coding-tricks):

class _dummy:
   def __init__(self, name):
      self.name=name

   def child_lookup(parent):
      c = []
      for i in range(0,5):
         c.append(_dummy("%s.%d"%(parent, i)))
      return c

used like this:

<dtml-let name="0">
<dtml-tree id=name branches_expr="child_lookup(parent=name)">
<b><dtml-var name></b>
</dtml-tree>
</dtml-let>

This toy example is similar to what I would write, but I need to handle different object types on
different levels of the hierarchy. The tree can obviously only handle functions, not real CORBA
objects (as the note in the example section in the HowTo suggests...0, right? This means I have
to cope with large if-then-else constructs in the function given to branches_expr?

CORBA objects are identified by a so-called IOR which is some sort of a stringified object reference
but in a non-readable way. Can I use a non-unique 'display name' for each node in the tree and
some unique identfier (the IOR) internally?

Sorry for so many questions, but I haven't found a lot of info about using the dtml-tree together with
external methods.

Lars

Reply via email to