Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [udig-devel] Reloading .umap files

So this is a little tricky.  What you need to do is call:

project.eResource().unload();

What this does is walk through all the children of project( and project) and turns them all into proxies so that when they are accessed again they are reloaded.  The problem is that the reloaded objects are new objects so if any objects retain references to the old projects, maps, layers, etc... they will be referencing the wrong objects.  What I suggest is that you close all editors to maps within that project before unloading the project, then unload the project...  I suppose there could be a problem though since the maps try to save the project when being closed,  seems like that would overwrite the changes.

Thinking....

The easy way for me is for you to change you program so that you have a central repository and get copies from the repository and run uDig on those copies instead of directly against the repository projects.  Especially since you are bound to have read/write conflicts if you are directly hacking the repository.  Might be a good plan for you anyhow.  So how it might work is you can close your maps, unload the project, get a new copy and then re-open you maps and project.

Otherwise I think I would have to put in make a change so that you can turn off autosaving is a preference that can be turned off.  But if I do that then when would things be saved?  I guess you would have to implement that yourself and manage all the read/write transactions to the repository anyhow.  So maybe the suggestion is the least amount of work for both of us...  

I'm open to suggestions.

Jesse

On 11-May-06, at 6:16 AM, M.S.Bachler wrote:

Hi!

As part of my use of uDig, people are sharing .umap files (now I have uniquely named them).

If a user downloads a .umap file it overwrite the local file fine.

Q 1) But how to I get uDig to reload the .umap file it is using in its project (eObject - structure etc), and redraw the map / Project View / Layer View etc to reflect any changes in the newly downloaded file?

Any pointers for this would be great as I have a feeling it will not be straight forward.

If the downloaded file does not exist, I want to import it into the current project.
Q 2) How would I do that?

Thanks

Michelle

_______________________________________________
User-friendly Desktop Internet GIS (uDig)


Back to the top