opensubscriber
   Find in this group all groups
 
Unknown more information…

o : ops-users@objectweb.org 2 July 2007 • 4:35AM -0400

[ops-users] Using the REST processors from XForms
by Paul Saxelby

REPLY TO AUTHOR
 
REPLY TO GROUP




Hi all.

Many thanks for the help to date.

The previous problem that I was having with the form data not getting
to the exist database has been solved for the meantime by running the
server on an XP machine instead of a Vista one.
The form now works exactly as I posted it...

My one remaining problem is (I think) just one of using the correct
processor from within XForms.

At the moment the submission is done using:

<xforms:submission id="save-submission"
ref="instance('questionnaires-instance')"
action="/exist/rest/db/orbeon/my-bookcast/books.xml" method="put"
replace="none" >
    <xforms:message ev:event="xforms-submit-error" level="modal">
        An error occurred while saving!
    </xforms:message>
</xforms:submission>


This replaces the entry in the database using REST (I think).
The equivalent calling the XForms submission processor is (I think):

<p:config>
    <p:processor name="oxf:xforms-submission">
        <p:input name="submission">
            <xforms:submission method="put"
action="/exist/rest/db/orbeon/my-bookcast/books.xml"/>
        </p:input>
        <p:input name="request">
            <gaga/>
        </p:input>
        <p:output name="response" id="dummy"/>
    </p:processor>
    <p:processor name="oxf:null-serializer">
        <p:input name="data" href="#dummy"/>
    </p:processor>
</p:config>

(what is the <gaga/> bit?).


Replacing the data is not what I need to do though, I need to add nodes
I have looked through the documentation that I can find on how to do
this, and there's an example in the second style.
The documentation seems to say that each of the examples given can be
done either directly from the XForms, or by calling the XForms
submission processor.


The one I think I need to use is:

<p:processor name="oxf:xmldb-insert">
    <p:input name="datasource" href="datasource.xml"/>
    <p:input name="query">
        <xdb:insert collection="/db/ops/dmv-example"/>
    </p:input>
    <p:input name="data" href="#document-info"/>
</p:processor>

The documentation seems to say that I will also need to set up the datasource:

<!-- For instance, to connect to an embedded eXist, use: -->
<datasource>
    <driver-class-name>org.exist.xmldb.DatabaseImpl</driver-class-name>
    <uri>xmldb:exist:///</uri>
    <username>admin</username>
    <password>admin</password>
</datasource>

I've tried to find some documentation that explains how & where in the
structure of the XForms document to do the above two things, but I
can't find it anywhere.

Does anyone know how to do this please?


Best regards,
Paul


Bookmark with:

Delicious   Digg   reddit   Facebook   StumbleUpon

Related Messages

opensubscriber is not affiliated with the authors of this message nor responsible for its content.