[opencms-dev] How to get find the siblings of a resource

Paddy Kalathur paddy at efoundry.com
Thu Jun 16 01:49:53 CEST 2005


Got it --- 

	CmsObject o = CmsFlexController.getCmsObject(request);
	String strPagename = cms.getRequestContext().getUri();
	List siblings = o.readSiblings(strPagename, CmsResourceFilter.ALL);
      for (int i = 0, l = siblings.size(); i < l; i++) {
        	String vfsName =
((CmsResource)siblings.get(i)).getRootPath();
		out.write(vfsName + "<br>");
	}

This should work fine .  

-----Original Message-----
From: opencms-dev-bounces at opencms.org
[mailto:opencms-dev-bounces at opencms.org] On Behalf Of Paddy Kalathur
Sent: Wednesday, June 15, 2005 7:34 PM
To: 'The OpenCms mailing list'
Subject: [opencms-dev] How to get find the siblings of a resource 

I am trying to find if a resource has sibling and what is the path of the
sibling . 
I see that CmsObject.readSiblings("strPagename", CmsResourceFilter.ALL)
should give me what I want . 
The question I have is how should I get the CmsObject . 

When I do
CmsObject o = OpenCms.initCmsObject("Guest"); 

It does create a CmsObject but the documenttion say that it  select the
"Online" project . 
I do not want it to select the "Online" project . 

Paddy Kalathur
eFoundry Corp
http://www.efoundry.com
978-371-3325



_______________________________________________
This mail is send to you from the opencms-dev mailing list To change your
list options, or to unsubscribe from the list, please visit
http://mail.opencms.org/mailman/listinfo/opencms-dev




More information about the opencms-dev mailing list