Hello Rui, 

It does not work for me the way you are doing it: I don't even get the date. 
Think this depends on the cocoon version (there have been some changes 
regarding jx that changed some behavior)

Anyway, the way it works for me is going through flow, 

do a sendpage with a cachekey and a validity object, and use these in flow (see 
http://marc.theaimsgroup.com/?l=xml-cocoon-users&m=115194685214066&w=2 for more 
elaboration on this)

Also make sure you use 
org.apache.excalibur.source.impl.validity.NOPValidity.SHARED_INSTANCE instead 
of org.apache.cocoon.caching.NOPCacheValidity() which is deprecated.

If you want I could mail an extended jx generator we use at hippo, which by 
default caches your jx (cachekey depends by default then on src location of the 
generator and the parameters of the generator)

So, if I have things in my jx that for example depend on the current date, I 
would cache my jx as follows:

<map:generate src="test.xml">
        <map:parameter name="crdate" value="{date:yyyMMdd}"/>
</map:generate>

You can have extra parameters indicating wether a parameter should be added to 
the cache key or not. This saves you the error prone round trips through flow.

Regards Ard

> Hi,
> 
> I'm trying to cache a document generated by JXTemplateGenerator.
> After reading some threads about making JXTemplateGenerator cacheable,
> I've tried:
> 
> <selectElemType elemTypeKey="${cocoon.request.elemTypeKey}"
>   xmlns:jx="http://apache.org/cocoon/templates/jx/1.0";
>   jx:cache-key="testing key"
>   jx:cache-validity="${org.apache.cocoon.caching.NOPCacheValidity()}"
>   date="${java.util.Date().toString()}"/>
> 
> and in sitemap.xmap:
> 
> <map:generate src="text.xml" type="jx"/>
> <map:serialize type="xml"/>
> 
> attribute date value changes after each request. Shouldn't result be
> cached, and the date value always the same?
> 
> What I'm missing here?
> Thanks for any help you cloud provide.
> Rui
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 

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

Reply via email to