[summary] reading xml from pipeline into a flow script
Jonathan's suggestion worked, so I thought I'd summarize the solution back to the list as a demo javascript flow script. function demo() { print getXML(http://localhost:8080/cocoon/mypipeline.xml;); } function getXML(urlStr) { // // return output of a pipeline as an xml string (and/or dom) // [NB. watch out for my app-specific parse settings below!] // var factory = Packages.javax.xml.parsers.DocumentBuilderFactory.newInstance(); factory.setValidating(false); // Prevent expansion of entity references factory.setExpandEntityReferences(false); // Configure it to ignore comments factory.setIgnoringComments(true); var document; var isvalid = true; try { document = factory.newDocumentBuilder().parse(urlStr); } catch (e) { isvalid = false; print(xml parse error: + e + \n); } var xmlStr; if (isvalid) { // Convert document to string var format = new Packages.org.apache.xml.serialize.OutputFormat(document); var strOut = new Packages.java.io.StringWriter(); var XMLSerial = new Packages.org.apache.xml.serialize.XMLSerializer(strOut,format); XMLSerial.serialize(document.getDocumentElement()); xmlStr = strOut.toString(); } return xmlStr; } Jonathan Spaeth wrote: One simple way of accomplishing this is to simply, define pipeline to generate, transform, and serialize the xml. Then, in the flowscript, simply use the jaxp dom api to load the generated xml: flow() { var document = Packages.javax.xml.parsers.DocumentBuilderFactory.newInstance().newDocumentBuilder().build(http://uri-to-xml-file); ... document.getDocumentElement(); // it is now a dom } -Original Message- From: Simon Price [mailto:[EMAIL PROTECTED] Sent: Saturday, June 28, 2003 3:25 PM To: [EMAIL PROTECTED] Subject: reading xml from pipeline into a flow script From within a flow script, I would like to read (or pass in) xml generated by a series of pipeline xslt transformations. Please could someone give me a pointer on how to do this? Cheers Simon --- Simon Price Institute for Learning and Research Technology University of Bristol 8-10 Berkeley Square Bristol BS8 1HH United Kingdom Direct: +44 (0)7071 226 720 Office: +44 (0)117 928 7193 Fax: +44 (0)117 928 7112 [EMAIL PROTECTED] http://www.ilrt.bristol.ac.uk - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- --- Simon Price Institute for Learning and Research Technology University of Bristol 8-10 Berkeley Square Bristol BS8 1HH United Kingdom Direct: +44 (0)7071 226 720 Office: +44 (0)117 928 7193 Fax: +44 (0)117 928 7112 [EMAIL PROTECTED] http://www.ilrt.bristol.ac.uk - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: reading xml from pipeline into a flow script
Thanks. I was glad of any solution at midnight on saturday, but I'll watch to see how the fom evolves as you advise. Thanks. Simon Reinhard Pötz wrote: This will work but not with the upcoming Flow Object Model. You won't have access to the environment any more. If you are interested in the FOM you find a reference here: http://wiki.cocoondev.org/Wiki.jsp?page=FOM (be aware that this is a working document and may change!!!) So currently the easiest way is { ... var uri = cocoon://blablabla; var resolver = cocoon.componentManager.lookup( Packages.org.apache.cocoon.environment.SourceResolver.ROLE ); var srce = resolver.resolveURI( uri ); cocoon.componentManager.release( resolver ); var dom = Packages.org.apache.cocoon.components.source.SourceUtil.toDOM( srce ); ... } which will probably change with FOM to { ... var uri = cocoon://blablabla; var resolver = cocoon.getComponent( Packages.org.apache.cocoon.environment.SourceResolver.ROLE ); var srce = resolver.resolveURI( uri ); // release of the component (not defined yet var dom = Packages.org.apache.cocoon.components.source.SourceUtil.toDOM( srce ); ... } Hope this helps! Reinhard -Original Message- From: Frank Taffelt [mailto:[EMAIL PROTECTED] Sent: Monday, June 30, 2003 9:34 AM To: [EMAIL PROTECTED] Subject: Re: reading xml from pipeline into a flow script you can use this snippet: function getString(src) { try { var is = cocoon.environment.resolveURI(src).getInputStream(); return Packages.org.apache.cocoon.components.language.markup.xsp.XSPU til.getContent s(is); } catch(ex) { print(ex: + ex); } return null; } - 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] -- --- Simon Price Institute for Learning and Research Technology University of Bristol 8-10 Berkeley Square Bristol BS8 1HH United Kingdom Direct: +44 (0)7071 226 720 Office: +44 (0)117 928 7193 Fax: +44 (0)117 928 7112 [EMAIL PROTECTED] http://www.ilrt.bristol.ac.uk - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Woody textareas?
Cocoon's form handling is (imho) it's weakest area at present although it is rapidly improving with the interplay between flow and xmlform. Unless your app is simple, I'd recommend not wasting time on the simple form validator and db actions. Pure xmlforms where you end up writing java code for each form is elegant but time consuming. I've not looked in detail at woody. However, I'd strongly recommend that you take a look at the petstore sample. This uses javascript as the interface to the persistence layer part of your model and (to my taste) a really easy to understand but flexible logic layer in a separate javascript file. The sample has switchable view layers that can be velocity/xslt/jxpath/jsomethingelse. The velocity vesion is very clean and easy to read (but there again, I used to be an assembler programmer!). Use is made of xmlform - with validation done in either schematron and/or javascript. Cheers Simon Luke Penca wrote: Are textareas implemented in Woody yet? I cannot find anything in the (oh so sparse) documentation. Furthermore, has anyone used Woody extensively yet? (I know, I know, it's alpha at this point but I need some serious forms handling.) Should I be considering Xforms instead? Who got some experience getting their hands bloodied with forms in Cocoon? I'm ever anxious to find out. Thanks in advance, Luke. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- --- Simon Price Institute for Learning and Research Technology University of Bristol 8-10 Berkeley Square Bristol BS8 1HH United Kingdom Direct: +44 (0)7071 226 720 Office: +44 (0)117 928 7193 Fax: +44 (0)117 928 7112 [EMAIL PROTECTED] http://www.ilrt.bristol.ac.uk - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
reading xml from pipeline into a flow script
From within a flow script, I would like to read (or pass in) xml generated by a series of pipeline xslt transformations. Please could someone give me a pointer on how to do this? Cheers Simon --- Simon Price Institute for Learning and Research Technology University of Bristol 8-10 Berkeley Square Bristol BS8 1HH United Kingdom Direct: +44 (0)7071 226 720 Office: +44 (0)117 928 7193 Fax: +44 (0)117 928 7112 [EMAIL PROTECTED] http://www.ilrt.bristol.ac.uk - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Best practices for validating request params?
You may want to take a look at the (from my dodgy memory) req-params action which does a simple existential check on request parameters. There's an example of its use in the modular database sample code's sitemap. Cheers Simon Sonny Sukumar wrote: Hi guys, I was wondering what the best way is to validate request parameters. I have a few questions: 1.) What is the best way to validate the *existence* of all expected request params (both for simple queries and for posting form data)? By this, I mean I'd ideally like to notify the client if any request param wasn't sent. I was thinking I could write a dedicated action to do this validation before another action extracts/formats the values. 2.) Do you think it is even a good practice to take the time/effort/cpu power to validate that all expected request params were sent and notify the client if they were not? Otherwise, my action that extracts/formats the values would just end up throwing things like NullPointerExceptions, NumberFormatExceptions, etc. when it tries to extract/format the values. This doesn't seem very elegant at all to me, even if I do wrap them in ProcessingExceptions before throwing them. One other reason I don't want to throw these seemingly odd and random exceptions is because they'll just give a stack trace that says my code failed on Line XXX. On my team we have another development group that is working on buiding the actual XHTML webpages and making sure they work with the backend. So these sorts of exceptions and stack traces won't help them at all to figure out what went wrong. If I notify them they forgot a param, they can say Oh , I forgot to pass the XYZ param--that's why it's failing and fix their XHTML code in short order. I'm interested to hear all of your thoughts! Thanks, Sonny _ STOP MORE SPAM with the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=features/junkmail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- --- Simon Price Institute for Learning and Research Technology University of Bristol 8-10 Berkeley Square Bristol BS8 1HH United Kingdom Direct: +44 (0)7071 226 720 Office: +44 (0)117 928 7193 Fax: +44 (0)117 928 7112 [EMAIL PROTECTED] http://www.ilrt.bristol.ac.uk - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
how to configure cocoon to spot sitemap changes without restarting
I've not used cocoon for 3-4 months but I've just downloaded and got the new 2.1 head running. There's some nice improvements - well done. Last time I used cocoon I had to make some changes in cocoon.xconf so that any edits to the sitemap were detected without a restart. However, the notes I made at the time no longer match what's now in xconf. Is there an up-to-date guide somewhere on how to configure cocoon for development? What are the best settings for caches, reloads etc. for easing development? Thanks in advance Simon --- Simon Price Institute for Learning and Research Technology University of Bristol 8-10 Berkeley Square Bristol BS8 1HH United Kingdom Direct: +44 (0)7071 226 720 Office: +44 (0)117 928 7193 Fax: +44 (0)117 928 7112 [EMAIL PROTECTED] http://www.ilrt.bristol.ac.uk - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faq/index.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: how to configure cocoon to spot sitemap changes without restarting
Thanks Jeff. Wiki is really useful. I've also hit the cache related bug you mentioned today but having just come back to cocoon I assumed it was something I'd done wrong :-) Simon On Fri, Jan 24, 2003 at 02:07:16PM +, Simon Price wrote: I've not used cocoon for 3-4 months but I've just downloaded and got the new 2.1 head running. There's some nice improvements - well done. Last time I used cocoon I had to make some changes in cocoon.xconf so that any edits to the sitemap were detected without a restart. However, the notes I made at the time no longer match what's now in xconf. I think that applies to the old compiled sitemap. The interpreted sitemap in 2.1 reloads automatically (and quickly) when it is modified, without conf tweaks. Btw, if you're using CVS head, watch out for this bug: http://nagoya.apache.org/bugzilla/show_bug.cgi?id=16248 and also for Attempted to retrieve component with null hint errors.. the sitemap sytax changed (eg. map:pipelines - map:pipes) since 2.0.x. Is there an up-to-date guide somewhere on how to configure cocoon for development? There's a Wiki with lots of good stuff.. http://wiki.cocoondev.org/Wiki.jsp --Jeff What are the best settings for caches, reloads etc. for easing development? Thanks in advance Simon - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faq/index.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --- Simon Price Institute for Learning and Research Technology University of Bristol 8-10 Berkeley Square Bristol BS8 1HH United Kingdom Direct: +44 (0)7071 226 720 Office: +44 (0)117 928 7193 Fax: +44 (0)117 928 7112 [EMAIL PROTECTED] http://www.ilrt.bristol.ac.uk - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faq/index.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
2.1 CVS still broken?
I'm still getting blank pages and the following error from the latest cvs. Is this just me or is anyone else seeing this at the moment? Better still, does anyone know the cure please? ERROR (2002-10-02) 21:21.05:864 [access] (Unknown-URI) Unknown-thread/CocoonServlet: Cocoon servlet threw an Exception while trying to close stream. java.io.IOException: Cannot find message associated with key 'responseStream.suspended' at org.apache.catalina.connector.ResponseStream.flush(ResponseStream.java:237) etc... The sitemap is translating the addresses into something sensible because localhost:8080/cocoon is getting mapped to http://localhost:8080/cocoon/documents/index.html;. However, the problem is resulting in just a skeletal blank html document coming back to the browser. Thanks Simon-life-is-too-short-for-this-Price --- Simon Price Institute for Learning and Research Technology University of Bristol 8-10 Berkeley Square Bristol BS8 1HH United Kingdom Direct: +44 (0)7071 226 720 Office: +44 (0)117 928 7193 Fax: +44 (0)117 928 7112 [EMAIL PROTECTED] http://www.ilrt.bristol.ac.uk - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faq/index.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: 2.1 CVS still broken?
I've upgraded Tomcat from 4.0.1 to 4.1.12 and 2.1 dev started working again. Thanks to Mark for his message which gave me the clue. Simon Simon Price wrote: I'm still getting blank pages and the following error from the latest cvs. Is this just me or is anyone else seeing this at the moment? Better still, does anyone know the cure please? ERROR (2002-10-02) 21:21.05:864 [access] (Unknown-URI) Unknown-thread/CocoonServlet: Cocoon servlet threw an Exception while trying to close stream. java.io.IOException: Cannot find message associated with key 'responseStream.suspended' at org.apache.catalina.connector.ResponseStream.flush(ResponseStream.java:237) etc... The sitemap is translating the addresses into something sensible because localhost:8080/cocoon is getting mapped to http://localhost:8080/cocoon/documents/index.html;. However, the problem is resulting in just a skeletal blank html document coming back to the browser. Thanks Simon-life-is-too-short-for-this-Price --- Simon Price Institute for Learning and Research Technology University of Bristol 8-10 Berkeley Square Bristol BS8 1HH United Kingdom Direct: +44 (0)7071 226 720 Office: +44 (0)117 928 7193 Fax: +44 (0)117 928 7112 [EMAIL PROTECTED] http://www.ilrt.bristol.ac.uk - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faq/index.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- --- Simon Price Institute for Learning and Research Technology University of Bristol 8-10 Berkeley Square Bristol BS8 1HH United Kingdom Direct: +44 (0)7071 226 720 Office: +44 (0)117 928 7193 Fax: +44 (0)117 928 7112 [EMAIL PROTECTED] http://www.ilrt.bristol.ac.uk - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faq/index.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
2.1 HEAD: Cannot find message associated with key 'responseStream.suspended'
Is the current 2.1 HEAD broken? I've just checked out the cvs head and built with -Dinclude.webapp.libs=yes -Dinclude.scratchpad=yes installwar (as I normally do) and deleted the tomcat work and cocoon dirs. When I try to access localhost:8080/cocoon I get the following error in the log... ERROR (2002-10-01) 13:10.04:292 [access] (Unknown-URI) Unknown-thread/CocoonServlet: Cocoon servlet threw an Exception while trying to close stream. java.io.IOException: Cannot find message associated with key 'responseStream.suspended' at org.apache.catalina.connector.ResponseStream.flush(ResponseStream.java:237) at SNIP I've built and am running with jdk1.4 and tomcat 4.0.3 I'm probably doing something daft, but I've not seen this problem before. Any suggestions most welcome. Cheers Simon --- Simon Price Institute for Learning and Research Technology University of Bristol 8-10 Berkeley Square Bristol BS8 1HH United Kingdom Direct: +44 (0)7071 226 720 Office: +44 (0)117 928 7193 Fax: +44 (0)117 928 7112 [EMAIL PROTECTED] http://www.ilrt.bristol.ac.uk - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faq/index.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: XMLForm stylesheet change suggestion
Okay. Ivelin Ivanov wrote: This should be a minor patch to the transformer. Do you want to submit it in buzilla? - Original Message - From: Simon Price [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, September 20, 2002 4:13 AM Subject: Re: XMLForm stylesheet change suggestion XForms 1.0 also includes help and hint elements for every control. They can be used to give the user extra information about a control. Its up to the UI renderer as to how this information is displayed, although the spec gives some guidance. Simon Ivelin Ivanov wrote: Phil, Sorry it took me a while to respond, I am having some problems with the 2.1 build. The XForms spec mandates one caption/ sub element. I think if you need additional text, you can use other custom tags from your own namespace. xf:textbox xf:captionMy field/xf:caption additionalElementCustom Text/additionalElement /xf:textbox Another option is to not set display text directly in the caption tag, but instead specify a lookup key like my.field which is then replaced via i18n tags. As far as wizard2html.xsl is concerned, it is only intended as a demo. xmlform2html.xsl on the other hand should be generic. Looking forward to your comments, Ivelin - Original Message - From: Phil [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, September 16, 2002 11:09 PM Subject: Re: XMLForm stylesheet change suggestion That does take care of the phantom text, but what if someone wanted some additional text on the form. The patch that I posted is based on the assumption that someone would not want a double post of the first caption, but any additional captions they would want to see. With the patch that is in cvs, what element would you use to go about getting additional text into the form (current problem I am working on)? Also, is the wizard2html.xsl supposed to be app specific or general to all xmlform apps? Thanks, Phil On Monday 16 September 2002 08:41 pm, Ivelin Ivanov wrote: Thanks for reminding me that this is an outstanding bug. I have applied a patch and closed it. It is a little different than yours, but it achieves the same effect. Please do a diff and let me know if you think the patch won't work. http://nagoya.apache.org/bugzilla/show_bug.cgi?id=9716 Best, Ivelin - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, September 16, 2002 9:46 PM Subject: XMLForm stylesheet change suggestion I have a change for the file wizard2html.xsl which will remove the caption that appears on the side of the page. If someone would tell me the proper way to submit this information in the future, I would be happy to comply. original code: xsl:for-each select=*[name() != 'xf:submit'] xsl:choose xsl:when test=name() = 'error'/ xsl:when test=xf:* xsl:apply-templates select=./ /xsl:when xsl:otherwise xsl:copy-of select=./ /xsl:otherwise /xsl:choose /xsl:for-each modified code: xsl:for-each select=*[name() != 'xf:submit'] xsl:choose xsl:when test=name() = 'error'/ !-- start new code -- xsl:when test=name() = 'xf:caption' xsl:if test=count(parent::node()/xf:caption) 1 xsl:if test=parent::node()/xf:caption[1] != . tr td align=center colspan=3 xsl:value-of select=./ /td /tr tr td colspan=3 /td /tr /xsl:if /xsl:if /xsl:when !-- end new code -- xsl:when test=xf:* xsl:apply-templates select=./ /xsl:when xsl:otherwise xsl:copy-of select=./ /xsl:otherwise /xsl:choose /xsl:for-each tr td align=center colspan=3 xsl:for-each select=*[name() = 'xf:submit'] xsl:copy-of select=. / xsl:text /xsl:text /xsl:for-each - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faq/index.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faq/index.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Please check that your question has not already been answered in the FAQ before posting. http
Re: XMLForm stylesheet change suggestion
been answered in the FAQ before posting. http://xml.apache.org/cocoon/faq/index.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- --- Simon Price Institute for Learning and Research Technology University of Bristol 8-10 Berkeley Square Bristol BS8 1HH United Kingdom Direct: +44 (0)7071 226 720 Office: +44 (0)117 928 7193 Fax: +44 (0)117 928 7112 [EMAIL PROTECTED] http://www.ilrt.bristol.ac.uk - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faq/index.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
possible bug in pipeline/transformer?
I'm seeing some strange behaviour when I use an XSLT stylesheet generated on the fly by cocoon. Unless I reference the generated xsl in the pipeline before using it as a transformer src I get a null pointer exception on the transformer (the one labelled DEBUG below). Hence the pointless map:part hack below. map:match pattern=bind-*.xsl map:generate src=model/{1}.xml/ map:transform src=model/makebinder.xsl/ map:serialize type=xml/ /map:match map:match pattern=*.html map:aggregate element=doc !-- HACK: I don't want this here but it makes the transform work!-- map:part src=cocoon:/bind-staff_model.xsl/ map:part src=model/staff_model.xml/ map:part src=xforms/{1}.xml/ /map:aggregate map:transform src=model/selectmodels.xsl/ map:transform src=cocoon:/bind-staff_model.xsl label=DEBUG/ Is this a bug? I can't find anything about it in bugzilla or on the list. Thoughts/suggestions welcomed. There's nothing wrong with the stylesheet itself - if I save the xml it produces as a file and then use that as the transform src it all works fine without the hack. VERSION INFO: cocoon 2.1 (HEAD of about 2 weeks ago), jdk1.3.1, tomcat 4.0.1 Cheers Simon --- Simon Price Institute for Learning and Research Technology University of Bristol 8-10 Berkeley Square Bristol BS8 1HH United Kingdom Direct: +44 (0)7071 226 720 Office: +44 (0)117 928 7193 Fax: +44 (0)117 928 7112 [EMAIL PROTECTED] http://www.ilrt.bristol.ac.uk - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faq/index.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: XMLForm data stored/retrieved via Session Transformer?
Ivelin Ivanov wrote: XMLForm currently supports JavaBeans, DOM and mixed models. You can look at the Feedback Wizard demo for example. I will look again, but it was not obvious to me how to pass a DOM model. How do you mean that people will be using forms without writing Java code. We can write another Action to take as parameter a file name with the XML model, however how you you handle the input data once submitted. How would you implement the logic for handling the input data? This has been requested before, but noone has suggested a better replacement for Java when it comes to writing general purpose logic. Schematron could still be used to do validation. XSLT could operate on the model instance (built from the request) to so simple logic. I agree Java is better for complex logic, but XSLT would be a nice halfway between the modular database actions approach and the full XML Forms + JB approach. I'll try and work my ideas up into a full example to show what I'm thinking of. Another idea might be to use the flow engine to do some of the validation/processing. Although I don't think this would scale well, it would be a practical entry point for people moving from clientside to serverside - they could make use of their javascript skills and then later move on to java. Simon Ivelin - Original Message - From: Simon Price [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Sunday, September 08, 2002 2:45 PM Subject: Re: XMLForm data stored/retrieved via Session Transformer? Support for Alan's suggestion of a model in XML format I'm pretty certain that JXPath can be used with a DOM object so it should be possible for XMLForms to support both JBs and XML as the model. Personally, I really like the idea of being able to create and manipulate the model without having to drop into Java. For many simple forms, its seems like complete overkill having to write beans. Irrespective of what I think, there's a strong argument for having an XML model: new Cocoon users and non-Java programmers will be able to take advantage of XML Forms. Cheers Simon --- Simon Price Institute for Learning and Research Technology University of Bristol 8-10 Berkeley Square Bristol BS8 1HH United Kingdom Direct: +44 (0)7071 226 720 Office: +44 (0)117 928 7193 Fax: +44 (0)117 928 7112 [EMAIL PROTECTED] http://www.ilrt.bristol.ac.uk - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faq/index.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: XMLForm data stored/retrieved via Session Transformer?
Support for Alan's suggestion of a model in XML format I'm pretty certain that JXPath can be used with a DOM object so it should be possible for XMLForms to support both JBs and XML as the model. Personally, I really like the idea of being able to create and manipulate the model without having to drop into Java. For many simple forms, its seems like complete overkill having to write beans. Irrespective of what I think, there's a strong argument for having an XML model: new Cocoon users and non-Java programmers will be able to take advantage of XML Forms. Cheers Simon PS. I'm still pretty new to Cocoon and so, despite having looked at the source for XML Forms, I would not be surprised to find that its already possible. If it is, I'd love to know how! PPS. Thanks to Ivelin for the new itemset tag. --- Simon Price Institute for Learning and Research Technology University of Bristol 8-10 Berkeley Square Bristol BS8 1HH United Kingdom Direct: +44 (0)7071 226 720 Office: +44 (0)117 928 7193 Fax: +44 (0)117 928 7112 [EMAIL PROTECTED] http://www.ilrt.bristol.ac.uk - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faq/index.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: continuations tag and ExtendedComponentSelector questions (cocoon.xconf)
Barbara Post wrote: 1. What is this is cocoon.xconf ? Session timeout ? : continuations time-to-live=3600/ Continuations are, in effect, a type of session and so I would expect this to be the session timeout - ie. the no. seconds that cocoon keeps the suspended flow program state (stack state, variables, etc.). Just guessing. Simon --- Simon Price Institute for Learning and Research Technology University of Bristol 8-10 Berkeley Square Bristol BS8 1HH United Kingdom Direct: +44 (0)7071 226 720 Office: +44 (0)117 928 7193 Fax: +44 (0)117 928 7112 [EMAIL PROTECTED] http://www.ilrt.bristol.ac.uk - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faq/index.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[SUMMARY] problems generating input to sql transformer with stylesheet (a la Langham Ziegeler book)
Adding this line to the stylesheet fixes the bug. xsl:output method=text/ In fact the problem turned out to have absolutely nothing to do with the sql transformer; the problem was earlier in the pipeline but was masked because the xml piped into the transformer appeared okay when inspected using a view. However, although it serializes and displays in the browser, any attempt to transform the subsequent xml that comes out of the stylesheet creates an error. I only discovered this when I started shortening the pipeline and also found that if I cut+pasted the xml from the stylesheet transformation into a text file, it worked fine if loaded by a file generator and immediately piped into the sql transformer! I assume its a bug in one of cocoon's components. Go figure :-( Simon Simon Price wrote: Ah! That's good to know. I can't use Java 1.4.1 because of the old Oracle 8i JDBC driver I'm using but I will try running it under cocoon 2.0.3 to see if its a 2.1 bug. Thanks again. Simon Koen Pellegrims wrote: oops, I just ran your example on my machine, and it ran like a charm :-s I must say I'm running tomcat 4.0.4, cocoon 2.0.3 on java 1.4.0... Koen -Oorspronkelijk bericht- Van: Simon Price [mailto:[EMAIL PROTECTED]] Verzonden: vrijdag 30 augustus 2002 14:53 Aan: [EMAIL PROTECTED] Onderwerp: Re: problems generating input to sql transformer with stylesheet (a la Langham Ziegeler book) Koen, thanks but I already tried this. The resultant xml using your stylesheet is... ?xml version=1.0 encoding=UTF-8? user xmlns:xmlns:sql=http://apache.org/cocoon/SQL/2.0; xmlns=http://apache.org/cocoon/SQL/2.0; ecsnp/ Price/ Simon/ / / /user It sort of works but, for some reason, the rowset, row and column name tags get omitted by the sql transformer!!! In case it helps anyone say why this is, here's the intermediate xml from the stylesheet, before it goes into the sql transformer... ?xml version=1.0 encoding=UTF-8? user xmlns:sql=http://apache.org/cocoon/SQL/2.0; sql:execute-query sql:use-connectionpool-TAL/sql:use-connection sql:query select USERNAME, SURNAME, INITIALS from STAFF where STAFFID = '24' /sql:query /sql:execute-query /user Koen Pellegrims wrote: try your stylesheet as follows: ?xml version=1.0? xsl:stylesheet version=1.0 xmlns:xsl=http://www.w3.org/1999/XSL/Transform; xmlns:sql=http://apache.org/cocoon/SQL/2.0; xsl:template match=bootstrap user sql:execute-query sql:use-connectionpool-TAL/sql:use-connection sql:query select USERNAME, SURNAME, INITIALS from STAFF where STAFFID = '24' /sql:query /sql:execute-query /user /xsl:template /xsl:stylesheet this is exactly the same approach you would take to generate fo, for example. Koen. -Oorspronkelijk bericht- Van: Simon Price [mailto:[EMAIL PROTECTED]] Verzonden: vrijdag 30 augustus 2002 13:03 Aan: [EMAIL PROTECTED] Onderwerp: problems generating input to sql transformer with stylesheet (a la Langham Ziegeler book) I'm having real problems doing a trivial tranformation (in the style of Matthew and Carsten's excellent book). I generate xml which then gets transformed by the sql transformer. Unfortunately, it only works if I have no containing elements in the input to the transformer. I'm guessing its related to the namespace? Or is it a bug in the sql transformer? Any suggestions welcomed! Here's the full details (stripped down to simplest repro so please don't worry about the stylesheet now being pointless)... version info: tomcat 4.0.1 java 1.3.1 cocoon 2.1 head sitemap fragment: map:match pattern=test3.xml map:generate src=model/bootstrap.xml/ map:transform src=model/staff_model.xsl/ map:transform type=sql/ map:serialize type=xml/ /map:match model/bootstrap.xml: ?xml version=1.0? bootstrap/ model/staff_model.xsl ?xml version=1.0? xsl:stylesheet version=1.0 xmlns:xsl=http://www.w3.org/1999/XSL/Transform; xmlns:sql=http://apache.org/cocoon/SQL/2.0; xsl:template match=bootstrap user execute-query xmlns=http://apache.org/cocoon/SQL/2.0; use-connectionpool-TAL/use-connection query select USERNAME, SURNAME, INITIALS from STAFF where STAFFID = '24' /query /execute-query /user /xsl:template /xsl:stylesheet error in browser (reformatted by hand to make more readable): Multiple colons are not allowed in a name. Error processing resource 'http://localhost:8080/cocoon/tal/admin/test3.xml'. Line 2, Position 18 user xmlns:xmlns:sql
problems generating input to sql transformer with stylesheet (a la Langham Ziegeler book)
I'm having real problems doing a trivial tranformation (in the style of Matthew and Carsten's excellent book). I generate xml which then gets transformed by the sql transformer. Unfortunately, it only works if I have no containing elements in the input to the transformer. I'm guessing its related to the namespace? Or is it a bug in the sql transformer? Any suggestions welcomed! Here's the full details (stripped down to simplest repro so please don't worry about the stylesheet now being pointless)... version info: tomcat 4.0.1 java 1.3.1 cocoon 2.1 head sitemap fragment: map:match pattern=test3.xml map:generate src=model/bootstrap.xml/ map:transform src=model/staff_model.xsl/ map:transform type=sql/ map:serialize type=xml/ /map:match model/bootstrap.xml: ?xml version=1.0? bootstrap/ model/staff_model.xsl ?xml version=1.0? xsl:stylesheet version=1.0 xmlns:xsl=http://www.w3.org/1999/XSL/Transform; xmlns:sql=http://apache.org/cocoon/SQL/2.0; xsl:template match=bootstrap user execute-query xmlns=http://apache.org/cocoon/SQL/2.0; use-connectionpool-TAL/use-connection query select USERNAME, SURNAME, INITIALS from STAFF where STAFFID = '24' /query /execute-query /user /xsl:template /xsl:stylesheet error in browser (reformatted by hand to make more readable): Multiple colons are not allowed in a name. Error processing resource 'http://localhost:8080/cocoon/tal/admin/test3.xml'. Line 2, Position 18 user xmlns:xmlns:sql=http://apache.org/cocoon/SQL/2.0; -^ rowset xmlns=http://apache.org/cocoon/SQL/2.0; xmlns:sql=http://apache.org/cocoon/SQL/2.0; row usernameecsnp/username surnamePrice/surname initialsS/initials /row /rowset /user To help diagnose, the intermediate XML that comes out of the stylesheet transformation, before going into the sql transformer is: ?xml version=1.0 encoding=UTF-8 ? user xmlns:sql=http://apache.org/cocoon/SQL/2.0; execute-query xmlns=http://apache.org/cocoon/SQL/2.0; use-connectionpool-TAL/use-connection queryselect USERNAME, SURNAME, INITIALS from STAFF where STAFFID = '24'/query /execute-query /user Contrast this with the XML at the same point if the root user element is removed from the stylesheet (THIS ONE WORKS): ?xml version=1.0 encoding=UTF-8 ? execute-query xmlns=http://apache.org/cocoon/SQL/2.0; xmlns:sql=http://apache.org/cocoon/SQL/2.0; use-connectionpool-TAL/use-connection queryselect USERNAME, SURNAME, INITIALS from STAFF where STAFFID = '24'/query /execute-query Thanks in advance Simon --- Simon Price Institute for Learning and Research Technology University of Bristol 8-10 Berkeley Square Bristol BS8 1HH United Kingdom Direct: +44 (0)7071 226 720 Office: +44 (0)117 928 7193 Fax: +44 (0)117 928 7112 [EMAIL PROTECTED] http://www.ilrt.bristol.ac.uk - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faq/index.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: problems generating input to sql transformer with stylesheet (a la Langham Ziegeler book)
Koen, thanks but I already tried this. The resultant xml using your stylesheet is... ?xml version=1.0 encoding=UTF-8? user xmlns:xmlns:sql=http://apache.org/cocoon/SQL/2.0; xmlns=http://apache.org/cocoon/SQL/2.0; ecsnp/ Price/ Simon/ / / /user It sort of works but, for some reason, the rowset, row and column name tags get omitted by the sql transformer!!! In case it helps anyone say why this is, here's the intermediate xml from the stylesheet, before it goes into the sql transformer... ?xml version=1.0 encoding=UTF-8? user xmlns:sql=http://apache.org/cocoon/SQL/2.0; sql:execute-query sql:use-connectionpool-TAL/sql:use-connection sql:query select USERNAME, SURNAME, INITIALS from STAFF where STAFFID = '24' /sql:query /sql:execute-query /user Koen Pellegrims wrote: try your stylesheet as follows: ?xml version=1.0? xsl:stylesheet version=1.0 xmlns:xsl=http://www.w3.org/1999/XSL/Transform; xmlns:sql=http://apache.org/cocoon/SQL/2.0; xsl:template match=bootstrap user sql:execute-query sql:use-connectionpool-TAL/sql:use-connection sql:query select USERNAME, SURNAME, INITIALS from STAFF where STAFFID = '24' /sql:query /sql:execute-query /user /xsl:template /xsl:stylesheet this is exactly the same approach you would take to generate fo, for example. Koen. -Oorspronkelijk bericht- Van: Simon Price [mailto:[EMAIL PROTECTED]] Verzonden: vrijdag 30 augustus 2002 13:03 Aan: [EMAIL PROTECTED] Onderwerp: problems generating input to sql transformer with stylesheet (a la Langham Ziegeler book) I'm having real problems doing a trivial tranformation (in the style of Matthew and Carsten's excellent book). I generate xml which then gets transformed by the sql transformer. Unfortunately, it only works if I have no containing elements in the input to the transformer. I'm guessing its related to the namespace? Or is it a bug in the sql transformer? Any suggestions welcomed! Here's the full details (stripped down to simplest repro so please don't worry about the stylesheet now being pointless)... version info: tomcat 4.0.1 java 1.3.1 cocoon 2.1 head sitemap fragment: map:match pattern=test3.xml map:generate src=model/bootstrap.xml/ map:transform src=model/staff_model.xsl/ map:transform type=sql/ map:serialize type=xml/ /map:match model/bootstrap.xml: ?xml version=1.0? bootstrap/ model/staff_model.xsl ?xml version=1.0? xsl:stylesheet version=1.0 xmlns:xsl=http://www.w3.org/1999/XSL/Transform; xmlns:sql=http://apache.org/cocoon/SQL/2.0; xsl:template match=bootstrap user execute-query xmlns=http://apache.org/cocoon/SQL/2.0; use-connectionpool-TAL/use-connection query select USERNAME, SURNAME, INITIALS from STAFF where STAFFID = '24' /query /execute-query /user /xsl:template /xsl:stylesheet error in browser (reformatted by hand to make more readable): Multiple colons are not allowed in a name. Error processing resource 'http://localhost:8080/cocoon/tal/admin/test3.xml'. Line 2, Position 18 user xmlns:xmlns:sql=http://apache.org/cocoon/SQL/2.0; -^ rowset xmlns=http://apache.org/cocoon/SQL/2.0; xmlns:sql=http://apache.org/cocoon/SQL/2.0; row usernameecsnp/username surnamePrice/surname initialsS/initials /row /rowset /user To help diagnose, the intermediate XML that comes out of the stylesheet transformation, before going into the sql transformer is: ?xml version=1.0 encoding=UTF-8 ? user xmlns:sql=http://apache.org/cocoon/SQL/2.0; execute-query xmlns=http://apache.org/cocoon/SQL/2.0; use-connectionpool-TAL/use-connection queryselect USERNAME, SURNAME, INITIALS from STAFF where STAFFID = '24'/query /execute-query /user Contrast this with the XML at the same point if the root user element is removed from the stylesheet (THIS ONE WORKS): ?xml version=1.0 encoding=UTF-8 ? execute-query xmlns=http://apache.org/cocoon/SQL/2.0; xmlns:sql=http://apache.org/cocoon/SQL/2.0; use-connectionpool-TAL/use-connection queryselect USERNAME, SURNAME, INITIALS from STAFF where STAFFID = '24'/query /execute-query Thanks in advance Simon --- Simon Price Institute for Learning and Research Technology University of Bristol 8-10 Berkeley Square Bristol BS8 1HH United Kingdom Direct: +44 (0)7071 226 720 Office: +44 (0)117 928 7193 Fax: +44 (0)117 928 7112 [EMAIL PROTECTED] http://www.ilrt.bristol.ac.uk
Re: problems generating input to sql transformer with stylesheet (a la Langham Ziegeler book)
Ah! That's good to know. I can't use Java 1.4.1 because of the old Oracle 8i JDBC driver I'm using but I will try running it under cocoon 2.0.3 to see if its a 2.1 bug. Thanks again. Simon Koen Pellegrims wrote: oops, I just ran your example on my machine, and it ran like a charm :-s I must say I'm running tomcat 4.0.4, cocoon 2.0.3 on java 1.4.0... Koen -Oorspronkelijk bericht- Van: Simon Price [mailto:[EMAIL PROTECTED]] Verzonden: vrijdag 30 augustus 2002 14:53 Aan: [EMAIL PROTECTED] Onderwerp: Re: problems generating input to sql transformer with stylesheet (a la Langham Ziegeler book) Koen, thanks but I already tried this. The resultant xml using your stylesheet is... ?xml version=1.0 encoding=UTF-8? user xmlns:xmlns:sql=http://apache.org/cocoon/SQL/2.0; xmlns=http://apache.org/cocoon/SQL/2.0; ecsnp/ Price/ Simon/ / / /user It sort of works but, for some reason, the rowset, row and column name tags get omitted by the sql transformer!!! In case it helps anyone say why this is, here's the intermediate xml from the stylesheet, before it goes into the sql transformer... ?xml version=1.0 encoding=UTF-8? user xmlns:sql=http://apache.org/cocoon/SQL/2.0; sql:execute-query sql:use-connectionpool-TAL/sql:use-connection sql:query select USERNAME, SURNAME, INITIALS from STAFF where STAFFID = '24' /sql:query /sql:execute-query /user Koen Pellegrims wrote: try your stylesheet as follows: ?xml version=1.0? xsl:stylesheet version=1.0 xmlns:xsl=http://www.w3.org/1999/XSL/Transform; xmlns:sql=http://apache.org/cocoon/SQL/2.0; xsl:template match=bootstrap user sql:execute-query sql:use-connectionpool-TAL/sql:use-connection sql:query select USERNAME, SURNAME, INITIALS from STAFF where STAFFID = '24' /sql:query /sql:execute-query /user /xsl:template /xsl:stylesheet this is exactly the same approach you would take to generate fo, for example. Koen. -Oorspronkelijk bericht- Van: Simon Price [mailto:[EMAIL PROTECTED]] Verzonden: vrijdag 30 augustus 2002 13:03 Aan: [EMAIL PROTECTED] Onderwerp: problems generating input to sql transformer with stylesheet (a la Langham Ziegeler book) I'm having real problems doing a trivial tranformation (in the style of Matthew and Carsten's excellent book). I generate xml which then gets transformed by the sql transformer. Unfortunately, it only works if I have no containing elements in the input to the transformer. I'm guessing its related to the namespace? Or is it a bug in the sql transformer? Any suggestions welcomed! Here's the full details (stripped down to simplest repro so please don't worry about the stylesheet now being pointless)... version info: tomcat 4.0.1 java 1.3.1 cocoon 2.1 head sitemap fragment: map:match pattern=test3.xml map:generate src=model/bootstrap.xml/ map:transform src=model/staff_model.xsl/ map:transform type=sql/ map:serialize type=xml/ /map:match model/bootstrap.xml: ?xml version=1.0? bootstrap/ model/staff_model.xsl ?xml version=1.0? xsl:stylesheet version=1.0 xmlns:xsl=http://www.w3.org/1999/XSL/Transform; xmlns:sql=http://apache.org/cocoon/SQL/2.0; xsl:template match=bootstrap user execute-query xmlns=http://apache.org/cocoon/SQL/2.0; use-connectionpool-TAL/use-connection query select USERNAME, SURNAME, INITIALS from STAFF where STAFFID = '24' /query /execute-query /user /xsl:template /xsl:stylesheet error in browser (reformatted by hand to make more readable): Multiple colons are not allowed in a name. Error processing resource 'http://localhost:8080/cocoon/tal/admin/test3.xml'. Line 2, Position 18 user xmlns:xmlns:sql=http://apache.org/cocoon/SQL/2.0; -^ rowset xmlns=http://apache.org/cocoon/SQL/2.0; xmlns:sql=http://apache.org/cocoon/SQL/2.0; row usernameecsnp/username surnamePrice/surname initialsS/initials /row /rowset /user To help diagnose, the intermediate XML that comes out of the stylesheet transformation, before going into the sql transformer is: ?xml version=1.0 encoding=UTF-8 ? user xmlns:sql=http://apache.org/cocoon/SQL/2.0; execute-query xmlns=http://apache.org/cocoon/SQL/2.0; use-connectionpool-TAL/use-connection queryselect USERNAME, SURNAME, INITIALS from STAFF where STAFFID = '24'/query /execute-query /user Contrast this with the XML at the same point if the root user element is removed from the stylesheet (THIS ONE WORKS): ?xml version=1.0 encoding=UTF-8 ? execute-query xmlns=http://apache.org/cocoon/SQL/2.0
possible bug in 2.1 map:mount src attribute?
I'm moving an app from 2.03 to 2.1-dev (cvs head, 21 Aug 02) and the sitemap engine no longer seems to support alternative names for the .xmap file. The following fragment used to work fine in 2.03 but only works if I rename sitemap_tal.xmap as sitemap.xmap. (ie. the engine appears to always look for a file called sitemap.xmap irrespective of what the src attribute says - although it does look in the right directory). map:match pattern=tal/** map:mount check-reload=yes reload-method=synchron src=tal/sitemap_tal.xmap uri-prefix=tal// /map:match Is this a deliberate feature change or a bug? Simon --- Simon Price Institute for Learning and Research Technology University of Bristol 8-10 Berkeley Square Bristol BS8 1HH United Kingdom Direct: +44 (0)7071 226 720 Office: +44 (0)117 928 7193 Fax: +44 (0)117 928 7112 [EMAIL PROTECTED] http://www.ilrt.bristol.ac.uk - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faq/index.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: possible bug in 2.1 map:mount src attribute?
I'm using tomcat 4.0.1 with java 1.3.1 Simon Price wrote: I'm moving an app from 2.03 to 2.1-dev (cvs head, 21 Aug 02) and the sitemap engine no longer seems to support alternative names for the .xmap file. The following fragment used to work fine in 2.03 but only works if I rename sitemap_tal.xmap as sitemap.xmap. (ie. the engine appears to always look for a file called sitemap.xmap irrespective of what the src attribute says - although it does look in the right directory). map:match pattern=tal/** map:mount check-reload=yes reload-method=synchron src=tal/sitemap_tal.xmap uri-prefix=tal// /map:match Is this a deliberate feature change or a bug? Simon --- Simon Price Institute for Learning and Research Technology University of Bristol 8-10 Berkeley Square Bristol BS8 1HH United Kingdom Direct: +44 (0)7071 226 720 Office: +44 (0)117 928 7193 Fax: +44 (0)117 928 7112 [EMAIL PROTECTED] http://www.ilrt.bristol.ac.uk - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faq/index.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- --- Simon Price Institute for Learning and Research Technology University of Bristol 8-10 Berkeley Square Bristol BS8 1HH United Kingdom Direct: +44 (0)7071 226 720 Office: +44 (0)117 928 7193 Fax: +44 (0)117 928 7112 [EMAIL PROTECTED] http://www.ilrt.bristol.ac.uk - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faq/index.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: possible bug in 2.1 map:mount src attribute?
Thanks Vadim. In case anyone wonders why on earth I changed the name of the xmap files: its so I can tell them apart at a glance in my text editor :-) Vadim Gritsenko wrote: Simon Price wrote: I'm using tomcat 4.0.1 with java 1.3.1 Simon Price wrote: I'm moving an app from 2.03 to 2.1-dev (cvs head, 21 Aug 02) and the sitemap engine no longer seems to support alternative names for the .xmap file. The following fragment used to work fine in 2.03 but only works if I rename sitemap_tal.xmap as sitemap.xmap. (ie. the engine appears to always look for a file called sitemap.xmap irrespective of what the src attribute says - although it does look in the right directory). map:match pattern=tal/** map:mount check-reload=yes reload-method=synchron src=tal/sitemap_tal.xmap uri-prefix=tal// /map:match Is this a deliberate feature change or a bug? It's a bug. Vadim Simon - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faq/index.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- --- Simon Price Institute for Learning and Research Technology University of Bristol 8-10 Berkeley Square Bristol BS8 1HH United Kingdom Direct: +44 (0)7071 226 720 Office: +44 (0)117 928 7193 Fax: +44 (0)117 928 7112 [EMAIL PROTECTED] http://www.ilrt.bristol.ac.uk - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faq/index.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat doesn't unpack cocoon.war
Possible cause: You need to make sure that the tomcat user/group has permission to write to the webapps directory. Martin Polley wrote: Unfortunately, I am at my (work) Windows machine right now, so I cannot check it. But I know that unpackWARs is set to true. (This is the default setting, I think.) I'll have a look at the logs as soon as I get back to my Linux machine. Thanks for your help. Martin Polley Technical Communicator http://www.surf-com.com/ [EMAIL PROTECTED] Tel: (+972) (4) 9095-732 Mobile: (053) 864-280 ICQ 15617901 -Original Message- From: Stephan Michels [mailto:[EMAIL PROTECTED]] Sent: Tuesday, August 20, 2002 1:05 PM To: [EMAIL PROTECTED] Subject: Re: Tomcat doesn't unpack cocoon.war On Tue, 20 Aug 2002, Martin Polley wrote: Am I doing something wrong? Setup: RedHat Linux 7.3 J2SDK 1.4.1_01 Tomcat 4.0.4 Cocoon 2.0.3 (vm 1.4 version) Java SDK and Tomcat (tomcat-full tomcat-webapps) were downloaded as RPMs, Cocoon as a binary tarball. When I go to http://localhost:8080/cocoon/, it tells me that the requested resource (/cocoon/) is unavailable (I know Tomcat runs OK.) I have tries other (binary) versions of Tomcat (4.0.1) and Cocoon (2.0.3 for JDK 1.3, with JDK 1.3), all to no avail. Anyone have any idea what I am doing wrong? (I have seen other posts recommending unpacking cocoon.war to CATALINA_HOME/webapps/cocoon and then deleting the .war file. How do you unpack it?) $TOMCAT_HOME/conf/server.xml: Host name=localhost8080 debug=0 appBase=webapps unpackWARs=true But I think there will be another problems. Are there any hints in the logs $TOMCAT_HOME/logs ? Stephan. - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faq/index.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faq/index.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- --- Simon Price Institute for Learning and Research Technology University of Bristol 8-10 Berkeley Square Bristol BS8 1HH United Kingdom Direct: +44 (0)7071 226 720 Office: +44 (0)117 928 7193 Fax: +44 (0)117 928 7112 [EMAIL PROTECTED] http://www.ilrt.bristol.ac.uk - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faq/index.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: how to use a checkbox with DatabaseUpdateAction
Thanks Christian. I'll look into this. My fallback plan is to write a logicsheet in XSLT/ESQL to do the same as the DB actions but at a higher level. What I'm trying to end up with is an XForm-like way of writing (simple model) forms but without having to write any java. For many simple applications, this is all lots of people would need (I think). Cheers Simon Christian Haul wrote: On 23.Jul.2002 -- 09:36 PM, Simon Price wrote: Is it possible to get DatabaseUpdateAction to write, for example, 'Y' or 'N' into an SQL column according to whether a checkbox is checked/unchecked? You could have a default for this column of N - but since the parameter is not present (- null) the DatabaseUpdateAction will insert a NULL into that column. No luck. You could use DatabaseUpdateAction from the modular package (scratchpad in 2.0.3, trunk in 2.1-dev) and wrap this column with a default module. 2.1-dev has such a module (DefaultsMetaModule), while 2.0.3 does not. This is because the signature of InputModules has changed slightly and 2.0.3 is bug-fix only. It should be easy to backport a module from 2.1 to 2.0.3 as the basic difference is the use of the objectModel instead of Request. Chris. -- --- Simon Price Institute for Learning and Research Technology University of Bristol 8-10 Berkeley Square Bristol BS8 1HH United Kingdom Direct: +44 (0)7071 226 720 Office: +44 (0)117 928 7193 Fax: +44 (0)117 928 7112 [EMAIL PROTECTED] http://www.ilrt.bristol.ac.uk - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faq/index.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
SUMMARY: how to use a checkbox with DatabaseUpdateAction
I've come up with a code-free workaround for the problem. Quick reminder of the problem: HTML checkboxes do not submit a request value if unchecked and hence DatabaseUpdateAction writes NULL into the corresponding column in the database. In Cocoon 2.03 there in no way of overriding this effective NULL default. What is more typically required is something like: when checked, write Y; when unchecked, write N. By adding a hidden input field of the same name as the checkbox input field to your HTML form you can force a non-NULL default. eg. my version of simple-page.xsl generates HTML for a checkbox as... input type=checkbox name={@name} value=Y xsl:if test=.='Y' xsl:attribute name=checkedtrue/xsl:attribute /xsl:if /input !-- default value for when checkbox is left unchecked -- input type=hidden name={@name} value=N/ When the box is checked, the Y is written, but when unchecked, the N is written. Cheers Simon PS. Tested with Cocoon 2.03, Java 1.3.1, Tomcat 4.01, IE6 and NS6 --- Simon Price Institute for Learning and Research Technology University of Bristol 8-10 Berkeley Square Bristol BS8 1HH United Kingdom Direct: +44 (0)7071 226 720 Office: +44 (0)117 928 7193 Fax: +44 (0)117 928 7112 [EMAIL PROTECTED] http://www.ilrt.bristol.ac.uk - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faq/index.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[SUMMARY] how to use a checkbox with DatabaseUpdateAction
Take 2... this time with correct summary prefix in email title :-))) --- I've come up with a code-free workaround for the problem. Quick reminder of the problem: HTML checkboxes do not submit a request value if unchecked and hence DatabaseUpdateAction writes NULL into the corresponding column in the database. In Cocoon 2.03 there in no way of overriding this effective NULL default. What is more typically required is something like: when checked, write Y; when unchecked, write N. By adding a hidden input field of the same name as the checkbox input field to your HTML form you can force a non-NULL default. eg. my version of simple-page.xsl generates HTML for a checkbox as... input type=checkbox name={@name} value=Y xsl:if test=.='Y' xsl:attribute name=checkedtrue/xsl:attribute /xsl:if /input !-- default value for when checkbox is left unchecked -- input type=hidden name={@name} value=N/ When the box is checked, the Y is written, but when unchecked, the N is written. Cheers Simon PS. Tested with Cocoon 2.03, Java 1.3.1, Tomcat 4.01, IE6 and NS6 --- Simon Price Institute for Learning and Research Technology University of Bristol 8-10 Berkeley Square Bristol BS8 1HH United Kingdom Direct: +44 (0)7071 226 720 Office: +44 (0)117 928 7193 Fax: +44 (0)117 928 7112 [EMAIL PROTECTED] http://www.ilrt.bristol.ac.uk - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faq/index.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: SUMMARY: how to use a checkbox with DatabaseUpdateAction
Doh! I worked out that DatabaseUpdateAction just took the first array item and in IE6 and NS6 this happens to be the same order as they occur in the form. I was assuming that this would be the case with all clients. Live and learn! I'll have to find a proper solution after next week but this kludge will let me make my UI review version deadline for next week ;-) Thanks Simon Christian Haul wrote: On 25.Jul.2002 -- 03:31 PM, Simon Price wrote: I've come up with a code-free workaround for the problem. Quick reminder of the problem: HTML checkboxes do not submit a request value if unchecked and hence DatabaseUpdateAction writes NULL into the corresponding column in the database. In Cocoon 2.03 there in no way of overriding this effective NULL default. What is more typically required is something like: when checked, write Y; when unchecked, write N. By adding a hidden input field of the same name as the checkbox input field to your HTML form you can force a non-NULL default. Sorry to disappoint you, but the above does not work reliably: If multiple fields with the same name exist, it completely depends on the client in what order they are sent. So, you get two values and when using the getAttributeValues() method, you'll get an array ['Y','N'] Chris. -- --- Simon Price Institute for Learning and Research Technology University of Bristol 8-10 Berkeley Square Bristol BS8 1HH United Kingdom Direct: +44 (0)7071 226 720 Office: +44 (0)117 928 7193 Fax: +44 (0)117 928 7112 [EMAIL PROTECTED] http://www.ilrt.bristol.ac.uk - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faq/index.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
how to use a checkbox with DatabaseUpdateAction
Is it possible to get DatabaseUpdateAction to write, for example, 'Y' or 'N' into an SQL column according to whether a checkbox is checked/unchecked? The problem is that only on (ie. checked) checkboxes submit a value, so is there an easy way to translate this into a Y/N value to go in the DB column. Apologies is this is well documented somewhere, but I can't find it. I had no problems getting form values from input/text and selections to work, but this one's less obvious (to a cocoon newbie like me anyway). Cheers Simon --- Simon Price Institute for Learning and Research Technology University of Bristol 8-10 Berkeley Square Bristol BS8 1HH United Kingdom Direct: +44 (0)7071 226 720 Office: +44 (0)117 928 7193 Fax: +44 (0)117 928 7112 [EMAIL PROTECTED] http://www.ilrt.bristol.ac.uk - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faq/index.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]