You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Yves Zoundi <bi...@hermes.ulaval.ca> on 2006/07/18 06:46:34 UTC

Cocoon still messing with i18n in session

I thought I had it all sorted out. No... I tried using cocoon fro SVN
2.1.X. The problem seems to occur when I use a caching ipieoline and when
I am using a noncaching pipeline everything seems to work. But I really
need the caching system of Apache Cocoon. We are using massing XSL
transformations to display our pages and wihtout it working my project is
worth nothing. 
   If you can, please help!!! I've been searching for a solution for a
long time and I can seem to get away with that showstopper.

Here is a link with the localeaction for those who are not familiar with it : 
http://cocoon.apache.org/2.1/apidocs/org/apache/cocoon/acting/LocaleAction.html

I am using ti because it seems it is the way in Apache Cocoon 2.1.X. 

Here is an exceprt of the root sitemap.xmap

...
<map:transformer name="i18n"
src="org.apache.cocoon.transformation.I18nTransformer">
     <catalogues default="default">
       <catalogue id="default" name="messages"
location="translations/default"/>
     </catalogues>
     <untranslated-text>untranslated</untranslated-text>
     <cache-at-startup>true</cache-at-startup>
 </map:transformer>
...
<map:action name="locale" src="org.apache.cocoon.acting.LocaleAction">
     <locale-attribute>locale</locale-attribute>
     <use-locale>false</use-locale>
     <default-locale language="fr" country="CA"/>
     <store-in-request>true</store-in-request>
     <create-session>true</create-session>
     <store-in-session>true</store-in-session>
     <store-in-cookie>false</store-in-cookie>
   </map:action>
</map:actions>
...

<map:pipeline type="caching">

<map:act type = "locale">
    <!-- welcome page -->
    <map:match pattern="">
      <map:generate src="welcome.xml"/>
      <map:transform src="welcome.xslt">
        <map:parameter name="contextPath" value="{request:contextPath}"/>
      </map:transform>
	<map:transform type = "i18n">
		<map:parameter name = "locale" value = "{session-attr:locale}"/>
	</map:transform>
      <map:serialize type="xhtml"/>
    </map:match>
</map:act>
...
=================================================================

here is an excerpt of the sitemap.xmap in the test folder.

...
<map:action name="locale" src="org.apache.cocoon.acting.LocaleAction">
     <locale-attribute>locale</locale-attribute>
     <use-locale>false</use-locale>
     <default-locale language="fr" country="CA"/>
     <store-in-request>true</store-in-request>
     <create-session>true</create-session>
     <store-in-session>true</store-in-session>
     <store-in-cookie>false</store-in-cookie>
   </map:action>
</map:actions>
...
<map:transformer name="i18n"
src="org.apache.cocoon.transformation.I18nTransformer">
     <catalogues default="default">
       <catalogue id="default" name="messages"
location="../translations/default"/>
     </catalogues>
     <untranslated-text>untranslated</untranslated-text>
     <cache-at-startup>true</cache-at-startup>
 </map:transformer>
...
<map:act type = "locale">
    <!-- welcome page -->
    <map:match pattern="">
	<map:generate src="test.html"/>     
	<map:transform type = "i18n">
		<map:parameter name = "locale" value = "{session-attr:locale}"/>
	</map:transform>
      <map:serialize type="html"/>
    </map:match>
</map:act>
...
=================================================================

Thanks in advance

Yves


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