Is there a way I can add these paths to the form builder and runner pages in a way similar to above
So instead of ending up with a path like "/orbeon/3.1415/forms/CPF/assets/scripts/jquery.min.js" I instead have "/imStatic/scripts.jquery.min.js"
var head= document.getElementsByTagName('head');
var jsfiles = ["/imStatic/scripts/jquery.min.js",
for(index=0; index<jsfiles.length; ++index)
var script= document.createElement('script');
This seems to work ok in the simple tests I have done so far.
It would be better if I could just add these to the property file but this will do for now if it works in all cases.
Indeed, paths starting with "/" are taken to be still relative to the Orbeon Forms web app, so the path is rewritten to add the context, and in some case a version so the resources can be aggressively cached by the browser.
Would adding a server name, as in https://myserver/path/to/my.css, work for you? Or we could understand a URI starting with "//" in a special way, but in general it is meant to mean "using the same scheme that was used for the page", so what follows is also a server name, as in //myserver/path/to/my.css. Or would you have some other suggestion on how this could be handled in a better way?
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
My requirement is quite simple as the scripts would always be accessible via the same server URL. So in that case for a form url like http://server:2727/orbeon/fr/...
//imScripts/js/script.js in oxf.fr.js.custom.uri becomes http://server:2727/imScripts/js/script.js
/imScripts/js/script.js in oxf.fr.js.custom.uri becomes http://server:2727/orbeon/3.1415/forms/imScripts/js/script.js
(as it does now)
That would be neat and simple to understand I think. But if you are in there changing the code, allowing a third format with a full URL such as http://otherhost:4545/asite/somejs.js that just goes through untouched might be more generally useful in the long term (but of course XSS restrictions will come into play here).