How can the result of a pipeline be a parameter for a transformation in another pipeline?

2003-01-31 Thread Cyril Vidal
Hello,

I would like to retrieve the language of the user's browser, so that I could
call the I18n Trasnformer in the right way (by passing the locales's value
equal to the browser's language).

To retrieve the language set up in the browser, I've used the Request
Generator, and applied the following simple stylesheet to it:

xsl:stylesheet version=1.0

xmlns:xsl=http://www.w3.org/1999/XSL/Transform;

xmlns:req=http://xml.apache.org/cocoon/requestgenerator/2.0;



xsl:template match=/

xsl:value-of
select=//req:requestHeaders/req:header[@name='accept-language']/

/xsl:template

/xsl:stylesheet



And this is working fine. By example, for my browser, the result is 'fr'.

But now, I don't know what really to do with this value: I would like to use
it as a parameter for a I18nTransformation in another pipeline.

Do you know how this can be achieved?



Thanks for your help,

Cyril.



-
Please check that your question  has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faq/index.html

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail:   [EMAIL PROTECTED]




Re: How can the result of a pipeline be a parameter for a transformation in another pipeline?

2003-01-31 Thread Konstantin Piroumian
From: Cyril Vidal [EMAIL PROTECTED]

 Hello,

 I would like to retrieve the language of the user's browser, so that I
could
 call the I18n Trasnformer in the right way (by passing the locales's value
 equal to the browser's language).

Simply use the LocaleAction as it is done in i18n samples.
AFAIK, you can setup it to use only the browser's locale and not take into
account request params, session attributes or cookies. But I'm sure you'll
need to allow users to change to language on fly or retain it in a cookie on
the client side to serve the last preferred language of the user. In all
this cases LocaleAction will help you a lot.

-- Konstantin


 To retrieve the language set up in the browser, I've used the Request
 Generator, and applied the following simple stylesheet to it:

 xsl:stylesheet version=1.0

 xmlns:xsl=http://www.w3.org/1999/XSL/Transform;

 xmlns:req=http://xml.apache.org/cocoon/requestgenerator/2.0;

 

 xsl:template match=/

 xsl:value-of
 select=//req:requestHeaders/req:header[@name='accept-language']/

 /xsl:template

 /xsl:stylesheet



 And this is working fine. By example, for my browser, the result is 'fr'.

 But now, I don't know what really to do with this value: I would like to
use
 it as a parameter for a I18nTransformation in another pipeline.

 Do you know how this can be achieved?



 Thanks for your help,

 Cyril.



 -
 Please check that your question  has not already been answered in the
 FAQ before posting. http://xml.apache.org/cocoon/faq/index.html

 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail:   [EMAIL PROTECTED]




-
Please check that your question  has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faq/index.html

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail:   [EMAIL PROTECTED]




Re: How can the result of a pipeline be a parameter for a transformation in another pipeline?

2003-01-31 Thread Cyril Vidal
Thanks for your help Konstantin!
It's OK with LocaleAction.

Regards,
Cyril.
- Original Message -
From: Konstantin Piroumian [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, January 31, 2003 4:12 PM
Subject: Re: How can the result of a pipeline be a parameter for a
transformation in another pipeline?


 From: Cyril Vidal [EMAIL PROTECTED]

  Hello,
 
  I would like to retrieve the language of the user's browser, so that I
 could
  call the I18n Trasnformer in the right way (by passing the locales's
value
  equal to the browser's language).

 Simply use the LocaleAction as it is done in i18n samples.
 AFAIK, you can setup it to use only the browser's locale and not take into
 account request params, session attributes or cookies. But I'm sure you'll
 need to allow users to change to language on fly or retain it in a cookie
on
 the client side to serve the last preferred language of the user. In all
 this cases LocaleAction will help you a lot.

 -- Konstantin

 
  To retrieve the language set up in the browser, I've used the Request
  Generator, and applied the following simple stylesheet to it:
 
  xsl:stylesheet version=1.0
 
  xmlns:xsl=http://www.w3.org/1999/XSL/Transform;
 
  xmlns:req=http://xml.apache.org/cocoon/requestgenerator/2.0;
 
  
 
  xsl:template match=/
 
  xsl:value-of
  select=//req:requestHeaders/req:header[@name='accept-language']/
 
  /xsl:template
 
  /xsl:stylesheet
 
 
 
  And this is working fine. By example, for my browser, the result is
'fr'.
 
  But now, I don't know what really to do with this value: I would like to
 use
  it as a parameter for a I18nTransformation in another pipeline.
 
  Do you know how this can be achieved?
 
 
 
  Thanks for your help,
 
  Cyril.
 
 
 
  -
  Please check that your question  has not already been answered in the
  FAQ before posting. http://xml.apache.org/cocoon/faq/index.html
 
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail:   [EMAIL PROTECTED]
 
 


 -
 Please check that your question  has not already been answered in the
 FAQ before posting. http://xml.apache.org/cocoon/faq/index.html

 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail:   [EMAIL PROTECTED]





-
Please check that your question  has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faq/index.html

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail:   [EMAIL PROTECTED]




Re: How can the result of a pipeline be a parameter for a transformation in another pipeline?

2003-01-31 Thread Christian Haul
On 31.Jan.2003 -- 04:07 PM, Cyril Vidal wrote:
 Hello,
 
 I would like to retrieve the language of the user's browser, so that I could
 call the I18n Trasnformer in the right way (by passing the locales's value
 equal to the browser's language).
 
 To retrieve the language set up in the browser, I've used the Request
 Generator, and applied the following simple stylesheet to it:

Starting with version 2.0.4 you could try
{request-header:accept-language} for that. See input modules in
concepts and javadocs.

Chris.
-- 
C h r i s t i a n   H a u l
[EMAIL PROTECTED]
fingerprint: 99B0 1D9D 7919 644A 4837  7D73 FEF9 6856 335A 9E08

-
Please check that your question  has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faq/index.html

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail:   [EMAIL PROTECTED]




Re: How can the result of a pipeline be a parameter for a transformation in another pipeline?

2003-01-31 Thread Cyril Vidal
Hello Christian,

First, thanks for your help!
I think I've done what you told me concerning the input module. And in fact,
I've just changed the  value of the parameter 'locale', given the
successfull pattern using localeAction:

 localeAction ***
map:pipeline

map:act type=locale

map:match pattern=localeAction

map:generate src=documents/participants.xml/

map:transform src=stylesheets/participantsINT.xsl

map:parameter name=use-request-parameters value=true/

/map:transform

map:transform type=i18n

map:parameter name=locale value={../locale}/

/map:transform

map:serialize type=html/

/map:match

/map:act



*input module *


map:match pattern=inputModule

map:generate src=documents/participants.xml/

map:transform src=stylesheets/participantsINT.xsl

map:parameter name=use-request-parameters value=true/

/map:transform

map:transform type=i18n

map:parameter name=locale value={request-header:accept-language}/

/map:transform

map:serialize type=html/

/map:match

/map:pipeline

but unfortunately, I receive the following error message, that I didn't have
with the preceding localAction:

type fatal

message Unable to locate resource: messages

description org.apache.cocoon.ProcessingException: Unable to locate
resource: messages:
org.apache.avalon.framework.component.ComponentException: Unable to locate
resource: messages

sender org.apache.cocoon.servlet.CocoonServlet

source Cocoon servlet

stack-trace

Is it normal?

Thanks again for your help,

Regards,

Cyril.

- Original Message -
From: Christian Haul [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, January 31, 2003 4:23 PM
Subject: Re: How can the result of a pipeline be a parameter for a
transformation in another pipeline?


 On 31.Jan.2003 -- 04:07 PM, Cyril Vidal wrote:
  Hello,
 
  I would like to retrieve the language of the user's browser, so that I
could
  call the I18n Trasnformer in the right way (by passing the locales's
value
  equal to the browser's language).
 
  To retrieve the language set up in the browser, I've used the Request
  Generator, and applied the following simple stylesheet to it:

 Starting with version 2.0.4 you could try
 {request-header:accept-language} for that. See input modules in
 concepts and javadocs.

 Chris.
 --
 C h r i s t i a n   H a u l
 [EMAIL PROTECTED]
 fingerprint: 99B0 1D9D 7919 644A 4837  7D73 FEF9 6856 335A 9E08

 -
 Please check that your question  has not already been answered in the
 FAQ before posting. http://xml.apache.org/cocoon/faq/index.html

 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail:   [EMAIL PROTECTED]





-
Please check that your question  has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faq/index.html

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail:   [EMAIL PROTECTED]




AW: How can the result of a pipeline be a parameter for a transformation in another pipeline?

2003-01-31 Thread Marco Rolappe
maybe your user agent has several languages set in Accept-Language and maybe
the input module uses these (LocalAction using first encountered).

 -Ursprüngliche Nachricht-
 Von: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED]]Im
 Auftrag von Cyril Vidal
 Gesendet: Freitag, 31. Januar 2003 17:27
 An: [EMAIL PROTECTED]; [EMAIL PROTECTED]
 Betreff: Re: How can the result of a pipeline be a parameter for a
 transformation in another pipeline?


 Hello Christian,

 First, thanks for your help!
 I think I've done what you told me concerning the input module.
 And in fact,
 I've just changed the  value of the parameter 'locale', given the
 successfull pattern using localeAction:

  localeAction ***
 map:pipeline

 map:act type=locale

 map:match pattern=localeAction

 map:generate src=documents/participants.xml/

 map:transform src=stylesheets/participantsINT.xsl

 map:parameter name=use-request-parameters value=true/

 /map:transform

 map:transform type=i18n

 map:parameter name=locale value={../locale}/

 /map:transform

 map:serialize type=html/

 /map:match

 /map:act



 *input module *


 map:match pattern=inputModule

 map:generate src=documents/participants.xml/

 map:transform src=stylesheets/participantsINT.xsl

 map:parameter name=use-request-parameters value=true/

 /map:transform

 map:transform type=i18n

 map:parameter name=locale value={request-header:accept-language}/

 /map:transform

 map:serialize type=html/

 /map:match

 /map:pipeline

 but unfortunately, I receive the following error message, that I
 didn't have
 with the preceding localAction:

 type fatal

 message Unable to locate resource: messages

 description org.apache.cocoon.ProcessingException: Unable to locate
 resource: messages:
 org.apache.avalon.framework.component.ComponentException: Unable to locate
 resource: messages

 sender org.apache.cocoon.servlet.CocoonServlet

 source Cocoon servlet

 stack-trace

 Is it normal?

 Thanks again for your help,

 Regards,

 Cyril.

 - Original Message -
 From: Christian Haul [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Friday, January 31, 2003 4:23 PM
 Subject: Re: How can the result of a pipeline be a parameter for a
 transformation in another pipeline?


  On 31.Jan.2003 -- 04:07 PM, Cyril Vidal wrote:
   Hello,
  
   I would like to retrieve the language of the user's browser, so that I
 could
   call the I18n Trasnformer in the right way (by passing the locales's
 value
   equal to the browser's language).
  
   To retrieve the language set up in the browser, I've used the Request
   Generator, and applied the following simple stylesheet to it:
 
  Starting with version 2.0.4 you could try
  {request-header:accept-language} for that. See input modules in
  concepts and javadocs.
 
  Chris.
  --
  C h r i s t i a n   H a u l
  [EMAIL PROTECTED]
  fingerprint: 99B0 1D9D 7919 644A 4837  7D73 FEF9 6856 335A 9E08
 
  -
  Please check that your question  has not already been answered in the
  FAQ before posting. http://xml.apache.org/cocoon/faq/index.html
 
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail:   [EMAIL PROTECTED]
 
 



 -
 Please check that your question  has not already been answered in the
 FAQ before posting. http://xml.apache.org/cocoon/faq/index.html

 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail:   [EMAIL PROTECTED]



-
Please check that your question  has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faq/index.html

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail:   [EMAIL PROTECTED]