RE: Mounting Sub-Sitemap from outside cocoon-dir...
Some hints : 1/ As written in the doc, use : src=file:///x:/some/folder/ 2/ On windows, use / in the path, not \ (yes, it SHOULD be the opposite ...) As I wrote in a previous post, using subsitemaps that are not inside the main sitemap seems to run into reloading problems, when updates are made in the main sitemap file. Look at the thread with the stange title : is this question too simple to be answered ? Regards. Laurent -Message d'origine- De : Menke Jörg,E2 [mailto:[EMAIL PROTECTED] Envoyé : mardi 25 février 2003 10:47 À : '[EMAIL PROTECTED]' Objet : Mounting Sub-Sitemap from outside cocoon-dir... -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi! For better integration into the versioning-system (clearcase in this case) I tried to let the locally installed cocoon (running in Weblogic 7) mount a subsitemap on a different drive (I'm stuck on Windows at the moment... :-( ). This did not work... Examples: map:match pattern=test map:mount check-reload=yes reload-method=synchron src=x:/test/ uri-prefix=test/ /map:match or map:match pattern=test map:mount check-reload=yes reload-method=synchron src=x:/test/sitemap.xmap uri-prefix=test/ /map:match or map:match pattern=test map:mount check-reload=yes reload-method=synchron src=file:/x:/test/sitemap.xmap uri-prefix=test/ /map:match Is this possible at all? Eg: can you reference a sitemap, or even only a ressources directory (for styles p.e.) that is outside the cocoon-installation? Thanks in advance, cu, Jörg -BEGIN PGP SIGNATURE- Version: PGP 6.0.2 iQA/AwUBPlstjf+R/hOShE1OEQJrbwCbBs7N+CWYrYAa9iGx0JLdso9yAloAoNSS jkuV9MVtopDvK/MiDCjSxyxA =sS11 -END PGP SIGNATURE- - 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: Cocoon as a DataMapper framework
Hi Luca, I'm writing a web-application (servlets + POJO) that use Cocoon for presentation, so my application is Controller+Model, and Cocoon is View (plus Controller if I need), MVC model speaking. My application generate data (response) in XML, and then I forward the original request using /view alias, pointing to the main Cocoon servlet. AFAK, i's a servlet, so you can call it like another one ... Regards. Laurent -Message d'origine- De : Luca Zago [mailto:[EMAIL PROTECTED] Envoye : lundi 24 fevrier 2003 14:27 A : [EMAIL PROTECTED] Objet : Cocoon as a DataMapper framework Hi, I was thinking about a data mapper framework, a framework which can take data from a source and write to another destination. An application scenario could be taking an xml somewhere (XML DB, HTML forms) and then writing it to a traget XML or even Relational DB. Then I was thinking why not to use cocoon to do it. I had some doubts, the nice thing could be that I write mainly the xml files for transformation and the pipelines, and then the framework works for me, my doubts are that coccon is too 'content delivery oriented' to apply such features. is cocoon in your opinion enough flexible to use it in such a scenario with not a great load of coding? Has somebody experienced such an application scenario for coccoon? One limitation immediately came to my mind is that cocoon works with a request from client, is it possible to call a pipeline programmatically? Thank you very much n advance for suggestions and opinions. Luca -- Luca Zago Senior IT Developer _ E-TREE S.p.a. Via Fonderia 43 - 31100 Treviso (Italy) phone +39.0422.3107 fax +39.0422.310888 http://www.e-tree.com http://www.webanana.com _ - 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: How can I handle session expiration event
Hi (bonjour)Vincent, you can certainly look at HttpSessionListener, as Cocoon is a java web-application after all. Regards.Laurent. -Message d'origine-De: MAHE Vincent FTRD/DIH/REN [mailto:[EMAIL PROTECTED]Envoyé: lundi 24 février 2003 15:08À: [EMAIL PROTECTED]Objet: How can I handle session expiration event Is there a way to handle session expiration events with cocoon ? I would like to launch some cleaning job when a session expires, is it possible ? Vincent
Is this question too simple to be answered ?
Hi, is this question too simple to be answered ? -Message d'origine- De : Laurent Comte [mailto:[EMAIL PROTECTED]] Envoy : mercredi 19 fvrier 2003 13:25 A : [EMAIL PROTECTED] Objet : Simple pb with subsitemap mount Hi, I just try to create subsitemap as written in docs. I have : [sitemap.xmap] ... map:pipelines !-- very simple test -- map:pipeline map:match pattern=view/** map:mount uri-prefix=view check-reload=true src=file:///D:\work\web.xmap / /map:match /map:pipeline /map:pipelines ... [D:\work\web.xmap] ... map:pipelines map:pipeline map:match pattern=**/index.xml map:generate src=index.xml/ map:transform src=index.xsl/ map:serialize/ /map:match /map:pipeline /map:pipelines ... So, when I type http://localhost:8080/cocon/view/index.xml, i've got this beautiful thing : description org.apache.cocoon.ProcessingException: Exception during processing of file:/D:/index.xsl: java.io.FileNotFoundException: \index.xsl (The system cannot find the file specified) sender org.apache.cocoon.servlet.ParanoidCocoonServlet source Cocoon servlet stack-trace org.apache.cocoon.ProcessingException: Exception during processing of file:/D:/index.xsl: java.io.FileNotFoundException: \index.xsl (The system cannot find the file specified) at org.apache.cocoon.components.source.AbstractStreamSource.toSAX(AbstractStrea mSource.java:211) at org.apache.cocoon.components.xslt.XSLTProcessorImpl.getTransformerHandler(XS LTProcessorImpl.java:268) at org.apache.cocoon.components.xslt.XSLTProcessorImpl.getTransformerHandler(XS LTProcessorImpl.java:239) at org.apache.cocoon.transformation.TraxTransformer.setup(TraxTransformer.java: 298) at org.apache.cocoon.components.pipeline.AbstractEventPipeline.setupPipeline(Ab stractEventPipeline.java:215) at org.apache.cocoon.components.pipeline.CachingEventPipeline.setup(CachingEven tPipeline.java:278) at org.apache.cocoon.components.pipeline.CachingEventPipeline.generateKey(Cachi ngEventPipeline.java:141) at org.apache.cocoon.components.pipeline.CachingStreamPipeline.process(CachingS treamPipeline.java:317) at org.apache.cocoon.www.file_.D_.work.web_xmap.matchN10224(D:\Java\Oodrive\Tom cat\work\cocoon-files\org/apache/cocoon/www/file_/D_/work\web_xmap.java:1530 ) at org.apache.cocoon.www.file_.D_.work.web_xmap.process(D:\Java\Oodrive\Tomcat\ work\cocoon-files\org/apache/cocoon/www/file_/D_/work\web_xmap.java:1439) at org.apache.cocoon.www.file_.D_.work.web_xmap.process(D:\Java\Oodrive\Tomcat\ work\cocoon-files\org/apache/cocoon/www/file_/D_/work\web_xmap.java:1385) at org.apache.cocoon.sitemap.Handler.process(Handler.java:224) at org.apache.cocoon.sitemap.Manager.invoke(Manager.java:179) at org.apache.cocoon.www.sitemap_xmap.matchN1020C(D:\Java\Oodrive\Tomcat\work\c ocoon-files\org/apache/cocoon/www\sitemap_xmap.java:1447) at org.apache.cocoon.www.sitemap_xmap.process(D:\Java\Oodrive\Tomcat\work\cocoo n-files\org/apache/cocoon/www\sitemap_xmap.java:1394) at org.apache.cocoon.www.sitemap_xmap.process(D:\Java\Oodrive\Tomcat\work\cocoo n-files\org/apache/cocoon/www\sitemap_xmap.java:1340) at org.apache.cocoon.sitemap.Handler.process(Handler.java:224) at org.apache.cocoon.sitemap.Manager.invoke(Manager.java:179) at org.apache.cocoon.sitemap.SitemapManager.process(SitemapManager.java:154) at org.apache.cocoon.Cocoon.process(Cocoon.java:575) at org.apache.cocoon.servlet.CocoonServlet.service(CocoonServlet.java:999) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application FilterChain.java:247) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh ain.java:193) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja va:260) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok eNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja va:191) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok eNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180 ) at org.apache.catalina.core.StandardPipeline
RE: Is this question too simple to be answered ?
Hi, and thanks for your reply :) quote Try relative location for your files. /quote The problem is that my subsitemap is not located in a subfolder under the main sitemap. So I must specify as src something like ../../../Apache/htdocs/myFolder/itsHere. Humf! == BUT, finally I found 2 interesting things : 1/ Even in Windows, if I specify the path as file:///D:/work/web.xmap instead file:///D:\work\web.xmap, it works ! Not really logic. 2/ When I change something in the main sitemap without updating the subsitemap file, it fails ! I must make a fake modification in the subsitemap file to make things working ... A little bit confusing, isn't it ? BTW, do you have the same behaviours (I use 2.0.4) ??? Laurent. - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faq/index.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Is this question too simple to be answered ?
Yes, I read it already. So I have check-reload="yes"and reload-method="synchron", BUT the problem is : If I update the main sitemap file without updating the subsitemap file, I obtain a NullPointerException during parsing of the subsitemap file. If I make a fake update in the subsitemap file, it works. Even If I make a fake update in the MAIN sitemap file, I've got the Exception. Regards. Laurent === but for (2) look at the documnentation for the reload-method="synchron" attribute/value. (example under: http://wiki.cocoondev.org/Wiki.jsp?page=BeginnerSWTutorial_01 and http://xml.apache.org/cocoon/userdocs/concepts/sitemap.html - in the section 'Reloading'_
RE: XPath problems in Cocoon?
Perhaps a trail : You use map:generate src="" type="html"/, so perhaps after the generator process, your html page is not EXACTLY the same as your static html file, and your Xpath expression fails. I think you cantrace Cocoon outputs during pipeline process as described in the documentation. Regards.Laurent -Message d'origine-De: Anna Afonchenko [mailto:[EMAIL PROTECTED]]Envoyé: jeudi 20 février 2003 12:05À: [EMAIL PROTECTED]Objet: Re: XPath problems in Cocoon? Derek I don't get any error message, at least not in WEB-IN/logs/error.log I get an xml document in the browser: ?xml version="1.0" encoding="utf-8" ? root / i.e., the stylesheet was applied successfully, it just didn't match anything. Maybe my XPath expression is wrong, but then how comes it works in XMLSpy? Thanks for answering Anna - Original Message - From: Derek Hohls To: [EMAIL PROTECTED] Sent: Thursday, February 20, 2003 12:51 PM Subject: Re: XPath problems in Cocoon? Anna What type of error message do you get in the log files? [EMAIL PROTECTED] 20/02/2003 12:40:10 Hi all. I am not sure that this message is related to Cocoon, so I apologize, if this is not appropriate here. I have a very simple html - test.html: html head titleTest anchors/title /head body ptest anchors/p a href=""One/a a href=""Two/a divseparator/div a href=""One1/a br / a href=""Two1/a divseparator/div a href=""One2/a some text a href=""Two2/a /body /html I want to choose the 'a' nodes for which first following node that is not a white-space only node is 'a' node. E.g. in the html above only the first 'a' node should be picked up. I wrote a very simple xsl - test.xsl: xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xsl:template match="/" root xsl:for-each select="//a[name(following-sibling::node()[1][not(self::text() and normalize-space())])='a']" xsl:value-of select="."/ /xsl:for-each /root /xsl:template /xsl:stylesheet When I apply this stylesheet on my test.html using XMLSpy's XSL Transformation Tool, I get this xml: rootOne/root, e.g. it chose correctly the first a node. But when I apply this stylesheet using Cocoon, I get empty root/ as a result, e.g. in Cocoon nothing is chosen. Here is my pipeline: map:match pattern="testAnchors" map:generate src="" type="html"/ map:transform type="xslt-saxon" src=""/ map:serialize type="xml"/ /map:match Can somebody explain me what is wrong with my stylesheet and why doesn't it work using Cocoon? Thank you very much for help and sorry if this is not too much related. Best regards, Anna-- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. "The CSIR exercises no editorial control over E-mail messages and/or attachments thereto/links referred to therein originating in the organisation and the views in this message/attachments thereto are therefore not necessarily those of the CSIR and/or its employees. The sender of this e-mail is, moreover, in terms of the CSIR's Conditions of Service, subject to compliance with the CSIR's internal E-mail and Internet Policy."
Sitemap parameters lifetime
As described at http://xml.apache.org/cocoon/userdocs/concepts/actions.html, you can set sitemap param as : sitemapParams.put("world", "hello"); I think it must be said what is the lifetime of the param "world". Because after the execution of the pipeline where this parameter is setted (via an Action), the value of parameter "world" is still "hello" ! Soare you agreewith : "Sitemap parameters are "global" parameters ? And not "local" to a pipeline ?" I think it's important ... Laurent.
RE: Sitemap parameters lifetime
It seems I must post the same question twice to have an answer :) Regards.Laurent. -Message d'origine-De: Laurent Comte [mailto:[EMAIL PROTECTED]]Envoyé: jeudi 20 février 2003 13:09À: [EMAIL PROTECTED]Objet: Sitemap parameters lifetime As described at http://xml.apache.org/cocoon/userdocs/concepts/actions.html, you can set sitemap param as : sitemapParams.put("world", "hello"); I think it must be said what is the lifetime of the param "world". Because after the execution of the pipeline where this parameter is setted (via an Action), the value of parameter "world" is still "hello" ! Soare you agreewith : "Sitemap parameters are "global" parameters ? And not "local" to a pipeline ?" I think it's important ... Laurent.
Simple pb with subsitemap mount
Hi, I just try to create subsitemap as written in docs. I have : [sitemap.xmap] ... map:pipelines !-- very simple test -- map:pipeline map:match pattern=view/** map:mount uri-prefix=view check-reload=true src=file:///D:\work\web.xmap / /map:match /map:pipeline /map:pipelines ... [D:\work\web.xmap] ... map:pipelines map:pipeline map:match pattern=**/index.xml map:generate src=index.xml/ map:transform src=index.xsl/ map:serialize/ /map:match /map:pipeline /map:pipelines ... So, when I type http://localhost:8080/cocon/view/index.xml, i've got this beautiful thing : description org.apache.cocoon.ProcessingException: Exception during processing of file:/D:/index.xsl: java.io.FileNotFoundException: \index.xsl (The system cannot find the file specified) sender org.apache.cocoon.servlet.ParanoidCocoonServlet source Cocoon servlet stack-trace org.apache.cocoon.ProcessingException: Exception during processing of file:/D:/index.xsl: java.io.FileNotFoundException: \index.xsl (The system cannot find the file specified) at org.apache.cocoon.components.source.AbstractStreamSource.toSAX(AbstractStrea mSource.java:211) at org.apache.cocoon.components.xslt.XSLTProcessorImpl.getTransformerHandler(XS LTProcessorImpl.java:268) at org.apache.cocoon.components.xslt.XSLTProcessorImpl.getTransformerHandler(XS LTProcessorImpl.java:239) at org.apache.cocoon.transformation.TraxTransformer.setup(TraxTransformer.java: 298) at org.apache.cocoon.components.pipeline.AbstractEventPipeline.setupPipeline(Ab stractEventPipeline.java:215) at org.apache.cocoon.components.pipeline.CachingEventPipeline.setup(CachingEven tPipeline.java:278) at org.apache.cocoon.components.pipeline.CachingEventPipeline.generateKey(Cachi ngEventPipeline.java:141) at org.apache.cocoon.components.pipeline.CachingStreamPipeline.process(CachingS treamPipeline.java:317) at org.apache.cocoon.www.file_.D_.work.web_xmap.matchN10224(D:\Java\Oodrive\Tom cat\work\cocoon-files\org/apache/cocoon/www/file_/D_/work\web_xmap.java:1530 ) at org.apache.cocoon.www.file_.D_.work.web_xmap.process(D:\Java\Oodrive\Tomcat\ work\cocoon-files\org/apache/cocoon/www/file_/D_/work\web_xmap.java:1439) at org.apache.cocoon.www.file_.D_.work.web_xmap.process(D:\Java\Oodrive\Tomcat\ work\cocoon-files\org/apache/cocoon/www/file_/D_/work\web_xmap.java:1385) at org.apache.cocoon.sitemap.Handler.process(Handler.java:224) at org.apache.cocoon.sitemap.Manager.invoke(Manager.java:179) at org.apache.cocoon.www.sitemap_xmap.matchN1020C(D:\Java\Oodrive\Tomcat\work\c ocoon-files\org/apache/cocoon/www\sitemap_xmap.java:1447) at org.apache.cocoon.www.sitemap_xmap.process(D:\Java\Oodrive\Tomcat\work\cocoo n-files\org/apache/cocoon/www\sitemap_xmap.java:1394) at org.apache.cocoon.www.sitemap_xmap.process(D:\Java\Oodrive\Tomcat\work\cocoo n-files\org/apache/cocoon/www\sitemap_xmap.java:1340) at org.apache.cocoon.sitemap.Handler.process(Handler.java:224) at org.apache.cocoon.sitemap.Manager.invoke(Manager.java:179) at org.apache.cocoon.sitemap.SitemapManager.process(SitemapManager.java:154) at org.apache.cocoon.Cocoon.process(Cocoon.java:575) at org.apache.cocoon.servlet.CocoonServlet.service(CocoonServlet.java:999) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application FilterChain.java:247) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh ain.java:193) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja va:260) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok eNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja va:191) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok eNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180 ) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok eNext(StandardPipeline.java:643) at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve. java:170) at
RE: Using a RequestAttributeSelector
let me quote a comment from the virgin cocoon sitemap: quote Since this is important, let me repeat it: Selectors are executed during pipeline setup. /quote the same goes for matchers and actions. what this means is that the RequestAttributeSelector is done before your generation step in the pipeline even starts. so, yes, the selector was acting on the original request (someUrl in your pipeline). Right. I thought it was the case only for actions ... another issue: I think it wouldn't even work when the selector would execute after the generation step, because you are selecting on a request attribute; but you're generating from the url, i.e. you make a request, you don't process it. so having the servlet set a request attribute is useless, since it generates a response, not a request. Right again ... apart from that I wonder why you'd want an external servlet as a controller. and I don't have any good idea (besides ugly stuff) how to do what you want to achieve. I don't want use an external servlet as a controller, but as a generator (to produce XML dynamically). I'de like to found a good way to select the right View dynamically, depending of the result of the generator-servlet. It's not necessary with a servlet. Perhaps it's not possible yet with Cocoon ? Laurent. - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faq/index.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Using a servlet as source for a generator
I think it doesn't fit your servlet mapping. Try map:generate uri=myServlet/ It doesn't work ... It couldn't setup pipeline with an org.apache.cocoon.ProcessingException: Could not setup pipeline.: org.xml.sax.SAXException: Invalid System ID If this doesn't work either and you are using 2.1 you can also try map:generate uri=http://{request:serverName}:{request:serverPort}{request:contextPath}/ m yServlet/ Doesn't work with 2.0.4 ... I believe this also works for 2.0.5-dev Did not tried yet. Regards. - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faq/index.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Using a servlet as source for a generator
Sorry, it should be map:generate src=myServlet/ I've tried also, but in this case, it looks the ressource on the file system (FileNotFoundException) ... Laurent - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faq/index.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Using a servlet as source for a generator
OK, one last guess: map:generate src=/myServlet/ I tried for 2 hours all sorts of things :(( ... The only one working is with the full url ... I think that for Cocoon: 1/ there's some confusion between src and uri attribute for the generator 2/ there's some confusion on how to know if uri is internet-uri or filesystem-uri ... It seems that it check if uri begin with http. Does it work with https ??? If this does not work I would go with: map:generate src=http://{request:serverName}:{request:serverPort}{request:contextPath}/ m yServlet/ AFAIK input modules have been backported to 2.0.5-dev I use only 2.0.4 prod version, i have enough problems with it :) Regards, Laurent - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faq/index.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Using a servlet as source for a generator
It seems that it check if uri begin with http. That is what I thought as well. But http://wiki.cocoondev.org/Wiki.jsp?page=IntegrateAServlet seems to indicate otherwise. Yes, but the author of this article told me that he didn't test it ! :-/ He will going to change his article ... Does it work with https ??? I don't think FileGenerator supports this. But you can try WebServiceProxyGenerator which uses commons-http client which supports https. In this case, i've got an SSL exception (certainly because i didn't configure SSL on my server), so it seems to look the ressource in the good place ... Laurent. - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faq/index.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Using a RequestAttributeSelector
I would like to : 1/ use a servlet (servDoSomething) as a generator to generate some XML data. 2/ depending of what happened in step 1 (everything was fine or some error happened), I would like to set a nextpage attribute to say where should we go next : request.setAttribute(nextpage, ok) or request.setAttribute(nextpage, error) 3/ in the pipeline, I want to select the good stylesheet depending of this attribute. So I tried to use the RequestAttributeSelector, because i've put the attribute nextpage in the request. BUT, it seems that the request read by the selector is the original one (or something like this), and my attribute is never found ... I used the logger of the RequestAttributeSelector and it says : RequestAttributeSelector: Request attribute 'nextpage' not set -- failing So, i'de like to find a good way to select my transformer at runtime, depending of the result of the generator-servlet. We can say : using a kind of Controller to choose the right View, depending of the result of an action in the Model. Any ideas ? Laurent. Cocoon 2.0.4 ; J2SE 1.4.1 ; Tomcat 4.1.18 ; Win2000 SP3 map:selector logger=sitemap.selector.request-attribute name=request-attribute src=org.apache.cocoon.selection.RequestAttributeSelector attribute-namenextpage/attribute-name /map:selector map:pipeline match=someUrl map:generate src=http://localhost:8080/web/servDoSomething; / map:select type=request-attribute map:when test=ok map:transform src=a_first_stylesheet.xsl / /map:when map:otherwise map:transform src=a_second_stylesheet.xsl / /map:otherwise /map:select map:serialize / /map:pipeline - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faq/index.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Using a servlet as source for a generator
Hi all, i've read the article at http://wiki.cocoondev.org/Wiki.jsp?page=IntegrateAServlet and i have a question ... I tried to use a servlet as a source for a generator and it works when i set the full url of the servlet (like http://localhost:8080/myApp/myServlet;). Unfortunately, when i dont't specify the full url but the servlet-mapping (like /myApp/myServlet) for src, i've got a weird error (see below) ... Of course, when i type the same url in my browser, it works (http://localhost:8080/myApp/myServlet;). Cocoon and my servlet are in the same webApp (and same Tomcat's Context). Does it really work for you ? sitemap.xmap is standard and i had just added this : map:pipelines map:pipeline match=myApp/test map:generate uri=/myApp/myServlet/!-- return XML -- map:serialize / /map:pipeline /map:pipelines My conf: Win2000 SP3 J2SE 1.4.1_01 Tomcat 4.1.18 Cocoon 2.0.4 == The Error : type fatal message Exception during processing of file:/D:/myApp/myServlet description org.apache.cocoon.ProcessingException: Exception during processing of file:/D:/myApp/myServlet: java.io.FileNotFoundException: \myApp\myServlet (The system cannot find the path specified) sender org.apache.cocoon.servlet.ParanoidCocoonServlet source Cocoon servlet stack-trace org.apache.cocoon.ProcessingException: Exception during processing of file:/D:/myApp/myServlet: java.io.FileNotFoundException: \myApp\myServlet (The system cannot find the path specified) at org.apache.cocoon.components.source.AbstractStreamSource.toSAX(AbstractStrea mSource.java:211) at org.apache.cocoon.generation.FileGenerator.generate(FileGenerator.java:143) at org.apache.cocoon.components.pipeline.CachingEventPipeline.process(CachingEv entPipeline.java:250) at org.apache.cocoon.components.pipeline.CachingStreamPipeline.process(CachingS treamPipeline.java:399) at org.apache.cocoon.www.sitemap_xmap.process(D:\Java\Oodrive\Tomcat\work\cocoo n-files\org/apache/cocoon/www\sitemap_xmap.java:1449) at org.apache.cocoon.www.sitemap_xmap.process(D:\Java\Oodrive\Tomcat\work\cocoo n-files\org/apache/cocoon/www\sitemap_xmap.java:1340) at org.apache.cocoon.sitemap.Handler.process(Handler.java:224) at org.apache.cocoon.sitemap.Manager.invoke(Manager.java:179) at org.apache.cocoon.sitemap.SitemapManager.process(SitemapManager.java:154) at org.apache.cocoon.Cocoon.process(Cocoon.java:575) at org.apache.cocoon.servlet.CocoonServlet.service(CocoonServlet.java:999) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application FilterChain.java:247) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh ain.java:193) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja va:260) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok eNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja va:191) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok eNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180 ) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok eNext(StandardPipeline.java:643) at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve. java:170) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok eNext(StandardPipeline.java:641) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172 ) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok eNext(StandardPipeline.java:641) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java :174) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok eNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java: 1040)