Re: create FormBinding from w3cDocument or String
Could somebody tell me how to install the patch. Please! greetings, Niclas -- View this message in context: http://www.nabble.com/create-FormBinding-from-w3cDocument-or-String-tf3513328.html#a9858212 Sent from the Cocoon - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Problems with JDBC driver
Hi The Problem is as follows: I want to connect to the database DB2. I registred the jdbc driver in the following places: in the web.xml, in the cocoon.xconf, inside the DBManager that my javaclasses are using. If I call a Site, where a connection to the Database should be established, inside the console of jetty is beeing printed, that the the mysql jdbc driver counldnt be found. But I nowhere declared the mysql jdbc driver! So is it a bug? If not, where else do I have to set the JDBC Drivers? Thanx! regards, Niclas -- View this message in context: http://www.nabble.com/Problems-with-JDBC-driver-tf3532322.html#a9858371 Sent from the Cocoon - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
create FormBinding from w3cDocument or String
Hi I use CForms. The binding is delivered from a javaclass. I can pass a w3cDocument or a String. I tried several thinks like: var myClass = new Packages.MyClass(); form.createBinding(myClass.getBinding().getDocumentElement()); //getBinding() delivers a w3cDocument) Doesnt work because createBinding expects a sourcepath. or var myClass = new Packages.MyClass(); var binding = myClass.getBinding() form.createBinding(cocoon:/generate/from/string, {binding:binding}); //getBinding() delivers a String matching pipeline: map:match pattern=generate/from/string map:generate type=jx src=module:flow-attr:binding / map:serialize type=xml/ /map:match The following error arises: The attribute: binding is empty So please, could somebody help me? THANX kind regards, Niclas -- View this message in context: http://www.nabble.com/create-FormBinding-from-w3cDocument-or-String-tf3513328.html#a9811543 Sent from the Cocoon - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Ajax - on Submit: Requerst failed - status=500
Has really nobody a suggestion how to use Ajax with an aggregator? Cant imagine, that nobody else had that problem before ;-) kind regards, Niclas ZongoZongo wrote: I found the problem, but dont know how to solve it. The problem is the location of the ajax-logic inside the aggregator. If its located inside a pipeline everything works fine. Sadly I have to put the formprocessing after the aggregation, because the tabs inside the form need, the tag head/, that is created after the aggregation through finalize.xsl. Maybe somebody has an idea for a workaround ;-) kind regards, Niclas ZongoZongo wrote: Hi I updateted my form with ajax. Now Iam getting a server error like described in the title of this thread when I hit the submitbutton. Javastack: java.lang.IllegalStateException: getWriter() has already been called for this response org.apache.catalina.connector.Response.getOutputStream(Response.java:568) org.apache.catalina.connector.ResponseFacade.getOutputStream(ResponseFacade.java:180) org.apache.cocoon.servlet.CocoonServlet.manageException(CocoonServlet.java:1316) org.apache.cocoon.servlet.CocoonServlet.service(CocoonServlet.java:1202) javax.servlet.http.HttpServlet.service(HttpServlet.java:802) Sitemap: map:resources map:resource name=page.html map:aggregate element=site map:part element=navigation src=cocoon:/navigation strip-root=true/ map:part src=cocoon:/{page}.source element=main/ map:part element=header src=header.xml strip-root=true/ /map:aggregate map:transform type=xslt src=stylesheets/finalize.xsl/ map:transform type=browser-update/ map:transform src=forms-samples-styling.xsl/ map:select type=ajax-request map:when test=true map:serialize type=xml/ /map:when map:otherwise map:serialize type=html/ /map:otherwise /map:select map:serialize type=html/ /map:resource /map:resources template: div jx:import xmlns:jx=http://apache.org/cocoon/templates/jx/1.0; uri=resource://org/apache/cocoon/forms/generation/jx-macros.xml / ft:form-template xmlns:ft=http://apache.org/cocoon/forms/1.0#template; method=POST enctype=multipart/form-data action=#{$continuation/id}.continue ajax=true fi:group xmlns:fi=http://apache.org/cocoon/forms/1.0#instance; fi:styling type=choice / fi:items fi:group fi:labelabstract/fi:label ft:repeater id=abstract table ft:repeater-rows tr td ft:widget id=fault-abstract / /td td ft:widget id=deleteRow-abstract / /td td ft:widget id=selectRow-abstract / /td /tr /ft:repeater-rows /table /ft:repeater br / ft:widget id=addRow-abstract / ft:widget id=deleteRows-abstract / /fi:group fi:group fi:labelpaper/fi:label ft:repeater id=paper table ft:repeater-rows tr td ft:widget id=fault-paper / /td td ft:widget id=deleteRow-paper / /td td ft:widget id=selectRow-paper / /td /tr /ft:repeater-rows /table /ft:repeater br / ft:widget id=addRow-paper / ft:widget id=deleteRows-paper / /fi:group /fi:items /fi:group ft:widget id=submitbutton / /ft:form-template /div Maybe somebody has an Idea how to solve this problem. kind regards, Niclas -- View this message in context: http://www.nabble.com/Ajax---on-Submit%3A-%22Requerst-failed---status%3D500%22-tf2966619.html#a8518382 Sent from the Cocoon - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Ajax - on Submit: Requerst failed - status=500
I have a complex cform with tabs und repeaters. When you use ajax, only the form is relaoded after something is changed instead of the whole site. The problem arises because I use tabs und an aggregator to build the site. So I have to place the stylesheet, that transforms the form inside the aggregator after the aggregation, because the code of the tabs needs the head/ that is placed after the aggregation (finalize.xsl). The ajax selector has to be placed after the stylesheet of formtransformation and in this way inside the aggregator. I dont know which part causes the problem exactly. The form is displayed correctly. I can also work with the form. But when I hit the submitbutton the error pops up. I hope its not too confusing ;-) Niclas Jeroen Reijn wrote: Hi Niclas, I've been reading your email, but it's not 100% clear with what you mean with using Ajax with an aggregator. What kind of ajax logic is inside the aggregator? What part in your aggregate is causing this problem? Kind regards, Jeroen Reijn ZongoZongo wrote: Has really nobody a suggestion how to use Ajax with an aggregator? Cant imagine, that nobody else had that problem before ;-) kind regards, Niclas ZongoZongo wrote: I found the problem, but dont know how to solve it. The problem is the location of the ajax-logic inside the aggregator. If its located inside a pipeline everything works fine. Sadly I have to put the formprocessing after the aggregation, because the tabs inside the form need, the tag head/, that is created after the aggregation through finalize.xsl. Maybe somebody has an idea for a workaround ;-) kind regards, Niclas ZongoZongo wrote: Hi I updateted my form with ajax. Now Iam getting a server error like described in the title of this thread when I hit the submitbutton. Javastack: java.lang.IllegalStateException: getWriter() has already been called for this response org.apache.catalina.connector.Response.getOutputStream(Response.java:568) org.apache.catalina.connector.ResponseFacade.getOutputStream(ResponseFacade.java:180) org.apache.cocoon.servlet.CocoonServlet.manageException(CocoonServlet.java:1316) org.apache.cocoon.servlet.CocoonServlet.service(CocoonServlet.java:1202) javax.servlet.http.HttpServlet.service(HttpServlet.java:802) Sitemap: map:resources map:resource name=page.html map:aggregate element=site map:part element=navigation src=cocoon:/navigation strip-root=true/ map:part src=cocoon:/{page}.source element=main/ map:part element=header src=header.xml strip-root=true/ /map:aggregate map:transform type=xslt src=stylesheets/finalize.xsl/ map:transform type=browser-update/ map:transform src=forms-samples-styling.xsl/ map:select type=ajax-request map:when test=true map:serialize type=xml/ /map:when map:otherwise map:serialize type=html/ /map:otherwise /map:select map:serialize type=html/ /map:resource /map:resources template: div jx:import xmlns:jx=http://apache.org/cocoon/templates/jx/1.0; uri=resource://org/apache/cocoon/forms/generation/jx-macros.xml / ft:form-template xmlns:ft=http://apache.org/cocoon/forms/1.0#template; method=POST enctype=multipart/form-data action=#{$continuation/id}.continue ajax=true fi:group xmlns:fi=http://apache.org/cocoon/forms/1.0#instance; fi:styling type=choice / fi:items fi:group fi:labelabstract/fi:label ft:repeater id=abstract table ft:repeater-rows tr td ft:widget id=fault-abstract / /td td ft:widget id=deleteRow-abstract / /td td ft:widget id=selectRow-abstract / /td /tr /ft:repeater-rows /table /ft:repeater br / ft:widget id=addRow-abstract / ft:widget id=deleteRows-abstract / /fi:group fi:group fi:labelpaper/fi:label ft:repeater id=paper table ft:repeater-rows tr td ft:widget id=fault-paper / /td td ft:widget id=deleteRow-paper / /td td ft:widget id=selectRow-paper / /td /tr
Re: Formtdefinition and -template from a org.w3c.dom.Document stream
Creating the form works fine. But the pipeline makes some trouble with parsing the template: org.xml.sax.SAXException: The object type: class java.lang.String could not be serialized to XML: Do I have to consider anything special? My template is valid and works fine if I use it conventionally :-/ div jx:import xmlns:jx=http://apache.org/cocoon/templates/jx/1.0; uri=resource://org/apache/cocoon/forms/generation/jx-macros.xml / ft:form-template xmlns:ft=http://apache.org/cocoon/forms/1.0#template; method=POST enctype=multipart/form-data action=#{$continuation/id}.continue ft:widget id=faults fi:styling xmlns:fi=http://apache.org/cocoon/forms/1.0#instance; list-type=checkbox / /ft:widget br / ft:widget id=comment fi:styling xmlns:fi=http://apache.org/cocoon/forms/1.0#instance; type=textarea cols=20 rows=5 / /ft:widget br / ft:widget id=submitbutton / /ft:form-template /div kind regards, Niclas Jason Johnston-3 wrote: ZongoZongo wrote: Hi Inside the flow I get the formtemplate and the formdefinition from a javamethod as an org.w3c.dom.Document stream. How can I use this streams to: - generate the form I believe you can pass a DOM element to the Form flowscript constructor: var form = new Form(myFormDocument.getDocumentElement()); - call the formtemplate What you need here is a way to use the DOM Document as input to the JX generator. The xmodule source allows you to stream a DOM from an input module, for instance using the flow-attribute module: (flowscript:) form.showForm(display-pipeline, {dom : myJXDocument}); (sitemap:) map:match pattern=display-pipeline map:generate type=jx src=xmodule:flow-attr:dom / ... Now, you should be aware that while this sort of setup is certainly possible, there will be a performance penalty. First of all, using a DOM object to build the form definition prevents the caching of that definition that usually takes place. Similarly, the JX template cannot be precompiled and cached so it has to recompile the template each time. You'll have to determine if that performance penalty is worth it for your particular case. Hope that helps --Jason - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Formdefinition-and--template-from-an-org.w3c.dom.Document-stream-tf2945399.html#a8369117 Sent from the Cocoon - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Ajax - on Submit: Requerst failed - status=500
I found the problem, but dont know how to solve it. The problem is the location of the ajax-logic inside the aggregator. If its located inside a pipeline everything works fine. Sadly I have to put the formprocessing after the aggregation, because the tabs inside the form need, the tag head/, that is created after the aggregation through finalize.xsl. Maybe somebody has an idea for a workaround ;-) kind regards, Niclas ZongoZongo wrote: Hi I updateted my form with ajax. Now Iam getting a server error like described in the title of this thread when I hit the submitbutton. Javastack: java.lang.IllegalStateException: getWriter() has already been called for this response org.apache.catalina.connector.Response.getOutputStream(Response.java:568) org.apache.catalina.connector.ResponseFacade.getOutputStream(ResponseFacade.java:180) org.apache.cocoon.servlet.CocoonServlet.manageException(CocoonServlet.java:1316) org.apache.cocoon.servlet.CocoonServlet.service(CocoonServlet.java:1202) javax.servlet.http.HttpServlet.service(HttpServlet.java:802) Sitemap: map:resources map:resource name=page.html map:aggregate element=site map:part element=navigation src=cocoon:/navigation strip-root=true/ map:part src=cocoon:/{page}.source element=main/ map:part element=header src=header.xml strip-root=true/ /map:aggregate map:transform type=xslt src=stylesheets/finalize.xsl/ map:transform type=browser-update/ map:transform src=forms-samples-styling.xsl/ map:select type=ajax-request map:when test=true map:serialize type=xml/ /map:when map:otherwise map:serialize type=html/ /map:otherwise /map:select map:serialize type=html/ /map:resource /map:resources template: div jx:import xmlns:jx=http://apache.org/cocoon/templates/jx/1.0; uri=resource://org/apache/cocoon/forms/generation/jx-macros.xml / ft:form-template xmlns:ft=http://apache.org/cocoon/forms/1.0#template; method=POST enctype=multipart/form-data action=#{$continuation/id}.continue ajax=true fi:group xmlns:fi=http://apache.org/cocoon/forms/1.0#instance; fi:styling type=choice / fi:items fi:group fi:labelabstract/fi:label ft:repeater id=abstract table ft:repeater-rows tr td ft:widget id=fault-abstract / /td td ft:widget id=deleteRow-abstract / /td td ft:widget id=selectRow-abstract / /td /tr /ft:repeater-rows /table /ft:repeater br / ft:widget id=addRow-abstract / ft:widget id=deleteRows-abstract / /fi:group fi:group fi:labelpaper/fi:label ft:repeater id=paper table ft:repeater-rows tr td ft:widget id=fault-paper / /td td ft:widget id=deleteRow-paper / /td td ft:widget id=selectRow-paper / /td /tr /ft:repeater-rows /table /ft:repeater br / ft:widget id=addRow-paper / ft:widget id=deleteRows-paper / /fi:group /fi:items /fi:group ft:widget id=submitbutton / /ft:form-template /div Maybe somebody has an Idea how to solve this problem. kind regards, Niclas -- View this message in context: http://www.nabble.com/Ajax---on-Submit%3A-%22Requerst-failed---status%3D500%22-tf2966619.html#a8369380 Sent from the Cocoon - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Ajax - on Submit: Requerst failed - status=500
Hi I updateted my form with ajax. Now Iam getting a server error like described in the title of this thread when I hit the submitbutton. Javastack: java.lang.IllegalStateException: getWriter() has already been called for this response org.apache.catalina.connector.Response.getOutputStream(Response.java:568) org.apache.catalina.connector.ResponseFacade.getOutputStream(ResponseFacade.java:180) org.apache.cocoon.servlet.CocoonServlet.manageException(CocoonServlet.java:1316) org.apache.cocoon.servlet.CocoonServlet.service(CocoonServlet.java:1202) javax.servlet.http.HttpServlet.service(HttpServlet.java:802) Sitemap: map:resources map:resource name=page.html map:aggregate element=site map:part element=navigation src=cocoon:/navigation strip-root=true/ map:part src=cocoon:/{page}.source element=main/ map:part element=header src=header.xml strip-root=true/ /map:aggregate map:transform type=xslt src=stylesheets/finalize.xsl/ map:transform type=browser-update/ map:transform src=forms-samples-styling.xsl/ map:select type=ajax-request map:when test=true map:serialize type=xml/ /map:when map:otherwise map:serialize type=html/ /map:otherwise /map:select map:serialize type=html/ /map:resource /map:resources template: div jx:import xmlns:jx=http://apache.org/cocoon/templates/jx/1.0; uri=resource://org/apache/cocoon/forms/generation/jx-macros.xml / ft:form-template xmlns:ft=http://apache.org/cocoon/forms/1.0#template; method=POST enctype=multipart/form-data action=#{$continuation/id}.continue ajax=true fi:group xmlns:fi=http://apache.org/cocoon/forms/1.0#instance; fi:styling type=choice / fi:items fi:group fi:labelabstract/fi:label ft:repeater id=abstract table ft:repeater-rows tr td ft:widget id=fault-abstract / /td td ft:widget id=deleteRow-abstract / /td td ft:widget id=selectRow-abstract / /td /tr /ft:repeater-rows /table /ft:repeater br / ft:widget id=addRow-abstract / ft:widget id=deleteRows-abstract / /fi:group fi:group fi:labelpaper/fi:label ft:repeater id=paper table ft:repeater-rows tr td ft:widget id=fault-paper / /td td ft:widget id=deleteRow-paper / /td td ft:widget id=selectRow-paper / /td /tr /ft:repeater-rows /table /ft:repeater br / ft:widget id=addRow-paper / ft:widget id=deleteRows-paper / /fi:group /fi:items /fi:group ft:widget id=submitbutton / /ft:form-template /div Maybe somebody has an Idea how to solve this problem. kind regards, Niclas -- View this message in context: http://www.nabble.com/Ajax---on-Submit%3A-%22Requerst-failed---status%3D500%22-tf2966619.html#a8300547 Sent from the Cocoon - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: cforms: tabs in an aggregated page
Ok, now its getting really strange! I built a new basic application only with the files ein I need to display the tabbed form (header and navigation all the same like in the app where the form doesnt work). And It works fine! Now I used a tool to compare the htmlfile (generated by cocoon) of the first app that doesnt display the form correctly and the htmlfile of this new applikation where everything works fine. And they are identical (except tab id and continuation id). Who can explain me that? two identical files, two different representations? I am really confused! kind regards, Niclas -- View this message in context: http://www.nabble.com/cforms%3A-tabs-in-an-aggregated-page-tf2918903.html#a8235066 Sent from the Cocoon - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: cforms: tabs in an aggregated page
Ok, now I solved the problem. I had an fault inside the matcher that is responsible for the ressources. kind regards, Niclas ZongoZongo wrote: Ok, now its getting really strange! I built a new basic application only with the files ein I need to display the tabbed form (header and navigation all the same like in the app where the form doesnt work). And It works fine! Now I used a tool to compare the htmlfile (generated by cocoon) of the first app that doesnt display the form correctly and the htmlfile of this new applikation where everything works fine. And they are identical (except tab id and continuation id). Who can explain me that? two identical files, two different representations? I am really confused! kind regards, Niclas -- View this message in context: http://www.nabble.com/cforms%3A-tabs-in-an-aggregated-page-tf2918903.html#a8235331 Sent from the Cocoon - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Formtdefinition and -template from a org.w3c.dom.Document stream
Hi Inside the flow I get the formtemplate and the formdefinition from a javamethod as an org.w3c.dom.Document stream. How can I use this streams to: - generate the form - call the formtemplate I hope this is possible. kind regards, Niclas -- View this message in context: http://www.nabble.com/Formtdefinition-and--template-from-a-org.w3c.dom.Document-stream-tf2945399.html#a8236321 Sent from the Cocoon - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: cforms: tabs in an aggregated page
Maybe someone of you could give me an example of an aggregated page where tabs in CForms work fine. I really need to solve this problem. Otherwise I cant proceed my project :-( kind regards, Niclas ZongoZongo wrote: Hi My page is aggregated of an aggregator. Now I wont to place a Form with tabs. Could somebody give me some hints how this might work? The probelm is, that I cant use the head/ tag in my template, because this is done finally by an xsl-file after the aggregation. I also tried to copy the script, that is placed by cocoon in the header, later inside the xsl-file manually. But it doesnt work. I just can see just the tab-labels and the content of the first group. kind regards, Niclas -- View this message in context: http://www.nabble.com/cforms%3A-tabs-in-an-aggregated-page-tf2918903.html#a8219945 Sent from the Cocoon - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: cforms: tabs in an aggregated page
The tabs are not shown. Just their labels are listed and the content of the first group. Mark Lundquist-2 wrote: On Jan 8, 2007, at 7:29 AM, ZongoZongo wrote: I really need to solve this problem. Otherwise I cant proceed my project :-( What problem, exactly? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/cforms%3A-tabs-in-an-aggregated-page-tf2918903.html#a8220293 Sent from the Cocoon - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: cforms: tabs in an aggregated page
Ok, I solved the problem with the missing head/ tag but it still dosnt work. Here is a little code. ### map:resources map:resource name=page.html map:aggregate element=site map:part element=navigation src=cocoon:/navigation strip-root=true/ map:part src=cocoon:/{page}.source element=main/ map:part element=header src=header.xml strip-root=true/ /map:aggregate map:transform type=xslt src=stylesheets/finalize.xsl/ map:transform src=forms-samples-styling.xsl/ map:serialize type=html/ /map:resource /map:resources ... //calls resource map:match pattern=** map:call resource=page.html map:parameter name=page value={0}/ /map:call /map:match ... //calls flow map:match pattern=tabs.source map:call function=tabs/ /map:match ... //generates form map:match pattern=form/template/*.source map:generate type=jx src=forms/{1}-template.xml/ map:serialize type=xml/ /map:match //flow function tabs(){ var form = new Form(forms/tabs-definition.xml); form.showForm(form/template/tabs.source); } FormModel: ?xml version=1.0? fd:form xmlns:fd=http://apache.org/cocoon/forms/1.0#definition; fd:widgets fd:field id=firstName required=true fd:labelVorname/fd:label fd:datatype base=string / fd:validation fd:length min=2 fd:failmessageDer Vorname muss aus mindestens 2 Zeichen bestehen./fd:failmessage /fd:length /fd:validation /fd:field fd:field id=cars fd:labelCars/fd:label fd:datatype base=string/ fd:selection-list fd:item value=BMW/ fd:item value=Mercedes/ fd:item value=Porsche/ fd:item value=Audi/ /fd:selection-list /fd:field fd:field id=activeTab fd:datatype base=integer/ /fd:field /fd:widgets /fd:form Formtemplate div xmlns:ft=http://apache.org/cocoon/forms/1.0#template; xmlns:fi=http://apache.org/cocoon/forms/1.0#instance; xmlns:jx=http://apache.org/cocoon/templates/jx/1.0; jx:import uri=resource://org/apache/cocoon/forms/generation/jx-macros.xml / ft:form-template action=${continuation.id}.cont method=POST fi:group !-- Alternativer Wert fuer type: choice -- fi:styling type=tabs / fi:state ft:widget id=activeTab / /fi:state fi:items fi:group fi:labelPersonendaten/fi:label !-- Anstelle von table koennen Sie hier auch wieder fi:styling verwenden -- table tr td ft:widget-label id=firstName / /td td ft:widget id=firstName / /td /tr /table /fi:group fi:group fi:labelHobbies/fi:label !-- Anstelle von table koennen Sie hier auch wieder fi:styling verwenden -- table tr td ft:widget-label id=cars / /td td ft:widget id=cars / /td
cforms: tabs in an aggregated page
Hi My page is aggregated of an aggregator. Now I wont to place a Form with tabs. Could somebody give me some hints how this might work? The probelm is, that I cant use the head/ tag in my template, because this is done finally by an xsl-file after the aggregation. I also tried to copy the script, that is placed by cocoon in the header, later inside the xsl-file manually. But it doesnt work. I just can see just the tab-labels and the content of the first group. kind regards, Niclas -- View this message in context: http://www.nabble.com/cforms%3A-tabs-in-an-aggregated-page-tf2918903.html#a8157390 Sent from the Cocoon - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Caching Problem
The method writeFormFiles writes the formmodel, the formtemplate and the formbinding to the filesystem (I need to do it this way, because the structure of the form is generated dynamically and can be very different from time to time). Writing back to db always works. After submitting the form a page is displayed, that shows the data of the DB. The factory.getFormObject cant be the reason neither. In fact the obj has to be the identical object, because I want to see the modified data of that object. The data that is loaded into the form is got from the function getXMLData that loads the data directly from the db. Pressing shif-f5 in the browser doesnt work too. The strange thing is, that everything works fine, when I restart tomcat after modifying the data. Then the correct data is loaded into the form. One question. To where does the output of print() go? I have no console like in java. kind regards, Niclas Ard Schrijvers wrote: Mark Lundquist-2 wrote: OK. But I don't think it's the value of a flowscript variable that's getting cached. It doesn't work that way. But clearly something is getting cached! As Mark already pointed out, cocoon is really caching nothing in what you are showing. The problem is in your flowscript. What I do not understand for example, is the obj.writeFormFiles(). What are you writing? Then, you say to save data back to DB. Perhaps something goes wrong there. Or when you reload again, perhaps var obj = factory.getFormObject(objectType, id, 0); does not result in something new. OR, try at least to use ctrl-f5 in your browser, when you have the old form, perhaps it is your browser cache. In that case you might want to add headers with cache pragmas. Put as Mark aleady said a print(doc) in your flowscript. At least you should then see if the flowscript is run again, and what is in the doc var Ard From your sitemap, what do the pipelines look like that are involved in servicing the client request (i.e., calling the flowscript function and serving up the final HTML response)? Also, if you add type=noncaching to your map:pipeline, does the behavior change at all? —ml— Setting type=noncaching doesnt help. Here are some sitemap extractions: map:match pattern=** map:call resource=page.html map:parameter name=page value={0}/ /map:call /map:match map:resources map:resource name=page.html map:aggregate element=site map:part element=navigation src=cocoon:/navigation strip-root=true/ map:part src=cocoon:/{page}.source element=main/ map:part element=header src=header.xml strip-root=true/ /map:aggregate map:transform type=xslt src=stylesheets/finalize.xsl/ map:serialize type=html/ /map:resource /map:resources calls flowscript. Attributes are just for testing map:match pattern=showObject.source map:call function=showObject map:attribute name=objectType value=author/ map:attribute name=id value=15/ /map:call /map:match is called from the flowscript map:match pattern=form/template/*.source map:generate type=jx src=forms/{1}-template.xml/ map:transform type=browser-update/ map:transform type=i18n map:parameter name=locale value=en-US/ /map:transform map:transform src=forms-samples-styling.xsl/ map:select type=ajax-request map:when test=true map:serialize type=xml/ /map:when map:otherwise map:serialize type=xhtml/ /map:otherwise /map:select /map:match Maybe you hava an idea ;-) kind regards, Niclas -- View this message in context: http://www.nabble.com/Caching-Problem-tf2909200.html#a8132146 Sent from the Cocoon - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Caching-Problem-tf2909200.html#a8137750 Sent from the Cocoon - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Caching Problem
I have a Simple CForm, that I enter through a navigationpoint. I use the binding framework to bind xml-data to the form. The Flowscript is as follows: ### //generate formdefinition, formtemplate, formbinding var factory = Packages.de.doccollector.ObjectFactory.getInstance(); var obj = factory.getFormObject(objectType, id, 0); obj.writeFormFiles(); var form = new Form(forms/object-definition.xml); form.createBinding(forms/object-binding.xml); //get XMLStream var doc = obj.getXmlData(); form.load(doc); form.showForm(form/template/object.source); form.save(doc); saveDocument(doc, forms/object-data-result.xml); ... save data back to DB and show next page # When I first enter the form, the formbinding works fine. Data is loaded into the form and after editing it is written back to db. The problem arises if I enter the form again. Then the data of the step before is loaded. Not the modified Data. I asume Cocoon caches the variable doc. If I restart tomcat everytime I modified the data everything works fine. So the problem must be the caching. How can I switch of this caching? nice regards, Niclas -- View this message in context: http://www.nabble.com/Caching-Problem-tf2909200.html#a8128000 Sent from the Cocoon - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Caching Problem
Mark Lundquist wrote: On Jan 2, 2007, at 10:17 AM, ZongoZongo wrote: var factory = Packages.de.doccollector.ObjectFactory.getInstance(); var obj = factory.getFormObject(objectType, id, 0); //... //get XMLStream var doc = obj.getXmlData(); form.load(doc); When I first enter the form, the formbinding works fine. Data is loaded into the form and after editing it is written back to db. The problem arises if I enter the form again. Then the data of the step before is loaded. Not the modified Data. I asume Cocoon caches the variable doc. I don't think so. How about you try adding print (doc) after the assignment to doc to find out? My guess would be that your factory is returning an obj that gives you the same getXmlData() each time...? cheers, —ml— I doubt this is not the case. After I changed the datafields of the form and the data is successfully written back to db, I ran the function getXmlData() outside in eclipse und it delivers the correct Data. The getXmlData simply fetches the data out of the DB and generates the xmlStructure. So it cant deliver outdated data. kind regards, niclas -- View this message in context: http://www.nabble.com/Caching-Problem-tf2909200.html#a8130114 Sent from the Cocoon - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Caching Problem
Mark Lundquist-2 wrote: OK. But I don't think it's the value of a flowscript variable that's getting cached. It doesn't work that way. But clearly something is getting cached! From your sitemap, what do the pipelines look like that are involved in servicing the client request (i.e., calling the flowscript function and serving up the final HTML response)? Also, if you add type=noncaching to your map:pipeline, does the behavior change at all? —ml— Setting type=noncaching doesnt help. Here are some sitemap extractions: map:match pattern=** map:call resource=page.html map:parameter name=page value={0}/ /map:call /map:match map:resources map:resource name=page.html map:aggregate element=site map:part element=navigation src=cocoon:/navigation strip-root=true/ map:part src=cocoon:/{page}.source element=main/ map:part element=header src=header.xml strip-root=true/ /map:aggregate map:transform type=xslt src=stylesheets/finalize.xsl/ map:serialize type=html/ /map:resource /map:resources calls flowscript. Attributes are just for testing map:match pattern=showObject.source map:call function=showObject map:attribute name=objectType value=author/ map:attribute name=id value=15/ /map:call /map:match is called from the flowscript map:match pattern=form/template/*.source map:generate type=jx src=forms/{1}-template.xml/ map:transform type=browser-update/ map:transform type=i18n map:parameter name=locale value=en-US/ /map:transform map:transform src=forms-samples-styling.xsl/ map:select type=ajax-request map:when test=true map:serialize type=xml/ /map:when map:otherwise map:serialize type=xhtml/ /map:otherwise /map:select /map:match Maybe you hava an idea ;-) kind regards, Niclas -- View this message in context: http://www.nabble.com/Caching-Problem-tf2909200.html#a8132146 Sent from the Cocoon - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: problem with xml formbinding
Ok, problem solved. I had the xml-file opend in Eclipse. Sometimes Cocoon could write sometimes not. Confusing :-/ kind regards, Niclas ZongoZongo wrote: Hi Have a look at the code: function showObject(objectType, id) { var factory = Packages.de.doccollector.ObjectFactory.getInstance(); var obj = factory.getFormObject(objectType, id, 0); obj.writeFormFiles(); var form = new Form(forms/object-definition.xml); form.createBinding(forms/object-binding.xml); var doc = loadDocument(forms/object-data.xml); form.load(doc); form.showForm(form/template/object.source); form.save(doc); saveDocument(doc, forms/object-data.xml); cocoon.sendPageAndWait(anypage); } I enter this function from a navigation point. The function creates the sufficient formfiles, displays the form, the user can do some input und the data is written back to the xml file. When I enter this function the first time, the formbinding works fine. But if I repeatedly enter the form, the modified data isnt written back to its xml-file. Displaying the data from the xml-file always works. Any Ideas? kind regards, Niclas -- View this message in context: http://www.nabble.com/problem-with-xml-formbinding-tf2815189.html#a7889018 Sent from the Cocoon - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
problem with xml formbinding
Hi Have a look at the code: function showObject(objectType, id) { var factory = Packages.de.doccollector.ObjectFactory.getInstance(); var obj = factory.getFormObject(objectType, id, 0); obj.writeFormFiles(); var form = new Form(forms/object-definition.xml); form.createBinding(forms/object-binding.xml); var doc = loadDocument(forms/object-data.xml); form.load(doc); form.showForm(form/template/object.source); form.save(doc); saveDocument(doc, forms/object-data.xml); cocoon.sendPageAndWait(anypage); } I enter this function from a navigation point. The function creates the sufficient formfiles, displays the form, the user can do some input und the data is written back to the xml file. When I enter this function the first time, the formbinding works fine. But if I repeatedly enter the form, the modified data isnt written back to its xml-file. Displaying the data from the xml-file always works. Any Ideas? kind regards, Niclas -- View this message in context: http://www.nabble.com/problem-with-xml-formbinding-tf2815189.html#a7856583 Sent from the Cocoon - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: which submitbutton was pressed?
Hi Couldnt solve the problem. But I am now using cforms. Inside the definition of the submitbutton you can set the attribute/ tags. But the problem stays the same. How can I find out which button has been pressed und how can I extract the attributes? Please help. This is very fundamtel for my further work :-( greetings, Niclas ZongoZongo wrote: Hi One simple short question :-) How can I get the name of the submitbutton that has been pressed in a form (inside flowscript). something like cocoon.request.getpressedButton() :-) By the way, I am not using CForms. But I think, that doesnt change anything. THX, Niclas -- View this message in context: http://www.nabble.com/which-submitbutton-was-pressed--tf2795896.html#a7830676 Sent from the Cocoon - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: which submitbutton was pressed?
The Problem is, that the forms are generated dynamically. So i dont now which buttons eaven exists. I hoped I could commit a set of variables that are transered depending on the button. Jeroen Reijn wrote: Hi Niclas, If you've defined the submit button as an fd:submit, you can react in flow based on the submitId of the form. You can request the submitId from flow by using: form.submitId Example: form.showForm(); switch(form.submitId) { case details: showDetails(); break; case create: createNew(); break; case ok: redisplayForm = false; processForm(form); break; } I hope this helps you out. Kind regards, Jeroen Reijn ZongoZongo wrote: Hi Couldnt solve the problem. But I am now using cforms. Inside the definition of the submitbutton you can set the attribute/ tags. But the problem stays the same. How can I find out which button has been pressed und how can I extract the attributes? Please help. This is very fundamtel for my further work :-( greetings, Niclas ZongoZongo wrote: Hi One simple short question :-) How can I get the name of the submitbutton that has been pressed in a form (inside flowscript). something like cocoon.request.getpressedButton() :-) By the way, I am not using CForms. But I think, that doesnt change anything. THX, Niclas - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/which-submitbutton-was-pressed--tf2795896.html#a7831182 Sent from the Cocoon - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: which submitbutton was pressed?
Yea, that sounds great. Sadly I get a null value forr the var attribute :-( Thats one of my widgets: fd:submit id=link-contributionDOT2 fd:labelDatenbankkomprimierung/fd:label fd:attributes attribute name=objectType value=link-contribution / attribute name=id value=2 / /fd:attributes /fd:submit Why is this so difficult :-D Niclas Simone Gianni-2 wrote: ZongoZongo wrote: The Problem is, that the forms are generated dynamically. So i dont now which buttons eaven exists. Hi Niclas, you can write the following : var buttonid = form.submitId; var widget = form.lookupWidget(buttonid); var attribute = widget.getAttribute(myattribute); More or less .. :) I don' t have the code by hand, but that's the idea. Simone - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/which-submitbutton-was-pressed--tf2795896.html#a7831932 Sent from the Cocoon - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: which submitbutton was pressed?
@Reijn: I am still not that familiar with cocoon. I would be kind, if you could post the sourcecode, of how to fetch the value. Thanks a lot regards, Niclas Jeroen Reijn wrote: Niclas, now I understood what went wrong before. Try fetching the value after putting the namespace in front the attribute: fd:submit id=link-contributionDOT2 fd:labelDatenbankkomprimierung/fd:label fd:attributes fd:attribute name=objectType value=link-contribution / fd:attribute name=id value=2 / /fd:attributes /fd:submit Does this help? I tried it with cocoon 2.1.10 and it seems to work. Kind regards, Reijn ZongoZongo wrote: Yea, that sounds great. Sadly I get a null value forr the var attribute :-( Thats one of my widgets: fd:submit id=link-contributionDOT2 fd:labelDatenbankkomprimierung/fd:label fd:attributes attribute name=objectType value=link-contribution / attribute name=id value=2 / /fd:attributes /fd:submit Why is this so difficult :-D Niclas Simone Gianni-2 wrote: ZongoZongo wrote: The Problem is, that the forms are generated dynamically. So i dont now which buttons eaven exists. Hi Niclas, you can write the following : var buttonid = form.submitId; var widget = form.lookupWidget(buttonid); var attribute = widget.getAttribute(myattribute); More or less .. :) I don' t have the code by hand, but that's the idea. Simone - 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] -- View this message in context: http://www.nabble.com/which-submitbutton-was-pressed--tf2795896.html#a7832696 Sent from the Cocoon - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
which submitbutton was pressed?
Hi One simple short question :-) How can I get the name of the submitbutton that has been pressed in a form (inside flowscript). something like cocoon.request.getpressedButton() :-) By the way, I am not using CForms. But I think, that doesnt change anything. THX, Niclas -- View this message in context: http://www.nabble.com/which-submitbutton-was-pressed--tf2795896.html#a7800473 Sent from the Cocoon - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Aggregation and CForms: redisplay
Hi I have an application, that is aggregated of several regions like navigation, header etc. In the main area I have some CForms. Some of the fields are required. The Problem is as follows: If one field is not filled, the form is beeing redisplayed. But ONLY the form. Navigation, header etc. are not shown. Some sitmemap extractions: map:match pattern=form-template-* map:generate type=jx src=forms/{1}-template.xml/ map:transform type=browser-update/ map:transform type=i18n map:parameter name=locale value=en-US/ /map:transform map:transform src=forms-samples-styling.xsl/ map:select type=ajax-request map:when test=true map:serialize type=xml/ /map:when map:otherwise map:serialize type=xhtml/ /map:otherwise /map:select /map:match map:match pattern=* map:aggregate element=site map:part element=navigation src=cocoon:/navigation strip-root=true/ map:part src=cocoon:/main-{1} element=main/ map:part element=header src=header.xml strip-root=true/ /map:aggregate map:transform type=xslt src=stylesheets/finalize.xsl/ map:serialize type=html/ /map:match /map:pipeline the pipelinecall from the flowscript: form.showForm(form-template-objectDefinition); The Problem is, that Cocoon only redisplays the main area, because the pipelinecall to the formtemplate from the flowscript doesnt match the aggregator. The question is. How must the aggregator und the matchers be designed, that the redisplay of a forms shows all parts of the aggregation? Or is there a possibility to tell Cocoon, which pipline has to be called in the case of a redisplay. Greetings, Niclas -- View this message in context: http://www.nabble.com/Aggregation-and-CForms%3A-redisplay-tf2773278.html#a7735895 Sent from the Cocoon - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
CForms: Dynamic XML-binding
Hi I have a simple short problem. I have a CForm and want to bind data to the form, that is generated by a cocoon Pipeline. My first idea was to var xmlDocument = loadDocument(cocoon:/mypipeline) form.load(xmlDocument) But of cause it doesnt work, because loadDocument needs a String as parameter. Is there a simple solution to generate the xmlDocument? Dont want to write a javabean every time. THX a lot, Niclas -- View this message in context: http://www.nabble.com/CForms%3A-Dynamic-XML-binding-tf2755051.html#a7682444 Sent from the Cocoon - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Problem with Java and Flowscript
Hi I have a Problem to import a javaclass in flowscript. The poblem doesnt arise with simple javaclasses. The code is tested and works in the eclipse enviroment. Ok, now the sourcecode: ## package de.doccollector.binding; import de.doccollector.*; import java.sql.*; import java.util.Vector; import java.util.Iterator; public class ManageObjects{ public static Objects load(Objects objects){ Vector vector = new Vector(); //create DB connection JDBCConnection conn = new JDBCConnection(); try{ Statement stat = conn.getStatement(); ResultSet rset = stat.executeQuery(SELECT name FROM Object WHERE entrance=0); while(rset.next()){ vector.add(rset.getString(name)); } } catch (SQLException sqle){ System.err.println(sqle); } conn.close(); objects.setObjectList(vector); return objects; } public static void save(Objects objects){ Vector vector = objects.getObjectList(); JDBCConnection conn = new JDBCConnection(); try{ Statement stat = conn.getStatement(); stat.executeUpdate(UPDATE Objects SET entrance=0); Iterator iterator = vector.iterator(); while(iterator.hasNext()){ String objectName = (String)iterator.next(); stat.executeUpdate(UPDATE Objects SET entrance=1 WHERE name=\ + objectName +\); } } catch (SQLException sqle){ System.err.println(sqle); } } } ### This class takes a javabean and loades and saves the fields respectively. I call this in flowscript as follows: ### var objectBean = new Packages.de.doccollector.binding.Objects(); importClass(Packages.de.doccollector.binding.ManageObjects); objectBean = ManageObjects.load(objectBean); ### Following error occurs ## org.mozilla.javascript.EvaluatorException: file:/C:/Programme/Apache Software Foundation/Tomcat 5.5/webapps/cocoon/doccollector/flows/configuration.js, line 13: Failed to compile Java class de.doccollector.binding.ManageObjects$load: file:/C:/Programme/Apache Software Foundation/Tomcat 5.5/webapps/cocoon/javaClasses/de/doccollector/binding/ManageObjects.java: Line 3: The import de.doccollector is never used file:/C:/Programme/Apache Software Foundation/Tomcat 5.5/webapps/cocoon/javaClasses/de/doccollector/binding/ManageObjects.java: Line 4: The import java.sql is never used file:/C:/Programme/Apache Software Foundation/Tomcat 5.5/webapps/cocoon/javaClasses/de/doccollector/binding/ManageObjects.java: Line 5: The import java.util.Vector is never used file:/C:/Programme/Apache Software Foundation/Tomcat 5.5/webapps/cocoon/javaClasses/de/doccollector/binding/ManageObjects.java: Line 6: The import java.util.Iterator is never used file:/C:/Programme/Apache Software Foundation/Tomcat 5.5/webapps/cocoon/javaClasses/de/doccollector/binding/ManageObjects.java: Line 8: The public type ManageObjects must be defined in its own file ## I really dont understand this. All importet classes ARE used. Besides the type ManageObjects IS defined it its own file. So please help me. I already spent so much time to solve this problem. Thanks Niclas -- View this message in context: http://www.nabble.com/Problem-with-Java-and-Flowscript-tf2724087.html#a7596606 Sent from the Cocoon - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]