You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lenya.apache.org by Thorsten Scherler <th...@apache.org> on 2009/07/11 23:06:10 UTC

Getting the direct parents of doc

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?

TIA

salu2
-- 
Thorsten Scherler <thorsten.at.apache.org>
Open Source <consulting, training and solutions>


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


Re: update codemirror form 0.60 to .061 ?

Posted by Andreas Hartmann <an...@apache.org>.
Rudolf Korhummel schrieb:
> Hi Lenya devs,
> 
> When we used cut and paste with the oneform editors sometimes blanks 
> between words got lost.
> I couldn't find out why, so I installed codemirror 0.61 (0.62 didn't 
> work) and the problem disapeared.
> Schould I update in trunk ?

+1, maybe we can give it some testing in the 2.0.3 release preparation 
session.

-- Andreas

> 
> Rudolf
> 
> 
> Am 12.07.2009 um 12:50 schrieb Thorsten Scherler:
> 
>> On Sun, 2009-07-12 at 11:10 +0200, Andreas Hartmann wrote:
>>> 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
>>
>> :)
>>
>>
>> Your are my hero! Thank you very much Andreas.
>>
>> salu2
>> -- 
>> Thorsten Scherler <thorsten.at.apache.org>
>> Open Source <consulting, training and solutions>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
>> For additional commands, e-mail: dev-help@lenya.apache.org
>>


-- 
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


update codemirror form 0.60 to .061 ?

Posted by Rudolf Korhummel <ru...@korhummel.de>.
Hi Lenya devs,

When we used cut and paste with the oneform editors sometimes blanks  
between words got lost.
I couldn't find out why, so I installed codemirror 0.61 (0.62 didn't  
work) and the problem disapeared.
Schould I update in trunk ?

Rudolf


Am 12.07.2009 um 12:50 schrieb Thorsten Scherler:

> On Sun, 2009-07-12 at 11:10 +0200, Andreas Hartmann wrote:
>> 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
>
> :)
>
>
> Your are my hero! Thank you very much Andreas.
>
> salu2
> -- 
> Thorsten Scherler <thorsten.at.apache.org>
> Open Source <consulting, training and solutions>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
> For additional commands, e-mail: dev-help@lenya.apache.org
>


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


Re: Getting the direct parents of doc

Posted by Thorsten Scherler <th...@apache.org>.
On Sun, 2009-07-12 at 11:10 +0200, Andreas Hartmann wrote:
> 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

:)


Your are my hero! Thank you very much Andreas.

salu2
-- 
Thorsten Scherler <thorsten.at.apache.org>
Open Source <consulting, training and solutions>


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


Re: Getting the direct parents of doc

Posted by Andreas Hartmann <an...@apache.org>.
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