Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Orion » How to add "pre-installed" plugins?
How to add "pre-installed" plugins? [message #877879] Mon, 28 May 2012 01:21 Go to next message
Rafael Chaves is currently offline Rafael Chaves
Messages: 22
Registered: April 2012
Junior Member
I am going to host my own instance of Orion. How do I extend Orion so my own plugins are pre-installed for any user accounts (just like Authentication, File Client, Jslint etc)?

Thanks,

Rafael
Re: How to add "pre-installed" plugins? [message #877948 is a reply to message #877879] Mon, 28 May 2012 06:20 Go to previous messageGo to next message
Rafael Chaves is currently offline Rafael Chaves
Messages: 22
Registered: April 2012
Junior Member
So far, I am suspecting the pre-installed plugins are baked in Orion by virtue of being part of the org.eclipse.orion.client.core bundle web/plugins directory.

If that is correct, I could as a workaround just add my plugin to that location post install as a file system link. But that wouldn't cut it, as my plugin makes HTTP requests and I believe same-origin policy requires me to publish it from the same server it sends requests to.
Re: How to add "pre-installed" plugins? [message #877952 is a reply to message #877948] Mon, 28 May 2012 06:37 Go to previous messageGo to next message
Rafael Chaves is currently offline Rafael Chaves
Messages: 22
Registered: April 2012
Junior Member
Hah, it seems the defaults.pref file determines what plugins are loaded by default, and it does accept any plugin URL, I was wrong about bundled plugins having to be part of the Orion distro.

For now, I will get by with modifying that file (while I am there, I will remove the plugins I don't need). Any more civilized way of modifying the list of installed plugins (that would survive an Orion reinstall, for instance)?
Re: How to add "pre-installed" plugins? [message #878068 is a reply to message #877952] Mon, 28 May 2012 13:01 Go to previous messageGo to next message
John Arthorne is currently offline John Arthorne
Messages: 174
Registered: July 2009
Senior Member
You've got it. The defaults.pref is the only way we currently configure the default set of installed plugins. I have entered a bug for finding a nicer way to do this on the server:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=380809
Re: How to add "pre-installed" plugins? [message #880249 is a reply to message #878068] Fri, 01 June 2012 17:53 Go to previous messageGo to next message
Leo R is currently offline Leo R
Messages: 5
Registered: August 2011
Junior Member
In case you still want to deploy something that would otherwise conflict with the same-origin policy,
this is a description on how to provide a separate bundle that runs in the same domain as Orion does.

(Everything just as far as I understand it. Maybe there is a better way)

For that you need to modify the server.configurator bundle.
Its plugin.xml defines which bundle's folder gets loaded to what url path.
Of course, if you want to load your plugin at startup you would still have to modify the defaults.pref.

Let's say you have the following bundle structure

com.corp.myplugin (bundle id equals project root name)
|_ web 
    |_ html,js files
    |_ myplugindefinition.html


In the server.configurator bundle you need to add some configuration code to its plugin.xml.

First you have to add an addtional httpcontext to the httpcontexts extension:

<extension point="org.eclipse.equinox.http.registry.httpcontexts">
      <httpcontext
            id="org.eclipse.orion.server.configurator.httpcontext.myplugin">
         <resource-mapping
               bundle="com.corp.myplugin"
               path="/web">
         </resource-mapping>
      </httpcontext>
      ... other httpcontexts ...
</extension>


And finally you need to define to which path the http context is supposed to be delivered

   <extension
         point="org.eclipse.equinox.http.registry.resources">
      <resource
            alias="/myplugin"
            httpcontextId="org.eclipse.orion.server.configurator.httpcontext.myplugin">
      </resource>
      .....
   </extension>


On the next restart the embedded Jetty Server should deploy the content of your plugin's web folder to
http: //oriondomain/myplugin

[Updated on: Fri, 01 June 2012 17:55]

Report message to a moderator

Re: How to add "pre-installed" plugins? [message #1065100 is a reply to message #880249] Mon, 24 June 2013 11:32 Go to previous message
Pankaj Dhoolia is currently offline Pankaj Dhoolia
Messages: 2
Registered: June 2013
Junior Member
Leo,
I followed the process you outlined to pre-install a plugin.
Apparently, the plugin's content is not accessible at "http://{oriondomain}/{myplugin}
Are there any additional changes required?
thanks.
Previous Topic:Deploying jar file to Orion
Next Topic:How do i build an Orion Product for a platform
Goto Forum:
  


Current Time: Mon Sep 22 00:21:24 GMT 2014

Powered by FUDForum. Page generated in 0.02392 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software