cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mathias Wiegard <Mathias.Wieg...@student.uni-ulm.de>
Subject Re: Including - another problem
Date Sun, 26 Oct 2003 14:18:20 GMT
If you know the number of fragments you want to combine then aggregation
will really be the better (and in the sitemap more understandable) solution.
For e.g. scenarios like combining any number of row-results of a relational
database, "cinclude" would be your choice...

> Von: gounis@osmosis.gr
> Antworten an: users@cocoon.apache.org
> Datum: Sun, 26 Oct 2003 16:08:00 +0200 (EET)
> An: users@cocoon.apache.org
> Betreff: Re: Including - another problem
> 
> 
> hi jan
> 
> spend some time to see how aggregation work
> i had the need to merge content in the past
> my first aproaches was to include files
> 
> but many people in this list beleave that aggregation is a cleaner
> solution
> 
> use .xsp to produce xml fragments and then merge these fragments in
> a pipeline
> 
> <map:match pattern="*.xsp">
>    <map:generate src="resources/content/{1}.xsp" type="serverpages"/>
>    <map:serialize type="xml"/>
> </map:match>
> 
> <map:match pattern="FullContent">
> <map:aggregate element="site">
> <map:part src="cocoon:/content1.xsp"/>
> <map:part src="cocoon:/content2.xsp"/>
> </map:aggregate>
> <map:transform ... your transfromation ... />
> <map:serialize ... your serialization ... />
> </map:match>
> 
> the decision will be yours
> 
> --stavros
> 
> 
> 
> On Sun, 26 Oct 2003, Mathias Wiegard wrote:
> 
>> You include the xsp-Page as pure xml.. it hast to be compiled at runtime
>> because a xsp represents java-code. That's the job of the
>> serverpage-generator. Aside from that, your call of the xsp with the
>> "src"-Attribut searches for an matcher that matches
>> "resource/content/header" in the current sitemap. If you want to include
>> static xml-content you can use the "resource:" protocol (see the manual:
>> sitemap) in the future. But because of you have to compile with the
>> serverpage generator, do define a pipeline like this:
>> 
>> <map:match pattern="*.xsp">
>>     <map:generate src="resources/content/{1}.xsp" type="serverpages"/>
>>     <map:serialize type="xml"/>
>> </map:match>
>> 
>> Remember that this pipeline has to be in the "auth-protect"-Action to have
>> the authentication-Context! ;)
>> 
>> The line in the main document would look like:
>> 
>> <cinclude:include src="cocoon:/header.xsp"/>
>> 
>> hope it helps, enjoy the world of cocoon ;)
>> Mat
>> 
>> 
>>> Von: Jan Wielgus <list40@o2.pl>
>>> Antworten an: users@cocoon.apache.org
>>> Datum: Sun, 26 Oct 2003 14:33:37 +0200 (MET DST)
>>> An: users@cocoon.apache.org
>>> Betreff: Including - another problem
>>> 
>>> Hi again,
>>> 
>>> the stuff with cinclude works, but there is a problem, that only a
>>> static text is being included. My include "header.xsp" file contains
>>> the following:
>>> 
>>> <?xml version="1.0"?>
>>> <xsp:page language="java" xmlns:xsp="http://apache.org/xsp"
>>> xmlns:esql="http://apache.org/cocoon/SQL/v2"
>>> xmlns:xsp-request="http://apache.org/xsp/request/2.0"
>>> xmlns:session="http://apache.org/xsp/session/2.0"
>>> xmlns:xsp-session="http://apache.org/xsp/session/2.0"
>>> xmlns:xsp-session-fw="http://apache.org/xsp/session-fw/1.0"
>>> xmlns:cinclude="http://apache.org/cocoon/include/1.0"
>>>> 
>>> <message>
>>> Hallo, <xsp-session-fw:getxml
>>>        context="authentication"
>>>        path="/authentication/data/lastname"/>
>>> </message>
>>> </xsp:page>
>>> 
>>> And I include it in my main-document with:
>>> 
>>> <cinclude:include src="resources/content/header.xsp"/>
>>> 
>>> But only the word "Hallo" is in output on the main page.
>>> On the other hand, when I call "header.xsp" explicitly, than I see
>>> the result of <xsp-session-fw> on the screen.
>>> 
>>> What may be the problem?
>>> 
>>> Jan
>>> 
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>>> For additional commands, e-mail: users-help@cocoon.apache.org
>>> 
>>> 
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>> For additional commands, e-mail: users-help@cocoon.apache.org
>> 
>> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message