lenya-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andreas Hartmann <andr...@apache.org>
Subject Re: Getting the direct parents of doc
Date Sun, 12 Jul 2009 09:10:59 GMT
Hi Thorsten,

Thorsten Scherler schrieb:
> Hi all,
> 
> I was following our tutorial at 
> http://lenya.apache.org/docu20/tutorials/usecaseTutorial/usecaseTutorialPart2.html
> and found:
> 
> Document doc = getSourceDocument(); Document[] allDocs =
> doc.area().getDocuments();
> 
> Now I know how to get all documents but my question is how to get
> only the direct parents of the node till the first node?

SiteNode node = doc.getLink().getNode();
List<SiteNode> ancestors = new List<SiteNode>();
while (!node.isTopLevel()) {
   SiteNode parent = node.getParent();
   ancestors.add(parent);
   node = parent;
}

(please excuse any errors, but this should help to get the general idea)

HTH,

-- Andreas



-- 
Andreas Hartmann, CTO
BeCompany GmbH
http://www.becompany.ch
Tel.: +41 (0) 43 818 57 01


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org


Mime
View raw message