cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chris Clark" <Chris.Cl...@teranet.ca>
Subject RE: JXForms dynamic flowscript problem
Date Wed, 30 Jul 2003 18:00:26 GMT
I'm not an expert at JXForms, but I've spent the last week figuring out most of it and documenting
it for internal purposes.  Here's some basics:

- You need one <map:match> for the initial request (m1).  This calls the Cocoon jxform
which, in turn, calls your flowscript.  Your script calls sendView(uri) which gets picked
up by a second matcher (m2)  

- The id passed to jxform must match the id in the <xf:form> tag.  

- The submit button must have an action that is identical to the original request (m1).

- The script should have a structure with one variable per field.  As far as I can tell, the
"ref" attribute and variable names must be identical.

If you want to use schematron, there's a few more relationship rules.

> -----Original Message-----
> From:	Tuomo L [SMTP:tlesonen@cc.hut.fi]
> Sent:	Wednesday, July 30, 2003 1:50 PM
> To:	users@cocoon.apache.org
> Subject:	RE: JXForms dynamic flowscript problem
> 
> Well, after changing <map:call function="jxForm"> to
>                                            ^
> <map:call function="jxform">, I'm getting this:
> 
> Original Exception: java.lang.ClassCastException
> 	at
> org.apache.cocoon.components.jxforms.flow.javascript.JXForm.getCocoon(JXForm.java:80)
> 	at
> org.apache.cocoon.components.jxforms.flow.javascript.JXForm.jsFunction_makeWebContinuation(JXForm.java:202)
> 	at inv6.invoke()
> 	at
> org.mozilla.javascript.FunctionObject.doInvoke(FunctionObject.java:523)
> 	at
> org.mozilla.javascript.FunctionObject.call(FunctionObject.java:438)
> 	at
> org.mozilla.javascript.ScriptRuntime.call(ScriptRuntime.java:1244)
> 	at
> org.mozilla.javascript.continuations.ContinuationInterpreter.interpret(ContinuationInterpreter.java:1104)
> 	at
> org.mozilla.javascript.continuations.ContinuationInterpreter.interpret(ContinuationInterpreter.java:190)
> 	at
> org.mozilla.javascript.continuations.ContinuationInterpreter.interpret(ContinuationInterpreter.java:138)
> 	at
> org.mozilla.javascript.continuations.InterpretedFunctionImpl.call(InterpretedFunctionImpl.java:121)
> 	at
> org.mozilla.javascript.ScriptRuntime.call(ScriptRuntime.java:1244)
> 	at
> org.apache.cocoon.components.flow.javascript.JavaScriptInterpreter.callFunction(JavaScriptInterpreter.java:583)
> 	at
> org.apache.cocoon.components.treeprocessor.sitemap.CallFunctionNode.invoke(CallFunctionNode.java:196)
> 	at
> org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:84)
> 	at
> org.apache.cocoon.components.treeprocessor.sitemap.PreparableMatchNode.invoke(PreparableMatchNode.java:164)
> 	at
> org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:108)
> 	at
> org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invoke(PipelineNode.java:164)
> 	at
> org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:108)
> 	at
> org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode.invoke(PipelinesNode.java:161)
> 	at
> org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:327)
> 	at
> org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:309)
> 	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:164)
> 	at
> org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:108)
> 	at
> org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invoke(PipelineNode.java:164)
> 	at
> org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:108)>

> 	at
> org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode.invoke(PipelinesNode.java:161)
> 	at
> org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:327)
> 	at
> org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:309)
> 	at org.apache.cocoon.Cocoon.process(Cocoon.java:621)
> 	at
> org.apache.cocoon.servlet.CocoonServlet.service(CocoonServlet.java:1088)
> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> 	at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
> 	at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
> 	at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
> 	at
> org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
> 	at
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
> 	at
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
> 	at
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
> 	at
> org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
> 	at
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
> 	at
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
> 	at
> org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415)
> 	at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
> 	at
> org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
> 	at
> org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
> 	at
> org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
> 	at
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
> 	at
> org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
> 	at
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
> 	at
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
> 	at
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
> 	at
> org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
> 	at
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
> 	at
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
> 	at
> org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
> 	at
> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:594)
> 	at
> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:392)
> 	at
> org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565)
> 	at
> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:619)
> 	at java.lang.Thread.run(Thread.java:536)
> 
> Here's the generated flow-script:
> 
> //*******************
> cocoon.load("resource://org/apache/cocoon/components/jxforms/flow/javascript/JXForm.js");
> 
> function wizard(form) {
>   var model = {
>     lastname: "foo",
>     firstname: "foo",
>     speciality_id: 0,
>     title: "foo",
>     phone: "foo",
>     last_edited: "foo"
>   };
> 
>   form.setModel(model);
>   form.sendView("forms/foo/bar.html");
> }
> //*******************
> 
> I admit, I'm not pretty confident about that script... Where's the
> documentation for flow and JXForms? Is there any?
> 
> -Tuomo
> 
> On Wed, 30 Jul 2003, Chris Clark wrote:
> 
> > I had this "apply is not a function" error just yesterday.
> > In my case, I had forgotten to put an entry for my script in the <map:flow ...>
section.  Once I added my script there, it fixed it.  Could it be that Cocoon just won't allow
a URI there--that it has to be a physical file?> 
> >
> > > -----Original Message-----
> > > From:	Tuomo L [SMTP:tlesonen@cc.hut.fi]
> > > Sent:	Wednesday, July 30, 2003 1:02 PM
> > > To:	users@cocoon.apache.org
> > > Subject:	JXForms dynamic flowscript problem
> > >
> > > Hi,
> > >
> > > I'm trying to get JXForms + flow  working using a dynamic
> > > javascript-resource by
> > > transforming an xml-file with a stylesheet and serializing with the
> > > TextSerializer
> > > (mime-type="text/javascript").
> > >
> > > The following error occurs: apply in not a function.
> > >
> > > In sitemap I have:
> > >
> > > <map:serializers default="html">
> > >   <map:serializer name="javascript" src="org.apache.cocoon.serialization.TextSerializer"
mime-type="text/javascript" logger="sitemap.serializer.text"/>
> > > </map:serializers>
> > >
> > > and:
> > >
> > > <map:flow language="JavaScript">
> > >   <map:script src="cocoon:/flow.js"/>
> > > </map:flow>
> > >
> > > and:
> > >
> > > <map:match pattern="flow.js">
> > >   <map:generate src="flow-info.xml"/>
> > >   <map:transform src="stylesheets/flow2js.xsl">
> > >     <map:parameter name="foo" value="{request-param:bar}"/>
> > >   </map:transform>
> > >   <map:serialize type="javascript"/>
> > > </map:match>
> > >
> > > What could cause this?
> > >
> > > -Tuomo
> > >
> > > Original Exception: TypeError: apply is not a function.
> > > (resource://org/apache/cocoon/components/flow/javascript/system.js; line
> > > 17)
> > > 	at
> > > org.mozilla.javascript.NativeGlobal.constructError(NativeGlobal.java:581)
> > > 	at
> > > org.mozilla.javascript.NativeGlobal.constructError(NativeGlobal.java:541)
> > > 	at
> > > org.mozilla.javascript.NativeGlobal.typeError1(NativeGlobal.java:551)
> > > 	at
> > > org.mozilla.javascript.ScriptRuntime.call(ScriptRuntime.java:1234)
> > > 	at
> > > org.mozilla.javascript.continuations.ContinuationInterpreter.interpret(ContinuationInterpreter.java:1104)
> > > 	at
> > > org.mozilla.javascript.continuations.ContinuationInterpreter.interpret(ContinuationInterpreter.java:190)
> > > 	at
> > > org.mozilla.javascript.continuations.ContinuationInterpreter.interpret(ContinuationInterpreter.java:138)
> > > 	at
> > > org.mozilla.javascript.continuations.InterpretedFunctionImpl.call(InterpretedFunctionImpl.java:121)
> > > 	at
> > > org.mozilla.javascript.ScriptRuntime.call(ScriptRuntime.java:1244)
> > > 	at
> > > org.apache.cocoon.components.flow.javascript.JavaScriptInterpreter.callFunction(JavaScriptInterpreter.java:583)
> > > 	at
> > > org.apache.cocoon.components.treeprocessor.sitemap.CallFunctionNode.invoke(CallFunctionNode.java:196)
> > > 	at
> > > org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:84)
> > > 	at
> > > org.apache.cocoon.components.treeprocessor.sitemap.PreparableMatchNode.invoke(PreparableMatchNode.java:164)
> > > 	at
> > > org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:108)
> > > 	at
> > > org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invoke(PipelineNode.java:164)
> > > 	at
> > > org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:108)
> > > 	at
> > > org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode.invoke(PipelinesNode.java:161)
> > > 	at
> > > org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:327)
> > > 	at
> > > org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:309)
> > > 	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:164)>

> > > 	at
> > > org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:108)>
> > > 	at
> > > org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invoke(PipelineNode.java:164)
> > > 	at
> > > org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:108)
> > > 	at
> > > org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode.invoke(PipelinesNode.java:161)
> > > 	at
> > > org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:327)
> > > 	at
> > > org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:309)
> > > 	at org.apache.cocoon.Cocoon.process(Cocoon.java:621)
> > > 	at
> > > org.apache.cocoon.servlet.CocoonServlet.service(CocoonServlet.java:1088)
> > > 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> > > 	at
> > > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
> > > 	at
> > > org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
> > > 	at
> > > org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
> > > 	at
> > > org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
> > > 	at
> > > org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
> > > 	at
> > > org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
> > > 	at
> > > org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
> > > 	at
> > > org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
> > > 	at
> > > org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
> > > 	at
> > > org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
> > > 	at
> > > org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415)
> > > 	at
> > > org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
> > > 	at
> > > org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
> > > 	at
> > > org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
> > > 	at
> > > org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
> > > 	at
> > > org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
> > > 	at
> > > org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
> > > 	at
> > > org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
> > > 	at
> > > org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
> > > 	at
> > > org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
> > > 	at
> > > org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
> > > 	at
> > > org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
> > > 	at
> > > org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
> > > 	at
> > > org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
> > > 	at
> > > org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:594)
> > > 	at
> > > org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:392)
> > > 	at
> > > org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565)
> > > 	at
> > > org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:619)
> > > 	at java.lang.Thread.run(Thread.java:536)
> > >
> > >
> > > ---------------------------------------------------------------------> 
> > > To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> > > For additional commands, e-mail: users-help@cocoon.apache.org
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> > For additional commands, e-mail: users-help@cocoon.apache.org
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message