W3C home > Mailing lists > Public > www-jigsaw@w3.org > May to June 2002

How to get parent's identifier?

From: Mudry julien <jmu@elca.ch>
Date: Thu, 6 Jun 2002 08:16:50 +0200
Message-ID: <A13B47F8EC3FD111A91500C04FD2A2820274685D@exchange.elca.ch>
To: "'www-jigsaw@w3.org'" <www-jigsaw@w3.org>

Hello everyone

I'm not 100% sure that this is the right place to ask
my question (as I didn't really understood what should
go here or to jigsaw@w3.org) and I hope I'm not mistaken.

Summary of my problem: I'm trying to use the getParent
method from the Resource class to gain access to the
identifier of my resource's parent, but this does not
seem to work as I expected.

First, some background information for my problem. 
Here's the resource tree that I have in Jigadmin 
(on the "Docs space" tab):

   Root (DirectoryResource)
     |
     |---- zeiram (VirtualHostResource)

When I open the VirtualHostResource, here's its
frames tree:

    zeiram
       |
       |---- forward (MyForwardFrame)
       |
       |---- pool (MyPoolManager)
               |
               |---- object1 (MyResource)

(In these graphs, I always put the identifier name followed
by its class name enclosed in brackets.)
The MyResource and MyPoolManager classes both extends
the ResourceFrame class and the MyForwardFrame class
extends ForwardFrame.

From the pool object, I'd like to be able to read its
parent's identifier (ie "zeiram" here) in pool's initialize
method. By reading the API documentation, I thought that the
following code should do the trick:

   String parentID = "";
   ResourceReference rr = getParent();
   try {
      Resource r = rr.lock();
      parentID = r.getIdentifier();
   } finally {
      rr.unlock();
   }

and I thought that the parentID's value would be "zeiram", but
I get "root" (which for me is its grand-parent identifier).

Could somebody be kind enough to point the correct way for
accessing my VirtualHostDirectory's identifier from one of
its children?

Thanks in advance.

Best wishes,

	Julien
Received on Thursday, 6 June 2002 02:16:57 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 9 April 2012 12:13:36 GMT