Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » work with read only data location(cannot write .metadata when data location is read only)
work with read only data location [message #496166] Mon, 09 November 2009 09:05 Go to next message
Stella Levin is currently offline Stella LevinFriend
Messages: 89
Registered: July 2009
Member
Hi, we develop rpc application, it is used primary to display/debug purposes. Several users may want to see the same data location directory (-data <dir>, org.instance.area). The problem is how to change location of .metadata file. I tried to put in config file:
osgi.instance.area.readOnly=true
but is seems do nothing. When the data directory is read only it fails with
IllegalStageException The platform metadata area could not be written ...
Any clue will be appreciated. Thanks.
Re: work with read only data location [message #496180 is a reply to message #496166] Mon, 09 November 2009 09:56 Go to previous messageGo to next message
T. Wilhelm is currently offline T. WilhelmFriend
Messages: 129
Registered: July 2009
Senior Member
Hi,

you can set it programatically in your Application.java:

Location instanceLoc = Platform.getInstanceLocation();
if (!instanceLoc.isSet()) {
    instanceLoc.set(new URL(
                    "file", null, System.getProperty("user.home") + "\\MyApplication"), 
                    false);
}


This snippet sets the location to your user.home/MyApplication Folder. You can change that of course.

Important that you add the parameter -data @noDefault, otherwise the location will be set automatically and once it is set it cant be changed.

Greetz,
Thomas
Re: work with read only data location [message #496183 is a reply to message #496180] Mon, 09 November 2009 10:16 Go to previous messageGo to next message
Stella Levin is currently offline Stella LevinFriend
Messages: 89
Registered: July 2009
Member
Thanks a lot for reply. Your snippet works. The problem is that I want to see the data location in one directory (it is used by multiple users) and create .metadata file in other directory (for every user in $HOME/.metadata). Is it possible?
Re: work with read only data location [message #496188 is a reply to message #496183] Mon, 09 November 2009 10:23 Go to previous messageGo to next message
T. Wilhelm is currently offline T. WilhelmFriend
Messages: 129
Registered: July 2009
Senior Member
Hey Bella-Stella Very Happy ,

lol sorry for that. Rolling Eyes

Do you mean that you want to define your "workspace" in a different folder than your metafile? Or what do you mean with data location?

Maybe you can have a look at

Platform.getUserLocation();


maybe this is what you mean by data location?

Greetz
Thomas
Re: work with read only data location [message #496194 is a reply to message #496188] Mon, 09 November 2009 10:34 Go to previous messageGo to next message
Stella Levin is currently offline Stella LevinFriend
Messages: 89
Registered: July 2009
Member
Hi Thomas, by data location I mean usage of -data <dir> or the equivalent osgi.instanse.area. By default the project is placed in the same directory as .metadata file. So I search a way to tell to application to create .metadata in other directory than project is. Thanks.
Re: work with read only data location [message #496197 is a reply to message #496194] Mon, 09 November 2009 10:43 Go to previous messageGo to next message
T. Wilhelm is currently offline T. WilhelmFriend
Messages: 129
Registered: July 2009
Senior Member
Ok, i dont know if that is possible, maybe you can find something here:

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

Anyway i wondering why you dont try to place your project somewhere else instead of changing the folder for the metadata.... isn´t it easier?

Greetz,
Thomas
Re: work with read only data location [message #496225 is a reply to message #496197] Mon, 09 November 2009 12:00 Go to previous message
Stella Levin is currently offline Stella LevinFriend
Messages: 89
Registered: July 2009
Member
Thanks, I already read runtime options in help. The usage is as follows:
- the script creates data in certain location
- user starts the rcp application with given location, the application defines the project programmatically for this data
- the application creates .metadata file for the user
- other time other user also wants to see the data, the user starts the application - he cannot update .metadata, created by the first user
looks, it is not solvable in standard way
Previous Topic:Single Model, TreeViewer, Databinding POJO, automatic update
Next Topic:Email through "Program.launch"
Goto Forum:
  


Current Time: Thu Apr 25 13:19:29 GMT 2024

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

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

Back to the top