RE: How to force a Save As prompt?
Matthias, Simplest solution is to write multiple matches, one for each type of serializer you want to use. That's what I do.. Precompilation of the sitemap prevents the use of variables in for instance the type attributes of generators, transformers and serializers. The sitemap processor pre-loads all necessary objects, while those variables are evaluated on request-time... :-P You could also try to use map:select, but I personally find it a bit clumsy most of the time.. Kind regards, Geert -Original Message- From: Matthias Müller [mailto:[EMAIL PROTECTED] Sent: woensdag 8 oktober 2008 9:26 To: users@cocoon.apache.org Subject: AW: How to force a Save As prompt? Hey, one more question: in your example you serialize your stream as xml. i want to be flexible with this, e.g. for xml or pdf files. matthias - Ursprüngliche Mail Von: Geert Josten [EMAIL PROTECTED] An: users@cocoon.apache.org users@cocoon.apache.org Gesendet: Dienstag, den 7. Oktober 2008, 14:32:39 Uhr Betreff: RE: How to force a Save As prompt? Hi, I typically do something like this: map:match pattern=download/*/** map:generate src=cocoon:/{2}/ map:act type=set-header map:parameter name=Content-Type value=application/x-download/ map:parameter name=Content-Disposition value=attachment ; filename={1}/ map:serialize type=xml/ /map:act /map:match Kind regards, Geert Drs. G.P.H. Josten Consultant http://www.daidalos.nl/ Daidalos BV Source of Innovation Hoekeindsehof 1-4 2665 JZ Bleiswijk Tel.: +31 (0) 10 850 1200 Fax: +31 (0) 10 850 1199 http://www.daidalos.nl/ KvK 27164984 De informatie - verzonden in of met dit emailbericht - is afkomstig van Daidalos BV en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onbedoeld hebt ontvangen, verzoeken wij u het te verwijderen. Aan dit bericht kunnen geen rechten worden ontleend. From: Matthias Müller [mailto:[EMAIL PROTECTED] Sent: dinsdag 7 oktober 2008 14:28 To: users cocoon.apache.org Subject: How to force a Save As prompt? Hi there, is there a way or workaround how i can force a Save As prompt for my cocoon output? The problem is that the browser knows the mime types of the generated files (xml, pdfs) and displays it instead of prompting. regards, matthias - 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]
RE: How to force a Save As prompt?
Hi, I typically do something like this: map:match pattern=download/*/** map:generate src=cocoon:/{2}/ map:act type=set-header map:parameter name=Content-Type value=application/x-download/ map:parameter name=Content-Disposition value=attachment ; filename={1}/ map:serialize type=xml/ /map:act /map:match Kind regards, Geert Drs. G.P.H. Josten Consultant http://www.daidalos.nl/ Daidalos BV Source of Innovation Hoekeindsehof 1-4 2665 JZ Bleiswijk Tel.: +31 (0) 10 850 1200 Fax: +31 (0) 10 850 1199 http://www.daidalos.nl/ KvK 27164984 De informatie - verzonden in of met dit emailbericht - is afkomstig van Daidalos BV en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onbedoeld hebt ontvangen, verzoeken wij u het te verwijderen. Aan dit bericht kunnen geen rechten worden ontleend. From: Matthias Müller [mailto:[EMAIL PROTECTED] Sent: dinsdag 7 oktober 2008 14:28 To: users cocoon.apache.org Subject: How to force a Save As prompt? Hi there, is there a way or workaround how i can force a Save As prompt for my cocoon output? The problem is that the browser knows the mime types of the generated files (xml, pdfs) and displays it instead of prompting. regards, matthias - 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: File upload
How about letting users do the upload in a separate (popup) window, which they can minimize while it is still busy? ;-) Cheers Drs. G.P.H. Josten Consultant http://www.daidalos.nl/ Daidalos BV Source of Innovation Hoekeindsehof 1-4 2665 JZ Bleiswijk Tel.: +31 (0) 10 850 1200 Fax: +31 (0) 10 850 1199 http://www.daidalos.nl/ KvK 27164984 De informatie - verzonden in of met dit emailbericht - is afkomstig van Daidalos BV en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onbedoeld hebt ontvangen, verzoeken wij u het te verwijderen. Aan dit bericht kunnen geen rechten worden ontleend. From: Magnus Haraldsen Amundsen [mailto:[EMAIL PROTECTED] Sent: maandag 4 augustus 2008 17:44 To: users@cocoon.apache.org Subject: File upload Hi, When doing file upload, and the file is at such a size that the processing of the uploaded file takes quite some time, is it possible to let the user continue with the browsing while the server handles the processing in the background? IMPORTANT NOTICE: This message may contain confidential information. If you have received this e-mail in error, do not use, copy or distribute it. Do not open any attachments. Delete it immediately from your system and notify the sender promptly by e-mail that you have done so. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: character-maps in cocoon
Heather, This could be done by using Saxon as (XSL)Serializer. I have some code around somewhere, but I won't be able to look it up till the end of the day (CET time). Kind regards, Geert Drs. G.P.H. Josten Consultant http://www.daidalos.nl/ Daidalos BV Source of Innovation Hoekeindsehof 1-4 2665 JZ Bleiswijk Tel.: +31 (0) 10 850 1200 Fax: +31 (0) 10 850 1199 http://www.daidalos.nl/ KvK 27164984 De informatie - verzonden in of met dit emailbericht - is afkomstig van Daidalos BV en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onbedoeld hebt ontvangen, verzoeken wij u het te verwijderen. Aan dit bericht kunnen geen rechten worden ontleend. From: Jeroen Reijn [mailto:[EMAIL PROTECTED] Sent: maandag 9 juni 2008 12:38 To: users@cocoon.apache.org Subject: Re: character-maps in cocoon Hi! You could try to use disable-output-escaping in your xslt files. Maybe that will help. Regards, Jeroen Heather Rankin wrote: Hi, Are character-maps supported in Cocoon 2.1? I need to replace lt; and gt; entity references with the literal characters '' and '' and can't get it to work in Cocoon. I have the following character-map in my XSLT: xsl:output use-character-maps=cm1 method=xml indent=yes encoding=UTF-8 media-type=text/xml/ xsl:character-map name=cm1 xsl:output-character character=lt; string=lt;/ xsl:output-character character=gt; string=gt;/ /xsl:character-map This works fine outside of cocoon (e.g. in Oxygen). But when I run it through the second transformer in the following pipleline: map:match pattern=terms map:generate src={request-param:url} type=html/ map:transform type=xslt2 src=transforms/getTerms.xsl/ map:transform type=xslt2 src=transforms/convertStringToXML.xsl/ map:serialize type=xml/ /map:match ... the lt; and gt; characters do not get replaced (remain escaped). Is this something to do with the xml serializer? Do I need to change something there? Heather http://www.bbc.co.uk/ This e-mail (and any attachments) is confidential and may contain personal views which are not the views of the BBC unless specifically stated. If you have received it in error, please delete it from your system. Do not use, copy or disclose the information in any way nor act in reliance on it and notify the sender immediately. Please note that the BBC monitors e-mails sent or received. Further communication will signify your consent to this. - 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]
RE: character-maps in cocoon
Hi, Other people may have raised their ears in expectation, so I am going to give away the most essential details anyway.. ;-) You need to create a new Java Cocoon component unfortunately. The easiest way is to extend the AbstractTextSerializer. You basically only need to overrule the setOutputStream function to create a transform handler and register that as content handler. Something like: SAXTransformerFactory tfactory = this.getTransformerFactory(); Templates templates = tfactory.newTemplates(new StreamSource(xslURI)); TransformerHandler transformerHandler = tfactory.newTransformerHandler(templates); transformerHandler.getTransformer().setOutputProperties(this.format); transformerHandler.setResult(new StreamResult(this.output)); this.setContentHandler(transformerHandler); this.setLexicalHandler(transformerHandler); xslURI is a parameter that could be passed to the component by using the configure interface (creation of object), or perhaps even through setup interface (preparation of sitemap, perhaps more convenient). The java code of XMLSerializer has pretty much everything you need, except that it doesn't lookup this xslURI variable and it doesn't create a new TransformerHandler each time as it isn't applying any XSL.. Also make sure to add the following parameter to the map:serializer definition and also something to specify the XSL containing the character maps: transformer-factorynet.sf.saxon.TransformerFactoryImpl/transformer-fa ctory If you google for 'XSLSerializer', you will find lots of comments of some other people having created similar things. (Found no real code though.) The general conclusion is to keep the serializer clean, so just add stuff in the XSL that cannot be put in an XSL transform before... Anyhow, I have extended the AbstractTextSerializer for other uses as well. It really takes a large step to create a first component of yourselves, but once that is behind you... ;-) Kind regards, Geert PS: I am not able to share the real code, for copyrights reasons. Sorry.. :-( -Original Message- From: Heather Rankin [mailto:[EMAIL PROTECTED] Sent: maandag 9 juni 2008 17:01 To: users@cocoon.apache.org Subject: RE: character-maps in cocoon Hi Geert, Just to save you some digging, I managed to get this working with the saxon:parse() extension instead. This works fine (no need for character maps): !-- Where node contains text mixed with enity references -- xsl:copy-of select=saxon:parse(results/node)/ Thanks for the help. Heather -Original Message- From: Geert Josten [mailto:[EMAIL PROTECTED] Sent: 09 June 2008 11:46 To: users@cocoon.apache.org Subject: RE: character-maps in cocoon Heather, This could be done by using Saxon as (XSL)Serializer. I have some code around somewhere, but I won't be able to look it up till the end of the day (CET time). Kind regards, Geert Drs. G.P.H. Josten Consultant http://www.daidalos.nl/ Daidalos BV Source of Innovation Hoekeindsehof 1-4 2665 JZ Bleiswijk Tel.: +31 (0) 10 850 1200 Fax: +31 (0) 10 850 1199 http://www.daidalos.nl/ KvK 27164984 De informatie - verzonden in of met dit emailbericht - is afkomstig van Daidalos BV en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onbedoeld hebt ontvangen, verzoeken wij u het te verwijderen. Aan dit bericht kunnen geen rechten worden ontleend. From: Jeroen Reijn [mailto:[EMAIL PROTECTED] Sent: maandag 9 juni 2008 12:38 To: users@cocoon.apache.org Subject: Re: character-maps in cocoon Hi! You could try to use disable-output-escaping in your xslt files. Maybe that will help. Regards, Jeroen Heather Rankin wrote: Hi, Are character-maps supported in Cocoon 2.1? I need to replace lt; and gt; entity references with the literal characters '' and '' and can't get it to work in Cocoon. I have the following character-map in my XSLT: xsl:output use-character-maps=cm1 method=xml indent=yes encoding=UTF-8 media-type=text/xml/ xsl:character-map name=cm1 xsl:output-character character=lt; string=lt;/ xsl:output-character character=gt; string=gt;/ /xsl:character-map This works fine outside of cocoon (e.g. in Oxygen). But when I run it through the second transformer in the following pipleline: map:match pattern=terms map:generate src={request-param:url} type=html/ map:transform type=xslt2 src=transforms/getTerms.xsl/ map:transform type=xslt2 src=transforms/convertStringToXML.xsl/ map:serialize type=xml/ /map:match ... the lt; and gt; characters do not get replaced (remain escaped). Is this something to do with the xml serializer? Do I need to change
RE: PDF Image Caching Problem
Hi Peter, I typically use the following construct for non-caching generation of documents: map:pipeline type=noncaching map:parameter name=outputBufferSize value=8192/ Kind regards, Geert Drs. G.P.H. Josten Consultant Daidalos BV Source of Innovation Hoekeindsehof 1-4 2665 JZ Bleiswijk Tel.: +31 (0) 10 850 1200 Fax: +31 (0) 10 850 1199 www.daidalos.nl KvK 27164984 De informatie - verzonden in of met dit emailbericht - is afkomstig van Daidalos BV en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onbedoeld hebt ontvangen, verzoeken wij u het te verwijderen. Aan dit bericht kunnen geen rechten worden ontleend. From: Peter Sparkes [mailto:[EMAIL PROTECTED] Sent: maandag 5 mei 2008 10:55 To: users@cocoon.apache.org Subject: PDF Image Caching Problem Hi, I generate html and pdf, which contain images, from the a database. When I update an image the html correctly displays the new image, however the pdf incorrectly contains the old image. If I then change the new image file name the pdf displays the correct image. When I change the image file name back the old image is displayed in the pdf, not the new image. It appears that the pdf is using a cached version of the image not the new version. Please, how can I get the pdf to display the new image rather than the old cashed image. I can't change the image file name in the production system. I am using Cocoon 2.1.10 Thank you Peter Sparkes - 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 to use stream generator to get multipart/form-data POST value
As an alternative, you could prefix the target field name with 'xml:' and use the request generator. If you don't specify parameters on the stream generator, it tries to process the request body. But how to get XML in the body with a html submit form? HTH, Geert Drs. G.P.H. Josten Consultant Daidalos BV Source of Innovation Hoekeindsehof 1-4 2665 JZ Bleiswijk Tel.: +31 (0) 10 850 1200 Fax: +31 (0) 10 850 1199 www.daidalos.nl KvK 27164984 De informatie - verzonden in of met dit emailbericht - is afkomstig van Daidalos BV en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onbedoeld hebt ontvangen, verzoeken wij u het te verwijderen. Aan dit bericht kunnen geen rechten worden ontleend. From: Flutina.Zhu [mailto:[EMAIL PROTECTED] Sent: donderdag 13 september 2007 12:19 To: users@cocoon.apache.org Subject: How to use stream generator to get multipart/form-data POST value hi, all I met a problem with stream generator. I submit a form as form id=uploadForm dojoAttachPoint=uploadFormNode method=post enctype=multipart/form-data action=upload.xml ... input name=target id=target name=target type=file/ ... /form So in the sitemap it as follow: map:generate type=stream map:parameter name=form-name value=target/ map:parameter name=defaultContentType value=multipart/form-data/ /map:generate but I get the error like : Exception in StreamGenerator.generate(): java.lang.NullPointerException So what's wrong with my code? the target is a well-format xml file. Anybody can help me? -flutina - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Using xsl:message and Cocoon
Hi, We have been using a patch for the TraxTransformer to get a more sensible error message rather that just 'Stylesheet directed termination': } catch (XSLTProcessorException se) { //throw new ProcessingException(Unable to get transformer handler for + this.inputSource.getURI(), se); /* [GJ] Patched to get sensible Exception messages */ if (se.getCause() == null) { throw new ProcessingException(Invalid stylesheet + this.inputSource.getURI() + : + se.getMessage());//, se); } else { throw new ProcessingException(Invalid stylesheet + this.inputSource.getURI() + : + se.getCause().getMessage());//, se.getCause()); } } It should be located near the end of the setup function. Note that this patch was applied to Cocoon 2.1.4. Perhaps it is included in the most recent version, I haven't checked. HTH, Geert Drs. G.P.H. Josten Consultant Daidalos BV Source of Innovation Hoekeindsehof 1-4 2665 JZ Bleiswijk Tel.: +31 (0) 10 850 1200 Fax: +31 (0) 10 850 1199 www.daidalos.nl KvK 27164984 De informatie - verzonden in of met dit emailbericht - is afkomstig van Daidalos BV en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onbedoeld hebt ontvangen, verzoeken wij u het te verwijderen. Aan dit bericht kunnen geen rechten worden ontleend. From: Jonathan Hipkiss [mailto:[EMAIL PROTECTED] On Behalf Of Jonathan Hipkiss Sent: vrijdag 13 juli 2007 18:07 To: users@cocoon.apache.org Subject: Re: Using xsl:message and Cocoon I don't know if this is any help but we use xsl:message terminate=yes blah/xsl:message and then add in the sitemap: map:handle-errors map:generate type=exception src=error/ map:transform type=xslt src=blah.xslt / map:serialize type=html status-code=400 / /map:handle-errors This way we can catch failing templates gracefully and display some breakpoint. Jonathan Andreas Kuehne wrote: Thanks for your final conclusion. Surely will save valuable time for many other developers ! There are too few postings of final outcomes to the list, especially in case of 'no solution'. Greetings Andreas - Original Message From: Steven D. Majewski [EMAIL PROTECTED] To: users@cocoon.apache.org Sent: Thursday, July 12, 2007 5:55:10 PM Subject: Re: Using xsl:message and Cocoon As the OP in that thread, I should note that despite Mark's help, I was still never able to find a trace of the xsl:message output. However, I gave up and tried some alternative ways of debugging instead, so I didn't spend a lot of time trying to figure out why it didn't work for me. Perhaps a xalan vs saxon issue? -- Steve Majewski On Jul 11, 2007, at 8:09 PM, Joerg Heinicke wrote: On 05.07.2007 11:43, Mike Dawson wrote: I have a few XSL's I'm attempting to do some basic debugging on and would like to use just plain old xsl:message to get an idea about certain variables through the execution of the XSL. Unfortunately after grepping the logs directory there was no sign of the string I had in xsl:message - and no sign of core.log Any help getting to xsl:message would be most appreciated. There is a thread from the beginning of this year [1], especially Mark Lundquist's message [2] explains where the message goes to. Joerg [1] http://marc.info/?l=xml-cocoon-usersm=116983397905795w=4 [2] http://marc.info/?t=11696104453r=1w=4 - 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]
RE: Image treatment
Could you give more hints about what you are trying to achieve exactly. To my knowledge, it should be possible to read with any protocol known to Cocoon, but where should the result go, once transformed? And are you trying to process multiple images in one pass? Try transforming just one for starters.. Kind regards, Geert Drs. G.P.H. Josten Consultant Daidalos BV Source of Innovation Hoekeindsehof 1-4 2665 JZ Bleiswijk Tel.: +31 (0) 10 850 1200 Fax: +31 (0) 10 850 1199 www.daidalos.nl KvK 27164984 De informatie - verzonden in of met dit emailbericht - is afkomstig van Daidalos BV en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onbedoeld hebt ontvangen, verzoeken wij u het te verwijderen. Aan dit bericht kunnen geen rechten worden ontleend. From: lfhc [mailto:[EMAIL PROTECTED] Sent: maandag 18 juni 2007 13:21 To: users@cocoon.apache.org Subject: Image treatment Hi, I needed to have some image treatment done, and I've been looking through ImageReader. Yet, my assumption is that this module only gets images from a filesystem, and I needed to get them through an http source. For example, I have a content source for news, that gives me an url for the images uploaded. With that content source, I want to build html pages, but that image url cannot be the original one, but one from cocoon, and, if possible, have some resizing done. Can anyone point me in the right direction please? Thank you, Best Regards, Luis Carvalho. -- View this message in context: http://www.nabble.com/Image-treatment-tf3939701.html#a11173889 Sent from the Cocoon - Users mailing list archive at Nabble.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: re-design of sitemaps
3) definition of a sitemap schema http://cocoon.apache.org/schema/sitemap/cocoon-sitemap-1.0.xsd 4) requirement that sitemaps validate against that schema (would make it easier to write sitemap tools) validation is off by default but can be activated, again only in Cocoon 2.2 Correct me if I am wrong, but I thought that it was impossible to write a complete XML schema for the current version of the sitemap. I thought all attempts hitherto were only approximations. One of the major problems is that any extensions a user writes (actions, transformations, etc.) might introduce new elements and attributes into the sitemap which the schema cannot know about a priori. I was looking for a solution where any valid sitemap could be validated against the schema, which seems to me to imply a change in the structure of sitemaps. Would it be right to say that the intention of this XML schema is only to support a simple subset of all possible current Cocoon sitemaps? Can one then provide the missing functionality by writing one's own blocks using the servlet-service framework? Have you tried validating your own sitemaps to this XSD yet? It contains constructs that allow entry of unknown elements.. Kind regards, Geert Drs. G.P.H. Josten Consultant Daidalos BV Source of Innovation Hoekeindsehof 1-4 2665 JZ Bleiswijk Tel.: +31 (0) 10 850 1200 Fax: +31 (0) 10 850 1199 www.daidalos.nl KvK 27164984 De informatie - verzonden in of met dit emailbericht - is afkomstig van Daidalos BV en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onbedoeld hebt ontvangen, verzoeken wij u het te verwijderen. Aan dit bericht kunnen geen rechten worden ontleend. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: unpack/unizp a complete zip file?
Hi H., It is not as complex as it might look, but you must extend the ZipSource component to make it work. I added the following code in the getInputStream function: String xml = ?xml version=\1.0\ encoding=\utf-8\?\nzip:archive xmlns:zip=\ + ZIP_NAMESPACE + \ name=\ + this.archive.getURI() + \\n; ZipEntry document = null; do { document = zipStream.getNextEntry(); if (document != null) { xml += zip:entry name=\ + document.getName() + \ /\n; zipStream.closeEntry(); } } while (document != null); xml += /zip:archive\n; return new ByteArrayInputStream(xml.getBytes(utf-8)); As you can see, this returns a list of socalled zip:entry elements with the names WITH (sub)path of the documents inside the zip (zip entries) as name attribute of these elements. Simple but effective. You will also need to change the ZipSourceFactory to identify when to return a zip entry listing and when to return actual file contents. The fun thing is that you can use the zip protocol itself to get both the zip entry listing and the actual file contents. What I usually do is start a pipeline match with a generate to get the zip entry listing. I then call an XSL to which I pass the URN that provided the zip entry listing. The XSL changes each zip:entry into a save:file element and takes as src attribute the URN for the zip, extended with the specific name of the zip:entry. As target you can do as you like. I typically have a global variable data-dir, to which I write. But you could write to Temp as well, or to a path that is provided as request-param. The SaveFilesTransformer simply uses the zip protocol to get access to the contents of each zip entry, as you specified with your XSL. The transformer does not care at all where contents is coming from, that is the beauty. The only bottleneck might be that empty directories might not come out. Directories are not stored as zip entries if I am correct. HTH, Geert -Original Message- From: HGENTO [mailto:[EMAIL PROTECTED] Sent: dinsdag 29 mei 2007 22:24 To: users@cocoon.apache.org Subject: Re: unpack/unizp a complete zip file? Hi Geert Jorsten, thank you for your detailed explanation. But now I'm a little but confused ;-) I'll try to set up an action but at the moment struggling with some .tmp files issues. So therefore I would also like to try your why as it sound very good but on the other way a little bit confusing. Hopefully I can ask you few questions to this to fully understand. I know how transformer work ad at the end i only need and xml file containing the information in the way the transformer needs for writing. So far so good but: how can I receive the directory and files as well as all subdirectory and subfiles within the zip file I want to extract? And the second question will be, how I have to set this instruction in the xml file, that contains the save information. cocoon wiki only tells me save:file src=mySourceUrl target=myTargetFileName xmlns:save=http://daidalos.nl/cocoon/save/1.0; http://daidalos.nl/cocoon/save/1.0 / In what kind of why I have to set the src attribute, as at the end it has to read the files and folder within the zip file? Perhaps you can give me another hint ;-) Hopefully, H. Geert Josten wrote: Hi, It was a rather short and quick answer, but yes, depending on the component that extracts the files and writes them, it is in principle possible to extract all types of files. SourceWriting component however uses XML/DOM as intermediate, so that component is unuseable as it is. (At least how it was around versions 2.1.4 - 2.1.6..) The SaveFiles transformer however is exactly written for this task. It doesn't cache anything, it redirect an inputstream to an outputstream internally and is therefore capable of handling binary. Only the outcome (fail or success) is passed to cocoon as xml. More about it on wiki: http://wiki.apache.org/cocoon/SaveFilesTransformer My zipsource produces on long xml with the full contents. One xsl pass converts this to savefiles instruction sheet, just a long list of save:file elements with a src and a target attribute. These can be processed in a single pass with the transformer. The end result of this transform can be used to produce a fail/success report. One final note on Cocoon Actions, the alternative on which Joerg Heinicke responded: be aware of the moment on which actions are executed. Regardless of where they are called within a request-chain, they are always executed _before_ the actual processing in a pipeline. This is only
RE: unpack/unizp a complete zip file?
Hi, It was a rather short and quick answer, but yes, depending on the component that extracts the files and writes them, it is in principle possible to extract all types of files. SourceWriting component however uses XML/DOM as intermediate, so that component is unuseable as it is. (At least how it was around versions 2.1.4 - 2.1.6..) The SaveFiles transformer however is exactly written for this task. It doesn't cache anything, it redirect an inputstream to an outputstream internally and is therefore capable of handling binary. Only the outcome (fail or success) is passed to cocoon as xml. More about it on wiki: http://wiki.apache.org/cocoon/SaveFilesTransformer My zipsource produces on long xml with the full contents. One xsl pass converts this to savefiles instruction sheet, just a long list of save:file elements with a src and a target attribute. These can be processed in a single pass with the transformer. The end result of this transform can be used to produce a fail/success report. One final note on Cocoon Actions, the alternative on which Joerg Heinicke responded: be aware of the moment on which actions are executed. Regardless of where they are called within a request-chain, they are always executed _before_ the actual processing in a pipeline. This is only important if you intend to process the files with the same request that also extracts the files. It might be very useful, but can be a bottle-neck just as easily. Kind regards, Geert -Original Message- From: HGENTO [mailto:[EMAIL PROTECTED] Sent: vrijdag 25 mei 2007 15:59 To: users@cocoon.apache.org Subject: Re: unpack/unizp a complete zip file? Thank you for your answer , but I'm a little bit confused, would this methode also work, if the zip file contains not only xml-files but also pictures. For example ein Open Document Writer file. I would like to have a methode where I can unpack the full odt files. Best regards, H. Geert Josten wrote: Hi, I extended the ZipSource component to accept zip-protocol patterns without the addition of special files. But the Source is supposed to produce content and you cannot produce the literal zip contents, so I chose to produce a dir-listing of the zip. I use that to generate new zip-url's that exhaustingly point to all files inside zip. Processing that list with a component like savefiles or writesource should result in extraction of a complete zip. HTH, Geert Drs. G.P.H. Josten Consultant Daidalos BV Source of Innovation Hoekeindsehof 1-4 2665 JZ Bleiswijk Tel.: +31 (0) 10 850 1200 Fax: +31 (0) 10 850 1199 www.daidalos.nl KvK 27164984 De informatie - verzonden in of met dit emailbericht - is afkomstig van Daidalos BV en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onbedoeld hebt ontvangen, verzoeken wij u het te verwijderen. Aan dit bericht kunnen geen rechten worden ontleend. From: HGENTO [mailto:[EMAIL PROTECTED] Sent: vrijdag 25 mei 2007 13:52 To: users@cocoon.apache.org Subject: unpack/unizp a complete zip file? Hi, how can I unzip a zip file with an sitemap instruction. I have access to a special file with zip:/file.zip!/file.xml but I would like to have an instruction to unzip the complete file.zip. Is there a easy way to do so in Cocoon 2.1.? I did't found a answer on wiki as well as apache cocoon homepage. Regards, Holger - 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]
RE: unpack/unizp a complete zip file?
Hi, I extended the ZipSource component to accept zip-protocol patterns without the addition of special files. But the Source is supposed to produce content and you cannot produce the literal zip contents, so I chose to produce a dir-listing of the zip. I use that to generate new zip-url's that exhaustingly point to all files inside zip. Processing that list with a component like savefiles or writesource should result in extraction of a complete zip. HTH, Geert Drs. G.P.H. Josten Consultant Daidalos BV Source of Innovation Hoekeindsehof 1-4 2665 JZ Bleiswijk Tel.: +31 (0) 10 850 1200 Fax: +31 (0) 10 850 1199 www.daidalos.nl KvK 27164984 De informatie - verzonden in of met dit emailbericht - is afkomstig van Daidalos BV en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onbedoeld hebt ontvangen, verzoeken wij u het te verwijderen. Aan dit bericht kunnen geen rechten worden ontleend. From: HGENTO [mailto:[EMAIL PROTECTED] Sent: vrijdag 25 mei 2007 13:52 To: users@cocoon.apache.org Subject: unpack/unizp a complete zip file? Hi, how can I unzip a zip file with an sitemap instruction. I have access to a special file with zip:/file.zip!/file.xml but I would like to have an instruction to unzip the complete file.zip. Is there a easy way to do so in Cocoon 2.1.? I did't found a answer on wiki as well as apache cocoon homepage. Regards, Holger - 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: Unique XSL transform error that only occurs with Cocoon and Java 1.5
After a closer look at this thread: My earlier reply should not apply to your case.. Have you tried: xsl:apply-templates select=@* / xsl:apply-templates select=node() / I have noticed strange behaviours before and ran into similar trouble with Cocoon recently. I recommend putting latest Xalan in the endorsed folder of your Cocoon/webserver environment and making sure no other versions of Xalan are in the classpath. Java 1.5 is shipped with a certain version of Xalan, of which I recall it not being the most stable version that has passed. I also noticed that Saxon.jar can cause conflicts, but only when multiple copies of the jar are loaded (e.g. one in web-inf/lib/ and one in lib/endorsed/ of jetty). Are there other XSL parser in your classpath? HTH, Geert Drs. G.P.H. Josten Consultant Daidalos BV Source of Innovation Hoekeindsehof 1-4 2665 JZ Bleiswijk Tel.: +31 (0) 10 850 1200 Fax: +31 (0) 10 850 1199 www.daidalos.nl KvK 27164984 De informatie - verzonden in of met dit emailbericht - is afkomstig van Daidalos BV en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onbedoeld hebt ontvangen, verzoeken wij u het te verwijderen. Aan dit bericht kunnen geen rechten worden ontleend. Van: footh [mailto:[EMAIL PROTECTED] Verzonden: donderdag 8 februari 2007 23:27 Aan: users@cocoon.apache.org Onderwerp: Re: Unique XSL transform error that only occurs with Cocoon and Java 1.5 I had done that and should've mentioned it on my first message. The part that causes the error is the line: xsl:apply-templates select=@*|node() / In particulary, the select piece. It doesn't like the bar(|). If I get rid if it and only have either @* or node() then I don't get the error. This is valid XSL, as I said, the error only occurs when transforming with Cocoon and Java 1.5. --- Bertrand Delacretaz [EMAIL PROTECTED] wrote: On 2/7/07, footh [EMAIL PROTECTED] wrote: ...Does anyone have any suggestions about where I would start looking to figure out what is going on?... If the exception gives no clue as to what's going wrong, I'd start commenting out parts of the transform to see exactly what causes it to fail. -Bertrand - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ __ Have a burning question? Go to www.Answers.yahoo.com and get answers from real people who know. - 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: Best practice (was: How can i acces to Class from a Class name?)
Is the Cocoon Bricks sample not still around somewhere? That was created for this very purpose and covered from database upto forms. Kind regards, Geert Drs. G.P.H. Josten Consultant Daidalos BV Source of Innovation Hoekeindsehof 1-4 2665 JZ Bleiswijk Tel.: +31 (0) 10 850 1200 Fax: +31 (0) 10 850 1199 www.daidalos.nl KvK 27164984 De informatie - verzonden in of met dit emailbericht - is afkomstig van Daidalos BV en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onbedoeld hebt ontvangen, verzoeken wij u het te verwijderen. Aan dit bericht kunnen geen rechten worden ontleend. Van: Tobia [mailto:[EMAIL PROTECTED] Verzonden: vrijdag 9 februari 2007 19:10 Aan: users@cocoon.apache.org Onderwerp: Best practice (was: How can i acces to Class from a Class name?) Leszek Gawron wrote: still I advise you not to put business logic into flowscript. Did that once for medium sized project 3 years ago - now I have to support it and regret my decision a lot. Is there a sample in cocoon 2.1 which separates the various aspects (business logic, presentation, persistence / data storage / legacy database access) the way you would, or otherwise is widely recognized as best practice? Tobia - 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: Unique XSL transform error that only occurs with Cocoon and Java 1.5
Can you give me the following 1) minimal XSL stylesheets 2) minimal XML example 3) relevant sitemap fragment 4) Java build number (java -version) And any other relevant information. Can't promiss, but I will try to take a look. It is always good to be aware of bugs or common mistakes in XSL parsers and Java/Cocoon setups.. Kind regards, Geert -Oorspronkelijk bericht- Van: footh [mailto:[EMAIL PROTECTED] Verzonden: vrijdag 9 februari 2007 19:28 Aan: users@cocoon.apache.org Onderwerp: RE: Unique XSL transform error that only occurs with Cocoon and Java 1.5 Geert, thanks for the replies. I tried all your recommended changes and nothing worked. I had xalan 2.7.0 in both the lib/endorsed dir of my web container (using Tomcat) and the lib directory of my web application. I tried various combinations (in one dir, not the other, etc.) and nothing worked - still the same transformer error. I also tried your stylesheet change and that had no effect. I still receive the same errors. The baffling thing is I ran this template through the xalan stylesheet command line utility under Java 1.5 and it transformed fine. Also, if I switch my web app environment to Java 1.4 it transforms fine. I have just run out of options to debug this thing. I have no idea where to start. Do you by any chance have a similar environment set up where you could test the template to see if you get the same error? Regards, JF --- Geert Josten [EMAIL PROTECTED] wrote: After a closer look at this thread: My earlier reply should not apply to your case.. Have you tried: xsl:apply-templates select=@* / xsl:apply-templates select=node() / I have noticed strange behaviours before and ran into similar trouble with Cocoon recently. I recommend putting latest Xalan in the endorsed folder of your Cocoon/webserver environment and making sure no other versions of Xalan are in the classpath. Java 1.5 is shipped with a certain version of Xalan, of which I recall it not being the most stable version that has passed. I also noticed that Saxon.jar can cause conflicts, but only when multiple copies of the jar are loaded (e.g. one in web-inf/lib/ and one in lib/endorsed/ of jetty). Are there other XSL parser in your classpath? HTH, Geert Drs. G.P.H. Josten Consultant Daidalos BV Source of Innovation Hoekeindsehof 1-4 2665 JZ Bleiswijk Tel.: +31 (0) 10 850 1200 Fax: +31 (0) 10 850 1199 www.daidalos.nl KvK 27164984 De informatie - verzonden in of met dit emailbericht - is afkomstig van Daidalos BV en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onbedoeld hebt ontvangen, verzoeken wij u het te verwijderen. Aan dit bericht kunnen geen rechten worden ontleend. Van: footh [mailto:[EMAIL PROTECTED] Verzonden: donderdag 8 februari 2007 23:27 Aan: users@cocoon.apache.org Onderwerp: Re: Unique XSL transform error that only occurs with Cocoon and Java 1.5 I had done that and should've mentioned it on my first message. The part that causes the error is the line: xsl:apply-templates select=@*|node() / In particulary, the select piece. It doesn't like the bar(|). If I get rid if it and only have either @* or node() then I don't get the error. This is valid XSL, as I said, the error only occurs when transforming with Cocoon and Java 1.5. --- Bertrand Delacretaz [EMAIL PROTECTED] wrote: On 2/7/07, footh [EMAIL PROTECTED] wrote: ...Does anyone have any suggestions about where I would start looking to figure out what is going on?... If the exception gives no clue as to what's going wrong, I'd start commenting out parts of the transform to see exactly what causes it to fail. -Bertrand - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ __ Have a burning question? Go to www.Answers.yahoo.com and get answers from real people who know. - 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] __ __ Finding fabulous fares is fun. Let Yahoo! FareChase search your favorite travel sites to find flight and hotel bargains. http
RE: Serialize to file?
I typically use the following, though there are other solutions possible: map:match pattern=download-*-zip map:generate src=cocoon:/generate-{1}-zip/ map:act type=set-header map:parameter name=Content-Type value=application/x-download/ map:parameter name=Content-Disposition value=attachment ; filename={1}.zip/ map:serialize type=zip/ /map:act /map:match Other serializers are possible ofcourse.. :-) HTH, Geert Drs. G.P.H. Josten Consultant Daidalos BV Source of Innovation Hoekeindsehof 1-4 2665 JZ Bleiswijk Tel.: +31 (0) 10 850 1200 Fax: +31 (0) 10 850 1199 www.daidalos.nl KvK 27164984 De informatie - verzonden in of met dit emailbericht - is afkomstig van Daidalos BV en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onbedoeld hebt ontvangen, verzoeken wij u het te verwijderen. Aan dit bericht kunnen geen rechten worden ontleend. Van: Gary Larsen [mailto:[EMAIL PROTECTED] Verzonden: vrijdag 9 februari 2007 17:02 Aan: users@cocoon.apache.org Onderwerp: RE: Serialize to file? Hi Jeroen, Thanks for your advice and pointers. I'll give these a try. Gary You could try to set the content-type of the serializer to a type which is not recognized by the browser. For instance: application/x-download or application/x-unknown Next to that you can use an sitemap action or something equivalent to send an header to the browser: (Content-Disposition, attachment; filename=myfile.extension) - 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: Unique XSL transform error that only occurs with Cocoon and Java 1.5
The expression is not necessarily correct actually, but that depends on context and content.. :-) For instance: xsl:copy newelem / xsl:apply-templates select=@* / /xsl:copy is not valid, but is likely to cause only errors when the current element has attributes.. Kind regards, Geert Drs. G.P.H. Josten Consultant Daidalos BV Source of Innovation Hoekeindsehof 1-4 2665 JZ Bleiswijk Tel.: +31 (0) 10 850 1200 Fax: +31 (0) 10 850 1199 www.daidalos.nl KvK 27164984 De informatie - verzonden in of met dit emailbericht - is afkomstig van Daidalos BV en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onbedoeld hebt ontvangen, verzoeken wij u het te verwijderen. Aan dit bericht kunnen geen rechten worden ontleend. Van: footh [mailto:[EMAIL PROTECTED] Verzonden: donderdag 8 februari 2007 23:27 Aan: users@cocoon.apache.org Onderwerp: Re: Unique XSL transform error that only occurs with Cocoon and Java 1.5 I had done that and should've mentioned it on my first message. The part that causes the error is the line: xsl:apply-templates select=@*|node() / In particulary, the select piece. It doesn't like the bar(|). If I get rid if it and only have either @* or node() then I don't get the error. This is valid XSL, as I said, the error only occurs when transforming with Cocoon and Java 1.5. --- Bertrand Delacretaz [EMAIL PROTECTED] wrote: On 2/7/07, footh [EMAIL PROTECTED] wrote: ...Does anyone have any suggestions about where I would start looking to figure out what is going on?... If the exception gives no clue as to what's going wrong, I'd start commenting out parts of the transform to see exactly what causes it to fail. -Bertrand - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ __ Have a burning question? Go to www.Answers.yahoo.com and get answers from real people who know. - 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: Regarding PDF file open in browser.
Hi, If you are looking for integration of a binary source into Cocoon, you might be interested in doing it as follows: - define a pseudo protocol in cocoon.xconf - write a SourceFactory that can take care of if. You could call your protocol pdf:// or perhaps something more generic, more related to the way you get access to you binary stream - use default reader to deliver the pdf to any browser, using the pseudo protocol. You might find it difficult to influence download behaviour, though. Search this list for more on that if you are interested. On the other hand, if you have a non-pdf source and are generating it to PDF and want to integrate that process more naturally into Cocoon, you could write a serializer, but that assumes the PDF is generated out of XML. Note that there are XSL-FO 2 PDF serializers available. Kind regards, Geert Drs. G.P.H. Josten Consultant Daidalos BV Source of Innovation Hoekeindsehof 1-4 2665 JZ Bleiswijk Tel.: +31 (0) 10 850 1200 Fax: +31 (0) 10 850 1199 www.daidalos.nl KvK 27164984 De informatie - verzonden in of met dit emailbericht - is afkomstig van Daidalos BV en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onbedoeld hebt ontvangen, verzoeken wij u het te verwijderen. Aan dit bericht kunnen geen rechten worden ontleend. Van: Renga, Subburaman [mailto:[EMAIL PROTECTED] Verzonden: dinsdag 7 november 2006 7:30 Aan: [EMAIL PROTECTED] CC: users@cocoon.apache.org Onderwerp: Regarding PDF file open in browser. Hi, I want to display a pdf on the browser. I have byte stream with me, using which I need to display the pdf directly on the browser. Currently, I am storing it in my local file system by creating a file output stream. But its taking a lot of time. I don't want to create any intermediate files. Is it possible to display the PDF directly on the browser? If anyone knows please let me know how this can be achieved in java? Thanks Regards, Renganathan.S. P A T N I *: X: 2133, 34, M: 9833064984 *: [EMAIL PROTECTED] http://www.patni.com/ http://www.patni.com/ --- -- -- -- Disclaimer: This e-mail message along with attachment, contain Patni GE Confidential, proprietary legally privileged information for the sole use of the person or entity to whom this message was originally addressed. Any review, e-transmission dissemination or other use of or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. If you have received this e-mail in error kindly delete this e-mail from your records. If it appears that this mail has been forwarded to you without proper authority, please notify the sender and delete this mail. This email (in whole or in part) is not to be reproduced or furnished to third parties or made public without the prior express written permission of the sender. -- -- -- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Any experience with SOAP Server WITHOUT Axis ?
Hi, A while back I wanted to use Cocoon as a SOAP server myself and found it not that difficult. I used the stream generator to get access to the SOAP envelop, processed it with XSL, transforming it to an 'internal' request with request-parameters and/or XML fragments, used cinclude to execute that internal request, wrapped that into a response envelop with XSL and submitted that as result. Worked okay for me. Though, you might find that the Flow approach mentioned below gives you more power over handling of request headers and such. Kind regards, Geert Drs. G.P.H. Josten Consultant Daidalos BV Source of Innovation Hoekeindsehof 1-4 2665 JZ Bleiswijk Tel.: +31 (0) 10 850 1200 Fax: +31 (0) 10 850 1199 www.daidalos.nl KvK 27164984 De informatie - verzonden in of met dit emailbericht - is afkomstig van Daidalos BV en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onbedoeld hebt ontvangen, verzoeken wij u het te verwijderen. Aan dit bericht kunnen geen rechten worden ontleend. Van: Andreas Kuehne [mailto:[EMAIL PROTECTED] Verzonden: woensdag 1 november 2006 10:41 Aan: [EMAIL PROTECTED]; users@cocoon.apache.org Onderwerp: Re: Any experience with SOAP Server WITHOUT Axis ? Hi Jan, thanks for the intersting link ! Don't know how I missed this ... In meantime I went for the trivial approach like Yves outlined. Works fine for me. But I'll check the more sophisticated stuff described in the Wiki to nsee what I did miss ;-) maybe this wikipage has some information for you: http://wiki.apache.org/cocoon/WebServiceServer On Tuesday 10 October 2006 13:37, Yves Zoundi wrote: I think you can generate a soap response for a requested url?? Not tested though. map:match pattern = getResponse map:generate type = getRecords/ map:transform src = xmltosoap.xsl/ map:serialize type = xml/ /map:match -Original Message- From: Andreas Kuehne [EMAIL PROTECTED] To: [EMAIL PROTECTED], users@cocoon.apache.org Date: Tue, 10 Oct 2006 12:41:46 +0200 Subject: Re: Any experience with SOAP Server WITHOUT Axis ? Hi Thomas, what about xfire http://xfire.codehaus.org E.g., it can be used in conjunction with xmlbeans. sounds intersting ! But as I'm a lazy guy, I don't want to go for a Java model. I woulddream of using my already-made-and-tested pipelines enabled with a SOAPfrontend ... ___ Andreas Kühne phone: +49 177 293 24 97 mailto: [EMAIL PROTECTED] Trustable Kirchröder Str. 70e 30625 Hannover Germany www.trustable.de Kostenlose Verifikation qualifizierter elektronischer Signaturen: www.sig-check.de - 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: error: Too Many Open Files
I've heard of a java bug that caused this message. What Java version are you using and what happens if you upgrade to the latest? (if possible) Kind regards, Geert Drs. G.P.H. Josten Consultant Daidalos BV Source of Innovation Hoekeindsehof 1-4 2665 JZ Bleiswijk Tel.: +31 (0) 10 850 1200 Fax: +31 (0) 10 850 1199 www.daidalos.nl KvK 27164984 De informatie - verzonden in of met dit emailbericht - is afkomstig van Daidalos BV en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onbedoeld hebt ontvangen, verzoeken wij u het te verwijderen. Aan dit bericht kunnen geen rechten worden ontleend. Van: Bokluci [mailto:[EMAIL PROTECTED] Verzonden: maandag 6 november 2006 23:19 Aan: users@cocoon.apache.org Onderwerp: error: Too Many Open Files From Time to time cocoon shows Too many open files error. I've already set ulimit to ulimit -n 8192 , but it still shows from time to time this error... Any suggestions? Thanks in advance. Vik - 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: HTML Generator/proxy using POST method
Hi Tal, You can use the cinclude transformer with elaborate syntax to perform more complex HTTP requests. cinclude:includexml cinclude:src {url you want to access} /cinclude:src cinclude:configuration cinclude:parameter cinclude:namemethod/cinclude:name cinclude:valuePOST/cinclude:value /cinclude:parameter /cinclude:configuration cinclude:parameters cinclude:parameter cinclude:name {name} /cinclude:name cinclude:value {value or XML fragment} /cinclude:value /cinclude:parameter /cinclude:parameters /cinclude:includexml But this DOES require that the url results XML not HTML. Kind regards, Geert Drs. G.P.H. Josten Consultant Daidalos BV Source of Innovation Hoekeindsehof 1-4 2665 JZ Bleiswijk Tel.: +31 (0) 10 850 1200 Fax: +31 (0) 10 850 1199 www.daidalos.nl KvK 27164984 De informatie - verzonden in of met dit emailbericht - is afkomstig van Daidalos BV en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onbedoeld hebt ontvangen, verzoeken wij u het te verwijderen. Aan dit bericht kunnen geen rechten worden ontleend. Van: Kaj Kandler [mailto:[EMAIL PROTECTED] Verzonden: vrijdag 27 oktober 2006 15:01 Aan: users@cocoon.apache.org Onderwerp: Re: HTML Generator/proxy using POST method -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi Tal, you should be able to use {request-param:your parameter} map:generate type=html src=http://localhost/tr/{1}{2}?{request-param:first}{request -param:second}... Ko Tal Shalif wrote: How do I generate (in a sitemap.xmap pipeline) HTML from a remote HTTP server passing through the client browser's form parameters using the POST method? What I would like to achieve is embed a foreign site (e.g. a PHP based trouble ticket system running on Apache server) inside a Forrest/cocoon site (please see diagram below). I provide the generator with the client form data via the query string: map:generate type=html src=http://localhost/tr/{1}{2}?{request:queryString}; But what do I do if the client is sending form data using the POST method? +---+ | remote:80 | (remote http) +---+ || || \/ +---+ | site skinning with forrest/cocoon | (cocoon/forrest) +---+ || || \/ +--+ | User view HTML page and/or submits back | (client browser) | its form data using the POST method | +--+ ||/\ || || \/ || +--+ | Cocoon passes the request || | to remote server also using | Site skinning with | (cocoon/forrest) | the POST method | Cocoon/forres | +--+ || /\ |||| \/|| +-+ | remote HTTP server:80 | (remote http) +-+ - -- [EMAIL PROTECTED] http://conficio.blogspot.com/ | We teach software one screencast at a time | http://www.conficio.com/ Tel: +1 (781) 632 5773 - Fax: +1 (781) 207 9159 Conficio P.O.Box 761062, Melrose, MA 02176 -BEGIN PGP SIGNATURE- Version: GnuPG v1.2.5 (MingW32) iD8DBQFFQgMlRDUvrJRNjTARAvhuAJ9KkeHD8f9BbaoHX2v6OMKP8QXKyACfZGbW EIF2BkY4cuspURx1sspI67M= =TNBl -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: How to call 1+ XSPs in a single pipeline?
You could: - use aggregation - use cinclude/xinclude - use Flowscript (using cocoon.processPipelineTo to call additional pipelines before the sendPage) And perhaps even more.. Kind regards, Geert Drs. G.P.H. Josten Consultant Daidalos BV Source of Innovation Hoekeindsehof 1-4 2665 JZ Bleiswijk Tel.: +31 (0) 10 850 1200 Fax: +31 (0) 10 850 1199 www.daidalos.nl KvK 27164984 De informatie - verzonden in of met dit emailbericht - is afkomstig van Daidalos BV en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onbedoeld hebt ontvangen, verzoeken wij u het te verwijderen. Aan dit bericht kunnen geen rechten worden ontleend. Van: Paritosh Patel [mailto:[EMAIL PROTECTED] Verzonden: woensdag 25 oktober 2006 18:32 Aan: users@cocoon.apache.org Onderwerp: How to call 1+ XSPs in a single pipeline? I have modularized my XSP functionality to the point that I need to run 2 XSPs to complete an http request, other times I need to use only 1 of the XSPs. Is this possible? (Can I have two pipelines each with an XSP generator and one pipeline redirecting to the other? The first pipeline does not generate data since it saves some data in SQL DB. The 2nd XSP reads SQL DB and also generates browser markup.) - PDP - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Build problems: 2.1.9 under Windows XP
Hi Wapiez, I unpacked and compiled out of the box with no problem. (Cocoon 2.1.9, JDK1.5 and WinXP) Did you compile out of the box as well? The message you are getting means that a certain lib file is not found in the CLASSPATH. I see in my distribution that there should be a jing-20030619.jar in tools/lib/ that contains the missing class. Check if it is present. If so, try placing a copy in the lib/endorsed folder of the distro or if that doesn't help either, in the lib or lib/endorsed of your java engine. Kind regards, Geert Drs. G.P.H. Josten Consultant Daidalos BV Source of Innovation Hoekeindsehof 1-4 2665 JZ Bleiswijk Tel.: +31 (0) 10 850 1200 Fax: +31 (0) 10 850 1199 www.daidalos.nl KvK 27164984 De informatie - verzonden in of met dit emailbericht - is afkomstig van Daidalos BV en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onbedoeld hebt ontvangen, verzoeken wij u het te verwijderen. Aan dit bericht kunnen geen rechten worden ontleend. Van: Wendell Piez [mailto:[EMAIL PROTECTED] Verzonden: zaterdag 21 oktober 2006 1:03 Aan: users@cocoon.apache.org Onderwerp: Build problems: 2.1.9 under Windows XP Hi, Could someone give me a tip on building 2.1.9 under Windows? XP, JDK 1.5. I'm getting what appears to be an Ant configuration error: C:\Bin\cocoon-2.1.9-src\cocoon-2.1.9build Buildfile: build.xml BUILD FAILED C:\Bin\cocoon-2.1.9-src\cocoon-2.1.9\tools\targets\init-build. xml:165: taskdef c lass com.thaiopensource.relaxng.util.JingTask cannot be found I'm not a Java developer, so it's beyond me to try to debug this. (And the docs told me I wouldn't have to!) Google shows me only stuff relating to a problem like this, but only back in 2003. Thanks for any help -- if this is dumb stuff, please feel free to respond off-list. (I'm setting up a new system and upgrading from 2.0.7 ... is that a bad idea?) Cheers, Wendell == Wendell Piezmailto:[EMAIL PROTECTED] Mulberry Technologies, Inc.http://www.mulberrytech.com 17 West Jefferson StreetDirect Phone: 301/315-9635 Suite 207 Phone: 301/315-9631 Rockville, MD 20850 Fax: 301/315-8285 -- Mulberry Technologies: A Consultancy Specializing in SGML and XML == - 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: flowscript caching and evaluation question
iiuc, i can configure it to check the flowscript for modification each time (at a performance penalty). but how does cocoon determine modification? if it only looks at the file timestamp, i still have problems, because i have the parameterised cocoon.load call in there - which means that the cache is only valid if the flowscript *and* all cocoon.load()ed resources are unchanged. Yes, setting reload to true makes Cocoon check file stamp, though with a delay of xxx milliseconds if you specify a number (one of the other parameters). Dynamically loading code might not work as expected, though if you put the cocoon.load() *inside* a function, it might work afterall. are there docs on cocoon.load()? Really dunno. Ask on cocoon-dev or try reading the code.. :-P I also know that there is something special about continuations. It's a weird situation if you request a continuation, but your script has been changed in the meantime. I believe continuations are invalidated for that reason if something like that occurs. eek. looks like i have to ditch my current approach with cocoon.load() and use dynamically generated function objects then. Not sure, but make sure to test thoroughly! :-) Kind regards, Geert Drs. G.P.H. Josten Consultant Daidalos BV Source of Innovation Hoekeindsehof 1-4 2665 JZ Bleiswijk Tel.: +31 (0) 10 850 1200 Fax: +31 (0) 10 850 1199 www.daidalos.nl KvK 27164984 De informatie - verzonden in of met dit emailbericht - is afkomstig van Daidalos BV en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onbedoeld hebt ontvangen, verzoeken wij u het te verwijderen. Aan dit bericht kunnen geen rechten worden ontleend. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: flowscript caching and evaluation question
Hi Jörn, I do not really know that much about FlowScript, but I have been wondering about caching and reloading of flowscripts as well. I do know that there is an entry in cocoon.xconf to configer the js interpreter, look for 'flow-interpreter' and you'll find. I also know that there is something special about continuations. It's a weird situation if you request a continuation, but your script has been changed in the meantime. I believe continuations are invalidated for that reason if something like that occurs. Kind regards, Geert Drs. G.P.H. Josten Consultant Daidalos BV Source of Innovation Hoekeindsehof 1-4 2665 JZ Bleiswijk Tel.: +31 (0) 10 850 1200 Fax: +31 (0) 10 850 1199 www.daidalos.nl KvK 27164984 De informatie - verzonden in of met dit emailbericht - is afkomstig van Daidalos BV en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onbedoeld hebt ontvangen, verzoeken wij u het te verwijderen. Aan dit bericht kunnen geen rechten worden ontleend. Van: Jörn Nettingsmeier [mailto:[EMAIL PROTECTED] Verzonden: donderdag 19 oktober 2006 10:06 Aan: users@cocoon.apache.org Onderwerp: flowscript caching and evaluation question hi ! the lenya cms provides a usecase framework with a generic flowscript that allows users to create their own usecases and views easily without touching javascript *if* their flow needs are very simple. to allow for more flexibility, i would like to add a way for users to add their own flow code to their usecases. it is supposed to work like this: the generic usecase handler checks if the user provided a custom flowscript uri with the usecase configuration (usecases are Configurable avalon components), which implements the functions customLoopFlow and customSubmitFlow the former is used while the usecase is looping, i.e. not yet submitted or cancelled, and the latter is invoked when user finally submits or cancels. it then uses cocoon.load(customUri) to load the custom code. the question is: will the flowscript always be re-evaluated? the sitemap just says map:flow src=genericUsecaseHandler.js/, so cocoon might well think it can cache and/or even precompile the flowscript once and re-use it. (my tests suggest that this is indeed the case.) the reason i'm using cocoon.load rather than parsing the customUri file myself and create the custom functions with new Function() {} (which would be guaranteed to be re-evaluated each time) is that those on-the-fly function objects are a nightmare to debug because you do not get line numbers in case of an error. how can i solve this? any hints or pointers to flowscript caching/compiling/evaluation docs (even code) are appreciated. regards, jörn -- Jörn Nettingsmeier Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law. - Douglas R. Hofstadter - 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: inner functions and continuations...
I am not sure, but I somehow recall that the execution thread is not literally saved, but that the variables in the context are saved and restored and that the function is re-executed, but with a special flag that makes it jump to the position where the previous request left off.. So I think saving the function in a (local) variable is sensible. Kind regards, Geert Drs. G.P.H. Josten Consultant Daidalos BV Source of Innovation Hoekeindsehof 1-4 2665 JZ Bleiswijk Tel.: +31 (0) 10 850 1200 Fax: +31 (0) 10 850 1199 www.daidalos.nl KvK 27164984 De informatie - verzonden in of met dit emailbericht - is afkomstig van Daidalos BV en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onbedoeld hebt ontvangen, verzoeken wij u het te verwijderen. Aan dit bericht kunnen geen rechten worden ontleend. Van: Jörn Nettingsmeier [mailto:[EMAIL PROTECTED] Verzonden: zaterdag 14 oktober 2006 15:22 Aan: users@cocoon.apache.org Onderwerp: inner functions and continuations... hi everyone! i'm trying to add local functions to a flowscript in order to make it more maintainable. the code looks like this: function executeUsecase() { var someLocalVar; function foo() { ... } foo(); sendPageAndWait(/some/pipeline); foo(); } the second call to foo results in an error (foo is undefined). so it appears that those functions are not stored with the continuation. is this expected behaviour? so i changed the function declaration to var foo = function() { ... } it seems to work - the function is still available after the continuation. is this the correct approach? for the record, i'm using cocoon 2.1 (svn HEAD) with sun java 1.5 on linux/x86_64. regards, jörn - 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: Loading a configuration file from a jar
I think you should be looking in the direction of: import java.util.Locale; import java.util.MissingResourceException; import java.util.ResourceBundle; ... Locale locale = Locale.getDefault(); try { resources = ResourceBundle.getBundle( my.package.MyProperties, locale); } catch (MissingResourceException e) { ... } you need to put a file MyProperties.properties in a folder my/packages/ inside any jar that you put into WEB-INF/lib/. Kind regards, Geert Drs. G.P.H. Josten Consultant Daidalos BV Source of Innovation Hoekeindsehof 1-4 2665 JZ Bleiswijk Tel.: +31 (0) 10 850 1200 Fax: +31 (0) 10 850 1199 www.daidalos.nl KvK 27164984 De informatie - verzonden in of met dit emailbericht - is afkomstig van Daidalos BV en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onbedoeld hebt ontvangen, verzoeken wij u het te verwijderen. Aan dit bericht kunnen geen rechten worden ontleend. Van: Omar Adobati [mailto:[EMAIL PROTECTED] Verzonden: donderdag 19 oktober 2006 15:44 Aan: users@cocoon.apache.org Onderwerp: Loading a configuration file from a jar Good Morning, I have developed a jar file and I need to load some configuration parameters from a .properties file placed outside of the jar itself. The jar file is under $cocoon/WEB-INF/lib directory and the .properties file too. Now, the problem is that my own class (that extends the java.util.Properties class) can't locate the properties file. Here is the code I'm actually using: public ConfigUtility(){ super(); File configFile = new File(/nptl.im.properties); try{ configURL = configFile.toURL(); }catch (Exception ex){ ex.printStackTrace(); } //do some other useful stuff } I'm running cocoon 2.1.18 with tomcat 5.5.x and JDK 1.5 Thanks for your help :) -- Omar Adobati - 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: FileUploadManager
What I need to add is to: protect the upload form with auth-manager; add some session logic to figure out where the file goes; display the page first -- ask if it's OK to publish if OK, move to where it belongs and display again, giving the final published URL for doc. I think continuations can help you here. I recall suggesting using sendPageAndWait, which basically means using continuations. I'll try give some more details on how to implement this. What you need is a confirmation form. Or perhaps adding a confirm button below the preview of the document would suffice. Lets call the match you use for that 'confirm-xml-upload' (might be your 'xml-upload-doc' match). I'll leave the implementation of that match to you. Next to this you will need to be able to reenter your flow function once the user has confirmed or declined the upload. For this you can add a match with for instance this pattern 'xml-upload-continue/*': map:match pattern=xml-upload-continue/* map:call continuation={1} / /map:match The {1} is a so-called continuation-id. Make sure to retrieve it from the context when generating the confirmation page and append it to the action of the form (or the confirm/decline url). I imagine that the actual confirmation is a parameter named 'confirmed' having the value 'true' or 'false'. You can pick something of your own taste if you like, just using this to explain the last part: flowscript changes.. You need to extend your upload function. Change the cocoon.sendPage line into cocoon.sendPageAndWait('confirm-xml-upload', {}); Once the user enters the xml-upload-continue/* match, this function is reactivated and continued at the sendPageAndWait position, using the continuation id! (I am still amazed that the Cocoon developers made this work :) Yes, there can be lots of continuations running simultaniously, so the continuation-id is very important. Once execution has been continued, you have access to the second request object, which should contain the confirmation parameter. Read it and decide to delete the upload or move it to a permanent location. Your function would become something like: function upload() { var docsrc = cocoon.request.getParameter( pubxml); // make a copy of uploaded file to tmp ... if ( FileHelper.fileExists( docsrc ) ) { var doc = java.io.File( docsrc ); FileHelper.copy( doc, java.io.File ( cocoon.parameters.temp_dir, doc.getName() )); } cocoon.sendPageAndWait( 'confirm-xml-upload' , {} ); var confirmed = (cocoon.request.getParameter(confirmed) == true); if (confirmed) // move the uploaded file to perminant location ... FileHelper.copy( java.io.File ( cocoon.parameters.temp_dir, doc.getName() ), java.io.File ( cocoon.parameters.uploads_dir, doc.getName() ) ); cocoon.sendPage( 'show-doc' , {} ); } else { FileHelper.delete( java.io.File ( cocoon.parameters.temp_dir, doc.getName() ) }; cocoon.sendPage ( 'upload-cancelled', {} ); } } Few additional recommendations: - About authentication: you could reroute the initial upload request through a flow function that will either show an 'authorization denied' message if not cleared or the upload form if cleared. But make sure to recheck the authorization at the actual upload! - About pipelines: it is not necessary to put each match in a different pipeline. :-) Usually you put cachable and noncachable matches together, but keep in mind that they are tested against the url's from top to bottom and the first match is executed. - I would recommend to base your xml-upload-xml and xml-upload-doc matches on the temp dir, not on upload protocol. That makes them accessible after a continue as well. :-) - You can define global variable in a sitemap and refer to them like {global:nameofvar}. Shouldn't be difficult to found out about how to define them on the cocoon website. Kind regards, Geert - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: RE: RE: RE: Cannot get JSPReader/JSPGenerator to work
The JSP engine is Jasper. Switching this to the Tomcat version is the next step. I will keep you posted (if you want). If you are running Cocoon within Tomcat, you are already using Jasper that is shipped with Tomcat. That is the JSP blocks default.. Grtz, Geert PS: yes, keep us informed, you never know who might benefit of the information. Drs. G.P.H. Josten Consultant Daidalos BV Source of Innovation Hoekeindsehof 1-4 2665 JZ Bleiswijk Tel.: +31 (0) 10 850 1200 Fax: +31 (0) 10 850 1199 www.daidalos.nl KvK 27164984 De informatie - verzonden in of met dit emailbericht - is afkomstig van Daidalos BV en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onbedoeld hebt ontvangen, verzoeken wij u het te verwijderen. Aan dit bericht kunnen geen rechten worden ontleend. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: RE: RE: Cannot get JSPReader/JSPGenerator to work
I just did.. :-) I did the following: - build cocoon 2.1.9 with standalone-demo flag (just to show how I am running cocoon) - copy the following libraries from tomcat5/common/lib to build/webapp/web-inf/lib: . ant.jar . jaspar-compiler.jar . jasper-runtime.jar . servlet-api.jar - run: cocoon.bat servlet - go to http://localhost:/samples/blocks/jsp/welcome.htm To return to your original questions: However, this is using Jetty instead of Tomcat to run Cocoon. When running cocoon inside tomcat, these libraries should already be available and do not need to be copied. Anyhow, it isn't unreasonable to use Jasper as JSP engine. It works well within cocoon/jetty. I still can imagine that Tomcat as servlet framework is interfering with Cocoon in your case. I try to find some time to look into it. Have you looked at stdout and stderr logging of tomcat? See tomcat5/logs/.. Kind regards, Geert Drs. G.P.H. Josten Consultant Daidalos BV Source of Innovation Hoekeindsehof 1-4 2665 JZ Bleiswijk Tel.: +31 (0) 10 850 1200 Fax: +31 (0) 10 850 1199 www.daidalos.nl KvK 27164984 De informatie - verzonden in of met dit emailbericht - is afkomstig van Daidalos BV en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onbedoeld hebt ontvangen, verzoeken wij u het te verwijderen. Aan dit bericht kunnen geen rechten worden ontleend. Van: Paritosh Patel [mailto:[EMAIL PROTECTED] Verzonden: donderdag 5 oktober 2006 15:03 Aan: users@cocoon.apache.org Onderwerp: Re: RE: RE: Cannot get JSPReader/JSPGenerator to work I am using the JSPReader/JSPGenerator that comes with Cocoon 2.1.9. I guess, the first question is: has anyone got the Welcome JSP to work? Its in the Samples (JSP Block). - pdp - 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: RE: RE: Cannot get JSPReader/JSPGenerator to work
Yuck! I am getting the following error in Tomcat. Anyone seen this before? org.apache.jasper.JasperException: Unable to compile class for JSP Generated servlet error: [javac] javac: invalid flag: Files\Apache [javac] Usage: javac options source files Kind regards, Geert -Oorspronkelijk bericht- Van: Geert Josten [mailto:[EMAIL PROTECTED] Verzonden: donderdag 5 oktober 2006 17:30 Aan: users@cocoon.apache.org Onderwerp: RE: RE: RE: Cannot get JSPReader/JSPGenerator to work I just did.. :-) I did the following: - build cocoon 2.1.9 with standalone-demo flag (just to show how I am running cocoon) - copy the following libraries from tomcat5/common/lib to build/webapp/web-inf/lib: . ant.jar . jaspar-compiler.jar . jasper-runtime.jar . servlet-api.jar - run: cocoon.bat servlet - go to http://localhost:/samples/blocks/jsp/welcome.htm To return to your original questions: However, this is using Jetty instead of Tomcat to run Cocoon. When running cocoon inside tomcat, these libraries should already be available and do not need to be copied. Anyhow, it isn't unreasonable to use Jasper as JSP engine. It works well within cocoon/jetty. I still can imagine that Tomcat as servlet framework is interfering with Cocoon in your case. I try to find some time to look into it. Have you looked at stdout and stderr logging of tomcat? See tomcat5/logs/.. Kind regards, Geert Drs. G.P.H. Josten Consultant Daidalos BV Source of Innovation Hoekeindsehof 1-4 2665 JZ Bleiswijk Tel.: +31 (0) 10 850 1200 Fax: +31 (0) 10 850 1199 www.daidalos.nl KvK 27164984 De informatie - verzonden in of met dit emailbericht - is afkomstig van Daidalos BV en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onbedoeld hebt ontvangen, verzoeken wij u het te verwijderen. Aan dit bericht kunnen geen rechten worden ontleend. Van: Paritosh Patel [mailto:[EMAIL PROTECTED] Verzonden: donderdag 5 oktober 2006 15:03 Aan: users@cocoon.apache.org Onderwerp: Re: RE: RE: Cannot get JSPReader/JSPGenerator to work I am using the JSPReader/JSPGenerator that comes with Cocoon 2.1.9. I guess, the first question is: has anyone got the Welcome JSP to work? Its in the Samples (JSP Block). - pdp - 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]
RE: RE: RE: Cannot get JSPReader/JSPGenerator to work
More news on this matter: When running in Tomcat context and you have trouble getting the JSP's to work, you can let Tomcat take care of it, though this will have limitations as Cocoon is simply being bypassed. Remove the servlet-mapping for *.jsp from Cocoons web.xml to enable this. The implications are: - url MUST end with *.jsp - url MUST translate to physical path - You cannot use pseudo-protocols of Cocoon to access other resources - Access to Cocoon from within the servlet page is either through Java environment (at least, I believe it is possible), or through the HTTP stack by making a new HTTP request. Perhaps someone with a debugging environment for Cocoon (in Tomcat) could trace where exactly things go wrong. The ant system, which tries to compile the JSP chokes on spaces in paths. Perhaps the problem lies in the ant library, that would make is more difficult to solve. This does makes me wonder if installing tomcat in a path with no spaces would get things working. Might be worth investigating.. ;-) Kind regards, Geert -Oorspronkelijk bericht- Van: Geert Josten [mailto:[EMAIL PROTECTED] Verzonden: donderdag 5 oktober 2006 17:36 Aan: users@cocoon.apache.org Onderwerp: RE: RE: RE: Cannot get JSPReader/JSPGenerator to work Yuck! I am getting the following error in Tomcat. Anyone seen this before? org.apache.jasper.JasperException: Unable to compile class for JSP Generated servlet error: [javac] javac: invalid flag: Files\Apache [javac] Usage: javac options source files Kind regards, Geert -Oorspronkelijk bericht- Van: Geert Josten [mailto:[EMAIL PROTECTED] Verzonden: donderdag 5 oktober 2006 17:30 Aan: users@cocoon.apache.org Onderwerp: RE: RE: RE: Cannot get JSPReader/JSPGenerator to work I just did.. :-) I did the following: - build cocoon 2.1.9 with standalone-demo flag (just to show how I am running cocoon) - copy the following libraries from tomcat5/common/lib to build/webapp/web-inf/lib: . ant.jar . jaspar-compiler.jar . jasper-runtime.jar . servlet-api.jar - run: cocoon.bat servlet - go to http://localhost:/samples/blocks/jsp/welcome.htm To return to your original questions: However, this is using Jetty instead of Tomcat to run Cocoon. When running cocoon inside tomcat, these libraries should already be available and do not need to be copied. Anyhow, it isn't unreasonable to use Jasper as JSP engine. It works well within cocoon/jetty. I still can imagine that Tomcat as servlet framework is interfering with Cocoon in your case. I try to find some time to look into it. Have you looked at stdout and stderr logging of tomcat? See tomcat5/logs/.. Kind regards, Geert Drs. G.P.H. Josten Consultant Daidalos BV Source of Innovation Hoekeindsehof 1-4 2665 JZ Bleiswijk Tel.: +31 (0) 10 850 1200 Fax: +31 (0) 10 850 1199 www.daidalos.nl KvK 27164984 De informatie - verzonden in of met dit emailbericht - is afkomstig van Daidalos BV en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onbedoeld hebt ontvangen, verzoeken wij u het te verwijderen. Aan dit bericht kunnen geen rechten worden ontleend. Van: Paritosh Patel [mailto:[EMAIL PROTECTED] Verzonden: donderdag 5 oktober 2006 15:03 Aan: users@cocoon.apache.org Onderwerp: Re: RE: RE: Cannot get JSPReader/JSPGenerator to work I am using the JSPReader/JSPGenerator that comes with Cocoon 2.1.9. I guess, the first question is: has anyone got the Welcome JSP to work? Its in the Samples (JSP Block). - pdp - 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]
RE: Problem with custom StreamGenerator
Hi, The original StreamGenerator makes a difference between form-data like and text/xml like content-types. The first scans for parameters, the second provides access to the request body. So, yes, content-type is highly relevant here. If you are submitting XML with a HTML form, you can access it with the streamgenerator by passing a parameter to the generator that tells the generator which parameter is should 'stream'. Typically you have a (multiline) text field on your form with a name like myxml or mytext. To stream that, configure your streamgenerator as follows: map:generate type=stream/ map:parameter name=form-name value=myxml / /map:generate Note: the requestgenerator is capable of parsing xml containing parameters as well (as long as they are marked with xml:), though you probably don't need all the extra information.. :-P Kind regards, Geert Drs. G.P.H. Josten Consultant Daidalos BV Source of Innovation Hoekeindsehof 1-4 2665 JZ Bleiswijk Tel.: +31 (0) 10 850 1200 Fax: +31 (0) 10 850 1199 www.daidalos.nl KvK 27164984 De informatie - verzonden in of met dit emailbericht - is afkomstig van Daidalos BV en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onbedoeld hebt ontvangen, verzoeken wij u het te verwijderen. Aan dit bericht kunnen geen rechten worden ontleend. Van: Fawzib Rojas [mailto:[EMAIL PROTECTED] Verzonden: dinsdag 3 oktober 2006 15:56 Aan: users@cocoon.apache.org Onderwerp: Problem with custom StreamGenerator I have a custom StreamGenerator and it is giving me some problems. I have used it with a custom application I've made and it works. I send a POST with my information and I can use the posted info in my custom generator. My problem is that when I use an actual FORM with a post message it fails. This is the HTTP message from my app: POST /servers HTTP/1.0 Connection: keep-alive Content-Type: text/xml Content-Length: 99 Host: 192.168.10.125 Accept: text/html, */* Accept-Encoding: identity User-Agent: Mozilla/3.0 (compatible; Indy Library) post_data_removed This is what Firefox sends when I submit the form: POST /msim/SamplePackage.pdf HTTP/1.1 Host: www.spectron-msim.com User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.7) Gecko/20060909 Firefox/1.5.0.7 Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9 ,text/plain;q=0.8,image/png,*/*;q=0.5 Accept-Language: en-us,en;q=0.5 Accept-Encoding: gzip,deflate Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 Keep-Alive: 300 Connection: keep-alive Referer: removed Authorization: removed Content-Type: application/x-www-form-urlencoded Content-Length: 57 post_data_removed I think that since the 'Content Type' is 'application/x-www-form-urlencoded' Cocoon is trying to process it before my generator deals with it. I tried adding ENCTYPE='text/xml' to my form but it seems Firefox and IE ignore it because I always get 'application/x-www-form-urlencoded'. Can anyone give me a hand? - 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: Cannot get JSPReader/JSPGenerator to work
Tomcat might already be trying to process the jsp calls itself but is failing to translate the url into a file path that is correct. I expect that there are comments in web.xml near *.jsp mapping concerning Tomcat. If you don't explicitly map *.jsp, tomcat is (or at least used to) take over control for all urls that end with .jsp. On the other hand I get the impression from your explanation that this is actually what you want. About classes and lib: the classloader will look in both, but classes folder might have higher precedence over lib. Kind regards, Geert Drs. G.P.H. Josten Consultant Daidalos BV Source of Innovation Hoekeindsehof 1-4 2665 JZ Bleiswijk Tel.: +31 (0) 10 850 1200 Fax: +31 (0) 10 850 1199 www.daidalos.nl KvK 27164984 De informatie - verzonden in of met dit emailbericht - is afkomstig van Daidalos BV en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onbedoeld hebt ontvangen, verzoeken wij u het te verwijderen. Aan dit bericht kunnen geen rechten worden ontleend. Van: Paritosh Patel [mailto:[EMAIL PROTECTED] Verzonden: dinsdag 3 oktober 2006 21:27 Aan: users@cocoon.apache.org Onderwerp: Cannot get JSPReader/JSPGenerator to work I am new to Cocoon (BTW, and its very cool) and am trying to get Cocoon to handle a JSP page to be processed... but it does not work. (My setup is running Cocoon 2.1.9 under Tomcat 5) First, I tried the JSP block welcome page and it also does not work for me. The IE browser window shows empty and the View Source results in only the following: !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.0 Transitional//EN HTMLHEAD META http-equiv=Content-Type content=text/html; charset=windows-1252/HEAD BODY/BODY/HTML Looking at the WEB-INF/classes/org/apache/... the JSPReader and JSPGenerator classes are not present. There is a 'cocoon-jsp-block.jar' under WEB-INF/lib, though. I do not know when Cocoon would go to this Jar file instead of the classes dir. Is there a problem in my setup? Finally, I modified the build's local.block.properties file to make sure that the jsp block is included... This resulted in the same result. What am I doing wrong? The end goal I am trying to get to is for Cocoon to use the Tomcat JSP engine... Is that unreasonable? - pdp - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: RE: Cannot get JSPReader/JSPGenerator to work
Ah, you are using a READER. But I guess that should not really make a difference. And the remark of Nathaniel reminded me that myself have used XSP and not JSP in the past. Still, have you investigated the ClassCastException? Your reader might be causing trouble by something tiresome like wrong libraries etc.. Kind regards, Geert Drs. G.P.H. Josten Consultant Daidalos BV Source of Innovation Hoekeindsehof 1-4 2665 JZ Bleiswijk Tel.: +31 (0) 10 850 1200 Fax: +31 (0) 10 850 1199 www.daidalos.nl KvK 27164984 De informatie - verzonden in of met dit emailbericht - is afkomstig van Daidalos BV en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onbedoeld hebt ontvangen, verzoeken wij u het te verwijderen. Aan dit bericht kunnen geen rechten worden ontleend. Van: Paritosh Patel [mailto:[EMAIL PROTECTED] Verzonden: woensdag 4 oktober 2006 14:53 Aan: users@cocoon.apache.org Onderwerp: Re: RE: Cannot get JSPReader/JSPGenerator to work Geert, I want to run the JSP within Cocoon and not as a request to go to Tomcat. From what I could tell, JSPReader and JSPGenerator uses the configured JSPEngine (in Cacoon) to run it. The path/file I used on the 'src' attribute was a local file (local to the sitemap file). Here is a portion of the sitemap: map:pipeline map:match pattern=*.jsp map:read type=jsp src=jsp/{1}.jsp mime-type=test/html / /map:match /map:pipeline Also, from the documentation, the default configured JSPEngine is the Jasper engine. I wanted to switch that to the Tomcat version (after I can get the default one to work). - pdp - 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: runtime error: xmlserializer not found
Perhaps the IDE is running tomcat in its own JVM and this causes the commen/endorsed libraries to be loaded after the libraries from the JVM itself? I would recommend as test running tomcat outside the IDE and see whether the error occurs there as well. If you are really keen on working within the IDE, you might have more succes with using the Paranoid Cocoon servlet. Include the paranoid block in the Cocoon build (just one additional jar I believe) and set the servlet-class in web.xml to: servlet-classorg.apache.cocoon.servlet.ParanoidCocoonServlet/servlet- class This makes sure that classes are searched in the webapp libraries first, before looking in libraries provided through the framework. Kind regards, Geert Drs. G.P.H. Josten Consultant Daidalos BV Source of Innovation Hoekeindsehof 1-4 2665 JZ Bleiswijk Tel.: +31 (0) 10 850 1200 Fax: +31 (0) 10 850 1199 www.daidalos.nl KvK 27164984 De informatie - verzonden in of met dit emailbericht - is afkomstig van Daidalos BV en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onbedoeld hebt ontvangen, verzoeken wij u het te verwijderen. Aan dit bericht kunnen geen rechten worden ontleend. Van: James Holstead [mailto:[EMAIL PROTECTED] Verzonden: maandag 2 oktober 2006 16:11 Aan: users@cocoon.apache.org Onderwerp: RE: runtime error: xmlserializer not found I'm running j2se 1.5 using netbeans IDE and it's built in tomcat55. My webpages folder WEB-INF/lib includes: xml-apis-1.3.03, xalan-2.7.0, xercesImpl-2.8.0 jars. I copied these to the %tomcat_home%\common\endorsed and restarted tomcat. Same error results. Any red flags pop up ? -Original Message- From: Jeroen Reijn [mailto:[EMAIL PROTECTED] Sent: Friday, September 29, 2006 3:31 AM To: users@cocoon.apache.org Subject: Re: runtime error: xmlserializer not found Hi James, yes it looks like Xerces isn't in your classpath or lib directory of you application server. Can you confirm this? I guess your problem should go away after adding the jar and restarting tomcat. Did you try the suggestions from the cocoon documentation about tomcat ,Xerces and j2se 1.4? It states: Cocoon requires more recent versions of the Xerces and Xalan libraries than those shipped with j2se 1.4. To override bundled libraries, follow these steps: 1. Create %JAVA_HOME%\jre\lib\endorsed directory. (Tomcat users use %TOMCAT_HOME\common\endorsed instead) 2. Copy xercesXXX.jar, xalan-XXX.jar, and the xml-apis.jar from the .\lib\endorsed\ to the new directory created above. See http://cocoon.apache.org/2.1/installing/index.html for more information Regards, Reijn James Holstead wrote: Envo: Cocoon219, Hibernate, Tc5.5 This is a configuration question that may not belong here, but after a full day of searching I'm left wondering if there is a conflicting jar with the org.apache.xml package somewhere. Any help or direction is appreciated. I'll say this in advance, because the error looks fairly obvious at first: xerces is in my nb project classpath. The code: fd:action id=test fd:labelPush Me/fd:label fd:on-action fd:javascript // get the counties as xml importPackage(com.testcocoon.utilities.data); importPackage(org.apache.xml.serialize); //added this line, doesn't help...why? In fact: If a try to import the class XMLSerializer, it complains thats its a class and not a package. var countyData = new StaticDataCounties(); //returns object with county data var data = countyData.currentObject(); //ERROR Line95, returns a CastorMarshaller.getXML() var parent = event.source.parent; parent.lookupWidget(output).setValue(data); //ds is hibernate datasource var peopleList = ds.getObjects(from com.testcocoon.dataobjects.PersonDO as o order by o.persLastName,0,10); var peopleWidget = parent.lookupWidget(people); peopleWidget.setSelectionList(peopleList, personID,persLastName); /fd:javascript /fd:on-action /fd:action The error: java.lang.NoClassDefFoundError: org/apache/xml/serialize/XMLSerializer Cocoon stacktrace[hide] at handleEvent (file:/E:/tomcat_farm/common/cocoon-2.1.9/build/webapp/cct/lic/model/e dit_childcare_facility_model.xml, Line 95): java.lang.NoClassDefFoundError: org/apache/xml/serialize/XMLSerializer file:/E:/tomcat_farm/common/cocoon-2.1.9/build/webapp/cct/lic/model/ed it_childcare_facility_model.xml - 95:-1 Error calling continuation file:/E:/tomcat_farm/common/cocoon-2.1.9/build/webapp/cct/lic/model/ed it_childcare_facility_model.xml
RE: runtime error: xmlserializer not found
Alternatively, you could try to use the paranoid class loader.. :-) Drs. G.P.H. Josten Consultant Daidalos BV Source of Innovation Hoekeindsehof 1-4 2665 JZ Bleiswijk Tel.: +31 (0) 10 850 1200 Fax: +31 (0) 10 850 1199 www.daidalos.nl KvK 27164984 De informatie - verzonden in of met dit emailbericht - is afkomstig van Daidalos BV en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onbedoeld hebt ontvangen, verzoeken wij u het te verwijderen. Aan dit bericht kunnen geen rechten worden ontleend. Van: Jeroen Reijn [mailto:[EMAIL PROTECTED] Verzonden: vrijdag 29 september 2006 10:31 Aan: users@cocoon.apache.org Onderwerp: Re: runtime error: xmlserializer not found Hi James, yes it looks like Xerces isn't in your classpath or lib directory of you application server. Can you confirm this? I guess your problem should go away after adding the jar and restarting tomcat. Did you try the suggestions from the cocoon documentation about tomcat ,Xerces and j2se 1.4? It states: Cocoon requires more recent versions of the Xerces and Xalan libraries than those shipped with j2se 1.4. To override bundled libraries, follow these steps: 1. Create %JAVA_HOME%\jre\lib\endorsed directory. (Tomcat users use %TOMCAT_HOME\common\endorsed instead) 2. Copy xercesXXX.jar, xalan-XXX.jar, and the xml-apis.jar from the .\lib\endorsed\ to the new directory created above. See http://cocoon.apache.org/2.1/installing/index.html for more information Regards, Reijn James Holstead wrote: Envo: Cocoon219, Hibernate, Tc5.5 This is a configuration question that may not belong here, but after a full day of searching I'm left wondering if there is a conflicting jar with the org.apache.xml package somewhere. Any help or direction is appreciated. I'll say this in advance, because the error looks fairly obvious at first: xerces is in my nb project classpath. The code: fd:action id=test fd:labelPush Me/fd:label fd:on-action fd:javascript // get the counties as xml importPackage(com.testcocoon.utilities.data); importPackage(org.apache.xml.serialize); //added this line, doesn't help...why? In fact: If a try to import the class XMLSerializer, it complains thats its a class and not a package. var countyData = new StaticDataCounties(); //returns object with county data var data = countyData.currentObject(); //ERROR Line95, returns a CastorMarshaller.getXML() var parent = event.source.parent; parent.lookupWidget(output).setValue(data); //ds is hibernate datasource var peopleList = ds.getObjects(from com.testcocoon.dataobjects.PersonDO as o order by o.persLastName,0,10); var peopleWidget = parent.lookupWidget(people); peopleWidget.setSelectionList(peopleList, personID,persLastName); /fd:javascript /fd:on-action /fd:action The error: java.lang.NoClassDefFoundError: org/apache/xml/serialize/XMLSerializer Cocoon stacktrace[hide] at handleEvent (file:/E:/tomcat_farm/common/cocoon-2.1.9/build/webapp/cct/lic/model/e dit_childcare_facility_model.xml, Line 95): java.lang.NoClassDefFoundError: org/apache/xml/serialize/XMLSerializer file:/E:/tomcat_farm/common/cocoon-2.1.9/build/webapp/cct/lic/model/ed it_childcare_facility_model.xml - 95:-1 Error calling continuation file:/E:/tomcat_farm/common/cocoon-2.1.9/build/webapp/cct/lic/model/ed it_childcare_facility_model.xml - 95:-1 [JavaScriptException] file:/E:/tomcat_farm/common/cocoon-2.1.9/build/webapp/cct/lic/model/ed it_childcare_facility_model.xml - 95:-1 resource://org/apache/cocoon/forms/flow/javascript/Form.js - 168:-1 resource://org/apache/cocoon/forms/flow/javascript/Form.js - 0:-1 file:/E:/tomcat_farm/common/cocoon-2.1.9/build/webapp/cct/lic/ prefs.js - 0:-1 file:/E:/tomcat_farm/common/cocoon-2.1.9/build/webapp/cct/lic/sitemap. xmap - 127:47 map:call file:/E:/tomcat_farm/common/cocoon-2.1.9/build/webapp/cct/site map.xmap - 188:68 map:mount file:/E:/tomcat_farm/common/cocoon-2.1.9/build/webapp/sitemap.xmap - 969:66 map:mount Java stacktrace[hide] java.lang.NoClassDefFoundError: org/apache/xml/serialize/XMLSerializer at org.exolab.castor.xml.Unmarshaller.initConfig(Unmarshaller.java:272) at org.exolab.castor.xml.Unmarshaller.init(Unmarshaller.java:225) at org.exolab.castor.xml.Unmarshaller.init(Unmarshaller.java:212) Thanks for any input, even if you have to kick me to a hibernate or castor threadI'm a bit lost! *James Holstead* Software Engineer
RE: link to a file
Hmmm, right... Sorry.. It does work on generate/serialize, but perhaps I was wrong and doesn't it work on matches that only contain a reader. Funny though.. Have you tried the following already? map:match pattern=download/** map:read src={1} mime-type=application/x-download / /map:match (or something alike?) Kind regards, Geert -Oorspronkelijk bericht- Van: Roel Croonenberghs [mailto:[EMAIL PROTECTED] Verzonden: vrijdag 29 september 2006 14:24 Aan: users@cocoon.apache.org Onderwerp: RE: link to a file If I do that, i ge the following error; Internal Server Error Message: null Description: java.lang.NullPointerException Sender: org.apache.cocoon.servlet.CocoonServlet Source: Cocoon Servlet Request URI download/test.pdf cause java.lang.NullPointerException request-uri /cocoontest/download/test.pdf stacktrace java.lang.NullPointerException at org.apache.catalina.connector.ResponseBase.setContentType(Resp onseBase.java:874) at org.apache.catalina.connector.HttpResponseBase.setContentType( HttpResponseBase.java:853) at org.apache.catalina.connector.ResponseFacade.setContentType(Re sponseFacade.java:197) at org.apache.cocoon.environment.http.HttpResponse.setContentType (HttpResponse.java:214) at org.apache.cocoon.environment.http.HttpEnvironment.setContentT ype(HttpEnvironment.java:216) at org.apache.cocoon.components.pipeline.AbstractProcessingPipeli ne.setupReader(AbstractProcessingPipeline.java:583) at org.apache.cocoon.components.pipeline.AbstractProcessingPipeli ne.preparePipeline(AbstractProcessingPipeline.java:515) at org.apache.cocoon.components.pipeline.AbstractProcessingPipeli ne.process(AbstractProcessingPipeline.java:479) at org.apache.cocoon.components.treeprocessor.sitemap.ReadNode.in voke(ReadNode.java:119) at org.apache.cocoon.components.treeprocessor.AbstractParentProce ssingNode.invokeNodes(AbstractParentProcessingNode.java:84) at org.apache.cocoon.components.treeprocessor.sitemap.ActTypeNode .invoke(ActTypeNode.java:176) at org.apache.cocoon.components.treeprocessor.AbstractParentProce ssingNode.invokeNodes(AbstractParentProcessingNode.java:84) at org.apache.cocoon.components.treeprocessor.sitemap.PreparableM atchNode.invoke(PreparableMatchNode.java:165) at org.apache.cocoon.components.treeprocessor.AbstractParentProce ssingNode.invokeNodes(AbstractParentProcessingNode.java:108) at org.apache.cocoon.components.treeprocessor.sitemap.PipelineNod e.invoke(PipelineNode.java:163) at org.apache.cocoon.components.treeprocessor.AbstractParentProce ssingNode.invokeNodes(AbstractParentProcessingNode.java:108) at org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNo de.invoke(PipelinesNode.java:152) at org.apache.cocoon.components.treeprocessor.TreeProcessor.proce ss(TreeProcessor.java:354) at org.apache.cocoon.components.treeprocessor.TreeProcessor.proce ss(TreeProcessor.java:307) at org.apache.cocoon.Cocoon.process(Cocoon.java:656) at org.apache.cocoon.servlet.CocoonServlet.service(CocoonServlet. java:1112) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilt er(ApplicationFilterChain.java:247) at org.apache.catalina.core.ApplicationFilterChain.doFilter(Appli cationFilterChain.java:193) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardW rapperValve.java:256) at org.apache.catalina.core.StandardPipeline$StandardPipelineValv eContext.invokeNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipel ine.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContextValve.invoke(StandardC ontextValve.java:191) at org.apache.catalina.core.StandardPipeline$StandardPipelineValv eContext.invokeNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipel ine.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContext.invoke(StandardContex t.java:2415) at org.apache.catalina.core.StandardHostValve.invoke(StandardHost Valve.java:180) at org.apache.catalina.core.StandardPipeline$StandardPipelineValv
RE: RE: link to a file
Hi, You found the thread on which I based my solution! :-) However, for some reason it doesn't work on readers. I hadn't noticed until after my first reply that I had commented it out in my own sitemap and had replaced it with a generate/serialize wrapped in the set-header action. It looks apparently like the response object is not yet created at the moment that the action is executed, which is before the reader. Design flaw? Kind regards, Geert Drs. G.P.H. Josten Consultant Daidalos BV Source of Innovation Hoekeindsehof 1-4 2665 JZ Bleiswijk Tel.: +31 (0) 10 850 1200 Fax: +31 (0) 10 850 1199 www.daidalos.nl KvK 27164984 De informatie - verzonden in of met dit emailbericht - is afkomstig van Daidalos BV en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onbedoeld hebt ontvangen, verzoeken wij u het te verwijderen. Aan dit bericht kunnen geen rechten worden ontleend. Van: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Namens Bertrand Delacretaz Verzonden: vrijdag 29 september 2006 16:49 Aan: users@cocoon.apache.org Onderwerp: Re: RE: link to a file On 9/29/06, Roel Croonenberghs [EMAIL PROTECTED] wrote: ...it opens .html, .txt, .jpg, .gif files in the browser instead of downloading them... You need to set the content-disposition HTTP header to trigger a download, this thread shows how (I think, didn't check in detail): http://marc2.theaimsgroup.com/?l=xml-cocoon-usersm=1108910965 22009w=2 And this explains the principle: http://www.onjava.com/pub/a/onjava/excerpt/jebp_3/index3.html -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: RE: link to a file
PS: I believe I also tried setting the header from FlowScript, but had the impression it was either ignored or overruled by the reader.. Kind regards, Geert -Oorspronkelijk bericht- Van: Geert Josten [mailto:[EMAIL PROTECTED] Verzonden: vrijdag 29 september 2006 17:04 Aan: users@cocoon.apache.org Onderwerp: RE: RE: link to a file Hi, You found the thread on which I based my solution! :-) However, for some reason it doesn't work on readers. I hadn't noticed until after my first reply that I had commented it out in my own sitemap and had replaced it with a generate/serialize wrapped in the set-header action. It looks apparently like the response object is not yet created at the moment that the action is executed, which is before the reader. Design flaw? Kind regards, Geert Drs. G.P.H. Josten Consultant Daidalos BV Source of Innovation Hoekeindsehof 1-4 2665 JZ Bleiswijk Tel.: +31 (0) 10 850 1200 Fax: +31 (0) 10 850 1199 www.daidalos.nl KvK 27164984 De informatie - verzonden in of met dit emailbericht - is afkomstig van Daidalos BV en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onbedoeld hebt ontvangen, verzoeken wij u het te verwijderen. Aan dit bericht kunnen geen rechten worden ontleend. Van: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Namens Bertrand Delacretaz Verzonden: vrijdag 29 september 2006 16:49 Aan: users@cocoon.apache.org Onderwerp: Re: RE: link to a file On 9/29/06, Roel Croonenberghs [EMAIL PROTECTED] wrote: ...it opens .html, .txt, .jpg, .gif files in the browser instead of downloading them... You need to set the content-disposition HTTP header to trigger a download, this thread shows how (I think, didn't check in detail): http://marc2.theaimsgroup.com/?l=xml-cocoon-usersm=1108910965 22009w=2 And this explains the principle: http://www.onjava.com/pub/a/onjava/excerpt/jebp_3/index3.html -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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Cocoon + PDF + Forms ?
Hi Brian, Interesting. I assume that users need to be able to fill out the forms (both PDF and HTML) and somehow send back the result. How do you do that with your in house solution? Is it all web-based? Our company employs PDF forms in a project for one of our customers, and I thought it was web-based, but am afraid I do not know the precise details. I guess Cocoon would have no trouble handling the FDF files, but combining an FDF with a PDF to provide a user with a PDF form might be more difficult. I am not that familiar with this technology though, to say for sure.. Kind regards, Geert Drs. G.P.H. Josten Consultant Daidalos BV Source of Innovation Hoekeindsehof 1-4 2665 JZ Bleiswijk Tel.: +31 (0) 10 850 1200 Fax: +31 (0) 10 850 1199 www.daidalos.nl KvK 27164984 De informatie - verzonden in of met dit emailbericht - is afkomstig van Daidalos BV en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onbedoeld hebt ontvangen, verzoeken wij u het te verwijderen. Aan dit bericht kunnen geen rechten worden ontleend. Van: Brian Demers [mailto:[EMAIL PROTECTED] Verzonden: woensdag 27 september 2006 19:10 Aan: users@cocoon.apache.org Onderwerp: Cocoon + PDF + Forms ? Hello All, We have an in house solution that allows us to render a PDF or HTML form based on an XML file. From what I have read, Cocoon can do this. I would like to move away from our in house solution to a more standard API. The problem is that we are using forms (as in data entry) with both our PDF and HTML versions. Will Cocoon and Cocoon forms allow for PDF form? If so does anyone have a link or an example? Also if this is supported does the PDF require an FDF document? Thanks! - 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: Custom Serializer
You should begin from this http://cocoon.apache.org/2.1/introduction.html The Apache Cocoon Project based at Apache Excalubur Project. Any Cocoon components are Avalon Components. http://excalibur.apache.org/developing/introduction.html If you need a simple example you can ask me. You could also look for an existing serializer that looks to be near to what you are looking for and patch it till it does what you want.. ;-) Drs. G.P.H. Josten Consultant Daidalos BV Source of Innovation Hoekeindsehof 1-4 2665 JZ Bleiswijk Tel.: +31 (0) 10 850 1200 Fax: +31 (0) 10 850 1199 www.daidalos.nl KvK 27164984 De informatie - verzonden in of met dit emailbericht - is afkomstig van Daidalos BV en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onbedoeld hebt ontvangen, verzoeken wij u het te verwijderen. Aan dit bericht kunnen geen rechten worden ontleend. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: link to a file
tnx, but does that means that for every different extension, I should supply a mime-type? It depends. The default reader will try and pick one automatically, but the ones it knows depends on some JDK settings file (search the list archives, I asked about this a while back). For others, you either need to add them to this file, or just use a specific map:read that supplies it. I might be mistaken, but there are mime-type mappings in web-inf/web.xml. The default reader could be using these.. Kind regards, Geert Drs. G.P.H. Josten Consultant Daidalos BV Source of Innovation Hoekeindsehof 1-4 2665 JZ Bleiswijk Tel.: +31 (0) 10 850 1200 Fax: +31 (0) 10 850 1199 www.daidalos.nl KvK 27164984 De informatie - verzonden in of met dit emailbericht - is afkomstig van Daidalos BV en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onbedoeld hebt ontvangen, verzoeken wij u het te verwijderen. Aan dit bericht kunnen geen rechten worden ontleend. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: link to a file
2de question; I want the user to download the file, that when teh user cliks the link, his browser opens a download dialog box so heb can choose where to save the file. how do I do that? To a large extent, that depends on the browser they're using - for example, I have mine set to automatically download files to a specific folder without prompting. More generally, though, if the browser has a plugin that can handle the returned mime type it will open it in that; otherwise it will download it. There may also be a separate download this link option on the RMB popup menu to allow it to be saved rather than opened. If you want to force files to be downloaded rather than handled by plugins, you could return application/octet-stream as the mime type instead of the actual value. I use the following strategy, which should work for most browsers I believe: map:match pattern=download/* map:act type=set-header map:parameter name=Content-Type value=application/x-download/ map:parameter name=Content-Disposition value=attachment ; filename={1}/ map:read src={global:datadir}{1} / /map:act /map:match PS: {global:datadir} refers to a datadir element in map:pipelines/map:component-configurations/global-variables Kind regards, Geert Drs. G.P.H. Josten Consultant Daidalos BV Source of Innovation Hoekeindsehof 1-4 2665 JZ Bleiswijk Tel.: +31 (0) 10 850 1200 Fax: +31 (0) 10 850 1199 www.daidalos.nl KvK 27164984 De informatie - verzonden in of met dit emailbericht - is afkomstig van Daidalos BV en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onbedoeld hebt ontvangen, verzoeken wij u het te verwijderen. Aan dit bericht kunnen geen rechten worden ontleend. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: HTMLGenerator generate Tree Files
Can you give more details on how the generator produces the three files exactly? Kind regards, Geert Drs. G.P.H. Josten Consultant Daidalos BV Source of Innovation Hoekeindsehof 1-4 2665 JZ Bleiswijk Tel.: +31 (0) 10 850 1200 Fax: +31 (0) 10 850 1199 www.daidalos.nl KvK 27164984 De informatie - verzonden in of met dit emailbericht - is afkomstig van Daidalos BV en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onbedoeld hebt ontvangen, verzoeken wij u het te verwijderen. Aan dit bericht kunnen geen rechten worden ontleend. Van: rachid harradi [mailto:[EMAIL PROTECTED] Verzonden: maandag 25 september 2006 13:45 Aan: users@cocoon.apache.org Onderwerp: HTMLGenerator generate Tree Files Hello Together, I have generator, which procudes three files(.xml, .xsl, .xsl). I would like to send this tree files on differently pipeline. how i can do it? -- Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen! Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer - 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: RE: HTMLGenerator generate Tree Files
Hi Rachid, I have the impression that you have coded more in Java than necessary. Can you summarize briefly what you try to achieve in functional terms and why you have chosen to write this generator? Kind regards, Geert -Oorspronkelijk bericht- Van: rachid harradi [mailto:[EMAIL PROTECTED] Verzonden: maandag 25 september 2006 15:46 Aan: users@cocoon.apache.org Onderwerp: Re: RE: HTMLGenerator generate Tree Files Hello Josten, my Generator generator: public void generate() throws IOException, SAXException, ProcessingException { SAXParser parser = null; try { boolean debug = false; boolean info = false; boolean ascii = false; boolean toc = false; ascii = true; String target =E:/workspace3/cocoon/build/webapp/wh2fo/objectionhtml.html; File source = new File(target); if (source.exists()) { translator.doXslAttsFileName(target); translator.doXmlFileName(target); translator.doXslFileName(target); String xslFileName= translator.getXslFileName(); String xslAttsFileName = translator.getXslAttsFileName(); String xmlFileName = translator.getXmlFileName(); String producer = Version.producer; documentParser = new DocumentParser( target,xslAttsFileName,xmlFileName,debug,ascii,toc); ElementTreeWriter XSLTempWriter = new ElementTreeWriter(xslFileName, producer); // 1er file bestored. //in E:/workspace3/cocoon/build/webapp/wh2fo/ //to another pipeline XSLTempWriter.write(documentParser.getXSLTemplatesRoot()); //// 1er file be stored in E:/workspace3/cocoon/build/webapp/wh2fo/ ElementTreeWriter XSLAttsWriter = new ElementTreeWriter(xslAttsFileName, producer); XSLAttsWriter.write(documentParser.getXSLAttributesRoot()); ElementTreeWriter XMLwriter = new ElementTreeWriter(xmlFileName, producer); XMLwriter.write(documentParser.getXMLPreProc());documentParser =translator.getParser(); StringReader xmlReader = new StringReader(XMLwriter.getBuffer().toString()); inputSource = new InputSource(xmlReader); parser = (SAXParser)this.manager.lookup(SAXParser.ROLE); parser.parse(this.inputSource, super.xmlConsumer); } else System.err.println(SEVERE ERROR: file +target+ not found.); } catch (IOException e) { getLogger().error(StreamGenerator.generate(), e); throw new ResourceNotFoundException(StreamGenerator could not find resource, e); } catch (Exception e) { getLogger().error(Could not get parser, e); throw new ProcessingException(Exception in StreamGenerator.generate(), e); } finally { this.manager.release( parser); } } Original-Nachricht Datum: Mon, 25 Sep 2006 14:11:00 +0200 Von: Geert Josten [EMAIL PROTECTED] An: users@cocoon.apache.org Betreff: RE: HTMLGenerator generate Tree Files Can you give more details on how the generator produces the three files exactly? Kind regards, Geert Drs. G.P.H. Josten Consultant Daidalos BV Source of Innovation Hoekeindsehof 1-4 2665 JZ Bleiswijk Tel.: +31 (0) 10 850 1200 Fax: +31 (0) 10 850 1199 www.daidalos.nl KvK 27164984 De informatie - verzonden in of met dit emailbericht - is afkomstig van Daidalos BV en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onbedoeld hebt ontvangen, verzoeken wij u het te verwijderen. Aan dit bericht kunnen geen rechten worden ontleend. Van: rachid harradi [mailto:[EMAIL PROTECTED] Verzonden: maandag 25 september 2006 13:45 Aan: users@cocoon.apache.org Onderwerp: HTMLGenerator generate Tree Files Hello Together, I have generator, which procudes three files(.xml, .xsl, .xsl). I would like to send this tree files on differently pipeline. how i can do it? -- Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen! Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED
RE: RE: RE: HTMLGenerator generate Tree Files
Oh, and you can easily insert an additional transform somewhere to activate XSL #3.. :-) -Oorspronkelijk bericht- Van: Geert Josten Verzonden: maandag 25 september 2006 17:22 Aan: 'users@cocoon.apache.org' Onderwerp: RE: RE: RE: HTMLGenerator generate Tree Files Hi Rachid, Aha, becoming a bit clearer. You are reading the HTML, distilling XML and XSL's out of it, applying the XSL's to the XML and producing XSL-FO all in one generator? If your WH2FO parser is XSLT based, you can use Cocoon piping to connect it all together and skip manual file and buffer writing. You would need something like: - One pipe to consume the HTML using the Jtidy generator - Three pipes that produce the XML, XSL 1 and XSL 2 respectively, using the first pipe (the first pipe will be executed only once thanks to the Cocoon internal caching mechanism) - One pipe to get the XML and apply the two XSL's - One pipe to get the result and apply FOP serializer if appropriate Most tricky part is the pipe before the last, though not that complex either. It could look like: map:match pattern=apply-stylesheets/**!-- ** represents path to html file -- map:generate src=cocoon:/get-xml/{1} / !-- call to pipeline that converts html to xml -- map:transform src=cocoon:/get-first-xsl/{1} / map:transform src=cocoon:/get-second-xsl/{1} / map:serialize type=xml / /map:match Implementing the above gives you separate pipes for the three files: xml, xsl 1 and xsl 2, an additional pipe to read any HTML file, a pipe to connect the three files to create XSL-FO, and as many additional pipes as you like to serialize the XSL-FO to as many formats as you like (or supported). Does this help? Kind regards, Geert -Oorspronkelijk bericht- Van: rachid harradi [mailto:[EMAIL PROTECTED] Verzonden: maandag 25 september 2006 16:38 Aan: users@cocoon.apache.org Onderwerp: Re: RE: RE: HTMLGenerator generate Tree Files Hello together, I will procude a XSLT and/or a XSL:FO on the basis WordHTML. for it I found a TOOL names WH2FO, which procudes three files(.xml, .xsl(1), .xsl(2)). I would like to use this Framework in cocoon. So the xml File like: paragraph class=Normal reference id=Name_Einreicher/reference #160; #160; ::woh_lastname , ::woh_firstname /paragraph with xsl(3) I want to replace the value like ::woh_lastname with other values(from another xml document(dynamic)). at end i want the resulting document through xsl(1,2) in HTML or pdf i hoffe thas you unterstand what i want to do Rachid Harradi Original-Nachricht Datum: Mon, 25 Sep 2006 16:02:41 +0200 Von: Geert Josten [EMAIL PROTECTED] An: users@cocoon.apache.org Betreff: RE: RE: HTMLGenerator generate Tree Files Hi Rachid, I have the impression that you have coded more in Java than necessary. Can you summarize briefly what you try to achieve in functional terms and why you have chosen to write this generator? Kind regards, Geert -Oorspronkelijk bericht- Van: rachid harradi [mailto:[EMAIL PROTECTED] Verzonden: maandag 25 september 2006 15:46 Aan: users@cocoon.apache.org Onderwerp: Re: RE: HTMLGenerator generate Tree Files Hello Josten, my Generator generator: public void generate() throws IOException, SAXException, ProcessingException { SAXParser parser = null; try { boolean debug = false; boolean info = false; boolean ascii = false; boolean toc = false; ascii = true; String target =E:/workspace3/cocoon/build/webapp/wh2fo/objectionhtml.html; File source = new File(target); if (source.exists()) { translator.doXslAttsFileName(target); translator.doXmlFileName(target); translator.doXslFileName(target); String xslFileName= translator.getXslFileName(); String xslAttsFileName = translator.getXslAttsFileName(); String xmlFileName = translator.getXmlFileName(); String producer = Version.producer; documentParser = new DocumentParser( target,xslAttsFileName,xmlFileName,debug,ascii,toc); ElementTreeWriter XSLTempWriter = new ElementTreeWriter(xslFileName, producer); // 1er file bestored. //in E:/workspace3/cocoon/build/webapp/wh2fo
RE: upload:// pseudo protocol
Yes, the mechanism for uploading files is not that trivial, but to my opinion quite flexible. When you press submit in the HTML form, the file you try to upload is attached to the HTML request. The built-in Cocoon (HTTP)Request object is able to automatically recognize these attachments (provided you activate enable-uploads in web.xml) and stores these in the Cocoon working dir (Jetty temp folder or whatever is configured). Once done, the request-parameter that identified the attachment is changed so that it contains the path to this temp file. Source factories are very flexible components that can be used anywhere in Cocoon where access to sources is needed. The instruction in cocoon.xconf you found defines an additional pseudo protocol, starting with upload://. It takes the name of the request-param that contains the reference to the uploaded file as parameter, reads the value of that parameter, opens a Source object that points to the temp file, and provides the input stream of the file to whichever component was requesting for it. I hopped through quite a lot of code a while ago and experimented a bit to derive all this. Seems to me that you were on the right track.. :-) About documentation: if there is no documentation in the header of the relevant Java files, look for working examples or read the code. :-( About previewing before publishing: I am not sure about the life-time of these upload temp files, but I guess that all you need is to write a FlowScript function that preserves the value of the upload request parameter, calls a sendPageAndWait and depending on the returned request parameters decide to publish the file or return to the upload screen perhaps. Kind regards, Geert Drs. G.P.H. Josten Consultant Daidalos BV Source of Innovation Hoekeindsehof 1-4 2665 JZ Bleiswijk Tel.: +31 (0) 10 850 1200 Fax: +31 (0) 10 850 1199 www.daidalos.nl KvK 27164984 De informatie - verzonden in of met dit emailbericht - is afkomstig van Daidalos BV en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onbedoeld hebt ontvangen, verzoeken wij u het te verwijderen. Aan dit bericht kunnen geen rechten worden ontleend. Van: Steven D. Majewski [mailto:[EMAIL PROTECTED] Verzonden: donderdag 21 september 2006 23:58 Aan: users@cocoon.apache.org Onderwerp: Re: upload:// pseudo protocol On Sep 21, 2006, at 4:20 PM, Steven D. Majewski wrote: Is the upload:// pseudo-protocol documented anywhere ? ( I saw it in one of the samples, but could not find anything in the docs. ) And if it isn't documented: where in the source code should I look for info on how it's implemented ? I just managed to find this myself -- the indirection implicit in cocoon's component model sometimes makes grepping thru the sources a futile search. I see that all of the protocol handlers ( upload as well as file, module, zip, etc... ) are defined in cocoon.xconf : component-instance class=org.apache.cocoon.components.source.impl.PartSourceFactory name=upload/ Which gives me a start on figuring out how upload://name in the sitemap manages to connect up with the MultipartParser. I'm still quite perplexed by all of the various ways of handling uploading in the cocoon samples, as well as the several methods documented on the wiki. But I'm still preplexed by much of the rest of it! -- Steve Majewski - 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: Free for use: SaveFilesTransformer
And the rollback() at endDocument() as well (if necessary :). Hum ... In fact the transaction id is the file url. IMHO endDocument is not called if an exeption occure in pipeline. You are right, point taken! :-P Grtz, Geert Drs. G.P.H. Josten Consultant Daidalos BV Source of Innovation Hoekeindsehof 1-4 2665 JZ Bleiswijk Tel.: +31 (0) 10 850 1200 Fax: +31 (0) 10 850 1199 www.daidalos.nl KvK 27164984 De informatie - verzonden in of met dit emailbericht - is afkomstig van Daidalos BV en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onbedoeld hebt ontvangen, verzoeken wij u het te verwijderen. Aan dit bericht kunnen geen rechten worden ontleend. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: upload:// pseudo protocol
For what its worth, I added the following to the sitemap to easily move uploads to a different location: map:components map:selectors !-- redefine request-param-regexp to add 'not-empty' -- map:selector name=request-param-regexp src=org.apache.cocoon.selection.RegexpRequestParameterSelector pattern name=empty^$/pattern pattern name=number^[0-9]+$/pattern pattern name=string^.+$/pattern pattern name=not-empty^.+$/pattern /map:selector /map:selectors /map:components map:resources map:resource name=save-upload map:select type=request-param-regexp map:parameter name=parameter-name value={request-param} / map:when test=not-empty map:act type=source-action src=upload://{request-param} map:parameter name=action value=copy / map:parameter name=dest value={upload-dir} / map:generate src=cocoon:/{continue-uri} / map:serialize type=xml / /map:act /map:when map:otherwise map:generate src=cocoon:/{continue-uri} / map:serialize type=xml / /map:otherwise /map:select /map:resource /map:resources And you can call it like this: map:call resource=save-upload map:parameter name=request-param value=my-upload / map:parameter name=upload-dir value={global:uploadDir} / map:parameter name=continue-uri value=cocoon://upload-done.html / /map:call Kind regards, Geert Drs. G.P.H. Josten Consultant Daidalos BV Source of Innovation Hoekeindsehof 1-4 2665 JZ Bleiswijk Tel.: +31 (0) 10 850 1200 Fax: +31 (0) 10 850 1199 www.daidalos.nl KvK 27164984 De informatie - verzonden in of met dit emailbericht - is afkomstig van Daidalos BV en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onbedoeld hebt ontvangen, verzoeken wij u het te verwijderen. Aan dit bericht kunnen geen rechten worden ontleend. Van: Steven D. Majewski [mailto:[EMAIL PROTECTED] Verzonden: donderdag 21 september 2006 23:58 Aan: users@cocoon.apache.org Onderwerp: Re: upload:// pseudo protocol On Sep 21, 2006, at 4:20 PM, Steven D. Majewski wrote: Is the upload:// pseudo-protocol documented anywhere ? ( I saw it in one of the samples, but could not find anything in the docs. ) And if it isn't documented: where in the source code should I look for info on how it's implemented ? I just managed to find this myself -- the indirection implicit in cocoon's component model sometimes makes grepping thru the sources a futile search. I see that all of the protocol handlers ( upload as well as file, module, zip, etc... ) are defined in cocoon.xconf : component-instance class=org.apache.cocoon.components.source.impl.PartSourceFactory name=upload/ Which gives me a start on figuring out how upload://name in the sitemap manages to connect up with the MultipartParser. I'm still quite perplexed by all of the various ways of handling uploading in the cocoon samples, as well as the several methods documented on the wiki. But I'm still preplexed by much of the rest of it! -- Steve Majewski - 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: Free for use: SaveFilesTransformer
Really an intersting idea. But I'd not begin the transaction in setup(). What about startDocument()? And the rollback() at endDocument() as well (if necessary :). Though I guess I would like to manage the transactions independantly altogether. In actions fired with separate urls perhaps? ;-) Drs. G.P.H. Josten Consultant Daidalos BV Source of Innovation Hoekeindsehof 1-4 2665 JZ Bleiswijk Tel.: +31 (0) 10 850 1200 Fax: +31 (0) 10 850 1199 www.daidalos.nl KvK 27164984 De informatie - verzonden in of met dit emailbericht - is afkomstig van Daidalos BV en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onbedoeld hebt ontvangen, verzoeken wij u het te verwijderen. Aan dit bericht kunnen geen rechten worden ontleend. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: RE: SaveFilesTransformer
Hi Rachid, I'm not sure I understand you fully, but to set filepath dynamically you have a few options I guess: 1. Use an input module to read the value and pass it to the XSL with a construct like this: map:parameter name=filepath value={request-param:outputdir} / (this reads a request-param named 'outputdir' and replaces the {..} part by the value) 2. Same thing, but wrapped in an action that sets a parameter or wrapped in a FlowScript call that sets a request-param, request-attribute or else.. 3. Forget about the filepath parameter alltogether and change the XSL to inspect the input (result from cocoon:/wohland), to get an output path from there. 4. ... Kind regards, Geert Hi Josten, thank you very much for help it work very nice :) i have another Question. the filepath is dynamic i get it from cocoon:/wohland or from Servelt Application. how can i acces the path during Sitemape like global variable? Rachid Harradi map:transform src=saveFile.xsl map:parameter name=serializer value=html / map:parameter name=filepath value=E:/temp/objectionhtml.html / /map:transform Drs. G.P.H. Josten Consultant Daidalos BV Source of Innovation Hoekeindsehof 1-4 2665 JZ Bleiswijk Tel.: +31 (0) 10 850 1200 Fax: +31 (0) 10 850 1199 www.daidalos.nl KvK 27164984 De informatie - verzonden in of met dit emailbericht - is afkomstig van Daidalos BV en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onbedoeld hebt ontvangen, verzoeken wij u het te verwijderen. Aan dit bericht kunnen geen rechten worden ontleend. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Free for use: SaveFilesTransformer
How does it work? Kind regards, Geert -Oorspronkelijk bericht- Van: Olivier [mailto:[EMAIL PROTECTED] Verzonden: woensdag 20 september 2006 10:07 Aan: users@cocoon.apache.org Onderwerp: Re: Free for use: SaveFilesTransformer Hi all, I've build a transactionnal write transformer on top of : http://jakarta.apache.org/commons/transaction/ Works fine in production. Geert Josten wrote: Hi all, Available on wiki: http://wiki.apache.org/cocoon/SaveFilesTransformer It might be that someone else already wrote a Transformer like this one. It is derived from the SourceWritingTransformer (yet simplified) and has one important benefit over it: it can take a src attribute that can be used to capture also binary streams and save them to disk. Comments are welcome.. Kind regards, Geert Drs. G.P.H. Josten Consultant Daidalos BV Source of Innovation Hoekeindsehof 1-4 2665 JZ Bleiswijk Tel.: +31 (0) 10 850 1200 Fax: +31 (0) 10 850 1199 www.daidalos.nl KvK 27164984 De informatie - verzonden in of met dit emailbericht - is afkomstig van Daidalos BV en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onbedoeld hebt ontvangen, verzoeken wij u het te verwijderen. Aan dit bericht kunnen geen rechten worden ontleend. - 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]
RE: SaveFilesTransformer
Hi Rachid, Yes, you are going wrong at the point where you actually call the savefiles transformer. This transformer is content driven, not parametrized with a save:file element. You have two options: 1. Wrap the result from the generate inside a save:file element using for instance the attached XSL, by adding the following transform between the generate and savefiles transform: map:transform src=saveFile.xsl map:parameter name=serializer value=html / map:parameter name=filepath value=E:/temp/objectionhtml.html / /map:transform 2. Not generate the dynamic content of cocoon:/wohland, but a static xml file with contents: ?xml version=1.0? save:file src=cocoon:/wohland target=E:/temp/objectionhtml.html xmlns:save=http://daidalos.nl/cocoon/save/1.0; / Hope this helps! Kind regards, Geert Drs. G.P.H. Josten Consultant Daidalos BV Source of Innovation Hoekeindsehof 1-4 2665 JZ Bleiswijk Tel.: +31 (0) 10 850 1200 Fax: +31 (0) 10 850 1199 www.daidalos.nl KvK 27164984 De informatie - verzonden in of met dit emailbericht - is afkomstig van Daidalos BV en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onbedoeld hebt ontvangen, verzoeken wij u het te verwijderen. Aan dit bericht kunnen geen rechten worden ontleend. Van: rachid harradi [mailto:[EMAIL PROTECTED] Verzonden: woensdag 20 september 2006 17:38 Aan: users@cocoon.apache.org Onderwerp: use: SaveFilesTransformer hello together, i had use the SaveFilesTransformer but i have any file stored in filesystem so is my Sitemap: ?xml version=1.0 encoding=UTF-8? map:sitemap xmlns:map=http://apache.org/cocoon/sitemap/1.0; map:components !--map:generators default=objectionHTMLGenerator map:generator name=objectionHTMLGenerator src=ameliGenerator.MyGenerator/ /map:generators-- map:generators default=myGenerator map:generator name=savingGenerator src=ameliGenerator.SavingGenerator/ map:generator name=objectionGenerator src=ameliGenerator.MyGenerator/ /map:generators map:transformers default=tofile map:transformer name=tofile src=ameliTransformer.AmeliTransformer/ map:transformer logger='transformer.savefiles' name='savefiles' src='ameliTransformer.SaveFilesTransformer'/ map:transformer name=write-source src=org.apache.cocoon.transformation.SourceWritingTransformer map:parameter name=serializer value=xml/ /map:transformer /map:transformers /map:components map:pipelines map:pipeline internal-only=false map:match pattern=wohland map:generate type=file src=ObjectionHTML.xml/ map:transform type=xslt src=objection04.xslt/ map:serialize type=html/ /map:match /map:pipeline map:pipeline map:match pattern= map:generate type=file src=cocoon:/wohland/ !--map:generate type=file src=ObjectionHTML.xml/-- map:transform type=savefiles save:file src=cocoon:/wohland target=E:/temp/objectionhtml.html xmlns:save=http://daidalos.nl/cocoon/save/1.0; / /map:transform map:serialize type=xml/ /map:match /map:pipeline map:pipeline map:match pattern=tofiles map:generate type=savingGenerator src=cocoon:/wohland/ map:serialize type=xml/ /map:match /map:pipeline /map:pipelines /map:sitemap i use this URL:http://localhost:8080/cocoon/savefiles/ -- Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen! Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] saveFile.xsl Description: saveFile.xsl - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: RE: RE: Output storing after Serializer
The SaveFilesTransformer can be found at: http://wiki.apache.org/cocoon/SaveFilesTransformer Kind regards, Geert Drs. G.P.H. Josten Consultant Daidalos BV Source of Innovation Hoekeindsehof 1-4 2665 JZ Bleiswijk Tel.: +31 (0) 10 850 1200 Fax: +31 (0) 10 850 1199 www.daidalos.nl KvK 27164984 De informatie - verzonden in of met dit emailbericht - is afkomstig van Daidalos BV en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onbedoeld hebt ontvangen, verzoeken wij u het te verwijderen. Aan dit bericht kunnen geen rechten worden ontleend. Van: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Namens Bertrand Delacretaz Verzonden: zaterdag 16 september 2006 20:58 Aan: users@cocoon.apache.org Onderwerp: Re: RE: RE: Output storing after Serializer On 9/16/06, Geert Josten [EMAIL PROTECTED] wrote: ...Can you give a suggestion where for instance? Somewhere that would make sense to others?.. The best IMHO is to create a new page, naming it after your transformer. See http://wiki.apache.org/cocoon/FlowAndWebServices for an example. -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]
Free for use: SaveFilesTransformer
Hi all, Available on wiki: http://wiki.apache.org/cocoon/SaveFilesTransformer It might be that someone else already wrote a Transformer like this one. It is derived from the SourceWritingTransformer (yet simplified) and has one important benefit over it: it can take a src attribute that can be used to capture also binary streams and save them to disk. Comments are welcome.. Kind regards, Geert Drs. G.P.H. Josten Consultant Daidalos BV Source of Innovation Hoekeindsehof 1-4 2665 JZ Bleiswijk Tel.: +31 (0) 10 850 1200 Fax: +31 (0) 10 850 1199 www.daidalos.nl KvK 27164984 De informatie - verzonden in of met dit emailbericht - is afkomstig van Daidalos BV en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onbedoeld hebt ontvangen, verzoeken wij u het te verwijderen. Aan dit bericht kunnen geen rechten worden ontleend. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: cocoon serializer
Dear Zsombor, I advice to register yourself on the cocoon users mailing list. That way you will not depend on my availability and access many others with experience simultaniously. I included the list in the CC. (I think you need to register to be allowed to submit messages to it.) Anyhow, I might have an answer for you. I have tried adapting the SourceWritingTransformer to act as a Serializer, but encountered the same problem as you. As far as I recall you cannot parametrize a serializer after it is created and initialized. (Please correct me if I am wrong, anyone!) Moreover, the way serializers work is quite a lot more difficult than Transformers. When calling pipes internally, serializers are circumvented and that is most likely not what you want. It was certainly not what I wanted! :-P Instead, I wrote a simple Transformer to do the job of saving to a file. It happens to be that I published it on the Cocoon wiki just this morning. :-) You can find it at: http://wiki.apache.org/cocoon/SaveFilesTransformer That page also explains how to use it. Kind regards, Geert Drs. G.P.H. Josten Consultant Daidalos BV Source of Innovation Hoekeindsehof 1-4 2665 JZ Bleiswijk Tel.: +31 (0) 10 850 1200 Fax: +31 (0) 10 850 1199 www.daidalos.nl KvK 27164984 De informatie - verzonden in of met dit emailbericht - is afkomstig van Daidalos BV en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onbedoeld hebt ontvangen, verzoeken wij u het te verwijderen. Aan dit bericht kunnen geen rechten worden ontleend. Van: Varga, Zsombor [mailto:[EMAIL PROTECTED] Verzonden: dinsdag 19 september 2006 9:32 Aan: Geert Josten Onderwerp: cocoon serializer Dear Geert! I have a problem with Cocoon serializers. I read an article from you at http://article.gmane.org/, where you give advise to a person whose problem like to mine. I am generating pdf documents with xsl-fo. Our Cocoon version is 2.1.9 . Here is the part of the sitemap: map:match pattern=mypdf.pdf map:generate type=serverpages src=mypdf.xsp/ map:transform src=mypdf2fo.xsl/ map:serialize type=fo2pdf/ /map:match The pdf serializer is the standard, which comes with the cocoon source. Everything works i get the correct pdf, at my browser. But i have to save the generated pdf automatically. I tried to write a new serializer, wich also writes to a file, but i can't control the serializer where to write, neither the name of the file. For this i should pass some paramter to this new serializer, which come from request or from the sitemap. And how i get theese parameters in the serializer? Can you help me solving this problem, or can you advise me another solution? Thanks for your help! Zsombor - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
FW: cocoon serializer
Might be interesting for other users.. (read below) Drs. G.P.H. Josten Consultant Daidalos BV Source of Innovation Hoekeindsehof 1-4 2665 JZ Bleiswijk Tel.: +31 (0) 10 850 1200 Fax: +31 (0) 10 850 1199 www.daidalos.nl KvK 27164984 De informatie - verzonden in of met dit emailbericht - is afkomstig van Daidalos BV en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onbedoeld hebt ontvangen, verzoeken wij u het te verwijderen. Aan dit bericht kunnen geen rechten worden ontleend. Van: Geert Josten Verzonden: dinsdag 19 september 2006 11:12 Aan: 'Varga, Zsombor' Onderwerp: RE: cocoon serializer Anyhow, I might have an answer for you. I have tried adapting the SourceWritingTransformer to act as a Serializer, but encountered the same problem as you. As far as I recall you cannot parametrize a serializer after it is created and initialized. (Please correct me if I am wrong, anyone!) i found an other solution here: http://comments.gmane.org/gmane.text.xml.cocoon.user/53269. And it is works!!! I only implemented the SitemapModelComponent interface. i have to add some more methods to my serializer (but Eclipse did it instead of me). And in the setup() method i got Parameters, and objectModel which is a Map. With Parameters you can get the SiteMap parameters, and with the objectModel yo can access to the Request object, wher you can get anything [Request oRequest = ObjectModelHelper.getRequest(objectModel)] It's really working! Cheers for getting it to work! :-) Yes, I recognize the thread. But I was still using older version of Cocoon, so I couldn't use the suggestion they made. :-P Besides, it is a pity that the serializer you created has such a limited use case, while mine can be used in many situations. And I always found transformers much more powerfull than serializers. I believe there are components that reuse code for both transformers and serializers, however; cannot mention one though. Have you noted my remark about making internal calls? Something to keep in mind when using your serializer. Kind regards, Geert - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: cocoon serializer
Hi Zsombor, [Geert] Besides, it is a pity that the serializer you created has such a limited use case, while mine can be used in many situations. And I always found transformers much more powerfull than serializers. [Zsombor] But how can you use the FPO fo2pdf serializer in a transormer? It's my only problem. Untill now i only use transformers to create xml from other xml generated by the generator. So how can i create a pdf document or a jpeg image with a transformer? Well.. That is the real magic of my transformer.. ;-) No, it is actually not that complex. The sourcewritingtransformer and first use case for my savefilestransformer takes an xml fragment. But you need a stream to be able to write to a file. That is provided by a serializer (specified by the serializer attribute of the element that wrapped the fragment and) that is instantiated *inside* the transformer.. :-) During the parsing of the fragment, the events are passed to the serializer that writes to the output stream that I provided to it. At the end of the fragment, the serializer is disconnected and events continue their path through Cocoon. The second use case of my transformer interrupts the events to open a new input source which takes any url type that Cocoon can process, gets the input stream from the source and simply copies the input stream to the output stream. Because this does not involve a serializer, it can also handle binary streams.. :-) [Geert] Have you noted my remark about making internal calls? Something to keep in mind when using your serializer. When calling pipes internally, serializers are circumvented and that is most likely not what you want. [Zsombor] What kind of internal calls do you think? What is an internal call of the pipe? Internal calls use the cocoon protocol, eg: cocoon:/other-match-in-same-sitemap Or cocoon://path-from-root/match-in-other-sitemap If you have a pipeline that generates PDF with the fo2pdf serializer and call it from another through a generate using the cocoon protocol, the generater simply bypasses or replaces the serializer of the PDF generating pipeline! That is also the reason why using a reader on a cocoon pipeline (intentionally) does not work (though generating the result of a reader does work, or was it the other way around? I am always getting confused about it).. :-P Kind regards, Geert Drs. G.P.H. Josten Consultant Daidalos BV Source of Innovation Hoekeindsehof 1-4 2665 JZ Bleiswijk Tel.: +31 (0) 10 850 1200 Fax: +31 (0) 10 850 1199 www.daidalos.nl KvK 27164984 De informatie - verzonden in of met dit emailbericht - is afkomstig van Daidalos BV en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onbedoeld hebt ontvangen, verzoeken wij u het te verwijderen. Aan dit bericht kunnen geen rechten worden ontleend. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Free for use: SaveFilesTransformer
Can I ask why we need a simplified SourceWritingTransformer? Ofcourse you can: you just did.. :-) No, I don't think a simplified one is needed, but it is the second use case that is most interesting. Perhaps I should have said that it is *another* SourceWritingTransformer.. :-P Kind regards, Geert Drs. G.P.H. Josten Consultant Daidalos BV Source of Innovation Hoekeindsehof 1-4 2665 JZ Bleiswijk Tel.: +31 (0) 10 850 1200 Fax: +31 (0) 10 850 1199 www.daidalos.nl KvK 27164984 De informatie - verzonden in of met dit emailbericht - is afkomstig van Daidalos BV en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onbedoeld hebt ontvangen, verzoeken wij u het te verwijderen. Aan dit bericht kunnen geen rechten worden ontleend. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Output storing after Serializer
Hi there, i need you help. i will to store every Output(pdf html) after Serializer. i had look at source Writing Transformer but i dont understand how can i use it. Not that I want to suggest Cocoon isn't always the best tool whatever the job is, but if you want to store every output (or every one of particular file types) have you considered writing a Filter to do the job instead? All it needs to do is wrap the respose to capture the output to a byte array output stream, the write it to a file as well as the original servlet output stream... Andrew, that is exactly what the SourceWritingTransformer does, actually. Transformers ARE filters.. :-) Rachid, what you need is the following: Input for the transformer: source:write source:source{path to your output file}/source:source source:fragment {xml fragment needed by your serializer to be able to write PDF, most likely XSL-FO} /source:fragment /source:write Transformer definition: map:transform type=write-source map:parameter name=serializer value={your pdf serializer name}/ /map:transform A more elaborate explanation of this transformer can be found here: http://cocoon.apache.org/2.1/userdocs/sourcewriting-transformer.html But you do need to take some extra steps to get to the appropriate input for this transformer.. In older versions of Cocoon I would have written an XSLT that inserts the correct path, received through a parameter, set from the sitemap with {request-param:my-output-path}. The XSLT would also write an cinclude or xinclude instruction to get XSL-FO code into the fragment code. So that would mean an XSLT tranform and an include transform before the write-source transform. In the newer versions of Cocoon, JX templates might do the setting path and including XSL-FO in one single generate, so that would be nicer. But next to all this, there is also FlowScript and JavaFlow with which you can virtually anything as well. Depending on other things you need, you could switch to using that. Could be particularly interesting if you intend to process multiple files with a single call. Kind regards, Geert PS: I once wrote a simplified source-writing transformer that took a src and target attribute. It simply captured the stream of the src url and redirected to the target file. Because it doesn't do any XML processing, it was able to handle binary streams as well.. :) Never found the time to share it with the community. If there is still interest in this transformer, just point me to a place where I can leave it. Perhaps, somewhere on Cocoon Wiki if that is still alive? (sorry, have been out of the loop for a while) Drs. G.P.H. Josten Consultant Daidalos BV Source of Innovation Hoekeindsehof 1-4 2665 JZ Bleiswijk Tel.: +31 (0) 10 850 1200 Fax: +31 (0) 10 850 1199 www.daidalos.nl KvK 27164984 De informatie - verzonden in of met dit emailbericht - is afkomstig van Daidalos BV en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onbedoeld hebt ontvangen, verzoeken wij u het te verwijderen. Aan dit bericht kunnen geen rechten worden ontleend. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: RE: Output storing after Serializer
...If there is still interest in this transformer, just point me to a place where I can leave it. Perhaps, somewhere on Cocoon Wiki if that is still alive?... It is, and it's a good spot for relatively simple or specialized contributions, so feel free to put your code there. Can you give a suggestion where for instance? Somewhere that would make sense to others? Kind regards Drs. G.P.H. Josten Consultant Daidalos BV Source of Innovation Hoekeindsehof 1-4 2665 JZ Bleiswijk Tel.: +31 (0) 10 850 1200 Fax: +31 (0) 10 850 1199 www.daidalos.nl KvK 27164984 De informatie - verzonden in of met dit emailbericht - is afkomstig van Daidalos BV en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onbedoeld hebt ontvangen, verzoeken wij u het te verwijderen. Aan dit bericht kunnen geen rechten worden ontleend. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [OT] Abuse of div and span (was: Cocoon written in PHP)
In my opinion you are underestimating the usefulness of the semantics associated with these structural HTML elements, and are throwing away *too much* information in the pipeline. Surely there's no advantage to throwing away that information, is there? Just to add my 2 cents.. ;-) By using headings, paragraphs, etc, instead of div and span for everything, you give search engines the opportunity to distinguish them and give more importance to headings over paragraph text. :-) Kind regards, Geert Drs. G.P.H. Josten Consultant Daidalos BV Source of Innovation Hoekeindsehof 1-4 2665 JZ Bleiswijk Tel.: +31 (0) 10 850 1200 Fax: +31 (0) 10 850 1199 www.daidalos.nl KvK 27164984 De informatie - verzonden in of met dit emailbericht - is afkomstig van Daidalos BV en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onbedoeld hebt ontvangen, verzoeken wij u het te verwijderen. Aan dit bericht kunnen geen rechten worden ontleend. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: too many open files
I heard something about a Java bug that seemed to cause these kinds of errors. What version of Java are you using and what happens if you update to the latest version (if you are not yet using it?) Kind regards, Geert Drs. G.P.H. Josten Consultant Daidalos BV Source of Innovation Hoekeindsehof 1-4 2665 JZ Bleiswijk Tel.: +31 (0) 10 850 1200 Fax: +31 (0) 10 850 1199 www.daidalos.nl De informatie - verzonden in of met dit emailbericht - is afkomstig van Daidalos BV en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onbedoeld hebt ontvangen, verzoeken wij u het te verwijderen. Aan dit bericht kunnen geen rechten worden ontleend. Van: Bokluci Bokluci [mailto:[EMAIL PROTECTED] Verzonden: maandag 3 juli 2006 19:01 Aan: users@cocoon.apache.org Onderwerp: too many open files hi, from time to time my cocoon get this error message: Too Many Open Files Sometimes after refresh it continues work, but sometimes it needs to be restarted. Is there any way to fix this issue? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: server side validation using cocoon flow script
Pass the request parameters to your XSL and insert these as the 'initial' value of the input fields. You need a few steps to achieve this: - either call the xsl with: map:transform src=mytemplate.xsl map:parameter name=use-request-parameters value=true / /map:transform or pass each request-param as a separate parameter to the XSL call. - define an xsl:param name=my_request_param / for each of the request parameters in your XSL - define the input fields in your XSL like for instance: input type=text value={$my_request_param} / The request-parameters should boil through from initial request to the pipeline called with sendPage(AndWait).. Kind regards, Geert Drs. G.P.H. Josten Consultant Daidalos BV Source of Innovation Hoekeindsehof 1-4 2665 JZ Bleiswijk Tel.: +31 (0) 10 850 1200 Fax: +31 (0) 10 850 1199 www.daidalos.nl De informatie - verzonden in of met dit emailbericht - is afkomstig van Daidalos BV en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onbedoeld hebt ontvangen, verzoeken wij u het te verwijderen. Aan dit bericht kunnen geen rechten worden ontleend. Van: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Verzonden: vrijdag 30 juni 2006 11:56 Aan: users@cocoon.apache.org Onderwerp: server side validation using cocoon flow script Hi, I'm using cocoon 2.1.8. I am using HTML form inside my XSL's. ( I could have used CForms, but at this moment it will be a bigger change for me, as I have to change at many places. Too late to make this change. ). What I need : In this case i'm accessing request parameters from the form inside flow script function. If any of them is empty i have to send it back pre-filled with other choices that user has entered. Ex. If a form has 5 input fields, and user enters only first two then i have to show a error message alongwith already pre-filled choices 1 and 2 Here I'm able to validate and display the error message, but I can't show the page with pre-filled choices. Is there any way for doing this? Any inputs and suggestions are welcome. Thanks in advance, Rahul =-=-= Notice: The information contained in this e-mail message and/or attachments to it may contain confidential or privileged information. If you are not the intended recipient, any dissemination, use, review, distribution, printing or copying of the information contained in this e-mail message and/or attachments to it are strictly prohibited. If you have received this communication in error, please notify us by reply e-mail or telephone and immediately and permanently delete the message and any attachments. Thank you - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Urgent :break statement in xsl
Hi, Your question is actually better of on the Mulberry XSL list, but perhaps here something that will help you.. xsl:variable name=daslcatagorypath select='/nos'/ xsl:for-each select=details/dasl:query-result/dasl:resource xsl:if test=d:resourcetype='' xsl:variable name=daslfolderpathxsl:value-of select=@dasl:path//xsl:variable xsl:variable name=check select=substring-after($daslfolderpath,$daslcatagorypath)/ xsl:if test=$check!='' and $counter='1' xsl:variable name=size select=d:getcontentlength/ xsl:variable name=kb-size select=($size div 1000) - ($size mod 1000 div 1000)/ xsl:value-of select=$kb-size/xsl:text /xsl:textKB xsl:variable name=counter select='0'/ /xsl:if /xsl:if /xsl:for-each If you are only interested in one occurrence of a list of nodes, why not selecting just one, instead of looping over the list and triggering for one case? First of all, you can add the check statement into the select by putting it in a predicate: select=details/dasl:query-result/dasl:resource Becomes: select=details/dasl:query-result/dasl:resource[substring-after(@dasl:pa th, $daslcatagorypath)] And if you are only interested in the first (in document order), put the lot between braces and add [1] to the end: select=(details/dasl:query-result/dasl:resource[substring-after(@dasl:p ath, $daslcatagorypath)])[1] This expression always results in one node, ruling out the need for a for-each. That should circumvent your problem.. Kind regards, Geert Drs. G.P.H. Josten Consultant Daidalos BV Source of Innovation Hoekeindsehof 1-4 2665 JZ Bleiswijk Tel.: +31 (0) 10 850 1200 Fax: +31 (0) 10 850 1199 www.daidalos.nl De informatie - verzonden in of met dit emailbericht - is afkomstig van Daidalos BV en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onbedoeld hebt ontvangen, verzoeken wij u het te verwijderen. Aan dit bericht kunnen geen rechten worden ontleend. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Importing Hand-made Java Packages For Use in Flowscript
I've implemented the Flowscript idea but am getting the following error: org.mozilla.javascript.EvaluatorException: file:/c:/Development/martini-peel/cocoonproject/flowscript/ma rtini-flow.js, line 44: Not a Java class: [JavaPackage org.martini.search.PeelQueryComponent] I'm using: importClass(Packages.org.martini.search.PeelQueryComponent); To import my class. Are you sure that the required class is available to the Cocoon environment? E.g. is it in the Web-inf/classes/ tree or is it available as part of a jar in Web-inf/lib/? Grtz, Geert Drs. G.P.H. Josten Consultant Daidalos BV Source of Innovation Hoekeindsehof 1-4 2665 JZ Bleiswijk Tel.: +31 (0) 10 850 1200 Fax: +31 (0) 10 850 1199 www.daidalos.nl De informatie - verzonden in of met dit emailbericht - is afkomstig van Daidalos BV en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onbedoeld hebt ontvangen, verzoeken wij u het te verwijderen. Aan dit bericht kunnen geen rechten worden ontleend. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Urgent :break statement in xsl
Not entirely true.. You can always use the position() function, but it depends on the context list, what it actually returns. The context list corresponds more or less to the last issued for-each's select statement or apply-templates's select statement. Both select's return a node set, which is ordered according to supplied sort instructions or in document order by default. That is used as context list. What you need to do here to be able to use it, is to integrate your *outer* if statement with the for-each select statement. As mentioned before, you can add a predicate to your xpath. Inside the loop, you can do stuff like: xsl:for-each select=a/b/[EMAIL PROTECTED] = ''] xsl:if test=position() = 1 .. /xsl:if xsl:if test=position() = last() .. /xsl:if xsl:if test=not(position() = last()) .. /xsl:if /xsl:for-each You can also use the position() outside a for-each, but might appear to be confusing for others. By just looking at one template, you cannot say for sure whether comments and text nodes (like white-space) are counted as well or not. Cheers, Geert If you move your inner if-test into another template called with an apply-templates or call-template, you will be able to use the position() function. Drs. G.P.H. Josten Consultant Daidalos BV Source of Innovation Hoekeindsehof 1-4 2665 JZ Bleiswijk Tel.: +31 (0) 10 850 1200 Fax: +31 (0) 10 850 1199 www.daidalos.nl De informatie - verzonden in of met dit emailbericht - is afkomstig van Daidalos BV en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onbedoeld hebt ontvangen, verzoeken wij u het te verwijderen. Aan dit bericht kunnen geen rechten worden ontleend. From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 28, 2006 3:31 AM To: users@cocoon.apache.org Subject: Urgent :break statement in xsl Hi All, I am facing a problem in xsl.I am not sure whether it is possible in xsl or not. I have a xsl:for-each loop .I have a check condition in it.I want it to do something for the first time check condition is satisfied.After that it should not do anything.As i have a check condition in the loop i could not put [position=1] in the xsl:for-each loop.I tried with declaring a variable and decreamenting its value if the check condition is satisfied.But it is not happening. Basically i want to break the xsl:for-eachloop if one condition is satisfied. Below is the code. xsl:variable name=daslcatagorypath select='/nos'/ xsl:for-each select=details/dasl:query-result/dasl:resource xsl:if test=d:resourcetype='' xsl:variable name=daslfolderpathxsl:value-of select=@dasl:path//xsl:variable xsl:variable name=check select=substring-after($daslfolderpath,$daslcatagorypath)/ xsl:if test=$check!='' and $counter='1' xsl:variable name=size select=d:getcontentlength/ xsl:variable name=kb-size select=($size div 1000) - ($size mod 1000 div 1000)/ xsl:value-of select=$kb-size/xsl:text /xsl:textKB xsl:variable name=counter select='0'/ /xsl:if /xsl:if /xsl:for-each Can anyone suggest me the solution for it. Thanks Regards, Deepak Kumar Sahoo Tata Consultancy Services Limited Mailto: [EMAIL PROTECTED] Website: http://www.tcs.com ForwardSourceID:NT922A =-=-= Notice: The information contained in this e-mail message and/or attachments to it may contain confidential or privileged information. If you are not the intended recipient, any dissemination, use, review, distribution, printing or copying of the information contained in this e-mail message and/or attachments to it are strictly prohibited. If you have received this communication in error, please notify us by reply e-mail or telephone and immediately and permanently delete the message and any attachments. Thank you - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Is using Cocoon a good idea?
Hi Michael, XSLT might be nice for small applications, but it does not scale up. So in general template matching is a misconception for larger applications, in my opinion at least... As said by others, more or less, it is just a matter of discipline and optimally using all the features that the language provides. And it is very easy to do something rather trivial in an uncomprehensible way, at least for others. I have found it useful to localize clusters of templates with a dedicated task by adding a mode attribute to them, accompanying these 'groups' with a remainder template that jumps back to the mode-less templates (if that suits the purpose). That way, you can easily determine whether template are intended to be in the same scope or not, just by searching on the mode attribute. Might help you to deal with complex tasks in future... When using Java I like eclipse showing me code which is not used anywhere. When using this xslt thing I dont have anything like that? That is because the execution of a piece of Java code is more or less unambiguous. XSLT code execution can only be determined unambiguously once the input is known. And that is usually hardly predictable. A DTD or schema of the intermediate format will help only little. Besides, how do you know what elements to make obligatory and which ones not? Unfortunatily. :-( For the task you have at hand: I would suggest to follow up Peter Binkley's advice of adding xsl:message (terminate=no) statements and inspecting the logs. Mind though that part of the stylesheets might only be triggered in highly specific cases; element structures that occur scarcely, but represent some important, not often used functionality. As said by yourself, you might overlook something, but I think you will find this method reassuring. Good luck, Geert Drs. G.P.H. Josten Consultant Daidalos BV Source of Innovation Hoekeindsehof 1-4 2665 JZ Bleiswijk Tel.: +31 (0) 10 850 1200 Fax: +31 (0) 10 850 1199 www.daidalos.nl De informatie - verzonden in of met dit emailbericht - is afkomstig van Daidalos BV en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onbedoeld hebt ontvangen, verzoeken wij u het te verwijderen. Aan dit bericht kunnen geen rechten worden ontleend. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Using Cocoon when you don't have access to the $TOMCAT_HOME/common/endorsed directory.
Use Paranoid cocoonservlet. That gives higher priority to libs in web-inf/lib/ over app server and java libs.. Cheers, Geert Brian Maddy wrote: Hello, According to the page http://cocoon.apache.org/2.1/installing/index.html, Cocoon requires some Xerces and Xalan libraries to be placed in the $TOMCAT_HOME/common/endorsed directory. I don't believe our hosting provider provides us with access to this directory, so is there any way around this requirement? Couldn't I somehow include those libraries inside my cocoon.war file? Does anyone know, is it still a requirement to do this if we were using Tomcat 5.0 or 5.5? Thanks! Brian - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Drs. G.P.H. Josten Consultant Daidalos BV Source of Innovation Hoekeindsehof 1-4 2665 JZ Bleiswijk Tel: +31 (0) 10 850 1200 Fax: +31 (0) 10 850 1199 www.daidalos.nl De informatie - verzonden in of met dit emailbericht - is afkomstig van Daidalos BV en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onbedoeld hebt ontvangen, verzoeken wij u het te verwijderen. Aan dit bericht kunnen geen rechten worden ontleend. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: FOP pdf / gif image issue with Cocoon 2.1.8
Jonas Lundberg wrote: ... anyway, the reason I thought it was Cocoon, is that version 2.1.7 did not have this problem ... Hans map:match pattern=flow/readimage/**.gif map:read type=image mime-type=image/gif src=http://guest:[EMAIL PROTECTED]:serverName}:{request:serverPort}/cocoon/web dav/db/contents/gif/{1}.gif / /map:match Why are you issuing a full HTTP request and not simply calling cocoon://webdav/db/contents/gif/{1}.gif. That would certainly by-pass Tomcat or any other application framework. Regards, Geert - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Simple question concerning XSP and Java
You can configure a java compiler to be used in the cocoon.xconf. It is not using JDK by default, because of a memory leak. I believe there are several alternatives listed of which the active one is provided as a jar in the web-inf/lib/ Cheers, Geert Goetzmann Bertrand wrote: Hi again (the last question for this day I hope), I have a question about XSP used with Java langage ; I read in an article that a XSP containg Java code was transformed in Java source and then compiled to produce a .class file. Does this require that you must to have access to the javac command on the server executing Cocoon ? Or the Java code is compiled on the fly by the JRE ? Thank again ! Bertrand Goetzmann. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to asign a value to a variable??
The node-set is created by an XPath expression. Note the | that ORs your two cases. As you probably know by now, doing it in one go is the only way. Note: the | is a UNION operator, not an OR.. :-P - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Passing a parameter to flow from sitemap
This really sounds like a bug (or 'missing' feature). You'd best post it as a bug and/or contact the cocoon dev mailing list... Regards, Geert Derek Hohls wrote: Geert After further testing, it appears that : map:parameter name=userid value={session-attr:userID}/ only works when it called on OUTSIDE of authenticated pipelines(s). i.e. it is NOT accessible in this situation: map:act type=auth-protect map:parameter name=handler value=ind-handler/ map:match pattern=db/test-* map:generate src=docs/blank.xml/ map:transform src=stylesheets/page2html.xsl map:parameter name=userid value={session-attr:userID}/ /map:transform map:serialize type=html/ So; the question becomes how to access session attribute data inside of a protected pipeline (bearing in mind the user ID is needed to get into the pipeline in the first place!) Thanks Derek - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Passing a parameter to flow from sitemap
Perhaps. Are _all_ sessions attributes hidden within the 'protected' part? And what about request attributes for instance? You might be able to use session or request actions to store the userid under a different name in session or request context outside the protected part. If that doesn't help, try asking the dev list... Kind regards, Geert Derek Hohls wrote: Geert Thanks... any suggestion for a work-around in the meantime?? Thanks Derek - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Passing a parameter to flow from sitemap [SOLVED]
Hmmm, yes, I see what you mean. Looks a bit similar to the way on accesses global settings from a sitemap. It would be nicer if there was an input module for the authentication context settings, so you could replace {session-attr:userID} with for instance {authentication:ID}. Cheers, Geert PS: good search by the way! Derek Hohls wrote: Geert POST SCRIPT: I finally tracked down a fragment of code, posted by Stavros: http://marc.theaimsgroup.com/?l=xml-cocoon-usersm=111662268832339w=2 in which the userID is accessed without having to pass a parameter from the sitemap. The code looks complex and unwieldy (to my non- Java guru eye), but it works! Thanks Derek - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Passing a parameter to flow from sitemap [SOLVED]
I knew there had to be a simple answer, many thanx to Jean-Baptiste Quenot on the dev mailing list (in answer to a question from Derek Hohls): Why don't you use the session-context input module? Example: map:parameter name=userId value={session-context:authentication/authentication/ID}/ Or just: map:parameter name=userId value={ID}/ The above expression works because AuthAction (auth-protect) returns a map of parameters available in the sitemap. Cheers Geert Josten wrote: Hmmm, yes, I see what you mean. Looks a bit similar to the way on accesses global settings from a sitemap. It would be nicer if there was an input module for the authentication context settings, so you could replace {session-attr:userID} with for instance {authentication:ID}. Cheers, Geert PS: good search by the way! Derek Hohls wrote: Geert POST SCRIPT: I finally tracked down a fragment of code, posted by Stavros: http://marc.theaimsgroup.com/?l=xml-cocoon-usersm=111662268832339w=2 in which the userID is accessed without having to pass a parameter from the sitemap. The code looks complex and unwieldy (to my non- Java guru eye), but it works! Thanks Derek - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Drs. G.P.H. Josten Consultant Daidalos BV Source of Innovation Hoekeindsehof 1-4 2665 JZ Bleiswijk Tel: +31 (0) 10 850 1200 Fax: +31 (0) 10 850 1199 www.daidalos.nl De informatie - verzonden in of met dit emailbericht - is afkomstig van Daidalos BV en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onbedoeld hebt ontvangen, verzoeken wij u het te verwijderen. Aan dit bericht kunnen geen rechten worden ontleend. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Passing a parameter to flow from sitemap
If you want to pass 'global' parameters to flowscript, then you can define them as sitemap globals and access the global input module from flowscript. in sitemap: map:component-configurations myvarblabla/myvar /map:component-configurations !-- to pass to XSLT -- map:parameter name=myvar value={global:myvar} / in flowscript: importPackage(Packages.org.apache.cocoon.components.modules.input); var global = cocoon.getComponent(InputModule.ROLE + Selector).select(global); var myvar = global.getAttribute(myvar,null,null); Cheers, Geert Derek Hohls wrote: This should be a trivial operation, but is not working: As per the manual (http://cocoon.apache.org/2.1/userdocs/flow/sitemap.html), I have: Sitemap: map:script src=script/dbtest.js map:parameter name=test value=foo/ /map:script In dbtest.js: //param - below is line 33 var thisTest = cocoon.parameters.test; which results in this error: An Error Occurred Cannot convert null to an object. org.apache.avalon.framework.CascadingRuntimeException: Cannot convert null to an object. cause: TypeError: Cannot convert null to an object. (file:/.../dbtest.js; line 33) Any ideas how to succesfully pass a parameter to flow? Thanks Derek PS Running Cocoon 2.1.5, JDK 1.4.x -- Drs. G.P.H. Josten Consultant Daidalos BV Source of Innovation Hoekeindsehof 1-4 2665 JZ Bleiswijk Tel: +31 (0) 10 850 1200 Fax: +31 (0) 10 850 1199 www.daidalos.nl De informatie - verzonden in of met dit emailbericht - is afkomstig van Daidalos BV en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onbedoeld hebt ontvangen, verzoeken wij u het te verwijderen. Aan dit bericht kunnen geen rechten worden ontleend. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Passing a parameter to flow from sitemap
First of all you have to make sure there is a session object. You can create one with cocoon.session or with session actions I believe. To pass dynamic parameters to flowscript, add the map:parameter to the map:call statements: map:call function=myfunc map:parameter name=myvar value={session-attr:myattr} / /map:call And not to the map:script command! In flowscript you will need the following: function myfunc { var myvar = cocoon.parameters[myvar]; // or var myvar = cocoon.parameter.myvar; ... } Cheers, Geert - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Passing a parameter to flow from sitemap
function main { var thisUser = cocoon.parameters[userid]; var thisTest = cocoon.parameters[test]; ... } I pondered about this some time and the only thing I could think of is: case-sensitivity. And indeed, in the sitemap you are talking about userID and in the flowscript about userid. Does that help? I can't really imagine that it is a bug in the way parameters are handled by flowscript.. Kind regards, Geert - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to asign a value to a variable??
What are you trying to achieve? Christian Barth wrote: Hi! I want to define a global variable with no value. Then I want to asign a value to the variable in a choose-when-select. I think of something like this (but this one doesn't work): xsl:variable name=element / xsl:for-each select=* xsl:choose xsl:when test=local-name() = 'rettungswege' xsl:variable name=element select=rettungswege/rw / /xsl:when xsl:when test=local-name() = 'trennwaende' xsl:variable name=element select=trennwaende/trennwand / /xsl:when /xsl:choose /xsl:for-each xsl:for-each select=$element ...do something... /xsl:for-each Is this possible? Thanks, Barthi -- Drs. G.P.H. Josten Consultant Daidalos BV Source of Innovation Hoekeindsehof 1-4 2665 JZ Bleiswijk Tel: +31 (0) 10 850 1200 Fax: +31 (0) 10 850 1199 www.daidalos.nl De informatie - verzonden in of met dit emailbericht - is afkomstig van Daidalos BV en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onbedoeld hebt ontvangen, verzoeken wij u het te verwijderen. Aan dit bericht kunnen geen rechten worden ontleend. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: XSLT - How can I get the element name?
xsl:value-of select=local-name() / Cheers Christian Barth wrote: But is there a way to get the name of the Element automatically? Then I could fill in the table in a for-each-loop. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: What's wrong with my XSL??
You'd better revert to the xsl-list with these questions.. Anyhow: You have to wrap xsl:when and xsl:otherwise elements in a xsl:choose element to make them work. xsl:when test=local-name() = 'abweichungen' Besides: you can use test=self::abweichungen if your elements are not namespaced.. Cheers, Geert - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Dyamic datasource configuration (2.1.7) is this possible?
Errr, how dynamic is dynamic? I have worked on an implementation that uses JNDI internally and configures datasources in the webapp server (Oracle in this case.. :-P) In Oracle webserver you have the opportunity to define datasources on a maintenance webinterface. I'm not sure you can do that with Tomcat. What we more or less did in Tomcat for testing is define a Resource (with Params) and pointed to it with a ResourceLink in Host/Context. web.xml contains a resource-ref as well and some env-entry elements with additional information... By the way: the database management doesn't hook into any of the Cocoon's objects/lifecycle management parts in this case. It could have, but configuration would have been totally different, I guess.. HTH, Geert Rob Gregory wrote: Hello People, thanks in advance for any assistance… I am running Cocoon 2.1.7 under Tomcat 5.5.9 and have a desperate requirement to provide the database (datasources/connection pools) dynamically aka ‘on-the-fly’. After ‘Googling’ for about six months now and getting as far as Cocoon using the same connections provided to Tomcat by using the format:- j2ee name=logindb dbnamelogindb/dbname /j2ee Over my previous attempt of:- jdbc name=MyConnectionName pool-controller min=5 max=10/ dburljdbc:oracle:thin:@localhost:1521:mydatabase/dburl usermylogin/user passwordmyPassword/password /jdbc Any pointers towards creating or configuring the datasources available to actions esql would be great. Thanks Again. Rob -- Drs. G.P.H. Josten Consultant Daidalos BV Source of Innovation Hoekeindsehof 1-4 2665 JZ Bleiswijk Tel: +31 (0) 10 850 1200 Fax: +31 (0) 10 850 1199 www.daidalos.nl De informatie - verzonden in of met dit emailbericht - is afkomstig van Daidalos BV en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onbedoeld hebt ontvangen, verzoeken wij u het te verwijderen. Aan dit bericht kunnen geen rechten worden ontleend. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Dyamic datasource configuration (2.1.7) is this possible?
After posting I thought my description may be a little vague... (snip) Any keywords for Google or code samples are more than welcome in my pursuit to get this working... I'll just supply some code snippets, they might give you new ideas.. (or not) :-P One additional note: we decided to code pretty much all business logic in plain Java and connect to these classes from FlowScript. (that is really easy) Tomcat 5.0 server.xml config snippets (I removed customer specific details): ... GlobalNamingResources !-- 1. Define the global datasource (MYDS) -- Resource name=jdbc/MYDS auth=Container scope=Shareable type=javax.sql.DataSource/ (you can probably name as many as you like, but dynamically as in without restarting tomcat I don't know..) !-- 2. Define the datasource config params -- ResourceParams name=jdbc/MYDS parameter namedriverClassName/name valueoracle.jdbc.OracleDriver/value /parameter parameter nameurl/name valuejdbc:oracle:thin:@myoracleserver:myoracleport:myoracledbname/value /parameter parameter nameusername/name valuemyuser/value /parameter parameter namepassword/name valuemypassword/value /parameter parameter namemaxActive/name value20/value /parameter parameter namemaxIdle/name value10/value /parameter parameter namemaxWait/name value-1/value /parameter /ResourceParams /GlobalNamingResources ... Service name=Catalina Connector port=8080/ Engine name=Catalina defaultHost=localhost Logger className=org.apache.catalina.logger.FileLogger/ Realm className=org.apache.catalina.realm.UserDatabaseRealm resourceName=UserDatabase/ Host name=localhost appBase=webapps !-- 3. Define a resourcelink in the defaultcontext that links to the global datasource -- DefaultContext ResourceLink name=jdbc/MYDS global=jdbc/MYDS type=javax.sql.DataSource/ /DefaultContext !-- 4. Optional. Define an extra context that points to the webapps folder in the project-development environment (for easy reloading) -- Context path=/test_site docBase=C:\Projects\cocoon\webapp/ /Host /Engine /Service ... Cocoon's web.xml snippet: ... resource-ref res-ref-namejdbc/MYDS/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth /resource-ref env-entry env-entry-namedatasource.ref/env-entry-name env-entry-valuejdbc/MYDS/env-entry-value env-entry-typejava.lang.String/env-entry-type /env-entry env-entry env-entry-namedatabase.sortingkey.default/env-entry-name env-entry-value5-1;4-0;2-1/env-entry-value env-entry-typejava.lang.String/env-entry-type /env-entry ... Java code that creates a DataSource by looking up a setting from web.xml: ... Context context = new InitialContext(); Context env = (Context) context.lookup(java:comp/env); // lookup the datasource reference String dataSourceRef = (String) config.get(GPS_AS_DATASOURCE_REF); // get the datasource dataSource = (DataSource) env.lookup(dataSourceRef); ... The java-classes are wrapped in a jar, dropped in the web-inf/lib/ directory of Cocoon and in FlowScript we do an importPackage(Package.our.package.path) and create and access objects from them just as you would create and access any other class in Flowscript. So you see, this isn't really Cocoon-specific. Nor does it tell how to use the datasource from cocoon components. On the other hand. You could handle database connectivity solely in Flowscript and pass any data relevant to components to them through parameters and alike.. HTH, Geert - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: XSL-Problem. I can't find the error
Hi, It is a bit confusing that you are referring to XSP pages as .xsl files. Apart from that, your snippet looks okay on first impression. You are passing {request-param:typ} as a map:parameter to the relevant map:transforms, as far as I can see just from glancing at it. I do notice that you are using xinclude. Are you performing HTTP requests to Cocoon internally with Xinclude? If so, pass the query string on to it or simply call Cocoon through the cocoon protocol. Regards, Geert PS: would be nice if you could slim down the example. Christian Barth wrote: Hi! In the file* view_bsksuche_edit2.xsl* I'm calling the sitemap at *bs-portlets-suchergebnis.* From there I'm calling the xsl* view_bsksuche.xsl* where the problem occurs. I need the parameter typ which I'm passing to the pipeline via hidden field in view_bsksuche_edit2.xsl. The problem is, that cocoon doesn't recognize the parameter. And I don't know why! Could you please have a look. Thanks! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: XML parsing and map:handle-errors
Perhaps use the HTMLGenerator on the RSS feeds? You could also call your RSS reading pipes through the http stack and read that result, but I guess that makes the application quite slower. Cheers, Geert Alexander Nofftz wrote: Hi! I use the portal engine to aggregate some RSS feeds. If some newsfeed returns invalid XML, the whole portal isn't running anymore. Some newsfeed returned incorrectly some HTML 404 page containing a PUBLIC DOCTYPE without DTD reference. This breaks up everything. I tried to catch this via map:handle-errors but this doesn't work in this case. Regards, Alex - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: AW: Why doesn't this XSL work??
xsl:variable name=wand_ID select=Wand_id_Liste/wand_id/ Are you sure this expression results only one wand_id? xsl:if test=generate-id(.) = generate-id($wand_ID) You could use: string(.) = string($wand_ID) to be clearer. This also takes the first wand_id element from the $want_ID variable.. xsl:sort select=. order=ascending data-type=text/ Put the sort just below the xsl:for-each open tag. I think this error is masking other ones. xsl:for-each select=//[EMAIL PROTECTED]/Wand/Oeffnungs_Liste/Oeffnung Variable names are case sensitive: use $wand_ID instead of $wand_id. Cheers, Geert - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: AW: AW: Why doesn't this XSL work??
Your for-each loops all start with //, which mean that descendants are searched for through the entire document for each iteration in each loop. This is not only slow, but most likely explains your duplicates. Make the expressions relative by removing the // and adding some sub-path if necessary, or by adding a period in front of the //, e.g. './/etc'. Cheers Christian Barth wrote: Ok, thanks. I got a step further. I mean, I get a result and no error. -Ursprüngliche Nachricht- Von: Geert Josten [mailto:[EMAIL PROTECTED] Gesendet: Dienstag, 10. Januar 2006 16:02 An: users@cocoon.apache.org Betreff: Re: AW: Why doesn't this XSL work?? xsl:variable name=wand_ID select=Wand_id_Liste/wand_id/ Are you sure this expression results only one wand_id? This one returns several wand_ids, but I only want to test one of these. Isn't this correct this way? xsl:if test=generate-id(.) = generate-id($wand_ID) You could use: string(.) = string($wand_ID) to be clearer. This also takes the first wand_id element from the $want_ID variable.. xsl:sort select=. order=ascending data-type=text/ Put the sort just below the xsl:for-each open tag. I think this error is masking other ones. xsl:for-each select=//[EMAIL PROTECTED]/Wand/Oeffnungs_Liste/Oeffnung Variable names are case sensitive: use $wand_ID instead of $wand_id. Ok, I didn't see this one. Cheers, Geert The problem now is, that I see the resulting Trennwand three times instead of one time. Mysterious! Maybe a problem with the DB. Or can you find another mistake? Barthi - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to return xml from a flowscript?
It reads a Cocoon pipeline, which converts a Word HTML file to XML. Then it sends this as a string in a parameter, to a pipeline that processes it further. Why not read WordML? :) What I *would like* to do, is to send XML in the parameter, instead of a string. Is this possible? Does anyone have a solution for me? Isn't it easier to change your upload pipe to read an internal pipe directly? In short something like: pattern=cleanwhtm/** read and clean html using base and page parameters pattern=upload/** generate src=cocoon:/{1} !-- set upload header flags and serialize -- flowscript: sendPage(upload/cleanwhtm + base + page); HTH, Geert - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to return xml from a flowscript?
Thanks for the replies. The problem is that I then have use the xml in a pipeline that starts with an xquery generator (this is the pipeline I call from the flowscript): map:generate src=xq/discuss.xq type=xquery map:parameter name=cleanedxml value={flow-attribute:cleanxml}/ How is the xquery using the xml in the parameter? Is it an idea to have another pipe that *generates* the discuss.xq which has your cleanedxml fragment included somewhere? Cheers, Geert - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to return xml from a flowscript?
No, this is not what I meant. You can replace: src=xq/discuss.xq by: src=cocoon:/insert-whtm-in-query/discuss.xq/path-to-whtm And create an new pipeline that includes the cleaned whtm into your xquery instruction. :-) Jonas Lundberg wrote: The xquery stores the XML file in eXist. Thus, if I try to insert the xml file using an Xinclude in discuss.xq, and then use an xinclude transformer after generation, then it will be put there *after* the query is executed. Which is not useful in this case, since the XML is needed during execution. Regards Hans - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to return xml from a flowscript?
Err, perhaps switch to the XML syntax of the XQuery language? That should be available and I would be surprised if it is not supported. I believe there are converters that can translate one to the other.. Regards, Geert Jonas Lundberg wrote: That would work, if I could do it... But xqueries are not written in XML, so how can I then include the XML in a good place in my xquery? :-( Hans - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to return xml from a flowscript?
So, what you are saying now is that you cannot pass an xml document as a parameter in Cocoon, at all? What do you mean with xml document and what with parameter? The parameters you pass from FlowScript can contain any object type, but I'm pretty sure that map:parameter does not allow that. That is probably why you are inserting the XML itself as value of the parameter, with all the complications you already mentioned. I really think it is wise to reconsider you approach. You don't want to treat XML as an escaped string... I liked the suggestions of uploading the xml to eXist from FlowScript directly... Regards, Geert - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Problem writing generator
Are you using startPrefixMapping and endPrefixMapping to register the i18n namespace? Kind regards, Geert Marcel Rouwenhorst wrote: Hi, I have a problem writing a generator. I want to write a generator for exception handling. It should work something like the exception generator. The generator should create an output that looks like this (simplified): exception xmlns:i18n=http://apache.org/cocoon/i18n/2.1; i18n:text i18n:key=some_keytest/i18n:text /exception I get everything right except I can’t create xmlns:i18n=http://apache.org/cocoon/i18n/2.1” in the exception tag or any other tag. I use the org.xml.sax.ContentHandler to create the xml. In the same way as the exception generator does. Help is appreciated Marcel -- Drs. G.P.H. Josten Consultant Daidalos BV Source of Innovation Hoekeindsehof 1-4 2665 JZ Bleiswijk Tel: +31 (0) 10 850 1200 Fax: +31 (0) 10 850 1199 www.daidalos.nl De informatie - verzonden in of met dit emailbericht - is afkomstig van Daidalos BV en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onbedoeld hebt ontvangen, verzoeken wij u het te verwijderen. Aan dit bericht kunnen geen rechten worden ontleend. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Problem writing generator
What serializer are you using? Perhaps the problem is elsewhere. Your first code snippet looks okay to me... Cheers, Geert Marcel Rouwenhorst wrote: Thanks Geert for answering! I do use the startPrefixMapping and endPrefixMapping This are the two source code examples I tried: 1 -- handler.startPrefixMapping(i18n, I18nTransformer.I18N_NAMESPACE_URI); AttributesImpl attr = new AttributesImpl(); attr.addCDATAAttribute(I18nTransformer.I18N_NAMESPACE_URI, key, i18n: + key, some_key); handler.startElement(null, exception, exception, null); handler.startElement(I18nTransformer.I18N_NAMESPACE_URI, text, i18n:text, attr); handler.endElement(I18nTransformer.I18N_NAMESPACE_URI, text, i18n:text); handler.endElement(null, exception, exception); handler.endPrefixMapping(i18n); This example creates the following xml: exception i18n:text i18n:key=some_key/ /exception 2- If I change the following 2 lines handler.startPrefixMapping(xmlns, I18nTransformer.I18N_NAMESPACE_URI); attr.addCDATAAttribute(I18nTransformer.I18N_NAMESPACE_URI, i18n, xmlns:i18n, I18nTransformer.I18N_NAMESPACE_URI); This example creates the following xml: exception i18n:text xmlns:i18n=http://apache.org/cocoon/i18n/2.1; xmlns:i18n=http://apache.org/cocoon/i18n/2.1/ /exception You can see that there are 2 i18n:text xmlns:i18n=http://apache.org/cocoon/i18n/2.1; I get an error XML Parsing Error: duplicate attribute Thank you, Marcel -Oorspronkelijk bericht- Van: Geert Josten [mailto:[EMAIL PROTECTED] Verzonden: dinsdag 3 januari 2006 10:08 Aan: users@cocoon.apache.org Onderwerp: Re: Problem writing generator Are you using startPrefixMapping and endPrefixMapping to register the i18n namespace? Kind regards, Geert Marcel Rouwenhorst wrote: Hi, I have a problem writing a generator. I want to write a generator for exception handling. It should work something like the exception generator. The generator should create an output that looks like this (simplified): exception xmlns:i18n=http://apache.org/cocoon/i18n/2.1; i18n:text i18n:key=some_keytest/i18n:text /exception I get everything right except I can't create xmlns:i18n=http://apache.org/cocoon/i18n/2.1; in the exception tag or any other tag. I use the org.xml.sax.ContentHandler to create the xml. In the same way as the exception generator does. Help is appreciated Marcel - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Question About Generators Getting Called Twice
Let me guess: you are using a recent version of MSIE. I bet you won't see this behaviour with FireFox.. Cheers, Geert Sylvain Wallez wrote: Christopher Sun wrote: I am just playing around with Cocoon, both with XSP and writing my own custom generator. I just observed that it seems like Generators are getting called twice with the same instance of the Object. This was observed by throwing some System.err.println in my XSP, and by writing a simple generator that output messages to the log in the recycle(), generate(), and setup() methods. Is this intended/common behavior for Cocoon to run through a Generator twice or is my configuration not quite right? What method did you use to see this behaviour? Sylvain -- Drs. G.P.H. Josten Consultant Daidalos BV Source of Innovation Hoekeindsehof 1-4 2665 JZ Bleiswijk Tel: +31 (0) 10 850 1200 Fax: +31 (0) 10 850 1199 www.daidalos.nl De informatie - verzonden in of met dit emailbericht - is afkomstig van Daidalos BV en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onbedoeld hebt ontvangen, verzoeken wij u het te verwijderen. Aan dit bericht kunnen geen rechten worden ontleend. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Two XML files and one XSL file in Cocoon(Summary)
On a side note, which logkit logger do I have to enable if I want to see all caching activity from Cocoon ? I'm afraid some of my pipelines are still quite slow even with type=caching enabled, and I'd like to see what's going on behind the scene. Tried to use the profiling pipelines? (type=profile-caching or type=profile-noncaching) Cheers - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Accessing user agent within XSLT
You will have to pass the user agent information on from the sitemap to your xslt stylesheet, something like: map:transform src=path_to_xsl map:parameter name=user-agent value=... / /map:transform and in your xsl: xsl:param name=user-agent select='msie' / !-- note: 'msie' is the default -- How to access the user agent info? I am pretty sure you can get to it using the request input module. But perhaps someone can confirm? Regards, Geert Joseph Hill wrote: Hi, Is it possible to access either request headers or the browser selector from within an XSLT template? I want to all pages sent to MSIE to differ slightly from all pages sent to Mozilla/Netscape, and because I'm using a lot of pipelines, using a when/otherwise structure in every pipeline in my sitemap (which is the only way I know how to do it) would be extremely unwieldy. For example, I would like to do this: xsl:when $useragent = 'explorer' Crazy Explorer workaround /xsl:when xsl:otherwise Code according to W3C standard /xsl:otherwise Thanks, Joe Hill - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Drs. G.P.H. Josten Consultant Daidalos BV Source of Innovation Hoekeindsehof 1-4 2665 JZ Bleiswijk Tel: +31 (0) 10 850 1200 Fax: +31 (0) 10 850 1199 www.daidalos.nl De informatie - verzonden in of met dit emailbericht - is afkomstig van Daidalos BV en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onbedoeld hebt ontvangen, verzoeken wij u het te verwijderen. Aan dit bericht kunnen geen rechten worden ontleend. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]