Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » How to set the configuration area dynamically?
How to set the configuration area dynamically? [message #334239] Wed, 28 January 2009 15:36 Go to next message
Daniel Krügler is currently offline Daniel KrüglerFriend
Messages: 853
Registered: July 2009
Senior Member
Hello,

among our product family we have a requirement that
special program files/folders are located at dedicated
locations. These locations cannot be computed via
variables defined by the Eclipse runtime options
(e.g. @user.home is not sufficient). I could use
System.getenv(), but this would require a "callback" for
dynamically setting the configuration, something what
we already do for the instance location (-data/osgi.instance.area).

Does there exist an official "callback" at a time during RCP startup,
where it is not too late to specify the location of the configuration area?

For instance locations, @noDefault seems to be no problem,
but the documentation for the configuration area locations
implies that it is basically impossible to do so for configuration
area's of usual RCP app's.

I wonder how other RCP applications solve this problem, because
under restricted user policies in modern OS's it's a No-No to
write data into the program install area (which is where the
default configuration area will be located).

Thanks in advance,

Daniel Krügler
Re: How to set the configuration area dynamically? [message #334261 is a reply to message #334239] Thu, 29 January 2009 16:56 Go to previous messageGo to next message
Marcus Ludvigson is currently offline Marcus LudvigsonFriend
Messages: 6
Registered: July 2009
Junior Member
Daniel Krügler wrote:
>
> I wonder how other RCP applications solve this problem, because
> under restricted user policies in modern OS's it's a No-No to
> write data into the program install area (which is where the
> default configuration area will be located).
>

Hi,

I use osgi.instance.area=@noDefault in config.ini and in my (heavily
stripped below) IApplication:

public Object start(IApplicationContext context) throws Exception {

Location instanceLoc = Platform.getInstanceLocation();
URL workspaceUrl = getNewWorkspaceURL();
instanceLoc.set(workspaceUrl, true);

PlatformUI.createAndRunWorkbench(..)
}

Regards,
Marcus Ludvigson
Re: How to set the configuration area dynamically? [message #334269 is a reply to message #334261] Fri, 30 January 2009 06:46 Go to previous message
Daniel Krügler is currently offline Daniel KrüglerFriend
Messages: 853
Registered: July 2009
Senior Member
Marcus Ludvigson wrote:
> Daniel Krügler wrote:
>>
>> I wonder how other RCP applications solve this problem, because
>> under restricted user policies in modern OS's it's a No-No to
>> write data into the program install area (which is where the
>> default configuration area will be located).
>>
>
> I use osgi.instance.area=@noDefault in config.ini and in my (heavily
> stripped below) IApplication:
>
> public Object start(IApplicationContext context) throws Exception {
>
> Location instanceLoc = Platform.getInstanceLocation();
> URL workspaceUrl = getNewWorkspaceURL();
> instanceLoc.set(workspaceUrl, true);
>
> PlatformUI.createAndRunWorkbench(..)
> }

I apologize, if my text caused a misunderstanding: My question is
how I can set dynamically the location of the *configuration* area,
not that of the instance location (which I also already do).

The explanations given in

http://help.eclipse.org/ganymede/index.jsp?topic=/org.eclips e.platform.doc.isv/reference/misc/runtime-options.html#locat ions

(Sorry, it seems that the reference to "locations" cannot be resolved by
the browser, so you need to go manually to section titled "Locations"
near to the end of the document)

implies that it is basically impossible to change the location of the
configuration area for non-trivial ("real rich") RCP applications.

In your snippet-example it would be necessary to change

Location instanceLoc = Platform.getInstanceLocation();

to

Location instanceLoc = Platform.getConfigurationLocation();

but the comment of parameter

osgi.configuration.area=@noDefault

is daunting...

Thanks for your help,

Daniel
Previous Topic:RCP dev - how to handle plugin.jars ?
Next Topic:setting the a Console active programmatically in the Console view
Goto Forum:
  


Current Time: Fri Apr 19 20:58:25 GMT 2024

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

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

Back to the top