cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Yves Zoundi <yves.zou...@bibl.ulaval.ca>
Subject RE: Problem with cache
Date Tue, 18 Jul 2006 15:12:03 GMT
Hello again,

	I tried to specify the locale parameter directly in the sitemap.xmap
and it doesn't work either. 

	I am using the status generator to analyze the keys in the cache and I
can see that Apache Cocoon never store the locale value in the cache. It
seems that is only caching web pages titles and few information. 

Here is the relevant part of the Cocoon status : 

 <group name="Store Janitor">
            <group

name="org.apache.cocoon.components.store.impl.DefaultTransientStore
(hash = 0x15cd9c0)">
                <value name="cached">

<line>XRB:file:/C:/logi/tomcat/webapps/ROOT/traductions/index/index_en.xml:file:/C:/logi/tomcat/webapps/ROOT/traductions/index/index.xml
                        (class:
org.apache.cocoon.i18n.XMLResourceBundle)</line>

<line>XRB:file:/C:/logi/tomcat/webapps/ROOT/traductions/erudit_commun/erudit_commun_en.xml:file:/C:/logi/tomcat/webapps/ROOT/traductions/erudit_commun/erudit_commun.xml
                        (class:
org.apache.cocoon.i18n.XMLResourceBundle)</line>

<line>XRB:file:/C:/logi/tomcat/webapps/ROOT/traductions/erudit_commun/erudit_commun.xml
                        (class:
org.apache.cocoon.i18n.XMLResourceBundle)</line>

<line>XRB:file:/C:/logi/tomcat/webapps/ROOT/traductions/index/index.xml
(class:
                        org.apache.cocoon.i18n.XMLResourceBundle)</line>
                </value>
                <value name="size">
                    <line>4 items in cache (0 are empty)</line>
                </value>
            </group>
            <group
name="org.apache.cocoon.components.store.impl.EHDefaultStore (hash =
0xb113c7)">
                <value name="cached">

<line>PK_G-file-file:/C:/logi/tomcat/webapps/ROOT/index.html_T-i18n-traductions/index?en___S-xhtml-;doctype-public=-//W3C//DTD
                        XHTML 1.0

Strict//EN;doctype-system=http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd;encoding=UTF-8
                        (class:
org.apache.cocoon.caching.CachedResponse)</line>
                </value>
                <value name="size">
                    <line>1 items in cache (0 are empty)</line>
                </value>
            </group>
        </group>
    </group>


Thanks 


On Tue, 2006-07-18 at 15:59 +0200, Ard Schrijvers wrote:
> Aaah, ok, did not understand that you wanted to have the locale in
> session, and not from browser header.  You still have the problem with
> respect to caching, right?
>  
> Do you also have the problem when you change in the i18n transformer
> the map:parameter name="locale" by hand?
>  
> just do a request with 
> <map:transform type = "i18n">
>  <map:parameter name ="locale" value ="en"/>
> </map:transform>
> 
> then change it into 
>  
> <map:transform type = "i18n">
>  <map:parameter name ="locale" value ="fr"/>
> </map:transform> 
>  
> Now, does this work in a caching pipeline? If it does not, then look
> at the StatusGenerator which keys are created. 
>  
> If it does work, then my guess is that when you do 
>  
> <map:transform type = "i18n">
>  <map:parameter name ="locale" value ="{session-attr:locale}"/>
> </map:transform>
>  
> your session is not correct
>  
> Regards Ard 
> 
>         Hi again Ard,
>         
>         According to the documentation of Apache Cocoon, I canhange
>         the value of the parameter use-locale to false . beacause this
>         parameter aallows tococon to use the locale from the browsers
>         headers. Which which edon't want in this case. We set the
>         default value to french Canada. And if the user chooses a
>         locale. whe want to keep it in the session. 
>         
>         Here is an exceprt of the documentation of the localeAction
>         which I seem to understand. at least a little bit. 
>         
>         ----------------------------
>            <map:action name="locale"
>         src="org.apache.cocoon.acting.LocaleAction">
>              <locale-attribute>locale</locale-attribute> 
>              <use-locale>true</use-locale>
>              <default-locale language="en" country="US"/>
>              <store-in-request>false<store-in-request>
>              <create-session>false<create-session>
>              <store-in-session>false<store-in-session>
>              <store-in-cookie>false<store-in-cookie>
>            </map:action>
>          
>         
>         Above configuration parameters mean: 
>         
>               * locale-attribute specifies the name of the request
>                 parameter / session attribute / cookie that is to be
>                 used as a locale (defaults to locale) 
>               * use-locale specifies whether the primary locale
>                 provided by the user agent (or server default, is no
>                 locale passed by the agent) is to be used 
>               * default-locale specifies the default locale to be used
>                 when none found. 
>               * store-in-request specifies whether found locale should
>                 be stored as request attribute. 
>               * create-session specifies whether session should be
>                 created when storing found locale as session
>                 attribute. 
>               * store-in-session specifies whether found locale should
>                 be stored as session attribute. 
>               * store-in-cookie specifies whether found locale should
>                 be stored as cookie. 
>         ----------------------------
>         
>         Is there something I am missing?
>         
>         Thanks. 
>         On Tue, 2006-07-18 at 10:22 +0200, Ard Schrijvers wrote: 
>         > You can set your pipeline type="noncaching". 
>         > 
>         > Though, cocoon comes with build in cache which should just work. I don't
consider changing to noncaching pipelines is a good solution.
>         > 
>         > Ard
>         > 
>         > > 
>         > > Hi,
>         > > Sorry I dont speak english very well.
>         > > 
>         > >  I have:
>         > > cocoon-2.1.6
>         > > tomcat-5.0.27-rc6
>         > > 
>         > > Everything is ok. I generate XML to  PDF . But if i change 
>         > > something  in 
>         > > my sample  document and if i try generate document again I 
>         > > get it from 
>         > > some cache system or database. Ofcorse if i change name and generate

>         > > document again everything is ok.  I must generate many  
>         > > invoice (nearly 
>         > > 4 thousands !!) and i can't change this name. I must off this cache

>         > > system. Oh i'm read about caching system on cocoon but still 
>         > > i dont know 
>         > > how i can off it.
>         > > 
>         > > Greetings
>         > > Mariusz Derela
>         > > 
>         > > ---------------------------------------------------------------------
>         > > 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
>         > 
>         -- 
>         Yves Zoundi
>         Analyste de l'informatique
>         Section recherche et développements numériques
>         Direction de la Bibliothèque de l'Université Laval
>         Pavillon Jean-Charles-Bonenfant, local 3137
>         Téléphone : (418) 656 2131, 13249
>         
-- 
Yves Zoundi
Analyste de l'informatique
Section recherche et développements numériques
Direction de la Bibliothèque de l'Université Laval
Pavillon Jean-Charles-Bonenfant, local 3137
Téléphone : (418) 656 2131, 13249



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


Mime
View raw message