You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by ku...@klup.de on 2011/02/14 16:12:05 UTC

Re: Re: Support & Traxtransformers

Hi Alec,

yes, that's my suggestion. Let the call be done by the CInclude transformer.

Regarding the User-Agent :
I had to dig into my own code and realized that I once built some slightly changed versions of CInclude and SourceUtil. The reason once was the need to make a completely dynamic SOAP call, so I had extend to the CInclude transformer.

If someone's interested, I would share the code, of course !

Greetings

Andreas

----- original Nachricht --------

Betreff: Re: Support & Traxtransformers
Gesendet: So, 13. Feb 2011
Von: Alec Bickerton<al...@net-m.ch>

> Hi Andreas,
> 
> I know this is the wrong approach, I'd like nothing more than to throw 
> the whole mess away and start again. The situation is something that has 
> evolved over many years but I'm trying to make as much of it sane as 
> possible while not breaking the existing functionality.
> 
> http://cocoon.apache.org/2.1/userdocs/cinclude-transformer.html doesn't 
> explain how I'd set the User-Agent, does this happen automagically?
> 
> As I stated previously, the url is generated dynamically inside xslt1 as 
> an xsl variable and the document call is made from the same xslt. the 
> result being copied as
> <dynamic><xsl:value-of select="document($url)" /></dynamic>
> 
> If I understand what you're saying, I need to modify xslt1 to generate a 
> "<cinclude:include src="url"/>" instead, and then use cinclude to fill 
> in the blanks. Am I correct?
> 
> Regards,
> Alec
> 
> On 02/12/2011 05:57 PM, kuehne@trustable.de wrote:
> > Hi Alec,
> >
> > the document() function is always a bad approach !
> > Try to use cocoon's own tools to aggregate the content. If it's a
> quasi-static content, use map:aggregate with two ore more map:parts. If you
> calculate the target of your call sdynamically, use the CInclude
> transformer.
> >
> > We used these approaches for a heavy-load productuon system and see very
> good performance of the syetem.
> >
> > Greetings
> >
> > Andreas
> >
> > ----- original Nachricht --------
> >
> > Betreff: Support&  Traxtransformers
> > Gesendet: Sa, 12. Feb 2011
> > Von: Alec Bickerton<al...@net-m.ch>
> 
> > Hi,
> > We're running a number of sites using cocoon 2.1.9 and have problem with
> > the TraxTransformer.
> >
> > We have some xslts that make use of document($url) to retrieve some data
> > from an external service. The problem is that some of these external
> > services require the useragent http-header to be propagated from the
> > original request, in order to provide a device specific result.
> >
> > Having googled for what seems like days. I think this is possible to do
> > with a URIResolver. Can anyone here suggest a way to do it ?
> >
> > e.g.
> >
> > request ->  generatorX ->  xslt1 ->  xslt2 ->  serialize
> >
> > xslt1 matches a DSL element and calls document(
> > http://someservice/getscaledImageURLForUseragent )
> >
> > The service is provided by a third party, and xslt1 cannot be changed.
> >
> > Any help is much appreciated.
> >
> > Regards
> > Alec
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
> 
> 

--- original Nachricht Ende ----


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


Re: Re: Support &amp; Traxtransformers

Posted by warrell harries <wa...@gmail.com>.
Hi Alec,

Having considered this issue my suggestion is to use a custom transformer
which invokes the external content provider with values from the pipeline
document and sets the user agent header from the orginal request. The
response from the external request is then aggregated or replaces the
document in the pipeline.

I developed such a custom transformer for testing and using SOAP services.
In such a scenario the transformer has to set the outgoing HTTP request with
the value of the desired SOAP action instead of the user agent.

I will post the code asap although I have an idea that I put it on this list
some 4 years ago.

Hope this helps,

Warrell