Hi Nicolas,

I think you are missing some code here ... you can't call a function like
form2xml with a parameter from a pipeline. I think there must have been some
kind of function called "handleForm" which has a look at a parameter called
"function" and then calls that providing a form object. Well it's a guess,
because the function that cocoon is calling is called "handleForm".

Chris

[ c h r i s t o f e r   d u t z ]

IT-Berater
univativ GmbH & Co. KG
Robert-Bosch-Str. 7, 64293 Darmstadt

fon: 0 61 51 / 66 717 - 21
fax: 0 61 51 / 66 717 - 29
email: [EMAIL PROTECTED]
http://www.univativ.de

Darmstadt, Stuttgart, Karlsruhe, Düsseldorf


-----Ursprüngliche Nachricht-----
Von: news [mailto:[EMAIL PROTECTED] Im Auftrag von Nicolas Duroc
Gesendet: Mittwoch, 7. Juni 2006 15:10
An: [email protected]
Betreff: Re: AW: repeaterLoop in repeater-rows


I'm pretty beginner in Cocoon, I used the blocks sample of binding XML of 
Cocoon, and the usefull part of sitemap is :

     <map:match pattern="form2xml.flow">
       <map:call function="handleForm">
         <map:parameter name="function" value="form2xml"/>
         <map:parameter name="definitionURI" value="forms/form2_model.xml"/>
         <map:parameter name="documentURI" value="forms/form2_data.xml"/>
         <map:parameter name="bindingURI" value="forms/form2_bind_xml.xml"/>
       </map:call>
     </map:match>

     <map:match pattern="*-display-pipeline">
       <map:generate src="forms/{1}_template.xml"/>
       <map:transform type="forms" label="content1"/>
       <map:transform type="i18n">
         <!--map:parameter name="locale" value="en-US"/-->
       </map:transform>
       <map:call resource="simple-page2html">
         <map:parameter name="file" value="forms/{1}_template.xml"/>
       </map:call>
       <map:transform src="resources/forms-samples-styling.xsl">
         <map:parameter name="resources-uri" 
value="{request:contextPath}/_cocoon/resources"/>
       </map:transform>
       <map:transform type="i18n">
       </map:transform>
       <map:serialize/>
     </map:match>


/* part of binding_example.js */
function form2xml(form) {
    // get the documentURI parameter from the sitemap which contains the
    // location of the file to be edited
    var documentURI = cocoon.parameters["documentURI"];

    // parse the document to a DOM-tree
    var document = loadDocument(documentURI);

    // bind the document data to the form
    form.load(document);

    // show the form to the user until it is validated successfully
    form.showForm("form2-display-pipeline");

    // bind the form's data back to the document
    form.save(document);

    // save the DOM-tree back to an XML file, the makeTargetURI
    // function makes a modified filename so that the
    // original document is not overwritten
    saveDocument(document, makeTargetURI(documentURI));

    cocoon.sendPage("form2-success-pipeline");
}


I launch the page form2xml.flow and if I did well understand, it calls the 
form2xml function, who shows the "form2-display-pipeline" page. In the 
sitemap, the map matchs it, and generates from the "forms/{1}_template.xml" 
(with my repeaterLoop), pass so through some transformers (which applies 
template "translating" the CForms into "Classic Forms", and serializes it.

I don't know where is the problem with the forms transformer.

Thanks in advance

Regards,

Nicolas Duroc


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to