Orbeon - Email Properties - orbeon

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.

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: Disable form fields after clicking "Submit"

I'm trying to configure "Send" process to set all fields to readonly, but it didn't work. Here is my configuration in properties.xml:
<property as="xs:string" name="oxf.fr.detail.process.send.*.*">
require-valid
then save
then success-message("save-success")
then xf:setvalue(ref = "//*[xf:readonly]", value = "true()")
</property>
Thanks for all suggestions!
You cannot set the "readonly-ness", in an imperative imperative way, with a xf:setvalue. Instead, the "readonly-ness" is define in a declarative way. In your case, I would recommend that:
When the form is submitted, you change the stage of the form, say to "submitted". In your process, you can do so with (doc):
set-workflow-stage(name = "submitted")
In Form Builder, you use a form level formula (doc) to declare that the whole form is readonly if the stage is "submitted". The formula will look like:
fr:workflow-stage-value() = 'submitted'
Also see the blog post New workflow capabilities in Orbeon Forms 2020.1.

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 forms builder with MS SQL

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?

Formatting hyperlink as a picture in a custom list schema

In my custom list XML I added a few URL fields. one of them has to be displayed as a picture just like when you select "Format URL as: Picture" in the fields settings of the UI.
In the customList's schema.xml I haven't found any place where to override the html markup for a URL type.
Any help or clue is welcome :)
Thanks,
teebot
Try changing the Format property of the relevant fields xml Schema.
Get a copy of SharePoint Manager to try it.
<Field ID="{c29e077d-f466-4d8e-8bbe-72b66c5f205c}" Name="URL"
SourceID="http://schemas.microsoft.com/sharepoint/v3" StaticName="URL"
Group="Base Columns" Type="URL" DisplayName="URL" ColName="nvarchar3"
RowOrdinal="0" ColName2="nvarchar4" RowOrdinal2="0" Format="Image" Version="1" />

Resources