Re: [2.1] Non-trivial uses of i18n transformer
Hello, I don't think you can have translated text embeded in js code like this. I think you have to move the string to the xml markup as in your first message, then let js handle strings that are already translated 2016-05-23 21:24 GMT+07:00 Christopher Schultz <ch...@christopherschultz.net >: > Francesco, > > On 5/23/16 9:58 AM, Francesco Chicchiriccò wrote: > > On 23/05/2016 15:55, Christopher Schultz wrote: > >> Marc, > >> > >> On 5/23/16 9:39 AM, Marc Salvetti wrote: > >> > Try something like this >> > I18n-attr="title"/> > >> > >> > That's by memory but should find the exact syntax in the doc > >> > >> Yep, this totally works. > >> > >> Since I'm on a roll, how about this: > >> > >> <xsl:comment> > >> function whatever() { > >> document.getElementById('link').title = 'translated-text'; > >> } > >> </xsl:comment> > >> > >> Probably the simplest way is to just remove the from > >> around the script, since I don't think that's actually been necessary > >> since the days of MSIE4. Is there another convenient way to do it? > > > > Why not > > > > > > <![CDATA[ > > function whatever() { > > document.getElementById('link').title = 'translated-text'; > > } > > ]]> > > > > Since the 'translated-text' is really , it would be ignored > if it were in a CDATA section. > > > <![CDATA[ > function whatever() { > document.getElementById('link').title = '<i18n:text key="foo" />'; > } > ]]> > > > That's not going to work any better than the javascript embedded within > an element, right? > > Thanks, > -chris > > - > To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org > For additional commands, e-mail: users-h...@cocoon.apache.org > >
Re: [2.1] Non-trivial uses of i18n transformer
Hi Chris, Try something like this That's by memory but should find the exact syntax in the doc Hope this helps, Marc Le 23 mai 2016 8:31 PM, "Christopher Schultz"a écrit : > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > All, > > I'm finally getting around to internationalizing the XSLT-based parts > of my application, and I'm running into a problem with non-trivial > uses of in a template. > > Here's an excellent example of the kind of thing I'm having trouble > with. I have a single XML document going through a pipeline with a few > transformations in it. There is one major transform where pretty much > everything interesting happens. I'd like to use in there to > produce an HTML element with a localized "title" attribute. > Something like this: > > > click me > > > Localizing the "click me" text is trivial. Doing the same with the > "title" attribute is not. > >" [...] > > > That obviously won't work because the attribute won't be parsed and > evaluated by the XSLT parser. Use of {} around it doesn't work because > it's an element, not an expression. > > > > > > [...] > > > That doesn't work because evidently can't contain > . At first, this irritated me but then I realized that this > would never work, because the second case would basically degenerate > into the first case after the completed its work for > this template before I (later) ran the I18nTransformer. > > The only idea I've had is to flip the current i18n process on its head > and instead do this: > > > > > > > > > > > > > > > > > > > > So instead of transforming the input document with an > internationalized stylesheet, then transforming the result with the > i18n transformer, I first transform the transformer itself to get a > localized transformer, and transform the input document with *that*. > > Is that "recommended technique"? Alternatively, is that entirely stupid? > > If this is a good idea, how specifically can I accomplish what I have > above? I haven't yet tried it, but I'm concerned I'll have the same > problem with elements not being allowed in other elements. > > Any suggestions? > > Thanks, > - -chris > -BEGIN PGP SIGNATURE- > Comment: GPGTools - http://gpgtools.org > Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ > > iEYEARECAAYFAldDBi0ACgkQ9CaO5/Lv0PC3HQCfQLoPna+oFFoWxXggz0rKwxis > vyAAn1IrMa5SNcy+8fhr6Wt5JxdJ8abT > =i48t > -END PGP SIGNATURE- > > - > To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org > For additional commands, e-mail: users-h...@cocoon.apache.org > >
Re: switch off parser validation in cocoon 2.2
Thanks a lot for the pointer, it seems to be what I'm looking for. Marc 2008/6/7 Grzegorz Kossakowski [EMAIL PROTECTED]: Marc Salvetti pisze: Hello, I'm having a big issue that just appeared after a server crash, I don't know why, either it's a configuration problem but now get the following error when accessing some parts of the project. From what I understand, it's an xml validation issue as apparently the parser try to find an xml schema or dtd to validate but for some reason I don't get it doesn't look locally for it, which is obviously very bad for performances and is now creating this error. Does anyone have an idea on how to either switch off validation or at least make it local ? You should use local catalog for entity resolution. I have found information about C2.1 only: http://cocoon.apache.org/2.1/userdocs/concepts/catalog.html but I guess this should be similar in 2.2 to some extent. -- Grzegorz Kossakowski - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Saving a file from the cocoon webapp
Hello, I'm having a file permission problem with my webapp, and it seems to be due to the app overwriting the saved file rather than saving it. After the file is saved, the group have changed to nobody, which creates problems in my case. I'm using a function that was fond in the cocoon examples and I'd like to change it so that it preserve the group but I haven't found what to do by looking at the api. This is the function I'm using to save files : function saveDocument(document, uri) { var source = null; var resolver = null; var outputStream = null; try { resolver = cocoon.getComponent(Packages.org.apache.cocoon.environment.SourceResolver.ROLE); source = resolver.resolveURI(uri); var tf = Packages.javax.xml.transform.TransformerFactory.newInstance(); if (source instanceof Packages.org.apache.excalibur.source.ModifiableSource tf.getFeature(Packages.javax.xml.transform.sax.SAXTransformerFactory.FEATURE)) { outputStream = source.getOutputStream(); var transformerHandler = tf.newTransformerHandler(); var transformer = transformerHandler.getTransformer(); transformer.setOutputProperty(encoding, UTF-8); transformer.setOutputProperty({ http://xml.apache.org/xslt}indent-amount;, 4); transformer.setOutputProperty({ http://xml.apache.org/xalan}indent-amount;, 4); transformer.setOutputProperty(Packages.javax.xml.transform.OutputKeys.INDENT, true); transformer.setOutputProperty(Packages.javax.xml.transform.OutputKeys.METHOD, xml); transformerHandler.setResult(new Packages.javax.xml.transform.stream.StreamResult(outputStream)); var streamer = new Packages.org.apache.cocoon.xml.dom.DOMStreamer(transformerHandler); streamer.setNormalizeNamespaces(false); //try streamer.stream(document); //catch //in case of exception, writing of the data should be canceled to avoid partial writing //if source.canCancel() //source.cancel(); //else ?? } else { throw new Packages.org.apache.cocoon.ProcessingException(Cannot write to source + uri); } } finally { if (source != null) resolver.release(source); cocoon.releaseComponent(resolver); if (outputStream != null) { try { outputStream.flush(); outputStream.close(); } catch (error) { cocoon.log.error(Could not flush/close outputstream: + error); } } } } Any help would be greatly appreciated Marc
switch off parser validation in cocoon 2.2
Hello, I'm having a big issue that just appeared after a server crash, I don't know why, either it's a configuration problem but now get the following error when accessing some parts of the project. From what I understand, it's an xml validation issue as apparently the parser try to find an xml schema or dtd to validate but for some reason I don't get it doesn't look locally for it, which is obviously very bad for performances and is now creating this error. Does anyone have an idea on how to either switch off validation or at least make it local ? Marc java.net.UnknownHostException: www.w3.org at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:177) at java.net.Socket.connect(Socket.java:518) at java.net.Socket.connect(Socket.java:468) at sun.net.NetworkClient.doConnect(NetworkClient.java:157) at sun.net.www.http.HttpClient.openServer(HttpClient.java:389) at sun.net.www.http.HttpClient.openServer(HttpClient.java:516) at sun.net.www.http.HttpClient.init(HttpClient.java:233) at sun.net.www.http.HttpClient.New(HttpClient.java:306) at sun.net.www.http.HttpClient.New(HttpClient.java:318) at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:788) at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:729) at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:654) at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:977) at org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(Unknown Source) at org.apache.xerces.impl.XMLEntityManager.startEntity(Unknown Source) at org.apache.xerces.impl.XMLEntityManager.startDTDEntity(Unknown Source) at org.apache.xerces.impl.XMLDTDScannerImpl.setInputSource(Unknown Source) at org.apache.xerces.impl.XMLDocumentScannerImpl$DTDDispatcher.dispatch(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source) at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source) at org.apache.excalibur.xml.impl.JaxpParser.parse(JaxpParser.java:315) at sun.reflect.GeneratedMethodAccessor53.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.cocoon.core.container.handler.PoolableComponentHandler$ProxyHandler.invoke(PoolableComponentHandler.java:147) at $Proxy0.parse(Unknown Source) at org.apache.excalibur.xmlizer.DefaultXMLizer.toSAX(DefaultXMLizer.java:128) at org.apache.cocoon.components.source.SourceUtil.toSAX(SourceUtil.java:185) at org.apache.cocoon.components.source.SourceUtil.toSAX(SourceUtil.java:155) at org.apache.cocoon.components.source.SourceUtil.toSAX(SourceUtil.java:226) at org.apache.cocoon.transformation.CIncludeTransformer.endTransformingElement(CIncludeTransformer.java:387) at org.apache.cocoon.transformation.AbstractSAXTransformer.endElement(AbstractSAXTransformer.java:485) at org.apache.xml.serializer.ToXMLSAXHandler.endElement(ToXMLSAXHandler.java:261) at org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:1399) at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2411) at org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:1374) at org.apache.xalan.templates.ElemApplyTemplates.transformSelectedNodes(ElemApplyTemplates.java:393) at org.apache.xalan.templates.ElemApplyTemplates.execute(ElemApplyTemplates.java:176) at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2411) at org.apache.xalan.templates.ElemCopy.execute(ElemCopy.java:114) at org.apache.xalan.templates.ElemApplyTemplates.transformSelectedNodes(ElemApplyTemplates.java:393) at org.apache.xalan.templates.ElemApplyTemplates.execute(ElemApplyTemplates.java:176) at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2411) at org.apache.xalan.transformer.TransformerImpl.applyTemplateToNode(TransformerImpl.java:2281) at org.apache.xalan.transformer.TransformerImpl.transformNode(TransformerImpl.java:1367) at org.apache.xalan.transformer.TransformerImpl.run(TransformerImpl.java:3458) at
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
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: Validation de formulaire Ajax
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 2008/5/14 [EMAIL PROTECTED]: Bonjour, J'ai un formulaire Ajax (ft:form-template method=POST ajax=true action=#{$cocoon/continuation/id} avec le flowscript suivant : var form = new Form(cocoon.parameters.form); form.createBinding(cocoon.parameters.binding); ... form.load(document); form.showForm(cocoon.parameters.show); cocoon.sendPage(cocoon.parameters.redirect); Les actions Ajax fonctionnent bien (ajout et suppression de ligne de repeater, etc...) mais la validation globale du formulaire avec le widget fd:submit n'a pas d'effet. Le formulaire reste dans form.showForm(cocoon.parameters.show) et le sendPage n'est pas exécuté. Y aurait-il quelque chose que j'aie oublié ? André Davignon - Liste francophone Apache Cocoon -- http://cocoon.apache.org/fr/ Pour vous desinscrire : mailto:[EMAIL PROTECTED] Autres commandes : mailto:[EMAIL PROTECTED]
Re: ajax request and another cform in the same page
Hi Cristopher, thanks for your explanations, i think it's related to the same problem, but i still have no idea on how to solve it. i will try to give a more detailed explanation of what i'm trying to do : on one page on my site, i have links that send an ajax request directly, outside of a cform, like this : function sendReq(strReq) { var req = createXHR(); if (req) { req.open(POST, strReq, true); // true = async req.setRequestHeader(Content-Type, application/x-www-form-urlencoded; charset=UTF-8); req.onreadystatechange = function() { if (req.readyState == 4) { handleBrowserUpdate(req); } } req.send(cocoon-ajax=true); } } this is received by the sitemap as an ajax request, somewhere in the pipe i add some bu:replace tags, transform this with the browser-update transformer and send this back to the above js function for browser updating. On some other pages, i have one cform with ajax turned on. Everything about this was working fine, until i tried to add a search cform on every page of the website. From what i understood to my problem, every time an ajax request is sent by whatever means (internal cforms or direct js call), to the server, the template generator tries to access the list of updated widgets in the search cform and crash because this list hasn't been initialized (NPE). Apparently, the normal behavior is to initialize it after the form is submited, which (wrongfully) assume that the ajax request was sent by this form and not by some other means (another cform submit or a direct js call) Or in other words :) direct js ajax request + no cform on the page = ok direct js ajax request + 1 cform on the page = bug cform ajax request + 1 cform on the page = ok cform ajax request + 2 cform on the page = bug Marc 2007/5/14, Christofer Dutz [EMAIL PROTECTED]: Hi Marc, do I understand your problem correct, that you have two forms on your page? This can be a problem. Since having a deeper cook into JavaFlow I could see, that the form instance is bound to an AvalonContext with a fixed Name. This means, that one FormInstance should overwrite the other one. I don't exactyl know how this is implemented in FlowScript, but since Generators like the SuggestionListGenerator also looks for a hard-coded CocoonFormsInstnce object, I guess this is generally done that way. Even if I know this doesn't help you solve the problem ... maybe it helps you find it. Feel free to contact me. I will do my best to help you if you provide a little more detailed description of your problem / applicatoin setup / intention. Chris Marc Salvetti schrieb: Hello, i'm running in a tricky problem while trying to add a search form to every page of the site. Anytime an ajax request is sent, either by a cform widget on another form, or by a custom js function, i get an error 500 : *Couldn't evaluate expression cformsHelper.pushWidget(id)* resource://org/apache/cocoon/forms/generation/jx-macros.xml - 45:52 // with a NPE in the pushWidget() method. Caused by: java.lang.NullPointerException at org.apache.cocoon.forms.generation.JXMacrosHelper.pushWidget( JXMacrosHelper.java:163) at org.apache.cocoon.forms.generation.JXMacrosHelper.pushWidget( JXMacrosHelper.java :231) at sun.reflect.GeneratedMethodAccessor100.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke( DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.apache.commons.jexl.util.introspection.UberspectImpl$VelMethodImpl.invoke (UberspectImpl.java:268) at org.apache.commons.jexl.parser.ASTMethod.execute(ASTMethod.java :61) at org.apache.commons.jexl.parser.ASTReference.execute (ASTReference.java:68) at org.apache.commons.jexl.parser.ASTReference.value( ASTReference.java:50) at org.apache.commons.jexl.ExpressionImpl.evaluate( ExpressionImpl.java:86) at org.apache.cocoon.components.expression.jexl.JexlExpression.evaluate (JexlExpression.java:47) ... 135 more By looking at the source, it appears that the member updatedWidgets has not been initialized before the call to pushWiget, which cause the NPE. Apparently, this is initialized in the call to form.process(), every time the form is submited. But in my case, i don't submit this form, but either another form or no form at all, so i don't really know what i should do to fix this problem. Any help would be greatly appreciated, Marc - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
ajax request and another cform in the same page
Hello, i'm running in a tricky problem while trying to add a search form to every page of the site. Anytime an ajax request is sent, either by a cform widget on another form, or by a custom js function, i get an error 500 : *Couldn't evaluate expression cformsHelper.pushWidget(id)* resource://org/apache/cocoon/forms/generation/jx-macros.xml - 45:52** with a NPE in the pushWidget() method. Caused by: java.lang.NullPointerException at org.apache.cocoon.forms.generation.JXMacrosHelper.pushWidget(JXMacrosHelper.java:163) at org.apache.cocoon.forms.generation.JXMacrosHelper.pushWidget(JXMacrosHelper.java:231) at sun.reflect.GeneratedMethodAccessor100.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.apache.commons.jexl.util.introspection.UberspectImpl$VelMethodImpl.invoke(UberspectImpl.java:268) at org.apache.commons.jexl.parser.ASTMethod.execute(ASTMethod.java:61) at org.apache.commons.jexl.parser.ASTReference.execute(ASTReference.java:68) at org.apache.commons.jexl.parser.ASTReference.value(ASTReference.java:50) at org.apache.commons.jexl.ExpressionImpl.evaluate(ExpressionImpl.java:86) at org.apache.cocoon.components.expression.jexl.JexlExpression.evaluate(JexlExpression.java:47) ... 135 more By looking at the source, it appears that the member updatedWidgets has not been initialized before the call to pushWiget, which cause the NPE. Apparently, this is initialized in the call to form.process(), every time the form is submited. But in my case, i don't submit this form, but either another form or no form at all, so i don't really know what i should do to fix this problem. Any help would be greatly appreciated, Marc
Re: [Re: Ajax + Formulaire]
A priori via le css mais c'est bizarre, pour moi elles prennent la largeur du mot le plus large Marc Le 02/05/07, Julien Flotté [EMAIL PROTECTED] a écrit : Merci pour ces precisions, j'ai reussi à m'en sortir :) J'ai un autre probleme concernant un tout autre sujet : les listes de suggestions. Y'a-t-il un moyen de definir une certaine largeur pour celles-ci simplement ? Par defaut, elles prennent toute la largeur de la frame. Julien
Re: Ajax + Formulaire
Bonjour, il faut avoir des bu:replace id= autour des données a rafraichir et il faut envoyer une requete xml post avec cocoon-ajax=true j'utilise ces petites fctions qui sont bien pratique function createXHR() { if (window.XMLHttpRequest) return new XMLHttpRequest; else if (window.ActiveXObject) return new ActiveXObject(Microsoft.XMLHTTP); } function sendReq(strReq) { var req = createXHR(); if (req) { req.open(POST, strReq, true); // true = async req.setRequestHeader(Content-Type, application/x-www-form-urlencoded; charset=UTF-8); req.onreadystatechange = function() { if (req.readyState == 4) { handleBrowserUpdate(req); } } req.send(cocoon-ajax=true); } } Bonne chance, Marc Le 30/04/07, Julien Flotté [EMAIL PROTECTED] a écrit : Bonjour, Je suis etudiant et en stage de fin d'etudes pour la fac. L'entreprise dans laquelle je suis a son portail web basé sur Cocoon. Je cherche un moyen pour rafraichir partiellement ma page qui sont composées de plusieurs panels. Pour arriver à utiliser Ajax, j'ai un formulaire dans un panel. Pour rafraichir correctement le reste, j'utilise un fd:action et je bloque l'envoi du submit. Les données du formulaire influe sur ce qu'il doit y avoir dans ma page. Y'aurait-il une autre methode pour faire correctement le rafraichissement partiel de la page en passant par un submit ? Dans mon cas, mon formulaire est integré dans un panel à l'initialisation grâce à un pipeline interne qui appelle le flowscript. Puis lors du click sur le bouton d'action, je passes dans un pipeline qui renvoie un xml de la forme : ?xml .. bu: document ... bu:replace bu: document bu:replace Cordialement, Julien Flotté. _ Gagnez des écrans plats avec Live.com http://www.image-addict.fr/ - Liste francophone Apache Cocoon -- http://cocoon.apache.org/fr/ Pour vous desinscrire : mailto:[EMAIL PROTECTED] Autres commandes : mailto:[EMAIL PROTECTED]
Re: Ajax + Formulaire
Le 30/04/07, Julien Flotté [EMAIL PROTECTED] a écrit : Merci pour l'aide, j'ai commencer à utiliser ces fonctions, et j'ai l'impression d'avancer. Par contre, quelle est la meilleure methode pour l'appeller, au niveau d'un attribut onSubmit sur le ft:template ? (c'est ce que je fais pour le moment) Il n'y a pas de meilleure facon, ca depend de ton contexte et de ce que tu veux faire. Habituellement, il n'y a pas besoin d'appel sur submit, mais plutot de fd:on-value-changed sur les widgets concernés dans ta definition de formulaire. Quand à la fonction handleBrowserUpdate, est-ce toi qui l'a créée ? Non, la fonction fait partie des librairies cocoon ajax ecrite par Sylvain Wallez je crois. Tu peux trouver la fonction dans les js ajax qui sont ajoutés dans le html quand tu mets l'attribut ajax=true sur un formulaire. Pour certaines pages ne contenant pas de formulaire, il faut ajouter le lien vers ce fichier js dans le head Julien From: Marc Salvetti [EMAIL PROTECTED] Reply-To: users-fr@cocoon.apache.org To: users-fr@cocoon.apache.org Subject: Re: Ajax + Formulaire Date: Mon, 30 Apr 2007 19:29:01 +0700 Bonjour, il faut avoir des bu:replace id= autour des données a rafraichir et il faut envoyer une requete xml post avec cocoon-ajax=true j'utilise ces petites fctions qui sont bien pratique function createXHR() { if (window.XMLHttpRequest) return new XMLHttpRequest; else if (window.ActiveXObject) return new ActiveXObject(Microsoft.XMLHTTP); } function sendReq(strReq) { var req = createXHR(); if (req) { req.open(POST, strReq, true); // true = async req.setRequestHeader(Content-Type, application/x-www-form-urlencoded; charset=UTF-8); req.onreadystatechange = function() { if (req.readyState == 4) { handleBrowserUpdate(req); } } req.send(cocoon-ajax=true); } } Bonne chance, Marc Le 30/04/07, Julien Flotté [EMAIL PROTECTED] a écrit : Bonjour, Je suis etudiant et en stage de fin d'etudes pour la fac. L'entreprise dans laquelle je suis a son portail web basé sur Cocoon. Je cherche un moyen pour rafraichir partiellement ma page qui sont composées de plusieurs panels. Pour arriver à utiliser Ajax, j'ai un formulaire dans un panel. Pour rafraichir correctement le reste, j'utilise un fd:action et je bloque l'envoi du submit. Les données du formulaire influe sur ce qu'il doit y avoir dans ma page. Y'aurait-il une autre methode pour faire correctement le rafraichissement partiel de la page en passant par un submit ? Dans mon cas, mon formulaire est integré dans un panel à l'initialisation grâce à un pipeline interne qui appelle le flowscript. Puis lors du click sur le bouton d'action, je passes dans un pipeline qui renvoie un xml de la forme : ?xml .. bu: document ... bu:replace bu: document bu:replace Cordialement, Julien Flotté. _ Gagnez des écrans plats avec Live.com http://www.image-addict.fr/ - Liste francophone Apache Cocoon -- http://cocoon.apache.org/fr/ Pour vous desinscrire : mailto:[EMAIL PROTECTED] Autres commandes : mailto:[EMAIL PROTECTED] _ Windows Live Spaces : créez votre blog à votre image ! http://www.windowslive.fr/spaces - Liste francophone Apache Cocoon -- http://cocoon.apache.org/fr/ Pour vous desinscrire : mailto:[EMAIL PROTECTED] Autres commandes : mailto:[EMAIL PROTECTED]
xmldb pseudo-protocol using specific namespace
Hello, i need to query a list of document in a specific namespace using the xmldb pseudo-protocol and an xpath like this : xmldb:exist:/db/boats/{1}/planning#/planning:cruise I get an error regarding the undeclared planning namespace and I didn't find where to declare it. I didn't find much documentation on this as well so any pointers would be welcome. Thanks in advance, Marc
Re: raster (jpeg, png) graphics in Batik SVG rasterizer under Cocoon
Hi Wendell, i had a similar pb and it was because of org.apache.cocoon.xml.dom.SVGBuilder.java and a pb in the endDocument function because of a bad base url and something about a call to the setDocumentLocator function. I didn't really solved the issue, just pointed it and changed it to fit my needs. Look in the logs if you have something like *setDocumentLocator was not called, will use as base uri* HTH, Marc 2007/4/2, Wendell Piez [EMAIL PROTECTED]: Hi, When serving SVGs with Cocoon, if I call a jpeg or PNG image into an SVG file and the Cocoon sitemap is configured to deliver them, I can see them just fine in the SVG in a browser. But when I pass the same SVG through Batik's rasterizer under Cocoon to make a jpeg (or png), the jpeg or png fails to be included, instead showing me a nice but alarming placeholder image. (I can arrange for examples on request, and/or show my sitemap.) When I run Batik standalone (as a client) and point them to the SVGs (being delivered by Cocoon), it behaves just like any SVG browser, displaying the jpeg or PNG and even offering me the rasterize functionality. It's when it's running on the server that it doesn't work. Does anyone have any hints as to whether (and how) it's possible to get Batik to resolve and include these images when rasterizing under Cocoon? Regards, Wendell == Wendell Piezmailto:[EMAIL PROTECTED] Mulberry Technologies, Inc.http://www.mulberrytech.com 17 West Jefferson StreetDirect Phone: 301/315-9635 Suite 207 Phone: 301/315-9631 Rockville, MD 20850 Fax: 301/315-8285 -- Mulberry Technologies: A Consultancy Specializing in SGML and XML == - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Integration of exist in cocoon 2.2
Hello, sorry for cross posting but i didn't get an answer on the exist ml. i'm trying to integrate exist in my cocoon 2.2 webapp and i have a problem with the exist webapp itself, and more specificaly with the xqueries and the XQueryGenerator. I can access the data with the xmldb: pseudo protocol so part of the configuration is fine, but when i try to exec any .xql trough the XQueryGenerator, i get the following error [1] I think that the elements are in a response namespace and that this namespace is somehow not declared, but i can't understand were the declaration is in the exist webapp, and why it's not working with cocoon 2.2 . Any help would be very appreciated; Marc [1] XPST0081: No namespace defined for prefix responseClass Name Method NameFile NameLineorg.exist.dom.QName parseQName.java262org.exist.xquery.XQueryContext declareVariableXQueryContext.java976org.exist.xmldb.LocalXPathQueryService setupContextLocalXPathQueryService.java267 org.exist.xmldb.LocalXPathQueryServiceexecuteLocalXPathQueryService.java180 org.exist.http.servlets.XQueryServletprocessXQueryServlet.java 316 org.exist.http.servlets.XQueryServletdoGetXQueryServlet.java 165 javax.servlet.http.HttpServletservice HttpServlet.java740 javax.servlet.http.HttpServletservice HttpServlet.java853 org.mortbay.jetty.servlet.ServletHolderhandle ServletHolder.java358 org.mortbay.jetty.servlet.WebApplicationHandler dispatch WebApplicationHandler.java294org.mortbay.jetty.servlet.ServletHandler handle ServletHandler.java567org.mortbay.http.HttpContext handleHttpContext.java 1807org.mortbay.jetty.servlet.WebApplicationContext handle WebApplicationContext.java525 org.mortbay.http.HttpContexthandle HttpContext.java1757 org.mortbay.http.HttpServerserviceHttpServer.java879 org.mortbay.http.HttpConnectionserviceHttpConnection.java 789 org.mortbay.http.HttpConnectionhandleNextHttpConnection.java 960 org.mortbay.http.HttpConnectionhandleHttpConnection.java 806 org.mortbay.http.SocketListenerhandleConnection SocketListener.java218 org.mortbay.util.ThreadedServerhandle ThreadedServer.java
Re: Cocoon 2.2 (Trunk) POI Bloc
Hi Jerome, i reproduced the problem and noticed that touching the sitemap is enough instead of reloading the server, still bad but that could be a lead to identify the problem Marc 2007/2/17, Jerome Benezech [EMAIL PROTECTED]: Hi all, I am running into a problem with cocoon 2.2 (JDK 1.5) and the POI block to generate an XLS file. Using the hello-world example provided with Cocoon 2.1, the first time I access the XLS, everything works fine but after that everytime I try to generate the XLS, I get a Duplicate Name Workbook error. I have to restart the server each time I need to generate the XLS. It looks like some buffer is not being reinitialized. Any idea ? Cheers, Jerome Jerome Benezech [EMAIL PROTECTED]
Re: Récupérer un attribut de session dans le src d'un JXTemplate
Ce que tu as ecrit m'a l'air correct, et je ne vois pas comment pourquoi cinclude serait geré differement, par contre, ton code n'est peut etre pas au bon endroit ? essaye peut etre de mettre le map:handle-errors a la fin du pipe contenant le cinclude Marc Le 24/02/07, Patrick Thomas [EMAIL PROTECTED] a écrit : Merci de ta réponse Marc, merci aussi à Jean-Baptiste. Les deux techniques (Cinclude et flow-attr) fonctionnent bien. J'ai pris celle que tu m'as proposée (Cinclude) parce que j'avais aussi à inclure du contenu dynamiquement. Sans vouloir abuser, sais-tu si les Cinclude posent un problème particulier pour faire remonter les exceptions vers le sitemap ? Je construis un JXTemplate (ici je le simplifie pour que ce soit plus lisible) : map:match pattern=affiche map:generate type=jx src=affiche_template.xml/ map:transform type=cinclude/ map:transform src=stylesheets/unStyle.xsl/ map:serialize/ /map:match Dans le template il y a un Cinclude avec une source externe dynamique récupérée d'une CForm via un flowscript : cinclude:include src=${source dynamique externe http://...}/ Si l'utilisateur écrit une source inexistante, je récupère deux exceptions possibles : java.io.FileNotFoundException java.net.UnknownHostException Je n'arrive pas à capturer ces exceptions au niveau du sitemap. J'ai écrit ça : map:components map:selectors default=browser map:selector name=exception src=org.apache.cocoon.selection.ExceptionSelector exception name=fileNotFound class=java.io.FileNotFoundException/ exception name=unknownHost class=java.net.UnknownHostException/ /map:selector /map:selectors /map:components et de manière globale : map:handle-errors map:select type=exception map:when test=fileNotFound map:generate src=uneReponse.xml/ map:serialize/ /map:when map:when test=unknownHost map:generate src=autreReponse.xml/ map:serialize/ /map:when /map:select /map:handle-errors Mais cela ne tourne pas. Il y a sûrement quelque chose que je n'ai pas compris. Patrick - Liste francophone Apache Cocoon -- http://cocoon.apache.org/fr/ Pour vous desinscrire : mailto:[EMAIL PROTECTED] Autres commandes : mailto:[EMAIL PROTECTED]
Re: Récurérer un attribut de session dans le src d'un JXTemplate
Bonjour Patrick, sans rentrer dans le detail, je pense que ce que tu cherche est le cinclude ou le xinclude transformer qq chose comme : map:match pattern=**.inc map:generate type=jx src={1}/ !-- traitement xslt et sérialisation -- /map:match qui serait appelé via un pipe map:match pattern=aggregate map:generate src=acces_url_bd/ !-- traitement xslt preparant les url dynamiques-- !-- cinclude transformer-- !-- serialize-- /map:match Bonne chance Marc Le 21/02/07, Patrick Thomas [EMAIL PROTECTED] a écrit : Bonjour, Pardon de faire encore appel à vous pour une question basique, mais je m'emmêle un peu les crayons dans les différentes technos proposées par Cocoon. Je fais une petite appli de lecture/abonnement à des flux rss. L'exemple de syndication donné dans les cocoon/samples est statique (l'adresse des flux : moreover, etc., est écrite en dur dans le sitemap)et ne m'aide pas beaucoup. J'utilise le système JXTemplate-CForms-Flowscript pour gérer l'ensemble. Depuis le script je récupère l'adresse du flux envoyée par le client (ou issue d'une BDD d'abonnements) puis je retourne au sitemap. Il faudrait que je puisse écrire : map:match pattern=... map:generate type=jx src=cette adresse dynamique/ !-- traitement xslt et sérialisation -- /map:match Mais je n'arrive pas à récupérer cette adresse depuis le script pour l'intégrer dans le src du template. Si j'envoie un objet avec le SendPage(), je peux le récupérer dans le jx-template, mais pas dans le src. Même chose si je positionne un attribut de session. Bref, je suis un peu coincé. Est-ce que l'un d'entre vous peut m'aider pour réaliser ça a minima (c-à-d sans entrer dans des technos trop lourdes) ? Accessoirement, si vous aviez un exemple (simple) de récupération dynamique de flux rss (ou autre source externe), je suis preneur. Merci d'avance Patrick - Liste francophone Apache Cocoon -- http://cocoon.apache.org/fr/ Pour vous desinscrire : mailto:[EMAIL PROTECTED] Autres commandes : mailto:[EMAIL PROTECTED]
Re: Envoi de mail dans une application
Bonjour Jean-Phillippe, ton pb viens du fait que tu n'es pas cencé travailler dans la sitemap principale de cocoon mais dans un repertoire contenant ton module d'envoi de mail, qui lui est monté par la sitemap cocoon. pour resumer, la sitemap de cocoon se trouve dans le dossier racine, et elle monte automatiquement les fichiers sitemap.xmap dans les sous repertoires. ce que tu doit faire est creer un repertoire (mail par exemple), y creer un fichier sitemap.xmap dans lequel tu mets ton match pr l'envoi de mail. l'url qui execute l'envoi de mail se trouve ds le champ action de ton formulaire action=mail/send-a-mail qui renvoie a un pipe cocoon se trouvant ds mail/sitemap.xmap J'espere que ca t'aidera, bonne chance, Marc 2007/2/1, Jean-Philippe Lesire [EMAIL PROTECTED]: Bonjour Jean-Michel, et surtout merci de me répondre. Comme tu vois, le message d'erreur tente de trouver un sitemap dans un dossier mail et j'avoue que ca me chiffonne. En fait, j'ai suivi les instructions du site officiel, avec l'alternative action(je me perdais un peu avec logicsheet). Je vais te montrer ce que j'ai fais : 1: j'ai inclus le code suivant dans le main sitemap de cocoon. map:components map:actions map:action name=sendmail logger=sitemap.action.sendmail src=org.apache.cocoon.acting.Sendmail/ /map:actions /map:components 2 : voici la partie la plus importante de mon formulaire(je te cache pas que son action me chiffonne et que je pense que c'est là que le mal réside) form action=/cocoon/mail/send-a-mail method=POST enctype=multipart/form-data input type=text name=subject size=56 / input type=text name=cc size=56 / input type=file name=uploaded_file1 size=56 / textarea name=body rows=5 cols=72 /textarea /form 3: voici donc ce que j'ai ajouté au sitemap de mon application map:match pattern=mail/* map:act type=sendmail !-- To override defaults specified in cocoon.xconf: map:parameter name=smtp-host value=localhost/ map:parameter name=smtp-user value=john/ map:parameter name=smtp-password value=john/ -- map:parameter name=from value=[EMAIL PROTECTED]/ map:parameter name=to value=[EMAIL PROTECTED]/ map:parameter name=subject value={request-param:subject}/ map:parameter name=body value={request-param:body}/ map:parameter name=cc value={request-param:cc}/ map:parameter name=bcc value=[EMAIL PROTECTED]/ map:parameter name=attachments value=uploaded_file1 context://welcome.xml/ map:generate src=mail/{status}.xml/ map:serialize type=xml/ /map:act /map:match 4: en oubliant pas que j'ai bien remplacé les jars géronimo par mail et activation comme requis par la doc. Remarque : On m'a gentiment donné à travailler sur ce framework sans que je connaisse quoique ce soit en xslt, xml, xsd, ect.. Mais ca me plait !! C'est déjà ca tu me diras. Une dernière chose : Cocoon se trouve dans le webapps de Tomcat 5.5 et mon application se trouve dans cocoon, ce qui donne : http://localhost:8080/cocoon/institute alors que lorsque j'ai le message d'erreur, il se trouve sur l'url suivante : http://localhost:8080/cocoon/mail/send-a-mail Merci encore a toi qui semble bien érudit dans ce domaine. Au fait, je suis stagiaire dans une société en Belgique et il est fort probable que mon sort dépende des résultats de ces tripatouillages...tu vois ce que je veux dire? Jean-Philippe -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: jeudi 1 février 2007 10:09 To: users-fr@cocoon.apache.org Subject: Re: Envoi de mail dans une application Bonjour Jean-Philippe, La 'FileNotFoundException' est tres classique. Le 'match' dans ton sitemap n'arrive pas a trouver un chemin, une ressource, un fichier. Il peut s'agir tout simplement d'une erreur de nommage d'un fichier ou d'un repertoire. Par exemple, si dans mon sitemap, j'ai : map:match pattern=*.excel ... map:generate type=serverpages src=excel/{1}-sql.xsp/ ... /map:match Et que mon repertoire s'appelle 'excels/' (alors qu'il doit s'appeler 'excel/'), j'obtiens la 'FileNotFoundException'. Meme chose si je demande 'exemple_1.excel', que le repertoire existe avec le bon nom ('excel/'), mais que mon fichier s'appelle en fait 'exemple-1-sql.xsp' (tiret au lieu d'un 'underscore') : il suffit de renommer le fichier en 'exemple_1-sql.xsp'. Dans tous les cas, il ne devrait pas etre tres complique de trouver d'ou vient le probleme. Cordialement, Jean-Michel ARTIGNAN Selon Jean-Philippe Lesire [EMAIL PROTECTED]: Bonjour, J'ai repris la construction d'un site en cours de route. Le problème est que je ne suis pas un grand spécialiste de la technologie utilisée par cocoon. Bref, je tente de m'en sortir. Mon problème : J'ai suivi (je pense) les instructions concernant l'envoi d'emails (remplissage d'un formulaire html et envoi de ses données à une adresse bien précise). Lorsque je presse le bouton submit , j'ai le message suivant :
Re: Envoi de mail dans une application
org.apache.cocoon.ResourceNotFoundException: No pipeline matched request: mail/send-a-mail map:mount - file:/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%205.5/webapps /cocoon/sitemap.xmap - 951:66 apparement il cherche ton pipe dans la sitemap principale, alors qu'il devrait chercher dans /mail/sitemap.xmap tu as bien créé un dossier mail avec un sitemap dedans ?
Re: Envoi de mail dans une application
normalement ds le sitemap.xmap, tu as ceci !--+ | Mount everything else by calling the sitemap.xmap file located | in the requested folder. +-- map:match pattern=*/** map:mount src={1}/ uri-prefix={1}/ /map:match ca sert a monter les sitemaps ds les sous repertoires ton matcher est ok pour mail/* mais a priori, la config par defaut retire le prefixe mail/ avant de passer la requete a la sous-sitemap (c'est le uri-prefix={1}) donc essaye match=* ou plutot match=send-a-mail, ca pourrait marcher ;) 2007/2/1, Jean-Philippe Lesire [EMAIL PROTECTED]: Oui, je vais te montrer le code (sorry pour l'indentation) : ?xml version=1.0? map:sitemap xmlns:map=http://apache.org/cocoon/sitemap/1.0; map:pipelines map:pipeline map:match pattern=mail/* map:act type=sendmail !-- To override defaults specified in cocoon.xconf: map:parameter name=smtp-host value=localhost/ map:parameter name=smtp-user value=john/ map:parameter name=smtp-password value=john/ -- map:parameter name=from value=[EMAIL PROTECTED]/ map:parameter name=to value=[EMAIL PROTECTED]/ !--map:parameter name=subject value={request-param:objet}/-- !--map:parameter name=body value={request-param:body}/-- !--map:parameter name=cc value={request-param:cc}/-- map:parameter name=bcc value=[EMAIL PROTECTED]/ !--map:parameter name=attachments value=uploaded_file1 context://welcome.xml/-- map:generate src=mail/{status}.xml/ map:serialize type=xml/ /map:act /map:match /map:pipeline /map:pipelines /map:sitemap Le fichier est bien nommé sitemap.xmap et est placé dans cocoon/mail -Original Message- From: Marc Salvetti [mailto:[EMAIL PROTECTED] Sent: jeudi 1 février 2007 13:48 To: users-fr@cocoon.apache.org Subject: Re: Envoi de mail dans une application org.apache.cocoon.ResourceNotFoundException: No pipeline matched request: mail/send-a-mail map:mount - file:/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%205.5/webapps /cocoon/sitemap.xmap - 951:66 apparement il cherche ton pipe dans la sitemap principale, alors qu'il devrait chercher dans /mail/sitemap.xmap tu as bien créé un dossier mail avec un sitemap dedans ? - Liste francophone Apache Cocoon -- http://cocoon.apache.org/fr/ Pour vous desinscrire : mailto:[EMAIL PROTECTED] Autres commandes : mailto:[EMAIL PROTECTED]
Re: Envoi de mail dans une application
et ca marche ? 2007/2/1, Jean-Philippe Lesire [EMAIL PROTECTED]: Donc, a ton sens, il est imperatif que le component se trouve dans la sitemap du dossier mail. Dans un de tes messages, tu m'a dis que si il se trouve dans le sitemap de cocoon ce n'est pas grave si ce n'est qu'il ne dois pas se trouver dans une nouvelle balise component car il ne peut y en avoir 2 sur le meme document.(ok pour ca) Logique meme. Mais je l'ai viré du sitemap de cocoon pour l'avoir alors dans le sitemap de mail pour me donner cela : ?xml version=1.0? map:sitemap xmlns:map=http://apache.org/cocoon/sitemap/1.0; map:components map:actions map:action name=sendmail logger=sitemap.action.sendmail src=org.apache.cocoon.acting.Sendmail/ /map:actions /map:components map:pipelines map:pipeline map:match pattern=send-a-mail map:act type=sendmail !-- To override defaults specified in cocoon.xconf: map:parameter name=smtp-host value=localhost/ map:parameter name=smtp-user value=john/ map:parameter name=smtp-password value=john/ -- map:parameter name=from value=[EMAIL PROTECTED]/ map:parameter name=to value=[EMAIL PROTECTED]/ !--map:parameter name=subject value={request-param:objet}/-- !--map:parameter name=body value={request-param:body}/-- !--map:parameter name=cc value={request-param:cc}/-- map:parameter name=bcc value=[EMAIL PROTECTED]/ !--map:parameter name=attachments value=uploaded_file1 context://welcome.xml/-- map:generate src=mail/{status}.xml/ map:serialize type=xml/ /map:act /map:match /map:pipeline /map:pipelines /map:sitemap Au fait, si un jour je peux te remercier, je le ferai. phil -Original Message- From: Marc Salvetti [mailto:[EMAIL PROTECTED] Sent: jeudi 1 février 2007 15:23 To: users-fr@cocoon.apache.org Subject: Re: Envoi de mail dans une application Oui, ca a un rapport, l'action de ton formulaire correspond a l'url que recoit cocoon : quand tu affiche ton form, tu es sur l'url http://localhost:8080/cocoon/mail/quelquechose (ou tu devrais) quand ton form est envoyé, il resoud l'url d'action par rapport a la ou tu te trouve. dans ton cas c'est une ref absolue '/cocoon' donc pas de pb par rapport a ca par rapport au pb que tu avais ds le mail d'avant, visiblement, tu n'as pas collé la section components au bon endroit. tu devrais regarder un peu la doc sur la sitemap avant de continuer... http://cocoon.apache.org/2.1/userdocs/concepts/sitemap.html 2007/2/1, Jean-Philippe Lesire [EMAIL PROTECTED]: Et maintenant, je reviens au point d'avant : org.apache.cocoon.ResourceNotFoundException: No pipeline matched request: mail/send-a-mail map:mount - file:/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%205.5/webapps /cocoon/sitemap.xmap - 951:66 L'action de mon formulaire s'appelle : /cocoon/mail/send-a-mail Est-ce que ca a un rapport? Dois je modifier quelque part? Ou modifier send-a-mail par sendmail? Note que j'ai essayé et j'ai quand meme une erreur -Original Message- From: Marc Salvetti [mailto:[EMAIL PROTECTED] Sent: jeudi 1 février 2007 14:41 To: users-fr@cocoon.apache.org Subject: Re: Envoi de mail dans une application Effectivement, ton erreur vient du fait qu'il ne trouve pas l'action sendmail. Normalement, la section components est herité par les sous sitemaps, dc si ce code se trouve ds la sitemap principale, ta sitemap devrait y acceder. Par contre, tu ne doit avoir qu'une seule section map:components par sitemap, donc si tu as collé ca a la suite ds la sitemap principale ca ne peut pas marcher essaye soit de coller ca ds mail/sitemap.xmap ou verifie que tu n'a pas 2 sections components ds la sitemap principale 2007/2/1, Jean-Philippe Lesire [EMAIL PROTECTED]: Hahhaaa... Et ben non... mais c'est un autre message a l'horizon. org.apache.avalon.framework.configuration.ConfigurationException: Type 'sendmail' is not defined for 'act' at file:/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%205.5/webapps /cocoon/mail/sitemap.xmap:7:30 file:/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%205.5/webapps /cocoon/mail/sitemap.xmap - 7:30 Type 'sendmail' is not defined for 'act' at file:/C
Re: Envoi de mail dans une application
Reviens où tu en etais quand tu avais l'erreur sur le host smtp not found, car au moins cette erreur indique que tes urls marchent bien et que cocoon trouve le pipe send-a-mail essaye plutot de configurer ton action va la sitemap, pour moi ça marchait. Un truc qui ne marchait pas avec cette action est le passage de piece attachée. map:parameter name=smtp-user value=toto/ map:parameter name=smtp-password value=passtoto/ map:parameter name=smtp-host value=smtp.tonhost.com/ 2007/2/1, Jean-Philippe Lesire [EMAIL PROTECTED]: Ben j'ai mis carrément mon serveur avec mes pass, ca marche pas du tout. Toujours la meme erreur... -Original Message- From: Marc Salvetti [mailto:[EMAIL PROTECTED] Sent: jeudi 1 février 2007 16:12 To: users-fr@cocoon.apache.org Subject: Re: Envoi de mail dans une application Non, le pb vient pas de la, la requete est interprete par le match et match=* doit marcher pour n'importe quoi (qui ne contient pas de /) sinon c'est ** . essaye de voir ds le log (dans WEB-INF/log) tu devrais retrouver le cheminement de ta requete dans les sitemaps et comprendre ce qui va pas. pour moi, c'est des pb de chemins absolu ou relatif, avec prefix /cocoon/mail, /mail ou rien ca devrait pas etre si sorcier ;) 2007/2/1, Jean-Philippe Lesire [EMAIL PROTECTED]: En fait j'ai suivi ton conseil et suis allé compulser la doc sur les sitemap Il apparait donc que j'ai mis le components en 1er et suivent les pipelines. Logiquement, pas de prob Mais il me donnais le message suivant : send-a-mail n'existe pas !! D'accord, j'ai bien compris ce que tu m'a dis avec la requête, mais send-a-mail dois bien correspondre à quelque chose et c'est bien la question que je me pose. Alors, j'ai modifié le nom de mon actin dans le form de cocoon/mail/send-a-mail à cocoon/mail/sendmail.. A mourir de rire, meme de ca il n'en veut pas, c'est le meme nom partout, A part que, je te promet que je ne vais que là où me dis de faire Ca ne marche pas(de ma faute je le sais bien) : org.apache.cocoon.ResourceNotFoundException: No pipeline matched request: mail/sendmail map:mount - file:/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%205.5/webapps /cocoon/sitemap.xmap - 951:66 snifff -Original Message- From: Marc Salvetti [mailto:[EMAIL PROTECTED] Sent: jeudi 1 février 2007 15:52 To: users-fr@cocoon.apache.org Subject: Re: Envoi de mail dans une application et ca marche ? 2007/2/1, Jean-Philippe Lesire [EMAIL PROTECTED]: Donc, a ton sens, il est imperatif que le component se trouve dans la sitemap du dossier mail. Dans un de tes messages, tu m'a dis que si il se trouve dans le sitemap de cocoon ce n'est pas grave si ce n'est qu'il ne dois pas se trouver dans une nouvelle balise component car il ne peut y en avoir 2 sur le meme document.(ok pour ca) Logique meme. Mais je l'ai viré du sitemap de cocoon pour l'avoir alors dans le sitemap de mail pour me donner cela : ?xml version=1.0? map:sitemap xmlns:map=http://apache.org/cocoon/sitemap/1.0; map:components map:actions map:action name=sendmail logger=sitemap.action.sendmail src= org.apache.cocoon.acting.Sendmail / /map:actions /map:components map:pipelines map:pipeline map:match pattern=send-a-mail map:act type=sendmail !-- To override defaults specified in cocoon.xconf: map:parameter name=smtp-host value=localhost/ map:parameter name=smtp-user value=john/ map:parameter name=smtp-password value=john/ -- map:parameter name=from value=[EMAIL PROTECTED]/ map:parameter name=to value=[EMAIL PROTECTED]/ !--map:parameter name=subject value={request-param:objet}/-- !--map:parameter name=body value={request-param:body}/-- !--map:parameter name=cc value={request-param:cc}/-- map:parameter name=bcc value=[EMAIL PROTECTED]/ !--map:parameter name=attachments value=uploaded_file1 context://welcome.xml/-- map:generate src=mail/{status}.xml/ map:serialize type=xml/ /map:act /map:match /map:pipeline /map:pipelines /map:sitemap Au fait, si un jour je peux te
Repeater in form
Hello,i'm having trouble integrating a repeater in a form. I copied the implementation made for LabelsThe template, metabind and repository files look ok when i load them trough the sample page, but when i try to display the form i get the following : org.xml.sax.SAXException: Element 'widget-label' refers to unexistent widget path 'resource', relative to the form container, at unknownHere is the metabind : fb:context path=meta meta:group styling-type=categories label=General state=internal-tab-state meta:group styling-layout=columns label=General meta:new id=General/ fb:value id=milestone path=milestone/ meta:new id=DurationDate/ meta:new id=DurationTime/ fb:value id=assignee path=assignee/ /meta:group meta:group label=Resources styling-layout=columns meta:group label=Resources styling-layout=columns fb:simple-repeater id=resources parent-path=resources row-path=resource fb:value styling= id=resource path=./ /fb:simple-repeater /meta:group /meta:group meta:new id=Alarm/ meta:new id=NewVersion/ meta:new id=System/ meta:new id=Versions/ /meta:group /fb:contextand the class where the repeater is defined : fd:class id=Task fd:widgetsfd:field id=title required=true fd:datatype base=string//fd:fieldfd:field id=milestone fd:datatype base=string/ fd:selection-list src="" dynamic=true/ /fd:fieldfd:field id=description required=true fd:datatype base=string//fd:field fd:field id=assignee required=true fd:datatype base=string/ fd:selection-list src="" dynamic=true/ /fd:field fd:repeater id=resources fd:widgets fd:field id=resource fd:datatype base=string/ fd:selection-list src="" dynamic=true/ /fd:field fd:booleanfield id=resources.select/ /fd:widgets /fd:repeater fd:repeater-action id=resources.action.add command=add-row repeater=resources/ fd:repeater-action id= resources.action.remove command=delete-rows repeater=resources select=select/ /fd:widgets /fd:classDoes someone have an idea of what i did wrong ?Thanks,Marc
Re: Repeater in form
Hi Simone, thanks for your help,i understand it's a template problem, but since the template is generated from the meta-bind, the error should be here : meta:group label=Resources styling-layout=columns meta:group label=Resources styling-layout=columns fb:simple-repeater id=resources parent-path=resources row-path=resource fb:value styling= id=resource path=./ /fb:simple-repeater /meta:group /meta:group But apparently the widget label is at the good position in the generated file :fi:groupfi:labelResources/fi:labelfi:styling layout=columns/− fi:items − fi:groupfi:labelResources/fi:labelfi:styling layout=columns/− fi:items− fb:simple-repeater id=resources parent-path=resources row-path=resource ft:widget-label id=resource/ft:widget id=resource//fb:simple-repeater/fi:items/fi:group/fi:items/fi:group That's where i don't get the error message. It says relative to the form container and at unknown, which seems to mean that it doesn't know the path.Any idea ?Marc 2006/4/5, Simone Gianni [EMAIL PROTECTED]: Hi Marc,the error is not (directly) related to definition or binding, but it's atemplate problem. In the template you have a ft:widget-labelid=resource which is not where it should be (AFAIU it should be a descendant of ft:widget id=resources/).Hope this helps,SimoneMarc Salvetti wrote: Hello, i'm having trouble integrating a repeater in a form. I copied the implementation made for Labels The template, metabind and repository files look ok when i load them trough the sample page, but when i try to display the form i get the following : org.xml.sax.SAXException: Element 'widget-label' refers to unexistent widget path 'resource', relative to the form container, at unknown Here is the metabind : fb:context path=meta meta:group styling-type=categories label=General state=internal-tab-state meta:group styling-layout=columns label=General meta:new id=General/ fb:value id=milestone path=milestone/ meta:new id=DurationDate/ meta:new id=DurationTime/ fb:value id=assignee path=assignee/ /meta:group meta:group label=Resources styling-layout=columns meta:group label=Resources styling-layout=columns fb:simple-repeater id=resources parent-path=resources row-path=resource fb:value styling= id=resource path=./ /fb:simple-repeater /meta:group /meta:group meta:new id=Alarm/ meta:new id=NewVersion/ meta:new id=System/ meta:new id=Versions/ /meta:group /fb:context and the class where the repeater is defined : fd:class id=Task fd:widgets fd:field id=title required=true fd:datatype base=string/ /fd:field fd:field id=milestone fd:datatype base=string/ fd:selection-list src="" dynamic=true/ /fd:field fd:field id=description required=true fd:datatype base=string/ /fd:field fd:field id=assignee required=true fd:datatype base=string/ fd:selection-list src="" dynamic=true/ /fd:field fd:repeater id=resources fd:widgets fd:field id=resource fd:datatype base=string/ fd:selection-list src="" dynamic=true/ /fd:field fd:booleanfield id=resources.select/ /fd:widgets /fd:repeater fd:repeater-action id=resources.action.add command=add-row repeater=resources/ fd:repeater-action id= resources.action.remove command=delete-rows repeater=resources select=select/ /fd:widgets /fd:class Does someone have an idea of what i did wrong ? Thanks, Marc--Simone Gianni-To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Repeater in form
Sorry for the noise, i just figured that i posted to the wrong list (bluexml)It's a cocoon based fw trough so the post isn't totally out of place ;)I just need to explain that the meta-bind file that i pasted in the mail is transformed by the fw into a binding file and a template file. If i look at the generated template file, it has the widget-label element at the correct place.Marc2006/4/5, Marc Salvetti [EMAIL PROTECTED] :Hi Simone, thanks for your help,i understand it's a template problem, but since the template is generated from the meta-bind, the error should be here : meta:group label=Resources styling-layout=columns meta:group label=Resources styling-layout=columns fb:simple-repeater id=resources parent-path=resources row-path=resource fb:value styling= id=resource path=./ /fb:simple-repeater /meta:group /meta:group But apparently the widget label is at the good position in the generated file :fi:groupfi:labelResources/fi:labelfi:styling layout=columns/ − fi:items − fi:groupfi:labelResources/fi:labelfi:styling layout=columns/− fi:items− fb:simple-repeater id=resources parent-path=resources row-path=resource ft:widget-label id=resource/ft:widget id=resource//fb:simple-repeater/fi:items/fi:group/fi:items /fi:group That's where i don't get the error message. It says relative to the form container and at unknown, which seems to mean that it doesn't know the path.Any idea ?Marc 2006/4/5, Simone Gianni [EMAIL PROTECTED]: Hi Marc,the error is not (directly) related to definition or binding, but it's atemplate problem. In the template you have a ft:widget-labelid=resource which is not where it should be (AFAIU it should be a descendant of ft:widget id=resources/).Hope this helps,SimoneMarc Salvetti wrote: Hello, i'm having trouble integrating a repeater in a form. I copied the implementation made for Labels The template, metabind and repository files look ok when i load them trough the sample page, but when i try to display the form i get the following : org.xml.sax.SAXException: Element 'widget-label' refers to unexistent widget path 'resource', relative to the form container, at unknown Here is the metabind : fb:context path=meta meta:group styling-type=categories label=General state=internal-tab-state meta:group styling-layout=columns label=General meta:new id=General/ fb:value id=milestone path=milestone/ meta:new id=DurationDate/ meta:new id=DurationTime/ fb:value id=assignee path=assignee/ /meta:group meta:group label=Resources styling-layout=columns meta:group label=Resources styling-layout=columns fb:simple-repeater id=resources parent-path=resources row-path=resource fb:value styling= id=resource path=./ /fb:simple-repeater /meta:group /meta:group meta:new id=Alarm/ meta:new id=NewVersion/ meta:new id=System/ meta:new id=Versions/ /meta:group /fb:context and the class where the repeater is defined : fd:class id=Task fd:widgets fd:field id=title required=true fd:datatype base=string/ /fd:field fd:field id=milestone fd:datatype base=string/ fd:selection-list src="" dynamic=true/ /fd:field fd:field id=description required=true fd:datatype base=string/ /fd:field fd:field id=assignee required=true fd:datatype base=string/ fd:selection-list src="" dynamic=true/ /fd:field fd:repeater id=resources fd:widgets fd:field id=resource fd:datatype base=string/ fd:selection-list src="" dynamic=true/ /fd:field fd:booleanfield id=resources.select/ /fd:widgets /fd:repeater fd:repeater-action id=resources.action.add command=add-row repeater=resources/ fd:repeater-action id= resources.action.remove command=delete-rows repeater=resources select=select/ /fd:widgets /fd:class Does someone have an idea of what i did wrong ? Thanks, Marc--Simone Gianni-To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Repeater in form
Indeed it seems to be related, if i change to ft:repeater i don't have the error, but still the repeater doesn't show up :(2006/4/5, Simone Gianni [EMAIL PROTECTED]: Hi Marc, maybe I'm missing something, but in the generated file there is : fb:simple-repeater id=resources parent-path=resources row-path=resource While it should be ft:repeater .. Simone Marc Salvetti wrote: Hi Simone, thanks for your help, i understand it's a template problem, but since the template is generated from the meta-bind, the error should be here : meta:group label=Resources styling-layout=columns meta:group label=Resources styling-layout=columns fb:simple-repeater id=resources parent-path=resources row-path=resource fb:value styling= id=resource path=./ /fb:simple-repeater /meta:group /meta:group But apparently the widget label is at the good position in the generated file : fi:group fi:labelResources/fi:label fi:styling layout=columns/ − fi:items − fi:group fi:labelResources/fi:label fi:styling layout=columns/ − fi:items − fb:simple-repeater id=resources parent-path=resources row-path=resource ft:widget-label id=resource/ ft:widget id=resource/ /fb:simple-repeater /fi:items /fi:group /fi:items /fi:group That's where i don't get the error message. It says relative to the form container and at unknown, which seems to mean that it doesn't know the path. Any idea ? Marc 2006/4/5, Simone Gianni [EMAIL PROTECTED]: Hi Marc, the error is not (directly) related to definition or binding, but it's a template problem. In the template you have a ft:widget-label id=resource which is not where it should be (AFAIU it should be a descendant of ft:widget id=resources/). Hope this helps, Simone Marc Salvetti wrote: Hello, i'm having trouble integrating a repeater in a form. I copied the implementation made for Labels The template, metabind and repository files look ok when i load them trough the sample page, but when i try to display the form i get the following : org.xml.sax.SAXException: Element 'widget-label' refers to unexistent widget path 'resource', relative to the form container, at unknown Here is the metabind : fb:context path=meta meta:group styling-type=categories label=General state=internal-tab-state meta:group styling-layout=columns label=General meta:new id=General/ fb:value id=milestone path=milestone/ meta:new id=DurationDate/ meta:new id=DurationTime/ fb:value id=assignee path=assignee/ /meta:group meta:group label=Resources styling-layout=columns meta:group label=Resources styling-layout=columns fb:simple-repeater id=resources parent-path=resources row-path=resource fb:value styling= id=resource path=./ /fb:simple-repeater /meta:group /meta:group meta:new id=Alarm/ meta:new id=NewVersion/ meta:new id=System/ meta:new id=Versions/ /meta:group /fb:context and the class where the repeater is defined : fd:class id=Task fd:widgets fd:field id=title required=true fd:datatype base=string/ /fd:field fd:field id=milestone fd:datatype base=string/ fd:selection-list src="" dynamic=true/ /fd:field fd:field id=description required=true fd:datatype base=string/ /fd:field fd:field id=assignee required=true fd:datatype base=string/ fd:selection-list src="" dynamic=true/ /fd:field fd:repeater id=resources fd:widgets fd:field id=resource fd:datatype base=string/ fd:selection-list src="" dynamic=true/ /fd:field fd:booleanfield id=resources.select/ /fd:widgets /fd:repeater fd:repeater-action id=resources.action.add command=add-row repeater=resources/ fd:repeater-action id= resources.action.remove command=delete-rows repeater=resources select=select/ /fd:widgets /fd:class Does someone have an idea of what i did wrong ? Thanks, Marc -- Simone Gianni - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Simone Gianni
Re: Repeater in form
Ok, thanks very much for this info.It's getting late here, so i'll try that tomorrow.Best regards,Marc2006/4/5, Simone Gianni [EMAIL PROTECTED]: Hi Marc, I don't know how this framework works, but actually you should have in the form template something like this : ft:repeater id=resources fi:group ... or other styling information for the repeater ft:repeater-rows fi:group .. or other styling inromations to be repeated for every line of the repeater ft:widget-label ... / ft:widget ... / /ft:repeater-rows ... /ft:repeater OR : ft:repeater-widget id=resources fi:group .. or other styling inromations to be repeated for every line of the repeater ft:widget-label ... / ft:widget ... / /ft:repeater-widget But this last syntax is not AJAX compatible. Simone Marc Salvetti wrote: Indeed it seems to be related, if i change to ft:repeater i don't have the error, but still the repeater doesn't show up :( 2006/4/5, Simone Gianni [EMAIL PROTECTED]: Hi Marc, maybe I'm missing something, but in the generated file there is : fb:simple-repeater id=resources parent-path=resources row-path=resource While it should be ft:repeater .. Simone Marc Salvetti wrote: Hi Simone, thanks for your help, i understand it's a template problem, but since the template is generated from the meta-bind, the error should be here : meta:group label=Resources styling-layout=columns meta:group label=Resources styling-layout=columns fb:simple-repeater id=resources parent-path=resources row-path=resource fb:value styling= id=resource path=./ /fb:simple-repeater /meta:group /meta:group But apparently the widget label is at the good position in the generated file : fi:group fi:labelResources/fi:label fi:styling layout=columns/ − fi:items − fi:group fi:labelResources/fi:label fi:styling layout=columns/ − fi:items − fb:simple-repeater id=resources parent-path=resources row-path=resource ft:widget-label id=resource/ ft:widget id=resource/ /fb:simple-repeater /fi:items /fi:group /fi:items /fi:group That's where i don't get the error message. It says relative to the form container and at unknown, which seems to mean that it doesn't know the path. Any idea ? Marc 2006/4/5, Simone Gianni [EMAIL PROTECTED]: Hi Marc, the error is not (directly) related to definition or binding, but it's a template problem. In the template you have a ft:widget-label id=resource which is not where it should be (AFAIU it should be a descendant of ft:widget id=resources/). Hope this helps, Simone Marc Salvetti wrote: Hello, i'm having trouble integrating a repeater in a form. I copied the implementation made for Labels The template, metabind and repository files look ok when i load them trough the sample page, but when i try to display the form i get the following : org.xml.sax.SAXException: Element 'widget-label' refers to unexistent widget path 'resource', relative to the form container, at unknown Here is the metabind : fb:context path=meta meta:group styling-type=categories label=General state=internal-tab-state meta:group styling-layout=columns label=General meta:new id=General/ fb:value id=milestone path=milestone/ meta:new id=DurationDate/ meta:new id=DurationTime/ fb:value id=assignee path=assignee/ /meta:group meta:group label=Resources styling-layout=columns meta:group label=Resources styling-layout=columns fb:simple-repeater id=resources parent-path=resources row-path=resource fb:value styling= id=resource path=./ /fb:simple-repeater /meta:group /meta:group meta:new id=Alarm/ meta:new id=NewVersion/ meta:new id=System/ meta:new id=Versions/ /meta:group /fb:context and the class where the repeater is defined : fd:class id=Task fd:widgets fd:field id=title required=true fd:datatype base=string/ /fd:field fd:field id=milestone fd:datatype base=string/ fd:selection-list src="" dynamic=true/ /fd:field fd:field id=description required=true fd:datatype base=string/ /fd:field fd:field id=assignee required=true fd:datatype base=string/ fd:selection-list src="" dynamic=true/ /fd:field fd:repeater id=resources fd:widgets fd:field id=resource fd:datatype base=string/ fd:selection-list src="" dynamic=true/ /fd:field fd:booleanfield id=resources.select/ /fd:widgets /fd:repeater fd:repeater-action id=resources.action.add command=add-row repeater=resources/ fd:repeater-action id= resources.action.remove command=delete-rows repeater=resources select=select/ /fd:widgets /fd:class Does someone have an idea of what i did wrong ? Thanks, Marc -- Simone Gianni - To unsubscribe, e-mail: [EMAIL PROTECTED] For addit
Re: Pb using tabs with the task tree sample
Looking at the dom inspector, i can see the cause of the problem :The generated ids of the enclosing DIV for the task and it's subtask are the same.Does someone know where these ids are generated or how to fix that ? Thanks,Marc2006/3/24, Marc Salvetti [EMAIL PROTECTED]: Hello,i'm trying to extend the task tree sample by adding tabs to a task.The problem is when i create a subtask, then try to change tab on any of the parent tasks. The form get confused and swich tabs on the subtask, not on the parent. This seems to be ajax-related as if i turn ajax to false, the tabs are working fine.This is my version of the task tree template, if somebody can help me to fix that problem. ft:class id=task-class div class=section ft:group id=task span class=actions ft:widget id=downfi:styling type=image src="" ft:widget id=upfi:styling type=image src=""> ft:widget id=deletefi:styling type=image src="" ft:widget id=addfi:styling type=image src=""> /span fi:group fi:styling type=tabs/ fi:state ft:widget id=tab-state/ /fi:state fi:items fi:group fi:labelGeneral/fi:label fi:itemsdivTitle ft:widget id=title//div divDescription ft:widget id=descriptionfi:styling type=textarea//ft:widget/div divFrom ft:widget id=dtstartfi:styling size=10//ft:widget to ft:widget id=dtendfi:styling size=10//ft:widget /div /fi:items /fi:group fi:group fi:labelDetail/fi:label fi:itemsdiv Responsible ft:widget id=responsible/ Target milestone ft:widget id=milestone/ Duration ft:widget id=duration/ /divdiv Time worked ft:widget id=timeWorked/ Completion ft:widget id=completion/ Achieved ft:widget id=achieved/ /div /fi:items /fi:group /fi:items /fi:group !-- Recurse -- ft:new id=tasklist-class/ /ft:group /div /ft:classThanks,Marc
Re: Gantt graph using Fins ?
Yes it is alive, but the development has been limited to some patchesfor the past year and half. Anyway, Marc is through a massive refactoring of the codebase... hopefully laying the foundation for thewhole of JFreeChart to be included in Fins.Thanks, that's great news !Do you have an idea of how long before the refactoring is released ? Marc
Pb using tabs with the task tree sample
Hello,i'm trying to extend the task tree sample by adding tabs to a task.The problem is when i create a subtask, then try to change tab on any of the parent tasks. The form get confused and swich tabs on the subtask, not on the parent. This seems to be ajax-related as if i turn ajax to false, the tabs are working fine.This is my version of the task tree template, if somebody can help me to fix that problem. ft:class id=task-class div class=section ft:group id=task span class=actions ft:widget id=downfi:styling type=image src="" ft:widget id=upfi:styling type=image src=""> ft:widget id=deletefi:styling type=image src="" ft:widget id=addfi:styling type=image src=""> /span fi:group fi:styling type=tabs/ fi:state ft:widget id=tab-state/ /fi:state fi:items fi:group fi:labelGeneral/fi:label fi:itemsdivTitle ft:widget id=title//div divDescription ft:widget id=descriptionfi:styling type=textarea//ft:widget/div divFrom ft:widget id=dtstartfi:styling size=10//ft:widget to ft:widget id=dtendfi:styling size=10//ft:widget /div /fi:items /fi:group fi:group fi:labelDetail/fi:label fi:itemsdiv Responsible ft:widget id=responsible/ Target milestone ft:widget id=milestone/ Duration ft:widget id=duration/ /divdiv Time worked ft:widget id=timeWorked/ Completion ft:widget id=completion/ Achieved ft:widget id=achieved/ /div /fi:items /fi:group /fi:items /fi:group !-- Recurse -- ft:new id=tasklist-class/ /ft:group /div /ft:classThanks,Marc
Gantt graph using Fins ?
Hi,i would like to know if Fins has the possibility to generate gantt charts from an xml input ?I noticed it's possible on the JFree website but i didn't see any mention of it in the fins doc.Btw, the fins page seems to have moved to http://new.cocoondev.org/main/117/29.html but the cocoon website and the doc page of fins http://www.sidimar.ipzs.it/fins012/docs/changes.html still reference an old project home page http://www.cocoondev.org/projects/fins.html+ the doc page of fins is last published in 2004. Is the project still alive ? Does someone know about it ?Thanks,Marc
Re: Back button issues with multipage forms
Hi Craig,i did run into the problem, and i didn't find other satisfiying solution than to cut down my multipage form to several forms called successively from the same flowscript function.You can also try to hack the pb with something like that : var submitWidget = widget.getForm().getSubmitWidget(); while(submitWidget == null){ form.showForm(displayPipeline); submitWidget = widget.getForm().getSubmitWidget(); //Protect from the bug when user press the back button if(submitWidget == null){ cocoon.log.debug(back button pressed);But i find it more difficult and less elegant than successive forms.hth, Marc 2006/3/15, Craig Gulliver [EMAIL PROTECTED]: I have several forms that use the multipage wizard. The basic idea is that the form has multiple group widget containers that can be hidden or displayed based on user actions(ie button clicks really). And are controlled using button event handers (on-action events) in the form definition. My problem is stemming from the use of the back button with these types of pages. The first thing I investigated was how continuations would solve my problem. It seemed like the right candidate to provide a solution. I turns out that even with continuations these forms still do not behave as I expect. I tracked the issue down to the fact that the form and it's state are not recorded at each continuation. The result is that the form widget states do not revert. In other words, the continuation does not have this state when applied to the process. To illustrate: * Displaying form with group A and group B. Group A is active, and Group B is invisible. * User submits the form using the flip button, the buttons event handler flips the state of each Group so that A is invisible and B is active. * User hits the browser back button, then hits the flip button again. The form processing shows that the state is that in step 2 instead of step 1. The state of these widget containers affect how the request is processed, and explains the strange behaviour. Another item I came across was the use of page local. The cocoon object provides a function called createPageLocal. The returned object is used to store local page variables that can be restored when a page is resubmitted (ie back button is used). There is not much documentation surrounding this feature. I was not able to solve my problem using it. Either I was using it incorrectly, or it's the wrong solution. Does anyone have any experience with this feature, and if so is there documentation for it. Would it solve my problem, or am I running down a rabbit hole? I would think that we are not the first to run into this problem. However, I have not found any mention of it on the forums, wiki, or supporting cocoon sites. Does anyone have an answer to this problem? Thanks in advance, Craig W Gulliver
Re: OT: Signature brands
:))2006/1/4, Peter Flynn [EMAIL PROTECTED]: Sorry, I couldn't resist this one:http://www.newtree.be/en/choco_cocoon.php///Peter- To unsubscribe, e-mail: [EMAIL PROTECTED]For additional commands, e-mail: [EMAIL PROTECTED]
Re: Envoyer une requete ajax ?
Voui, puisque je l'ai écrite avec mes petits doigts :-) Je sais pas pourquoi, mais je me doutais que c'est toi qui allait répondre ;) Un bémol toutefois: cette librairie est à considérer comme interne à Cocoon et va fortement évoluer dans les prochaines semaines, lors de l'intégration de Dojo [1]. Tu peux donc t'en inspirer, mais je te déconseille de l'utiliser directement sous peine de mauvaises surprises plus tard... Ok, je retiens ça Ceci étant dit, voici comment faire un POST en Ajax pour envoyer des données sur le serveur (ne jamais utiliser GET pour ça: si le navigateur a un cache un peu aggressif ou si tu passes par un serveur proxy, la requête peut ne jamais arriver au serveur). function createXHR() { if (window.XMLHttpRequest) return new XMLHttpRequest; else if (window.ActiveXObject) return new ActiveXObject(Microsoft.XMLHTTP); } function envoyerPosition(pos) { var req = createXHR(); if (req) { req.open(POST, url-de-setPosition, true); // true = async req.setRequestHeader(Content-Type, application/x-www-form-urlencoded); req.send(position= + pos); } } Merci, ca ressemble fortement à ce que je cherchais :) Et voilà. Si tu veux aller plus loin et traiter le retour du serveur, regarde dans cforms.js ou les nombreux tutoriels qui traitent du sujet... Sylvain [1] http://www.dojotoolkit.org/ -- Sylvain WallezAnyware Technologies http://bluxte.net http://www.anyware-tech.com Apache Software Foundation Member Research Technology Director - Liste francophone Apache Cocoon -- http://cocoon.apache.org/fr/ Pour vous desinscrire : mailto:[EMAIL PROTECTED] Autres commandes : mailto:[EMAIL PROTECTED]
Envoyer une requete ajax ?
Bonjour, je voudrais memoriser la position d'un menu flottant dans mon appli, de façon a ce qu'il reste a l'endroit ou l'utilisateur le pose quand on passe de page en page. Pour ça, je voudrais utiliser la petite librairie ajax qui se trouve dans le nouveau bloc, car je voudrais eviter de recharger toute la page pour ça. En fait, il s'agit simplement d'envoyer une requete au serveur, sans meme attendre de reponse. Quelqu'un connait t'il suffisament la librairie pour me donner un petit exemple ? Merci, Marc
Re: Sending html messages with pdf attachments using sendMail action
Answering to myself again :) I finally managed to do it, but i had to patch the mail block. I changed 3 files : MailMessageSender.java MailSender.java SendMail.java Basically, i added a bodyMimeType parameter to the action, and checked if this attribute is set, use the setContent(body, mimeType) method rather than the setText(body, charset) method. It works fine, and i would like to contribute the fix, but since i'm not a commiter, i don't know how to do Marc 2005/11/21, Marc Salvetti [EMAIL PROTECTED]: 2005/11/21, Marc Salvetti [EMAIL PROTECTED]: That's why i'm trying to do for a while now and i came to the following problems : - if i use the action and set the src attribute to a cocoon pipeline producing html, the Content-disposition = attachment header is added, which i don't want (i want the html inline), but the pdf file is attached correctly to the mail - I can manage to send the html inline using the javaMail api directly from flowscript, but authentication and construction of the message is more complex than using the action, and i get the following error when sending the message : ERROR 2005-11-21 19:57:05,710 [flow] Thread-108 - javax.mail.MessagingException: IOException while sending message; nested exception is: javax.activation.UnsupportedDataTypeException: no object DCH for MIME type application/pdf I looked at the code of the MessageSender class, and i saw that it get the mime type by using the sourceResolver component. Since the mime type returned by the sourceResolver is also application/pdf i know it's not something to do with versions of the activation framework or some Sorry, i sent the message by mistake - damn keyboards shortcuts ! :) Since the mime type returned by the sourceResolver is also application/pdf i think it's not something to do with versions of the activation framework or something like that, but more with the way i use the api. I'd rather use the action, but it doesn't support adding custom headers, and it set the body of the message as an attachment. here is the flowscript i use : var mailprops = new java.util.Properties(); mailprops.put(mail.smtp.host, cocoon.parameters['smtp-host']); mailprops.put(mail.smtp.auth, true); mailprops.put(mail.smtp.user, cocoon.parameters['smtp-user']); mailprops.put(mail.smtp.password, cocoon.parameters['smtp-password']); var session = javax.mail.Session.getDefaultInstance(mailprops, null); session.setDebug(true); // create a message var msg = new javax.mail.internet.MimeMessage(session); msg.setRecipients(javax.mail.Message.RecipientType.TO, to); if(!bcc.equals()){ msg.setRecipients(javax.mail.Message.RecipientType.BCC, bcc); } // Optional : You can also set your custom headers in the Email if you Want // Setting the Subject and Content Type msg.setSubject(subject); msg.setSentDate(new java.util.Date()); var result, message; try { var addressFrom = new javax.mail.internet.InternetAddress(cocoon.parameters['from']); msg.setFrom(addressFrom); // create and fill the first message part var mbp1 = new javax.mail.internet.MimeBodyPart(); mbp1.setContent(body, text/html); // create the Multipart and its parts to it var mp = new javax.mail.internet.MimeMultipart(); mp.addBodyPart(mbp1); if(!attachments.equals()){ // create and fill the second message part var mbp2 = new javax.mail.internet.MimeBodyPart(); mbp2.setDisposition(attachment) var mimeType = getMimeType(attachments); // Use setText(text, charset), to show it off ! var stream = new java.io.ByteArrayOutputStream(); cocoon.processPipelineTo(attachments, {}, stream ); mbp2.setContent(stream, mimeType); mp.addBodyPart(mbp2); } // add the Multipart to the message msg.setContent(mp); // send the message //javax.mail.Transport.send(msg); var tr = session.getTransport(smtp); tr.connect(cocoon.parameters['smtp-host'], cocoon.parameters['smtp-user'], cocoon.parameters['smtp-password']); msg.saveChanges(); tr.sendMessage(msg, msg.getAllRecipients()); tr.close(); result = success; } catch(e) { cocoon.log.error(e=+ e); result = failure; message = e; } Any help would be greatly appreciated ! Marc
Re: Sending html messages with pdf attachments using sendMail action
Done, i uploaded the modified files. Thanks, Marc2005/11/22, Ralph Goers [EMAIL PROTECTED]: First, read http://cocoon.apache.org/community/contrib.html.Unfortunately, this still references bugzilla which the project nolonger uses. Instead, go to http://issues.apache.org/jira/browse/COCOONand create a new issue.You will probably need to create an account inJira before you can create the issue. We appreciate your work. Thanks.RalphMarc Salvetti wrote: Answering to myself again :) I finally managed to do it, but i had to patch the mail block. I changed 3 files : MailMessageSender.java MailSender.java SendMail.java Basically, i added a bodyMimeType parameter to the action, and checked if this attribute is set, use the setContent(body, mimeType) method rather than the setText(body, charset) method. It works fine, and i would like to contribute the fix, but since i'm not a commiter, i don't know how to do Marc 2005/11/21, Marc Salvetti [EMAIL PROTECTED] mailto:[EMAIL PROTECTED]: 2005/11/21, Marc Salvetti [EMAIL PROTECTED] mailto:[EMAIL PROTECTED]: That's why i'm trying to do for a while now and i came to the following problems : - if i use the action and set the src attribute to a cocoon pipeline producing html, the Content-disposition = attachment header is added, which i don't want (i want the html inline), but the pdf file is attached correctly to the mail - I can manage to send the html inline using the javaMail api directly from flowscript, but authentication and construction of the message is more complex than using the action, and i get the following error when sending the message : ERROR 2005-11-21 19:57:05,710 [flow] Thread-108 - javax.mail.MessagingException: IOException while sending message; nested exception is: javax.activation.UnsupportedDataTypeException : no object DCH for MIME type application/pdf I looked at the code of the MessageSender class, and i saw that it get the mime type by using the sourceResolver component. Since the mime type returned by the sourceResolver is also application/pdf i know it's not something to do with versions of the activation framework or some Sorry, i sent the message by mistake - damn keyboards shortcuts ! :) Since the mime type returned by the sourceResolver is also application/pdf i think it's not something to do with versions of the activation framework or something like that, but more with the way i use the api. I'd rather use the action, but it doesn't support adding custom headers, and it set the body of the message as an attachment. here is the flowscript i use :var mailprops = new java.util.Properties();mailprops.put(mail.smtp.host, cocoon.parameters['smtp-host']); mailprops.put(mail.smtp.auth, true);mailprops.put(mail.smtp.user, cocoon.parameters['smtp-user']);mailprops.put(mail.smtp.password, cocoon.parameters['smtp-password']);var session = javax.mail.Session.getDefaultInstance(mailprops, null);session.setDebug(true);// create a messagevar msg = new javax.mail.internet.MimeMessage(session);msg.setRecipients(javax.mail.Message.RecipientType.TO http://javax.mail.Message.RecipientType.TO, to);if(!bcc.equals()){msg.setRecipients(javax.mail.Message.RecipientType.BCC, bcc); } // Optional : You can also set your custom headers in the Email if you Want // Setting the Subject and Content Typemsg.setSubject(subject);msg.setSentDate(new java.util.Date());var result, message;try { var addressFrom = new javax.mail.internet.InternetAddress(cocoon.parameters['from']); msg.setFrom(addressFrom); // create and fill the first message part var mbp1 = new javax.mail.internet.MimeBodyPart(); mbp1.setContent(body, text/html); // create the Multipart and its parts to it var mp = new javax.mail.internet.MimeMultipart(); mp.addBodyPart(mbp1); if(!attachments.equals()){ // create and fill the second message part var mbp2 = new javax.mail.internet.MimeBodyPart(); mbp2.setDisposition(attachment) var mimeType = getMimeType(attachments); // Use setText(text, charset), to show it off ! var stream = new java.io.ByteArrayOutputStream(); cocoon.processPipelineTo(attachments, {}, stream ); mbp2.setContent(stream, mimeType); mp.addBodyPart(mbp2); } // add the Multipart to the message msg.setContent(mp); // send the message //javax.mail.Transport.send(msg); var tr = session.getTransport(smtp); tr.connect(cocoon.parameters['smtp-host'], cocoon.parameters['smtp-user'], cocoon.parameters['smtp-password']); msg.saveChanges(); tr.sendMessage(msg, msg.getAllRecipients()); tr.close(); result = success; }catch(e){cocoon.log.error(e=+ e);result = failure;message = e;} Any help would be greatly appreciated ! Marc-To unsubscribe, e-mail: [EMAIL PROTECTED]For additional commands, e-mail: [EMAIL PROTECTED]
Sending html messages with pdf attachments using sendMail action
That's why i'm trying to do for a while now and i came to the following problems : - if i use the action and set the src attribute to a cocoon pipeline producing html, the Content-disposition = attachment header is added, which i don't want (i want the html inline), but the pdf file is attached correctly to the mail - I can manage to send the html inline using the javaMail api directly from flowscript, but authentication and construction of the message is more complex than using the action, and i get the following error when sending the message : ERROR 2005-11-21 19:57:05,710 [flow] Thread-108 - javax.mail.MessagingException: IOException while sending message; nested exception is: javax.activation.UnsupportedDataTypeException: no object DCH for MIME type application/pdf I looked at the code of the MessageSender class, and i saw that it get the mime type by using the sourceResolver component. Since the mime type returned by the sourceResolver is also application/pdf i know it's not something to do with versions of the activation framework or some
Re: Sending html messages with pdf attachments using sendMail action
2005/11/21, Marc Salvetti [EMAIL PROTECTED]: That's why i'm trying to do for a while now and i came to the following problems : - if i use the action and set the src attribute to a cocoon pipeline producing html, the Content-disposition = attachment header is added, which i don't want (i want the html inline), but the pdf file is attached correctly to the mail - I can manage to send the html inline using the javaMail api directly from flowscript, but authentication and construction of the message is more complex than using the action, and i get the following error when sending the message : ERROR 2005-11-21 19:57:05,710 [flow] Thread-108 - javax.mail.MessagingException: IOException while sending message; nested exception is: javax.activation.UnsupportedDataTypeException: no object DCH for MIME type application/pdf I looked at the code of the MessageSender class, and i saw that it get the mime type by using the sourceResolver component. Since the mime type returned by the sourceResolver is also application/pdf i know it's not something to do with versions of the activation framework or some Sorry, i sent the message by mistake - damn keyboards shortcuts ! :) Since the mime type returned by the sourceResolver is also application/pdf i think it's not something to do with versions of the activation framework or something like that, but more with the way i use the api. I'd rather use the action, but it doesn't support adding custom headers, and it set the body of the message as an attachment. here is the flowscript i use : var mailprops = new java.util.Properties(); mailprops.put(mail.smtp.host, cocoon.parameters['smtp-host']); mailprops.put(mail.smtp.auth, true); mailprops.put(mail.smtp.user, cocoon.parameters['smtp-user']); mailprops.put(mail.smtp.password, cocoon.parameters['smtp-password']); var session = javax.mail.Session.getDefaultInstance(mailprops, null); session.setDebug(true); // create a message var msg = new javax.mail.internet.MimeMessage(session); msg.setRecipients(javax.mail.Message.RecipientType.TO, to); if(!bcc.equals()){ msg.setRecipients(javax.mail.Message.RecipientType.BCC, bcc); } // Optional : You can also set your custom headers in the Email if you Want // Setting the Subject and Content Type msg.setSubject(subject); msg.setSentDate(new java.util.Date()); var result, message; try { var addressFrom = new javax.mail.internet.InternetAddress(cocoon.parameters['from']); msg.setFrom(addressFrom); // create and fill the first message part var mbp1 = new javax.mail.internet.MimeBodyPart(); mbp1.setContent(body, text/html); // create the Multipart and its parts to it var mp = new javax.mail.internet.MimeMultipart(); mp.addBodyPart(mbp1); if(!attachments.equals()){ // create and fill the second message part var mbp2 = new javax.mail.internet.MimeBodyPart(); mbp2.setDisposition(attachment) var mimeType = getMimeType(attachments); // Use setText(text, charset), to show it off ! var stream = new java.io.ByteArrayOutputStream(); cocoon.processPipelineTo(attachments, {}, stream ); mbp2.setContent(stream, mimeType); mp.addBodyPart(mbp2); } // add the Multipart to the message msg.setContent(mp); // send the message //javax.mail.Transport.send(msg); var tr = session.getTransport(smtp); tr.connect(cocoon.parameters['smtp-host'], cocoon.parameters['smtp-user'], cocoon.parameters['smtp-password']); msg.saveChanges(); tr.sendMessage(msg, msg.getAllRecipients()); tr.close(); result = success; } catch(e) { cocoon.log.error(e=+ e); result = failure; message = e; } Any help would be greatly appreciated ! Marc
Re: execute js after row-delete ?
Thanks a lot ! It works perfectly :) Marc2005/11/17, Robin Wyles [EMAIL PROTECTED]: Marc,Instead of using a fd:row-action why not use a fd:action such as:fd:action id=delete_item command=delete_itemfd:on-actionfd:_javascript_ var widget = event.source; var row = widget.parent; var repeater = row.parent; repeater.removeRow(repeater.indexOf(row)); // Your extra code here.../fd:_javascript_/fd:on-action/fd:actionHope this helps...RobinOn 16 Nov 2005, at 11:01, Marc Salvetti wrote: Hello,I have a cart displaying an invoice on top of the page and a cforms with a repeater displaying the products at the bottom of the page.I need to update the invoice when a row is deleted in the repeater The calculation of the invoice is done on the server and need to read from the dom binded to the formSo i need to do a form.save(doc) to update the dom tree, then pass this dom tree to the invoicing fonction. Now my problem is that for the row-delete action, the on-action handler is triggered *before* the row is removed, so calling form.save() in this handler is useless for me.Does someone now how to execute some code after the row is deleted ? Thanks,Marc-To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
execute js after row-delete ?
Hello, I have a cart displaying an invoice on top of the page and a cforms with a repeater displaying the products at the bottom of the page. I need to update the invoice when a row is deleted in the repeater The calculation of the invoice is done on the server and need to read from the dom binded to the form So i need to do a form.save(doc) to update the dom tree, then pass this dom tree to the invoicing fonction. Now my problem is that for the row-delete action, the on-action handler is triggered *before* the row is removed, so calling form.save() in this handler is useless for me. Does someone now how to execute some code after the row is deleted ? Thanks, Marc
Re: CForms, databinding and databases
Because... because... don't know why!! I think I need two widgetsbecause of the need to have two kinds of telephone number... How I can use just one widget for both of them?Sorry if this is a dummy question... I think i see your problem now, i didn't understand you need to have several different tel numbers stored for each contact, and not only one, but of a different type So i think, but it's just a guess, that you could have two repeaters on your template, one for office numbers and one for mobile, and map them both a different named resultset. For instance, you get a resultset named officeNums, and a resultset named mobileNums Then in your form, you create to repeaters matching theses names. HTH, Marc thanks in advance - is right now? ;)--Omar Adobati [EMAIL PROTECTED]-To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: CForms, databinding and databases
Yes, because I'm using a DB that has, for example, a table called telephoneNumber. How's that a problem? fd:field id=telephoneNumber works perfectly! I might be wrong, but if telephoneNumber is a table, i think it should be mapped to a repeater, not to a field. snip/ Now, I suppose is clear where the matter is: I have two widgets for each of the telephone number I need (homeNumber abd officeNumber) but I cant mach them with the columns Fields name!!! How to solve it? Does anybody know?Why do you need 2 widgets if you have only 1 field in your table ? Can't you make a conditional validation based on the value of your idType widget ? Marc
js après row-delete action
Bonjour, j'ai le problème suivant : j'ai un formulaire qui affiche des infos (une facture) en haut de page et un repeater en bas qui liste les produits. J'ai besoin de mettre à jour la facture quand une ligne est supprimée dans le repeater. Le calcul de la facture passe par le serveur et attend comme parametre le xml de la commande qui est attaché au formulaire. J'ai donc besoin de faire un form.save(doc) pour mettre à jour le xml, puis passer le doc à la fonction de calcul de facture pour ensuite reafficher le formulaire. Or pour l'action row-delete dans cforms, le handler on-action se declenche avant la supression de la ligne dans le repeater, ce qui rend inutile tout form.save() J'ai bien essayé endFormProcessing() pour renvoyer au script principal, mais apparement cette fonction n'existe plus. (elle est toujours dans la doc, il faudrait l'enlever) Je pourrais declencher automatiquement un bouton submit caché, mais ça me semble pas très propre et je ne vois pas trop comment faire. Quelqu'un a une idée ?
2.1.8 and mail block
Hello, i recently updated to 2.1.8 rc1, and i have some problems running the mail block. The first thing is that if i don't have mail.jar and activation.jar or if i have old versions of this jars or if i have recent versions doesn't change anything to my problem. If i try to send mail from my app, if i'm under jetty, i get a success response from the sendmail action and no errors in the log, but the message isn't sent, on the other hand, if i'm under tomcat, i get correct log messages and it works. If i try to compile a default cocoon distro, and run it normally with jetty, i always get the same exception in the logs [1] method not yet implemented The first fact i find strange, is that if i forget to put mail.jar and activation.jar in the lib/local folder of jetty, i don't get any classNotFound exception when running the mail samples. The second thing is that even after downloading recent jars from java.sun.com, i get the same error, which looks like if i didn't updated the jars ! So it looks like the system somehow find the classes somewhere, and ignore the jars in the lib folder, but i can't understand how, since i don't find any other instance of theses classes anywhere in the cocoon tree. Does anyone had similar problems or have any idea where to start tracking down the problem ? Marc [1] ERROR (2005-11-10) 15:40.27:142 [sitemap.action.sendmail] (/samples/blocks/mail/sendmail/new.html) PoolThread-4/Sendmail: An exception was thrown while sending email. java.lang.UnsupportedOperationException: Method not yet implemented at javax.mail.internet.MimeBodyPart.setFileName(MimeBodyPart.java:156) at org.apache.cocoon.mail.MailMessageSender.doSend(MailMessageSender.java:440) at org.apache.cocoon.mail.MailMessageSender.send(MailMessageSender.java:271) at org.apache.cocoon.acting.Sendmail.act(Sendmail.java:247) at org.apache.cocoon.components.treeprocessor.sitemap.ActTypeNode.invoke(ActTypeNode.java:119) at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:46) at org.apache.cocoon.components.treeprocessor.sitemap.ActTypeNode.invoke(ActTypeNode.java:138) at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:46) at org.apache.cocoon.components.treeprocessor.sitemap.PreparableMatchNode.invoke(PreparableMatchNode.java:130) at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:46) at org.apache.cocoon.components.treeprocessor.sitemap.PreparableMatchNode.invoke(PreparableMatchNode.java:130) at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:68) at org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invoke(PipelineNode.java:142) at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:68) at org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode.invoke(PipelinesNode.java:92) at org.apache.cocoon.components.treeprocessor.ConcreteTreeProcessor.process(ConcreteTreeProcessor.java:234) at org.apache.cocoon.components.treeprocessor.ConcreteTreeProcessor.process(ConcreteTreeProcessor.java:176) at org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:248) at org.apache.cocoon.components.treeprocessor.sitemap.MountNode.invoke(MountNode.java:117) at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:46) at org.apache.cocoon.components.treeprocessor.sitemap.PreparableMatchNode.invoke(PreparableMatchNode.java:130) at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:68) at org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invoke(PipelineNode.java:142) at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:68) at org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode.invoke(PipelinesNode.java:92) at org.apache.cocoon.components.treeprocessor.ConcreteTreeProcessor.process(ConcreteTreeProcessor.java:234) at org.apache.cocoon.components.treeprocessor.ConcreteTreeProcessor.process(ConcreteTreeProcessor.java:176) at org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:248) at org.apache.cocoon.components.treeprocessor.sitemap.MountNode.invoke(MountNode.java:117) at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:46) at org.apache.cocoon.components.treeprocessor.sitemap.PreparableMatchNode.invoke(PreparableMatchNode.java:130) at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:68) at
Re: 2.1.8 and mail block
Here's a wild guess. Check in your WEB-INF/lib to see anything beginningwith geronimo-spec. If there, delete them. They are (as far as I understand it) jar files that allow us to compileCocoon, but do not provide the full functionality that is required andcould account for method not yet implemented. Let me know whether I am right or not :-)Regards, Upayavira Bingo ! wild but clever guess ;) However, if i just delete all geronimo-* from web-inf/lib, the default cocoon fails to launch, probably because of some other block. I noticed that if i build cocoon with the jars in the local/lib folder, i get this message at the end of the build C:/CocoonSVN/tools/src/check-jars.xsl:154:24: Warning! [WARN] Using local library local/mail.jar : ensure it doesn't conflict with any other library. In my app, where only the blocks i used are selected, only 2 geronimo-* files are created (4 in default cocoon install) and deleting theses 2 files from my webapp/web-inf/lib directory did solve the problem and doesn't prevent cocoon to lauch correctly. Thanks a lot, Marc
Re: Ajaxeries
Merci beaucoup pour ta réponse, ton idee à l'air assez puissante, je vais essayer. Par contre, on dirait que je vais avoir pas mal de boulot pour integrer ça dans ma vielle sitemap :/ Marc Le 09/11/05, Sylvain Wallez [EMAIL PROTECTED] a écrit : Marc Salvetti wrote: Où se trouve ton aggrégation? Est-elle dans le pipeline appelé par form.showForm()? Si oui, c'est là qu'est le problème: les requêtes Ajax doivent rappeler la continuation, mais ne doivent pas passer par l'aggrégation. Sylvain Bon, en relisant calmement tous les messages et en essayant un peu differents trucs, je commence à mieux comprendre le probleme. Ce que tu dis est exactement mon problème. Mon aggregation se trouve dans le pipeline appelé par showForm(), et je ne vois pas comment faire autrement. Je me souviens avoir eu beaucoup de difficultés pour creer la serie de pipelines qui affichent les forms avec l'aggregation, et je pense que j'ai du me tromper quelque part dans la logique d'enchainement des pipes. Est-ce que si tu regarde les pipes que j'ai collé dans ma reponse precedente tu vois quelque chose qui te choque ? Ben... j'ai regardé ça, mais je n'ai pas des masses de temps, et le découpage en ressources n'a pas aidé à une compréhension rapide... Mais en gros, pour remonter l'aggrégation au plus haut niveau, il faut un truc du genre: map:match pattern=_do-* map:call function={1}/ /map:match map:match pattern=_continue map:call continuation={request-param:continuation-id}/ /map:match map:match pattern=_viewform-* ... pipeline de form, celui qui est appelé via Ajax ... /map:match map:match type=regexp pattern=[^_](.*) map:aggregate element=root map:part src=bandeau/ map:part src=cocoon://_{1}/ /map:aggregate map:transform src=styling-de-la-mort.xsl/ map:serialize/ /map:match Le préfixe _ désigne les parties individuelles, qui sont aggrégées lorsqu'une URL ne commençant pas par _ arrive. Sylvain -- Sylvain Wallez Anyware Technologies http://people.apache.org/~sylvain http://www.anyware-tech.com Apache Software Foundation Member Research Technology Director - Liste francophone Apache Cocoon -- http://cocoon.apache.org/fr/ Pour vous desinscrire : mailto:[EMAIL PROTECTED] Autres commandes : mailto:[EMAIL PROTECTED]
Re: Ajaxeries
Merci pour le lien, je l'ai transmis à ma soeur qui à 6 enfants plutot turbulents, ça pourrait les calmer :)) Le 09/11/05, Sylvain Wallez [EMAIL PROTECTED] a écrit : Marc Salvetti wrote: Merci beaucoup pour ta réponse, ton idee à l'air assez puissante, je vais essayer. Les idées puissantes, ça me rappelle powerful ideas in the classroom, un outil génial pour initier les enfants aux principes de modélisation et de programmation. Mon fils de 9 ans est accro et fait des trucs étonnants :-) http://smallwiki.unibe.ch/traductionfranaisedepowerfulideasintheclassroom/ Sylvain -- Sylvain Wallez Anyware Technologies http://people.apache.org/~sylvain http://www.anyware-tech.com Apache Software Foundation Member Research Technology Director - Liste francophone Apache Cocoon -- http://cocoon.apache.org/fr/ Pour vous desinscrire : mailto:[EMAIL PROTECTED] Autres commandes : mailto:[EMAIL PROTECTED]
Re: Ajaxeries
Merci pour le lien, je vais lire ça tout de suite. Oui, j'ai mis le browser-update, mais uniquement après le generate jx, pas dans le pipe d'au dessus qui fait l'aggregation. Marc Le 07/11/05, Sylvain Wallez [EMAIL PROTECTED] a écrit : Marc Salvetti wrote: Bonjour, je suis en train d'essayer d'ajaxiser un formulaire de mon appli, et j'ai rencontré d'abord ce problème dont j'ai trouvé la réponse, mais je la copie juste au cas ou :) Au début chaque requete affichait le message No xml answer. En fouillant un peu, je me suis rendu compte que c'est parceque j'utilise l'agreggation pour afficher les pages de mon site et un autre pipe pour generer le formulaire. Dans les exemples, le problème n'apparait pas car la page est generée à partir d'un seul pipe. Donc la solution est assez simple, il faut que ce code : 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 se trouve à la fin du pipe qui fait l'aggregation menu-titre-page et non pas à la fin du pipe qui genere le fomulaire. Maintenant, j'ai un autre problème. Je reçoit deux messages successifs No handler found for head element et No handler found for body element. J'ai retrouvé ce message dans 2 fichiers - cocoon-ajax.js et browserupdater.js, mais je n'arrive pas bien à comprendre ce que sont ces handlers et à quel moment ils sont initialisés. Est-ce que quelqu'un peut m'expliquer d'ou peut venir le problème ? Il y a une jolie doc sur le sujet, pour l'instant uniquement dans le CMS, qui sera incluse dans la 2.1.8: http://cocoon.zones.apache.org/daisy/documentation/forms/750.html Est-ce que tu as bien mis le browser-update transformer dans ton pipeline ? Sylvain -- Sylvain Wallez Anyware Technologies http://people.apache.org/~sylvain http://www.anyware-tech.com Apache Software Foundation Member Research Technology Director - Liste francophone Apache Cocoon -- http://cocoon.apache.org/fr/ Pour vous desinscrire : mailto:[EMAIL PROTECTED] Autres commandes : mailto:[EMAIL PROTECTED]
Re: Ajaxeries
Ok, je comprend le problème. Par contre, je ne vois pas bien ce qu'il faut que je mette dans l'attribut ajax-action. Si je pointe directement sur le pipe de generation de la form, je prend une erreur cannot find a form object, d'après ce que je comprend, parceque je ne repasse pas dans la fonction du flowscript. Or le pipe d'appel a cette fonction passe en parametre (le display-pipeline) le pipe d'aggregation. Est-ce qu'il faut que je rajoute un select ajax-request dans ce pipe pour passer un parametre different en cas de requete ajax ? Est-ce qu'il ne va pas y avoir un problème de continuation, du fait de sortir du premier showForm() pour en relancer un autre à chaque nouvelle requete ? Marc Le 07/11/05, Sylvain Wallez [EMAIL PROTECTED] a écrit : Marc Salvetti wrote: Merci pour le lien, je vais lire ça tout de suite. Oui, j'ai mis le browser-update, mais uniquement après le generate jx, pas dans le pipe d'au dessus qui fait l'aggregation. Ah, j'ai compris: dans le cas d'une aggrégation, il est nécessaire d'utiliser l'attribut ajax-action sur ft:form-template, de façon à ce que les requêtes Ajax pointent directement sur la gestion de la form plutôt que sur l'aggrégation. Sylvain -- Sylvain Wallez Anyware Technologies http://people.apache.org/~sylvain http://www.anyware-tech.com Apache Software Foundation Member Research Technology Director - Liste francophone Apache Cocoon -- http://cocoon.apache.org/fr/ Pour vous desinscrire : mailto:[EMAIL PROTECTED] Autres commandes : mailto:[EMAIL PROTECTED]
Re: Ajaxeries
Je vais essayer de coller le code de la sitemap qui rentre dans l'affichage du form, tu verras peut etre mieux quel est mon probleme, car je ne vois vraiment pas comment rappeler la continuation sans passer par l'aggregation. Dans la sitemap : La resource d'aggregation : map:resource name=composite map:aggregate element=site label=xml map:part src=cocoon:/get-login/ map:part src=cocoon:/book-{URI}.xml/ map:part src=cocoon:/body-{URI}.xml/ /map:aggregate map:transform src=stylesheets/site2xhtml.xsl map:parameter name=resource value={request-param:resource}/ map:parameter name=requestURI value={request-uri:requestURI}/ map:parameter name=page value={URI}/ map:parameter name=use-request-parameters value=true/ /map:transform map:select type=parameter map:parameter name=parameter-selector-test value={form}/ map:when test=true map:transform src=resources/forms-samples-styling.xsl/ /map:when /map:select map:transform type=i18n map:parameter name=locale value={locale}/ /map:transform map:select type=ajax-request map:when test=true map:serialize type=xml/ /map:when map:otherwise map:transform type=omitns/ map:serialize type=html/ /map:otherwise /map:select map:serialize type=xml/ /map:resource La resource form : map:resource name=form map:generate type=jx src={form-template}/ map:transform type=browser-update/ map:transform type=i18n map:parameter name=locale value={locale}/ /map:transform map:transform src=resources/forms-samples-styling.xsl/ map:transform type=i18n map:parameter name=locale value={locale}/ /map:transform map:select type=ajax-request map:when test=true map:serialize type=xml/ /map:when map:otherwise map:transform type=omitns/ map:serialize type=html/ /map:otherwise /map:select /map:resource La resource d'appel de la fonction flowscript : map:resource name=view-cart map:call function=form_cart2xml map:parameter name=definitionURI value=forms/cart-definition.xml/ map:parameter name=bindingURI value=forms/cart-binding.xml/ map:parameter name=displayPipeline value=view-cart-{suffix}.html/ /map:call /map:resource Le matcher de continuation : map:match pattern=**continue.html map:act type=auth-loggedIn map:parameter name=handler value=cfmhandler/ map:act type=auth-protect map:parameter name=handler value=cfmhandler/ map:call continuation={request-param:continuation-id}/ /map:act /map:act map:call continuation={request-param:continuation-id}/ /map:match Le matcher de la page du form sur lequel pointe la continuation (display-pipeline ds la fct flowscript) : map:match pattern=view-cart-*.html map:call resource=composite map:parameter name=URI value=view-cart-{1}/ map:parameter name=locale value={../locale}/ map:parameter name=form value=true/ /map:call /map:match Le matcher du contenu de la page formulaire : map:match pattern=body-view-cart-*.xml map:aggregate element=form_document map:part src=xdocs/forms/cart.xml/ map:part src=cocoon:/cart.form/ /map:aggregate map:transform src=stylesheets/form_document2document.xsl/ map:transform src=stylesheets/document2html.xsl/ map:transform type=i18n map:parameter name=locale value={../locale}/ /map:transform map:transform src=resources/forms-samples-styling.xsl/ map:serialize type=xml/ /map:match Le matcher interne commun a tous les formulaires : map:match pattern=*.form map:call resource=form map:parameter name=form-template value=forms/{1}-template.xml/ map:parameter name=action value={1}/ map:parameter name=locale value={../locale}/ /map:call /map:match Dans ma template j'ai ça : ft:form-template action=continue.html method=post ajax=true ajax-action=?? Et le probleme est donc que continue.html appele la continuation, qui relance showForm(displayPipeline), et ce displayPipeline doit correspondre à l'aggregation pour le premier appel (creation de la continuation) puis à un autre pipeline (oui mais lequel et comment changer la valeur de displayPipeline pendant l'execution de showForm ?) pour les appels suivants. Est-ce que j'ai bon ? Marc Le 07/11/05, Marc Salvetti [EMAIL PROTECTED] a écrit : Dans ajax-action, tu dois mettre l'action qui rappelle la continuation, qui elle même, après traitement de la form, rappelera le pipeline d'affichage. Sylvain Désolé, mais là je suis tout perdu :( L'action qui est actuellement dans le parametre action est l'action qui appelle la continuation. Donc je comprend pas ce que ça va changer de mettre la meme action dans ajax-action ? Marc Le 07/11/05, Sylvain Wallez [EMAIL PROTECTED] a écrit : Marc Salvetti wrote: Dans ajax-action, tu dois mettre l'action qui rappelle la continuation, qui elle même, après traitement de la form, rappelera le pipeline d'affichage. Sylvain Désolé, mais là je suis tout perdu :( L'action qui est actuellement dans le parametre action est l'action qui appelle la continuation. Donc je comprend pas ce que ça va changer de mettre la meme action dans ajax-action ? Où se trouve ton aggrégation? Est-elle dans le pipeline appelé par
Re: Ajaxeries
Le 07/11/05, Jean-Christophe Kermagoret [EMAIL PROTECTED] a écrit : Concrètement, map:match pattern=controller map:select type=request-method map:when test=POST !-- Tu n'appelles pas ton agrégation -- map:call continuation={request-param:continuation-id}/ /map:when map:when test=GET !-- Tu appelles ton agrégation -- map:call function=dispatch/ /map:when /map:select /map:match Jean-Christophe Je ne pense pas que ça puisse marcher dans mon cas, vu que mon problème est que la continuation rapelle l'aggregation. Ce qu'il faudrait, c'est que le pipe passé à showForm() pour l'affichage ne soit pas le pipe d'aggregation, mais à ce moment la, je ne vois pas comment afficher la page complète à la première et dernière requete. Marc
Ajaxeries
Bonjour, je suis en train d'essayer d'ajaxiser un formulaire de mon appli, et j'ai rencontré d'abord ce problème dont j'ai trouvé la réponse, mais je la copie juste au cas ou :) Au début chaque requete affichait le message No xml answer. En fouillant un peu, je me suis rendu compte que c'est parceque j'utilise l'agreggation pour afficher les pages de mon site et un autre pipe pour generer le formulaire. Dans les exemples, le problème n'apparait pas car la page est generée à partir d'un seul pipe. Donc la solution est assez simple, il faut que ce code : 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 se trouve à la fin du pipe qui fait l'aggregation menu-titre-page et non pas à la fin du pipe qui genere le fomulaire. Maintenant, j'ai un autre problème. Je reçoit deux messages successifs No handler found for head element et No handler found for body element. J'ai retrouvé ce message dans 2 fichiers - cocoon-ajax.js et browserupdater.js, mais je n'arrive pas bien à comprendre ce que sont ces handlers et à quel moment ils sont initialisés. Est-ce que quelqu'un peut m'expliquer d'ou peut venir le problème ? Merci, Marc
Re: 2.1.8 et fd:group
Je me repond tout seul, vu que j'ai trouvé le probleme :) C'est le fichier forms-samples-styling.xsl qui a changé. Du coup j'ai une question, est-ce qu'il est possible de referencer ce fichier à partir de la build cocoon ? du genre resource://quelquechose ? Marc Le 04/11/05, Marc Salvetti [EMAIL PROTECTED] a écrit : Bonjour, j'ai recemment recuperé la branche 2_1_X du svn et j'ai un formulaire qui ne marche plus. Le probleme vient apparement du fd:group dont le contenu n'est plus affiché (seul une balise div title=groupid/ est affichée). Quelqu'un à une idée de ce qui a changé ? Marc
Re: [Poll] What sources of information do you use?
Questions:1. What is your favorite source of information, in other words: where would you be most likely to read these articles if they were published? On the official cocoon website or on the wiki 2. Where would your boss/person deciding on framework be most likely toread these articles? I'm the same person Marc
Re: E-CRUD Design Pattern
Bonne nouvelle :) Au fait jc, tu as eu le temps de regarder le code que je t'ai envyé ? Marc Jean-Christophe Kermagoret a écrit : Bonjour, En y réfléchissant une fois supplémentaire, et en relisant les différents arguments des threads sur les licences, nous sommes d'accord pour passer en ASL. On effectue les changements de licence dans la foulée :-) Jean-Christophe Sylvain Wallez a écrit : [EMAIL PROTECTED] wrote: BlueXML rules :) flamenon c'est ruby on rails qui rules ;)/flame extincteurPfff... Python, Zope and Plone rulez the universe/extincteur Allez, allez les enfants. Rien ne vaut ce bon vieux C ou l'encore plus vieux Lisp :-P Ceci dit, pas mal BlueXML. Générer les forms et tout le tralala, ça fait gagner du temps. flameMais que BlueXML soit en GPL va empêcher beaucoup de monde de s'y intéresser autant qu'il le mérite.../flame Sylvain - Liste francophone Apache Cocoon -- http://cocoon.apache.org/fr/ Pour vous desinscrire : mailto:[EMAIL PROTECTED] Autres commandes : mailto:[EMAIL PROTECTED]
Re: E-CRUD Design Pattern
Thanks for the great work christophe, it's a really interesting solution. As many, i done something myself as an exercise that you may use. I designed a very small webapp with a few basic and probably reusable features like gui for user/group managment and gui for catalogues/messages managment, separation between sitemaps (general, data, backoffice) and a styling pattern that uses extensively css to separate design from logical structure. I think my solution for crud is far from good, but maybe you'd be interesting in seeing the code and maybe taking a few ideas ? Marc Jean-Christophe Kermagoret a écrit : Hello, For those who are interested, I uploaded a few documentation in the wiki about the E-CRUD Design Pattern. It is available from the Wiki Cocoon Frontpage in : * http://wiki.apache.org/cocoon/, or directly in : * http://wiki.apache.org/cocoon/DesignPattern/Overview There might be some interesting code and documentation (I hope :-) Your discussion is welcome, and, I will say more, awaited with great enthousiasm :-) It's a work in progress. If you have any question, or any remark or addition, don't hesitate to tell me, I will (or You may) correct it immediately. Jean-Christophe - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: E-CRUD Design Pattern
Jean-Christophe Kermagoret a écrit : Yes,it's a great idea. thanks :) Have you got an overview about your project's technical implementation (architecture, ...) ? Where may I download it to have a look ? i'll send you a personal mail with ftp accout PS: do you work with Franck Touch ? No, i nearly worked with him trough ;) Marc Salvetti a écrit : Thanks for the great work christophe, it's a really interesting solution. As many, i done something myself as an exercise that you may use. I designed a very small webapp with a few basic and probably reusable features like gui for user/group managment and gui for catalogues/messages managment, separation between sitemaps (general, data, backoffice) and a styling pattern that uses extensively css to separate design from logical structure. I think my solution for crud is far from good, but maybe you'd be interesting in seeing the code and maybe taking a few ideas ? Marc Jean-Christophe Kermagoret a écrit : Hello, For those who are interested, I uploaded a few documentation in the wiki about the E-CRUD Design Pattern. It is available from the Wiki Cocoon Frontpage in : * http://wiki.apache.org/cocoon/, or directly in : * http://wiki.apache.org/cocoon/DesignPattern/Overview There might be some interesting code and documentation (I hope :-) Your discussion is welcome, and, I will say more, awaited with great enthousiasm :-) It's a work in progress. If you have any question, or any remark or addition, don't hesitate to tell me, I will (or You may) correct it immediately. Jean-Christophe - 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: Rappel du form template en cas d'erreur ?
Salut Laurent, A mon avis, ce que tu veux faire est possible. Ton pb ressemble a une erreur ds l'enchainement des pipes. J'ai une config a peu pres similaire au niveau des composantes (menu, header, page centrale etc...), et je me souviens avoir longtemps tourné en rond pour arriver a regler le pb que tu decris. Finalement l'idee est assez simple, il suffit d'avoir un matcher du genre *.showform qui fait exactement la meme chose que ton matcher *.html, et de passer a ta fct flowscript un display-pipeline du genre monform.showform. a mon avis, que ce soit du map:aggregate ou du cinclude pour composer la page ne change pas grd chose au pb. Je sait pas si je suis très clair du coup je donne un petit exemple :) map:match pattern=**form-*.html map:call function=handleForm map:parameter name=function value=form_{2}2xml/ map:parameter name=display-pipeline value=form-{2}.showform/ map:parameter name=form-definition value=forms/admin/{2}-definition.xml/ map:parameter name=documentURI value=cocoon:/data/{2}/ map:parameter name=bindingURI value=forms/admin/{2}-binding.xml/ map:parameter name=success-pipeline value={2}_success.html/ /map:call /map:match map:match pattern=**.html map:call resource=composite map:parameter name=URI value={1}/ map:parameter name=prefix value=admin// map:parameter name=locale value={../locale}/ /map:call /map:match map:match pattern=**form-*.showform map:call resource=composite map:parameter name=URI value={1}form-{2}/ map:parameter name=locale value={locale}/ map:parameter name=form value=true/ /map:call /map:match Et dans la resource composite, tu compose la page du site avec la methode qui te plait. Marc Laurent Perez a écrit : Une page d'erreur générique? Et pourquoi ne pas réafficher la même page avec l'indication de l'erreur de saisie. Cocoon Forms est fait pour ça, tout de même :-) oui, c'est le comportement logique des CForms, mais j'ai voulu faire quelque chose qui à priori pose problème : j'ai une interface d'administration plutôt basique : un header avec quelques liens comme logout par ex., un menu à gauche pour sélectionner une section à administrer, un footer, et enfin un écran, qui affiche les CForms. plutôt qu'utiliser un map:aggregate qui regroupe les quatre morceaux, suivi d'une transfo xsl qui transforme tout, j'ai fait un squelette (JXTemplate), qui utilise des cinclude vers des patterns internes (comme cocoon:/menu.xml, cocoon:/header.xml, etc. mais surtout des choses comme cocoon:/forms/ajouterUnTruc.form) pour construire la page complète, le squelette reçoit ensuite une transformation cinclude, puis une transfo i18n à la fin. au 1er appel ça fonctionne, le flux issu de cocoon:/forms/ajouterUnTruc.form est bien inclu dans le JX, j'ai un joli formulaire :) mais quand une erreur de validation survient, showForm rappelle le pattern cocoon:/forms/ajouterUnTruc.form, et je me retrouve assez logiquement avec juste un formulaire et ses indicateurs de saisie, et pas le JX contenant les autres morceaux. ça ressemble à une erreur de design de ma part (pas taper), je voulais eviter de faire un pattern par CForm, qui aggrege toujours les trois mêmes morceaux, le quatrieme changeant à chaque fois (CForm différent), mais visiblement injecter les CForms avec un cinclude était pas une bonne idée. voilà, c'est un peu long, mais je le laisse pour les archives :) laurent - Liste francophone Apache Cocoon -- http://cocoon.apache.org/fr/ Pour vous desinscrire : mailto:[EMAIL PROTECTED] Autres commandes : mailto:[EMAIL PROTECTED] - Liste francophone Apache Cocoon -- http://cocoon.apache.org/fr/ Pour vous desinscrire : mailto:[EMAIL PROTECTED] Autres commandes : mailto:[EMAIL PROTECTED]
Re: How to evaluate an xpath expression against a dom tree in flow ?
Thx for the pointer Tony, the use of the sessionManager is very interesting. Best regards, Marc Tony Edwards a écrit : Hey Marc, Glad I could help. What I find when I'm developing with flowscript is that it gives you the tremendous ability to 'think outside the square' because flowscript can allow you to instanciate and use nearly every java object that's lying around. I don't know how I stumbled across this but I had the same problem as you in that I was sifting through the DOM nodes just using dom methods and getting quite frustrated. I've stuck an entry on the Wiki some time ago which included my general purpose flow script for DOM manipulation. Check it out at http://wiki.apache.org/cocoon/FlowBasedXMLEditor Regards, Tony Marc Salvetti wrote: Yes! thx a lot Tony, exactly what i needed ! btw is this referenced anywhere in the cocoon docs, because i've been looking for a while for some docs with this kind of practice or tips in flowscript, but never found anything consistant ? Marc Tony Edwards a écrit : Hi Marc, I use the XPathAPI to navigate a DOM. eg: importClass(org.apache.xpath.XPathAPI); nl = XPathAPI.selectNodeList(document, sXpath); where sXpath could be something like xPath = //authorityLink[linkNumber=' + linkNum + ']; I don't know if this is what you're after but I hope it helps!! Regards Tony Marc Salvetti wrote: Hello, I've been using flow with cforms for a while and the framework is great, but one thing that i found really uneasy is navigating in the dom tree with the dom api. For exemple, i often do things like : users = document.getDocumentElement().getElementsByTagName(users).item(0).getElementsByTagName(user); and then i have to iterate all nodes to find the one i want : for(var i=0; i users.getLength(); i++){ //Test each node against a property eg : id to find the node i want if(users.item(i).getAttribute('id').equals(foo)){ //The node is finally found... } } Now i would like to know if there is a class somewhere in the cocoon distribution that allows to use the much more convenient xpath syntax to navigate in the dom. Hopefully, sth like user = Utils.evalSax(document, authentication/users/[EMAIL PROTECTED]'foo']); Does something similar to this exist ? Thanks, Marc - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This email is from Civica Pty Limited and it, together with any attachments, is confidential to the intended recipient(s) and the contents may be legally privileged or contain proprietary and private information. It is intended solely for the person to whom it is addressed. If you are not an intended recipient, you may not review, copy or distribute this email. If received in error, please notify the sender and delete the message from your system immediately. Any views or opinions expressed in this email and any files transmitted with it are those of the author only and may not necessarily reflect the views of Civica and do not create any legally binding rights or obligations whatsoever. Unless otherwise pre-agreed by exchange of hard copy documents signed by duly authorised representatives, contracts may not be concluded on behalf of Civica by email. Please note that neither Civica nor the sender accepts any responsibility for any viruses and it is your responsibility to scan the email and the attachments (if any). All email received and sent by Civica may be monitored to protect the business interests of Civica. - 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] This email is from Civica Pty Limited and it, together with any attachments, is confidential to the intended recipient(s) and the contents may be legally privileged or contain proprietary and private information. It is intended solely for the person to whom it is addressed. If you are not an intended recipient, you may not review, copy or distribute this email. If received in error, please notify the sender and delete the message from your system immediately. Any views or opinions expressed in this email and any files transmitted with it are those of the author only and may not necessarily reflect the views of Civica and do not create any legally binding rights or obligations whatsoever. Unless otherwise pre-agreed by exchange of hard copy documents signed by duly authorised representatives, contracts may not be concluded on behalf of Civica by email. Please note that neither Civica nor the sender accepts any responsibility for any viruses and it is your responsibility to scan the email and the attachments (if any). All
Re: [Cforms] Activating/Hiding whole repeaters?
What about puting your repeater and whatever you'd like in a fd:group and then hiding the group ? Marc Florian Leinberger a écrit : Hi, I would like to display/hide a whole repeater (containing several widgets) in a cocoon form depending on which value is selected in a select-field above this repeater. I know how this can be done with single widgets using javascript in the form definition, like setState(Packages.org.apache.cocoon.forms.formmodel.WidgetState.ACTIVE); setState(Packages.org.apache.cocoon.forms.formmodel.WidgetState.INVISIBLE); I would appreciate any hints if this can be done in a similiar way to show/hide not only a single widget but a whole repeater containing several widgets (with all its repetitions). I tried RepeaterState which didn't work though :-( Thanks, Florian - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to evaluate an xpath expression against a dom tree in flow ?
Yes! thx a lot Tony, exactly what i needed ! btw is this referenced anywhere in the cocoon docs, because i've been looking for a while for some docs with this kind of practice or tips in flowscript, but never found anything consistant ? Marc Tony Edwards a écrit : Hi Marc, I use the XPathAPI to navigate a DOM. eg: importClass(org.apache.xpath.XPathAPI); nl = XPathAPI.selectNodeList(document, sXpath); where sXpath could be something like xPath = //authorityLink[linkNumber=' + linkNum + ']; I don't know if this is what you're after but I hope it helps!! Regards Tony Marc Salvetti wrote: Hello, I've been using flow with cforms for a while and the framework is great, but one thing that i found really uneasy is navigating in the dom tree with the dom api. For exemple, i often do things like : users = document.getDocumentElement().getElementsByTagName(users).item(0).getElementsByTagName(user); and then i have to iterate all nodes to find the one i want : for(var i=0; i users.getLength(); i++){ //Test each node against a property eg : id to find the node i want if(users.item(i).getAttribute('id').equals(foo)){ //The node is finally found... } } Now i would like to know if there is a class somewhere in the cocoon distribution that allows to use the much more convenient xpath syntax to navigate in the dom. Hopefully, sth like user = Utils.evalSax(document, authentication/users/[EMAIL PROTECTED]'foo']); Does something similar to this exist ? Thanks, Marc - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This email is from Civica Pty Limited and it, together with any attachments, is confidential to the intended recipient(s) and the contents may be legally privileged or contain proprietary and private information. It is intended solely for the person to whom it is addressed. If you are not an intended recipient, you may not review, copy or distribute this email. If received in error, please notify the sender and delete the message from your system immediately. Any views or opinions expressed in this email and any files transmitted with it are those of the author only and may not necessarily reflect the views of Civica and do not create any legally binding rights or obligations whatsoever. Unless otherwise pre-agreed by exchange of hard copy documents signed by duly authorised representatives, contracts may not be concluded on behalf of Civica by email. Please note that neither Civica nor the sender accepts any responsibility for any viruses and it is your responsibility to scan the email and the attachments (if any). All email received and sent by Civica may be monitored to protect the business interests of Civica. - 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]
How to evaluate an xpath expression against a dom tree in flow ?
Hello, I've been using flow with cforms for a while and the framework is great, but one thing that i found really uneasy is navigating in the dom tree with the dom api. For exemple, i often do things like : users = document.getDocumentElement().getElementsByTagName(users).item(0).getElementsByTagName(user); and then i have to iterate all nodes to find the one i want : for(var i=0; i users.getLength(); i++){ //Test each node against a property eg : id to find the node i want if(users.item(i).getAttribute('id').equals(foo)){ //The node is finally found... } } Now i would like to know if there is a class somewhere in the cocoon distribution that allows to use the much more convenient xpath syntax to navigate in the dom. Hopefully, sth like user = Utils.evalSax(document, authentication/users/[EMAIL PROTECTED]'foo']); Does something similar to this exist ? Thanks, Marc - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Pb cforms + bouton precedent
Sylvain Wallez a écrit : Je vois le pb: lorsqu'on passe à un nouvel écran, le fd:group contenant la partie du formulaire que l'on vient de soumettre est mise dans l'état invisible. Outre le fait de cacher cette partie, cela a aussi pour effet de désactiver les fd:action de ce groupe, c'est à dire les boutons précédent et suivant. Quand on revient en arrière sur le navigateur et qu'on clique sur suivant dans le formulaire, l'action correspondante est dans l'état invisible et ne répond donc pas à la sollicitation. Cela a aussi pour effet que CForms considère que la form a été postée sans submit-widget particulier. Merci beaucoup pour cette réponse Sylvain, comme d'habitude, ca explique très clairement le problème :) C'est donc un souci dans cette approche pour les formulaires multipages. Pour gérer le retour arrière du navigateur, il faudrait remonter la navigation entre pages au niveau du flowscript, de façon à avoir des continuations différentes entre les différentes étapes du formulaire. Par contre, ici je ne comprend pas bien ce que tu veux dire par remonter la navigation entre pages au niveau du flow. Est-ce que tu pourrais donner un petit exemple de l'idee ? Marc - Liste francophone Apache Cocoon -- http://cocoon.apache.org/fr/ Pour vous desinscrire : mailto:[EMAIL PROTECTED] Autres commandes : mailto:[EMAIL PROTECTED]
Re: Link: Project: www.GoPubMed.org
Hi Tony, while you're at it, could you check if http://www.cfmekong.com is in the queue as well ? it's running cocoon 2.1.7, i've put a mail about it some 6 month ago but i think it's not on the list. Thanks, Marc Tony Collen a écrit : Andreas, I'm going to go through some livesites tonight and see what I can get committed, since there are some other ones in the queue -- I'll see about adding it tonight. Tony Andreas Doms wrote: At while ago I created a ticket to list GoPubMed as a Cocoon application on your site. Did you get such a ticket? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] . - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Cocoon and OpenLaszlo
True, i tried a few exemples and the first generation is really slow for just a hello world :-\ the good this is that the cocoon caching system seems to work fine with lazlo, so depending on how the pipes are designed and optimized for caching, this can remain a small problem. For me, the main difficulty i see is to have underlying logical documents that fit with both lazlo and html view. The problem will always be to match this or this lazlo feature (like window or layout) in html+css. Proably a lot of headaches here, but really worth it :) Marc Sebastien Arbogast a écrit : I see it also like that, cocoon is a MVC framework that handles easily multiples V, why not using lazlo for at least one of the views of the webapp ? Exactly ! That could make accessibility go a step further : you make a RIA V and for those who don't want or don't like Flash, you just make an AJAX or plain XHTML one, without having to develop all the rest again. Moreover, I think that OpenLaszlo misses a few features that Cocoon provides, like i18n for example (their support for resources is quite... simple), so we could translate lzx files before passing them to LZX compiler. The big problem I see with this collaboration is that performance is already a big issue with Laszlo. So with Cocoon XML transformations before, it could be awful. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Cocoon and OpenLaszlo
Sebastien Arbogast a écrit : For me, the main difficulty i see is to have underlying logical documents that fit with both lazlo and html view. The problem will always be to match this or this lazlo feature (like window or layout) in html+css. Proably a lot of headaches here, but really worth it :) You're right. It would be like trying to combine two different ways to do the same thing : Cocoon and Laszlo are both for the presentation layer, but Cocoon is MVC whereas Laszlo is not, so piping Cocoon M and C into a Laszlo V would require Laszlo to be MVC itself, which it's not and it's normal as it' doesn't need to be : MVC fits for the classical Web, not for that new kind of RIA's. That's not what i meant :), i think it's possible to see laszlo as just another channel in multiprocessing. But you have to think about it when you design your webapp. I will try to be a bit more detailed here, as i already thought a bit about that ;) let's say you have your data datahello world/data then you hav a xsl that changes it in a logical page in a neutral GUI language which can be deeply inspired from the laszlo grammar : page canvas id=hello-worldtexthello world/text/canvas /page then you can have a xsl by channel : the classical html+css styling html headstyle/style/head bodydiv class=canvas id=hello-worldspanhello world/span/canvas/body /html or the laszlo styling : canvas id=hello-world texthello world/text /canvas All you need is to design xsl templates that match laszlo features, like canvas, window (can be easily done with good css and a bit of client js), layout (i think it's the more difficult to do) etc... I guess the best thing is to make a choice. It's already amazing what you can do with this incredible framework. For example, I haven't tried it yet, but it seems that you can connect a Laszlo presentation layer with a Spring business layer through JavaRPC. So i don't think you have to make a choice, you just have to structure your logical documents thinking a bit about how laszlo works. In fact it depends on what your priority is. If you want accessibility and multichanneling first, Cocoon is the best choice. If user experience is your main concern, Laszlo is excellent. And this user-experience concern is becoming very present : think of XUL or XAML, they do exactly the same as Laszlo, except that those two are not portable between browsers... - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Cocoon and OpenLaszlo
Sebastien Arbogast a écrit : Yes but do you think it's really possible to design your logical documents to fit such different paradigms as the ones of HTML and Laszlo ? The main discrepancy I see is that an HTML page must be built once and for all (except if it uses AJAX to load data but it's still an exception), I don't know what is AJAX, sorry :) whereas with Laszlo, it's very common to have different window's extract information from different sources after the application has been loaded through the different RPC API's. As i see it, you don't do have to do any RPC from laslzo, because theses calls are done with cocoon on the MC side, you just feed the window with the same content as in html, but in one case the window is designed with html+css and in the other case through laszlo serializer. Hope that makes sense ;) Marc - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Cocoon and OpenLaszlo
Yes but if you do it that way, you don't need a RIA anymore, and using Laszlo is even worse than using anything else as your whole page has to be refreshed and in the case of Laszlo, recompiled. It's very important to understand that Laszlo-style RIA's and Cocoon-generated HTML pages use very different paradigms. That's precisely the strength of Laszlo : it makes you think about web applications completely differently. That's why I'm particularly skeptical about using it in conjunction with Cocoon. Yes, that makes a lot of sense. Thanks for that, i'll save a lot of time by not going in that direction then :) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Use cocoon pipeline result as cform input?
hi, have a look at the forms block samples in the cocoon distrib, Marc Christofer Dutz a écrit : Hi, I am trying to bind a cforms form to an xml-result delivered by an internal cocoon pipeline. My first attempt (form.load(cocoon:/db/tablename/where.xml);) looked promising at fist, but didn’t seem to work. Could anyone give me a hint? Thanks in advance, Christofer Dutz - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Cocoon and OpenLaszlo
Hello, I see it also like that, cocoon is a MVC framework that handles easily multiples V, why not using lazlo for at least one of the views of the webapp ? Marc Yves Vindevogel a écrit : Your 2 cents are worth a dollar (or a euro) Well, that's also how I see it. Cocoon is far better than Laszlo in the base xml stuff, like data access, authentication, ... Laszlo is very nice for GUI, which Cocoon is totally not. It would be nice to have a pipeline that uses Laszlo as the final step for the GUI. On 29 Aug 2005, at 20:38, Sebastien Arbogast wrote: 2005/8/29, Yves Vindevogel [EMAIL PROTECTED]: Hi, I read a pretty interesting article on OpenLaszlo, which uses similar techniques to Cocoon for presenting web content. Has anybody done any interaction with it ? Is there any project that is similar to OpenLaszlo in the Apache foundation ? I'm looking for a RIA (Rich Internet Application) environment. www.openlaszlo.org OpenLaszlo is indeed a very interesting thing but after having read through the whole documentation, I don't see it in the same field as Cocoon. As you said the main aspect of OpenLaszlo is interface through RIA access. In a sense it's kind of a pure presentation layer, without any implementation of MVC. On the other end, the main advantage of Cocoon is multichannel processing through XML transformations, and very strict implementation of MVC. The only common point I see between Cocoon and Laszlo is some sort of GUI framework but in Cocoon, CForms are still very limited compared to what you can do with Laszlo, and even if there have been recent works to integrate AJAX in Cocoon, it's still far from it. IMO Cocoon and Laszlo work in the same layer in the application architecture, but don't do the same thing. At best they overlap a little bit. But I see more resemblance with Struts or Spring MVC, than with Laszlo. Just my two cents... -- Sébastien Arbogast Blog : http://www.sebastien-arbogast.com The Epseelon Project : http://www.epseelon.org - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Met vriendelijke groeten, Bien à vous, Kind regards, *Yves Vindevogel* *Implements* Mail: [EMAIL PROTECTED] - Mobile: +32 (478) 80 82 91 Kempische Steenweg 206 - 3500 Hasselt - Tel-Fax: +32 (11) 43 55 76 Web: http://www.implements.be / First they ignore you. Then they laugh at you. Then they fight you. Then you win. Mahatma Ghandi./ - 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: map:mount src=some.xmap makes cocoon.sendPage fail
Hi, i think when you use sendPage(url), the url determine which sitemap it refers to cocoon://pipeline is in the main sitemap and cocoon:/pipeline is in the current sitemap hth, marc Antonio Fiol Bonnín a écrit : Hello, I have discovered that on Cocoon 2.1.7 (not tested on other versions), if I have: map:mount check-reload=yes src=internal.xmap uri-prefix=internal/ and internal.xmap contains: map:flow language=javascript map:script src=flow/internal.js/ /map:flow and map:match pattern=pipeline ... /map:match and another pipeline in internal.xmap calls a javaflow function which uses cocoon.sendPage(pipeline); the pipeline pipeline is NOT FOUND. However, I found that using the following workaround, the problem no longer appears. map:mount check-reload=yes src=./internal.xmap uri-prefix=internal/ The difference being a ./ before the file name. Could this be a bug?... At least it seems so... Or maybe I'm completely confused... -- Antonio - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: idea: log utility
Never heard about this ! I've only start using cocoon since 2.1.x version, so i can't be sure, but i've been looking around a bit and didn't find anything about this. Marc Tony Edwards a écrit : Didn't version 2.0.4 have the ability to output log files as XML? (or am I dreaming!) I can vaguely remember setting a parameter somewhere that would enable log files to be rendered as xml. Has anybody else had this dream??? Regards, Tony Marc Salvetti wrote: Hello, it sounds a bit complex to me, what about a custom logGenerator who reads format from logkit.xconf, parse the logfile as a string according to the format, and then generates a xml logFile ? I was thinking of creating such a component myself. Maybe it would be a good start to create the frontend you are thinking of ?. Marc Joose Vettenranta a écrit : Hi, got an idea for what - perhaps - could be a nice tool for cocoon, atleast for production sites: Web frontend for exception handling. Idea is that when software get's exception and goes to process map:handle-errors error (with stack trace and stuff) would also be recorded to database. then in web frontend you could group, change priority, mark as fixed, delete, get latest exceptions with rss .. and so on. It would be easy to follow prodcution sites errors like that. I thought it would work like having a bean to save that data and it would have like processException method in it, which would set all correct fields to correct values and then use like OJB to save it. I don't have time to code that now, but if someone is going to code that or similar, I definetly want to try and even help with it. - Joose -- Always remember that you are unique, just like everyone else! * http://iki.fi/joose/ * [EMAIL PROTECTED] * +358 44 561 0270 * - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: JXTemplate formatDate problem
Hello, c:set var=now value=${java.util.Calendar.getInstance()}/ try c:set var=now value=${java.util.Calendar.getInstance().getTime()}/ Marc - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: JXTemplate formatDate problem
You can use the i18n transformer and pass the parameter $now to your stylesheet like this : map:transform src=stylesheets/transform.xsl map:parameter name=now value={date:date} / /map:transform then in the xsl : i18n:date src-pattern=your pattern from cocoon.xconf pattern=''anythingxsl:value-of select=$now//i18n:date Marc Frank Taffelt a écrit : Marc Salvetti wrote: Hello, c:set var=now value=${java.util.Calendar.getInstance()}/ try c:set var=now value=${java.util.Calendar.getInstance().getTime()}/ the new version also doesn't work: ?xml version=1.0? page xmlns:c=http://apache.org/cocoon/templates/jx/1.0; test c:set var=now value=${java.util.Calendar.getInstance().getTime()}/ variant c:formatDate value=${now}/ /variant c:set var=sdf value=${java.text.SimpleDateFormat('dd.MM.')}/ variant ${sdf.format(now)} /variant /test /page any other ideas ? - 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: JXTemplate formatDate problem
... or maybe better, format your date in the fowscript function that call your jx template, and make it available from the template with cocoon.sendPage(the-jx-pipe, {now : formattedDate}) Marc Frank Taffelt a écrit : Marc Salvetti wrote: Hello, c:set var=now value=${java.util.Calendar.getInstance()}/ try c:set var=now value=${java.util.Calendar.getInstance().getTime()}/ the new version also doesn't work: ?xml version=1.0? page xmlns:c=http://apache.org/cocoon/templates/jx/1.0; test c:set var=now value=${java.util.Calendar.getInstance().getTime()}/ variant c:formatDate value=${now}/ /variant c:set var=sdf value=${java.text.SimpleDateFormat('dd.MM.')}/ variant ${sdf.format(now)} /variant /test /page any other ideas ? - 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: idea: log utility
Hello, it sounds a bit complex to me, what about a custom logGenerator who reads format from logkit.xconf, parse the logfile as a string according to the format, and then generates a xml logFile ? I was thinking of creating such a component myself. Maybe it would be a good start to create the frontend you are thinking of ?. Marc Joose Vettenranta a écrit : Hi, got an idea for what - perhaps - could be a nice tool for cocoon, atleast for production sites: Web frontend for exception handling. Idea is that when software get's exception and goes to process map:handle-errors error (with stack trace and stuff) would also be recorded to database. then in web frontend you could group, change priority, mark as fixed, delete, get latest exceptions with rss .. and so on. It would be easy to follow prodcution sites errors like that. I thought it would work like having a bean to save that data and it would have like processException method in it, which would set all correct fields to correct values and then use like OJB to save it. I don't have time to code that now, but if someone is going to code that or similar, I definetly want to try and even help with it. - Joose -- Always remember that you are unique, just like everyone else! * http://iki.fi/joose/ * [EMAIL PROTECTED] * +358 44 561 0270 * - 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]
Comment acceder au contexte authentication depuis le flowscript
Bonjour, j'ai cette fonction dans mon script : function saveCartDoc(contextName, path, cartDoc){ var manager = cocoon.getComponent(Packages.org.apache.cocoon.webapps.authentication.AuthenticationManager.ROLE); try{ cocoon.log.debug(saving cartdoc to context + contextName + at path + path); var frag = cartDoc.createDocumentFragment(); frag.appendChild(cartDoc.getDocumentElement()); var user = manager.isAuthenticated(cfmhandler); var ctx = user.getContext(); ctx.setXML(path, frag); } finally { cocoon.releaseComponent(manager); } } Et j'ai deux questions : -Est-ce que cette approche est correcte pour écrire dans le contexte ? -Pourquoi le code plante au moment du releaseComponent() ? d'après l'erreur manager est toujours null car j'ai une NPE sur cette ligne. - Liste francophone Apache Cocoon -- http://cocoon.apache.org/fr/ Pour vous desinscrire : mailto:[EMAIL PROTECTED] Autres commandes : mailto:[EMAIL PROTECTED]
Re: Comment acceder au contexte authentication depuis le flowscript
(Thread.java:534) Caused by: java.lang.NullPointerException at org.apache.cocoon.webapps.authentication.context.AuthenticationContext.setXML(AuthenticationContext.java:214) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:230) at org.mozilla.javascript.ScriptRuntime.call(ScriptRuntime.java:1244) at org.mozilla.javascript.continuations.ContinuationInterpreter.interpret(ContinuationInterpreter.java:1134) at org.mozilla.javascript.continuations.ContinuationInterpreter.interpret(ContinuationInterpreter.java:190) at org.mozilla.javascript.continuations.ContinuationInterpreter.interpret(ContinuationInterpreter.java:138) at org.mozilla.javascript.continuations.InterpretedFunctionImpl.call(InterpretedFunctionImpl.java:121) at org.mozilla.javascript.ScriptRuntime.call(ScriptRuntime.java:1244) at org.mozilla.javascript.ScriptableObject.callMethod(ScriptableObject.java:1591) at org.apache.cocoon.components.flow.javascript.fom.FOM_JavaScriptInterpreter.handleContinuation(FOM_JavaScriptInterpreter.java:843) ... 49 more Sylvain Wallez a écrit : Marc Salvetti wrote: Bonjour, j'ai cette fonction dans mon script : function saveCartDoc(contextName, path, cartDoc){ var manager = cocoon.getComponent(Packages.org.apache.cocoon.webapps.authentication.AuthenticationManager.ROLE); try{ cocoon.log.debug(saving cartdoc to context + contextName + at path + path); var frag = cartDoc.createDocumentFragment(); frag.appendChild(cartDoc.getDocumentElement()); var user = manager.isAuthenticated(cfmhandler); var ctx = user.getContext(); ctx.setXML(path, frag); } finally { cocoon.releaseComponent(manager); } } Et j'ai deux questions : -Est-ce que cette approche est correcte pour écrire dans le contexte ? Je ne sais pas trop dire, parce que je n'utilise pas l'authentication-fw... (et au passage, cette API qui réclame un DocumentFragment n'est pas vraiment sympathique...) -Pourquoi le code plante au moment du releaseComponent() ? d'après l'erreur manager est toujours null car j'ai une NPE sur cette ligne. Tu peux nous donner la trace de la NPE ? Sylvain - Liste francophone Apache Cocoon -- http://cocoon.apache.org/fr/ Pour vous desinscrire : mailto:[EMAIL PROTECTED] Autres commandes : mailto:[EMAIL PROTECTED]
Re: Comment acceder au contexte authentication depuis le flowscript
Oui, il y a une login action avant l'appel dans ce pipeline : map:match pattern=view-cart-member-*-* map:act type=auth-protect map:parameter name=handler value=cfmhandler/ map:call resource=view-cart map:parameter name=position value={../1}/ map:parameter name=page value={../2}/ map:parameter name=id-user value={ID}/ map:parameter name=id-org value={org}/ map:parameter name=role value={role}/ map:parameter name=suffix value=member/ map:parameter name=context value=authentication/ /map:call /map:act /map:match Sylvain Wallez a écrit : Marc Salvetti wrote: Merci de ta réponse, voila la trace : Caused by: java.lang.NullPointerException at org.apache.cocoon.webapps.authentication.context.AuthenticationContext.setXML(AuthenticationContext.java:214) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:230) Hmm... en remontant la piste depuis setXML, on trouve que SessionContext.getState() renvoie null. Et ce state est n'est valué que dans DefaultAuthenticationManager.login(). Est-ce qu'il y a une login-action ou équivalent avant l'appel du flowscript? Sylvain - Liste francophone Apache Cocoon -- http://cocoon.apache.org/fr/ Pour vous desinscrire : mailto:[EMAIL PROTECTED] Autres commandes : mailto:[EMAIL PROTECTED]
Re: Comment acceder au contexte authentication depuis le flowscript
snip/ Hmm... en remontant la piste depuis setXML, on trouve que SessionContext.getState() renvoie null. Comment est-ce que tu arrive a voir ça ds la trace ??? Et ce state est n'est valué que dans DefaultAuthenticationManager.login(). J'imagine que cette fonction est appelée par la login action ? Et dans ce cas, je n'explique toujours pas la NPE au moment du release :( Marc - Liste francophone Apache Cocoon -- http://cocoon.apache.org/fr/ Pour vous desinscrire : mailto:[EMAIL PROTECTED] Autres commandes : mailto:[EMAIL PROTECTED]
Accessing the authentication context from flow
Hello, i have a problem accessing the authentication context from flow. i have the following function in my flowscript : function saveCartDoc(contextName, path, cartDoc){ try{ cocoon.log.debug(saving cartdoc to context + contextName + at path + path); var contextMan = cocoon.getComponent(Packages.org.apache.cocoon.webapps.session.ContextManager.ROLE); var authContext = contextMan.getContext(contextName); if(authContext == null) throw context + contextName + not found; var frag = cartDoc.createDocumentFragment(); frag.appendChild(cartDoc.getDocumentElement()); authContext.setXML(path, frag); } finally { cocoon.releaseComponent(contextMan); } } This works fine with a self created context when the user isn't authentified, but when he is authentified, the authentication context is always null :( I know the context is created because i can read it with the session transformer. Should i call another contextManager ? If so, how do i do that ? Thanks, Marc - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Mail and continuations
Hello, i'm trying to send mails that contains link with continuation-id, and there is 2 things i don't understand. First i tried the following link in my jx template : a href=continue.html?continuation-id=#{$cocoon/continuation/id}continue.html?continuation-id=#{$cocoon/continuation/id}/a I want the continuation-id to appear in the text of the link in case the user use a text mode mail client or want to copy/paste the url. The pb is that in the mail i receive, the continuation id is in the href part, so the link works perfectly, but it's not in the text part ! ie : the received link is like that : a href=http://localhost:8080/continue.html?continuation-id=69636f7c523f2279741c2b1942132f1d380f4f34; continue.html?continuation-id=/a Then i tried to put the id in a hidden field in a form, but when the form is received by cocoon, it doesn't receive the continuation-id in the request parameters Here is the form received in the mail : form action=http://localhost:8080/continue.html; method=post input type=hidden id=continuation-id name=continuation-id value=69636f7c523f2279741c2b1942132f1d380f4f34/ input type=submit name=submit value=Valider/ /form I would like to know if someone have an explanation for theses problems. Thanks, Marc - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Mail and continuations
Aurélien DEHAY a écrit : My choice was to put a confirmation field in the database, and put this field (randomly generated) instead of the continuation in the mail. Thus, the user can validate is account whenever he wants. And I've got no continuation left in memory. In my case i don't use a database (i was very new to cocoon when i started the project and never came in the situation where i really needed one). And the numbers of user wanting to buy a cruise on this boat shouldn't exceed 1 or 2 per day in the best case, so i'm not too scared about the memory usage. the other situation is when a company want to open an account, the mail is then sent to the manager and the form is redisplayed, allowing the manager to validate/change the data in the form before saving the account. In the first case, the lifetime of the continuation is set to 10 hours, which should be enough for the user to check is mail and click on the link. If it's not, a page explaining that he have to process his request again is displayed. In the second case, the lifetime is set to 100 hours, so that the manager have a few days to check the validity of the information sent. Waw. You should have a lot of memory ;) Or very few users :p Same here with even less demands, maybe one every month or so. In any case, this approach is really convenient, and i don't really see the danger in doing this. Could you explain further why it's dangerous/bad practice ? I don't really know. We were thinking it was a good practice to not over-use the memory by keeping needless things while we could put these in the database, in a same place who can resist to a crash of the machine. I choose this solution because the good part of the continuation is that you don't have to store anything, the continuation does it for you. And in my case, there is very few continuations likely to live together in memory, and the amount of data stored in memory is very small (only one small dom object and a few strings). Marc - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: XSLT transformation
Yes, this is the expected behavior, the pipe will always stop at the first serializer, or before if there is an error, no matter what's after it. I just left the second transform because i always use this technique to debug my pipes : moving a serialize type=xml line to differents places in the pipe to figure the guilty transform. So in your case, .if the following give no error map:generate type=file src=content/showsyscontainer.xml/ map:transform type=bdbxml/ map:serialize type=xml/ It just means your bdbxml class is ok. So you can look for the pb in containerslist.xsl Marc Antony Grinyer a écrit : Thanks for the idea Mark - I tried this and it just displays the XML? Seems it's stopping at the map:serialize type=xml/ and not moving onto map:transform type=xslt src=style/xsl/containerslist.xsl/? Thanks, Ant -Original Message- From: Marc Salvetti [mailto:[EMAIL PROTECTED] Sent: 03 August 2005 06:26 pm To: users@cocoon.apache.org Subject: Re: XSLT transformation You can just try the following pipe map:match pattern=listcontainers map:generate type=file src=content/showsyscontainer.xml/ map:transform type=bdbxml/ map:serialize type=xml/ map:transform type=xslt src=style/xsl/containerslist.xsl/ map:serialize type=html/ /map:match if you get the same error, the pb is in the java class, if not, it's in the stylesheet :) Marc Antony Grinyer a écrit : Hi, A have a simple sitemap entry as below: map:match pattern=listcontainers map:generate type=file src=content/showsyscontainer.xml/ map:transform type=bdbxml/ map:transform type=xslt src=style/xsl/containerslist.xsl/ map:serialize type=html/ /map:match The generator is a simple XML file which is passed to a java class transformer ( referenced as type=bdbxml) which returns XML results. This all works fine if I use map:serialize type=xml/ to simply output the XML, however if I try to transform the XML output with the XSLT transformer above I get an error: Error executing pipeline. org.apache.cocoon.ProcessingException: Error executing pipeline.: java.lang.RuntimeException I know the XSLT containerslist.xsl is correct as I've tried it against some sample output XML in XMLSpy, but it appears that when I add this XSLT transformer I get a Processing Exception? In the sitemap.log it is reported as: Unable to get parser: java.lang.RuntimeException: java.lang.NullPointerException Any ideas please? (for a Cocoon newbie) Thx in advance, Ant - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Flowscript et Upload
Pour cforms il y a cette javadoc : http://www.jdocs.com/cocoon/1.2.5.1/api/org/apache/cocoon/forms/formmodel/package-summary.html sinon pour l'upload j'avait fait ca il y a longtemps pour des photos, tu trouveras pe qq lignes a copier coller ici, mais je ne suis pas sur de la qualité de ce code ;) // Handle newly uploaded files for(var i=0; iform.getChild(photos).getSize(); i++){ var row = form.getChild(photos).getRow(i); var pic = row.getChild(upload).getValue(); var uri; if(pic != null){ print(upload : +pic.getheaders().get(filename)); upImg = readImage(pic); //If the upload replace an old file, delete this file and the thumbnail if(row.getChild(src).getValue() != null){ uri = form.getChild(folderPath).getValue() + / + row.getChild(src).getValue(); var oldImage = resolveToFile( uri); if(oldImage.isFile()){ oldImage[delete](); } uri = form.getChild(folderPath).getValue() + /thumbnails/ + row.getChild(src).getValue(); oldImage = resolveToFile( uri); if(oldImage.isFile()){ oldImage[delete](); } } uri = form.getChild(folderPath).getValue() + / + pic.getheaders().get(filename); var newImage = resolveToFile( uri); uri = form.getChild(folderPath).getValue() + /thumbnails/ + pic.getheaders().get(filename); var newThumb = resolveToFile( uri); //try to copy the image and thumbnail to local filesystem copyFiles(upImg, newImage, newThumb); } } function resolveToFile(uri){ var resolver = null; var filesource = null; try { resolver = cocoon.getComponent(Packages.org.apache.cocoon.environment.SourceResolver.ROLE); filesource = resolver.resolveURI(uri); var file = new java.io.File(new java.net.URI(filesource.getURI().replaceAll( , %20))); return file; } finally { if(filesource != null) resolver.release(filesource); cocoon.releaseComponent(resolver); } } function readImage(file){ var upImg = javax.imageio.ImageIO.read(file.getInputStream()); try{ upImg.getHeight(); }catch(e){ throw new Exception(Unreadable image); } return upImg; } function copyFiles(upImg,newImage, newThumbnail) { var THUMBNAILS_MAX_DIM = 100; var IMAGES_MAX_WIDTH = 500; var scale = THUMBNAILS_MAX_DIM / upImg.getHeight(); if(upImg.getWidth() upImg.getHeight()){ scale = THUMBNAILS_MAX_DIM / upImg.getWidth(); } // Determine size of new tuhmbnail. One of them should equal maxDim. var scaledW = scale * upImg.getWidth(); var scaledH = scale * upImg.getHeight(); var outImg = new java.awt.image.BufferedImage(scaledW, scaledH, upImg.getType()); var g = outImg.createGraphics(); //g.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR); g.drawImage(upImg,0,0,scaledW, scaledH, null); javax.imageio.ImageIO.write(outImg, jpg, newThumbnail); //Checks if the width or height exceeds the limits scale = 0; if(upImg.getWidth() IMAGES_MAX_WIDTH){ scale = IMAGES_MAX_WIDTH / upImg.getWidth(); scaledW = scale * upImg.getWidth(); scaledH = scale * upImg.getHeight(); } //Resize to the limits if so if(scale != 0){ outImg = new java.awt.image.BufferedImage(scaledW, scaledH, upImg.getType()); g = outImg.createGraphics(); g.drawImage(upImg,0,0,scaledW, scaledH, null); javax.imageio.ImageIO.write(outImg, jpg, newImage); }else{ javax.imageio.ImageIO.write(upImg, jpg, newImage); } } Janet Yvan a écrit : Salut. J’ai besoin d’uploader des fichiers d’icones avec CForms et les placer dans un de mes répertoires qui sert pour les resources d’images. J’ai cru comprendre que ça se faisait dans mon flowscript, mais je n’ai trouvé l’API JScriptnulle part ?? Quelqu’un aurait-il une idée (et / ou simplement une URL pour l’API) Merci d’avance. Yvan - Liste francophone Apache Cocoon -- http://cocoon.apache.org/fr/ Pour vous desinscrire : mailto:[EMAIL PROTECTED] Autres commandes : mailto:[EMAIL PROTECTED]
Pb with cforms using the multipage technique
Hello, i have a cform with a few pages and i noticed a problem if the user hit the browser back button on say page 2, and the form next button one page 1, the form is then submited, but since it's not submited by a submit widget (the next button is an action widget) form.getSubmitWidget() return null. It's not a big problem to catch it and send the user back to the form, but i think it might be a bug, because it's not the expected behavior. Marc ___ Appel audio GRATUIT partout dans le monde avec le nouveau Yahoo! Messenger Téléchargez cette version sur http://fr.messenger.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Advice on site design - really close
Hello, for the aggregation pb, you can have a look to this article : http://www.cocooncenter.org/articles/stylefree.html and maybe this one will help also if you start a cocoon project : http://wiki.apache.org/cocoon/CocoonBestPractices For the application logic, it's usually recommended to keep it in flow eg. your sitemap call a flow function that do the logic and call cocoo.redirectTo or cocoon.sendPage at the end to launch the view pipeline, passing it the bizness data built in flow. From what i experienced so far, if you have simple logic in your pages, you can perform it with a couple of xsl tranforms and don't really need flow. Whenever the logic becomes more complicated, especially when it includes date operations, it becomes much easier to use jx generator + flow Hope this helps, Marc footh a écrit : I read about flow before and in fact I intended ot use it once I got this supposedly basic part of the site resolved. Anyway, I re-read the documentation and I can't seem to find out how it would help the situation described below. How can I use flow logic combine 5 pages that require dynamic processing into one page? --- Ralph Goers [EMAIL PROTECTED] wrote: It sounds like you need to take a look at flowscript or javaflow. footh wrote: I'm converting my site from pure JSP to Cocoon. I've read lots of tutorials on Cocoon and I've come really close to getting the site to work the way I want but I've hit a few snags. Basically, the site has a header, footer and two sidebars with content in the middle. In JSP, I would just have includes on every page for the header, footer, etc. However, in Cocoon, I was hoping I could have one template page that decided the layout. I was able to create this model, mainly using this tutorial: http://www.cocooncenter.org/articles/navigation.html I created an XSL stylesheet for the header, footer, and two sidebars, along with associated XML content files and imported those into a main stylesheet. Then, in the main stylesheet, I apply the templates for the constant parts by using the document function in XSL, for ex: xsl:apply-templates select=document('..\menus\header.xml')/*/ For the main content on each page, I have separate XML files that, for now, are simply a dump of static HTML and I use the copy-of XSL tag to insert it into the page. Later, I'll make these XSP pages and dynamically generate the content. Here's where I've hit a couple issues. The header, footer and sidebars contain some dynamic content. For example, if a person is logged in, the header will show something different. I was able to get around this by passing in the remoteUser parameter to the stylesheet in the pipeline and then using stylesheet logic. But, there's also other logic I will need to process that's a bit more complicated (ex. depending on the user's role, etc). With my current layout, I can't seem to find a way to add logic that can use Java to these mostly static blocks. I've tried aggregating, but that doesn't seem to work well with XSP. Also, I'd like to not use cinclude since I'd like to avoid including the other elements on every page like in JSP. Might anyone have any suggestions for me out there? Thanks a ton. JF __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.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] __ Yahoo! Mail Stay connected, organized, and protected. Take the tour: http://tour.mail.yahoo.com/mailtour.html - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] ___ Appel audio GRATUIT partout dans le monde avec le nouveau Yahoo! Messenger Téléchargez cette version sur http://fr.messenger.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: JXTemplate - Incrementing value of variable in a loop
Another way is to use i18n tranformer to format your date : i18n:date src-pattern=MM/dd/jx:out value=#{$cruise/@start}//i18n:date My guess is that if you use the pattern attribute with jx:formatddate, the locale attribute is probably ignored. Marc Johannes Becker a écrit : The problem is, that I have a billion dates on this page. I also don't care (in this case) about logic in my Templates. If you just want something, that works, Does this mean, the locale attribute of formatDate doesn't work yet or isn't implemented (in the 2.1.7 distribution)? Thanks Jonny --- Ursprüngliche Nachricht --- Von: Jan Hinzmann [EMAIL PROTECTED] An: users@cocoon.apache.org Betreff: Re: JXTemplate - Incrementing value of variable in a loop Datum: Tue, 12 Jul 2005 16:39:16 +0200 On Tuesday 12 July 2005 16:05, Johannes Becker wrote: Thanks! The xpath function sum() worked for me. And since I have you guys and girls attention. I posted this two times but never got an answer: I'm still having trouble formatting dates. My date problem: Something like jx:formatDate value=#{date} pattern=dd locale=en_US/ will output for example: 12 März 2003 Since I set the locale to an american-style output that either means my locale is set in a wrong way or the locale-attribute isn't implemented yet. Can anybody tell me how to set the locale correctly? If you just want something, that works, and if you are using flowscript, you can do somthing like: - have a Util.java class which gives you the correct formatted DateString - pass this String from the flowscript to the JXTemplate Using this prevents you from having logic in your Templates. Thanks Jonny --- Ursprüngliche Nachricht --- Von: Chris Marasti-Georg [EMAIL PROTECTED] An: users@cocoon.apache.org Betreff: RE: JXTemplate - Incrementing value of variable in a loop Datum: Tue, 12 Jul 2005 09:47:02 -0400 There is an xpath function sum(), try using #{sum(item/quantity)} (not sure of exact syntax) ex. jx:set var=total value=#{sum(item/quantity)}/ Chris Marasti-Georg -Original Message- From: Upayavira [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 12, 2005 9:05 AM To: users@cocoon.apache.org Subject: Re: JXTemplate - Incrementing value of variable in a loop Johannes Becker wrote: Hi, I want to increment the value of a variable in a jx:forEach-loop. In my case, I want to increment the variable total with the quantity-element (from item). jx:set var=total value=0/ jx:forEach select=#{item} ??? #{total} += #{quantity} ??? /jx:forEach Is there a way to do this? Or a workaround? See http://cocoon.apache.org/2.1/userdocs/flow/jxtemplate.html#forEach (esp begin, step, end attributes). Never used them, I assume they work. Upayavira - 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] -- Weitersagen: GMX DSL-Flatrates mit Tempo-Garantie! Ab 4,99 Euro/Monat: http://www.gmx.net/de/go/dsl - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Gruß, Jan ___ Appel audio GRATUIT partout dans le monde avec le nouveau Yahoo! Messenger Téléchargez cette version sur http://fr.messenger.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Matching problem
Hello, i just noticed that foo/bar/fooo/baar doesn't match the pattern foo/**/*/* but match the pattern foo/**/* Is that a bug or normal behavior ? Best regards, Marc ___ Appel audio GRATUIT partout dans le monde avec le nouveau Yahoo! Messenger Téléchargez cette version sur http://fr.messenger.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: cforms problem when trying jx
Hello, i had this kind of pb before because of the binding. either you are calling new Form(form-definition) in your flow where you are not supposed to or you use the handleForm function from the sample and didn't supplied a binding-uri hope this helps Marc Joose Vettenranta a écrit : Hi, I changed in sitemap map:trasform type=cforms / - map:transform type=jx / Then I added jx:import uri=resource://org/apache/cocoon/forms/ generation/template.jx/ in to the template file. Then when calling that forms page from flow I get this error msg: Description: org.apache.cocoon.ProcessingException: Failed to execute pipeline.: resource://org/apache/cocoon/forms/generation/template.jx: 25:15:TypeError: [EMAIL PROTECTED]: NOT_FOUND is not a function. (resource://org/apache/cocoon/components/flow/ javascript/fom/fom_system.js; line 19) Where to try to find the problem? Thanks, Joose -- Always remember that you are unique, just like everyone else! * http://iki.fi/joose/ * [EMAIL PROTECTED] * +358 44 561 0270 * - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] ___ Appel audio GRATUIT partout dans le monde avec le nouveau Yahoo! Messenger Téléchargez cette version sur http://fr.messenger.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Matching problem
Honestly it also looks like a bug to me. I think the string is parsed form left to right where it should be parsed from right to left or sth like that ;) Anyway, i just changed my pattern to foo/bar/fooo:baar that workaround the problem :) Marc Martijn C. Vos a écrit : Marc Salvetti [mailto:[EMAIL PROTECTED] wrote: i just noticed that foo/bar/fooo/baar doesn't match the pattern foo/**/*/* but match the pattern foo/**/* Is that a bug or normal behavior ? Similar inexplicable behaviour was also noticed a few months ago by Ard Schrijvers. I can't recall if he got a good explanation from anyone, but you might want to search for that thread. He was pretty thorough in testing what did and did not match what, and it sounds like a bug to me. mcv. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] . ___ Appel audio GRATUIT partout dans le monde avec le nouveau Yahoo! Messenger Téléchargez cette version sur http://fr.messenger.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
What mean theses errors ?
Hello, Do you know what these errors means? I don't know why, but Tomcat + Apache failed today between 18:20 - 18:25 GMT. I have the following errors in the log : [Loaded org.apache.log4j.spi.ThrowableInformation from file:/home/marc/public_html/WEB-INF/lib/log4j-1.2.8.jar] [Loaded org.apache.log4j.spi.VectorWriter from file:/home/marc/public_html/WEB-INF/lib/log4j-1.2.8.jar] [Loaded org.apache.log4j.spi.NullWriter from file:/home/marc/public_html/WEB-INF/lib/log4j-1.2.8.jar] (digester.Digester 1059) End event threw exception java.lang.IllegalArgumentException: Can't convert argument: null at org.apache.tomcat.util.IntrospectionUtils.convert(IntrospectionUtils.java:967) at org.apache.tomcat.util.digester.CallMethodRule.end(CallMethodRule.java:522) at org.apache.tomcat.util.digester.Rule.end(Rule.java:228) at org.apache.tomcat.util.digester.Digester.endElement(Digester.java:1057) at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source) at org.apache.xerces.parsers.AbstractXMLDocumentParser.emptyElement(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source) at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source) at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source) at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source) at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1561) at org.apache.catalina.startup.ContextConfig.applicationWebConfig(ContextConfig.java:302) at org.apache.catalina.startup.ContextConfig.start(ContextConfig.java:959) at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:249) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4020) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:759) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:739) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:524) at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:909) at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:872) at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:474) at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1106) at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:310) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1019) at org.apache.catalina.core.StandardHost.start(StandardHost.java:718) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1011) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:440) at org.apache.catalina.core.StandardService.start(StandardService.java:450) at org.apache.catalina.core.StandardServer.start(StandardServer.java:683) at org.apache.catalina.startup.Catalina.start(Catalina.java:537) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:271) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.apache.commons.daemon.support.DaemonLoader.start(DaemonLoader.java:218) [Loaded org.apache.log4j.spi.ThrowableInformation from file:/usr/local/jakarta/jakarta-tomcat-5.5.7/common/lib/log4j-1.2.11.j$ [Loaded org.apache.log4j.spi.VectorWriter from file:/usr/local/jakarta/jakarta-tomcat-5.5.7/common/lib/log4j-1.2.11.jar] [Loaded sun.reflect.GeneratedMethodAccessor71 from __JVM_DefineClass__] [Loaded org.apache.log4j.spi.LoggingEvent from file:/home/colette/public_html/WEB-INF/lib/log4j-1.2.8.jar] log4j:WARN No appenders could be found for logger (org.apache.catalina.session.ManagerBase). log4j:WARN Please initialize the log4j system properly. [Loaded
Re: Scheduling tasks
Thx a lot, that makes it much clearer ;) Marc Lionel Crine a écrit : There are different ways to launch to use the cron. Here is what I know. 1/ First method : - Configure the cron component in cocoon.xconf - Create a trigger (cocoon component) : Your class should implements cron interface. In this case the cron will be lauched once Cocoon started. --- 2/ Second method : - Use the scheduler component in a java class or a flowscript (the Cocoon example). public void service(ServiceManager _manager) throws ServiceException { // recuperation du scheduler manager = _manager; scheduler = (JobScheduler) manager.lookup(JobScheduler.ROLE); } In this case the scheduler will be lauch whenever you use the class in the sitemap. To launch a pipe everyday, I would use the first method. I'm not a cron expert so if someone can complete my explanation, it would be great. Lionel Marc Salvetti wrote: Thanks lionel, but what about this cron job thing ? do i have to code a java class that implements some interface or is there a class to do this in the distrib ? In the example, the config seems to be spread in differents files. Do you know what is the minimal (but complete) configuration to lanch a pipe everyday ? Best regards, Marc Lionel Crine a écrit : Hi, In this example, the trigger will be launched everyday at 2 AM : cron0 0 2 * * ? */cron Here, every 30 mins : cron* */30 * * * ? */cron Hope that help Lionel Marc Salvetti wrote: Thanks, that's definitly what i need, but i badly miss a basic example on how to launch a pipeline everyday anyone around have one ? Best regards, Marc Geert Josten a écrit : Hi, Take a look at the cron block, that might be what you are looking for... Cheers, Geert Marc Salvetti wrote: Hello, I need some files to be checked once a day and eventually updated depending on certain conditions (if a date inside the document is before the date of the day, some attributes need to be changed inside the doc) Does anyone know the right cocoon component to use for that ? Thanks, Marc ___ Appel audio GRATUIT partout dans le monde avec le nouveau Yahoo! Messenger Tilichargez cette version sur http://fr.messenger.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] ___ Appel audio GRATUIT partout dans le monde avec le nouveau Yahoo! Messenger Téléchargez cette version sur http://fr.messenger.yahoo.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] ___ Appel audio GRATUIT partout dans le monde avec le nouveau Yahoo! Messenger Téléchargez cette version sur http://fr.messenger.yahoo.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] ___ Appel audio GRATUIT partout dans le monde avec le nouveau Yahoo! Messenger Téléchargez cette version sur http://fr.messenger.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Site icon display
I just have this map:match pattern=*.ico map:read src=icons/{1}.ico/ /map:match and somehow, i didn't need any links in the html to make it works, i think the browser just look for it at the root of the domain and display it if it's found Marc Derek Hohls a écrit : Yup - check - already got that, thanks! mime type is image/ico ... ? [EMAIL PROTECTED] 2005/06/24 12:52:46 PM And make sure you have the *.ico matcher in the sitemap, i forgot this before and spend a few hours understanding why the icon wouldn't show up. Marc Bertrand Delacretaz a écrit : Le 24 juin 05, à 09:00, Derek Hohls a écrit : ...I have tried: link rel=SHORTCUT ICON type=image/ico href=path/favicon.ico/link and link rel=icon type=image/png href=path/favicon.png/link Here's one which is known to work: link href=publication-static/www/img/favicon.png type=image/png rel=Shortcut Icon Then, as suggested, you can check at the HTTP level, what precise URL the browser looks for. -Bertrand ___ Appel audio GRATUIT partout dans le monde avec le nouveau Yahoo! Messenger Téléchargez cette version sur http://fr.messenger.yahoo.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] ___ Appel audio GRATUIT partout dans le monde avec le nouveau Yahoo! Messenger Téléchargez cette version sur http://fr.messenger.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Choix d'implementation
Parce que si je rappelle index.html a partir du flow avec un redirectTo ca va matcher le pipe **.html de ma sitemap et tourner en rond. Ca impliquerai donc de changer dans la sitemap les matchers de .html vers .autrechose. A moins que j'ai tout faux ;) marc Sylvain Wallez a écrit : Marc Salvetti wrote: Bonjour, je dois installer sur toutes les pages de mon site un formulaire de login, remplacé par 'hello user toto' quand l'utilisateur est authentifié. Comme j'ai commencé a utiliser jx+cforms, je pense qu'il est mieux d'utiliser aussi jx aussi pour ce formulaire. Ma question est qq'un a t'il deja implémenté ça, est-ce que c'est faisable en utilisant jx+cforms Tout à fait. Quelle serait la meilleur facon d'implementer ? Je pense a un matcher general qui appelle une fonction dispatch qui renvoie a la sitemap, mais je ne vois pas comment renvoyer a la sitemap sans provoquer une boucle infinie. Pourquoi y aurait-il une boucle infinie? Sylvain ___ Appel audio GRATUIT partout dans le monde avec le nouveau Yahoo! Messenger Téléchargez cette version sur http://fr.messenger.yahoo.com - Liste francophone Apache Cocoon -- http://cocoon.apache.org/fr/ Pour vous desinscrire : mailto:[EMAIL PROTECTED] Autres commandes : mailto:[EMAIL PROTECTED]
Choix d'implementation
Bonjour, je dois installer sur toutes les pages de mon site un formulaire de login, remplacé par 'hello user toto' quand l'utilisateur est authentifié. Comme j'ai commencé a utiliser jx+cforms, je pense qu'il est mieux d'utiliser aussi jx aussi pour ce formulaire. Ma question est qq'un a t'il deja implémenté ça, est-ce que c'est faisable en utilisant jx+cforms Quelle serait la meilleur facon d'implementer ? Je pense a un matcher general qui appelle une fonction dispatch qui renvoie a la sitemap, mais je ne vois pas comment renvoyer a la sitemap sans provoquer une boucle infinie. Marc ___ Appel audio GRATUIT partout dans le monde avec le nouveau Yahoo! Messenger Téléchargez cette version sur http://fr.messenger.yahoo.com - Liste francophone Apache Cocoon -- http://cocoon.apache.org/fr/ Pour vous desinscrire : mailto:[EMAIL PROTECTED] Autres commandes : mailto:[EMAIL PROTECTED]
Re: Scheduling tasks
Thanks lionel, but what about this cron job thing ? do i have to code a java class that implements some interface or is there a class to do this in the distrib ? In the example, the config seems to be spread in differents files. Do you know what is the minimal (but complete) configuration to lanch a pipe everyday ? Best regards, Marc Lionel Crine a écrit : Hi, In this example, the trigger will be launched everyday at 2 AM : cron0 0 2 * * ? */cron Here, every 30 mins : cron* */30 * * * ? */cron Hope that help Lionel Marc Salvetti wrote: Thanks, that's definitly what i need, but i badly miss a basic example on how to launch a pipeline everyday anyone around have one ? Best regards, Marc Geert Josten a écrit : Hi, Take a look at the cron block, that might be what you are looking for... Cheers, Geert Marc Salvetti wrote: Hello, I need some files to be checked once a day and eventually updated depending on certain conditions (if a date inside the document is before the date of the day, some attributes need to be changed inside the doc) Does anyone know the right cocoon component to use for that ? Thanks, Marc ___ Appel audio GRATUIT partout dans le monde avec le nouveau Yahoo! Messenger Tilichargez cette version sur http://fr.messenger.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] ___ Appel audio GRATUIT partout dans le monde avec le nouveau Yahoo! Messenger Téléchargez cette version sur http://fr.messenger.yahoo.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] ___ Appel audio GRATUIT partout dans le monde avec le nouveau Yahoo! Messenger Téléchargez cette version sur http://fr.messenger.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]