Dear Cocoon list, I'm having some trouble setting up a simple CForms example. I'm following the instructions at http://cocoon.apache.org/2.1/userdocs/forms/sample.html but modifying things cosmetically for my own example.
My problem is, when I try to access anything via the sitemap
that governs my example, the sitemap fails to load, with the
following error:
org.apache.cocoon.ProcessingException:
Failed to load sitemap from file:/c:/Program Files/Apache Group/Tomcat
4.1/webapps/cocoon/mount/gem/test/sitemap.xmap:
org.apache.avalon.framework.configuration.ConfigurationException:
This sitemap contains no control flows defined, cannot call at
file:/c:/Program%20Files/Apache%20Group/Tomcat%204.1/webapps/cocoon/mount/gem/test/sitemap.xmap:28:
54.
Define a control flow using <map:flow>, with embedded <map:script> elements.
It says the sitemap contains no control flows defined, yet I have
one defined just like it's specified in the instructions:
<map:flow language="javascript">
<map:script src="flow/update.js"/>
</map:flow>
(under <map:components>)
My flow/update.js file looks like this:
cocoon.load("resource://org/apache/cocoon/forms/flow/javascript/Form.js");
function update_Linguistic_Subgroup() {
var form = new Form("forms/update-Linguistic_Subgroup.xml");
form.showForm("update-display-pipeline");
var model = form.getModel();
var bizdata = { "LS_name" : model.name }
cocoon.sendPage("update-success-pipeline", bizdata);
}
Could the error above be caused by this update.js file containing
some sort of error and therefore failing to load?
E.g. if Form.js (first line) is not found?
However, sample files like
samples/blocks/forms/flow/registration.js
load the same Form.js, and they have no such problems.
I'll attach several of the files involved, in case it helps.
(update.js is in a "flows" subdirectory. *.xml and *.jx are
in a "forms" subdirectory.)
Thanks for any hints,
Lars
Title: Simple Cocoon Forms test page
Simple Cocoon Forms test page
test form: update a Linguistic Subgroup
Source code:
- Sitemap
- Form definition file - this defines the "widgets" (controls) used in the form, their labels, data types, and validation rules.
- Form template file - this specifies what the presentational skeleton of the form will look like, and what widgets are used where in the form.
- Flow script
<?xml version="1.0" encoding="UTF-8"?> <!-- simple sitemap for testing CForms --> <map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0"> <map:components> <map:generators default="file"/> <map:transformers default="xslt"/> <map:readers default="resource"/> <map:serializers default="html"/> <map:selectors default="browser"/> <map:matchers default="wildcard"/> <map:flow language="javascript"> <map:script src="flow/update.js"/> </map:flow> </map:components> <map:pipelines> <map:pipeline> <map:match pattern=""> <map:read src="index.html" mime-type="text/html" /> </map:match> <map:match pattern="source/**"> <map:read src="{1}" mime-type="text/xml" /> </map:match> <map:match pattern="update"> <map:call function="update_Linguistic_Subgroup"/> </map:match> <map:match pattern="*.continue"> <map:call continuation="{1}"/> </map:match> <map:match pattern="update-display-pipeline"> <map:generate src="forms/update-Linguistic_Subgroup-template.xml"/> <map:transform type="forms"/> <!-- <map:transform type="i18n"> <map:parameter name="locale" value="en-US"/> </map:transform> --> <map:transform src="resources/forms-samples-styling.xsl"/> <map:serialize/> </map:match> <map:match pattern="update-success-pipeline"> <map:generate type="jx" src="forms/update_success.jx"/> <map:serialize/> </map:match> </map:pipeline> </map:pipelines> </map:sitemap>
update.js
Description: Binary data
update_success.jx
Description: Binary data
<?xml version="1.0"?> <!-- test form for updating Linguistic_Subgroup instance --> <fd:form xmlns:fd="http://apache.org/cocoon/forms/1.0#definition" xmlns:i18n="http://apache.org/cocoon/i18n/2.1"> <fd:widgets> <fd:field id="LS_NAME" required="true"> <fd:label>Name:</fd:label> <fd:datatype base="string"> <fd:validation> <fd:length min="2"/> </fd:validation> </fd:datatype> </fd:field> </fd:widgets> </fd:form>
<?xml version="1.0" encoding="UTF-8"?> <html xmlns:ft="http://apache.org/cocoon/forms/1.0#template" xmlns:fi="http://apache.org/cocoon/forms/1.0#instance"> <head> <title>Update Linguistic Subgroup (label)</title> </head> <body> <h1>Update Linguistic Subgroup (label)</h1> <ft:form-template action="#{$continuation/id}.continue" method="POST"> <ft:widget-label id="LS_NAME"/> <ft:widget id="LS_NAME"/> <input type="submit"/> </ft:form-template> </body> </html>
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
