On 03.05.2014 14:16, Alex Rollin wrote:
Hello,

I am trying to distribute JOSM with the HDM Presets and Paint Styles for
offline survey.  That means I can't rely on JOSM to be able to pull the
presets down, and links should be relative so that they work no matter
where a user places the JOSM directory.

I really want to make a folder situation like this:

josm-latest.jar
-appdata
--HDM
---HDM-JOSM-style.zip
---HDM.xml (HDM Presets)

I am looking at the preferences.xml file and I cannot figure out how to put
in a relative link.
I see only absolute links like "C:Users/blahblah/Desktop/josm/etc/HDM.xml"

I see another kind of relative link that appears to point inside the
jar, resource://data/defaultpresets.xml

As a hacky and very preliminary solution, you could distribute your style and presets inside josm-latest.jar. A jar file is just a regular zip file with a different file extension, so what you can do:
* rename josm-latest.jar to josm-latest.zip
* unzip
* place your styles and presets in the directory structure
* zip all the files to josm-latest2.zip
* rename josm-latest2.zip to josm-latest2.jar

Then you can use the resource:// URLs in the preferences.xml.

Yes, it is a good idea to support paths relative to the JOSM preferences directory and relative to the JOSM cache directory, but I don't think this is possible at the moment.

Paul

_______________________________________________
josm-dev mailing list
josm-dev@openstreetmap.org
https://lists.openstreetmap.org/listinfo/josm-dev

Reply via email to