Sry, I wanted to clean up the code a little before, and give it a decent name:
Anyway, you can find it here: http://svn.hippocms.org/repos/hippo/hippo-cocoon-extensions/trunk/hippo-misc/src/java/nl/hippo/cocoon/generation/ It is called hippoTemplateJXGenerator, but ofcourse I liked the name to be changed. Think the code speaks for itself, Regards Ard > > > Hi Ard... > Could you please send me the extended jx generator! > Thanks a lot... > > Rui > On Fri, 2006-07-21 at 17:23 +0100, Rui Alberto wrote: > > Hello Ard, > > the behavior you mentioned is exactly what I need. I will be very > > thankful if you could send me the extended jx generator. > > > > Rui > > > > On Fri, 2006-07-21 at 17:55 +0200, Ard Schrijvers wrote: > > > 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=11519468521 > 4066&w=2 for more elaboration on this) > > > > > > Also make sure you use > org.apache.excalibur.source.impl.validity.NOPValidity.SHARED_I > NSTANCE 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] > > > > > > > > > > --------------------------------------------------------------------- > > 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] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
