Re: conception pipe/sitemap ?
Jean-Baptiste Quenot a écrit : Pourquoi ne pas écrire un Transformer? http://cocoon.apache.org/2.2/core-modules/pipeline-api/1.0/org/apache/cocoon/transformation/Transformer.html et oui pourquoi pas ? à ce propos, entre un transformer dédié et une feuille de style + appel à une fonction java (qui utilise une librairie), quel est le bon choix ? quels sont les implications coté perf ? cache ? mémoire utilisée ?? à+ -- Sébastien Geindre DPREVI/AERO/DEV sebastien.geindre __at__ meteo.fr - Liste francophone Apache Cocoon -- http://cocoon.apache.org/fr/ Pour vous desinscrire : mailto:[EMAIL PROTECTED] Autres commandes : mailto:[EMAIL PROTECTED]
problem creating generator - parameters
Hi, I'm trying to build a generator that does the following: call a remote method on a server (using spring remoting) drag the result through an XML mapper (currently XMLBeans) deliver XML SAX events to cocoon All in all not a big issue, were it not for the fact that I can't seem to find information on configuring a generator. I'd like to define the generator as this: map:generator name=remoteGenerator src=x.y.RemoteSpringGenerator spring-config/x/y/remote-spring-config.xml/spring-config /map:generator where the xml file contains my remote servicebeans, like: bean id=myService class=org.springframework.remoting.rmi.RmiProxyFactoryBean property name=serviceUrl value=rmi://localhost:/MyService/ property name=serviceInterface value=x.y.MyService/ /bean Is the above possible? I've cooked up a solution by hard-coding the xml location into the RemoteSpringGenerator (using a 'magic' location), but I'd like to reuse the class in other projects. I can also use: map:match pattern=myRemoteMethod.xml map:generate type=remoteGenerator map:parameter name=remoteServiceName value=myService / map:parameter name=methodName value=myRemoteMethod / map:parameter name=argTypes value=Integer / map:parameter name=argNames value=id / map:parameter name=spring-config value=/x/y/remote-spring-config.xml / /map:generate map:serialize type=xml/ /map:match but this means a lot of copy-paste and the need to constantly build the Spring container (although I could create it only the first time and reuse it, but still)... In any case, I'd call it through http://.../myRemoteMethod.xml?id=3 TIA! Lieven - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Problem with my Wiki-Account
Hi Joerg, The default place for maintaining Cocoon documentation (which is more official than the wiki) is Daisy at http://cocoon.zones.apache.org/daisy/. What the better place is is hard to say and depends much on the kind of your addition. I think, the wiki is the place for all new docs, from which we don´t know whether it should come into the official docu or not. Am I right? But you actually logged in? Do you see your name in the right upper corner? Do you have cookies activated? I don't think we have much control over the wiki. I guess it's administered by the Apache infrastructure team. I must have been some sick yesterday. Some hours before, I turned of cookies in my browser. Thank you very much for your help. Joerg Marc -- QuinScape GmbH [EMAIL PROTECTED] Wittekindstraße 30 Tel. : 0231 / 53 38 31 604 44139 Dortmund Fax. : 0231 / 53 38 31 111 http://www.quinscape.deMobil: 0163 / 266 21 89 http://www.docscape.de Geschäftsführer: Thomas Biskup Sitz Dortmund Dr. Norbert Jesse HRB 14740 Dr. Gero PresserAmtsgericht Dortmund *** DocScape - Vollautomatisches Print-Publishing auf höchstem Niveau *** - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Cocoon 2.2 - Block name required in file path?
From: Joerg Heinicke [EMAIL PROTECTED] I didn't know it but I saw today the thread about mounting a block at root level. So in case you missed it: http://marc.info/?t=11920255864r=1w=4 The information at that link is no longer accurate for Cocoon 2.2, but it was close enough to help me fix my problem. In case others would like to mount a block at the root level, the correct procedure is to edit the file: myBlock1\src\main\resources\META-INF\cocoon\spring\servlet-service.xml This file contains an element: bean id=mysite.com.myBlock1.service class=org.apache.cocoon.sitemap.SitemapServlet servlet:context mount-path=myBlock1 context-path=blockcontext:/myBlock1// /bean To mount the block at the root level, you change the mount-path attribute in the servlet:context element to be an empty string: Thanks very much! -Hugh Sparks - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Cocoon 2.2 - Block name required in file path?
Hugh Sparks wrote: From: Joerg Heinicke [EMAIL PROTECTED] I didn't know it but I saw today the thread about mounting a block at root level. So in case you missed it: http://marc.info/?t=11920255864r=1w=4 The information at that link ... which is the bottom of http://cocoon.apache.org/2.2/1362_1_1.html. The file mentioned there, block.xml, does not exist... is no longer accurate for Cocoon 2.2, but it was close enough to help me fix my problem. In case others would like to mount a block at the root level, the correct procedure is to edit the file: myBlock1\src\main\resources\META-INF\cocoon\spring\servlet-service.xml This file contains an element: bean id=mysite.com.myBlock1.service class=org.apache.cocoon.sitemap.SitemapServlet servlet:context mount-path=myBlock1 context-path=blockcontext:/myBlock1// /bean To mount the block at the root level, you change the mount-path attribute in the servlet:context element to be an empty string: Changing mount-path to either of or / works, actually. HM - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: problem creating generator - parameters
On 10.10.2007 10:23 Uhr, Lieven Doclo wrote: I'd like to define the generator as this: map:generator name=remoteGenerator src=x.y.RemoteSpringGenerator spring-config/x/y/remote-spring-config.xml/spring-config /map:generator where the xml file contains my remote servicebeans, like: bean id=myService class=org.springframework.remoting.rmi.RmiProxyFactoryBean property name=serviceUrl value=rmi://localhost:/MyService/ property name=serviceInterface value=x.y.MyService/ /bean Is the above possible? I don't see any problem with this. You have to implement the Configurable or the Parameterizable interface. The spring-config parameter is NOT passed to setup() if that's what you expected. If you only started the project recently you might consider using Cocoon 2.2 which is based on Spring and so makes the integration of both much easier. Joerg - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: SendMail smart host (was sendmail)
Hi, I can't connect to the default SMTP port number 25, but have to use a Smart host, smtp.bytemark.co.uk. Please is it possible to use a Smart Host with sendmail and if so how. thanks Peter Hi Tobia, I have a MTA but I am now not sure that I am connecting to it properly Thanks Peter Peter Sparkes wrote: I have put the Sun mail.jar and activation.jar in my WEB-INF/lib and removed removed geronimo-spec-javamail-*.jar and geronimo-spec-activation-*.jar from WEB-INF/lib. However I still get the error message Could not connect to SMTP host: localhost, port: 25 Stupid question, but... are you sure you have a MTA running on localhost? Tobia - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Cocoon 2.1 environment objects from a Java XSLT extension
[EMAIL PROTECTED] wrote: XSLT Extensions assist formatting. Data collection belongs in the XML generation phase. Using XSLT Extensions to generate data is a very bad practice. What are the requirements? Let me explain better. I need to translate URIs in a XML document, in the middle of a pipeline, fetching relevant information from a SQL database. In the middle of a pipeline means that there are various other steps before it, so I cannot fetch this SQL data in the initial generator. At first I tried to have a sub-pipeline do the job, using the document() XPath function with a cocoon: schema, but it was too slow. My next (and current) idea is transforming the XML with XSLT, while coding the actual URI transformations (including the SQL queries) as a Java extension function, to be called from XSLT where appropriate. I'm hitting a wall, because I need a DataSourceComponent to be able to make SQL queries, but a Java XSLT extension class doesn't have any access to Cocoon's object model (that I can see.) I cannot pass the DataSourceComponent, or any other interesting object, from the sitemap to my extension function, passing through the XSLT as a parameter, because XSLT parameters get passed from the sitemap as strings. Suggestions are welcome. My last resort is doing everything as a custom transformer, but I'd like to avoid it, as I'm not too keen on coding in Sax what can easily be dealt with in XSLT (changing a bunch of attribute values.) Although it wouldn't be too hard with Sax either... Tobia - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: SendMail smart host (was sendmail)
Peter Sparkes wrote: I have to use a Smart host, smtp.bytemark.co.uk. Please is it possible to use a Smart Host with sendmail and if so how. You didn't say whether you're using the Sendmail Transformer, the Sendmail Action, or another thing entirely. Here is how you can configure for the first two. Notice that the transformer wants smtphost, while the action wants smtp-host. map:transform type=sendmail map:parameter name=smtphost value=smtp.bytemark.co.uk/ ... map:act type=sendmail map:parameter name=smtp-host value=smtp.bytemark.co.uk/ ... Tobia - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: SendMail smart host (was sendmail)
Thanks Tobia, It's the transformer. Thanks to your help it is now working Peter Peter Sparkes wrote: I have to use a Smart host, smtp.bytemark.co.uk. Please is it possible to use a Smart Host with sendmail and if so how. You didn't say whether you're using the Sendmail Transformer, the Sendmail Action, or another thing entirely. Here is how you can configure for the first two. Notice that the transformer wants smtphost, while the action wants smtp-host. map:transform type=sendmail map:parameter name=smtphost value=smtp.bytemark.co.uk/ ... map:act type=sendmail map:parameter name=smtp-host value=smtp.bytemark.co.uk/ ... Tobia - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Cocoon 2.1 environment objects from a Java XSLT extension
Tobia Conforto pisze: [EMAIL PROTECTED] wrote: XSLT Extensions assist formatting. Data collection belongs in the XML generation phase. Using XSLT Extensions to generate data is a very bad practice. What are the requirements? Let me explain better. I need to translate URIs in a XML document, in the middle of a pipeline, fetching relevant information from a SQL database. In the middle of a pipeline means that there are various other steps before it, so I cannot fetch this SQL data in the initial generator. At first I tried to have a sub-pipeline do the job, using the document() XPath function with a cocoon: schema, but it was too slow. My next (and current) idea is transforming the XML with XSLT, while coding the actual URI transformations (including the SQL queries) as a Java extension function, to be called from XSLT where appropriate. I'm hitting a wall, because I need a DataSourceComponent to be able to make SQL queries, but a Java XSLT extension class doesn't have any access to Cocoon's object model (that I can see.) I cannot pass the DataSourceComponent, or any other interesting object, from the sitemap to my extension function, passing through the XSLT as a parameter, because XSLT parameters get passed from the sitemap as strings. Suggestions are welcome. My last resort is doing everything as a custom transformer, but I'd like to avoid it, as I'm not too keen on coding in Sax what can easily be dealt with in XSLT (changing a bunch of attribute values.) Although it wouldn't be too hard with Sax either... I'm not sure if it's going to fit in your case but I would suggest to take a look at Cocoon's quite powerful LinkRewriterTransformer[1]. Basically all you would need to do is to implement your own input module (quite simple task) and configure transformer so it uses your own input module. I strongly agree that using extension functions in your case that access external that is *NOT* a good idea. [1] http://cocoon.apache.org/2.1/apidocs/org/apache/cocoon/transformation/LinkRewriterTransformer.html -- Grzegorz Kossakowski Committer and PMC Member of Apache Cocoon http://reflectingonthevicissitudes.wordpress.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Cocoon 2.2 - Block name required in file path?
Hugh Sparks pisze: This is a 2.1 to 2.2 migration issue. I created a simple c2 block using: mvn archetype:create \ -DarchetypeGroupId=org.apache.cocoon \ -DarchetypeArtifactId=cocoon-22-archetype-block \ -DarchetypeVersion=1.0.0-RC3-SNAPSHOT \ -DgroupId=csparks.com \ -DartifactId=AAQuotes Then I modified it to do an example I have working in cocoon 2.1: a simple application that displays a randomly selected quotation and image. The quotations work as expected, but the path to the images in the result.jx template (shown below) requires the name of my block in the path: img src=AAQuotes/${imageNumber}.gif/ I ported this example from a working cocoon 2.1.X version and the image tag was simply: img src=${imageNumber}.gif/ Why is the block name required in the path to fetch the image when using cocoon 2.2? I would expect the location of the sitemap to be the root for finding files. If I omit the block name, I get an error of the form: javax.servlet.ServletException: No block for /148.gif I wonder why request for /148.gif ever happens. I mean, isn't a browser supposed to make request relatively to the path of html document? If so, the mount path of a block should not be making any problems at all. Another comment is that making a block simply mounted at / AND basing on this setting when developing a block is not a good idea for two reasons: 1. Mount path of block can be changed externally (to the block) by using Cocoon Spring Configurator and suitable property 2. The idea of block is that it is reusable unit that has it's own URI space for living. This design decision makes it possible to extend and compose blocks. -- Grzegorz Kossakowski Committer and PMC Member of Apache Cocoon http://reflectingonthevicissitudes.wordpress.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Cocoon 2.2 - Block name required in file path?
Grzegorz Kossakowski pisze: Hugh Sparks pisze: This is a 2.1 to 2.2 migration issue. I created a simple c2 block using: mvn archetype:create \ -DarchetypeGroupId=org.apache.cocoon \ -DarchetypeArtifactId=cocoon-22-archetype-block \ -DarchetypeVersion=1.0.0-RC3-SNAPSHOT \ -DgroupId=csparks.com \ -DartifactId=AAQuotes Then I modified it to do an example I have working in cocoon 2.1: a simple application that displays a randomly selected quotation and image. The quotations work as expected, but the path to the images in the result.jx template (shown below) requires the name of my block in the path: img src=AAQuotes/${imageNumber}.gif/ I ported this example from a working cocoon 2.1.X version and the image tag was simply: img src=${imageNumber}.gif/ Why is the block name required in the path to fetch the image when using cocoon 2.2? I would expect the location of the sitemap to be the root for finding files. If I omit the block name, I get an error of the form: javax.servlet.ServletException: No block for /148.gif I wonder why request for /148.gif ever happens. I mean, isn't a browser supposed to make request relatively to the path of html document? If so, the mount path of a block should not be making any problems at all. Another comment is that making a block simply mounted at / AND basing on this setting when developing a block is not a good idea for two reasons: 1. Mount path of block can be changed externally (to the block) by using Cocoon Spring Configurator and suitable property 2. The idea of block is that it is reusable unit that has it's own URI space for living. This design decision makes it possible to extend and compose blocks. Oups, hit the send button too early. I wanted to say, that if you need an absolute path of resource in a block you should use servlet: protocol + servletLinkRewriter combo. Forms block makes an extensive use of this technique and you can have a look at this document[1] to get an idea how it works. I would only add that if you need to reference a resource from current (your own) block you can use this syntax: servlet:/path/to/your/resource (ommitting the part that contains block's name) [1] http://cocoon.apache.org/2.2/blocks/forms/1.0/1351_1_1.html -- Grzegorz Kossakowski Committer and PMC Member of Apache Cocoon http://reflectingonthevicissitudes.wordpress.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: updating css class in ajax form
Binkley, Peter pisze: I've got a form in which a repeater generates cells of a table. Within each cell there is a select element. I want the css class of the td element to be set to the value of the select whenever the select changes. I've done this in the template like this: ft:repeater id=rows table ft:repeater-rows ft:repeater id=columns tr ft:repeater-rows td class=${repeater.getWidget(repeaterLoop.index, 'foo').getValue()} ft:widget id=foo fi:styling submit-on-change=true/ /ft:widget /td /ft:repeater-rows /tr /ft:repeater /ft:repeater-rows /table /ft:repeater I had hoped that the submit-on-change styling would force the td to re-render with the new style, but it doesn't; the ajax update is empty. Is there a way to force the td to re-render? The behaviour you get is expected one because only widgets that have changed are rendered again in Ajax mode. Form model doesn't know that you want to render some bits again because the rendering bases on widgets value. Nevertheless there is a way to force rendering of certain widgets. You just must add them using addWidgetUpdate[1] method. In order to call this method with proper parameter you will need to implement your own on-change action[2]. I hope that helps. [1] http://cocoon.apache.org/2.1/apidocs/org/apache/cocoon/forms/formmodel/Form.html#addWidgetUpdate(org.apache.cocoon.forms.formmodel.Widget) [2] http://cocoon.apache.org/2.2/blocks/forms/1.0/479_1_1.html -- Grzegorz Kossakowski Committer and PMC Member of Apache Cocoon http://reflectingonthevicissitudes.wordpress.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Cocoon 2.1 environment objects from a Java XSLT extension
Grzegorz Kossakowski wrote: I'm not sure if it's going to fit in your case but I would suggest to take a look at Cocoon's quite powerful LinkRewriterTransformer[1]. Very interesting, thanks. It seems to fit my case perfectly! Basically all you would need to do is to implement your own input module (quite simple task) and configure transformer so it uses your own input module. So I would put my SQL logic in the input module... makes sense! I strongly agree that using extension functions in your case that access external that is *NOT* a good idea. Very well, lesson taken. Tobia - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]