Re: cache
Hi, See: http://cocoon.apache.org/2.1/userdocs/concepts/caching.html Best Regards, Antonio Gallardo Bokluci escribió: Is there any way to make cocoon cache last not so long? - 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]
Re: Dynamic selection list
Are people still writing apps in XSP? I thought that usage of XSP was deprecated and that it had long been supplanted by other, more robust, technologies and techniques. FWIW, the way I do this is to use an SQLTransformer and stylesheet combo: 1. The query (say, XYZ-lookup.xml): http://apache.org/cocoon/SQL/2.0"; > SELECT FieldA AS id, FieldB AS data FROM myTable 2. The stylesheet (say, keys2list.xsl): http://www.w3.org/1999/XSL/Transform"; xmlns:sql="http://apache.org/cocoon/SQL/2.0"; > 3. And the pipeline match: true true 4. And the call from the form would be: 5. Obviously, adding new lookup lists would simply be a matter of adding new XML files with new queries (using the same field renaming convention so as to be able to reuse the stylesheet), named so that they can be "found" by the same pipeline. Hope this helps! Derek >>> [EMAIL PROTECTED] 2006/07/04 11:22 PM >>> Jason Johnston wrote: > > how to make a SQL query in javascript. > > It can be done, though the syntax isn't quite as nice. I'd like to give it a try, if the syntax isn't unbearable. Do you have any pointers? Although most of all I'd rather do it in ESQL in an XSP page and then somehow call it from javascript and get an array out of the xml produced. Is there a way to do that? > But there's also JavaSelectionList, which mysteriously doesn't appear > to be in the published user docs. It sounds like this is closer to > what you're looking for. Thanks, that's quite fitting to what I need. Although I'd still rather do it in XSP, for consistency with all the other DB queries in this app. Thinking about it, I could write an XSP-JavaSelectionList logicsheet... Toby - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- This message is subject to the CSIR's copyright, terms and conditions and e-mail legal notice. Views expressed herein do not necessarily represent the views of the CSIR. CSIR E-mail Legal Notice http://mail.csir.co.za/CSIR_eMail_Legal_Notice.html CSIR Copyright, Terms and Conditions http://mail.csir.co.za/CSIR_Copyright.html For electronic copies of the CSIR Copyright, Terms and Conditions and the CSIR Legal Notice send a blank message with REQUEST LEGAL in the subject line to [EMAIL PROTECTED] This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Dynamic selection list
Toby wrote: I'm trying to implement a dynamic selection list for a form field. I need to extract the selection values and labels from a database. The only way of filling a selection list with dynamic values, that I could glean from the documentation, is by using flow-jxpath. Which poses the problem of how to make a SQL query in javascript. Or, if flowscript could fetch an arbitrary sitemap URI and access the generated XML data, I could write the query in ESQL. Is it possible? Am I barking at the wrong tree here? How should I proceed? Hi Toby, You can also make a pipeline that fetches the data from the DB using the SQLTransformer [1], and transforms the resulting XML into a CForms selection list format. Then in you form model specify a dynamic selection list: This seems much easier than the flow/jx solution to me. See [2] for more info. Regards, Niels [1] http://cocoon.apache.org/2.1/userdocs/sql-transformer.html [2] http://cocoon.apache.org/2.1/userdocs/widgetconcepts/selectionlists.html - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat / Cocoon Logging Configuration
Hi, The problem seems to be an older commons-logging-jar in your classpath: Caused by java.lang.ClassNotFoundException: org.apache.commons.logging.impl.LogKitLogger Best Regards, Antonio Gallardo. E. Martens escribió: Hi all, after installing Cocoon to my Tomcat Server, some conflicts occur in the logging. I cannot access Tomcat's main page and the manager application anymore. Cocoon 2.1.9 Tomcat 5.5.17 Win XP, all SP applied below, I present the log and the Cocoon configuration entries. Thank you very much for any Help! %TOMCAT_HOME%/catalina.2006-06-28.log: 28.06.2006 08:14:40 org.apache.catalina.core.AprLifecycleListener lifecycleEvent INFO: The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Programme\Apache\Tomcat\5.5\bin;.;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Programme\PHP;C:\Programme\PHP\ext;"C:\Programme\Zone Labs\ZoneAlarm\MailFrontier";C:\Programme\Apache\src\forrest-0.8\bin 28.06.2006 08:14:42 org.apache.coyote.http11.Http11BaseProtocol init INFO: Initializing Coyote HTTP/1.1 on http-8080 28.06.2006 08:14:42 org.apache.catalina.startup.Catalina load INFO: Initialization processed in 3391 ms 28.06.2006 08:14:42 org.apache.catalina.core.StandardService start INFO: Starting service Catalina 28.06.2006 08:14:42 org.apache.catalina.core.StandardEngine start INFO: Starting Servlet Engine: Apache Tomcat/5.5.17 28.06.2006 08:14:42 org.apache.catalina.core.StandardHost start INFO: XML validation disabled 28.06.2006 08:15:28 org.apache.catalina.startup.HostConfig deployDescriptor SCHWERWIEGEND: Error deploying configuration descriptor host-manager.xml org.apache.commons.logging.LogConfigurationException: org.apache.commons.logging.LogConfigurationException: java.lang.ClassNotFoundException: org.apache.commons.logging.impl.LogKitLogger (Caused by java.lang.ClassNotFoundException: org.apache.commons.logging.impl.LogKitLogger) (Caused by org.apache.commons.logging.LogConfigurationException: java.lang.ClassNotFoundException: org.apache.commons.logging.impl.LogKitLogger (Caused by java.lang.ClassNotFoundException: org.apache.commons.logging.impl.LogKitLogger)) at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:543) at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:235) at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:370) at org.apache.catalina.core.ContainerBase.getLogger(ContainerBase.java:380) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4090) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:759) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:739) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:524) at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:608) at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:535) at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:470) at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1122) at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:310) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1021) at org.apache.catalina.core.StandardHost.start(StandardHost.java:718) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1013) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:442) at org.apache.catalina.core.StandardService.start(StandardService.java:450) at org.apache.catalina.core.StandardServer.start(StandardServer.java:709) at org.apache.catalina.startup.Catalina.start(Catalina.java:551) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:294) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:432) Caused by: org.apache.commons.logging.LogConfigurationException: java.lang.ClassNotFoundException: org.apache.commons.logging.impl.LogKitLogger (Caused by java.lang.ClassNotFoundException: org.apache.commons.logging.impl.LogKitLogger) at org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor(LogFactoryImpl.java:397) at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:529) ... 26 more Caused by: java.lang.ClassNotFoundException: org.apache.commons.logging.impl.LogKitLogger at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Nativ
Re: Switch generate type to serverpage returns a blank page
Hi Basil, Would you provide some sitemap.xmap snippet? Best Regards, Antonio Gallardo. Basil Moser escribió: Hi all I tried out Cocoon 2.1. I have some XML (with java code embedded) and XSL files. When i switch now in the sitemap.xmap to javapages in the attribute "generate type" cocoon retruns me a blank page. Why does this happen? I also set "generate type" to file. Then cocoon does not inperpret the java code. The java code is only displayed. Why does this happen? Thanks a lot! Basil - 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]
Re: SQLTransform exception
Hi Dimas, You should try a newer version. I checked the lastest trunk and the sample works: http://cocoon.zones.apache.org/demos/21branch/samples/blocks/databases/samples Best Regards, Antonio Gallardo. Dimas51 escribió: Hello! SQLTransform sample at /cocoon/samples/blocks/databases/transform/sql-page does't work. I'm using cocoon v2.1.7 Platform: Windows JVM: 1.4.2-b28 Tomcat 5.0 Getting the exception: cause: java.lang.NullPointerException full exception chain stacktrace[hide] org.apache.cocoon.ProcessingException: Error executing pipeline.: java.lang.NullPointerException at org.apache.cocoon.components.pipeline.AbstractProcessingPipeline.handleException(AbstractProcessingPipeline.java:940) at org.apache.cocoon.components.pipeline.impl.AbstractCachingProcessingPipeline.processXMLPipeline(AbstractCachingProcessingPipeline.java:281) at org.apache.cocoon.components.pipeline.AbstractProcessingPipeline.process(AbstractProcessingPipeline.java:483) at org.apache.cocoon.components.treeprocessor.sitemap.SerializeNode.invoke(SerializeNode.java:120) at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:46) at org.apache.cocoon.components.treeprocessor.sitemap.PreparableMatchNode.invoke(PreparableMatchNode.java:130) at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:68) at org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invoke(PipelineNode.java:138) at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:68) at org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode.invoke(PipelinesNode.java:92) at org.apache.cocoon.components.treeprocessor.ConcreteTreeProcessor.process(ConcreteTreeProcessor.java:234) at org.apache.cocoon.components.treeprocessor.ConcreteTreeProcessor.process(ConcreteTreeProcessor.java:176) at org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:243) at org.apache.cocoon.components.treeprocessor.sitemap.MountNode.invoke(MountNode.java:117) at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:46) at org.apache.cocoon.components.treeprocessor.sitemap.PreparableMatchNode.invoke(PreparableMatchNode.java:130) at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:68) at org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invoke(PipelineNode.java:138) at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:68) at org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode.invoke(PipelinesNode.java:92) at org.apache.cocoon.components.treeprocessor.ConcreteTreeProcessor.process(ConcreteTreeProcessor.java:234) at org.apache.cocoon.components.treeprocessor.ConcreteTreeProcessor.process(ConcreteTreeProcessor.java:176) at org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:243) at org.apache.cocoon.components.treeprocessor.sitemap.MountNode.invoke(MountNode.java:117) at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:46) at org.apache.cocoon.components.treeprocessor.sitemap.PreparableMatchNode.invoke(PreparableMatchNode.java:130) at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:68) at org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invoke(PipelineNode.java:138) at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:68) at org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode.invoke(PipelinesNode.java:92) at org.apache.cocoon.components.treeprocessor.ConcreteTreeProcessor.process(ConcreteTreeProcessor.java:234) at org.apache.cocoon.components.treeprocessor.ConcreteTreeProcessor.process(ConcreteTreeProcessor.java:176) at org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:243) at org.apache.cocoon.components.treeprocessor.sitemap.MountNode.invoke(MountNode.java:117) at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:46) at org.apache.cocoon.components.treeprocessor.sitemap.PreparableMatchNode.invoke(PreparableMatchNode.java:130) at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode
Re: Cocoon 2.1.9 Compile Error
Scott Warren escribió: Solved! Turns out that it's the JDK (Version 1.5.0_06-b05) that has issues with compiling the code. So I went back to 1.5.0_02 and it compiled successfully. Or go to build 1.5.0_07-b03 ;-) Best Regards, Antonio Gallardo. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Dynamic selection list
Jason Johnston wrote: > > how to make a SQL query in javascript. > > It can be done, though the syntax isn't quite as nice. I'd like to give it a try, if the syntax isn't unbearable. Do you have any pointers? Although most of all I'd rather do it in ESQL in an XSP page and then somehow call it from javascript and get an array out of the xml produced. Is there a way to do that? > But there's also JavaSelectionList, which mysteriously doesn't appear > to be in the published user docs. It sounds like this is closer to > what you're looking for. Thanks, that's quite fitting to what I need. Although I'd still rather do it in XSP, for consistency with all the other DB queries in this app. Thinking about it, I could write an XSP-JavaSelectionList logicsheet... Toby - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Dynamic selection list
Toby wrote: I'm trying to implement a dynamic selection list for a form field. I need to extract the selection values and labels from a database. The only way of filling a selection list with dynamic values, that I could glean from the documentation, is by using flow-jxpath. Which poses the problem of how to make a SQL query in javascript. It can be done, though the syntax isn't quite as nice. You could also implement the query in a Java method and just call that method from Javascript to get back a List of items. But there's also JavaSelectionList, which mysteriously doesn't appear to be in the published user docs. It sounds like this is closer to what you're looking for. To use it, create a Java class that extends AbstractJavaSelectionList[1]. It will need to implement the build() abstract method; in this method you can run your query to get the list of items, and then add those items to the selection list by calling addItem(value, label) for each. Then return either true or false depending on whether or not you want the selection list to be rebuilt every time or just the first time. Then in your form definition, reference your class like so: ... The fd:selection-list element also accepts a nullable="true" attribute for if you want a null item to be added to the top of the list. In addition, you can add any arbitrary attributes you want and then access their values within your Java class via getAttribute(name). This is a very easy way to use the same class many times with different parameters affecting its behavior. Hope that helps! --Jason [1] http://cocoon.apache.org/2.1/apidocs/org/apache/cocoon/forms/datatype/AbstractJavaSelectionList.html Or, if flowscript could fetch an arbitrary sitemap URI and access the generated XML data, I could write the query in ESQL. Is it possible? Am I barking at the wrong tree here? How should I proceed? Toby - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Dynamic selection list
I'm trying to implement a dynamic selection list for a form field. I need to extract the selection values and labels from a database. The only way of filling a selection list with dynamic values, that I could glean from the documentation, is by using flow-jxpath. Which poses the problem of how to make a SQL query in javascript. Or, if flowscript could fetch an arbitrary sitemap URI and access the generated XML data, I could write the query in ESQL. Is it possible? Am I barking at the wrong tree here? How should I proceed? Toby -- Signed/encrypted mail welcome. GPG/PGP Key-Id: 0x15C5C2EA - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Sitemap javaflow / flowscript combo
HiThe whole continuation management infrastructure is still waiting for an overhaul. (Probably not even that much work)Ah! I suppose my follow on question from that response would be which flow model to follow then, java or _javascript_? Is there any point in having more than one definitive model? I mean is there any point in having one model, _javascript_, which supports the cocoon object and another, java, which does not? Would it not be better to just fully implement the best model and be done with all the other half baked ones??? regardsAndrew
RE: Caching jx with flow (WAS: Is use-store needed when using XSLTC ?)
> > ...What about a talk about Cocoon caching at the Cocoon > GetTogether?.. > > Big +1, it seems you Hippo guys have done some interesting stuff with > caching, it would be cool to share your experience. Quite frankly I think we are just using the caching possibilities provided by cocoon, no more no less. But, that might still be interesting for many people, because not everybody might be aware of it. About speaking, well, don't think I am that much of a speaker, combined with the fact that I will be arriving at 7:00 in the morning oct the 2th from vacation...I will think about it. I also will be working on a some sort of best practice manual about caching/performance/running live/etc etc... I will keep you posted, but must say I am very occupied at the moment. Trying to achieve this "manual" in the upcoming weeks Regards Ard > > -Bertrand > > - > 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]
RE: cache
I assume you are referring to the default cocoon cache (EHDefaultStore). You can set timeToLiveSeconds and timeToLiveIdle See http://marc.theaimsgroup.com/?l=xml-cocoon-users&m=115193368622073&w=2 for extensive overview Ard -- Hippo Oosteinde 11 1017WT Amsterdam The Netherlands Tel +31 (0)20 5224466 - [EMAIL PROTECTED] / http://www.hippo.nl -- > > > Is there any way to make cocoon cache last not so long? > > > - > 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]
Re: too many open files
On 7/4/06, Bokluci <[EMAIL PROTECTED]> wrote: How high should be "very high load"? over 10 000 hits a day? Impossible to say, it all depends on how the replies to these hits are generated, and your traffic patterns. You need to measure the performance with simulated or actual load to make decisions about this. 10'000 hits a day (86'400 seconds) can be as low as 0.12 per second if evenly spread, which is not much at all. OTOH if these hits come within 2 minutes...you get the idea. ...Are there any drawbacks running cocoon as non privileged user?... Not that I know, quite the contrary, except that it cannot listen on port 80 then. But it's a good idea to put an httpd / reverse proxy in front anyway. -Bertrand - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: caching RSS feeds or external xml files (WAS: Caching jx with flow)
> > > > For the last point, there was implementation[1] of Excalibur's source > which was meeting our expectations. Good explanation how to > use it was > there[2]. However, this code was in 'scratchpad' block and > was removed > in 2.1.7 release as no one was maintaining it. Valuable gems has been > lost, unfortunately. It is not removed: cocoon/trunk/block/cocoon-scratchpad/cocoon-scratchpad-impl/src/main/java/org/apache/cocoon/components/source/impl It is by far the most important block there is for us at Hippo. Though, we modified it because we had problems with not serialiable responses which we had to account for (Actually I believe there is an error in scratchpad resulting in a NPE, but I did not do the rebuilding so I would have to lookup where that was). But is sounds logical to embed it into this block. Only not sure if I will have time for this on short notice. Bertrand mailed an easy, though effictive way of using external rss. A cocoon cron job is also possible for this. > > > I want this behavior to have the following behavior: > > > > Fetching rss/xml only when modified is clear I suppose. > Caching the content is necessary to have the content > available when you get a 304. You might have an external rss > that lacks proper headers, making your generator having to > regenerate the rss every time. Therefore, making the cache > also expiring gives you the possibility to only ask for the > rss every X minutes. At last, quite an important one, a > failing external rss can make your cocoon app waiting very > long for the external source, resulting in a broken front end. > > > > I think it is not very hard to make an external rss/xml > generator that meets these 4 points (or adding a http scheme > to the source-factories with a component-instance that > behaves accordingly), but I am afraid that it must be in > cocoon somewhere already... > > > As for now I cannot work on this but in not-so-distant future I could > port and document cached source into 2.1.x's core of course > question is > if patch would be accepted. > My gut feeling is that conditional gets are not implemented in > Cocoon/Excalibur and I have no idea if would be hard "fix" it. I am not sure either...would have to look into it as well. Perhaps in a few weeks Regards Ard > Any hints greatly appreciated. > > -- > Grzegorz Kossakowski > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > >
cache
Is there any way to make cocoon cache last not so long? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: caching RSS feeds or external xml files (WAS: Caching jx with flow)
On 7/4/06, Ard Schrijvers <[EMAIL PROTECTED]> wrote: ...I am not very keen on this kind of solutions.. Of course, this is not the ultimate solution. Just wanted to point it out, as depending on your environment and needs it's a simple and good enough solution. -Bertrand - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: too many open files
How high should be "very high load"? over 10 000 hits a day? Are there any drawbacks running cocoon as non privileged user? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Bertrand Delacretaz Sent: Tuesday, July 04, 2006 1:34 PM To: users@cocoon.apache.org Subject: Re: too many open files On 7/4/06, Bokluci <[EMAIL PROTECTED]> wrote: > ...Are there any drawbacks if I use it alone with the standard > bundled server?... Not necessarily, it's not optimized for very high loads but runs just fine on several of my production systems, with up to 9 months uptime until now. -Bertrand - 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]
RE: caching RSS feeds or external xml files (WAS: Caching jx with flow)
> > > ...I think it is not very hard to make an external rss/xml > generator that meets these 4 points...but I am afraid that it > must be in cocoon somewhere already... > > A fairly effective poor man's way of doing this, as someone also > suggested recently, is to use an external cron job to fetch a feed's > XML, check that it is well-formed (in case you don't trust the backend > too much), and replace a local copy with the new version if different. That was me suggesting that one and also used that one. I just don't like the cron-job part and extra dependencies your cocoon app is depending on. It does work though, but I am not very keen on this kind of solutions Ard > > A full-blown generator is of course a cleaner way of handling this, > but if someone's interested, here's a script that I use to implement > such a scenario. I'm using xmlfw to check the XML, but many other > tools would do. > > ME=$(basename $0) > URL=$1 > FINAL_OUTPUT=$2 > OUTPUT_DIR=/tmp/$ME-$$ > USAGE="usage: $ME url_to_retrieve output_file (example: $ME > http://somefeed.ch/rdf/ /tmp/output.xml)" > > # this name is fixed by xmlfw, hence the variable OUTPUT_DIR > TEMP_FILE=$OUTPUT_DIR/STDIN > > fatal() { > echo $ME: $* > rmdir $OUTPUT_DIR 2>/dev/null > exit 1 > } > > [[ -n "$URL" ]] || fatal $USAGE > [[ -n "$FINAL_OUTPUT" ]] || fatal $USAGE > > # use wget to retrieve URL > # xmlfw checks well-formedness and only if ok copies file to > # output dir, using STDIN as the filename > mkdir -p $OUTPUT_DIR > rm -f $TEMP_FILE > ( wget -q -O- $URL | xmlwf -d $OUTPUT_DIR -c ) > [[ -f $TEMP_FILE ]] || fatal "did not get well-formed XML from $URL" > mv $TEMP_FILE $FINAL_OUTPUT > > > -Bertrand > > - > 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]
Re: too many open files
On 7/4/06, Bokluci <[EMAIL PROTECTED]> wrote: ...Are there any drawbacks if I use it alone with the standard bundled server?... Not necessarily, it's not optimized for very high loads but runs just fine on several of my production systems, with up to 9 months uptime until now. -Bertrand - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: too many open files
As a matter of a fact I'm not using cocoon with combination with tomcat, should I? Are there any drawbacks if I use it alone with the standard bundled server? -Original Message- From: Cayetano [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 04, 2006 8:13 AM To: users@cocoon.apache.org Subject: Re: too many open files > > ...What do you mean by "what kind of app is this?"... > > The question is, what are your application patterns, i.e. do you use > many XSLT transforms, or the SQLTransformer, often call external > processes, use a lot of Flow and/or CForms, etc.. > And i would add: running with Tomcat under Linux with a non-privileged user? (see /etc/security/limits.conf) Cayetano - 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]
Re: too many open files
On 7/4/06, Geert Josten <[EMAIL PROTECTED]> wrote: ...I heard something about a Java bug that seemed to cause these kinds of errors... Which might be: using the Process object and not explicitely closing its channels, see http://codeconsult.ch/bertrand/archives/000456.html -Bertrand - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Caching jx with flow (WAS: Is use-store needed when using XSLTC ?)
On 7/4/06, Niels van Kampenhout <[EMAIL PROTECTED]> wrote: ...What about a talk about Cocoon caching at the Cocoon GetTogether?.. Big +1, it seems you Hippo guys have done some interesting stuff with caching, it would be cool to share your experience. -Bertrand - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: caching RSS feeds or external xml files (WAS: Caching jx with flow)
On 7/4/06, Ard Schrijvers <[EMAIL PROTECTED]> wrote: ...I think it is not very hard to make an external rss/xml generator that meets these 4 points...but I am afraid that it must be in cocoon somewhere already... A fairly effective poor man's way of doing this, as someone also suggested recently, is to use an external cron job to fetch a feed's XML, check that it is well-formed (in case you don't trust the backend too much), and replace a local copy with the new version if different. A full-blown generator is of course a cleaner way of handling this, but if someone's interested, here's a script that I use to implement such a scenario. I'm using xmlfw to check the XML, but many other tools would do. ME=$(basename $0) URL=$1 FINAL_OUTPUT=$2 OUTPUT_DIR=/tmp/$ME-$$ USAGE="usage: $ME url_to_retrieve output_file (example: $ME http://somefeed.ch/rdf/ /tmp/output.xml)" # this name is fixed by xmlfw, hence the variable OUTPUT_DIR TEMP_FILE=$OUTPUT_DIR/STDIN fatal() { echo $ME: $* rmdir $OUTPUT_DIR 2>/dev/null exit 1 } [[ -n "$URL" ]] || fatal $USAGE [[ -n "$FINAL_OUTPUT" ]] || fatal $USAGE # use wget to retrieve URL # xmlfw checks well-formedness and only if ok copies file to # output dir, using STDIN as the filename mkdir -p $OUTPUT_DIR rm -f $TEMP_FILE ( wget -q -O- $URL | xmlwf -d $OUTPUT_DIR -c ) [[ -f $TEMP_FILE ]] || fatal "did not get well-formed XML from $URL" mv $TEMP_FILE $FINAL_OUTPUT -Bertrand - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: caching RSS feeds or external xml files (WAS: Caching jx with flow)
Grzegorz Kossakowski napisał(a): Ard Schrijvers napisał(a): IMHO generator is not suitable for this task as it would lead to bogus pipelines only for proxing. E.g. you want include your RSS via XInclude, then you have to build And call this pipeline thought cocoon:/ protocol. Given that, it seems that http scheme/Excalibur's source is more convenient. For the last point, there was implementation[1] of Excalibur's source which was meeting our expectations. Good explanation how to use it was there[2]. However, this code was in 'scratchpad' block and was removed in 2.1.7 release as no one was maintaining it. Valuable gems has been lost, unfortunately. As for now I cannot work on this but in not-so-distant future I could port and document cached source into 2.1.x's core of course question is if patch would be accepted. My gut feeling is that conditional gets are not implemented in Cocoon/Excalibur and I have no idea if would be hard "fix" it. Any hints greatly appreciated. *Gosh* forgot about links: [1] http://svn.apache.org/viewvc/cocoon/tags/RELEASE_2_1_6/src/blocks/scratchpad/java/org/apache/cocoon/components/source/impl/ [2] http://svn.apache.org/viewvc/cocoon/tags/RELEASE_2_1_6/src/blocks/scratchpad/conf/caching-source.xconf?view=markup - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: caching RSS feeds or external xml files (WAS: Caching jx with flow)
Ard Schrijvers napisał(a): Considering caching RSS feeds. Is there any option to configure cocoon (maybe by using some source protocol?) to behave like proxy and do not break the rest of cached content? Any chance to do conditional gets? [1] [1] http://fishbowl.pastiche.org/2002/10/21/http_conditional_get_for_rss_hackers I know there are some proxy generators around (see blocks/proxy for GenericProxyGenerator.java, HttpProxyGenerator.java, WebServiceProxyGenerator.java), though I haven't had a close look at them, but I don't think they do what you want them to do, and probably you haven't configured them anyway. IMHO generator is not suitable for this task as it would lead to bogus pipelines only for proxing. E.g. you want include your RSS via XInclude, then you have to build And call this pipeline thought cocoon:/ protocol. Given that, it seems that http scheme/Excalibur's source is more convenient. Anyway, by default, when generating an external rss, you will probably have something like: http://www.foo.org/rss"/> Unless you have specified a specific source-factories for http in your cocoon.xconf, this uri scheme will be managed by org.apache.excalibur.source.impl.URLSourceFactory. I am not sure if this URLSourceFactory delivers what you want, but I don't think so. Then again, I think when working with external (http) sources like rss, one wants the following behavior: 1) fetch the rss/xml only when modified 2) have the fetched content cached 3) have the fetched content cached with an expires (configurable) 4) have a configurable connection time out (we had cocoon apps completely hanging on failing external rss feeds) I think cocoon is particularly well suited for xml content aggregation of external sources, but I haven't found something that managed the above 4 (logical) demands for it (Anybodyis it in there already? Portal block? Do I miss something?) For the last point, there was implementation[1] of Excalibur's source which was meeting our expectations. Good explanation how to use it was there[2]. However, this code was in 'scratchpad' block and was removed in 2.1.7 release as no one was maintaining it. Valuable gems has been lost, unfortunately. I want this behavior to have the following behavior: Fetching rss/xml only when modified is clear I suppose. Caching the content is necessary to have the content available when you get a 304. You might have an external rss that lacks proper headers, making your generator having to regenerate the rss every time. Therefore, making the cache also expiring gives you the possibility to only ask for the rss every X minutes. At last, quite an important one, a failing external rss can make your cocoon app waiting very long for the external source, resulting in a broken front end. I think it is not very hard to make an external rss/xml generator that meets these 4 points (or adding a http scheme to the source-factories with a component-instance that behaves accordingly), but I am afraid that it must be in cocoon somewhere already... As for now I cannot work on this but in not-so-distant future I could port and document cached source into 2.1.x's core of course question is if patch would be accepted. My gut feeling is that conditional gets are not implemented in Cocoon/Excalibur and I have no idea if would be hard "fix" it. Any hints greatly appreciated. -- Grzegorz Kossakowski - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Sitemap javaflow / flowscript combo
Hi, is it yet possible, in 2.1.9, to declare more than one flow resource in java and javascript? Not absolutely 100% but I think this has not been fixed yet. The whole continuation management infrastructure is still waiting for an overhaul. (Probably not even that much work) cheers -- Torsten - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
caching RSS feeds or external xml files (WAS: Caching jx with flow)
Considering caching RSS feeds. Is there any option to configure cocoon (maybe by using some source protocol?) to behave like proxy and do not break the rest of cached content? Any chance to do conditional gets? [1] [1] http://fishbowl.pastiche.org/2002/10/21/http_conditional_get_for_rss_hackers I know there are some proxy generators around (see blocks/proxy for GenericProxyGenerator.java, HttpProxyGenerator.java, WebServiceProxyGenerator.java), though I haven't had a close look at them, but I don't think they do what you want them to do, and probably you haven't configured them anyway. I am not familiar with the cocoon portal block, but I would guess that xml from different locations is frequently generated over there (and thus one expects this to be done effectively...anybody who knows more about this?) Anyway, by default, when generating an external rss, you will probably have something like: http://www.foo.org/rss"/> Unless you have specified a specific source-factories for http in your cocoon.xconf, this uri scheme will be managed by org.apache.excalibur.source.impl.URLSourceFactory. I am not sure if this URLSourceFactory delivers what you want, but I don't think so. Then again, I think when working with external (http) sources like rss, one wants the following behavior: 1) fetch the rss/xml only when modified 2) have the fetched content cached 3) have the fetched content cached with an expires (configurable) 4) have a configurable connection time out (we had cocoon apps completely hanging on failing external rss feeds) I think cocoon is particularly well suited for xml content aggregation of external sources, but I haven't found something that managed the above 4 (logical) demands for it (Anybodyis it in there already? Portal block? Do I miss something?) I want this behavior to have the following behavior: Fetching rss/xml only when modified is clear I suppose. Caching the content is necessary to have the content available when you get a 304. You might have an external rss that lacks proper headers, making your generator having to regenerate the rss every time. Therefore, making the cache also expiring gives you the possibility to only ask for the rss every X minutes. At last, quite an important one, a failing external rss can make your cocoon app waiting very long for the external source, resulting in a broken front end. I think it is not very hard to make an external rss/xml generator that meets these 4 points (or adding a http scheme to the source-factories with a component-instance that behaves accordingly), but I am afraid that it must be in cocoon somewhere already... Regards Ard - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Sitemap javaflow / flowscript combo
Hi,is it yet possible, in 2.1.9, to declare more than one flow resource in java and _javascript_? So for example can I do the following?: regardsAndrew
Re: Caching jx with flow (WAS: Is use-store needed when using XSLTC ?)
Ard Schrijvers napisał(a): Hmmm, I hoped my mails would be so clear that it is not needed anymore :-) But your right, I probably should, but it takes a lot of time and effort to write it down really well Anyway, are there people interested in a document on cocoon caching with best practice and some examples regarding: - The different strategies (noncaching, caching, ecaching/eventcaching, expiring) and when to use them. Appending some use-cases like "how to cache untill 0:00 hours exactly" , and "how to cache an external rss feed properly" Considering caching RSS feeds. Is there any option to configure cocoon (maybe by using some source protocol?) to behave like proxy and do not break the rest of cached content? Any chance to do conditional gets? [1] - How to configure your stores properly "important for keeping you cache clean" - Some tools to measure performance and caching - How to cache your jx templates. - The "watch out's" in configuring your components (for example in your TraxTransformer setting true can easily bring your cocoon app down when a crawler comes by ) - Which tools can help me finding the flaws (solex/tcpmon/charles(last one not free) ) Above is more or less configuration and examples. Below might be the some more advanced topics - When writing your own cacheable component what to keep in mind (you can easile makes things 100% cached while regenerating them would be faster) - How does the cocoon cache mechanism work (http://cocoon.zones.apache.org/daisy/documentation/writing/690.html) - and probably all the other things that come to mind But, I am not sure how much is already out there in documentation (probably there is quite a lot, but it is scattered around, outdated, and it is of course in a wiki form which is basically the equivalent of "cant find the [EMAIL PROTECTED]@ thing" ), and I am willing to make one solid "best-practice-regarding-performance", but before that, I want to know if there is interest in it. It will cost me many (probably of my sparetime) hours to complete this, and I don't bother, but if this is just basic stuff for everybody, then of course, I am wasting my time. I would be very interested in this! It would be also great to explain how cocoon's cache internal works. Especially, in order to get enough knowledge to write one's own components. For example, XInclude transformer seems to be very interesting case. [1] http://fishbowl.pastiche.org/2002/10/21/http_conditional_get_for_rss_hackers -- Grzegorz Kossakowski - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cocoon-forms-block.jar opened file
Hi. We are using cocoon 2.1.7 and Sun ONE Web Server 6.1 in Solaris 8 We have "TO MANY OPENED FILES" Error. Thanks to lsof we can see that when a user logs into the application, websrvd opens cocoon-forms-block.jar and never closes them. Finally Web Server fails and we must restart it. Any suggestion? Thanks.
Re: Is use-store needed when using XSLTC ?
Yes, I saw it via Google. But I just wanted to know whether this XSL2HTML was provided with Cocoon or not. Regards 2006/7/4, Grzegorz Kossakowski <[EMAIL PROTECTED]>: Cocoon Man napisał(a):>>> You can follow what is cached in the different stores via the > StatusGenerator.>> Regards Ard>> I've declared the StatusGenerator in my sitemap and it works fine !> Is there a default XML2HTML stylesheet associated to this generator, > like for the profiler ?>> Regards,Have you looked at this:http://cocoon.zones.apache.org/demos/21branch/samples/status.html ?--Grzegorz Kossakowski-To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Is use-store needed when using XSLTC ?
Cocoon Man napisał(a): You can follow what is cached in the different stores via the StatusGenerator. Regards Ard I've declared the StatusGenerator in my sitemap and it works fine ! Is there a default XML2HTML stylesheet associated to this generator, like for the profiler ? Regards, Have you looked at this: http://cocoon.zones.apache.org/demos/21branch/samples/status.html ? -- Grzegorz Kossakowski - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Caching jx with flow (WAS: Is use-store needed when using XSLTC ?)
Ard, What about a talk about Cocoon caching at the Cocoon GetTogether? Niels Giacomo Pati wrote: Hi Ard I'm crossposting this as it seem very valuable and far from "if this is just basic stuff for everybody, then of course, I am wasting my time" Personally I'm very interested on a document showing what the caching/performance tuning capabilities would be. Ciao Giacomo On Mon, 3 Jul 2006, Ard Schrijvers wrote: Date: Mon, 3 Jul 2006 19:13:31 +0200 From: Ard Schrijvers <[EMAIL PROTECTED]> Reply-To: users@cocoon.apache.org To: users@cocoon.apache.org Subject: RE: Caching jx with flow (WAS: Is use-store needed when using XSLTC ?) Hmmm, I hoped my mails would be so clear that it is not needed anymore :-) But your right, I probably should, but it takes a lot of time and effort to write it down really well Anyway, are there people interested in a document on cocoon caching with best practice and some examples regarding: - The different strategies (noncaching, caching, ecaching/eventcaching, expiring) and when to use them. Appending some use-cases like "how to cache untill 0:00 hours exactly" , and "how to cache an external rss feed properly" - How to configure your stores properly "important for keeping you cache clean" - Some tools to measure performance and caching - How to cache your jx templates. - The "watch out's" in configuring your components (for example in your TraxTransformer setting true can easily bring your cocoon app down when a crawler comes by ) - Which tools can help me finding the flaws (solex/tcpmon/charles(last one not free) ) Above is more or less configuration and examples. Below might be the some more advanced topics - When writing your own cacheable component what to keep in mind (you can easile makes things 100% cached while regenerating them would be faster) - How does the cocoon cache mechanism work (http://cocoon.zones.apache.org/daisy/documentation/writing/690.html) - and probably all the other things that come to mind But, I am not sure how much is already out there in documentation (probably there is quite a lot, but it is scattered around, outdated, and it is of course in a wiki form which is basically the equivalent of "cant find the [EMAIL PROTECTED]@ thing" ), and I am willing to make one solid "best-practice-regarding-performance", but before that, I want to know if there is interest in it. It will cost me many (probably of my sparetime) hours to complete this, and I don't bother, but if this is just basic stuff for everybody, then of course, I am wasting my time. Regards Ard Hi Ard, it might be a good idea to post your knowledge about caching JXtemplate to the cocoon wiki so that other people can find it there instead of on the mailinglist. WDYT? Regards, Reijn Ard Schrijvers wrote: Again, and now really in a new thread...! "I am not familiar with xsp (anymore). I use jx all the time (with flow). It is by default not cached, though you can arrange this via flow. How do you do this (cache) in flow?" I have changed the name of this thread since this part drifts away from the inital subject. Probably known by lots of users of jx is that the org.apache.cocoon.generation.JXTemplateGenerator by default is not cacheable. This is because lots of logic the components setup is not aware of might be present in the the file that is generated by the JXTemplateGenerator (the setup of a component must be able to return the cachekey that is processed in the pipeline cachekey AND the validity). Suppose you are doing some date functions in your jx, computing the current week. This can never be cached because the pipeline key or validity has no dependence on what happens during the generation of the jx file. But, since we often know where our specific jx depends on, you can make it being cached. So, when you are in your flow function you define your cachekey for the jx, and the valdity type: var ck='KEY-'; var params={'cacheValidity': NOPValidity.SHARED_INSTANCE}; // NOPValidity merely means something like: assume I am always valid. You can equally well define an expires validity if it is only valid for some time, or an eventValidity, or a timeStampValdity or...that is about it I think now, to var ck you append the things that is depends on (like a request parameter, current week number, etc) you add it to params: params['ck']=ck; and go back to the sitemap with cocoon.sendPage(foo, params); You have the matcher and bar.xml starts with: jx:cache-validity="${cacheValidity}" Now, your JXTemplateGenerator is cached. Since we had to repeat this pattern many many times (sitemap --> flow --> sitemap --> jx ) we have extended the JXTemplateGenerator, where you can very easily make your jx cacheable. (you just generate it, and everything it depends on is added to it with map:parameter)... So for example, I have a jx depending on session and date and request-param, the
RE: too many open files
Hi Bokluci, In case you're running Cocoon on Linux, these are my experiences with the "too many open files" issue. I used this in the past to raise the number of open files, which might not be the actual solution to your problem, but at least it will give you some pointers for where to look at. * login as root user* check 'ulimit -n', this will show you the current limit of open files* edit /etc/security/limits.conf:** soft nofile 8192** hard nofile 65535* edit /etc/pam.d/sshd:** session required /lib/security/pam_limits.so* 'ulimit -n 8192' (set limit to 8192)* 'service sshd restart' (or /etc/init.d/sshd restart)* logoff* logon again and check 'ulimit -n', this will show you the new values The maximum number of open files is limited to the capabilities of the filesystem in use. You can find the max number for *all processes combined* by doing 'cat /proc/sys/fs/file-max'. It's normally somewhere between 100.000 and 500.000.If you set the hard limit in limits.conf to high, you might block the filesystem which makes the server unreliable and even block SSH shells!! 8192 is a common setting. Good luck, Kind regards,Arjé CahnHippo Oosteinde 111017WT AmsterdamThe NetherlandsTel +31 (0)20 5224466-[EMAIL PROTECTED] / www.hippo.nl / [EMAIL PROTECTED]-- From: Bokluci Bokluci [mailto:[EMAIL PROTECTED] Posted At: maandag 3 juli 2006 19:01Posted To: Cocoon User ListConversation: too many open filesSubject: too many open fileshi,from time to time my cocoon get this error message:Too Many Open FilesSometimes after refresh it continues work, but sometimes it needs to be restarted.Is there any way to fix this issue?
Looking for SAX parsers benchmark
Hello, I looked a little on the net for some SAX parsers benchmark but didn't find a very recent one. According to you, what is the best Java SAX parser for the following type of XML document : documents include several namespaces documents do not need to be validated against some DTD or XML Schema no external entities need to be resolved documents are not very big (less than 200 kb) ??? Any opinion ? Regards,
Is it worth setting "reuse-parsers" to 'true'
Hello Cocoon gurus, Looking at the cocoon.xconf file, I noticed that it is possible to "reuse XML parsers". I'm working on a session-less service where each request processes a brand new XML stream (which may contain several namespaces but no external entities). So, do you think I can gain some performance (less memory, better response time) by setting this attribute to "true" ? It is not clear though what the term "reuse parser" means here knowing that I can already use the pool of components by setting pool-max to an appropriate value : So, since my JaxpParser is already a pooled component, what is the change introduced by setting ? Regards,
RE: Caching jx with flow (WAS: Is use-store needed when using XSLTC ?)
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi Ard I'm crossposting this as it seem very valuable and far from "if this is just basic stuff for everybody, then of course, I am wasting my time" Personally I'm very interested on a document showing what the caching/performance tuning capabilities would be. Ciao Giacomo On Mon, 3 Jul 2006, Ard Schrijvers wrote: Date: Mon, 3 Jul 2006 19:13:31 +0200 From: Ard Schrijvers <[EMAIL PROTECTED]> Reply-To: users@cocoon.apache.org To: users@cocoon.apache.org Subject: RE: Caching jx with flow (WAS: Is use-store needed when using XSLTC ?) Hmmm, I hoped my mails would be so clear that it is not needed anymore :-) But your right, I probably should, but it takes a lot of time and effort to write it down really well Anyway, are there people interested in a document on cocoon caching with best practice and some examples regarding: - The different strategies (noncaching, caching, ecaching/eventcaching, expiring) and when to use them. Appending some use-cases like "how to cache untill 0:00 hours exactly" , and "how to cache an external rss feed properly" - How to configure your stores properly "important for keeping you cache clean" - Some tools to measure performance and caching - How to cache your jx templates. - The "watch out's" in configuring your components (for example in your TraxTransformer setting true can easily bring your cocoon app down when a crawler comes by ) - Which tools can help me finding the flaws (solex/tcpmon/charles(last one not free) ) Above is more or less configuration and examples. Below might be the some more advanced topics - When writing your own cacheable component what to keep in mind (you can easile makes things 100% cached while regenerating them would be faster) - How does the cocoon cache mechanism work (http://cocoon.zones.apache.org/daisy/documentation/writing/690.html) - and probably all the other things that come to mind But, I am not sure how much is already out there in documentation (probably there is quite a lot, but it is scattered around, outdated, and it is of course in a wiki form which is basically the equivalent of "cant find the [EMAIL PROTECTED]@ thing" ), and I am willing to make one solid "best-practice-regarding-performance", but before that, I want to know if there is interest in it. It will cost me many (probably of my sparetime) hours to complete this, and I don't bother, but if this is just basic stuff for everybody, then of course, I am wasting my time. Regards Ard Hi Ard, it might be a good idea to post your knowledge about caching JXtemplate to the cocoon wiki so that other people can find it there instead of on the mailinglist. WDYT? Regards, Reijn Ard Schrijvers wrote: Again, and now really in a new thread...! "I am not familiar with xsp (anymore). I use jx all the time (with flow). It is by default not cached, though you can arrange this via flow. How do you do this (cache) in flow?" I have changed the name of this thread since this part drifts away from the inital subject. Probably known by lots of users of jx is that the org.apache.cocoon.generation.JXTemplateGenerator by default is not cacheable. This is because lots of logic the components setup is not aware of might be present in the the file that is generated by the JXTemplateGenerator (the setup of a component must be able to return the cachekey that is processed in the pipeline cachekey AND the validity). Suppose you are doing some date functions in your jx, computing the current week. This can never be cached because the pipeline key or validity has no dependence on what happens during the generation of the jx file. But, since we often know where our specific jx depends on, you can make it being cached. So, when you are in your flow function you define your cachekey for the jx, and the valdity type: var ck='KEY-'; var params={'cacheValidity': NOPValidity.SHARED_INSTANCE}; // NOPValidity merely means something like: assume I am always valid. You can equally well define an expires validity if it is only valid for some time, or an eventValidity, or a timeStampValdity or...that is about it I think now, to var ck you append the things that is depends on (like a request parameter, current week number, etc) you add it to params: params['ck']=ck; and go back to the sitemap with cocoon.sendPage(foo, params); You have the matcher and bar.xml starts with: jx:cache-validity="${cacheValidity}" Now, your JXTemplateGenerator is cached. Since we had to repeat this pattern many many times (sitemap --> flow --> sitemap --> jx ) we have extended the JXTemplateGenerator, where you can very easily make your jx cacheable. (you just generate it, and everything it depends on is added to it with map:parameter)... So for example, I have a jx depending on session and date and request-param, then Now, the cached jx