How to register flowscripts dynamically at runtime?
Hello, we need the possibility for our customer to put all essential configurations of our system together in one file (outside the sitemap and the xconf). This includes the configuration of all special flowscripts in this file, too. To do so, we need to (re-)load these flowscripts at runtime. Now my question: Is there a Cocoon component available which I can use to register new flowscripts at runtime and what points I have to keep in mind to do that? Any hint is appreciated. Thank you a lot! Regards Stephan
Re: [BUG?] JavaFlow and getComponent
Torsten Curdt wrote: Cocoon trunk uses javaflow with the compiling classloader. Do you have your source files under build/webapp/WEB-INF/src? Yes. I saw the classes in WEB-INF but they're not included in the build. Just the source AbstractContinuation.java is included but not compiled. Is this right? build/webapp/WEB-INF/src$ find -name *.java ./org/apache/cocoon/forms/flow/java/FormInstance.java ./org/apache/cocoon/samples/flow/java/CalculatorFlow.java ./org/apache/cocoon/samples/flow/java/PersistenceFlow.java ./org/apache/cocoon/samples/flow/java/FormFlow.java ./org/apache/cocoon/components/flow/java/AbstractContinuable.java The compilation happens in memory. Don't expect to see any .class files. Hmm, ok. But why this exception occurs? Maybe I have done something wrong, but I don't know what. I have compiled the "standard" by just using the build script. After compiling I had copied the webapp folder into my tomcat and then restarted tomcat. Do I have to separately activate the compiling classloader? Or is the problem using tomcat instead of jetty outside the source structure? Thanks. -- Regards Stephan
Re: [BUG?] JavaFlow and getComponent
Torsten Curdt wrote: JavaFlow doesn't work in trunk at all, because the class AbstractContinuation doesn't exist either in cocoon-javaflow.block.jar nor in src. There are just these few classes in org\apache\cocoon\components\flow\java: CocoonContinuationContext.class JavaInterpreter.class VarMap.class VarMapHandler.class Things are pretty different ...but I am pretty sure it's working ;-) What problems do you have? I have compiled the trunk with the javaflow block. But when I tried to execute the flow, I got the following exception: 2005-01-07 13:59:46 StandardWrapperValve[Cocoon]: Servlet.service() for servlet Cocoon threw exception java.lang.NoClassDefFoundError: org/apache/cocoon/components/flow/java/AbstractContinuable at java.lang.ClassLoader.defineClass0(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:539) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123) at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1634) at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:860) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1307) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1189) at org.apache.jci.ResourceStoreClassLoader.loadClass(ResourceStoreClassLoader.java:56) at java.lang.ClassLoader.loadClass(ClassLoader.java:235) I saw the classes in WEB-INF but they're not included in the build. Just the source AbstractContinuation.java is included but not compiled. Is this right? -- Regards Stephan
Re: [BUG?] JavaFlow and getComponent
It would also be great if you could try cocoon-trunk and report back. Hi Torsten, JavaFlow doesn't work in trunk at all, because the class AbstractContinuation doesn't exist either in cocoon-javaflow.block.jar nor in src. There are just these few classes in org\apache\cocoon\components\flow\java: CocoonContinuationContext.class JavaInterpreter.class VarMap.class VarMapHandler.class -- Regards Stephan
Re: [BUG?] JavaFlow and getComponent
Torsten Curdt wrote: What is "cocoon-trunk"? That would be the one from svn :) Being a versioning system there are different branches. Trunk is the main development branch. https://svn.apache.org/repos/asf/cocoon/trunk/ This might also help http://wiki.apache.org/cocoon/SubversionMigration Thanks -- Torsten Ah, ok. The same as HEAD in CVS means? Ok, I will try it in the next days if I'll find some time for it. -- Stephan
Re: [BUG?] JavaFlow and getComponent
It would also be great if you could try cocoon-trunk and report back. What is "cocoon-trunk"? The nightly build or the version out from subversion? Stephan
[BUG?] JavaFlow and getComponent
Hello, it's possible that I have found another bug in Cocoon. Using getComponent within a JavaFlow causes a cryptical exception. I wrote an example using Cocoon 2.1.6 which doesn't work. Can someone please verify whether it is really a bug or just a mistake of mine? # The Component Interface: package foo.bar; public interface TestComponent { public static final String ROLE = TestComponent.class.getName(); public void dummy(); } # The component implementation: package foo.bar; public class TestComponentImpl implements TestComponent{ public void dummy() {} } # The component registration in cocoon.xconf: # The TestFlow-Java class: package foo.bar; import org.apache.cocoon.components.flow.java.AbstractContinuable; class TestFlow extends AbstractContinuable { public void doFlowTest() throws Exception { while(true) { TestComponent component = null; try { component = (TestComponent)this.getComponent(TestComponent.ROLE); } finally {this.releaseComponent(component);} this.sendPageAndWait("somewhat"); } } } The sitemap: http://apache.org/cocoon/sitemap/1.0";> The exception I got is: Instruction GETSTATIC constraint violated: Class 'foo.bar.TestComponent' is referenced, but cannot be loaded and resolved: 'VERIFIED_REJECTED Number of LocalVariableTable attributes of Code attribute '' (method 'static void ()') exceeds number of local variable slots '0' ('There may be no more than one LocalVariableTable attribute per local variable in the Code attribute.'). '. InstructionHandle: 3: getstatic[178](3) 23 Execution Frame: Local Variables: 0: foo.bar.TestFlow 1: 2: 3: OperandStack: Slots used: 1 MaxStack: 2. foo.bar.TestFlow (Size: 1) Execution flow: 0: aconst_null [InstructionContext] 1: astore_1 [InstructionContext] 2: aload_0 [InstructionContext] 3: getstatic 23 [InstructionContext] Thank you. Regards Stephan
JXTemplate import + JSPGenerator = ClassCastException
Hello, I'm importing a sitemap ressource within a JXTemplate using the element: The according pipline parses a JSP an returns the result as XML: Using the protocol cocoon:/ to retrieve the JSP result causes an ClassCastException. Calling test.jsp directly (without JXTemplate) works well. The stacktrace: java.lang.ClassCastException at org.apache.jasper.compiler.JspRuntimeContext.(JspRuntimeContext.java:95) at org.apache.jasper.servlet.JspServlet.init(JspServlet.java:77) at org.apache.cocoon.components.jsp.JSPEngineImpl.executeJSP(JSPEngineImpl.java:71) 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.apache.avalon.excalibur.component.ComponentProxyGenerator$ComponentInvocationHandler.invoke(ComponentProxyGenerator.java:143) at $Proxy9.executeJSP(Unknown Source) at org.apache.cocoon.generation.JSPGenerator.generate(JSPGenerator.java:85) at org.apache.cocoon.components.pipeline.AbstractProcessingPipeline.processXMLPipeline(AbstractProcessingPipeline.java:530) at org.apache.cocoon.components.pipeline.impl.AbstractCachingProcessingPipeline.processXMLPipeline(AbstractCachingProcessingPipeline.java:172) at org.apache.cocoon.components.pipeline.AbstractProcessingPipeline.process(AbstractProcessingPipeline.java:701) at org.apache.cocoon.components.source.impl.SitemapSource.toSAX(SitemapSource.java:415) at org.apache.cocoon.components.source.SourceUtil.parse(SourceUtil.java:264) ... Thanks for your help. Regards Stephan
Re: [vote] splitting cocoon.xconf
Sylvain Wallez wrote: Team, here's a formal vote about splitting cocoon.xconf. I propose to add a new feature in cocoon.xconf so that adding/removing blocks to a Cocoon instance doesn't require do merge each block's configuration in a unique cocoon.xconf file as of today. With this feature, cocoon.xconf can simply be a list of imports, thus allowing to very easily add/remove blocks in a Cocoon application. For more background, please see the initial "splitting cocoon.xconf" post [1]. The first implementation will focus on basic import (one file per element), and later on we'll implement globbing features proposed by Carsten [2]. Please cast your votes. Here's my +1 (of course!) Sylvain [1] http://marc.theaimsgroup.com/?l=xml-cocoon-dev&m=110354180900487&w=2 [2] http://marc.theaimsgroup.com/?l=xml-cocoon-dev&m=110361460811792&w=2 If I'm allowed to vote here: +1000 ! Really good idea! One suggestion: Why not optionally scanning the folder WEB-INF for files having a special suffix (e.g. *.inc.xconf) and then, including the content of this files under the root element in cocoon.xconf? This avoids any changes of cocoon.xconf if own components must be included. Just placing such a file in WEB-INF makes the component or block working. This makes it very easy to provide own components for customers by using build processes like Ant. Maybe two possibilities: An import element to import a special file and a element to scan a certain folder for files to include at the specified position. An example: WDYT? Ahh, after reading the messages of the posted links above, I saw, Carsten has already posted an similar idea. Nevertheless, I will post this message, too ;-) Just to express that this feature would very very nice!! Regards Stephan
Re: [CForms] How to iterate other a model?
Hi, after I had tried several times to iterate over a widget using flowscript (model.lookupWidget()) I had realized that - in my opinion - this is not easily possible. The problem: I don't know the id's of the widgets! So there are two big questions I'm having: 1) In Java I can use .getChilds() of a ContainerWidget which returns me an iterator to iterate over all childs of an widget. I couldn't find such a method in the flowscript API. How to solve this problem? Either I need a length of all childs and then I can get one by one by pointing to its index or I need an iterator. 2.) I didn't find a way to resolve a Widget value of type MultiValueField. Therefore its not possible to retrieve such values. None of "typeof" or "instanceof" worked correctly to determine the object type. How can I resolve whether it is a MultiValueField or not? Thanks! Regards Stephan
Re: [CForms] How to iterate other a model?
Hi Sylvain, I have resolved my problem: I have to include the v2 Form.js and to change form.getModel() to form.getWidget(). Thanks. Regards Stephan
Re: [CForms] How to iterate other a model?
Sylvain Wallez wrote: Stephan Coboos wrote: Hello, is it possible to iterate other a model object within a flowscript? The model object was retrieved before by calling form.getModel(). Yes, you can use lookupWidget() that accepts a path-like syntax (i.e. "a/b/c" or "../d") Another question: Is there an API doc available for this object? http://cocoon.apache.org/2.1/apidocs/org/apache/cocoon/forms/formmodel/package-summary.html Sylvain Hi Sylvain, that's why I'am a little bit confused about the documentation because model.lookupWidget("age") as well as other methods from type Widget doesn't work in my flowscript. I got this exception: Original Exception: TypeError: lookupWidget is not a function. (file:/E:/container/instances/testsys/webapps/evalsys/app/flows/fillOut.js; line 13) at org.mozilla.javascript.NativeGlobal.constructError(NativeGlobal.java:581) at org.mozilla.javascript.NativeGlobal.constructError(NativeGlobal.java:541) In the listing below you can see the part in my flowscript: var form = new Form("cocoon:/formDefinition/" + inquiryName); form.showForm("formTemplate/" + inquiryName); var model = form.getModel(); print("Widget: :" + model.lookupWidget("age")); What's wrong here? Thank you for your help! Regards Stephan
[CForms] How to iterate other a model?
Hello, is it possible to iterate other a model object within a flowscript? The model object was retrieved before by calling form.getModel(). Another question: Is there an API doc available for this object? Thanx. Stephan
Re: How to access sitemap parameter within JavaFlow?
That's the problem! The AbstractContinuable contains no method getParameters(): http://cocoon.apache.org/2.1/apidocs/org/apache/cocoon/components/flow/java/AbstractContinuable.html It exists in trunk. Sorry, but I don't understand. What do you mean with "It exists in trunk."? Thank you. Regards Stephan
Re: How to access sitemap parameter within JavaFlow?
Hi Torsten, I guess he is after JAVAflow ;-) Yes.You're right! ;-) IIRC the parameters are set inside the continuation context. If you inherit from AbstractContinuable you should be able to just use getParameters(). That's the problem! The AbstractContinuable contains no method getParameters(): http://cocoon.apache.org/2.1/apidocs/org/apache/cocoon/components/flow/java/AbstractContinuable.html Thank you. Regards Stephan
How to access sitemap parameter within JavaFlow?
Hello, I had asked this question in the users list before but got no answer. So I will try it here. I need to access a sitemap parameter within a JavaFlow class. Is this possible? How can I access the parameter "foo" within the JavaFlow? Thank you a lot! Regards Stephan
Re: SQLTransformer, reaction on socket close?
Hi Sylvain, One output format will be a raw xml document (generated by the SQLTransformer). It will be parsed by an java client. On the other hand the output will be transformed to a HTML or Excel document by an XSLT Transformer. As you has written in your post before, I think the second one is not possible to detect a "browser cancel"? Is there a workaraound available? What happens on the first one (directly xml output) if the user stops the transfer by closing the browser? Thank you, Sylvain. Regards Stephan Sylvain Wallez wrote: Stephan Coboos wrote: I had forgotten to say: "The database connection should be closed if the user closes the browser _during reading_." So a hughe set of data which are not needed should not read again out of the database to save resources. We can know if the user closed her browser only by receiving an excption when trying to send data. That means that output of the SQLTransformer must be streamed down to the browser with no intermediate buffering, which unfortunately is what happens with an XSL transformation. What are the components after the SQLTransformer? Sylvain
Re: SQLTransformer, reaction on socket close?
I had forgotten to say: "The database connection should be closed if the user closes the browser _during reading_." So a hughe set of data which are not needed should not read again out of the database to save resources. Thank you. Stephan Stephan Coboos wrote: Hi, I need some "internal" informations. Therefore I'm posting on the dev list. I'm using the SQLTransformer to receive a very very big set of values out from a oracle database. Because the values are very very big, it would be nice, if the the connection to the database will be closed if the user closes its browser (socket close). Is such a feature implemented yet? Thank you! Regards Stephan
SQLTransformer, reaction on socket close?
Hi, I need some "internal" informations. Therefore I'm posting on the dev list. I'm using the SQLTransformer to receive a very very big set of values out from a oracle database. Because the values are very very big, it would be nice, if the the connection to the database will be closed if the user closes its browser (socket close). Is such a feature implemented yet? Thank you! Regards Stephan
Acessing request within a avalon component?
Hello, is it possible to access the current request within a avalon component without passing it as parameter? Thank you! Regards Stephan
Wizard using CForms doesn't work?
Hello, I need to implement a wizard using CForms. For this I had created one form definition which contains all fields of all wizards. Within the flowscript I only create one form instance for all shows. Each wizard form will contain a subset of fields of the form definition. At the end of the wizard trip I want to get all datas into one model. My flowscript looks something like this: function foo { var form = new Form("form.xml"); form.showForm("wizardStep1"); // Do something here form.showForm("wizardStep2"); var model = form.getModel(); // Do something with model here // Send ok page cocoon.sendPageAndWait("ok.html"); } But this doesn't work. The first wizard will be shown and the second one, too. But after filling out and sending the second form cocoon will allways display the second wizard and not go to the ok.html page. Isn't it possible to make several calls of showForm on one instance? Whats wrong here? Is this a known problem? Here you can see the second template. It should be correctly because no error was thrown: http://apache.org/cocoon/forms/1.0#template"; xmlns:fi="http://apache.org/cocoon/forms/1.0#instance";> Thank you. Regards Stephan
Bug in build of JavaFlow?
Hello, I don't need the samples and don't need the ojb block but the Javaflow block, so I had only Javaflow marked as include=true. But during build I got an exception: PersistenceFlow.java:81: cannot resolve symbol symbol : class Employee location: class org.apache.cocoon.samples.flow.java.PersistenceFlow employee = (Employee) broker.getObjectByIdentity(new Identity(employee, broker)); ^ I don't need samples and don't need ojb and therefore I had excluded these blocks, but why I got an compilation error here because of an class from ojb cannot resolved? Is it a bug in the build structure? That to do? Regards Stephan
Re: simple-repeater and on-bind doesn't work?
Joerg Heinicke wrote: On 02.09.2004 20:08, Stephan Coboos wrote: why it is not possible to use aso. within ?. I need this repeater because I want to remove all entries from the list and replace them by new values from the form. Or is this behavior also possible with ? Wouldn't it be better to add the attribute "clear-before-load" to the instead of introducing a new element ? http://issues.apache.org/bugzilla/show_bug.cgi?id=27601 Joerg Ok, thank you Joerg. But in the meantime what can I do to use the "on-insert-row" feature like in the and the "remove and readd"? Is there a way? Thank you. Stephan
simple-repeater and on-bind doesn't work?
Hello, why it is not possible to use aso. within ?. I need this repeater because I want to remove all entries from the list and replace them by new values from the form. Or is this behavior also possible with ? Wouldn't it be better to add the attribute "clear-before-load" to the instead of introducing a new element ? Thank you. Regards Stephan
[HELP!] HSSFSerializer and XSLTransformer doesn't work together (2nd)
Hello, I have a problem using XSLTTransformer and HSSFSerializer together. If I do so, I got a NullPointerException. Vladim talked to me that I have to look into the xalan sources and to get the original exception but I can't compile xalan (TransformerImpl) (The source version doesn't macht with the compiled one?). NOTE: Using the XSLTTransformer together with XMLSerializer works well but not with HSSFSerializer. Can somebody help me please to solve this problem because my company want's to using Cocoon but only if this basic feature does work in the next days. It would be great if we are able to use Cocoon in our server park. This is the file I want to transform: bar1 bar2 This is the stylesheet to transform the file above: http://www.w3.org/1999/XSL/Transform"; xmlns:sql="http://apache.org/cocoon/SQL/2.0"; xmlns:gmr="http://www.gnome.org/gnumeric/v7";> Sheet1 Sheet1 -1 -1 This is the sitemap entry for this: And what I get is the following error: Original Exception: java.lang.RuntimeException: java.lang.NullPointerException at org.apache.xalan.transformer.TransformerImpl.run(TransformerImpl.java:3407) at org.apache.xalan.transformer.TransformerHandlerImpl.endDocument(TransformerH andlerImpl.java:433) at org.apache.cocoon.xml.AbstractXMLPipe.endDocument(AbstractXMLPipe.java:56) at org.apache.cocoon.transformation.TraxTransformer.endDocument(TraxTransformer .java:562) at org.apache.xerces.parsers.AbstractSAXParser.endDocument(Unknown Source) at org.apache.xerces.impl.XMLDocumentScannerImpl.endEntity(Unknown Source) at org.apache.xerces.impl.XMLEntityManager.endEntity(Unknown Source) at org.apache.xerces.impl.XMLEntityScanner.load(Unknown Source) at org.apache.xerces.impl.XMLEntityScanner.skipSpaces(Unknown Source) at org.apache.xerces.impl.XMLDocumentScannerImpl$TrailingMiscDispatcher.dispatc h(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.excalibur.xml.impl.JaxpParser.parse(JaxpParser.java:296) . Thank you so much! Regards Stephan
Stops Cocoon the response on cancel?
Hallo, I would like to know whether Cocoon stops creating the output stream if the user canceles the response. For example I have a SQLTransformer sheet and in it SQL statements which can take a long time of execution. So, what I'd like to know is whether the user canceles the response is the sql stream (db connection) canceled, too? Or finishes the SQLTransformer the output (ResultSet) from the database first? It would be nice if the user can canceles the response (database query) if it takes too long and then no background process will be longer executed. Thank you. Regards Stephan
AW: HSSFSerializer doesn't work with XSLTransformer?
> > Because of a bug in serializer? Xalan catches NPE and re-throws it > loosing stacktrace. Catch original NPE and see where it is thrown; IMHO > it is coming from hssf serializer. Hello Vadim, this is the whole stacktrace, does it help? org.apache.cocoon.ProcessingException: Failed to execute pipeline.: java.lang.RuntimeException: java.lang.NullPointerException at org.apache.cocoon.components.pipeline.impl.AbstractCachingProcessingPipeline .processXMLPipeline(AbstractCachingProcessingPipeline.java:283) at org.apache.cocoon.components.pipeline.AbstractProcessingPipeline.process(Abs tractProcessingPipeline.java:490) at org.apache.cocoon.components.treeprocessor.sitemap.SerializeNode.invoke(Seri alizeNode.java:120) at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invo keNodes(AbstractParentProcessingNode.java:49) at org.apache.cocoon.components.treeprocessor.sitemap.PreparableMatchNode.invok e(PreparableMatchNode.java:130) at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invo keNodes(AbstractParentProcessingNode.java:72) at org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invoke(Pipel ineNode.java:126) at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invo keNodes(AbstractParentProcessingNode.java:72) at org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode.invoke(Pipe linesNode.java:101) at org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcess or.java:336) at org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcess or.java:277) at org.apache.cocoon.components.treeprocessor.sitemap.MountNode.invoke(MountNod e.java:103) at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invo keNodes(AbstractParentProcessingNode.java:49) at org.apache.cocoon.components.treeprocessor.sitemap.PreparableMatchNode.invok e(PreparableMatchNode.java:130) at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invo keNodes(AbstractParentProcessingNode.java:72) at org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invoke(Pipel ineNode.java:126) at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invo keNodes(AbstractParentProcessingNode.java:72) at org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode.invoke(Pipe linesNode.java:101) at org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcess or.java:336) at org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcess or.java:277) at org.apache.cocoon.Cocoon.process(Cocoon.java:639) at org.apache.cocoon.servlet.CocoonServlet.service(CocoonServlet.java:1098) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application FilterChain.java:237) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh ain.java:157) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja va:214) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex t.java:104) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520) at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContext Valve.java:198) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja va:152) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex t.java:104) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137 ) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex t.java:104) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117 ) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex t.java:102) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java :109) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex t.java:104) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929) at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConne ction(Http11Protocol.java:705) at org.apache.tomcat.util.net.TcpWorkerThread.r
HSSFSerializer doesn't work with XSLTransformer?
Hello, I have a big problem using the HSSFSerializer. If I'm creating a xml worksheet by hand and then serializing it using the HSSFSerializer everthing works well. But If I'm using a XSLTransformer before to create the structure, I got a NullPointerException: Original Exception: java.lang.RuntimeException: java.lang.NullPointerException at org.apache.xalan.transformer.TransformerImpl.run(TransformerImpl.java:3407) at org.apache.xalan.transformer.TransformerHandlerImpl.endDocument(TransformerH andlerImpl.java:433) at org.apache.cocoon.xml.AbstractXMLPipe.endDocument(AbstractXMLPipe.java:56) at org.apache.cocoon.transformation.TraxTransformer.endDocument(TraxTransformer .java:549) at org.apache.cocoon.xml.AbstractXMLPipe.endDocument(AbstractXMLPipe.java:56) at org.apache.cocoon.transformation.AbstractSAXTransformer.endDocument(Abstract SAXTransformer.java:279) at org.apache.cocoon.xml.AbstractXMLPipe.endDocument(AbstractXMLPipe.java:56) at org.apache.cocoon.xml.AbstractXMLPipe.endDocument(AbstractXMLPipe.java:56) at org.apache.cocoon.generation.JXTemplateGenerator.execute(JXTemplateGenerator .java:3230) at org.apache.cocoon.generation.JXTemplateGenerator.performGeneration(JXTemplat eGenerator.java:2979) at org.apache.cocoon.generation.JXTemplateGenerator$TransformerAdapter$Template Consumer.endDocument(JXTemplateGenerator.java:2742) at org.apache.cocoon.xml.AbstractXMLPipe.endDocument(AbstractXMLPipe.java:56) at org.apache.cocoon.components.sax.XMLTeePipe.endDocument(XMLTeePipe.java:67) at org.apache.cocoon.components.sax.XMLByteStreamInterpreter.parse(XMLByteStrea mInterpreter.java:83) The according pipeline look as follows: If I'am using the xml serializer and saving the xml to a file and then serializing this file using the HSSFSerializer everthing works well. Then: Why is it not possible to use the HSSFSerializer together with the XSLTransformer? Here is my simple stylesheet: http://www.w3.org/1999/XSL/Transform"; xmlns:sql="http://apache.org/cocoon/SQL/2.0"; xmlns:gmr="http://www.gnome.org/gnumeric/v7";> Sheet1 Sheet1 -1 -1 Thank you very much. Regards Stephan
Nightly build 2.1 is 2.2.0 dev???
Hello, I had downloaded the nightly build cocoon-2.1_20040731161331. But what I got after compiling was cocoon-2.2.0dev? Heahh? Is the snapshot algorithm wrong? Regards Stephan
RresultSet within JXTemplate?
Hello, is it possible to set a java.sql.ResultSet witin a JXTemplate and then iterate over the contents? I need this way to print out > 60 Elements from a database into an xml. So it is not possible to create beans before. Thank you. Regards Stephan
Form sample doesn't work
Hello, I'am using 2.1.5.1. It seems that the CForms samples doesn't work on this release? If I'am trying to start such an example the following error message will be thrown: Caused by: org.apache.avalon.framework.component.ComponentException: Could not find component (key [org.apache.cocoon.forms.FormManager]) at org.apache.avalon.excalibur.component.ExcaliburComponentManager.lookup(ExcaliburComponentManager.java:263) But the forms block exists and the necessary libs (the class FormManager), too. What can I do? Is it fixed in the nightly build? Or is it a problem on my side? Thank you! Regards Stephan
Filter like in servlet container
Hello, why not implement a filter system like in a servlet container exists to filter the request and the response? Because using the filter of the servlet-container there is a bindig between cocoon and the servlet container necessary. This filter technique would be useful eg for closing transactions after view generation (like hibernate and some others) or to simply plug-in a login mechanism (just a few examples out of many). What do you think about it? Regards Stephan
Re: component lifecycles
Jeremy Quinn wrote: How would I organise this differently, in the situation where I had several of these Components, each differently configured, that I wanted to be able to load in FlowScript in a similar way. Maybe we want one setup for read-only privs and another setup for read-write privs etc. Use the ServiceSelector like for DataSources. I dont't know where documentation about this can be found, but the sources of Cocoon should contain many lines of that kind and a search on "ServiceSelector" should help. Using a ServiceSelector, a entry in cocoon.xconf looks like: In a java class the code to retrieve the component foo1 should be something like: ServiceSelector selector = (ServiceSelector)this.serviceManager.lookup(Foo.ROLE); ... Foo foo1 = (Foo)selector.select("foo1"); ... Hope this few lines helps. Regards
Re: Best practice for database access in flow layer
Adam Ratcliffe wrote: I'm looking for a little direction on the most appropriate way to access a database from the flow layer. My application requires read-only access to the database only so an O/R type approach would probably be overkill. What I would like to do in the flow layer is something like the following psuedo code. Do a select query against the database using a java component. Test the returned collection to see if it contains any elements and use that test to determine whether redisplay the current page or to break out of the recursive loop. Any suggestions? function searchCategories(locType, class1, class2) { var categories = Search.searchCategories(locType, class1, class2); if(categories != null) { // if search returned categories, search again on expanded categories cocoon.sendPageAndWait("page/showCategories.xml", {"categories" : categories} ); // when user request arrives class1 = cocoon.request.getParameter("class1"); class2 = cocoon.request.getParameter("class2"); // recursively calls itself with searchCategories(locType, class1, class2); } } Create your own avalon database component. So you can switch the persistence layer like you want. Please have a look at the following link. (It's in german language but the code should help you. Use class "AbstractManagerDB") http://www.pgmtools.de/board/viewtopic.php?t=35 Regards Stephan
Flow and and its own scope
Hello, why having bizData objects its own flow scope and not be stored e.g. in session or request? Is it possible to retrieve the object via session or request without using extra setAttribute in flow? Thank you. Regards
Re: Taglib-Block doesn't work? (Deprecated?)
[EMAIL PROTECTED] wrote: the problem is a ClassCastException because the code was changed to use a ServiceSelector, but the configuration uses a ExtendedComponentSelector. I send you the diff what was changed. You can replace ServiceSelector back to ComponentSelector and it will work again. It seam that there is no ExtendedServiceSelector available. Volker Hello Volker, is it solved in the actualy nightly build? I don't want to change something in cocoon blocks because of later updates of cocoon. Thank you. Regards Stepan
Re: Bug in HTMLSerializer?
Stephan Coboos wrote: Pier Fumagalli wrote: On 15 Jun 2004, at 17:28, Stephan Coboos wrote: Hello, in my XML doc I need to declare some entities. But if I do so, I cant use the HTMLSerializer to output my doc because a braket > appears on the right top corner. Why? Is it a bug in HTMLSerializer? What can I do to avoid this? Did you try using the XML serializer in the "serializers" package? Class name is org.apache,cocoon.components.serializers.XMLSerializer Pier Yes of course! It works. But the XHTMLSerializer outputs empty as => IE has problems with this output! So I need the HTMLSerializer.. Oh, I'm sorry. Haven't seen you mean another one. This HTMLSerializer works! Why not make this one to the default one? What are the differences? Thank you. Regards Stephan
Re: Bug in HTMLSerializer?
Pier Fumagalli wrote: On 15 Jun 2004, at 17:28, Stephan Coboos wrote: Hello, in my XML doc I need to declare some entities. But if I do so, I cant use the HTMLSerializer to output my doc because a braket > appears on the right top corner. Why? Is it a bug in HTMLSerializer? What can I do to avoid this? Did you try using the XML serializer in the "serializers" package? Class name is org.apache,cocoon.components.serializers.XMLSerializer Pier Yes of course! It works. But the XHTMLSerializer outputs empty as => IE has problems with this output! So I need the HTMLSerializer..
Re: Bug in HTMLSerializer?
Bruno Dumon wrote: This is a problem in the Xalan serializer. You could file a bug report with them. (but make sure you're using the latest version -- I seem to remember that something like this was fixed before). I can remember this bug already exists in Cocoon 2.1.x (!). I will see to report this bug to the xalan group. As a workaround, you can include a transformer in your pipeline that throws away all events between the start and end of the doctype. For example, inserting an identity XSLT transform will do this (though not in the most optimal way). Did you have an example how to do that? Thank you. Regards Stephan
Bug in HTMLSerializer?
Hello, in my XML doc I need to declare some entities. But if I do so, I cant use the HTMLSerializer to output my doc because a braket > appears on the right top corner. Why? Is it a bug in HTMLSerializer? What can I do to avoid this? My xml doc: ]> &foo; My pipeline: My browser output (source): > bar Look at the first braket > on top of the source. Why is it there? Thank you for your help! Regards Stephan
Bug in HTMLSerializer?
Hello, in my XML doc I need to declare some entities. But if I do so, I cant use the HTMLSerializer to output my doc because a braket > appears on the right top corner. Why? Is it a bug in HTMLSerializer? What can I do to avoid this? My xml doc: ]> &foo; My pipeline: My browser output (source): > bar Look at the first braket > on top of the source. Why is it there? Thank you for your help! Regards Stephan
Problem using JavaFlow and exceptions
Hello, I'am sorry but I have another problem using JavaFlow. I want to use my own Exceptions in JavaFlow. One Exception contains a long type as parameter. But if so, the flows will not load at startup. Please have a look into my source code example: package foo.bar; import org.apache.cocoon.components.flow.java.AbstractContinuable; public class TestFlow extends AbstractContinuable { public void doTest() throws Exception { while(true) { this.sendPageAndWait("test.jxt"); throw new FooException("test", 123); } } } The class FooException: package foo.bar; public class FooException extends java.lang.Exception { private long id = 0; public FooException() { } public FooException(String msg) { super(msg); } public FooException(String msg, long id) { ... this.id = id; } } If I use the parameter id, at first call of the corresponding url I got the following error output into the logs of tomcat and flows will not work: java.lang.VerifyError: (class: foo/bar/TestFlow, method: doTest signature: ()V) Attempt to split long or double on the stack at java.lang.Class.getDeclaredMethods0(Native Method) at java.lang.Class.privateGetDeclaredMethods(Class.java:1647) at java.lang.Class.privateGetPublicMethods(Class.java:1770) at java.lang.Class.getMethods(Class.java:824) at org.apache.cocoon.components.flow.java.JavaInterpreter.initialize(JavaInterpreter.java:119) at org.apache.cocoon.components.flow.java.JavaInterpreter.callFunction(JavaInterpreter.java:153) at org.apache.cocoon.components.treeprocessor.sitemap.CallFunctionNode.invoke(CallFunctionNode.java:130) at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:49) at org.apache.cocoon.components.treeprocessor.sitemap.PreparableMatchNode.invoke(PreparableMatchNode.java:130) at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:72) at org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invoke(PipelineNode.java:126) at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:72) at org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode.invoke(PipelinesNode.java:101) at org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:336) at org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:277) at org.apache.cocoon.components.treeprocessor.sitemap.MountNode.invoke(MountNode.java:103) at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:49) at org.apache.cocoon.components.treeprocessor.sitemap.PreparableMatchNode.invoke(PreparableMatchNode.java:130) at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:72) at org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invoke(PipelineNode.java:126) at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:72) at org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode.invoke(PipelinesNode.java:101) at org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:336) at org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:277) at org.apache.cocoon.Cocoon.process(Cocoon.java:619) at org.apache.cocoon.servlet.CocoonServlet.service(CocoonServlet.java:1073) at javax.servlet.http.HttpServlet.service(HttpServlet.java:810) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520) at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:1
Re: Another bug in javaflow?
Stephan Michels wrote: member variables have the scope of the seesion. Ok. But makes this sense? If I have no continuation I need no member variable. Isn't it better to remove the member vars from the session scope and bind them on the contonuation object? What's the reason to bind member vars to session and not to continuation? Thank you. Regards Stephan
Another bug in javaflow?
Hello, please have a look at the following java flow code: ... public class TestFlow extends AbstractContinuable{ private boolean foo= false; public void doTest() throws Exception { while(true) { this.getLogger().debug("reload = " + this.foo); this.sendPageAndWait("test.jxt"); this.foo= true; } } } I assume if I'am "hopping" from continuation to continuation the variable "foo" should always be "true". It's ok it is always "true". BUT: If I reload the page in my browser (hard reload) the var "foo" is "true", too. There is no initialization process! So "foo" is always "true" in the same browser instance. In my opinion, If I make a reload without a call of a continuation the var reload should be false, should it? Is it another bug in javaflow? Thank you for your help. Regards Stephan
Taglib-Block doesn't work? (Deprecated?)
Hello, I had tried to write my own taglib using the TagTransformer but it doesn't work. I can't find some informations about it, so I had copied the example and changed something but it doesn't work. I want to use a tag to print out "HELLO WORLD". My changes in detail: 1.) I had written my own class HelloWorldTag: package foo.bar.taglib; import org.apache.cocoon.taglib.XMLProducerTagSupport; import org.xml.sax.SAXException; import org.xml.sax.Attributes; public class HelloWorldTag extends XMLProducerTagSupport { public int doStartTag(String namespaceURI, String localName, String qName, Attributes atts) throws SAXException { String hello = "HELLO WORLD"; this.xmlConsumer.characters(hello.toCharArray(), 0, hello.length()); this.getLogger().error("T E X T = " + hello); return this.EVAL_BODY; } } 2.) I had created a subproject tagtest containing a xml file tagtest.xml: 3.) My sitemap looks as follow: http://apache.org/cocoon/sitemap/1.0";> tag 3.) In cocoon.xconf I had registered the tag : 4.) After calling http://localhost:8080/cocoon/tagtest the tag will not be replaces by "HELLO WORLD". I got the following output - nothing parsed: What is wrong here? Thank you for your help. PS: I had tried the taglib block it seems it doesn't work, too! Whats about this block? Is it deprecated? Regards Stephan
Re: [BUG] Registering of JavaFlow fails (was: [JavaFlow] java.lang.VerifyException)
Stephan Michels wrote: Am Do, den 03.06.2004 schrieb Stephan Michels um 15:00: Am Di, den 01.06.2004 schrieb Stephan Coboos um 20:23: Hello, I have a problem using Objects in JavaFlow before a while loop. Please see my first posting [JavaFlow] java.lang.VerifyException. In my opinion it can be a bug in the JavaFlow block. Because my fist posting was not so clear, I had tried to reproduce the error for a while and I had discovered the following code which creates such an error (you need the packages of Lucene): java.lang.VerifyError: (class: foo/bar/TestFlow, method: doTest signature: ()V) Incompatible object argument for function call Is it really a bug? Why is it not possible to declare these three line within the method doTest? What can I do? Yes, it seems to be a bug. I guess its a problem the following line query = QueryParser.parse("foo", "bar", new StandardAnalyzer()); I had many problem in the past with uninitialized objects and saving the continuation. I will take a look into it. It was a problem with null objects, which were stored into the continuation. If the frame will be restored, the null object cannot be casted into the right type. So, at the end the correct signatur couldn't be found. Hits hits; IndexSearcher searcher = null; sendPageAndWait("foo"); hits = searcher.search(query); I have fixed it now. Stephan. Wow, what a quick work! Thank you very much! Regards Stephan
[BUG] Registering of JavaFlow fails (was: [JavaFlow] java.lang.VerifyException)
Hello, I have a problem using Objects in JavaFlow before a while loop. Please see my first posting [JavaFlow] java.lang.VerifyException. In my opinion it can be a bug in the JavaFlow block. Because my fist posting was not so clear, I had tried to reproduce the error for a while and I had discovered the following code which creates such an error (you need the packages of Lucene): package foo.bar; import org.apache.cocoon.components.flow.java.AbstractContinuable; import org.apache.lucene.queryParser.*; import org.apache.lucene.search.*; import org.apache.lucene.analysis.standard.StandardAnalyzer; public class TestFlow extends AbstractContinuable { public void doTest() throws Exception { // This causes an error -> The class can not be registered at first call!!! Query query = null; Hits hits; IndexSearcher searcher = null; // end while(true) { this.sendPageAndWait("foo"); query = QueryParser.parse("foo", "bar", new StandardAnalyzer()); hits = searcher.search(query); } } } If you test this error you can see that the first call of any (!) url of the corresponding cocoon app causes in a empty page. The flow-log shows as last entry the following line: registered java class "foo.bar.TestFlow" for flow Then, Cocoon stops working and displays a empty page. In the logs of my servlet container Tomcat I can see the follwing error message: 2004-06-01 19:58:33 StandardWrapperValve[Cocoon]: Servlet.service() for servlet Cocoon threw exception java.lang.VerifyError: (class: foo/bar/TestFlow, method: doTest signature: ()V) Incompatible object argument for function call at java.lang.Class.getDeclaredMethods0(Native Method) at java.lang.Class.privateGetDeclaredMethods(Class.java:1647) at java.lang.Class.privateGetPublicMethods(Class.java:1770) at java.lang.Class.getMethods(Class.java:824) at org.apache.cocoon.components.flow.java.JavaInterpreter.initialize(JavaInterpreter.java:96) at org.apache.cocoon.components.flow.java.JavaInterpreter.callFunction(JavaInterpreter.java:130) at org.apache.cocoon.components.treeprocessor.sitemap.CallFunctionNode.invoke(CallFunctionNode.java:130) at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:49) at org.apache.cocoon.components.treeprocessor.sitemap.PreparableMatchNode.invoke(PreparableMatchNode.java:130) at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:72) at org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invoke(PipelineNode.java:126) at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:72) at org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode.invoke(PipelinesNode.java:101) at org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:336) at org.apache.cocoon.components.treeprocessor.TreeProcessor.handleCocoonRedirect(TreeProcessor.java:382) at org.apache.cocoon.components.treeprocessor.TreeProcessor.access$000(TreeProcessor.java:66) at org.apache.cocoon.components.treeprocessor.TreeProcessor$TreeProcessorRedirector.cocoonRedirect(TreeProcessor.java:543) at org.apache.cocoon.environment.ForwardRedirector.redirect(ForwardRedirector.java:58) at org.apache.cocoon.components.treeprocessor.sitemap.RedirectToURINode.invoke(RedirectToURINode.java:69) at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:49) at org.apache.cocoon.components.treeprocessor.sitemap.PreparableMatchNode.invoke(PreparableMatchNode.java:130) at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:72) at org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invoke(PipelineNode.java:126) at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:72) at org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode.invoke(PipelinesNode.java:101) at org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:336) at org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:277) at org.apache.cocoon.components.treeprocessor.sitemap.MountNode.invoke(MountNode.java:103) at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:49) at org.apache.cocoon.components.treeprocessor.sitemap.PreparableMatchNode.invoke(PreparableMatchNode.java:130) at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:72) at org.apache.cocoon.components.treepro
[JavaFlow] java.lang.VerifyException
Hello, I'am using JavaFlow. All my JavaFlows works very well, except one. If I use this Flow I got a empty page each first call. In the next call I got an exception which displays that the method of the flow can not be found but the name of the method is correct and it is correct registered: org.apache.cocoon.ProcessingException: No method found for 'editSingleContainer' at org.apache.cocoon.components.flow.java.JavaInterpreter.callFunction(JavaInterpreter.java:135) at org.apache.cocoon.components.treeprocessor.sitemap.CallFunctionNode.invoke(CallFunctionNode.java:130) at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:49) at org.apache.cocoon.components.treeprocessor.sitemap.PreparableMatchNode.invoke(PreparableMatchNode.java:130) at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:72) at org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invoke(PipelineNode.java:126) at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:72) at org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode.invoke(PipelinesNode.java:101) The Tomcat logs shows me the following: java.lang.VerifyError: (class: foo/bar/flow/EditSingleContainerFlow, method: doEditSingleContainer signature: ()V) Incompatible object argument for function call at java.lang.Class.getDeclaredMethods0(Native Method) at java.lang.Class.privateGetDeclaredMethods(Class.java:1647) at java.lang.Class.privateGetPublicMethods(Class.java:1770) at java.lang.Class.getMethods(Class.java:824) at org.apache.cocoon.components.flow.java.JavaInterpreter.initialize(JavaInterpreter.java:96) at org.apache.cocoon.components.flow.java.JavaInterpreter.callFunction(JavaInterpreter.java:130) at org.apache.cocoon.components.treeprocessor.sitemap.CallFunctionNode.invoke(CallFunctionNode.java:130) at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:49) at org.apache.cocoon.components.treeprocessor.sitemap.PreparableMatchNode.invoke(PreparableMatchNode.java:130) at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:72) at org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invoke(PipelineNode.java:126) at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:72) at org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode.invoke(PipelinesNode.java:101) at org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:336) at org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:277) at org.apache.cocoon.components.treeprocessor.sitemap.MountNode.invoke(MountNode.java:103) at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:49) at org.apache.cocoon.components.treeprocessor.sitemap.PreparableMatchNode.invoke(PreparableMatchNode.java:130) at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:72) at org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invoke(PipelineNode.java:126) at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:72) at org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode.invoke(PipelinesNode.java:101) at org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:336) at org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:277) at org.apache.cocoon.Cocoon.process(Cocoon.java:619) at org.apache.cocoon.servlet.CocoonServlet.service(CocoonServlet.java:1073) at javax.servlet.http.HttpServlet.service(HttpServlet.java:810) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520) at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520) at org.apache.catalina.core.Standard
LuceneSearchGenerator: NullPointerException if query contains a blank
Hello, I'am trying the LuceneSearchGenerator of the cocoon samples to search for a pattern passed to the generator via the parameter "queryString" but if this query string contains a blank " " or a special character like (, ) ", ! a NullPointerException will be thrown. Why? What can I do to avoid this exception? Is it a bug? Thank you. The full exception: Original Exception: java.lang.NullPointerException at org.apache.cocoon.www.samples.lucene.search_index_xsp.generate(org.apache.cocoon.www.samples.lucene.search_index_xsp:1087) at org.apache.cocoon.generation.ServerPagesGenerator.generate(ServerPagesGenerator.java:263) at org.apache.cocoon.components.pipeline.AbstractProcessingPipeline.processXMLPipeline(AbstractProcessingPipeline.java:581) at org.apache.cocoon.components.pipeline.impl.AbstractCachingProcessingPipeline.processXMLPipeline(AbstractCachingProcessingPipeline.java:196) at org.apache.cocoon.components.pipeline.AbstractProcessingPipeline.process(AbstractProcessingPipeline.java:525) at org.apache.cocoon.components.treeprocessor.sitemap.SerializeNode.invoke(SerializeNode.java:155) at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:84) at org.apache.cocoon.components.treeprocessor.sitemap.PreparableMatchNode.invoke(PreparableMatchNode.java:165) at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:107) at org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invoke(PipelineNode.java:162) at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:107) at org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode.invoke(PipelinesNode.java:136) at org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:371) at org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:312) at org.apache.cocoon.components.treeprocessor.sitemap.MountNode.invoke(MountNode.java:133) at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:84) at org.apache.cocoon.components.treeprocessor.sitemap.PreparableMatchNode.invoke(PreparableMatchNode.java:165) at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:107) at org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invoke(PipelineNode.java:162) at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:107) at org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode.invoke(PipelinesNode.java:136) at org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:371) at org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:312) at org.apache.cocoon.components.treeprocessor.sitemap.MountNode.invoke(MountNode.java:133) at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:84) at org.apache.cocoon.components.treeprocessor.sitemap.PreparableMatchNode.invoke(PreparableMatchNode.java:165) at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:107) at org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invoke(PipelineNode.java:162) at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:107) at org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode.invoke(PipelinesNode.java:136) at org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:371) at org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:312) at org.apache.cocoon.Cocoon.process(Cocoon.java:656) at org.apache.cocoon.servlet.CocoonServlet.service(CocoonServlet.java:1112) at javax.servlet.http.HttpServlet.service(HttpServlet.java:856) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:284) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:204) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:257) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:567) at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:245) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:199) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:567) at org.apache.catali
Re: InitParameters in Cocoon
Anna Bikkina wrote: I could put in a properties file but its just one property so didnt know if it does make sense. Well if I cant reach web.xml then I have no other alternate anway. Anyone else successful trying to get access to initparameters in web.xml? Thanks, Anna. On Thursday 29 April 2004 06:32 pm, Upayavira wrote: Why do you need them there. Can't you put them somewhere else? I've failed before to get hold of web.xml parameters. You shouldn't use web.xml to store and retrieve parameters, because cocoon is able to work without web.xml! Its better you're using one of the input modules: GlobalInputModule, DefaultsModule or PropertiesFileModule: http://cocoon.apache.org/2.1/apidocs/org/apache/cocoon/components/modules/input/package-summary.html Regards Stephan
Re: #{//foo/bar} doesn't work within forEach!
Leon Widdershoven wrote: Could it be that you are using both Jexl and XPath tags? Yes of course. But it should work, shouldn't it? Because something like this works, correctly: Item: #{.} Note: The iteration will be done by using Jexl. The node to print out will be selected by XPath. So i think it is possible to mix Jexl and XPath. Regards Stephan
#{//foo/bar} doesn't work within forEach!
Hello, I've tried to retrieve an object within a JXTemplate: #{//foo/bar} This works fine outside any "forEach". If I'am using it inner forEach, nothing will be printed out: #{//foo/bar} Because // refers to the root, the value should be printed out within this context, right? Whats wrong? Thank you. Regards Stephan
Re: JXTemplateTransformer doesnt work!
Ohh. I'am sorry. I had used attribute "name" instead "var". It works fine! Thank you. Regards Stephan
JXTemplateTransformer doesnt work!
Hello, this construct doesn't show me the the content of the variable: ${foo} This should print out "bar" but it doesn't!! Why? Is it another bug in JXTemplateTransformer or did I something wrong? Please help me. Regards Stephan
Re: [BUG?] jx:import doesn't work in JXTemplateTransformer
Christopher Oliver wrote: Stephan Coboos wrote: Is it a bug? Should I post it in the bugtracker? It's a bug. The ServiceManager isn't initialized when you run JXTemplateGenerator as a transformer. I'll commit a fix shortly. Chris Perfectly! Thank you! Regards Stephan
Re: [BUG?] jx:import doesn't work in JXTemplateTransformer
Is it a bug? Should I post it in the bugtracker?
Using SourceResolver with german umlauts?
Hello, is it possible to use the SourceResolver to resolve a path which contains german umlauts? Is it possible to set the right encoding? I'm getting hieroglyphes using the SourceResolver to resolve paths containing german umlauts. Thank you. Regards
Re: [BUG?] jx:import doesn't work in JXTemplateTransformer
Hello Oliver; the stacktrace: Original Exception: java.lang.NullPointerException at org.apache.cocoon.components.source.SourceUtil.parse(SourceUtil.java:290) at org.apache.cocoon.generation.JXTemplateGenerator.execute(JXTemplateGenerator.java:3856) at org.apache.cocoon.generation.JXTemplateGenerator.performGeneration(JXTemplateGenerator.java:2957) at org.apache.cocoon.generation.JXTemplateGenerator$TransformerAdapter$TemplateConsumer.endDocument(JXTemplateGenerator.java:2731) at org.apache.cocoon.xml.AbstractXMLPipe.endDocument(AbstractXMLPipe.java:91) at org.apache.cocoon.components.sax.XMLTeePipe.endDocument(XMLTeePipe.java:102) at org.apache.xerces.parsers.AbstractSAXParser.endDocument(Unknown Source) at org.apache.xerces.impl.XMLDocumentScannerImpl.endEntity(Unknown Source) at org.apache.xerces.impl.XMLEntityManager.endEntity(Unknown Source) at org.apache.xerces.impl.XMLEntityScanner.load(Unknown Source) at org.apache.xerces.impl.XMLEntityScanner.skipSpaces(Unknown Source) at org.apache.xerces.impl.XMLDocumentScannerImpl$TrailingMiscDispatcher.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.excalibur.xml.impl.JaxpParser.parse(JaxpParser.java:318) at org.apache.excalibur.xml.impl.JaxpParser.parse(JaxpParser.java:337) at org.apache.cocoon.components.source.SourceUtil.parse(SourceUtil.java:284) at org.apache.cocoon.generation.FileGenerator.generate(FileGenerator.java:141) at org.apache.cocoon.components.pipeline.impl.AbstractCachingProcessingPipeline.processXMLPipeline(AbstractCachingProcessingPipeline.java:272) at org.apache.cocoon.components.pipeline.AbstractProcessingPipeline.process(AbstractProcessingPipeline.java:525) at org.apache.cocoon.components.treeprocessor.sitemap.SerializeNode.invoke(SerializeNode.java:155) at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:84) at org.apache.cocoon.components.treeprocessor.sitemap.PreparableMatchNode.invoke(PreparableMatchNode.java:165) at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:107) at org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invoke(PipelineNode.java:162) at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:107) at org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode.invoke(PipelinesNode.java:136) at org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:371) at org.apache.cocoon.components.treeprocessor.TreeProcessor.handleCocoonRedirect(TreeProcessor.java:416) at org.apache.cocoon.components.treeprocessor.TreeProcessor.access$000(TreeProcessor.java:101) at org.apache.cocoon.components.treeprocessor.TreeProcessor$TreeProcessorRedirector.cocoonRedirect(TreeProcessor.java:577) at org.apache.cocoon.environment.ForwardRedirector.redirect(ForwardRedirector.java:93) at org.apache.cocoon.components.treeprocessor.sitemap.RedirectToURINode.invoke(RedirectToURINode.java:104) at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:84) at org.apache.cocoon.components.treeprocessor.sitemap.PreparableMatchNode.invoke(PreparableMatchNode.java:165) at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:107) at org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invoke(PipelineNode.java:162) at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:107) at org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode.invoke(PipelinesNode.java:136) at org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:371) at org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:312) at org.apache.cocoon.components.treeprocessor.sitemap.MountNode.invoke(MountNode.java:133) at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:84) at org.apache.cocoon.components.treeprocessor.sitemap.PreparableMatchNode.invoke(PreparableMatchNode.java:165) at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:107) at org.apache.cocoon.components.tr
[BUG?] jx:import doesn't work in JXTemplateTransformer
Hello, the element doesnt work in JXTemplateTransformer. If I'am using this element I got a java.lang.NullPointerException. In the JXTemplateGenerator instead it works fine. Is it a bug? Should I add it to the bugtracker? PS: Im using Cocoon 2.1.4. Thank you. Regards Stephan
Not possible to pass params to action-set or bug?
Hello, is it possible to pass parameters from the pipeline to an action within an action-set? I have the following structure in my sitemap: ... ... This doesnt work. My TestAction doesn't display the parameter "name", which should contain the value "bar". If I'm using {../foo} instead of {foo} I got a "not so many levels" exception. Isn't it possible to pass parameters to an action-set or is it a bug? Thank you. Regards Stephan
Include XML string into the pipline via transformer
Hello, I need to include xml coming from a database as string into the pipline via my own transformer. (Please do not ask why writing my own transformer. I need it..). I had seen, including xml coming form sources (xml files) is very easy using the SourceUtil. But how can I include xml which exists not as source but as string? Is there already a tool avaiable which makes it easy like the SourceUtil? Any examples? Thank you very much. Regards Stephan
Re: Usage of SAXBuffer?
Christopher Oliver wrote: You could use the JXTemplate generator to do this without Java programming: -- Chris Thank you, Chris. But I need to write my own transformer for several reasons. So I can't use JXTransformer. My problem is not how to create an iteration but how to repeat a bunch of sax events several times within a transformer. One possible solution would be to put the events on a stack. The better solution would SAXBufffer be, I hope so. Therefore I need a short example how to use this class. Regards
Usage of SAXBuffer?
Hello, I want to write my own transformer which iterates over a element and repeates the content several times. For example: I'm the content The content "I'm the content" should be repeated 3 times, like this: I'm the content I'm the content I'm the content Can I use the class org.apache.cocoon.xml.SAXBuffer to do that? Can you give me a short example, how to use this class within a transformer? Thank you. Regards Stephan
Re: Default ProcessingPipline implementation?
Unico Hommes wrote: Stephan Coboos wrote: Unico Hommes wrote: See the root sitemap where it says: ;-) Unico And what happens if I dont specify an element in the root sitemap? ;-) Which ProcessingPipeline is will be used then? AFAICT this would generate an error. Doesn't it? Unico Yes it does. Thank you. Regards Stephan
Re: Default ProcessingPipline implementation?
Unico Hommes wrote: See the root sitemap where it says: ;-) Unico And what happens if I dont specify an element in the root sitemap? ;-) Which ProcessingPipeline is will be used then? Regards Stephan
Default ProcessingPipline implementation?
Hello, if no section is given in a sitemap, which implementation of a ProcessingPipeline will be used? CachingProcessingPipeline? Thank you! Regards Stephan
Re: Configuration of own roles in external file?
Upayavira wrote: Stephan Coboos wrote: Hello, long long time ago I had heard that own roles can be configured in a separate config file. But I have forgotten which structure this file must have and how to set the path to this file. The only thing I know is there was an attribuite in of cocoon.xconf to set the path, but which? Maybe roles="..." ? <*cocoon* *user*-*roles*="WEB-INF/myroles.xconf"> Regards, Upayavira Ahh yes. Thank you. Which structure must myroles.xconf have? This: Thank you. Regards
Configuration of own roles in external file?
Hello, long long time ago I had heard that own roles can be configured in a separate config file. But I have forgotten which structure this file must have and how to set the path to this file. The only thing I know is there was an attribuite in of cocoon.xconf to set the path, but which? Maybe roles="..." ? Thank you. Regards
Re: Accessing Servlet request, response and session
Miguel Griffa wrote: Hi all, I'm new to developing inside cocoon (I'm writing a generator now). Since I have to migrate an old framework into cocoon, I need to access data like request and response How can I access these? I have the idea that I'd need to use the manager to lookup() some component that will give me these data, but where can I have a list of which components are available in the service manager? Thanks in advance Use org.apache.cocoon.environment.ObjectModelHelper to get the request in method setup(). Request req = ObjectModelHelper.getRequest(objectModel); Regards Stephan
Re: Flowscript and return to pipeline
Antonio Gallardo wrote: Stephan Coboos dijo: is more easier to understand than this: Did you already saw the advantage of this?: No matter how they will try to go to "second" they MUST go through "first". I like this feature of flow. :-D Yes, of course. We are using this, too. But to decide, which internal-only pipeline was called from the flowscript you have to take a look into the script or create a good documentation of your sitemap! I want not to say using flowscript to call another pipeline in some ways is bad. I want to say it should be optional and marked in the sitemap in any way (with return="true" for example). 1.) This flowscript comes back (it is not possible to "switch" within the flowscript): 2.) This flowscript comes not back: Thats all. Regards Stephan
Re: Flowscript and return to pipeline
Leszek Gawron wrote: On Thu, Feb 26, 2004 at 10:22:12AM +0100, Stephan Coboos wrote: I think a solution like this: is more easier to understand than this: ok, this is possible, too: Not easier to understand at all as you are mixing concerns. With 2 lines of code you have mixed model and view. What are the differences between this two solutions? and Therefore I wrote "why not using flowscript like actions"? Please note the attribute return="true" in the . This tells cocoon what the flow will always return into the sitemap at this position and is not able to use sendPage or sendPageAndWait. I think this would be a possible way to realize integration of flowscript. What if getValues function fails to fetch the data? Of course another way could be to to use a construct like this: - BSF (you can use Javascript too) - I do not know what state the BSF block is in right now as really nobody used it before. OK. But this seems to be a problem. I have to use this option in a production environment and therefore it has to be stable. It should be possible to say: Use flowscript for _all_ your logic problems. The one way should be to use it with sendPage, ... and another way to use it without this functions and instead with a if-else-construct within the pipeline like in actions. So you have one technique which solves the most problems. Regards Stephan
Re: Flowscript and return to pipeline
Antonio Gallardo wrote: AFAIK, there as an initiative to use javascript in XSP. But for a lack of interest there is not fully developed. Yes, I know. But I dont like XSP. I think XSP is not the best way to integrate logic. For historical reasons flow was introduced with flowscript for convenience. Later was found the advantages of using Javascript in Flow. There was hard discusion. You can search cocoon-dev mailarchives about this topic. Yes. But what I want to say is: Why should I use the one language to integrate this logic and the other language to integrate other logic? Why not bring it all together? Why cant I use a JavaScript like an action? Or did you ever seen a car which only can turn left? ;-)) The more different types of integrating logic are possible the more complicated cocoon will become. To put it all in a nutshell: I think a solution like this: is more easier to understand than this: ok, this is possible, too: But here I have to use two different languages. In our company we have many html-developers who can use JavaScript but nowone is able to using Java. So we have to realize the simple logic part by the expensive web-developers, too! Regards Stephan
Re: Flowscript and return to pipeline
Antonio Gallardo wrote: We already have to this. With the sitemap complexity grows very fast in some times to unreadable sizes. Yes, but why using Java on the one hand and JavaScript on the other? Why not using for both solutions JavaScript as alternative way? This mix makes it much more complicated to get involved into cocoon for newbies. Regards Stephan
Re: Flowscript and return to pipeline
Ralph Goers wrote: I don't mean to start any kind of flame war here and the following is strictly my opinion. Actually the statement below is the exact reason I and my colleagues are reticent to use flowscript. I have no problem with using flowscript to manage a couple of pages that are linked together (i.e. - a form to fill out followed by a confirmation page). But using it for more than this violates the separation of concerns principal that Cocoon strives to achieve through the sitemap. It is far too easy to start throwing all your business as well as presentation logic into flowscript and soon you'll end up with something worse than JSPs. This is impossible to do with just the sitemap. Frankly, I have been concerned with how so much effort seems to be focused on moving Cocoon from its sitemap roots to flowscript. Yes, I agree with you but why not using a solution which markes a flowscript as "linear" or "returnable"? If this flag was setted it should be impossible to use sendPage and sendPageAndWait, ... within the flowscript. So it is not possible to call another pipeline and the flow must return to the called position in the pipeline. With this solution you have a kind of action which is much more easier to develope. 1.) If you read the sitemap you can decide (by reading the sitemap! not the flowscript!) which returns after work at the same position. 2.) The programmer of a flowscript is not able to use sendPage,... and therefore he has to design the flowscript to fit this need. What do you think about this? Regards
Re: Flowscript and return to pipeline
Christopher Oliver wrote: Um, how much harder is this: Yes we had tried this solution, too. But we have much more flowscripts than only readProductBeans and for each one we have to split our pipeline. Therefore the sitemap will become a unreadable size. The other point is, if you (as designer or htmler) dont know, what function readProductBeans does you cant decide which pipeline will be called next. In you example, it is easy. In real projects it is possible to become a terrible find action. It would be more understanding for the html-designer if you can say: Here are your templates and with this call you can get all your data you need. Do it. We want to creat a more generic way in which the html-designer is able to plug-in his on pipelines. No we are doing something like this and I think this is not the best solution: Regards
Flowscript and return to pipeline
Hello, in some discussions I'd heard that actions and XSP should be more and more replaced by flowscript. I think, this is a good idea because flowscript is a good way to integrate logic parts into an application. But with one thing I cant agree. Why shouldn't it be possible to return to the sitemap without sendPage? I had read some discussions about the decision, throwing a Exception if no sendPage existst within a flowscript but I think this decision was wrong. In our current project we have to create some Beans from a Database. After that, this beans should be integrated into the actual pipeline, but this is not possible because a return after the flowscript is not possible so we have to use Actions instead b This is not possible but would be very very nice: Instead we have to do a work arround with an action which every time returns null and to put the Beans into the request scope. So we have to merge actions and flowscripts in one application but we do not want to use actions... So what to do? An alternative way would be a kind of "linear"-flowscript which is not able to redirect into another pipeline. What do you think about this? This could be marked in the pipeline with an attribute linear="true" for example: So if you read this line, you can be shure that this flowscript comes back and does not redirect into another pipeline. Thank you. Regards
cocoon.request.getAttributeNames not implementend yet?
Hello, in the cocoon docs http://cocoon.apache.org/2.1/userdocs/flow/api.html#Request+Object I can read that cocoon.request.getAttributeNames should return an object of type java.util.Enumeration but this function seems to be not implemented yet because a call of this funtion cases a "Function not found " exception. A further look into the apidocs shows me, that the according FOM_Method doesnt exist: http://cocoon.apache.org/2.1/apidocs/org/apache/cocoon/components/flow/javascript/fom/AO_FOM_Cocoon.FOM_Request.html After I had looked into the source it seems to me adding this method is very simple by adding the following lines to AO_FOM_Cocoon.FOM_Request: public Enumeration jsFunction_getAttributeNames() { return request.getAttributeNames(); } Thank you. Regards Stephan
Calling method before getting component from the pool?
Hello, is there a interface for the service manager avaiable which definies that a method of a pooled component will be called right before I get it from the pool? I want to get a new Datasource each time I get the component from the pool. How to do that? Thank you. Regards
Re: State/size of pools ?
Olivier Billard wrote: On 04/02/2004 12:37, Vadim Gritsenko wrote: Olivier Billard wrote: Hi cocooners ! (again) Is there a way to show the content at time t of objects pools ? By debug traces ? a special-secret-powerfull-tool ;) ? There is some secret super-powerful tool... Name is excalibur-instrument-manager, and when instrumentation enabled, you can launch some GUI app to see what's happening. I've not used it yet; archives should have mentionings of it. Vadim Oh oh :) ! Seems really a great super-secret-powerfull tool ! Thanks a lot Vadim ! I've heard of "instruments" in a training course of Mr Wallez ;). I'll check into this... Olivier Billard wrote: On 04/02/2004 12:37, Vadim Gritsenko wrote: Olivier Billard wrote: Hi cocooners ! (again) Is there a way to show the content at time t of objects pools ? By debug traces ? a special-secret-powerfull-tool ;) ? There is some secret super-powerful tool... Name is excalibur-instrument-manager, and when instrumentation enabled, you can launch some GUI app to see what's happening. I've not used it yet; archives should have mentionings of it. Vadim Oh oh :) ! Seems really a great super-secret-powerfull tool ! Thanks a lot Vadim ! I've heard of "instruments" in a training course of Mr Wallez ;). I'll check into this... Hello Oliver, would you tell me, how to use this instrumentation-secrect-powerfull-wow-tool? I have seen a file named instrumentation.xconf but it shows me nothing ;-) Thank you. Stephan
Re: [OT] Mail & Web forums
Upayavira wrote: [Off topic alert - this is completely off topic, but I'm stuck for anywhere else to look - please excuse me!] I'm looking for a system (preferably open source) that I can install on my own server, that'll allow me to set up a combined mailing list/web based forum, (much as we have now with ezmlm and gmane), i.e.messages can be sent by email or on a web page, messages can be received by email or viewed, threaded, on a web page. I can't use Gmane as these lists will be private. Anyone able to give me pointers (replies off list are fine)? I've been looking for months and not found anything. Sorry for the noise. Regards, Upayavira I don't know about mailling function but this web based forum looks very good (uses JSP and Servlets) and is in GPL: http://www.mvnforum.com/ Regards Stephan
Re: Status of 'Apples'?
Hello Marc, thank you for this long statement about apples. In my opinion, apples is a good counterpart to actions in struts because there are many things in common between this two conecpts. So struts users can easier change to Cocoon. Some people which are new to cocoon don't like the concept of using JavaScript as flow layer and would like to code this layer in "real" java. So they can do it! After they had stepped into cocoon and tested the flowscript side maybe some of this peoples will changing to flowscript, who knows? Regards Stephan
Status of 'Apples'?
Hello, I had read about the apples block and I would like to use it in some parts of my application. There is just one big question: I'd read that apples is in alpha status, so will it be (really) supported in future and when is the release planned? In 2.2? Thank you. Regards Stephan
Re: [Suggestion] Making components easier to distribute
Giacomo Pati wrote: Stephan Coboos wrote: Hello, I like the concept of own avalon components in cocoon very very well. So I only work with flowscripts and avalon components but very seldom with actions or xsp. I think, the concept flowscript + avalon component is the future way to integrate logic into a cocoon app. But in my opnion there are a bunsh of disadvantages creating avalon-components in cocoon: 1.) Why it is necessary to extract the cocoon.roles from the cocoon.jar to register the components? It is not necesssary. You can either make your own roles.file and indicate that in cocoon.xconf like: or just use the full component descriptor as you'll find some in that form in the cocoon.xconf: Oh, fine. I didn't knew about this. For me at the first time I had done this, it has looked like a change on the whole cocoon archticture and not a simple integration of a logic component. I think its not clear why do so. It looks like this is not the suggested way to intregate business logic. But it is, isn't it? My suggestion: The cocoon.roles should be situated in the classes folder, not in the cocoon.jar or better in WEB-INF beside the cocoon.xconf aso. No. the cocoon.roles file is a private one for cocoon only. If you are in need of your own write as mentioned above. 2.) Its very hard to create independent components for customers. What I mean is: Using a component in flowscript is relativley simple (the customer is able to use this;-) but creating a component can be very hard and complex. So it's possible that a new market place grows up in which avalon-components for cocoon will be created and distributed (Mailer-Component, DB-Component, aso.). But moving a component from one cocoon-app to another cocoon-app can be very hard, too (4 steps and more for moving are to much). So it should not be necessary to register all roles in the same roles.cocoon and configure it in the same cocoon.xconf. In my opinion the best way would be to distribute a new component as jar which has its on "cocoon.roles" and "cocoon.xconf" in it. Cocoon should "mount" these config files at startup. The disatvantage of this order is, that the "real" config files are separated from the one in the components jar. But cocoon should look at startup into the real cocoon.roles and cocoon.xconf. Is the role already registered and configured there, this configurations will be used. Otherwise the configurations from the jar will be used. Have you read about the Blocks comming with version 2.2 (http://wiki.cocoondev.org/Wiki.jsp?page=Blocks)? No I'am sorry. But now I had read some parts of it. It looks really good and seems to solve my problem in future. PS: Is there a timeline avaibale when 2.2 wille be approx released? In 2004? Thank you. Stephan
[Suggestion] Making components easier to distribute
Hello, I like the concept of own avalon components in cocoon very very well. So I only work with flowscripts and avalon components but very seldom with actions or xsp. I think, the concept flowscript + avalon component is the future way to integrate logic into a cocoon app. But in my opnion there are a bunsh of disadvantages creating avalon-components in cocoon: 1.) Why it is necessary to extract the cocoon.roles from the cocoon.jar to register the components? For me at the first time I had done this, it has looked like a change on the whole cocoon archticture and not a simple integration of a logic component. I think its not clear why do so. It looks like this is not the suggested way to intregate business logic. But it is, isn't it? My suggestion: The cocoon.roles should be situated in the classes folder, not in the cocoon.jar or better in WEB-INF beside the cocoon.xconf aso. 2.) Its very hard to create independent components for customers. What I mean is: Using a component in flowscript is relativley simple (the customer is able to use this;-) but creating a component can be very hard and complex. So it's possible that a new market place grows up in which avalon-components for cocoon will be created and distributed (Mailer-Component, DB-Component, aso.). But moving a component from one cocoon-app to another cocoon-app can be very hard, too (4 steps and more for moving are to much). So it should not be necessary to register all roles in the same roles.cocoon and configure it in the same cocoon.xconf. In my opinion the best way would be to distribute a new component as jar which has its on "cocoon.roles" and "cocoon.xconf" in it. Cocoon should "mount" these config files at startup. The disatvantage of this order is, that the "real" config files are separated from the one in the components jar. But cocoon should look at startup into the real cocoon.roles and cocoon.xconf. Is the role already registered and configured there, this configurations will be used. Otherwise the configurations from the jar will be used. What do you think about these suggestions? Regards Stephan
Re: Passing request params to a flowscript thru a resource?
Geoff Howard wrote: Stephan Coboos wrote: Hello, because I've got no answer for my question postet in the users list before, I will try it on the dev list... I have the following sitemap fragment: ... ... In the match section I'm calling the resource 'main' which is calling a flowscript function itself. But if I do that this way I don't have access to the request params in the flowscript because cocoon.request... returns nothing! How do I activate passing request parameters thru resources to a flowscript? Can you explain why you would need to do this? The example you've given above is pointless AFAICS. Geoff Hello Geoff, yes, I can explain it for you. I'm writing a simple cms. In this cms it is possible to surf arround the entire websites and when the customer wants to edit a page he has to click the edit button situated on top on the page if he is logged in. The whole cms is organized by only one central flowscript which checks for login, recievies the values from the database via components and makes other things. The status of the flowscript must be valid during the user is logged. So I have written two simple actions: The first sets the actual continuation id to the session and the second one extracts the continuation id from the session. At this way, no need is necessary to change the url's on the webpage to forward the continuation id. But to call the two actions I need to call resource every time before the flowscript is called and before the response is sent to the client: ... ... All works fine! Only the request returns everytime null when I'm calling the function "cms" this way. If I call the function directly in the match block, the request works and returns the correkt values! Regards Stephan
Re: Passing request params to a flowscript thru a resource?
Carlos Chávez wrote: Stephan Coboos Escribio :-) Hello, because I've got no answer for my question postet in the users list before, I will try it on the dev list... I have the following sitemap fragment: ... ... In the match section I'm calling the resource 'main' which is calling a flowscript function itself. But if I do that this way I don't have access to the request params in the flowscript because cocoon.request... returns nothing! Hi, Stephan try in flowcript this: var parameter = cocoon.parameters["parameter from sitemap"] Cheers, How do I activate passing request parameters thru resources to a flowscript? Thank you. Regards Stephan Hello Carlos, so I have to use the request module to pass the request parameters? Or what do you mean? Thank you. Stephan
Passing request params to a flowscript thru a resource?
Hello, because I've got no answer for my question postet in the users list before, I will try it on the dev list... I have the following sitemap fragment: ... ... In the match section I'm calling the resource 'main' which is calling a flowscript function itself. But if I do that this way I don't have access to the request params in the flowscript because cocoon.request... returns nothing! How do I activate passing request parameters thru resources to a flowscript? Thank you. Regards Stephan
Re: Moving error-handlers to map:pipelines?
Sorry, now it works... Havent read the hierachy description on the docs. The error-handler of the sub-sitemap is evaluated first. Thank you. Regards Stephan - Original Message - From: "Stephan Coboos" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, November 17, 2003 9:17 AM Subject: Moving error-handlers to map:pipelines? > Hello, > > why not place the element of the main sitemap into > ? Now it is situated in . Therefore it is not > possible to define own error pipelines in a sub-sitemap, because the > "main-error-handler" is the first matching handler in all cases. > > Regards > Stephan >
Moving error-handlers to map:pipelines?
Hello, why not place the element of the main sitemap into ? Now it is situated in . Therefore it is not possible to define own error pipelines in a sub-sitemap, because the "main-error-handler" is the first matching handler in all cases. Regards Stephan
Making a reader cacheble?
Hello cocoon experts, what are the differences between making a reader or another sitemap component like transformer aso. cacheable? I've seen that both type of components implementing the CacheableProcessingComponent interface. For what is the method getLastModified on a reader necessary? Thank you. Regards Stephan
CIncludeTransformer now with sitemap params?
Hello, because I needed a CIncludeTransformer which is able to include dynamically resources, I had modificated the CIncludeTransformer a little bit. Now its possible to pass sitemap parameters to the transformer. Within the src attribute the variable will be replaced by the value of the parameter. Does anyone need this feature, too? For example: somefile.xml: <...:include src="cocoon:/{filename}"/> pipeline: ... ... Result: <...:include src="cocoon:/myFile.xml"/> Regards Stephan
Re: [suggestion] Method getParameterMap in Request?
- Original Message - From: "Carsten Ziegeler" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, October 24, 2003 2:28 PM Subject: RE: [suggestion] Method getParameterMap in Request? > Stephan Coboos wrote: > > > What do you think of adding a static helper method somewhere? > > > > If no getParameterMap method exists, I have to implement such a method > > myself. > > > Yes, and you can send a patch that we can apply and then it exists > officially. Static or "normal"? Regards Stephan
Re: [suggestion] Method getParameterMap in Request?
- Original Message - From: "Carsten Ziegeler" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, October 24, 2003 8:18 AM Subject: RE: [suggestion] Method getParameterMap in Request? > I'm not very happy about changing our Request interface. The information > you need to get a parameter map is already in the Request object. > You can get all parameter names and all values for one parameter. Yes, of course. But I think it is a little bit uncomfortable... but was just an idea because in J2EE this method exist, too. > What do you think of adding a static helper method somewhere? If no getParameterMap method exists, I have to implement such a method myself. Thank you. Regards Stephan
Re: [suggestion] Method getParameterMap in Request?
- Original Message - From: "Ugo Cei" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, October 23, 2003 9:11 PM Subject: Re: [suggestion] Method getParameterMap in Request? > Stephan Coboos wrote: > > in my opnion it would be nice to have a method like getParameterMap() from > > Servlet programming which returns all request parameters as name value pairs > > in a hash map. This method should reside in interface > > org.cocoon.apache.environment.Request oder http.HttpRequest. > > Unfortunately it is possible to have more than one value for a single > parameter. Yes. In Servlet programming, too. Here, a string array would returned. Here is a snipplet from the J2EE javadoc: Returns: an immutable java.util.Map containing parameter names as keys and parameter values as map values. The keys in the parameter map are of type String. The values in the parameter map are of type String array. It would be possible and standarized ;-)) Thank you. Regards Stephan
[suggestion] Method getParameterMap in Request?
Hello, in my opnion it would be nice to have a method like getParameterMap() from Servlet programming which returns all request parameters as name value pairs in a hash map. This method should reside in interface org.cocoon.apache.environment.Request oder http.HttpRequest. Do you agree with me? Thank you. Regards Stephan