Retrieve all form data in XML format - how?

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Retrieve all form data in XML format - how?

WillemV
Hi,

What is the best way to retrieve the form results for a certain Orbeon form as entered by the user?

I'm currently invoking:
<orbeon>/exist/rest/db/orbeon/fr/<appName>/<formName>/data/<id>/data.xml

and this will give me an XML of the format

<form>
    <section-1>
        <control-3/>
        <section-2>
            <acceptAgree>yes</acceptAgree>
        </section-2>
   </section-1>
   <...>
</form>

however this doesn't always seem to work and worse it seems to sometimes produce different results than those seen by inspecting the form through the Orbeon Proxy Portlet which in turn invokes the following URL:

<orbeon>/fr/<appName>/<formName>/view/<id>?orbeon-embeddable=true&userid=...

So what is the best to query Orbeon for form results? We are on 4.0.0.m9.201208080300 CE.

When we use the method described above we sometimes get the following error message:

2012-12-05 13:11:02,331 ERROR XFormsServer  - xforms-submit-error - response {status code: "404"}
2012-12-05 13:11:02,332 ERROR XFormsServer  - xforms-submit-error - response headers {content-type: "text/html", cache-control: "private, max-age=0", expires: "Wed, 05 Dec 2012 1
2:11:02 GMT", last-modified: "Wed, 05 Dec 2012 12:11:02 GMT", content-length: "1168", server: "Apache-Coyote/1.1", date: "Wed, 05 Dec 2012 12:11:02 GMT"}
2012-12-05 13:11:02,332 INFO  ProcessorService  - /fr/service/persistence/crud/Competitions/IV-accept/data/29/data.xml - Timing: 38
2012-12-05 13:11:02,332 ERROR XFormsServer  - xforms-submit-error - setting body string {body: "
<html><head><title>Apache Tomcat/7.0.29 - Error report</title><style><!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-fa mily:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} B ODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma, Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}HR {color : #525D76;}--></style> </head><body>HTTP Status 404 - Documen
t /db/orbeon/fr/Competitions/IV-accept/data/29/data.xml not found<HR size="1" noshade="noshade"><p>type Status report</p><p>message <u>Document /db/orbeon/fr/C
ompetitions/IV-accept/data/29/data.xml not found</u></p><p>description <u>The requested resource (Document /db/orbeon/fr/Competitions/IV-accept/data/29/data.xml not found)
 is not available.</u></p><HR size="1" noshade="noshade">

Apache Tomcat/7.0.29

</body></html>"}
2012-12-05 13:11:02,337 ERROR XFormsServer  - xforms-submit-error - setting throwable {throwable: "
+----------------------------------------------------------------------------------------------------------------------+
|An Error has Occurred                                                                                                 |
|----------------------------------------------------------------------------------------------------------------------|
|xforms:submission for submission id: fr-get-document-submission, error code received when submitting instance: 404    |
|----------------------------------------------------------------------------------------------------------------------|
|Application Call Stack                                                                                                |
|----------------------------------------------------------------------------------------------------------------------|
|----------------------------------------------------------------------------------------------------------------------|
|Exception: org.orbeon.oxf.xforms.submission.XFormsSubmissionException                                                 |
|----------------------------------------------------------------------------------------------------------------------|
|org.orbeon.oxf.xforms.submission.XFormsModelSubmiss|getReplacer                   |XFormsModelSubmission.java    | 713|
|org.orbeon.oxf.xforms.submission.RegularSubmission$|call                          |RegularSubmission.java        |  99|
Reply | Threaded
Open this post in threaded view
|

Re: Retrieve all form data in XML format - how?

WillemV
Found the cause of the problem. On the live environment the internal exist data was taken out of orbeon and installed on a separate server. The first query was still looking at the old internal exist data.
Reply | Threaded
Open this post in threaded view
|

Re: Retrieve all form data in XML format - how?

WillemV
One more question though: on the live environment the configuration is set up exactly as described on this page:
http://wiki.orbeon.com/forms/doc/developer-guide/exist-configuration
so we have a separate exist database in the same tomcat, i.e. http://localhost:8080/orbeon/ and http://localhost:8080/exist/

We changed the file
orbeon/WEB-INF/resources/config/properties-local.xml
and added:
<property as="xs:anyURI" name="oxf.fr.persistence.exist.exist-uri" value="http://orbeon:$PASSWORD@localhost:8080/exist/rest/db/orbeon/fr"/>

So my question is: if I use the URL:
http://localhost:8080/orbeon/exist/rest/db/orbeon/fr/<app>/<form>/data/<id>/data.xml
I will get stale data from the old internal exist database

I can't go to
http://localhost:8080/exist/rest/db/orbeon/fr/<app>/<form>/data/<id>/data.xml
because I then need to specify the username/password of the exist installation.

Is there a way to go through http://localhost:8080/orbeon/ to the external exist database to retrieve the form data?

Thanks,
Willem
Reply | Threaded
Open this post in threaded view
|

Re: Re: Retrieve all form data in XML format - how?

Alessandro  Vernet
Administrator
Hi Willem,

Yes, accessing the Orbeon persistence API directly:
http://localhost:8080/orbeon/exist/rest/db/orbeon/fr/<app>/<form>/data/<id>/data.xml

And note that with 4.0, this API is protected by default, for security; see:
http://wiki.orbeon.com/forms/doc/developer-guide/page-flow-controller/authorization

Alex

On Thu, Dec 6, 2012 at 4:54 AM, WillemV <[hidden email]> wrote:

> One more question though: on the live environment the configuration is set up
> exactly as described on this page:
> http://wiki.orbeon.com/forms/doc/developer-guide/exist-configuration
> so we have a separate exist database in the same tomcat, i.e.
> http://localhost:8080/orbeon/ and http://localhost:8080/exist/
>
> We changed the file
> orbeon/WEB-INF/resources/config/properties-local.xml
> and added:
> <property as="xs:anyURI" name="oxf.fr.persistence.exist.exist-uri"
> value="http://orbeon:$PASSWORD@localhost:8080/exist/rest/db/orbeon/fr"/>
>
> So my question is: if I use the URL:
> http://localhost:8080/orbeon/exist/rest/db/orbeon/fr/<app>/<form>/data/<id>/data.xml
> I will get stale data from the old internal exist database
>
> I can't go to
> http://localhost:8080/exist/rest/db/orbeon/fr/<app>/<form>/data/<id>/data.xml
> because I then need to specify the username/password of the exist
> installation.
>
> Is there a way to go through http://localhost:8080/orbeon/ to the external
> exist database to retrieve the form data?
>
> Thanks,
> Willem
>
>
>
> --
> View this message in context: http://orbeon-forms-ops-users.24843.n4.nabble.com/Retrieve-all-form-data-in-XML-format-how-tp4656075p4656080.html
> Sent from the Orbeon Forms (ops-users) mailing list archive at Nabble.com.
>
>
> --
> You receive this message as a subscriber of the [hidden email] mailing list.
> To unsubscribe: mailto:[hidden email]
> For general help: mailto:[hidden email]?subject=help
> OW2 mailing lists service home page: http://www.ow2.org/wws
>


--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: Re: Retrieve all form data in XML format - how?

WillemV
Hi Alexander,

Thanks for your reply but it's not the answer to my question - maybe I didn't explain myself clearly. I need to know how I can access the exist rest services when exist coexists as a separate web app in the same tomcat.

I.e. I have a tomcat with an /orbeon web app and an /exist web app. /orbeon is aware of /exist and knows the exist username/password. I want to go through /orbeon to retrieve data from /exist without having to specify the same username/password, but how?

Thanks,
Willem
Reply | Threaded
Open this post in threaded view
|

Re: Re: Re: Retrieve all form data in XML format - how?

Alessandro  Vernet
Administrator
Hi Willem,

Then it is very simple: with the embedded eXist, Orbeon stores
documents as guest, so you can access and update documents on the
embedded eXist without any authentication.

And if you're on 4.0, eXist is protected by an Orbeon filter, which
checks the request contains a token provided by Orbeon Forms, to
prevent eXist from being accessible by anyone. See:

http://wiki.orbeon.com/forms/doc/developer-guide/release-notes/40#TOC-Security-of-the-built-in-eXist-database

Alex

On Thu, Dec 6, 2012 at 12:32 PM, WillemV <[hidden email]> wrote:

> Hi Alexander,
>
> Thanks for your reply but it's not the answer to my question - maybe I
> didn't explain myself clearly. I need to know how I can access the exist
> rest services when exist coexists as a separate web app in the same tomcat.
>
> I.e. I have a tomcat with an /orbeon web app and an /exist web app. /orbeon
> is aware of /exist and knows the exist username/password. I want to go
> through /orbeon to retrieve data from /exist without having to specify the
> same username/password, but how?
>
> Thanks,
> Willem
>
>
>
> --
> View this message in context: http://orbeon-forms-ops-users.24843.n4.nabble.com/Retrieve-all-form-data-in-XML-format-how-tp4656075p4656082.html
> Sent from the Orbeon Forms (ops-users) mailing list archive at Nabble.com.
>
>
> --
> You receive this message as a subscriber of the [hidden email] mailing list.
> To unsubscribe: mailto:[hidden email]
> For general help: mailto:[hidden email]?subject=help
> OW2 mailing lists service home page: http://www.ow2.org/wws
>


--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet