[Zope] Accessing hierarchical information in a CORBA server

vonWedel@lfpt.rwth-aachen.de vonWedel@lfpt.rwth-aachen.de
Mon, 4 Dec 2000 10:27:10 +0100


Dies ist eine mehrteilige Nachricht im MIME-Format.
--=_alternative 0034F414C12569AB_=
Content-Type: text/plain; charset="us-ascii"

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
--=_alternative 0034F414C12569AB_=
Content-Type: text/html; charset="us-ascii"




<br><font size=2 face="sans-serif">Hi folks,</font>
<br>
<br><font size=2 face="sans-serif">I looked into Zope quite recently and I'm very impressed of all its features.</font>
<br><font size=2 face="sans-serif">After getting started with some basics, I'd like to make a real-world application,</font>
<br><font size=2 face="sans-serif">migrating from a set of CGI-scripts written in Python but I'm still puzzled how to actually</font>
<br><font size=2 face="sans-serif">solve my problem, especially using the dtml-tree.</font>
<br>
<br><font size=2 face="sans-serif">I want to access information in a CORBA server which is more or less hierarchically structured,</font>
<br><font size=2 face="sans-serif">so I'd like to use the neat trees to display the hierarchy and selecting one of the items in the</font>
<br><font size=2 face="sans-serif">hierarchy directly should open a page with further information about that object.</font>
<br>
<br><font size=2 face="sans-serif">As I have to use CORBA, an external method written in Python seems the only possible way</font>
<br><font size=2 face="sans-serif">to make a connection from the tree to the server. In the How-To's, I found the following example</font>
<br><font size=2 face="sans-serif">(http://www.zope.org/Members/anthony/tree-coding-tricks):</font>
<br>
<br><font size=2 face="sans-serif">class _dummy:</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp;def __init__(self, name):</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; self.name=name</font>
<br>
<br><font size=2 face="sans-serif">&nbsp; &nbsp;def child_lookup(parent):</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; c = []</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; for i in range(0,5):</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;c.append(_dummy(&quot;%s.%d&quot;%(parent, i)))</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; return c</font>
<br>
<br><font size=2 face="sans-serif">used like this:</font>
<br>
<br><font size=2 face="sans-serif">&lt;dtml-let name=&quot;0&quot;&gt;</font>
<br><font size=2 face="sans-serif">&lt;dtml-tree id=name branches_expr=&quot;child_lookup(parent=name)&quot;&gt;</font>
<br><font size=2 face="sans-serif">&lt;b&gt;&lt;dtml-var name&gt;&lt;/b&gt;</font>
<br><font size=2 face="sans-serif">&lt;/dtml-tree&gt;</font>
<br><font size=2 face="sans-serif">&lt;/dtml-let&gt;</font>
<br>
<br><font size=2 face="sans-serif">This toy example is similar to what I would write, but I need to handle different object types on</font>
<br><font size=2 face="sans-serif">different levels of the hierarchy. The tree can obviously only handle functions, not real CORBA</font>
<br><font size=2 face="sans-serif">objects (as the note in the example section in the HowTo suggests...0, right? This means I have</font>
<br><font size=2 face="sans-serif">to cope with large if-then-else constructs in the function given to branches_expr?</font>
<br>
<br><font size=2 face="sans-serif">CORBA objects are identified by a so-called IOR which is some sort of a stringified object reference</font>
<br><font size=2 face="sans-serif">but in a non-readable way. Can I use a non-unique 'display name' for each node in the tree and</font>
<br><font size=2 face="sans-serif">some unique identfier (the IOR) internally?</font>
<br>
<br><font size=2 face="sans-serif">Sorry for so many questions, but I haven't found a lot of info about using the dtml-tree together with</font>
<br><font size=2 face="sans-serif">external methods.</font>
<br>
<br><font size=2 face="sans-serif">Lars</font>
--=_alternative 0034F414C12569AB_=--