Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 494816

Summary: Ability to disable Sites plugin
Product: [ECD] Orion Reporter: Alexei Alexandrov <alexei.alexandrov>
Component: ServerAssignee: Silenio Quarti <Silenio_Quarti>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: Silenio_Quarti
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Mac OS X   
Whiteboard:

Description Alexei Alexandrov CLA 2016-05-28 01:03:18 EDT
I am running my own instance of Orion server and I'd like to disable the Sites plugin, but it doesn't look like I can do that using default.prefs?  I would like to have a way to disable this plugin using Orion configuration.
Comment 1 Silenio Quarti CLA 2016-06-23 12:05:32 EDT
This can be done by altering the defaults.prefs file. You need to remove the orion plugin (orionSharedWorker.js) and add which individual plugin you want to keep.
Comment 2 Alexei Alexandrov CLA 2016-06-28 01:25:15 EDT
Which of the two default.prefs files should be modified?

./bundles/org.eclipse.orion.client.ui/web/defaults.pref
./modules/orionode/lib/orionode.client/defaults.pref
Comment 3 Silenio Quarti CLA 2016-06-28 08:38:39 EDT
For the java server change:

./bundles/org.eclipse.orion.client.ui/web/defaults.pref

For the node server change:

./modules/orionode/lib/orionode.client/defaults.pref
Comment 4 Alexei Alexandrov CLA 2016-06-28 13:07:23 EDT
I have applied this change below locally.  Then I do "node ./modules/orionode/server.js" and visit localhost:8081 in the browser hitting CMD-SHIFT-R on my Mac to force reload with caching disabled.  But I can still see the Sites button in the vertical bar on the left.  Am I missing something?

diff --git a/modules/orionode/lib/orionode.client/defaults.pref b/modules/orionode/lib/orionode.client/defaults.pref
index f098377..1448c9a 100644
--- a/modules/orionode/lib/orionode.client/defaults.pref
+++ b/modules/orionode/lib/orionode.client/defaults.pref
@@ -1,7 +1,5 @@
 {
        "/plugins":{
-               "plugins/orionSharedWorker.js": true,
-               "git/plugins/gitPlugin.html":true,
                "webtools/plugins/webToolsPlugin.html":true,
                "javascript/plugins/javascriptPlugin.html":true,
                "edit/content/imageViewerPlugin.html":true,
Comment 5 Silenio Quarti CLA 2016-06-28 14:04:57 EDT
Try changing the defaults.pref to the following. Clear cache and clear local storage (localStorage.clear() in the console).
------------
{
	"/plugins":{
		"plugins/fileClientPlugin.html":true,
		"plugins/authenticationPlugin.html":true,
		"plugins/jslintPlugin.html":true,
		"plugins/googleAnalyticsPlugin.html":true,
		"plugins/languageToolsPlugin.html":true,
		"plugins/preferencesPlugin.html":true,
		"plugins/pageLinksPlugin.html":true,
		"plugins/taskPlugin.html":true,
		"plugins/webEditingPlugin.html":true,
		"profile/userservicePlugin.html":true,
		"plugins/helpPlugin.html":true,
		"shell/plugins/shellPagePlugin.html":true,
		"git/plugins/gitPlugin.html":true,
		"webtools/plugins/webToolsPlugin.html":true,
		"javascript/plugins/javascriptPlugin.html":true,
		"edit/content/imageViewerPlugin.html":true,
		"edit/content/jsonEditorPlugin.html":true
	}
}
--------------------
Comment 6 Alexei Alexandrov CLA 2016-06-28 20:39:58 EDT
This seems to work.  Is there a way to force a cleanup of the cached information so that if I change the set of plugins in my installation the users don't have to cleanup their browser state manually?

Another question (I can file another request for this if needed): I am also trying to disable the Shell plugin.  I tried removing the

    "shell/plugins/shellPagePlugin.html":true,

line from the defaults.pref file, but when I do that the UI opens pretty much empty, no directory listing or anything.

Thanks for the help!
Comment 7 Alexei Alexandrov CLA 2016-06-28 20:47:31 EDT
Also, how can I disable the toolbar with deployment actions (such as "Deploy the App from the Workspace" and such)?  Sorry for using this issue as an uber umbrella for these questions, I can split this out.
Comment 8 Silenio Quarti CLA 2016-06-29 10:39:10 EDT
(In reply to Alexei Alexandrov from comment #6)
> This seems to work.  Is there a way to force a cleanup of the cached
> information so that if I change the set of plugins in my installation the
> users don't have to cleanup their browser state manually?
> 

I do not think there is any easy to the automatically clear the local storage in the current implementation, but the local storage plugin cache expires 24 hours. So the end user should eventually see the modification.


> Another question (I can file another request for this if needed): I am also
> trying to disable the Shell plugin.  I tried removing the
> 
>     "shell/plugins/shellPagePlugin.html":true,
> 
> line from the defaults.pref file, but when I do that the UI opens pretty
> much empty, no directory listing or anything.
> 
> Thanks for the help!

This should have worked. Ensure that the plugins have all the services loaded in the settings page (Plugin tab). If there no files in the navigator, it usually means that the file client plugin failed to initialize.  Try reloading the plugins by clicking the Reload All button.
Comment 9 Silenio Quarti CLA 2016-06-29 10:42:37 EDT
(In reply to Alexei Alexandrov from comment #7)
> Also, how can I disable the toolbar with deployment actions (such as "Deploy
> the App from the Workspace" and such)?  Sorry for using this issue as an
> uber umbrella for these questions, I can split this out.

Unfortunately, this can only done by hacking the code. Take a look at

http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/tree/bundles/org.eclipse.orion.client.ui/web/edit/setup.js#n634
Comment 10 Alexei Alexandrov CLA 2016-06-30 11:51:52 EDT
Looks like disabling the shell plugin worked after cleaning everything up.  Thanks!

Regarding the run bar - would it be possible to add a preference property that could be set by default to hide it?  I can send a PR if you are OK with this.
Comment 11 Alexei Alexandrov CLA 2016-07-02 15:27:53 EDT
A friendly ping on my last question.
Comment 12 Silenio Quarti CLA 2016-07-04 10:09:20 EDT
(In reply to Alexei Alexandrov from comment #10)
> Looks like disabling the shell plugin worked after cleaning everything up. 
> Thanks!
> 
> Regarding the run bar - would it be possible to add a preference property
> that could be set by default to hide it?  I can send a PR if you are OK with
> this.

Please open a separate bug for the RunBar preference.
Comment 13 Alexei Alexandrov CLA 2016-07-04 12:07:04 EDT
Filed https://bugs.eclipse.org/bugs/show_bug.cgi?id=497255.

Here is the proposed change: https://github.com/eclipse/orion.client/pull/58
Comment 14 Alexei Alexandrov CLA 2016-07-04 12:15:43 EDT
I also filed https://bugs.eclipse.org/bugs/show_bug.cgi?id=497257 which is one more thing (seemingly last) we want to customize.
Comment 15 Alexei Alexandrov CLA 2016-07-07 20:57:29 EDT
Silenio, just wondering if you had a chance to look at the patch?
Comment 16 Silenio Quarti CLA 2016-07-08 04:21:21 EDT
Sorry, I am not in the office until the end of next week. I will try to find someone else to review it.
Comment 17 Alexei Alexandrov CLA 2016-07-21 12:39:41 EDT
A friendly ping on this.
Comment 18 Silenio Quarti CLA 2016-07-28 10:30:36 EDT
Closing this one since there is no outstanding issue.