Dimitrios Menounos
Dimitrios Menounos

Reputation: 555

Orbeon 4.1 custom REST persistence

I have been struggling for over a week with trying to setup a custom ORBEON REST persistence.

I am using the Struts 2 MVC framework with the following configuration:

<action name="/crud/{appName}/{formName}/form/form.xhtml" class="com.example.CrudController" method="executeForm" />

<action name="/crud/{appName}/{formName}/data/{uuid}/data.xml" class="com.example.CrudController" method="executeData" />

<action name="/search/{appName}/{formName}" class="com.example.SearchController" />

The problem is that only the first action is being called.

From the Form Builder, when I click on a form record (say "foo"), this is called:

GET http://localhost:8080/mycontext/app/crud/myapp/library/form/form.xhtml

Notice that, myapp is the correct application name but library is not the correct form name (which should be "foo").

From Form Runner, when I try the "foo" summary or new pages, this is called:

GET http://localhost:8080/mycontext/app/crud/myapp/foo/form/form.xhtml

This time the form name is correct, however I expected a /search/... call instead. Nevertheless I tried responding with either the xform xml or a query result with no success.

Upvotes: 0

Views: 417

Answers (1)

avernet
avernet

Reputation: 31753

The call to /crud/myapp/library/form/form.xhtml is normal: it isn't done by Form Runner to load your form, but to load your app-specific section templates library, which is stored in the reserved library form name. So most likely your implementation of the persistence API should return a 404, since it doesn't have a form myapp/library.

As to the query to /crud/myapp/foo/form/form.xhtml when you access the new page for a myapp/foo, this is just Form Runner loading the form definition for myapp/foo. The query to the search API is only done by the summary page, to list data for a specific form.

Upvotes: 1

Related Questions