From 981b9f2e87d4d2e0b1fdf95233fe26a054643d9f Mon Sep 17 00:00:00 2001 From: Dennis Aulenbacher Date: Mon, 30 Nov 2020 14:31:01 +0100 Subject: [PATCH 1/5] bug5409: Changing name of field "tag" in MarkPropertiesResource to "tags", correctly conveying it's multi value nature. --- .../server/gateway/jaxrs/api/MarkPropertiesResource.java | 6 +++--- .../webservices/api/v1/markPropertiesAllGet.html | 2 +- .../webservices/api/v1/markPropertiesPost.html | 2 +- .../webservices/api/v1/markPropertiesPut.html | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/java/com.sap.sailing.shared.server.gateway/src/com/sap/sailing/shared/server/gateway/jaxrs/api/MarkPropertiesResource.java b/java/com.sap.sailing.shared.server.gateway/src/com/sap/sailing/shared/server/gateway/jaxrs/api/MarkPropertiesResource.java index 171b1a76e73..cf46f48debe 100644 --- a/java/com.sap.sailing.shared.server.gateway/src/com/sap/sailing/shared/server/gateway/jaxrs/api/MarkPropertiesResource.java +++ b/java/com.sap.sailing.shared.server.gateway/src/com/sap/sailing/shared/server/gateway/jaxrs/api/MarkPropertiesResource.java @@ -59,7 +59,7 @@ public class MarkPropertiesResource extends SharedAbstractSailingServerResource @GET @Produces("application/json;charset=UTF-8") - public Response getMarkProperties(@QueryParam("tag") List tags) throws Exception { + public Response getMarkProperties(@QueryParam("tags") List tags) throws Exception { Iterable markPropertiesList = getSharedSailingData().getAllMarkProperties(tags); JSONArray result = new JSONArray(); for (MarkProperties markProperties : markPropertiesList) { @@ -85,7 +85,7 @@ public class MarkPropertiesResource extends SharedAbstractSailingServerResource public Response createMarkProperties(@FormParam("name") final String name, @FormParam("shortName") final String shortName, @FormParam("deviceUuid") String deviceUuid, @FormParam("color") String rgbColor, @FormParam("shape") String shape, @FormParam("pattern") String pattern, - @FormParam("markType") final String markType, @FormParam("tag") List tags, + @FormParam("markType") final String markType, @FormParam("tags") List tags, @FormParam("latDeg") Double latDeg, @FormParam("lonDeg") Double lonDeg) throws Exception { if (name == null || name.isEmpty()) { return getBadMarkPropertiesValidationErrorResponse("name must be given"); @@ -161,7 +161,7 @@ public class MarkPropertiesResource extends SharedAbstractSailingServerResource @FormParam("name") final String name, @FormParam("shortName") final String shortName, @FormParam("color") String rgbColor, @FormParam("shape") String shape, @FormParam("pattern") String pattern, - @FormParam("markType") final String markType, @FormParam("tag") List tags, + @FormParam("markType") final String markType, @FormParam("tags") List tags, @FormParam("deviceUuid") String deviceUuid, @FormParam("latDeg") Double latDeg, @FormParam("lonDeg") Double lonDeg) throws Exception { final UUID markPropertiesUUID = UUID.fromString(markPropertiesId); diff --git a/java/com.sap.sailing.shared.server.gateway/webservices/api/v1/markPropertiesAllGet.html b/java/com.sap.sailing.shared.server.gateway/webservices/api/v1/markPropertiesAllGet.html index e033cbd728c..cb2d7c3a76b 100644 --- a/java/com.sap.sailing.shared.server.gateway/webservices/api/v1/markPropertiesAllGet.html +++ b/java/com.sap.sailing.shared.server.gateway/webservices/api/v1/markPropertiesAllGet.html @@ -29,7 +29,7 @@ Optional parameters: - tag: tag for filtering. Multiple tags are allowed. If no tag is specified, no filtering by tag will be done.
+ tags: Multi value specifying an optional set of tags. No filtering by tag will be done.
Request method: diff --git a/java/com.sap.sailing.shared.server.gateway/webservices/api/v1/markPropertiesPost.html b/java/com.sap.sailing.shared.server.gateway/webservices/api/v1/markPropertiesPost.html index a37e39cc2d8..874540de340 100644 --- a/java/com.sap.sailing.shared.server.gateway/webservices/api/v1/markPropertiesPost.html +++ b/java/com.sap.sailing.shared.server.gateway/webservices/api/v1/markPropertiesPost.html @@ -34,7 +34,7 @@ Optional parameters: shortName: the short name to set. If not given, the short name defaults to the name.
- tag: Multi value specifying an optional set of tags. + tags: Multi value specifying an optional set of tags. markType: One of [BUOY, CAMERABOAT, STARTBOAT, UMPIREBOAT, LANDMARK, FINISHBOAT]
color: RGB color value. Either of the hex color patterns: #RRGGBB, #RGB, RRGGBB, RGB
shape: For marks with BUOY type, this may be specified as one of [CYLINDER, CONICAL]
diff --git a/java/com.sap.sailing.shared.server.gateway/webservices/api/v1/markPropertiesPut.html b/java/com.sap.sailing.shared.server.gateway/webservices/api/v1/markPropertiesPut.html index 41adf69b51b..282ab2db3af 100644 --- a/java/com.sap.sailing.shared.server.gateway/webservices/api/v1/markPropertiesPut.html +++ b/java/com.sap.sailing.shared.server.gateway/webservices/api/v1/markPropertiesPut.html @@ -34,7 +34,7 @@ Optional parameters: shortName: the short name to set. If not given, the short name defaults to the name.
- tag: Multi value specifying an optional set of tags. + tags: Multi value specifying an optional set of tags. Appearance parameters (not giving a parameter sets it to the default):
markType: One of [BUOY, CAMERABOAT, STARTBOAT, UMPIREBOAT, LANDMARK, FINISHBOAT]
color: RGB color value. Either of the hex color patterns: #RRGGBB, #RGB, RRGGBB, RGB
From b32546127442a9c370c81e83c2a2ea4c0571a900 Mon Sep 17 00:00:00 2001 From: Dennis Aulenbacher Date: Mon, 30 Nov 2020 15:34:03 +0100 Subject: [PATCH 2/5] bug5409: Renaming static field --- .../selenium/api/coursetemplate/FreestyleProperties.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/java/com.sap.sailing.selenium.test/src/com/sap/sailing/selenium/api/coursetemplate/FreestyleProperties.java b/java/com.sap.sailing.selenium.test/src/com/sap/sailing/selenium/api/coursetemplate/FreestyleProperties.java index 4518a5f0683..eed2f07f385 100644 --- a/java/com.sap.sailing.selenium.test/src/com/sap/sailing/selenium/api/coursetemplate/FreestyleProperties.java +++ b/java/com.sap.sailing.selenium.test/src/com/sap/sailing/selenium/api/coursetemplate/FreestyleProperties.java @@ -15,7 +15,7 @@ public class FreestyleProperties extends JsonWrapper { private static final String FIELD_SHAPE = "shape"; private static final String FIELD_PATTERN = "pattern"; private static final String FIELD_MARK_TYPE = "markType"; - private static final String FIELD_TAG = "tags"; + private static final String FIELD_TAGS = "tags"; public FreestyleProperties(final JSONObject json) { super(json); @@ -31,7 +31,7 @@ public class FreestyleProperties extends JsonWrapper { getJson().put(FIELD_PATTERN, pattern); getJson().put(FIELD_MARK_TYPE, markType); JSONArray jsonTags = new JSONArray(tags); - getJson().put(FIELD_TAG, jsonTags); + getJson().put(FIELD_TAGS, jsonTags); } public String getName() { From 809be975f8e7eac51023a510d4cb5c6fb79765b1 Mon Sep 17 00:00:00 2001 From: Dennis Aulenbacher Date: Tue, 1 Dec 2020 12:20:08 +0100 Subject: [PATCH 3/5] bug5409: Added tags FreestyleProperties property to example request body --- .../webservices/api/v1/courseConfigurationCreateCourse.html | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/java/com.sap.sailing.server.gateway/webservices/api/v1/courseConfigurationCreateCourse.html b/java/com.sap.sailing.server.gateway/webservices/api/v1/courseConfigurationCreateCourse.html index 0ddce553194..eeb8c84b342 100644 --- a/java/com.sap.sailing.server.gateway/webservices/api/v1/courseConfigurationCreateCourse.html +++ b/java/com.sap.sailing.server.gateway/webservices/api/v1/courseConfigurationCreateCourse.html @@ -114,7 +114,8 @@ "color": "#00FF00", "shape": "", "pattern": "", - "markType": "BUOY" + "markType": "BUOY", + "tags":["tag1"] }, "storeToInventory": true }, @@ -148,6 +149,7 @@ "shape": "", "pattern": "", "markType": "BUOY" + "tags":["tag1"] }, "storeToInventory": true }, From 22a3a9cc7be259f1181c0e304819246d4c9a0cef Mon Sep 17 00:00:00 2001 From: Dennis Aulenbacher Date: Tue, 1 Dec 2020 12:22:32 +0100 Subject: [PATCH 4/5] bug5409: Changed "tag" query parameter to tags, correctly representing it'S multi valued nature --- .../gateway/jaxrs/api/CourseConfigurationResource.java | 5 ++--- .../api/v1/courseConfigurationCreateCourseTemplate.html | 2 +- .../webservices/api/v1/courseConfigurationGetFromCourse.html | 2 +- .../server/gateway/jaxrs/api/CourseTemplateResource.java | 2 +- .../webservices/api/v1/courseTemplateAllGet.html | 2 +- 5 files changed, 6 insertions(+), 7 deletions(-) diff --git a/java/com.sap.sailing.server.gateway/src/com/sap/sailing/server/gateway/jaxrs/api/CourseConfigurationResource.java b/java/com.sap.sailing.server.gateway/src/com/sap/sailing/server/gateway/jaxrs/api/CourseConfigurationResource.java index d76d3a4b460..4e4b624dcce 100644 --- a/java/com.sap.sailing.server.gateway/src/com/sap/sailing/server/gateway/jaxrs/api/CourseConfigurationResource.java +++ b/java/com.sap.sailing.server.gateway/src/com/sap/sailing/server/gateway/jaxrs/api/CourseConfigurationResource.java @@ -142,8 +142,7 @@ public class CourseConfigurationResource extends AbstractSailingServerResource { @Path("getFromCourse/{regattaName}/{raceColumn}/{fleet}") public Response createCourseConfigurationFromCourse(@PathParam("regattaName") String regattaName, @PathParam("raceColumn") String raceColumn, @PathParam("fleet") String fleet, - @QueryParam("tag") List tags) throws Exception { - + @QueryParam("tags") List tags) throws Exception { if (regattaName == null || raceColumn == null || fleet == null) { return getBadCourseConfigurationValidationErrorResponse( "Course configuration is required to have a regatta name and a race name"); @@ -183,7 +182,7 @@ public class CourseConfigurationResource extends AbstractSailingServerResource { @Path("getFromCourseTemplate/{courseTemplateId}") public Response createCourseConfigurationFromCourseTemplate(@PathParam("courseTemplateId") String courseTemplateId, @QueryParam("regattaName") String regattaName, - @QueryParam("tag") List tags, + @QueryParam("tags") List tags, @QueryParam("numberOfLaps") Integer optionalNumberOfLaps) { final CourseTemplate courseTemplate = this.getSharedSailingData() .getCourseTemplateById(UUID.fromString(courseTemplateId)); diff --git a/java/com.sap.sailing.server.gateway/webservices/api/v1/courseConfigurationCreateCourseTemplate.html b/java/com.sap.sailing.server.gateway/webservices/api/v1/courseConfigurationCreateCourseTemplate.html index 646c251d906..01c57cc7556 100644 --- a/java/com.sap.sailing.server.gateway/webservices/api/v1/courseConfigurationCreateCourseTemplate.html +++ b/java/com.sap.sailing.server.gateway/webservices/api/v1/courseConfigurationCreateCourseTemplate.html @@ -43,7 +43,7 @@
  • name: the name of the mark to create
  • shortName: the short name to set. If not given, the short name defaults to the name.
  • -
  • tag: Multi value specifying an optional set of tags.
  • +
  • tags: Multi value specifying an optional set of tags.
  • markType: One of [BUOY, CAMERABOAT, STARTBOAT, UMPIREBOAT, LANDMARK, FINISHBOAT]
  • color: RGB color value. Either of the hex color patterns: #RRGGBB, #RGB, RRGGBB, RGB
  • shape: For marks with BUOY type, this may be specified as one of [CYLINDER, CONICAL]
  • diff --git a/java/com.sap.sailing.server.gateway/webservices/api/v1/courseConfigurationGetFromCourse.html b/java/com.sap.sailing.server.gateway/webservices/api/v1/courseConfigurationGetFromCourse.html index f0561c389e9..b91f047672c 100644 --- a/java/com.sap.sailing.server.gateway/webservices/api/v1/courseConfigurationGetFromCourse.html +++ b/java/com.sap.sailing.server.gateway/webservices/api/v1/courseConfigurationGetFromCourse.html @@ -29,7 +29,7 @@ Optional query parameters: - tag: Tags to filter mark properties for. + tags: Tags to filter mark properties for. This is only relevant if a course is loaded that was created based on a course template. In this case matching of MarkProperties to MarkTemplates that aren't covered by regatta marks is done by also using the given tags as a filter criteria filter. diff --git a/java/com.sap.sailing.shared.server.gateway/src/com/sap/sailing/shared/server/gateway/jaxrs/api/CourseTemplateResource.java b/java/com.sap.sailing.shared.server.gateway/src/com/sap/sailing/shared/server/gateway/jaxrs/api/CourseTemplateResource.java index 91c2db1341f..267ac6f5f4a 100644 --- a/java/com.sap.sailing.shared.server.gateway/src/com/sap/sailing/shared/server/gateway/jaxrs/api/CourseTemplateResource.java +++ b/java/com.sap.sailing.shared.server.gateway/src/com/sap/sailing/shared/server/gateway/jaxrs/api/CourseTemplateResource.java @@ -52,7 +52,7 @@ public class CourseTemplateResource extends SharedAbstractSailingServerResource @GET @Produces("application/json;charset=UTF-8") - public Response getCourseTemplates(@QueryParam("tag") List tags) throws Exception { + public Response getCourseTemplates(@QueryParam("tags") List tags) throws Exception { Iterable courseTemplateList = getSharedSailingData().getAllCourseTemplates(tags); JSONArray result = new JSONArray(); for (CourseTemplate courseTemplate : courseTemplateList) { diff --git a/java/com.sap.sailing.shared.server.gateway/webservices/api/v1/courseTemplateAllGet.html b/java/com.sap.sailing.shared.server.gateway/webservices/api/v1/courseTemplateAllGet.html index a05d643a9f8..c8d086a1034 100644 --- a/java/com.sap.sailing.shared.server.gateway/webservices/api/v1/courseTemplateAllGet.html +++ b/java/com.sap.sailing.shared.server.gateway/webservices/api/v1/courseTemplateAllGet.html @@ -29,7 +29,7 @@ Optional parameters: - tag: tag for filtering. Multiple tags are allowed. If no tag is specified, no filtering by tag will be done.
    + tags: tags for filtering. Multiple tags are allowed. If no tag is specified, no filtering by tag will be done.
    Request method: From 1b153716583990782935dc82c53436934da0370a Mon Sep 17 00:00:00 2001 From: Dennis Aulenbacher Date: Tue, 1 Dec 2020 12:44:40 +0100 Subject: [PATCH 5/5] bug5409: Correction of example requests in api docs --- .../webservices/api/v1/courseTemplateAllGet.html | 2 +- .../webservices/api/v1/markPropertiesAllGet.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/java/com.sap.sailing.shared.server.gateway/webservices/api/v1/courseTemplateAllGet.html b/java/com.sap.sailing.shared.server.gateway/webservices/api/v1/courseTemplateAllGet.html index c8d086a1034..3100492024a 100644 --- a/java/com.sap.sailing.shared.server.gateway/webservices/api/v1/courseTemplateAllGet.html +++ b/java/com.sap.sailing.shared.server.gateway/webservices/api/v1/courseTemplateAllGet.html @@ -37,7 +37,7 @@ Example: - http://www.sapsailing.com/sailingserver/api/v1/coursetemplates?tag=test1&tag=test2 + http://www.sapsailing.com/sailingserver/api/v1/coursetemplates?tags=test1&tags=test2
    diff --git a/java/com.sap.sailing.shared.server.gateway/webservices/api/v1/markPropertiesAllGet.html b/java/com.sap.sailing.shared.server.gateway/webservices/api/v1/markPropertiesAllGet.html index cb2d7c3a76b..b4caf211d2c 100644 --- a/java/com.sap.sailing.shared.server.gateway/webservices/api/v1/markPropertiesAllGet.html +++ b/java/com.sap.sailing.shared.server.gateway/webservices/api/v1/markPropertiesAllGet.html @@ -37,7 +37,7 @@ Example: - http://www.sapsailing.com/sailingserver/api/v1/markproperties?tag=test1&tag=test2 + http://www.sapsailing.com/sailingserver/api/v1/markproperties?tags=test1&tags=test2