On 05/24/10 09:25 AM, Dermot McCluskey wrote:
Karen,

> page 9, section 3.4.1.1
>
> The description of "parent" property says that it is a read-only
> property by
> consumers.  In the tree manipulation section,section 3.4.1.2, none of
> the append child API allow you to specify a parent object.  How do
> I create the tree structure?


There is automatically a top-level node called "DataObjectCache".
This is the same object that is returned from DataObjectCache.get_instance().

Users first add children to "DataObjectCache" and then create the
tree of objects from that level down.

So, you'll end up with a structure like:

<DataObjectCache>
<ExecutionCheckpoints>    # added by app/engine
<Checkpoint 1>
<Checkpoint 2>
<Discovered Targets>        # added by TD
<Disk 1>
<Disk 2>
<Arbitrary Data 1>
<Arbitrary Data 2>


- Dermot


Thanks Dermot.
Now, I understand how the tree is built based on Darren and your
answers.  Based on your answers, the steps to create the <checkpoint 1>
and <checkpoing 2> above would be this.  Assuming this is the psudo-code
the application will execute:

doc=DataObjectCache.get_instance()
exec_chkp = ExecutionCheckpoints()
doc.append_child(exec_chkp)
doc_exec_chkp = doc.get_first_child(type=ExecutionCheckpoint)
chkp1 = Checkpoint()
chkp2 = Checkpoint()
doc_exec_chkp.append_child(chkp1)
doc_exec_chkp.append_child(chkp2)

Is this correct?

I was confused because I didn't realize I need to
lookup the "parent" node in the DOC and then add
the child under it.  I kept thinking that I can just
call doc.append_child() with the name of the parent
somehow, and the call will do the look up for me, and
put the node under that parent.

Thanks,

--Karen



_______________________________________________
caiman-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/caiman-discuss

Reply via email to