Orbeon forms builder with MS SQL - orbeon

I lose all form data and get an error saying error performing search when I set the following property in Orbeon Form Builder properties - local.xml file
<property as="xs:string" name="oxf.fr.persistence.provider.*.*.*" value="sqlserver"/>
Can someone please help me?

Related

Orbeon Forms: Initial data posted to the New Form page through XML POST

For a Proof of Concept we are trying to prefill a Orbeon Form field when it loads for the user. The documentation on the Orbeon website states that such an action is possible when adding a additional POST payload to the call of the form-instance (“…/new?form-version=1”). We followed the guide on the Orbeon website (https://doc.orbeon.com/configuration/properties/form-runner/form-runner-detail-page#initial-data-posted-to-the-new-form-page), but whatever we try, the field is never prefilled in the page once loaded (or within the HTML we get back from the call in Windows Powershell.
What are we doing wrong in our example? Or is this simply not yet possible in the current version over Orbeon Forms?
In order to test the scenario we installed Orbeon on a VM-instance within our IT-landscape. Additionally we enabled the POST-methods on the forms (https://doc.orbeon.com/xml-platform/controller/authorization-of-pages-and-services#backward-compatibility).
We then made a very simple form in the Form Builder, with just one field to fill, and published the form so that is could be called through the “…/new”-url of the Form Runner.
Orbeon Form example with empty field
Orbeon Form field description/properties
To access the Form with a payload we used PowerShell. Based on the documentation we tried a number of different approaches and XML-payloads, but non resulted in the field within the Form to be filled with the included value on load.
Below you can see one of the commands/payloads we tried:
$uri="http://##URL##/orbeon/fr/Test_PowerShell/Test_Powershell_prefilled_Formfield/new?form-version=1"$xmlbody = #"<form><section-1><grid-1><control-1-Powershell><xforms-input-1>NEWNEW</xforms-input-1></control-1-Powershell></grid-1></section-1></form>"#$encodedBase64 = [System.Convert]::ToBase64String($xmlbody.ToCharArray())$body = #"<form method="post" action="/path/to/new"><input type="hidden" name="fr-form-data" value=$encodedBase64 /></form>"#
$callresponse = Invoke-WebRequest -uri $uri -Method POST -body $body
$callresponse.content
As you can see below, the response of the call itself doesn’t contain any problems… just not the expected result of the field filled with the new value.
XML POST call response
Hope someone can help and explain what we are doing wrong.
Thanks in advance!
I would suggest you do the following to check that you can get this working on a verbatim install of Orbeon Forms:
Download the latest Orbeon Forms PE.
Unzip the archive, unzip the orbeon.war into an orbeon directory, move it to your Tomcat's webapps.
Rename orbeon/WEB-INF/resources/config/properties-local.xml.template to remove the .template, edit the file, and add the 2 properties below.
<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"/>
Create a form in Form Builder, and in Edit Source paste the form.xml from this gist. Publish it.
Save the data.xml from that gist. From the command line, run: curl -X POST -H "Content-Type: application/xml" -d #data.xml http://localhost:8080/orbeon/fr/a/a/new > new.html
Open new.html in an editor, and search for "Homer". You should be able to find it as the value of an input field.
Once this is working for you with a verbatim install, you can look into what is different in your actual environment that could explain the difference you are seeing. And of course, feel free to comment here should you have any questions.

Orbeon Form - Is there anyway to disallow download attachment by default?

I found a useful document about it: https://doc.orbeon.com/form-runner/component/attachment
Therefore I did a similar approach, I added this line in properties-local.xml:
<property as="xs:string" name="oxg.xforms.xbl.fr.attachment.allow-download" value="false"/>
but it doesn't work. When I created Form Builder and added attachment, the setting still marked allow download.
I think that you just have a typo. Try the following (with the property name starting with oxf instead of org). I've tried this locally and it is working for me.
<property
as="xs:string"
name="oxf.xforms.xbl.fr.attachment.allow-download"
value="false"/>

Trying to get form data as XML via REST API

It should be a simple thing and it probably is, but I'm not achieving to get the XML data of a draft form via the REST API described in the Orbeon docs.
I did the following changes to the properties-local-dev.xml file:
<property
as="xs:string"
processor-name="oxf:page-flow"
name="page-public-methods"
value="GET HEAD POST"/>
<property
as="xs:string"
processor-name="oxf:page-flow"
name="service-public-methods"
value="GET HEAD"/>
<property
as="xs:anyURI"
name="oxf.fr.persistence.exist.exist-uri"
value="/exist/rest/db/orbeon/fr"/>
<page public-methods="GET HEAD POST" view="view.xpl"/>
<service public-methods="GET HEAD" view="view.xpl"/>
Then I tried different URL's to call the data:
http://localhost:9090/orbeon/exist/rest/db/orbeon/fr/gsmn/hello-world/draft/f025a471b2c8452dd65267cc5886063d995757f5/data.xml
http://localhost:9090/orbeon/crud/gsmn/hello-world/draft/f025a471b2c8452dd65267cc5886063d995757f5/data.xml
http://localhost:9090/orbeon/fr/service/persistence/crud/gsmn/hello-world/draft/f025a471b2c8452dd65267cc5886063d995757f5/data.xml
Form Runner resides on :
http://localhost:9090/orbeon/fr/
Is there something obvious I'm missing?
Thanks
Noel
Assuming your app name is gsmn and your form name is hello-world, then the last URL you mentioned (copied below for clarity), should work.
http://localhost:9090/orbeon/fr/service/persistence/crud/gsmn/hello-world/draft/92aad35a44876b3bfac3b4d6f835130fbd1fe19e/data.xml
However, most likely, the issue is that you're trying this with eXist, and that, as of this writing, the autosave functionality isn't supported by Orbeon Forms on eXist; it is only supported on relational databases. For more on this, see the support matrix for different databases, and the RFE to add support for autosave on eXist.

Orbeon - Email Properties

I want to sent the document id of orbeon form to my email body, therefore I added the following property in my properties-local.xml file
<property as="xs:string" name="oxf.fr.resource.*.*.en.email.body" value="{xxf:document-id()}"/> but this will just display {xxf:document-id()} in my email body, need help please.....
This is not a feature yet. There is an RFE for it.

JSF 2.0 h:datatable not using supplied id attribute

I'm observing the following behavior within a JSF 2 page (Mojarra 2.1.18 / RedHat EAP 6.1, if that's useful). I've got a form wrapping a data table, and I'm supplying an ID attribute value for both the form and the table. When I view the resulting html source file, I see that the table ID is set to an auto-generated value and the form ID attribute is not prepended to the auto-generated table ID. That is:
This set of tags:
<h:form id="form4">
<h:datatable id="notices" ...>
...
</h:datatable>
</h:form>
Yields the following html:
<form id="form4" ...>
<table id="j_itd68"> //i.e. id != "notices"
...
</table>
</form>
There are more elements in the JSF xhtml file preceding the h:form/h:datatable, but I've intentionally excluded them here (hoping that someone might recognize this symptom without additional clutter). Things go wrong for me when I attempt to include some PrimeFaces p:commandbutton instances within the table. They don't get named properly (i.e. they don't include the enclosing form ID in the generated ID), and this causes a "component not found for ID" servlet error. The same improper naming occurs if I replace the p:commandbutton instances with h:commandbutton instances (so I don't believe this is a PrimeFaces issue). This behavior seems like the result of a malformed JSF page, but I haven't found anything yet (a NetBeans XML check on the JSF xhtml file returns a successful result). Any help is appreciated.
Best regards,
-Andy

Resources