Re: CForms -Bind to 2 Separate Sources -Solved

2005-03-06 Thread Peter Sparkes
Thanks for your help, its working now. I used  Jorg's bean method to 
partially prepopulate a form with data from an XML file and save the 
data from the completed form to XMLDB

Regards
Peter Sparkes
Hi,
Help please
I wish to bind to a XML file to generate a form and then send the 
data in the completed form to a database without updating the 
original XML file. I can't work out how to extract the data from the 
completed form so that I can update the database.
Mark Lundquist wrote:
I'm not quite sure I get the idea... is it to prepopulate a form from 
XML data?

If so, here's how I would go about it:
// Parse the XML into a bean.  This bean is really a kind of Data 
Transfer Object (DTO).
// .
// .
// .
// then:
//
form.load  (theBean);
form.showForm (whatever);
form.save (theBean);
//
// Finally, pass the bean to your model layer which updates the 
database.

Jorg Heymans wrote:

Have a look at [1], more specifically the direction attribute. In your 
binding, you can specify where the data should be loaded from and 
where the data should be saved to. So you load from your XML and you 
save to a different bean that you then persist. Should be fairly 
straightforward I believe.

Your question wasn't that clear though, hope i understood you right.
HTH
Jorg
[1] http://cocoon.apache.org/2.1/userdocs/forms/binding.html

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


CForms -Bind to 2 Separate Sources

2005-03-02 Thread Peter Sparkes
Hi,
Help please
I wish to bind to a XML file to generate a form and then send the data 
in the completed form to a database without updating the original XML 
file. I can't work out how to extract the data from the completed form 
so that I can update the database.

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


Re: CForms -Bind to 2 Separate Sources

2005-03-02 Thread Mark Lundquist
Hi Peter,
On Mar 2, 2005, at 12:19 AM, Peter Sparkes wrote:
Hi,
Help please
I wish to bind to a XML file to generate a form and then send the data 
in the completed form to a database without updating the original XML 
file. I can't work out how to extract the data from the completed form 
so that I can update the database.
I'm not quite sure I get the idea... is it to prepopulate a form from 
XML data?

If so, here's how I would go about it:
	// Parse the XML into a bean.  This bean is really a kind of Data 
Transfer Object (DTO).
	// 	.
	// 	.
	// 	.
	// then:
	//
	form.load  (theBean);
	form.showForm (whatever);
	form.save (theBean);
	//
	// Finally, pass the bean to your model layer which updates the 
database.

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


Re: CForms -Bind to 2 Separate Sources

2005-03-02 Thread Jorg Heymans
Have a look at [1], more specifically the direction attribute. In your 
binding, you can specify where the data should be loaded from and where 
the data should be saved to. So you load from your XML and you save to a 
different bean that you then persist. Should be fairly straightforward I 
believe.

Your question wasn't that clear though, hope i understood you right.
HTH
Jorg
[1] http://cocoon.apache.org/2.1/userdocs/forms/binding.html
Peter Sparkes wrote:
Hi,
Help please
I wish to bind to a XML file to generate a form and then send the data 
in the completed form to a database without updating the original XML 
file. I can't work out how to extract the data from the completed form 
so that I can update the database.

Thanks
Peter Sparkes

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