[josm-dev] Relative links in preferences.xml

Alex Rollin alex.rollin at gmail.com
Sun May 4 09:04:42 UTC 2014


I did try to get them to autoload today by placing them into cache but it
didn't work.

I've been updating this package monthly, and now that I did just unzip my
first jar file I think I can handle this method.
Thank you Paul for those instructions.  I will let you know what I figure
out.

I was into the idea of BAT files or some other config adjuster but various
versions of Windows seem to conspire to thwart my efforts.

I will see about opening a feature request for some way to identify a
relative path for "packages"? If that seems appropriate?

I should say again this is primarily for field deployments, people just
getting started with JOSM.  We are training people with video, too,
delivered with the package, so, while it isn't for everyone, obviously, I
think there's certainly several thousand people in Asia who wouldn't mind
at all.

--
Alex


On Sun, May 4, 2014 at 3:17 PM, Paul Hartmann <phaaurlt at gmail.com> wrote:

> 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 at openstreetmap.org
> https://lists.openstreetmap.org/listinfo/josm-dev
>


More information about the josm-dev mailing list