Modify

Opened 4 years ago

Closed 4 years ago

#1848 closed enhancement (fixed)

[new PATCH] Version in MOTD

Reported by: anonymous Owned by: xeen
Priority: major Component: unspecified
Version: Keywords: MOTD Message of the Day
Cc:

Description

Can MOTD be modified to include latest stable and experimental release, that would be a good aid into knowing when to download a new update of JOSM.

Attachments (3)

Getting Started.patch (8.5 KB) - added by xeen 4 years ago.
Cache Getting Started with Extra Class.patch (21.7 KB) - added by xeen 4 years ago.
Cache Getting Started with Extra Class.2.patch (21.7 KB) - added by xeen 4 years ago.
Daily Interval was wrong

Download all attachments as: .zip

Change History (13)

Changed 4 years ago by xeen

comment:1 Changed 4 years ago by xeen

  • Keywords Message of the Day added
  • Summary changed from Version in MOTD to [PATCH] Version in MOTD
  • Displays installed and current latest version in lower right corner.
  • Saves MOTD to disk and caches it for 24 hours or until JOSM's version number changes
  • fixes "disable motd" logic, it didn't work before
  • added documentation
  • MOTD variables are now their own group:
    • motd.display – Display MOTD (boolean, default: true)
    • motd.lastversion – JOSM's version number when the MOTD was updated (integer, default: 0). Will be set automatically.
    • motd.lastupdate – The time the MOTD was last updated (in milliseconds). (long, default: 0). Will be set automatically.
    • motd.updateinterval – The amount of time a cached copy is valid (if the version number stays the same) (in milliseconds). (integer, default: 24*60*60*1000 = 24 hours). Setting this to 0 essentially disables caching, the MOTD file is still written to the disk though.

comment:2 Changed 4 years ago by stoecker

Some notes:

  • latest does not need "?format=txt".
  • Using latest is not nice, tested is better. It should be clear that latest is a developer version.
  • We already have a buffering class. Please use it instead of new routines.

comment:3 Changed 4 years ago by xeen

Whups, that should've been tested, no idea why I chose latest in the first place. I used "?format=txt" to force WikiReader to do a normal read instead of trying to parse the wiki. I could pass a wrong base url, but that'd require a new WikiReader. So I opted for "?format".

Buffering classes: I thought so, too, when originally writing the patch, but a search didn't turn up any useful results and I don't know where to look. Can you give me a hand?

comment:4 Changed 4 years ago by stoecker

  • Owner changed from framm to xeen

See "org.openstreetmap.josm.io.MirroredInputStream". Probably displaying "latest" as well is not wrong, but the main focus should be on tested.

comment:5 Changed 4 years ago by xeen

Hm, MirroredInputStream doesn't allow to write custom content – using it would require going down to the bare minimum and only cache HTTP gets. In our case this leaves about 8 html cache files and all the executor, parsing and stitching overhead.

comment:6 Changed 4 years ago by stoecker

So what about writing another caching class which e.g. can be used by other parts as well (e.g. the wms stuff)? I really don't like to have dozens of implementations of equal functionality.

comment:7 Changed 4 years ago by stoecker

Added http://josm.openstreetmap.de/version which contains both versions.

comment:8 Changed 4 years ago by xeen

  • Summary changed from [PATCH] Version in MOTD to [new PATCH] Version in MOTD

Changed 4 years ago by xeen

Daily Interval was wrong

comment:9 Changed 4 years ago by xeen

I plan to replace WMS Cache with this class at a later time, still looking how to insert it meaningfully into the plugin. Due to WMS structure it cannot simply replace WMS' current Cache class.

comment:10 Changed 4 years ago by stoecker

  • Resolution set to fixed
  • Status changed from new to closed

In r1450.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed .
as The resolution will be set. Next status will be 'closed'.
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.