Modify ↓
Opened 12 years ago
Last modified 12 years ago
#9476 new enhancement
[Patch draft] Annotations for remote control implementation
| Reported by: | simon04 | Owned by: | team |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Core remotecontrol | Version: | |
| Keywords: | Cc: |
Description
I was playing around a bit with annotations. The goal would be to make implementing new remote control handlers more fun. A handler is an arbitrary method annotated with @RequestMethod and its parameters annotated with @RequestParameter. The load_object could look like:
@RequestMethod( command = "load_object", usage = "Download objects with given id.", usageExamples = {"/load_object?new_layer=true&objects=w106159509", "/load_object?new_layer=true&objects=r2263653&relation_members=true" }) public static void loadObject( @RequestParameter(name = "objects") String objects, @RequestParameter(name="new_layer", optional = false) String new_layer, @RequestParameter(name="relation_members", optional = false) String relation_members) { // implementation follows }
A working, but unfinished patch is attached.
Attachments (1)
Note:
See TracTickets
for help on using tickets.



Is the duplication of parameter name really necessary ? If we could simply use the function's parameter name, it would be simpler, no ?
I let you decide the milestone :)