Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [udig-devel] Path update in Udig project file

I want to have update *.umap Udig file in order to have any user get loaded the maps in his own local path.

Because if a save a project and other person install the program will not get loaded any map since it have old paths from my machine…

I don’t know if I explained myself properly…

 


From: udig-devel-bounces@xxxxxxxxxxxxxxxxxxxxx [mailto:udig-devel-bounces@xxxxxxxxxxxxxxxxxxxxx] On Behalf Of Jesse Eichar
Sent: jueves, 06 de noviembre de 2008 16:02
To: User-friendly Desktop Internet GIS
Subject: Re: [udig-devel] Path update in Udig project file

 

Hi,  You don't want to touch that in any way.  When a map is saved the IGeoResources that the layer uses is saved with all the data required to load the IGeoResource again.  The reasoning is so that you can give a map to another uDig user and have the map be able to be loaded.  The map is saved any time the mapeditor is closed and on shutdown of uDig.  You can trigger a saving by:

 

            Resource resource = ((Map)map).eResource();

        resource.setModified(true);

        resource.save(ProjectPlugin.getPlugin().saveOptions);

        

If you want to change the path of a map or a project do it through Project.eResource and Map.eResource.  But be careful because the ProjectRegistry needs to be able to keep track of the new resource.  So for example if you want to change the resource (save location) of a map you want to do something like:

           

            Resource resource = ((Map)map).eResource();

        Resource newResource = resource.getResourceSet().createResource(URI.createFileURI("/path/projectfile.udig"));

        newResource.getContents().add((EObject) map);

        

I think that will work.  I don't think you need to remove from the old resource because I think that happens automatically.

 

Hope that helps,

 

Jesse

 

On 6-Nov-08, at 3:06 PM, Mario Nuñez Jimenez wrote:



Hello,

Could please someone give any tip about getting decoded XML attribute catalogRef from layers XML element in project udig file (*.umap)

I need to change this path in runtime, so I need to get it, decode it, change it, encode the new one and set again in the XML file.

It looks like this:

 

<layers name="thai_south_counties" catalogRef="%23Tue+Oct+21+17%3A28%3A59+CEST+2008%0D%0Afile_export_version%3D3.0%0D%0A%2Fnet.refractions.udig.project%2Ffile%253A%252FD%253A%252Fshapefiles%252FThailand%252FThailand%2BSouth%2BCounties%2B%2528FIPS%2529%252Fthai_south_counties.shp%2523thai_south_counties%2Ffile%253A%252FD%253A%252Fshapefiles%252FThailand%252FThailand%2BSouth%2BCounties%2B%2528FIPS%2529%252Fthai_south_counties.shp%2Fshapefile%5C+url%2Ftype%3Djava.net.URL%0D%0A%2Fnet.refractions.udig.project%2Ffile%253A%252FD%253A%252Fshapefiles%252FThailand%252FThailand%2BSouth%2BCounties%2B%2528FIPS%2529%252Fthai_south_counties.shp%2523thai_south_counties%2Ffile%253A%252FD%253A%252Fshapefiles%252FThailand%252FThailand%2BSouth%2BCounties%2B%2528FIPS%2529%252Fthai_south_counties.shp%2Fshapefile%5C+url%2Fvalue%3Dfile%253A%252FD%253A%252Fshapefiles%252FThailand%252FThailand%2BSouth%2BCounties%2B%2528FIPS%2529%252Fthai_south_counties.shp%0D%0A%2Fnet.refractions.udig.project%2Ffile%253A%252FD%253A%252Fshapefiles%252FThailand%252FThailand%2BSouth%2BCounties%2B%2528FIPS%2529%252Fthai_south_counties.shp%2523thai_south_counties%2Ffile%253A%252FD%253A%252Fshapefiles%252FThailand%252FThailand%2BSouth%2BCounties%2B%2528FIPS%2529%252Fthai_south_counties.shp%2Fdbf%5C+charset%2Fvalue%3Dwindows-1252%0D%0A%2Fnet.refractions.udig.project%2Ffile%253A%252FD%253A%252Fshapefiles%252FThailand%252FThailand%2BSouth%2BCounties%2B%2528FIPS%2529%252Fthai_south_counties.shp%2523thai_south_counties%2Ffile%253A%252FD%253A%252Fshapefiles%252FThailand%252FThailand%2BSouth%2BCounties%2B%2528FIPS%2529%252Fthai_south_counties.shp%2Fcreate%5C+spatial%5C+index%2Ftype%3Djava.lang.Boolean%0D%0A%2Fnet.refractions.udig.project%2Ffile%253A%252FD%253A%252Fshapefiles%252FThailand%252FThailand%2BSouth%2BCounties%2B%2528FIPS%2529%252Fthai_south_counties.shp%2523thai_south_counties%2Ffile%253A%252FD%253A%252Fshapefiles%252FThailand%252FThailand%2BSouth%2BCounties%2B%2528FIPS%2529%252Fthai_south_counties.shp%2Fcreate%5C+spatial%5C+index%2Fvalue%3Dtrue%0D%0A%2Fnet.refractions.udig.project%2Ffile%253A%252FD%253A%252Fshapefiles%252FThailand%252FThailand%2BSouth%2BCounties%2B%2528FIPS%2529%252Fthai_south_counties.shp%2523thai_south_counties%2Ffile%253A%252FD%253A%252Fshapefiles%252FThailand%252FThailand%2BSouth%2BCounties%2B%2528FIPS%2529%252Fthai_south_counties.shp%2Fdbf%5C+charset%2Ftype%3Djava.lang.String%0D%0A%5C%21%2Fnet.refractions.udig.project%2Ffile%253A%252FD%253A%252Fshapefiles%252FThailand%252FThailand%2BSouth%2BCounties%2B%2528FIPS%2529%252Fthai_south_counties.shp%2523thai_south_counties%3D%0D%0A" iD="file:/D:/workspace/org.dews_online.ccui.core/shapefiles/Thailand/Thailand_South_Counties_FIPS/thai_south_counties.shp#thai_south_counties" defaultColor="#666666">

 

I have tried with URLDecoder but does not work…

Thank you in advance!

 

------------------------------------------------------------------
This e-mail and the documents attached are confidential and intended 
solely for the addressee; it may also be privileged. If you receive 
this e-mail in error, please notify the sender immediately and destroy it. 
As its integrity cannot be secured on the Internet, the Atos Origin 
group liability cannot be triggered for the message content. Although 
the sender endeavours to maintain a computer virus-free network, 
the sender does not warrant that this transmission is virus-free and 
will not be liable for any damages resulting from any virus transmitted. 

Este mensaje y los ficheros adjuntos pueden contener informacion confidencial 
destinada solamente a la(s) persona(s) mencionadas anteriormente 
pueden estar protegidos por secreto profesional. 
Si usted recibe este correo electronico por error, gracias por informar 
inmediatamente al remitente y destruir el mensaje. 
Al no estar asegurada la integridad de este mensaje sobre la red, Atos Origin 
no se hace responsable por su contenido. Su contenido no constituye ningun 
compromiso para el grupo Atos Origin, salvo ratificacion escrita por ambas partes. 
Aunque se esfuerza al maximo por mantener su red libre de virus, el emisor 
no puede garantizar nada al respecto y no sera responsable de cualesquiera 
danos que puedan resultar de una transmision de virus. 
------------------------------------------------------------------ _______________________________________________
User-friendly Desktop Internet GIS (uDig)
http://udig.refractions.net
http://lists.refractions.net/mailman/listinfo/udig-devel

 

 
------------------------------------------------------------------
This e-mail and the documents attached are confidential and intended
solely for the addressee; it may also be privileged. If you receive
this e-mail in error, please notify the sender immediately and destroy it.
As its integrity cannot be secured on the Internet, the Atos Origin
group liability cannot be triggered for the message content. Although
the sender endeavours to maintain a computer virus-free network,
the sender does not warrant that this transmission is virus-free and
will not be liable for any damages resulting from any virus transmitted.

Este mensaje y los ficheros adjuntos pueden contener informacion confidencial
destinada solamente a la(s) persona(s) mencionadas anteriormente
pueden estar protegidos por secreto profesional.
Si usted recibe este correo electronico por error, gracias por informar
inmediatamente al remitente y destruir el mensaje.
Al no estar asegurada la integridad de este mensaje sobre la red, Atos Origin
no se hace responsable por su contenido. Su contenido no constituye ningun
compromiso para el grupo Atos Origin, salvo ratificacion escrita por ambas partes.
Aunque se esfuerza al maximo por mantener su red libre de virus, el emisor
no puede garantizar nada al respecto y no sera responsable de cualesquiera
danos que puedan resultar de una transmision de virus.
------------------------------------------------------------------

Back to the top