Re: Validation de formulaire Ajax
Bonjour, Merci pour la réponse. Oui, j'ai bien un pipe qui traite ça : map:match type=request pattern=continuation-id map:call continuation={request-param:continuation-id}/ /map:match J'ai essayé celui que tu me conseilles et là, les actions Ajax ne fonctionnent plus. je crois comprendre : Mes actions Ajax déclenchent des POST du genre : http://serveur/appli/%5Bobject%20HTMLInputElement%5D Cela ne pose pas de problème pour les actions Ajax (ajout de ligne de repeater, qui fonctionne), mais en pose lors de la validation globale du formulaire. Après m'être renseigné sur ce type de problème, il semblerait que l'action du formulaire ne soit pas appelée, car non reconnue. Et je ne sais pas pourquoi. Et donc, ton pipe n'est pas exécuté... Par contre les POST manuels continue.html fonctionnent bien, ce qui veut dire que ton pipe est efficace, le formulaire est validé et le sendPage bien exécuté. Reste à faire en sorte que les POST appellent bien l'action associée au formulaire. Une idée ? André Davignon Le 15/05/2008 06:20, Marc Salvetti (par Internet, dépôt [EMAIL PROTECTED]) a écrit : Bonjour André, est-ce que tu as bien un pipe pour la continuation. Dans mon appli j'ai plutot qq chose comme ca et ca marche bien : ft:form-template action=continue.html method=post ajax=true ft:widget id=continuation-idfi:styling type=hidden/fi:styling value=#{$cocoon/continuation/id}//ft:widget et dans la sitemap map:match pattern=**continue.html map:call continuation={request-param:continuation-id}/ /map:match Marc - Liste francophone Apache Cocoon -- http://cocoon.apache.org/fr/ Pour vous desinscrire : mailto:[EMAIL PROTECTED] Autres commandes : mailto:[EMAIL PROTECTED]
Re: Validation de formulaire Ajax
Si mon souvenir est bon, normalement dans le html tu devrais voir sur tes actions ajax qqchose du genre onclick=submit_form(this) (ajouté automatiquement par le block forms sur les widgets) qui va envoyer une requete xmlhttprequest, laquelle doit etre ensuite traitee au niveau de la sitemap de facon a renvoyer uniquement les elements a mettre a jour (les bu:replace) en gros, dans ton pipe final il faut qq chose comme ... map:transform type=browser-update/ ... 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 il faut aussi preciser au niveau des widgets qu'ils doivent envoyer le form sur le onchange ce qui doit creer les onclick=form_submit : ft:widget id= fi:styling submit-on-change=true/ /ft:widget Le 15 mai 2008 14:12, [EMAIL PROTECTED] a écrit : Bonjour, Merci pour la réponse. Oui, j'ai bien un pipe qui traite ça : map:match type=request pattern=continuation-id map:call continuation={request-param:continuation-id}/ /map:match J'ai essayé celui que tu me conseilles et là, les actions Ajax ne fonctionnent plus. je crois comprendre : Mes actions Ajax déclenchent des POST du genre : http://serveur/appli/%5Bobject%20HTMLInputElement%5D Cela ne pose pas de problème pour les actions Ajax (ajout de ligne de repeater, qui fonctionne), mais en pose lors de la validation globale du formulaire. Après m'être renseigné sur ce type de problème, il semblerait que l'action du formulaire ne soit pas appelée, car non reconnue. Et je ne sais pas pourquoi. Et donc, ton pipe n'est pas exécuté... Par contre les POST manuels continue.html fonctionnent bien, ce qui veut dire que ton pipe est efficace, le formulaire est validé et le sendPage bien exécuté. Reste à faire en sorte que les POST appellent bien l'action associée au formulaire. Une idée ? André Davignon Le 15/05/2008 06:20, Marc Salvetti (par Internet, dépôt [EMAIL PROTECTED]) a écrit : Bonjour André, est-ce que tu as bien un pipe pour la continuation. Dans mon appli j'ai plutot qq chose comme ca et ca marche bien : ft:form-template action=continue.html method=post ajax=true ft:widget id=continuation-idfi:styling type=hidden/fi:styling value=#{$cocoon/continuation/id}//ft:widget et dans la sitemap map:match pattern=**continue.html map:call continuation={request-param:continuation-id}/ /map:match Marc - Liste francophone Apache Cocoon -- http://cocoon.apache.org/fr/ Pour vous desinscrire : mailto:[EMAIL PROTECTED] Autres commandes : mailto:[EMAIL PROTECTED]
Re: Validation de formulaire Ajax
Si mon souvenir est bon, normalement dans le html tu devrais voir sur tes actions ajax qqchose du genre onclick=submit_form(this) (ajouté automatiquement par le block forms sur les widgets) qui va envoyer une requete xmlhttprequest, laquelle doit etre ensuite traitee au niveau de la sitemap de facon a renvoyer uniquement les elements a mettre a jour (les bu:replace) Oui. en gros, dans ton pipe final il faut qq chose comme ... map:transform type=browser-update/ ... 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 C'est ce qui figure. Le transformer browser-update envoie bien les bu dans ma configuration précédente avec le pipe map:match type=request pattern=continuation-id map:call continuation={request-param:continuation-id}/ /map:match il faut aussi preciser au niveau des widgets qu'ils doivent envoyer le form sur le onchange ce qui doit creer les onclick=form_submit : ft:widget id= fi:styling submit-on-change=true/ /ft:widget Bien vu. Je viens de le faire et en HTML, je me retrouve donc avec des input de ce genre : input id=addCHAMP type=submit name=addCHAMP title= value=+ class=forms action active onchange=forms_submitForm(this)/ Hélas, les actions Ajax déclenchent toujours des POST de ce type : http://serveur/appli/5Bobject%20HTMLInputElement%5D Et donc n'appellent pas l'action du formulaire. Je ne vois pas pourquoi Que peut-il se passer ? André Davignon - Liste francophone Apache Cocoon -- http://cocoon.apache.org/fr/ Pour vous desinscrire : mailto:[EMAIL PROTECTED] Autres commandes : mailto:[EMAIL PROTECTED]
Re: Validation de formulaire Ajax
ca n'est probablement pas le probleme mais il me semble que le submitonchange=true n'est pas necessaire pour les input de type submit, c'est plus pour les listes de selection ou les champs texte. Pour ton probleme, je pense qu'il faut passer au debugger javascript pour arriver a voir ce qui se passe. Il y a une extention firefox venkmark qui est pas mal pour ça Marc 2008/5/15 [EMAIL PROTECTED]: Si mon souvenir est bon, normalement dans le html tu devrais voir sur tes actions ajax qqchose du genre onclick=submit_form(this) (ajouté automatiquement par le block forms sur les widgets) qui va envoyer une requete xmlhttprequest, laquelle doit etre ensuite traitee au niveau de la sitemap de facon a renvoyer uniquement les elements a mettre a jour (les bu:replace) Oui. en gros, dans ton pipe final il faut qq chose comme ... map:transform type=browser-update/ ... 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 C'est ce qui figure. Le transformer browser-update envoie bien les bu dans ma configuration précédente avec le pipe map:match type=request pattern=continuation-id map:call continuation={request-param:continuation-id}/ /map:match il faut aussi preciser au niveau des widgets qu'ils doivent envoyer le form sur le onchange ce qui doit creer les onclick=form_submit : ft:widget id= fi:styling submit-on-change=true/ /ft:widget Bien vu. Je viens de le faire et en HTML, je me retrouve donc avec des input de ce genre : input id=addCHAMP type=submit name=addCHAMP title= value=+ class=forms action active onchange=forms_submitForm(this)/ Hélas, les actions Ajax déclenchent toujours des POST de ce type : http://serveur/appli/5Bobject%20HTMLInputElement%5D Et donc n'appellent pas l'action du formulaire. Je ne vois pas pourquoi Que peut-il se passer ? André Davignon - Liste francophone Apache Cocoon -- http://cocoon.apache.org/fr/ Pour vous desinscrire : mailto:[EMAIL PROTECTED] Autres commandes : mailto:[EMAIL PROTECTED]
Re: Query Database Produce Excel Document
As per below - except I would not be using ESQL but the SQL transformer to read data from the database and create the XML... On 2008/05/14 at 08:44, in message [EMAIL PROTECTED], Ken Starks [EMAIL PROTECTED] wrote: If you are new to Cocoon, I would put the email requirement, and produce a (virtual) spreadsheet in the user's browser. You scheme of work can then follow the most usual Cocoon sitemap design: i) A generator (Non-XML to XML) ii) One or more Transformation steps (XML_1 to XML_2 to XML_3 to ..., as required) iii) A serialiser (XML to Non-XML) i. I generally use an ESQL logicsheet for reading my database, which is a generator and has to go at the start of your pipeline. But I find it simpler than an 'Action' which can go anywhere in the pipeline. It turns your payload of data into an XML format which you can design yourself; as well as coding various errors and empty payloads in XML. (cf Appendix E of Mozcar and Aston ) ii. You then need to write XSLT to turn this XML into something acceptable to the HSSF serialiser. I'm not sure how up to date it is, or how up to date the HSSF serialiser, but you can get some documentation from: www.jfree.org/jworkbook/download/gnumeric-xml.pdf Data values are pretty much OK to deal with, but formulas are hell (IMHO). No wonder its called HSSF (Horrible Spread Sheet Format). iii. The HSSF serialiser can be used out of the box. Look at the Cocoon Samples 'Hello World' (Excel pipeline) to see how to set the correct Mime-type. In fact, the best approach for most people, is to start with a working copy of the Hello World Example, and gradually elaborate it. After a bit of experience you will know what kind of XMl at the start of the Transformation stage will make life easy. If it is hard to produce it using ESQL, you can consider doing some preliminary work it in the database, using a database view. (i.e. Copy the main bits of Cocoon-Home/samples/hello-world/ to Cocoon-Home/MyHello-World. You need: content/hello.xml sitemap.xmap with most map:match elements deleted apart from hello.xml, hello.html, hello.txt style/xsl/page2html.xsl style/xsl/page2xsl.xml Unfortunately, the pipeline for hello.xsl has been carefully hidden and is no longer part of samples/hello-world/sitemap.xmap. It is now in samples/blocks/poi/sitemap.xmap, but you might as well just copy this into Myhello-world/sitemap.xmap: map:match pattern=hello.xls map:generate src=content/hello.xml/ map:transform src=style/xsl/page2xls.xsl/ map:serialize type=xls/ /map:match Point your browser to: http://your/usual/cocoon/url/and/port/Myhello-world/hello.xls Or if you want differently named source files, use a wildcard: map:match pattern=*.xls map:generate src=content/{1}.xml/ map:transform src=style/xsl/page2xls.xsl/ map:serialize type=xls/ /map:match ... and use widldcards in all the other pipelines too. Edit hello.xml, or write something similar, and see what difference it makes to the various styles of output. You can look at the XML at any stage either by defining a special pipeline, or by defining a Cocoon view. The special pipeline is easier, frankly, if you are a beginner. Matthew Monkan wrote: Hey everyone. I'm somewhat new to XML and Cocoon, so please pardon my ignorance with the subject. :confused: I am using Cocoon 2.1.11 on Windows XP. I've been using the Moczar Aston book and have been able to create the static page examples in Chapter 7 within the downloaded Cocoon folder. Ultimately, I need to be able to query info from a database and output an Excel spreadsheet. Then, I need Cocoon to send out an e-mail with the Excel spreadsheet attached. I basically need help understanding what tools in Cocoon I need to use. Can someone verify these or make suggestions? Here are some of the things I listed down so far: For DB to Excel document: SQLTransformer (queries the database, passing the result back in the SAX event stream) HSSF Serializer (turns SAX events into Excel spreadsheet document) To send out the e-mail: Cocoon mail block (SendMail Transformer?) I don't really understand what generator to use. I'm trying to create an example of this offline using MySQL. So for example, I have a small table created in MySQL; I want to say, stick some data from it in some shape or form into Excel, and send out a quick e-mail to a hardcoded e-mail address with the Excel document attached. I also need to be able to run this from the offline CLI. Can someone help me understand the most optimal flow of information I would use. I want to create a sequence diagram to help me visualize this, so if someone could help me understand what info is being passed where, that would be extremely helpful. All the terminology in Cocoon is killing me, and I need help focusing on what is most important to know for these requirements. - To
Re: 2.2 OutOfMemoryError
Andre Thenot wrote: On May 14, 2008, at 6:42, Luca Morandini wrote: No matter how much you increase your PermGenSpace, sooner or later you will hit the wall (every redeploy decreases the amount of PermGenSpace available). Ok thanks, this answers my question. I'll simply restart the server at each deployment which, as you pointed out, is not terribly frequent in production. ...or, if you are in for some experimentation, give JRockIt + JBoss a go and solve this problem for good. Regards, Luca Morandini www.lucamorandini.it - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
lucene block has unrecognized line ending style
Hi guys, in trying to run an svn up on the blocks directory, I found an error that prevented the update from occurring. The lucene block has a line ending problem. There is probably a setting that tells subversion to ignore this but I do not know it without poking around. Thanks for your help, regards Ross -- View this message in context: http://www.nabble.com/lucene-block-has-unrecognized-line-ending-style-tp17250801p17250801.html 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 Aggregator Widget--preserving line breaks in text areas
Sure thing...note that I amusing a somewhat strange field separator @[EMAIL PROTECTED] It is a aggregator made up of four fields. Field 1 is a string with validation to ensure only numbers can be entered. Field 2 is styled as a text area. It appears I can enter line breaks and that these get saved to the database. However, they do not appear to be retrievable and displayable...the entire aggregate showing up blank. thx! Paul Here is the snippet from the form definition file: fd:aggregatefield id=taskaggregate required=false fd:label/ fd:datatype base=string/ fd:split pattern=(.*)@!#-_-#!@(.*) fd:map group=1 field=part1/ fd:map group=2 field=part2/ /fd:split fd:combine expression = 'Concat(NVL(part1, ), @!#-_-#!@, NVL(part2, ))'/ fd:widgets fd:field id=part1 required=false fd:datatype base=string/ fd:helpHelp info 3/fd:help fd:validation fd:regexp pattern=[-+]?([0-9]*\.)?[0-9]+([eE][-+]?[0-9]+)? fd:failmessageOnly decimals (numbers) are allowed here./fd:failmessage /fd:regexp /fd:validation fd:on-value-changed/ /fd:field fd:field id=part2 required=false fd:datatype base=string/ fd:validation/ /fd:field /fd:widgets /fd:aggregatefield Here is the snippet from the form styling file: tr td width=3/td width=174 bgColor=#f7f3d6 height=10font style=font-size: 9pt face=ArialCustomer Number/font/td td valign=topft:aggregate-widget id=taskaggregateft:widget id=part1fi:styling size=20//ft:widget/ft:aggregate-widget/td /tr tr td width=4 height=4/ td colspan=2 width=746 height=4/ /tr tr td width=3/td width=174 bgColor=#f7f3d6 height=10font style=font-size: 9pt face=ArialCustom Desc./font/td td valign=topft:aggregate-widget id=taskaggregateft:widget id=part2fi:styling type=textarea rows=10 size=20//ft:widget/ft:aggregate-widget/td /tr - Original Message - From: Joerg Heinicke [EMAIL PROTECTED] To: users@cocoon.apache.org Sent: Thursday, May 15, 2008 12:06 AM Subject: Re: CForms Aggregator Widget--preserving line breaks in text areas On 14.05.2008 13:00, Paul Joseph wrote: However, when I use a Text Area type widget in an aggregator, I find that the Aggregator does not seem to be able to retrieve and display any information in any of the widgets that make up the aggregator, IF I enter even a single line break in the Text Area widget that is part of the Aggregator widget. It is able to save it with line breaks to the database--it is only on retrieval that it the Aggregator seems to have difficulty due to the line breaks. With aggregator you mean the aggregate field widget [1]? Can you show some code? Joerg [1] http://cocoon.apache.org/2.2/blocks/forms/1.0/486_1_1.html - 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]
Strange (?) cocoon.context.getInitParameter() == null problem
Hi, I'm using Cocoon 2.2 RC2 on top of Tomcat and I had a strange problem with getInitParameter(). I defined some parameters in Tomcat's context block for my application, eg: Parameter name=my.param value=Your param is quite nice/ Then, in flow, I got this: cocoon.context.getInitParameter(my.param) == null So, I tried this: var E = cocoon.context.getInitParameterNames(); while( E.hasMoreElements() ) { var e = E.nextElement(); cocoon.log.error(N: + e + ']'); cocoon.log.error(V: + cocoon.context.getInitParameter(e) + ']'); } And the resulting log lines were: 2008-05-15 12:01:47,010 http-8080-2 ERROR fom.FOM_Cocoon - N: my.param] 2008-05-15 12:01:47,011 http-8080-2 ERROR fom.FOM_Cocoon - V: null] So, my.param reached cocoon from the Tomcat Context, but not its value?! However, if put some servlet:init-params in the servlet:context for my block, then everything works: So, if I have: servlet:init-params entry key=enable-uploads value=true / entry key=upload-max-size value=100 / /servlet:init-params in my serlvet-service.xml file, then the above loop gives me: 2008-05-15 12:01:47,010 http-8080-2 ERROR fom.FOM_Cocoon - N: my.param] 2008-05-15 12:01:47,011 http-8080-2 ERROR fom.FOM_Cocoon - V: Your Param is quite nice] 2008-05-15 12:00:56,153 http-8080-2 ERROR fom.FOM_Cocoon - N: enable-uploads] 2008-05-15 12:00:56,153 http-8080-2 ERROR fom.FOM_Cocoon - V: true] 2008-05-15 12:00:56,153 http-8080-2 ERROR fom.FOM_Cocoon - N: upload-max-size] 2008-05-15 12:00:56,153 http-8080-2 ERROR fom.FOM_Cocoon - V: 100] Not sure if this classifies as a bug, or if I'm confused. Cheers and Thanks, Shahriar. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: lucene block has unrecognized line ending style
Hi Ross I found deleting the folder containing the faulty file and then doing svn update removed the problem. Best regards William On 15 May, 2008, at 12:09 pm, rossputin wrote: Hi guys, in trying to run an svn up on the blocks directory, I found an error that prevented the update from occurring. The lucene block has a line ending problem. There is probably a setting that tells subversion to ignore this but I do not know it without poking around. Thanks for your help, regards Ross -- View this message in context: http://www.nabble.com/lucene-block- has-unrecognized-line-ending-style-tp17250801p17250801.html Sent from the Cocoon - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Strange (?) cocoon.context.getInitParameter() == null problem
On 15.05.2008 12:16, Shahriar Aghajani wrote: Hi, I'm using Cocoon 2.2 RC2 on top of Tomcat and I had a strange problem with getInitParameter(). I defined some parameters in Tomcat's context block for my application, eg: These init parameters are not in Tomcat's servlet.xml (or whatever it is named), but in the webapp's web.xml. Joerg - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: SQL Server 2005?
On 9/21/2006 4:15 PM, Lars Huttar wrote: Hello, Does anyone have Cocoon connecting successfully to SQL Server 2005? We've been using Cocoon for quite some time (currently 2.1.7) with SQL Server 2000. Now I've been trying to switch to 2005 and Cocoon keeps giving an error ERROR (2006-09-21) 16:03.33:230 [sitemap.generator.serverpages] (/mount/gem/enterprise/sMicrosoft/IT_Servers/guest/select_IT_Server) http-80-Processor25/select_IT_Server_xsp: java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Error establishing socket. I tried replacing the three ms jars (mssqlserver.jar, msutil.jar, and msbase.jar) with sqljdbc.jar, the new sql server 2005 jdbc driver from ms download site. (This in Cocoon's WEB-INF\lib folder.) I also adjusted WEB-INF\web.xml to change the driver class name from com.microsoft.jdbc.sqlserver.SQLServerDriver to com.microsoft.sqlserver.jdbc.SQLServerDriver However, I still get the error (core.log:) WARN(2006-09-21) 16:14.13:299 [core.manager] (/mount/gem/enterprise/sMicrosoft/IT_Servers/guest/select_IT_Server) http-80-Processor25/ResourceLimitingJdbcDataSource: Could not return Connection java.sql.SQLException: No suitable driver (error.log:) ERROR (2006-09-21) 16:14.13:299 [sitemap.generator.serverpages] (/mount/gem/enterprise/sMicrosoft/IT_Servers/guest/select_IT_Server) http-80-Processor25/select_IT_Server_xsp: java.sql.SQLException: No suitable driver (Yes, I restarted Tomcat after each change.) Any suggestions or reports of success would be appreciated. Lars 20 months later... Turns out we also needed to change our db connection URLs (in the datasources in cocoon.xconf). We had to change 'jdbc:Microsoft:sqlserver://' to 'jdbc:sqlserver://', i.e. get rid of Microsoft and everything was fine. ;-) Thanks to Rick Harman for discovering this. Lars - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
date formatting issue
Hello! I have a cocoon field, formated like that : fd:datatype base=date fd:convertor type=formatting lenient=true fd:patterns fd:patterndd/MM//fd:pattern /fd:patterns /fd:convertor /fd:datatype My problem is that, when i input a non-valid date, it is accepted. for example, if I input 32/12/2001, it is accepted as 01/01/2002. does anyone know a way to correct this? Thanks a lot.