How to set the configuration area dynamically? [message #334239] |
Wed, 28 January 2009 10:36  |
Eclipse User |
|
|
|
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 #334269 is a reply to message #334261] |
Fri, 30 January 2009 01:46  |
Eclipse User |
|
|
|
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
|
|
|
Powered by
FUDForum. Page generated in 0.04024 seconds