XForm schema validation: resolution of child schema imports - orbeon

I'm interested in using schema-based validation:
<model schema="oxf:..path">
The Orbeon documention currently doesn't have a lot of details about it's use, and in one spot this topic shows up as a "TODO". The schemas we created all have child schemas (certain elements are common to all).
I have a folder structure for the schemas that looks like:
COMMON
xsd
xsd...
schema_A
xsd
<schema_B>
xsd
...
I am putting these schema in a Maven project that generates a jar file of these, and am putting this JAR in "orbeon/web-inf/lib" folder. In the xforms, I have no problems accesing individual files in this JAR (like creating an instance with that as a source).
In the schemas themselves I'm using a relative url that uses "directory up", like this:
<import xmlns="<uri>" "schemaLocation="<uri> ../../COMMON/childSchemaA.xsd">
However, Orbeon doesn't seem to be able to resolve the imports and I get a "Resource not Found" page when I try to use it. In the orbeon log I see that it interprets the location as being in the parent folder, i.e. "schemaA/childSchema.xsd"
Is this a known issue? (I am using the lasT Orbeon 2019 version as the current version does not support rich text controls in XForms). I did a test in which I put the parent schemas and child schemas in the same folder (in the jar file), and validation seems to work as expected.
Is there something that would help orbeon resolve the child schemas? For organization reasons, I don't want to have to have a folder with all of the parent schemas and the child schemas in a single folder. I have another Java web project in which the same JAR file is put on the classpath, and when using the parent schemas for validation there are not any issues.

Related

ORBEON Forms source code

I have imported orbeon war file in my Eclipse IDE and using my war file i have created new forms but i dono where the source code generated for my new forms,
what i have tried is downloaded the war, file and imported into my eclipse IDE using this war file i have created new forms.
and my link is http://orbeon.com/orbeon/fr/orbeon/builder/edit/be0b8be388fc248859fffd0cfb04a237cc8da6a6
anyone please answer me asap,
Thanks in advance.
Form Data and Definitions are stored via the persistence API. For more info look at Form Runner/Form Builder Persistence API.
When you say you have used the war file to create forms - do you mean you have used the Form Buidler interface?
Your link is to the orbeon.com server. Is that correct?

How to alter the scaffolding output folder?

I can't seem to determine if the -Folder option was removed from the MvcScaffolding package for ASP.NET MVC. These two links indicate that it was used for altering the output folder for the items created by the scaffolds:
http://blog.stevensanderson.com/2011/01/13/mvcscaffolding-standard-usage/
How to change project and folder where MvcScaffolding generates controllers, views and repositories
I'm using the Package Manager Console in VS2010 for an MVC3 project. When I try to alter the output folder when scaffolding, say, a repository, there is no -Folder option in the list of options that appear when I enter "-" and press Tab. The options that sound closest to what I need are:
TemplateFolders
OverrideTemplateFolders
PipeOutput
But I can't find good documentation on what these really do either (I tried them but couldn't actually tell what they did). Am I missing something obvious? Thanks!

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 directory. 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

Prevent IIS7/ASP.NET locking directory with images

I have an ASP.NET webapp using the ASP.NET MVC 2 framework. It allows users to upload files to an uploads folder. The issue occurs when an image within a sub-folder is accessed by a web browser:
http://mywebapp/uploads/image_gallery/sub_folder/image.jpg
The uploads folder is static and can't be modified by users, but anything below it is intended to be modifiable.
In the above example, the image_gallery folder becomes locked because w3wp.exe appears to create a handle on the sub_folder directory (using process explorer by sysinternals). I am still able to rename the sub_folder directory and the handle seems to stay with it after a rename, but i can't rename the parent folder (image_gallery in this case).
I can still browse within the folder and view other images and files etc. But can't rename the parent folder.
As this is using the MVC 2 framework i've put in an exclusion for the uploads folder like so:
routes.IgnoreRoute("upload/{*pathInfo}");
into global.asax, so i'm assuming that ASP.NET is serving up those images directly (outside of the MVC framework)
So I guess my question is, is there any way to prevent IIS from putting a handle on specific directories or forcing it to remove a handle? Is the MVC 2 framework doing something tricky even though i have the ignoreroute specified?
Thanks in advance for any tips!
I had the same problem, and after much investigating I've found the culprit:
Web.config
<configuration>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true">
Setting this option (which makes all http modules run on ALL files, static ones included) to false fixed it for me.
I believe, directory handle gets created in worker processor because ASP.NET typically watches the file system for changes - this allows it to respond to change/addition of config files, new dlls etc.
I suggest that you move from the concept that users can control physical directory structure on the web server. Typically, what user can create is an logical directory structure but physical structure would be controlled by your program logic. Your logic will store the logical structure created by user and its mapping with actual physical structure on the web server.

Is it possible to add Grails MVC classes at deployment time?

I'm writing a Grails app which I'd like 3rd parties to augment at runtime. Ideally they would be able to add a JAR/WAR to the webapp directory which contains new domain, controller and service classes, new views, and other content.
Is there a simple way to do this within grails? Would it be simplest to create a startup script which copies the new classes etc. into the relevant directories and then updates grails.xml and web.xml?
You will be able to do this in version 2 of grails in which plugins will be also OSGI plugins http://jira.codehaus.org/browse/GRAILS/fixforversion/15421
It seems that the Grails plugins will actually fit quite well for this: http://www.grails.org/Understanding+Plugins
A plugin can do just about anything... One thing a plugin cannot do though is modify the web-app/WEB-INF/web.xml or web-app/WEB-INF/applicationContext.xml files. A plugin can participate in web.xml generation, but not modify the file or provide a replacement. A plugin can NEVER change the applicationContext.xml file, but can provide runtime bean definitions

Resources