Marc Gille Messages: 16 Registered: May 2011 Location: Frankfurt
Junior Member
I had asked:
I am running a site (let say on localhost:8080) hosting an editor which in turn is accessible from ORION (let say running on localhost:9090) via a corresponding plugin.
This editor requires JS access to the Orion server.
1) Have a copy of the Orion plugin registry loaded in your page
2) Have the file plugin from localhost:9090/plugins/fileClientPlugin.html installed in your PM's plugin registry
3) You then can access the files and their contents using the Orion File Service API - http://wiki.eclipse.org/Orion/Documentation/Developer_Guide/Core_client_services#orion.core.file - the File Client Plugin will handle the Ajax details
Question in turn:
Is there any coding example/documentation on how to do 1.)-3.).
Marc Gille Messages: 16 Registered: May 2011 Location: Frankfurt
Junior Member
I eventually got this working. Here is the approach for everybody who intends to load Orion-managed files from another web application:
Make sure that you can load the transient closure of orion/bootstrap.js (orion.core plugin) into your JS code. I did this with adding the corresponding JS files to a Utility plugin named 'orion' to allow requirejs to resolve dependencies. There may be other, more elegant ways.
Code to load the plugin and retrieve the file is below whereby
* uri is the file URI and
* Utils is a auxiliary class for logging. You may use console.log() instead.