cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeroen Reijn <j.re...@hippo.nl>
Subject Re: aggregating duplicate parameters at sitemap level
Date Thu, 08 Feb 2007 15:58:36 GMT
Hi Ron,

Ron Van den Branden wrote:
> Hi Jeroen,
> 
> Thanks a lot for this quick and helpful hint: I now manage to get an XML
> representation of the request with the RequestGenerator. That's
> excellent for XSL processing, but... I still don't see clearly how I can
> integrate this in the pipeline (sorry - I take full account of my
> ignorance).

No problem. I had to learn all of this myself too! :-) Well since the 
all request parameters are in the generator, you will not have to pass 
them to the transformer, since you already have them.
> 
> Jeroen Reijn schreef:
>>
>>
>> In that case the only thing you need to do in your sitemap is change 
>> your generate part to an aggregate and you will probably have to 
>> change your xslt a bit and that would be it.
>>
> Do I understand you correctly by thinking that you'd aggregate both the
> XML request representation (via RequestGenerator) and the requested XML
> source (via another pipeline) into an XML structure for further
> processing? Something like:
> 
>   <map:match pattern="processform.htm">
>     <map:aggregate>
>       <!-- get XML representation of request -->
>       <map:part src="???"/>
>       <!-- get XML source -->
>       <map:part src="???"/>
>     </map:aggregate>
>     <map:transform src="stylesheets/xml2htm/{1}.xsl">
>       <map:parameter name="use-request-parameters" value="true"/>
>     </map:transform>
>     <map:serialize type="xhtml"/>
>   </map:match>
> 
> Then the question marks are unclear to me...

You are correct with the above. The aggregate should in your case look like:

      <map:aggregate element="root">
        <!-- get XML representation of request -->
        <map:part src="cocoon:/requestAsXML"/>
        <!-- get XML source -->
        <map:part src="xml/{1}.xml"/>
      </map:aggregate>

As you might have noticed the first part calls another pipeline which 
generates the request. That should be:

<map:match pattern="requestAsXML">
   <map:generate type="request"/>
   <map:serialize type="xml"/>
</map:match>

Now you will have to change your xslt to handle the extra wrapping 
element and that should be it.

> 
>> Just as a side note: I always discourage use-request-parameters, since 
>> it can give you problems when using caching pipelines.
>>
> What alternative do you suggest?

Well it depends on what you want to do within your pipeline, but I 
always declare my request parameters separately. Using the 
use-request-parameters parameter will make all your request parameters 
end up in your cachekey (if your pipeline is set to caching). So if 
let's say some crawler runs by your website and the crawler uses a time 
stamp as a request parameter, all these request will get a seperate 
cachekey. It will enlarge your cache enormously.

> 
> Thank you very much,

Your welcome.
> 
Jeroen Reijn

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


Mime
View raw message