Remote Workspace Preferences Plug-in

Overview

Introduction

The Remote Workspace Preferences Plug-in basically provides functionality to import Eclipse preference files (EPF) from remote locations accessible by HTTP. Besides that it is able to detect new or unconfigured Eclipse workspaces and a simple variable substitution mechanism allows for localization of the preferences.

Workflow

Workflow

The import process consists of three logical steps which are executed for each EPF file sequentially:

The URLs of the EPF files can be configured in the preferences dialog and defaults can be set using an extension point provided in a (fragment) bundle.

Applying Remote Preferences

Manually applying the remote preferences

To manually start the import process run File > Import... from the main menu. Then select General > Remote Preferences.

Remote Preferences Import Wizard

The import wizard has two function modes:

Autodetect unconfigured workspaces

If enabled in the configuration, the plug-in detects unconfigured workspaces during the start-up. It will then show the following dialog giving the user three options.

Creating a Remote Preference File

Create a reference Workspace

Create a reference workspace containing all the preferences as they are supposed to be including the code repository connections. It is recommended to use a separate workspace just for the reason of being the reference for all others. Do not checkout projects or work in this workspace regularly, as this might affect your well crafted reference preferences.

Export the preferences

Export the preferences of the workspace to a file using Eclipse's native export wizard. More information about this step can be found in the Eclipse Documentation.

Postprocess the preference file

There are two reasons for postprocessing the exported (epf) file:

1. Pick only a few settings

The Eclipse preferences export wizard exports all preferences of the workspace. If you just want to import some preferences, you will have to manually edit the epf file and remove all settings you don't want to distribute to other workspaces.

Example:
 
  /instance/org.eclipse.core.resources/encoding=ISO-8859-1

2. Do variable substitutions during the import process

During the import of the preference file, variable substitutions with Java system properties can be made. An example where this might be useful is to set the correct user names in CLASSPATH variables or code repository URLs.

Find the character sequences that shall be set during the import and replace them with the Java system property that shall be inserted instead. Make sure you prepend the system property name with a '$' character.

Example:

  /instance/org.eclipse.jdt.core/org.eclipse.jdt.core.classpathVariable. ↵
    M2_REPO=c\:/Documents and Settings/$user.name/.m2/repository

In this example, the location of the Maven local repository is user dependent and the $user.name of the Eclipse classpath variable M2_REPO will be substituted with the user name set in the Java system property user.name.

Hint: Don't forget to configure the variable replacement in the plug-in's preferences.

Recorder

A very simple preference recorder/differ eases the task of picking the changed settings:

Publish the file on a web server

Publish the epf file on some web server to which all team members have access.

Getting the Configuration Status of a Workspace

The configuration status including the date and time of the last configuration process can be seen in the Configuration Tab of the Installation Details Dialog available from the About Dialog. To open that dialog select Help > About Eclipse SDK, then hit the button Installation Details and finally select the tab Configuration.

Example:

  *** ! Remote Workspace Preferences Import Status:
  Workspace configuration status: configured on 2009-08-10 22:39:15

Preferences

Workspace Preferences

The behavior of the Remote Workspace Preference plug-in can be configured in the Eclipse preferences dialog. Open the dialog from the Window > Preferences menu. The settings are located on the General > Workspace > Remote Preferences page and contain the following options:

Default Settings

There are no built-in default settings, but you may provide them using the extension point ch.netcetera.eclipse.workspace.defaultConfiguration. The extension point supports the following configration elements: