You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by "Arsen A. Gutsal" <ar...@softsky.com.ua> on 2005/02/24 17:09:57 UTC

CForms Binding

Hello list.
I'm using cocoon 2.1.6, and js file for very simple flow taken from
cocoon samples:

function processForm() {
		form.createBinding(bindingURI);
		var document = loadDocument(documentURI);
		form.load(document);
		form.showForm(formPipeline);

		form.save(document);
		saveDocument(document, documentURI);
		
		java.lang.System.err.println("FORM POSTED");
		cocoon.sendPage(formName + "-success-pipeline");
}

loadDocument and saveDocument are also functions taken from cocoon
samples.
But I would like to save form data somewhere to database rather then
disk file.
I guess that somehow I should send form data to another pipe and this
pipe could easily execute database update code (e.g. xindice xml file).

Can anyone explain me the easiest and most strict way to do that?
 

-- 
Sincerely,
Arsen A. Gutsal
SOFTSKY Ltd CEO/Executive
SOFTSKY - Cost effective Software Development


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


Re: CForms Binding

Posted by "Arsen A. Gutsal" <ar...@softsky.com.ua>.
Whell, it works fine now.
Anyway - I'm not really sure how to INSERT or UPDATE records.

Means, that I have context like:
<fb:context
		xmlns:fb="http://apache.org/cocoon/forms/1.0#binding"
		xmlns:fd="http://apache.org/cocoon/forms/1.0#definition"
		path="customers/customer">
....

And I would like either INSERT record (new customer) or UPDATE existing
(I guess I should specify some XPath for fb:context node like
path="customers/customer[@id = someid]"

Any help would be appreciated.
 
On Thu, 2005-02-24 at 16:13 +0000, Upayavira wrote:
> Arsen A. Gutsal wrote:
> > Hello list.
> > I'm using cocoon 2.1.6, and js file for very simple flow taken from
> > cocoon samples:
> > 
> > function processForm() {
> > 		form.createBinding(bindingURI);
> > 		var document = loadDocument(documentURI);
> > 		form.load(document);
> > 		form.showForm(formPipeline);
> > 
> > 		form.save(document);
> > 		saveDocument(document, documentURI);
> > 		
> > 		java.lang.System.err.println("FORM POSTED");
> > 		cocoon.sendPage(formName + "-success-pipeline");
> > }
> > 
> > loadDocument and saveDocument are also functions taken from cocoon
> > samples.
> > But I would like to save form data somewhere to database rather then
> > disk file.
> > I guess that somehow I should send form data to another pipe and this
> > pipe could easily execute database update code (e.g. xindice xml file).
> 
> If xindice document is your chosen destination, then just have 
> documentURI be an xmldb URL. You can bind both ways directly to an XMLDB 
> source with the code you've got.
> 
> Regards, Upayavira
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
> 
> 
-- 
Sincerely,
Arsen A. Gutsal
SOFTSKY CEO/Executive
mailto:arsen@softsky.com.ua


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


Re: CForms Binding

Posted by Upayavira <uv...@upaya.co.uk>.
Arsen A. Gutsal wrote:
> Hello list.
> I'm using cocoon 2.1.6, and js file for very simple flow taken from
> cocoon samples:
> 
> function processForm() {
> 		form.createBinding(bindingURI);
> 		var document = loadDocument(documentURI);
> 		form.load(document);
> 		form.showForm(formPipeline);
> 
> 		form.save(document);
> 		saveDocument(document, documentURI);
> 		
> 		java.lang.System.err.println("FORM POSTED");
> 		cocoon.sendPage(formName + "-success-pipeline");
> }
> 
> loadDocument and saveDocument are also functions taken from cocoon
> samples.
> But I would like to save form data somewhere to database rather then
> disk file.
> I guess that somehow I should send form data to another pipe and this
> pipe could easily execute database update code (e.g. xindice xml file).

If xindice document is your chosen destination, then just have 
documentURI be an xmldb URL. You can bind both ways directly to an XMLDB 
source with the code you've got.

Regards, Upayavira


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