Switching between Dev and Production servers and authentication easily
Florian
florian at schaeferban.de
Sat Jun 26 19:26:38 UTC 2021
Hi Kai,
yes, it would be ideal if only uploads that close the changeset trigger the action. It's ok as it is now, but it would be nice if only the last upload into a changeset (i.e. the one that will close the changeset) would trigger the action.
Or alternatively it would already be great if I would be notified before the changeset is closed (as it is now), but could determine that JOSM is about to close the changeset.
At the moment I do it like this: https://gitlab.com/JOSM/plugin/RovasConnector/-/blob/master/src/main/java/app/rovas/josm/RovasPlugin.java#L60 with `OsmServerWriter.registerPostprocessor()`. But at that point the changeset is always still open.
I looked into using the ChangesetCache for a while, but wasn't really satisfied by that route. As I understand it that way I would need to distinguish if a changeset was closed by the current JOSM user, or if it's a changeset by another user that was closed on the server. But I'm not completely sure about that.
Cheers,
Florian
Am 26. Juni 2021 21:09:00 MESZ schrieb Kai Michael Poppe - OSM <osm at poppe.dev>:
>Hi Florian,
>
>I will check tomorrow what the trigger does exactly for my plugin. So
>you want to trigger only if the upload closes the cs, not if it's kept
>open?
>
>Kai
>
>On June 26, 2021 8:56:43 PM GMT+02:00, Florian <florian at schaeferban.de>
>wrote:
>>Hi Kai,
>>
>>I recently also developed a plugin that was triggered by uploads of
>OSM data and I'm not aware of an easy way to switch back and forth
>between OSM accounts for the development server and for the production
>server in the same JOSM instance.
>>
>>The easiest would be to start JOSM with a different JOSM_HOME when
>developing, so the settings for development and production are
>separate.
>>
>>Also, I added a menu item to the JOSM main menu while I developed the
>plugin and this menu item triggered the same event that an upload would
>have triggered. For the release I removed that again.
>>
>>In case your plugin uses the gradle-josm-plugin, you could start a
>separate JOSM instance with the current state of your plugin loaded by
>using the `runJosm` task. Full disclosure: I'm the creator of the
>gradle-josm-plugin, so obviously biased.
>>
>>I also have a related question: My goal for the plugin I developed was
>to only trigger when a changeset is closed. But the best I was able to
>achieve was to trigger for every upload, regardless of if the changeset
>was closed or not. Does anyone know a reliable way to trigger an action
>every time a changeset is closed by JOSM?
>>
>>Cheers,
>>Florian
>>
>>Am 26. Juni 2021 18:42:16 MESZ schrieb Kai Michael Poppe - OSM
><osm at poppe.dev>:
>>>Hi all,
>>>
>>>just today, I had to change my settings to work against the
>>>api06.dev-environment rather than production servers because my
>plugin
>>>is triggered when JOSM uploads Changesets (and I obviously don't want
>>>to upload tests to the public map).
>>>
>>>Is there an easy way to switch between the server settings (with user
>>>and password) without manually entering everything?
>>>
>>>Any ideas would be appreciated!
>>>
>>>Kai
More information about the josm-dev
mailing list