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.
Related
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.
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"/>
We have got path based vulnerability issues in Qualys report. I have gone through stackoverflow questions like this one and configured useDefaultSuffixPattern as false as shown below.
I am still able to load the page with /about.anything even though in controller I have given as #RequestMapping(value = "/about")
Is there any other configuration we need to update to stop this from happening?
<bean
class="org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping">
<property name="order" value="0" />
<!-- Set whether to register paths using the default suffix pattern as
well: i.e. whether "/users" should be registered as "/users.*" and "/users/"
too. Default is "true". Turn this convention off if you intend to interpret
your #RequestMapping paths strictly. Note that paths which include a ".xxx"
suffix or end with "/" already will not be transformed using the default
suffix pattern in any case. -->
<property name="useDefaultSuffixPattern" value="false" />
<property name="pathMatcher" ref="pathMatcher" />
</bean>
We are using hybris 1811 version
This might be happening because of an inherent bug in Spring where it ignores everything after the dot(.) in the URL.
To resolve this you must create the path variable pattern for GET call in your controller more rigid.
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.
I have one application running on tomcat sever.I removed the path in in server.xml so i am able to access the application like
http://localhost:8080/login.xhtml
I am using Pretty faces as well for URL rewrite.
Now i want to know how to send a request to server like
http://localhost:8080
so that it should display my login page.
My pretty-config.xml is
<url-mapping id="login">
<pattern value="/" />
<view-id value="/login.xhtml" />
</url-mapping>
it is not working.please let me know the solution.
Your pretty-config part (which is valid) tells that a path / should be mapped to /login.xhtml and may be referred to as pretty:login in outcomes of JSF components (as well as in action methods).
From here there are two possible options for inconsistencies:
Prettyfaces must be pointed to a valid URL, meaning that FacesServlet mapping in web.xml should be *.xhtml in your case, not faces/*, not *.jsf, etc.
Prettyfaces should be used appropriately in your JSF components. For instance, <h:link outcome="pretty:login" value="Home" /> will render an HTML a element with the value / (which will internally show login.xhtml when you click on it).
Also, it would be helpful to read the excellent PrettyFaces documentation.