hi mathew,
Am Montag, 2. Mai 2005 18:19 schrieb Matthew Ceroni:
> Quick question about CForms (since the example on cocoon.apache.org doesn't
> seem complete).
>
> I am using Cocoon 2.1.
>
> The example on the website sets up the main pipeline as such.
>
> <map:match pattern="registration-display-pipeline">
> <map:generate src="forms/registration_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>
>
> My question is, how does this pipeline know what model file to use. (since
> it only specifies the template).
surely you find something like
<map:flow language="javascript">
<map:script src="cont/useradm.js"/>
</map:flow>
in your sitemap. look at this code. you will find included something like
cocoon.load("resource://org/apache/cocoon/forms/flow/javascript/v2/Form.js");
look at this file. there you will find a function called handleForm.
the pipeline you found is called by the flowscript function. you get to the
pipeline using something like
<map:match pattern="handle-*">
<map:call function="handleForm">
<map:parameter name="function" value="getAdminForms"/>
<map:parameter name="form-definition"
value="xml/newuser-forms-definition.xml"/>
<map:parameter name="documentURI"
value="cocoon:/get-{1}-data"/>
<map:parameter name="bindingURI"
value="xml/newuser_bind_xml.xml"/>
</map:call>
</map:match>
you will find it in your sitemap.
in this example the function getAdminForms is called by the flow. look at your
function in the flowscript you registered by <map:flow .....> for function
which is called in your pipeline.
model file name is given to the function by the parameter form-definition.
hth
beate
--
þíþí
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]