Dan McCreary
Dan McCreary

Reputation: 411

Best way to use Orbeon as a REST service

I have a set of XForms already running within eXist-db that are automatically generated by an XQuery. Is there any way form me to call a REST service, supplied by Orbeon, running on a separate tomcat server, that will convert the XForms files into HTML that I can display in a web browser?

In other words I would like to do something like:

xquery version "1.0";
...
let $my-xforms-file := local:my-generate-xforms($spec-file)
let $orbeon-rendered-xforms := httpclient:post('http://localhost/tomcat/orbeon/getpost',  $my-xforms-file)
return $html-file

What I want is really just a render conversion service for XForms that gets an HTTP POST with the XForms in the document body and it returns something that I can render with a web browser.

Is there a component to do this already built into Orbeon? I am glad to document this, provide an XQuery module to support it and share with others.

Upvotes: 1

Views: 405

Answers (1)

Dan McCreary
Dan McCreary

Reputation: 411

There is a REST service for using the Orbeon forms runner, but it uses HTTP GET, not HTTP POST.

The service is offered as part of the forms runner "Sandbox" Here is a sample:

If you have Tomcat running on port 8081 (not the default) and eXist running on port 8080 then the following will work:

http://localhost:8081/orbeon/xforms-sandbox/run?url=http://localhost:8080/exist/apps/grants/orbeon-tests/01-min.xml

The sandbox also has a way to get the data from a file system

You can't get to form runner standbox from the menus. To get there you have to manually put the following URL into your browser:

http://localhost:8081/orbeon/xforms-sandbox/

Upvotes: 4

Related Questions