[Zope] Problems with nested ZClasses

Robert Roy rjroy@takingcontrol.com
Thu, 16 Mar 2000 22:54:46 -0500


--=====_95326528641=_
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: quoted-printable

Overview

I am trying to put an XML structure into a Zope product that mirrors the=
 hierarchy.

The dtd for the XML is roughly of the form
<!ELEMENT nodes (node)*>
<!ELEMENT node (node|leaf)*>
<!ELEMENT leaf (object)*>
<!ELEMENT object EMPTY> 

The 4 elements share several attributes and each has some unique=
 attributes. So the intent is to group the common attributes in a couple of=
 property pages and create an property page for each individual element.

The desired ZClass representation is as follows:
container (object manager)
    base () {to contain common property pages}
    nodes (object manager, base)
        node (object manager, base)
            leaf (object manager, base)
                 object()

I build the hierarchy, set permissions as follows and do the factory edit=
 button trick
container - add_nodes
nodes - add_node
node - add_node, add_twigs
twigs - add_objects

I instantiate a container, 
add a nodes object to the container, 
add a node to th nodes.

At this point I can only add twigs though I think I should be able to add=
 nodes. I thought I would look at the SubOjbects list however the only=
 object that appears in the Subobjects list is nodes.

Am I missing something here? I have tried countless permutations with and=
 without the base class, deriving base from object manager etc... I think=
 one of my prior iterations actually worked but without the base class=
 concept though I seem unable to reproduce it now...

Does anyone have any ideas?

Thanks 
Bob


--=====_95326528641=_
Content-Type: text/html; charset="us-ascii"

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=windows-1252" http-equiv=Content-Type>
<META content="MSHTML 5.00.2919.6307" name=GENERATOR></HEAD>
<BODY bgColor=#ffffff text=#000000>
<DIV>Overview</DIV>
<DIV>&nbsp;</DIV>
<DIV>I am trying to put an XML structure into a Zope product that mirrors the 
hierarchy.</DIV>
<DIV>&nbsp;</DIV>
<DIV>The dtd for the XML is roughly of the form</DIV>
<DIV>&lt;!ELEMENT nodes (node)*&gt;</DIV>
<DIV>&lt;!ELEMENT node (node|leaf)*&gt;</DIV>
<DIV>&lt;!ELEMENT&nbsp;leaf (object)*&gt;</DIV>
<DIV>&lt;!ELEMENT&nbsp;object EMPTY&gt; </DIV>
<DIV>&nbsp;</DIV>
<DIV>The 4 elements share several attributes and each has some unique 
attributes. So the intent is to group the common attributes in a couple of 
property pages and create an property page for each individual element.</DIV>
<DIV>&nbsp;</DIV>
<DIV>The desired ZClass representation is as follows:</DIV>
<DIV>container (object manager)</DIV>
<DIV>&nbsp;&nbsp;&nbsp; base () {to contain common property pages}</DIV>
<DIV>
<DIV>&nbsp;&nbsp;&nbsp; nodes (object manager, base)
<DIV>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; node (object manager, base)
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;leaf 
(object manager, base)</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
object()</DIV>
<DIV>&nbsp;</DIV>
<DIV>I build the hierarchy, set permissions as follows and do the factory edit 
button trick</DIV>
<DIV>container - add_nodes</DIV>
<DIV>nodes - add_node</DIV>
<DIV>node - add_node, add_twigs</DIV>
<DIV>twigs - add_objects</DIV>
<DIV>&nbsp;</DIV>
<DIV>I instantiate a container, </DIV>
<DIV>add a nodes object to the container, </DIV>
<DIV>add a node to th nodes.</DIV>
<DIV>&nbsp;</DIV>
<DIV>At this point I can only add twigs though I think I should be able to add 
nodes. I thought I would look at the SubOjbects list however the only object 
that appears in the Subobjects list is nodes.</DIV>
<DIV>&nbsp;</DIV>
<DIV>Am I missing something here? I have tried countless permutations with and 
without the base class, deriving&nbsp;base from object manager&nbsp;etc... I 
think one of my prior iterations actually worked but without the base class 
concept though I seem unable to reproduce it now...</DIV>
<DIV>&nbsp;</DIV>
<DIV>Does anyone have any ideas?</DIV>
<DIV>&nbsp;</DIV>
<DIV>Thanks </DIV>
<DIV>Bob</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV></DIV></DIV></DIV>
<DIV>&nbsp;</DIV></BODY></HTML>


--=====_95326528641=_--