Repository: incubator-unomi Updated Branches: refs/heads/feature-UNOMI-117 f479d8f5d -> ccc3c2c70
UNOMI-117 fix javadoc, add bulk entry point to update property type Project: http://git-wip-us.apache.org/repos/asf/incubator-unomi/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-unomi/commit/ccc3c2c7 Tree: http://git-wip-us.apache.org/repos/asf/incubator-unomi/tree/ccc3c2c7 Diff: http://git-wip-us.apache.org/repos/asf/incubator-unomi/diff/ccc3c2c7 Branch: refs/heads/feature-UNOMI-117 Commit: ccc3c2c7058a310263a46bd51ad8da6f8e2b79e2 Parents: f479d8f Author: dgaillard <[email protected]> Authored: Fri Oct 6 15:09:38 2017 +0200 Committer: dgaillard <[email protected]> Committed: Fri Oct 6 15:09:38 2017 +0200 ---------------------------------------------------------------------- .../unomi/rest/ProfileServiceEndPoint.java | 25 ++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/ccc3c2c7/rest/src/main/java/org/apache/unomi/rest/ProfileServiceEndPoint.java ---------------------------------------------------------------------- diff --git a/rest/src/main/java/org/apache/unomi/rest/ProfileServiceEndPoint.java b/rest/src/main/java/org/apache/unomi/rest/ProfileServiceEndPoint.java index dff5bab..34ac552 100644 --- a/rest/src/main/java/org/apache/unomi/rest/ProfileServiceEndPoint.java +++ b/rest/src/main/java/org/apache/unomi/rest/ProfileServiceEndPoint.java @@ -476,14 +476,13 @@ public class ProfileServiceEndPoint { } /** - * Retrieves all the property types associated with the specified target. + * Retrieves the property type associated with the specified property ID. * * TODO: move to a different class - * Deprecated : use a /properties/targets collection instead, this URI will be used for looking up properties by id instead. * - * @param propertyId the target for which we want to retrieve the associated property types + * @param propertyId the property ID for which we want to retrieve the associated property type * @param language the value of the {@code Accept-Language} header to specify in which locale the properties description should be returned TODO unused - * @return a collection of all the property types associated with the specified target + * @return the property type associated with the specified ID */ @GET @Path("/properties/{propertyId}") @@ -563,6 +562,24 @@ public class ProfileServiceEndPoint { } /** + * Persists the specified properties type in the context server. + * + * TODO: move to a different class + * + * @param properties the properties type to persist + * @return {@code true} if the property type was properly created, {@code false} otherwise (for example, if the property type already existed + */ + @POST + @Path("/properties/bulk") + public boolean setPropertyTypes(List<PropertyType> properties) { + boolean saved = false; + for (PropertyType property : properties) { + saved |= profileService.setPropertyType(property); + } + return saved; + } + + /** * Deletes the property type identified by the specified identifier. * * TODO: move to a different class
