You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Matthew Ceroni <ce...@hotmail.com> on 2005/05/02 18:19:00 UTC

CForms Help

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).

Thanks



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


Re: CForms Help

Posted by beatejung <be...@online.de>.
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: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: CForms Help

Posted by Sebastien Arbogast <se...@gmail.com>.
2005/5/2, Matthew Ceroni <ce...@hotmail.com>:
> 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).

I'm not quite sure but it seems logical to me.
It's because when you call this pipeline from flowscript you have
already created the form using the form definition :

var form = new Form("my_definition.xml");
form.showForm("registration-display-pipeline");

And the link between both the definition and the template is
maintained through that call to showForm.

-- 
Sebastien ARBOGAST

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