MySQL and Persistence REST API

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

MySQL and Persistence REST API

WillemV
Hi,

When running Orbeon using the built-in eXist database it's possible to access the form data through the REST persistence API by invoking:

http://localhost:8080/orbeon/fr/service/persistence/crud/test/test/data/37eb024a1e15f82e8353b2f92747340bfadadb4f/data.xml

after adding the following to properties-local.xml:

<property as="xs:string" processor-name="oxf:page-flow" name="page-public-methods" value="GET HEAD POST PUT DELETE"/>
<property as="xs:string" processor-name="oxf:page-flow" name="service-public-methods" value="GET HEAD POST PUT DELETE"/>

Now we'd like to use MySQL instead of eXist so we've added the following properties:
<property as="xs:string" name="oxf.fr.persistence.provider.*.*.*" value="mysql"/>
<property as="xs:string" name="oxf.fr.persistence.mysql.datasource" value="mysql"/>

and we defined a Resource in tomcat. This is working perfectly fine, except that we're now not able to invoke the persistence API. When I invoke:

http://localhost:8080/orbeon/fr/service/persistence/crud/test/test/data/37eb024a1e15f82e8353b2f92747340bfadadb4f/data.xml
or
http://localhost:8080/orbeon/fr/service/mysql/crud/test/test/data/37eb024a1e15f82e8353b2f92747340bfadadb4f/data.xml

I get a blank screen and a 403 (Forbidden). What am I missing? Is it possible to directly access the data.xml and attachments through the persistence API with MySQL?

Thanks,
Willem

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Reply | Threaded
Open this post in threaded view
|

Re: MySQL and Persistence REST API

Alessandro  Vernet
Administrator
Hi Willem,

First, as a side note, I'd recommend you always call service/persistence, rather than service/mysql, as the former (service/persistence) reaches the persistence proxy which does some work and adds some headers to the request it forwards to the later (service/mysql).

As for the 403, I'm not sure why you would be getting this specifically with MySQL, but not with eXist. What version of Orbeon Forms are you seeing this with? Do you have permissions enabled on the form in Form Builder? If you do, are you still getting the same error if you disable those permissions? (Maybe this is with an older version of Orbeon Forms which didn't support all the permissions checking with eXist?)

Alex

On Fri, Jun 17, 2016 at 7:58 AM, Willem Vermeer <[hidden email]> wrote:
Hi,

When running Orbeon using the built-in eXist database it's possible to access the form data through the REST persistence API by invoking:


after adding the following to properties-local.xml:

<property as="xs:string" processor-name="oxf:page-flow" name="page-public-methods" value="GET HEAD POST PUT DELETE"/>
<property as="xs:string" processor-name="oxf:page-flow" name="service-public-methods" value="GET HEAD POST PUT DELETE"/>

Now we'd like to use MySQL instead of eXist so we've added the following properties:
<property as="xs:string" name="oxf.fr.persistence.provider.*.*.*" value="mysql"/>
<property as="xs:string" name="oxf.fr.persistence.mysql.datasource" value="mysql"/>

and we defined a Resource in tomcat. This is working perfectly fine, except that we're now not able to invoke the persistence API. When I invoke:

http://localhost:8080/orbeon/fr/service/persistence/crud/test/test/data/37eb024a1e15f82e8353b2f92747340bfadadb4f/data.xml
or
http://localhost:8080/orbeon/fr/service/mysql/crud/test/test/data/37eb024a1e15f82e8353b2f92747340bfadadb4f/data.xml

I get a blank screen and a 403 (Forbidden). What am I missing? Is it possible to directly access the data.xml and attachments through the persistence API with MySQL?

Thanks,
Willem

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: MySQL and Persistence REST API

WillemV
Hi Alex,

Thanks for your reply. After some more searching I found out that I had forgotten to define the oxf namespace in properties-local.xml. Without the namespace declaration the following line is silently ignored:

<property as="xs:string" processor-name="oxf:page-flow" name="service-public-methods" value="GET HEAD POST PUT DELETE"/>

I suppose because it cannot resolve oxf:page-flow.

Thanks again for providing a sanity check in your reply.

Best regards,
Willem

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Reply | Threaded
Open this post in threaded view
|

Re: MySQL and Persistence REST API

Alessandro  Vernet
Administrator
Hi Willem,

Got it, and I'm glad you found the solution to this one.

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