Modify

Opened 12 years ago

Closed 11 years ago

Last modified 11 years ago

#8228 closed enhancement (fixed)

Add endpoint description to usage page of remote control

Reported by: simon04 Owned by: simon04
Priority: normal Milestone: 14.01
Component: Core remotecontrol Version:
Keywords: Cc:

Description

I suggest to improve/rework the remote control part in two ways:

  • instead of low-level-re-implementing parts of the HTTP protocol, use com.sun.net.httpserver.HttpServer
  • add some usage examples in the code, in order to (hopefully) have all parameters documented, e.g.:
/imagery: adds an imagery layer (e.g. WMS, TMS))
  mandatory parameter: url
  usage examples:
    /imagery?title=...&type={wms|tms|html|bing|scanex}&url=....[&cookies=...][&min_zoom=...][&max_zoom=...]

This patch is meant for the post-stabilization phase and is open for discussion. (Note: the reverter plugin needs some small adoptions as it provides a remote control handler.)

Attachments (1)

rc.patch (20.5 KB ) - added by simon04 12 years ago.

Download all attachments as: .zip

Change History (16)

by simon04, 12 years ago

Attachment: rc.patch added

in reply to:  description comment:1 by Don-vip, 12 years ago

Replying to simon04:

  • instead of low-level-re-implementing parts of the HTTP protocol, use com.sun.net.httpserver.HttpServer

Is it safe to use this class in com.sun package ?

comment:2 by simon04, 12 years ago

It's listed in JavaDoc http://docs.oracle.com/javase/6/docs/jre/api/net/httpserver/spec/com/sun/net/httpserver/HttpServer.html and also available in OpenJDK (I'm using 1.7.0_09, OpenJDK Runtime Environment (IcedTea7 2.3.3)).

comment:3 by Don-vip, 12 years ago

Ok.

I did not look in detail but I'm surprised this patch only contains new lines ? Shouldn't it remove the HTTP reimplemented mechanisms you were talking about ?

comment:5 by Don-vip, 12 years ago

I think we can try this patch :)

in reply to:  2 comment:6 by bastiK, 12 years ago

Replying to simon04:

It's listed in JavaDoc http://docs.oracle.com/javase/6/docs/jre/api/net/httpserver/spec/com/sun/net/httpserver/HttpServer.html and also available in OpenJDK (I'm using 1.7.0_09, OpenJDK Runtime Environment (IcedTea7 2.3.3)).

Still, the package com.sun.net.httpserver is only present in the Sun based implementations and not part of the official Java API.

If there is a significant advantage, we can live with it at the moment, but it is better avoid these internal classes.

(There have been tries to run JOSM with GNU Classpath and it even works to some extend, but this is just academic exercise at the moment.)

comment:7 by stoecker, 11 years ago

Summary: [Patch] Improve/rework remote control[Patch needs rework] Improve/rework remote control

comment:8 by akks, 11 years ago

In 6091/josm:

see #8612, #8228: remote control - add examples [patch by simon04, parts], add /feature request to detect commands

comment:9 by akks, 11 years ago

I have added the examples from the patch and wiki, but I am not sure we need descriptions now (there will be many untranslated strings for very specific purpose).

comment:10 by simon04, 11 years ago

Actually, we don't i18n the remote control usage page at all, do we?

comment:11 by simon04, 11 years ago

Summary: [Patch needs rework] Improve/rework remote controlAdd endpoint description to usage page of remote control

in reply to:  10 comment:12 by stoecker, 11 years ago

Replying to simon04:

Actually, we don't i18n the remote control usage page at all, do we?

What do you mean?

comment:13 by simon04, 11 years ago

Currently, the strings from getUsageAsHtml are not being translated, e.g., "optional parameters". Therefore, we could also show untranslated descriptions …

comment:14 by simon04, 11 years ago

Resolution: fixed
Status: newclosed

In 6536/josm:

fix #8228 - remote control: add command description to usage page

comment:15 by Don-vip, 11 years ago

Milestone: 14.01

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain simon04.
as The resolution will be set.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.