How to properly integrate Orbeon with Grails?
Attempting to integrate Orbeon 3.9 CE with Grails 1.3.7, using the recommended separate war deployment approach specified here: http://wiki.orbeon.com/forms/doc/developer-guide/xforms-with-java-applications
After having created the form and viewed in Orbeon Form Builder, I placed the resulting xml in a views/xforms directory under the root of the Grails app and called the file test.gsp
. I also placed the image file for the logo of the form in the same dir开发者_如何学运维ectory. I created a war file and placed in an instance of Tomcat 7 where the orbeon.war
was deployed. When I invoke the test.gsp
, the form comes up sans the image file or any of the labels specified in the XForm!
- Why would all labels not render?
- Where do I place resources such as an image file so that it appears?
Thanks!
I recommend you don't go the route of using Form Builder to generate a form, and copying the source somewhere else. It see 3 main drawbacks:
- Some elements generated by Form Builder are expected to be interpreted by the Form Builder runtime; so they won't be understood by Orbeon Forms when they are generated by your code. I am thinking of
fr:view
,fr:section
and the like. - Form Runner services used for persistence, internationalization, PDF generation… most likely won't work.
- The copy-paste process is by itself not recommendable.
The separate deployment assumes that you're using another framework and that you're going to be writing XForms in a text editor, while Form Builder is targeted at "form authors" (not necessarily developers); it uses its own runtime which requires request to hit Orbeon Forms, that is those URLs starting with /fr
.
All static files, like images must be placed at web-app/*/
dir, and linked by using <g:resource>
tag.
For example, for images you have to put your image ('test.png' for example) into web-app/images/
and use following code in your gsp: <img src="${resource(dir:'/images/settings', file:'test.png')}">
See docs for this tag: http://grails.org/doc/latest/ref/Tags/resource.html
精彩评论