[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [orion-dev] plugin with extension point
|
John,
Here's code I'm using with the Dojo 1.7 loader to bootstrap Orion. I'm
loading Orion and my app (maqetta) from the same domain.
<script>
var dojoConfig = {parseOnLoad: true,
paths:{'orion': '../../../orion', 'preview':
'../preview', 'system':'../system'},
cacheBust: '@revision@'}
</script>
<script type="text/javascript" src=
"/maqetta/app/dojo/dojo.js?@revision@" ></script><script>
define("text", ["dojo/text"], function(t){return t;});
require(['orion/serviceregistry', 'orion/preferences',
'orion/pluginregistry', "dijit/dijit", "davinci/davinci-common",
"davinci/davinci"],
function (mServiceregistry, mPreferences, mPluginRegistry,
mCommands) {
var serviceRegistry = new mServiceregistry.ServiceRegistry
();
// This is code to ensure the first visit to orion
works
// we read settings and wait for the plugin
registry to fully startup before continuing
var preferenceService = new
mPreferences.PreferencesService(serviceRegistry, "/prefs/user");
var pluginRegistry;
preferenceService.getPreferences("/plugins").then(
function() {
pluginRegistry = new mPluginRegistry.PluginRegistry
(serviceRegistry);
dojo.addOnWindowUnload(function() {
pluginRegistry.shutdown();
});
return pluginRegistry.startup();
});
var allReferences = serviceRegistry.getServiceReferences(
"orion.core.file");
});
</script>
Thanks,
Brad Childs
IBM Software Group
Emerging Internet Technology / Browser Technology Center
Office: (512)-286-5681
Cell: (512)-569-5816
|------------>
| From: |
|------------>
>--------------------------------------------------------------------------------------------------------------------------------------------------|
|John J Barton <johnjbarton@xxxxxxxxxxxxxxx> |
>--------------------------------------------------------------------------------------------------------------------------------------------------|
|------------>
| To: |
|------------>
>--------------------------------------------------------------------------------------------------------------------------------------------------|
|Orion developer discussions <orion-dev@xxxxxxxxxxx> |
>--------------------------------------------------------------------------------------------------------------------------------------------------|
|------------>
| Date: |
|------------>
>--------------------------------------------------------------------------------------------------------------------------------------------------|
|01/26/2012 03:20 PM |
>--------------------------------------------------------------------------------------------------------------------------------------------------|
|------------>
| Subject: |
|------------>
>--------------------------------------------------------------------------------------------------------------------------------------------------|
|Re: [orion-dev] plugin with extension point |
>--------------------------------------------------------------------------------------------------------------------------------------------------|
On Thu, Jan 26, 2012 at 11:44 AM, Simon Kaegi <Simon_Kaegi@xxxxxxxxxx>
wrote:
>
> Inception? (But should work as I tried a variation on this a few years
ago)
? Sorry I don't know, is this a question?
>
>
> So... yes, sounds like you're on the right track.
>
> You'll probably need to use AMD for the pluginregistry and
serviceregistry so take a look at bootstrap.js for help starting up
correctly.
Well bootstrap seems to create and return these things:
// initialize service registry and EAS services
var serviceRegistry = new
mServiceregistry.ServiceRegistry();
....
return {
serviceRegistry:
serviceRegistry,
preferences: preferences,
pluginRegistry:
pluginRegistry
};
So should I require bootstrap? I guess somehow the registry in my
plugin will be synced with the page?
>
>
> The plugin provider is not currently using AMD so although you can
"require" it and get it loaded as a script you reference it as a global
object. instead of giving it a local name.
>
> -Simon
>
_______________________________________________
orion-dev mailing list
orion-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/orion-dev