<. Hi keith! .> Tuesday, May 4, 2004, 11:49:56 PM, you wrote:
kdz> I have been starting to use cocoon for my personal web site, and I am kdz> becoming quite fond of it... Congrats go out to all devs. kdz> I have a few apps i'd like to build, and either I am too new to cocoon kdz> to understand all that i should, or what I want to do is stupid. In any kdz> case, here we go. kdz> I would like to write an application to create a local cache of certain kdz> websites i like to monitor. The flow of the application is that the kdz> first time a user requests a certain resource, the server goes out and kdz> queries the web for it. It uses xslt, etc, etc to transform the source, kdz> and then stores it locally for future use. The locally stored copy is kdz> then sent out to the users. The local copy is never updated once it is kdz> successfully aquired one time. kdz> So, with that in mind, the questions... kdz> 1. Is the best way to do the download and save step to create an kdz> action, and run this action conditionally in a resource-exists selector? kdz> Is there a better way, or preferably one that I could do (being my kdz> lazy self) without writing java/perl code, but just add stuff to the kdz> sitemap? There is simpler way than writing own action. We have SourceWriting Transformer [1] ;-) I think, sitemap snip will explain everything: <map:generate type="jx" src="query_resource_template.xml"/> [2] <map:transform type="cinclude"/> [3] <map:transform type="xslt" src="your_xslt_transformations.xsl"/> <map:transform type="write-source"/> <map:transform type="xslt" src="other_transformations.xsl"/> <map:serialize type="xml"/> Your query template should be filled up with informations abaout resource by the JXTemplateGenerator. CInclude Transformer will query the resource and include it. Of course this snip is needed when resource local copy of resource doesn't exist. kdz> 2. I have a list of resources available. I want the user to be able to kdz> view them all on one page (all as in all for the day), or each kdz> individually. Ideally, I would store these resources in an xml file, kdz> and generate the list with xslt. But my sitemap also needs an entry for kdz> each of these. I tried to do this: You can access xml file from sitemap using input module XMLFileModule[4] but I'm not sure if it is necessary. Links: [1] http://cocoon.apache.org/2.1/userdocs/transformers/sourcewriting-transformer.html [2] http://wiki.cocoondev.org/Wiki.jsp?page=JXTemplateGenerator [3] http://cocoon.apache.org/2.1/userdocs/transformers/cinclude-transformer.html [4] http://wiki.cocoondev.org/Wiki.jsp?page=InputModules Hope this help. :-) -- Best regards <. g[R]eK mailto:[EMAIL PROTECTED] .> --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
