|
Hi,
I am a beginer with Orbeon forms and I have a specific requirement that I couldn't implement so far. The requirement is that when the user presses the Send button, the form data is first saved into our database (in our business tables), the inserts are validated and after that, if no error occures, the form is saved.
Here is what I've done so far:
1. I built an SQL Processor that I saved into orbeon\WEB-INF\resources\forms\Test\MyProcessor.xpl.
2. I verified that my processor is working by calling it directly from my form with an action triggered by a button
<xf:action ev:event="DOMActivate" if="true()" ev:observer="but-insert-sql-processor-control"> <xf:insert ref="instance('my-processor-response-instance')"
origin="xxf:call-xpl('oxf:/forms/Test/MyProcessor.xpl', 'instance' ,instance('fr-form-instance'), 'data' )"/> </xf:action>
3. I added a custom button using properties in properties.local.xml file:
<property as="xs:string" name="oxf.fr.detail.buttons.Test.*"
value="save-draft pdf button-sql"/> <property
as="xs:string"
name="oxf.fr.resource.Test.*.en.detail.buttons.button-sql"
value="<i class='icon-ok-sign'/> Send"/>
<property
as="xs:string"
name="oxf.fr.detail.process.button-sql.Test.*"
value='require-valid
then validate
then confirm(message="Are you sure you want to submit your form?")
then suspend
then process("oxf:/forms/Test/MyProcessor.xpl")
then send
then success-message(message = "Your form has been saved!")
recover error-message(message = "There was an error saving the data!")'/>
My processor isn't called this way. How do I need to call my processor? Is there additional configuration that I need to do?
Is this the good approach for my requirement? Can you point me to an online resource that explains how to do this?
I'm using Orbeon Forms 4.5 PE.
Thank you.
|