This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository pollen. See https://gitlab.nuiton.org/chorem/pollen.git commit dc13f8c67eaebe696db5d789e9744c69b923c00c Author: Sylvain Bavencoff <bavencoff@codelutin.com> Date: Mon Jul 17 09:52:09 2017 +0200 retour vers la premiers version de l'api, correction des fil Atom, vérification des dépendances --- pollen-persistence/pom.xml | 5 ++ pollen-rest-api/pom.xml | 32 +++++++-- .../rest/api/PollenRestApiRequestFilter.java | 2 +- .../org/chorem/pollen/rest/api/v1/ApiUtils.java | 7 -- .../org/chorem/pollen/rest/api/v1/ChoiceApi.java | 16 +++-- .../org/chorem/pollen/rest/api/v1/CommentApi.java | 18 ++--- .../java/org/chorem/pollen/rest/api/v1/DocApi.java | 3 +- .../chorem/pollen/rest/api/v1/FavoriteListApi.java | 42 +++++------ .../org/chorem/pollen/rest/api/v1/PollApi.java | 45 ++++++------ .../pollen/rest/api/v1/PollenResourceApi.java | 15 ++-- .../chorem/pollen/rest/api/v1/PollenUserApi.java | 24 ++++--- .../org/chorem/pollen/rest/api/v1/VoteApi.java | 12 ++-- .../chorem/pollen/rest/api/v1/VoteCountingApi.java | 5 +- .../pollen/rest/api/v1/VoteCountingTypeApi.java | 5 +- .../chorem/pollen/rest/api/v1/VoterListApi.java | 29 ++++---- pollen-services/pom.xml | 25 +------ .../pollen/services/service/FeedService.java | 9 +++ pollen-ui-riot-js/src/main/web/js/ChoiceService.js | 57 ++++++--------- .../src/main/web/js/CommentService.js | 68 +++++++----------- .../src/main/web/js/FavoriteListService.js | 8 +-- pollen-ui-riot-js/src/main/web/js/FetchService.js | 47 ++++++++----- pollen-ui-riot-js/src/main/web/js/PollService.js | 82 ++++++++++------------ .../src/main/web/js/ResourceService.js | 24 +++++-- pollen-ui-riot-js/src/main/web/js/ResultService.js | 12 ++-- pollen-ui-riot-js/src/main/web/js/UserService.js | 36 ++++++---- .../src/main/web/js/VoteCountingTypeService.js | 14 +++- pollen-ui-riot-js/src/main/web/js/VoteService.js | 43 +++++------- .../src/main/web/js/VoterListService.js | 31 +++++--- pom.xml | 37 ++++++++-- 29 files changed, 407 insertions(+), 346 deletions(-) diff --git a/pollen-persistence/pom.xml b/pollen-persistence/pom.xml index b6324fb5..d2442a08 100644 --- a/pollen-persistence/pom.xml +++ b/pollen-persistence/pom.xml @@ -64,6 +64,11 @@ </dependency> <dependency> + <groupId>org.flywaydb</groupId> + <artifactId>flyway-core</artifactId> + </dependency> + + <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-core</artifactId> </dependency> diff --git a/pollen-rest-api/pom.xml b/pollen-rest-api/pom.xml index 3597979f..1509b6fd 100644 --- a/pollen-rest-api/pom.xml +++ b/pollen-rest-api/pom.xml @@ -92,22 +92,46 @@ </dependency> <dependency> + <groupId>org.jboss.spec.javax.ws.rs</groupId> + <artifactId>jboss-jaxrs-api_2.0_spec</artifactId> + </dependency> + + <dependency> <groupId>org.jboss.resteasy</groupId> <artifactId>resteasy-jaxrs</artifactId> </dependency> + <dependency> <groupId>org.jboss.resteasy</groupId> <artifactId>resteasy-servlet-initializer</artifactId> + <scope>runtime</scope> </dependency> <dependency> <groupId>org.jboss.resteasy</groupId> <artifactId>resteasy-jackson2-provider</artifactId> + <scope>runtime</scope> </dependency> <dependency> <groupId>org.jboss.resteasy</groupId> <artifactId>resteasy-multipart-provider</artifactId> + <scope>runtime</scope> + </dependency> + + <dependency> + <groupId>org.jboss.resteasy</groupId> + <artifactId>resteasy-multipart-provider</artifactId> + </dependency> + + <dependency> + <groupId>com.fasterxml.jackson.core</groupId> + <artifactId>jackson-core</artifactId> + </dependency> + + <dependency> + <groupId>com.fasterxml.jackson.core</groupId> + <artifactId>jackson-databind</artifactId> </dependency> <dependency> @@ -129,10 +153,6 @@ <artifactId>commons-logging</artifactId> </dependency> <dependency> - <groupId>commons-beanutils</groupId> - <artifactId>commons-beanutils</artifactId> - </dependency> - <dependency> <groupId>commons-io</groupId> <artifactId>commons-io</artifactId> </dependency> @@ -140,6 +160,10 @@ <groupId>org.apache.commons</groupId> <artifactId>commons-lang3</artifactId> </dependency> + <dependency> + <groupId>org.apache.commons</groupId> + <artifactId>commons-collections4</artifactId> + </dependency> <dependency> <groupId>org.apache.httpcomponents</groupId> diff --git a/pollen-rest-api/src/main/java/org/chorem/pollen/rest/api/PollenRestApiRequestFilter.java b/pollen-rest-api/src/main/java/org/chorem/pollen/rest/api/PollenRestApiRequestFilter.java index ed99e59d..815ccd62 100644 --- a/pollen-rest-api/src/main/java/org/chorem/pollen/rest/api/PollenRestApiRequestFilter.java +++ b/pollen-rest-api/src/main/java/org/chorem/pollen/rest/api/PollenRestApiRequestFilter.java @@ -22,7 +22,7 @@ package org.chorem.pollen.rest.api; */ import com.google.gson.Gson; -import org.apache.commons.collections.CollectionUtils; +import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; diff --git a/pollen-rest-api/src/main/java/org/chorem/pollen/rest/api/v1/ApiUtils.java b/pollen-rest-api/src/main/java/org/chorem/pollen/rest/api/v1/ApiUtils.java index cf3405e3..43ced8eb 100644 --- a/pollen-rest-api/src/main/java/org/chorem/pollen/rest/api/v1/ApiUtils.java +++ b/pollen-rest-api/src/main/java/org/chorem/pollen/rest/api/v1/ApiUtils.java @@ -1,8 +1,6 @@ package org.chorem.pollen.rest.api.v1; import com.google.common.base.Charsets; -import com.rometools.rome.feed.atom.Feed; -import com.rometools.rome.feed.synd.SyndFeed; import org.apache.commons.io.IOUtils; import org.chorem.pollen.services.PollenTechnicalException; import org.chorem.pollen.services.bean.ResourceFileBean; @@ -70,9 +68,4 @@ public class ApiUtils { throw new PollenTechnicalException(e); } } - - public static Feed syndFeedToFeed(SyndFeed feedForPoll) { - // TODO - return null; - } } diff --git a/pollen-rest-api/src/main/java/org/chorem/pollen/rest/api/v1/ChoiceApi.java b/pollen-rest-api/src/main/java/org/chorem/pollen/rest/api/v1/ChoiceApi.java index b42c1c34..563de3a7 100644 --- a/pollen-rest-api/src/main/java/org/chorem/pollen/rest/api/v1/ChoiceApi.java +++ b/pollen-rest-api/src/main/java/org/chorem/pollen/rest/api/v1/ChoiceApi.java @@ -49,11 +49,12 @@ import java.util.List; * @author Tony Chemit - dev@tchemit.fr * @since 2.0 */ -@Path("/choices/{pollId}") +@Path("") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) public class ChoiceApi { + @Path("polls/{pollId}/choices") @GET public List<ChoiceBean> getChoices(@Context ChoiceService choiceService, @PathParam("pollId") PollenEntityId<Poll> pollId) { @@ -62,7 +63,7 @@ public class ChoiceApi { } - @Path("/{choiceId}") + @Path("polls/{pollId}/choices/{choiceId}") @GET public ChoiceBean getChoice(@Context ChoiceService choiceService, @PathParam("pollId") PollenEntityId<Poll> pollId, @@ -72,6 +73,7 @@ public class ChoiceApi { } + @Path("polls/{pollId}/choices") @POST public PollenEntityRef<Choice> addChoice(@Context ChoiceService choiceService, @PathParam("pollId") PollenEntityId<Poll> pollId, @@ -81,7 +83,7 @@ public class ChoiceApi { } - @Path("/{choiceId}") + @Path("polls/{pollId}/choices/{choiceId}") @POST @PUT public ChoiceBean editChoice(@Context ChoiceService choiceService, @PathParam("pollId") PollenEntityId<Poll> pollId, @@ -91,7 +93,7 @@ public class ChoiceApi { } - @Path("/{choiceId}") + @Path("polls/{pollId}/choices/{choiceId}") @DELETE public void deleteChoice(@Context ChoiceService choiceService, @PathParam("pollId") PollenEntityId<Poll> pollId, @@ -101,7 +103,7 @@ public class ChoiceApi { } - @Path("/{choiceId}/reports") + @Path("polls/{pollId}/choices/{choiceId}/reports") @POST public void addReport(@Context ReportService reportService, @PathParam("pollId") PollenEntityId<Poll> pollId, @@ -112,7 +114,7 @@ public class ChoiceApi { } - @Path("/{choiceId}/reports") + @Path("polls/{pollId}/choices/{choiceId}/reports") @GET public List<ReportBean> getReports(@Context ReportService reportService, @PathParam("pollId") PollenEntityId<Poll> pollId, @@ -121,7 +123,7 @@ public class ChoiceApi { return reportService.getChoiceReports(pollId.getEntityId(), choiceId.getEntityId()); } - @Path("/{choiceId}/reports/{reportId}") + @Path("polls/{pollId}/choices/{choiceId}/reports/{reportId}") @POST public void saveReport(@Context ReportService reportService, @PathParam("pollId") PollenEntityId<Poll> pollId, diff --git a/pollen-rest-api/src/main/java/org/chorem/pollen/rest/api/v1/CommentApi.java b/pollen-rest-api/src/main/java/org/chorem/pollen/rest/api/v1/CommentApi.java index 3e9cb71c..3fe498bd 100644 --- a/pollen-rest-api/src/main/java/org/chorem/pollen/rest/api/v1/CommentApi.java +++ b/pollen-rest-api/src/main/java/org/chorem/pollen/rest/api/v1/CommentApi.java @@ -52,11 +52,12 @@ import java.util.List; * @author Tony Chemit - dev@tchemit.fr * @since 2.0 */ -@Path("/comments/{pollId}") +@Path("") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) public class CommentApi { + @Path("polls/{pollId}/comments") @GET public PaginationResultBean<CommentBean> getComments(@Context CommentService commentService, @PathParam("pollId") PollenEntityId<Poll> pollId, @@ -66,7 +67,7 @@ public class CommentApi { } - @Path("/{commentId}") + @Path("polls/{pollId}/comments/{commentId}") @GET public CommentBean getComment(@Context CommentService commentService, @PathParam("pollId") PollenEntityId<Poll> pollId, @@ -76,7 +77,7 @@ public class CommentApi { } - @Path("/new") + @Path("polls/{pollId}/comments/new") @GET public CommentBean getNewComment(@Context CommentService commentService, @PathParam("pollId") PollenEntityId<Poll> pollId) { @@ -85,6 +86,7 @@ public class CommentApi { } + @Path("polls/{pollId}/comments") @POST public PollenEntityRef<Comment> addComment(@Context CommentService commentService, @PathParam("pollId") PollenEntityId<Poll> pollId, @@ -94,7 +96,7 @@ public class CommentApi { } - @Path("/{commentId}") + @Path("polls/{pollId}/comments/{commentId}") @PUT @POST public CommentBean editComment(@Context CommentService commentService, @PathParam("pollId") PollenEntityId<Poll> pollId, @@ -104,7 +106,7 @@ public class CommentApi { } - @Path("/{commentId}") + @Path("polls/{pollId}/comments/{commentId}") @DELETE public void deleteComment(@Context CommentService commentService, @PathParam("pollId") PollenEntityId<Poll> pollId, @@ -114,7 +116,7 @@ public class CommentApi { } - @Path("/{commentId}/reports") + @Path("polls/{pollId}/comments/{commentId}/reports") @POST public void addReport(@Context ReportService reportService, @PathParam("pollId") PollenEntityId<Poll> pollId, @@ -125,7 +127,7 @@ public class CommentApi { } - @Path("/{commentId}/reports") + @Path("polls/{pollId}/comments/{commentId}/reports") @GET public List<ReportBean> getReports(@Context ReportService reportService, @PathParam("pollId") PollenEntityId<Poll> pollId, @@ -134,7 +136,7 @@ public class CommentApi { return reportService.getCommentReports(pollId.getEntityId(), commentId.getEntityId()); } - @Path("/{commentId}/reports/{reportId}") + @Path("polls/{pollId}/comments/{commentId}/reports/{reportId}") @POST public void saveReport(@Context ReportService reportService, @PathParam("pollId") PollenEntityId<Poll> pollId, diff --git a/pollen-rest-api/src/main/java/org/chorem/pollen/rest/api/v1/DocApi.java b/pollen-rest-api/src/main/java/org/chorem/pollen/rest/api/v1/DocApi.java index de442fed..7b5b399d 100644 --- a/pollen-rest-api/src/main/java/org/chorem/pollen/rest/api/v1/DocApi.java +++ b/pollen-rest-api/src/main/java/org/chorem/pollen/rest/api/v1/DocApi.java @@ -38,9 +38,10 @@ import java.nio.charset.StandardCharsets; * @author Tony Chemit - dev@tchemit.fr * @since 2.0 */ -@Path("/doc") +@Path("") public class DocApi { + @Path("/doc") @GET @Produces(MediaType.TEXT_PLAIN) public String showMapping() { diff --git a/pollen-rest-api/src/main/java/org/chorem/pollen/rest/api/v1/FavoriteListApi.java b/pollen-rest-api/src/main/java/org/chorem/pollen/rest/api/v1/FavoriteListApi.java index c202234b..b0f92f74 100644 --- a/pollen-rest-api/src/main/java/org/chorem/pollen/rest/api/v1/FavoriteListApi.java +++ b/pollen-rest-api/src/main/java/org/chorem/pollen/rest/api/v1/FavoriteListApi.java @@ -60,11 +60,12 @@ import javax.ws.rs.core.Response; * @author Tony Chemit - dev@tchemit.fr * @since 2.0 */ -@Path("/favoriteLists") +@Path("") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) public class FavoriteListApi { + @Path("/favoriteLists") @GET public PaginationResultBean<FavoriteListBean> getFavoriteLists(@Context FavoriteListService favoriteListService, @BeanParam PaginationParameterBean paginationParameter, @@ -74,7 +75,7 @@ public class FavoriteListApi { } - @Path("/imports") + @Path("/favoriteLists/imports") @POST @Consumes("multipart/form-data") public int importFavoriteLists(@Context FavoriteListService favoriteListService, @@ -84,7 +85,7 @@ public class FavoriteListApi { return favoriteListService.importFavoriteLists(resourceFileBean.getFile()); } - @Path("/exports") + @Path("/favoriteLists/exports") @GET @Produces(MediaType.APPLICATION_OCTET_STREAM) public Response exportFavoriteLists(@Context FavoriteListService favoriteListService) { @@ -94,7 +95,7 @@ public class FavoriteListApi { return ApiUtils.exportBeanToResponse(exportBean); } - @Path("/{favoriteListId}") + @Path("/favoriteLists/{favoriteListId}") @GET public FavoriteListBean getFavoriteList(@Context FavoriteListService favoriteListService, @PathParam("favoriteListId") PollenEntityId<FavoriteList> favoriteListId) { @@ -105,6 +106,7 @@ public class FavoriteListApi { + @Path("/favoriteLists") @POST public PollenEntityRef<FavoriteList> createFavoriteList(@Context FavoriteListService favoriteListService, FavoriteListBean favoriteList) throws InvalidFormException { @@ -113,7 +115,7 @@ public class FavoriteListApi { } - @Path("/{favoriteListId}") + @Path("/favoriteLists/{favoriteListId}") @PUT @POST public FavoriteListBean editFavoriteList(@Context FavoriteListService favoriteListService, FavoriteListBean favoriteList) throws InvalidFormException { @@ -122,7 +124,7 @@ public class FavoriteListApi { } - @Path("/{favoriteListId}") + @Path("/favoriteLists/{favoriteListId}") @DELETE public void deleteFavoriteList(@Context FavoriteListService favoriteListService, @PathParam("favoriteListId") PollenEntityId<FavoriteList> favoriteListId) { @@ -131,7 +133,7 @@ public class FavoriteListApi { } - @Path("/{favoriteListId}/importCsv") + @Path("/favoriteLists/{favoriteListId}/importCsv") @POST @Consumes("multipart/form-data") public void importFavoriteListMembersFromCsv(@Context FavoriteListService favoriteListService, @@ -142,7 +144,7 @@ public class FavoriteListApi { favoriteListService.importFavoriteListMembersFromCsv(favoriteListId.getEntityId(), resourceFileBean.getFile()); } - @Path("/{favoriteListId}/importLdap") + @Path("/favoriteLists/{favoriteListId}/importLdap") @POST public void importFavoriteListMembersFromLdap(@Context FavoriteListService favoriteListService, @PathParam("favoriteListId") PollenEntityId<FavoriteList> favoriteListId, @@ -152,7 +154,7 @@ public class FavoriteListApi { } - @Path("/importVoterList") + @Path("/favoriteLists/importVoterList") @POST public FavoriteListBean importFavoriteListMembersFromVoterList(@Context FavoriteListService favoriteListService, @QueryParam("voterListId") PollenEntityId<VoterList> voterListId) throws FavoriteListImportException, InvalidFormException { @@ -161,7 +163,7 @@ public class FavoriteListApi { } - @Path("/{favoriteListId}/members") + @Path("/favoriteLists/{favoriteListId}/members") @GET public PaginationResultBean<FavoriteListMemberBean> getMembers(@Context FavoriteListService favoriteListService, @PathParam("favoriteListId") PollenEntityId<FavoriteList> favoriteListId, @@ -172,7 +174,7 @@ public class FavoriteListApi { } - @Path("/{favoriteListId}/members/{memberId}") + @Path("/favoriteLists/{favoriteListId}/members/{memberId}") @GET public FavoriteListMemberBean getMember(@Context FavoriteListService favoriteListService, @PathParam("favoriteListId") PollenEntityId<FavoriteList> favoriteListId, @@ -182,7 +184,7 @@ public class FavoriteListApi { } - @Path("/{favoriteListId}/members") + @Path("/favoriteLists/{favoriteListId}/members") @POST public PollenEntityRef<FavoriteListMember> addMember(@Context FavoriteListService favoriteListService, @PathParam("favoriteListId") PollenEntityId<FavoriteList> favoriteListId, @@ -192,7 +194,7 @@ public class FavoriteListApi { } - @Path("/{favoriteListId}/members/{memberId}") + @Path("/favoriteLists/{favoriteListId}/members/{memberId}") @PUT @POST public FavoriteListMemberBean editMember(@Context FavoriteListService favoriteListService, @PathParam("favoriteListId") PollenEntityId<FavoriteList> favoriteListId, @@ -202,7 +204,7 @@ public class FavoriteListApi { } - @Path("/{favoriteListId}/members/{memberId}") + @Path("/favoriteLists/{favoriteListId}/members/{memberId}") @DELETE public void removeMember(@Context FavoriteListService favoriteListService, @PathParam("favoriteListId") PollenEntityId<FavoriteList> favoriteListId, @@ -212,7 +214,7 @@ public class FavoriteListApi { } - @Path("/{favoriteListId}/lists") + @Path("/favoriteLists/{favoriteListId}/lists") @GET public PaginationResultBean<ChildFavoriteListBean> getChildrenLists(@Context FavoriteListService favoriteListService, @PathParam("favoriteListId") PollenEntityId<FavoriteList> favoriteListId, @@ -223,7 +225,7 @@ public class FavoriteListApi { } - @Path("/{favoriteListId}/lists/{childListId}") + @Path("/favoriteLists/{favoriteListId}/lists/{childListId}") @GET public ChildFavoriteListBean getChildList(@Context FavoriteListService favoriteListService, @PathParam("favoriteListId") PollenEntityId<FavoriteList> favoriteListId, @@ -233,7 +235,7 @@ public class FavoriteListApi { } - @Path("/{favoriteListId}/lists") + @Path("/favoriteLists/{favoriteListId}/lists") @POST public PollenEntityRef<ChildFavoriteList> addChildList(@Context FavoriteListService favoriteListService, @PathParam("favoriteListId") PollenEntityId<FavoriteList> favoriteListId, @@ -243,7 +245,7 @@ public class FavoriteListApi { } - @Path("/{favoriteListId}/lists/{childListId}") + @Path("/favoriteLists/{favoriteListId}/lists/{childListId}") @POST @PUT public ChildFavoriteListBean editChildList(@Context FavoriteListService favoriteListService, @PathParam("favoriteListId") PollenEntityId<FavoriteList> favoriteListId, @@ -253,7 +255,7 @@ public class FavoriteListApi { } - @Path("/{favoriteListId}/lists/{childListId}") + @Path("/favoriteLists/{favoriteListId}/lists/{childListId}") @DELETE public void removeChildList(@Context FavoriteListService favoriteListService, @PathParam("favoriteListId") PollenEntityId<FavoriteList> favoriteListId, @@ -263,7 +265,7 @@ public class FavoriteListApi { } - @Path("/{favoriteListId}/all") + @Path("/favoriteLists/{favoriteListId}/all") @GET public PaginationResultBean<PollenBean> getAllChildren(@Context FavoriteListService favoriteListService, @PathParam("favoriteListId") PollenEntityId<FavoriteList> favoriteListId, diff --git a/pollen-rest-api/src/main/java/org/chorem/pollen/rest/api/v1/PollApi.java b/pollen-rest-api/src/main/java/org/chorem/pollen/rest/api/v1/PollApi.java index 7656fcb5..e4598517 100644 --- a/pollen-rest-api/src/main/java/org/chorem/pollen/rest/api/v1/PollApi.java +++ b/pollen-rest-api/src/main/java/org/chorem/pollen/rest/api/v1/PollApi.java @@ -21,8 +21,6 @@ package org.chorem.pollen.rest.api.v1; * #L% */ -import com.rometools.rome.feed.atom.Feed; -import com.rometools.rome.feed.synd.SyndFeed; import org.chorem.pollen.persistence.entity.ChoiceType; import org.chorem.pollen.persistence.entity.Poll; import org.chorem.pollen.rest.api.beans.PollCreateBean; @@ -58,20 +56,21 @@ import java.util.List; * @author Tony Chemit - dev@tchemit.fr * @since 2.0 */ -@Path("/polls") +@Path("") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) public class PollApi { @GET - @Path("/new") + @Path("/polls/new") public PollBean getNewPoll(@Context PollService pollService) { return pollService.getNewPoll(ChoiceType.TEXT); } + @Path("/polls/polls") @GET public PaginationResultBean<PollBean> getPolls(@Context PollService pollService, @BeanParam PaginationParameterBean paginationParameter) { @@ -81,7 +80,7 @@ public class PollApi { } @GET - @Path("/created") + @Path("/polls/created") public PaginationResultBean<PollBean> getCreatedPolls(@Context PollService pollService, @BeanParam PaginationParameterBean paginationParameter) { @@ -90,7 +89,7 @@ public class PollApi { } @GET - @Path("/invited") + @Path("/polls/invited") public PaginationResultBean<PollBean> getInvitedPolls(@Context PollService pollService, @BeanParam PaginationParameterBean paginationParameter) { @@ -99,7 +98,7 @@ public class PollApi { } @GET - @Path("/participated") + @Path("/polls/participated") public PaginationResultBean<PollBean> getParticipatedPolls(@Context PollService pollService, @BeanParam PaginationParameterBean paginationParameter) { @@ -107,6 +106,7 @@ public class PollApi { } + @Path("/polls") @POST public PollenEntityRef<Poll> createPoll(@Context PollService pollService, PollCreateBean pollCreateBean) throws InvalidFormException { @@ -118,7 +118,7 @@ public class PollApi { } - @Path("/{pollId}") + @Path("/polls/{pollId}") @GET public PollBean getPoll(@Context PollService pollService, @PathParam("pollId") PollenEntityId<Poll> pollId) { @@ -127,7 +127,7 @@ public class PollApi { } - @Path("/{pollId}") + @Path("/polls/{pollId}") @PUT @POST public PollBean editPoll(@Context PollService pollService, @@ -137,7 +137,7 @@ public class PollApi { } - @Path("/{pollId}") + @Path("/polls/{pollId}") @DELETE public void deletePoll(@Context PollService pollService, @PathParam("pollId") PollenEntityId<Poll> pollId) { @@ -146,7 +146,7 @@ public class PollApi { } - @Path("/{pollId}/clone") + @Path("/polls/{pollId}/clone") @POST public PollenEntityRef<Poll> clonePoll(@Context PollService pollService, @PathParam("pollId") PollenEntityId<Poll> pollId) { @@ -155,7 +155,7 @@ public class PollApi { } - @Path("/{pollId}/close") + @Path("/polls/{pollId}/close") @PUT public void closePoll(@Context PollService pollService, @PathParam("pollId") PollenEntityId<Poll> pollId) { @@ -164,7 +164,7 @@ public class PollApi { } - @Path("/{pollId}/reopen") + @Path("/polls/{pollId}/reopen") @POST public void reopenPoll(@Context PollService pollService, @PathParam("pollId") PollenEntityId<Poll> pollId) { @@ -173,7 +173,7 @@ public class PollApi { } - @Path("/{pollId}/export") + @Path("/polls/{pollId}/export") @GET @Produces(MediaType.APPLICATION_OCTET_STREAM) public Response exportPoll(@Context PollService pollService, @@ -184,22 +184,23 @@ public class PollApi { } - @Path("/{pollId}/assign") + @Path("/polls/{pollId}/assign") @PUT public PollBean assignPoll(@Context PollService pollService, @PathParam("pollId") PollenEntityId<Poll> pollId) { return pollService.assignPollToConnectedUser(pollId.getEntityId()); } - @Path("/{pollId}/feed") + @Path("/polls/{pollId}/feed") @Produces(MediaType.APPLICATION_ATOM_XML) - public Feed getFeedForPoll(@Context FeedService feedService, + @GET + public Response getFeedForPoll(@Context FeedService feedService, @PathParam("pollId") PollenEntityId<Poll> pollId) { - SyndFeed feedForPoll = feedService.getFeedForPoll(pollId.getEntityId()); - return ApiUtils.syndFeedToFeed(feedForPoll); + String feedContent = feedService.getFeedContentForPoll(pollId.getEntityId()); + return Response.ok(feedContent).build(); } - @Path("/{pollId}/reports") + @Path("/polls/{pollId}/reports") @POST public void addReport(@Context ReportService reportService, @PathParam("pollId") PollenEntityId<Poll> pollId, @@ -209,7 +210,7 @@ public class PollApi { } - @Path("/{pollId}/reports") + @Path("/polls/{pollId}/reports") @GET public List<ReportBean> getReports(@Context ReportService reportService, @PathParam("pollId") PollenEntityId<Poll> pollId) { @@ -217,7 +218,7 @@ public class PollApi { return reportService.getPollReports(pollId.getEntityId()); } - @Path("/{pollId}/reports/{reportId}") + @Path("/polls/{pollId}/reports/{reportId}") @POST public void saveReport(@Context ReportService reportService, @PathParam("pollId") PollenEntityId<Poll> pollId, diff --git a/pollen-rest-api/src/main/java/org/chorem/pollen/rest/api/v1/PollenResourceApi.java b/pollen-rest-api/src/main/java/org/chorem/pollen/rest/api/v1/PollenResourceApi.java index 2556c82d..8345db5a 100644 --- a/pollen-rest-api/src/main/java/org/chorem/pollen/rest/api/v1/PollenResourceApi.java +++ b/pollen-rest-api/src/main/java/org/chorem/pollen/rest/api/v1/PollenResourceApi.java @@ -54,10 +54,10 @@ import java.io.IOException; * @author dralagen * @since 2.0 */ -@Path("/resources") +@Path("") public class PollenResourceApi { - @Path("/{resourceId}") + @Path("/resources/{resourceId}") @GET @Produces(MediaType.APPLICATION_OCTET_STREAM) public Response getResource(@Context PollenResourceService pollenResourceService, @@ -68,7 +68,7 @@ public class PollenResourceApi { return Response.ok(resource.getResourceContent(), resource.getContentType()).build(); } - @Path("/{resourceId}/download") + @Path("/resources/{resourceId}/download") @GET @Produces(MediaType.APPLICATION_OCTET_STREAM) public Response getDownloadResource(@Context PollenResourceService pollenResourceService, @@ -79,7 +79,7 @@ public class PollenResourceApi { return ApiUtils.ResponseDownload(resource.getResourceContent(), resource.getName(), resource.getContentType()); } - @Path("/{resourceId}/preview") + @Path("/resources/{resourceId}/preview") @GET @Produces(MediaType.APPLICATION_OCTET_STREAM) public Response getPreviewResource(@Context PollenResourceService pollenResourceService, @@ -123,7 +123,7 @@ public class PollenResourceApi { return Response.ok(new ByteArrayInputStream(output.toByteArray()), contentType).build(); } - @Path("/{resourceId}/meta") + @Path("/resources/{resourceId}/meta") @GET @Produces(MediaType.APPLICATION_JSON) public ResourceMetaBean getMetaResource(@Context PollenResourceService pollenResourceService, @@ -132,6 +132,7 @@ public class PollenResourceApi { return pollenResourceService.getMetaResource(resourceId.getEntityId()); } + @Path("/resources") @POST @Consumes(MediaType.MULTIPART_FORM_DATA) @Produces(MediaType.APPLICATION_JSON) @@ -145,7 +146,7 @@ public class PollenResourceApi { return createRef; } - @Path("/{resourceId}") + @Path("/resources/{resourceId}") @POST @Consumes(MediaType.MULTIPART_FORM_DATA) public PollenEntityRef<PollenResource> editResource(@Context PollenResourceService pollenResourceService, @@ -161,7 +162,7 @@ public class PollenResourceApi { } - @Path("/{resourceId}") + @Path("/resources/{resourceId}") @DELETE public void deleteResource(@Context PollenResourceService pollenResourceService, @PathParam("resourceId") PollenEntityId<PollenResource> resourceId) { diff --git a/pollen-rest-api/src/main/java/org/chorem/pollen/rest/api/v1/PollenUserApi.java b/pollen-rest-api/src/main/java/org/chorem/pollen/rest/api/v1/PollenUserApi.java index 9c335d75..d1218eb2 100644 --- a/pollen-rest-api/src/main/java/org/chorem/pollen/rest/api/v1/PollenUserApi.java +++ b/pollen-rest-api/src/main/java/org/chorem/pollen/rest/api/v1/PollenUserApi.java @@ -53,11 +53,12 @@ import java.util.Objects; * @author Tony Chemit - dev@tchemit.fr * @since 2.0 */ -@Path("/users") +@Path("") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) public class PollenUserApi { + @Path("/users") @GET public PaginationResultBean<PollenUserBean> getUsers(@Context PollenUserService pollenUserService, @BeanParam PaginationParameterBean paginationParameter) { @@ -66,7 +67,7 @@ public class PollenUserApi { } - @Path("/connected") + @Path("/users/connected") @GET public PollenUserBean getConnectedUser(@Context PollenSecurityContext securityContext, @Context PollenUserService pollenUserService) { PollenUser pollenUser = securityContext.getPollenUser(); @@ -75,7 +76,7 @@ public class PollenUserApi { } - @Path("/{userId}") + @Path("/users/{userId}") @GET public PollenUserBean getUser(@Context PollenUserService pollenUserService, @PathParam("userId") PollenEntityId<PollenUser> userId) { @@ -84,6 +85,7 @@ public class PollenUserApi { } + @Path("/users") @POST public PollenEntityRef<PollenUser> createUser(@Context PollenUserService pollenUserService, PollenUserBean user) throws InvalidFormException { @@ -92,7 +94,7 @@ public class PollenUserApi { } - @Path("/{userId}") + @Path("/users/{userId}") @POST public PollenUserBean editUser(@Context PollenUserService pollenUserService, PollenUserBean user) throws InvalidFormException { @@ -101,14 +103,14 @@ public class PollenUserApi { } - @Path("/{userId}/admin") + @Path("/users/{userId}/admin") @POST public PollenUserBean adminUser(@Context PollenUserService pollenUserService, PollenUserBean user) { return pollenUserService.adminUser(user); } - @Path("/{userId}") + @Path("/users/{userId}") @DELETE public void deleteUser(@Context PollenUserService pollenUserService, @PathParam("userId") PollenEntityId<PollenUser> userId, @@ -118,7 +120,7 @@ public class PollenUserApi { } - @Path("/{userId}/ban") + @Path("/users/{userId}/ban") @DELETE public void banUser(@Context PollenUserService pollenUserService, @PathParam("userId") PollenEntityId<PollenUser> userId, @@ -127,7 +129,7 @@ public class PollenUserApi { pollenUserService.banUser(userId.getEntityId(), anonymize); } - @Path("/{userId}/makeAdmin") + @Path("/users/{userId}/makeAdmin") @POST public void makeAdmin(@Context PollenUserService pollenUserService, @PathParam("userId") PollenEntityId<PollenUser> userId) { @@ -135,7 +137,7 @@ public class PollenUserApi { pollenUserService.makeAdmin(userId.getEntityId()); } - @Path("/{userId}/unmakeAdmin") + @Path("/users/{userId}/unmakeAdmin") @POST public void unmakeAdmin(@Context PollenUserService pollenUserService, @PathParam("userId") PollenEntityId<PollenUser> userId) { @@ -143,7 +145,7 @@ public class PollenUserApi { pollenUserService.unmakeAdmin(userId.getEntityId()); } - @Path("/{userId}") + @Path("/users/{userId}") @PUT public void validateUserEmail(@Context PollenUserService pollenUserService, @PathParam("userId") PollenEntityId<PollenUser> userId, @@ -153,7 +155,7 @@ public class PollenUserApi { } - @Path("/{userId}/password") + @Path("/users/{userId}/password") @PUT @POST public void changePassword(@Context PollenUserService pollenUserService, @PathParam("userId") PollenEntityId<PollenUser> userId, diff --git a/pollen-rest-api/src/main/java/org/chorem/pollen/rest/api/v1/VoteApi.java b/pollen-rest-api/src/main/java/org/chorem/pollen/rest/api/v1/VoteApi.java index 8fb2478c..4d1a3b04 100644 --- a/pollen-rest-api/src/main/java/org/chorem/pollen/rest/api/v1/VoteApi.java +++ b/pollen-rest-api/src/main/java/org/chorem/pollen/rest/api/v1/VoteApi.java @@ -47,12 +47,12 @@ import java.util.List; * @author Tony Chemit - dev@tchemit.fr * @since 2.0 */ -@Path("/votes/{pollId}") +@Path("") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) public class VoteApi { - @Path("/new") + @Path("/polls/{pollId}/votes/new") @GET public VoteBean getNewVote(@Context VoteService voteService, @PathParam("pollId") PollenEntityId<Poll> pollId) { @@ -61,6 +61,7 @@ public class VoteApi { } + @Path("/polls/{pollId}/votes") @GET public List<VoteBean> getVotes(@Context VoteService voteService, @PathParam("pollId") PollenEntityId<Poll> pollId) { @@ -69,7 +70,7 @@ public class VoteApi { } - @Path("/{voteId}") + @Path("/polls/{pollId}/votes/{voteId}") @GET public VoteBean getVote(@Context VoteService voteService, @PathParam("pollId") PollenEntityId<Poll> pollId, @@ -79,6 +80,7 @@ public class VoteApi { } + @Path("/polls/{pollId}/votes") @POST public PollenEntityRef<Vote> addVote(@Context VoteService voteService, @PathParam("pollId") PollenEntityId<Poll> pollId, @@ -88,7 +90,7 @@ public class VoteApi { } - @Path("/{voteId}") + @Path("/polls/{pollId}/votes/{voteId}") @POST @PUT public VoteBean editVote(@Context VoteService voteService, @PathParam("pollId") PollenEntityId<Poll> pollId, @@ -98,7 +100,7 @@ public class VoteApi { } - @Path("/{voteId}") + @Path("/polls/{pollId}/votes/{voteId}") @DELETE public void deleteVote(@Context VoteService voteService, @PathParam("pollId") PollenEntityId<Poll> pollId, diff --git a/pollen-rest-api/src/main/java/org/chorem/pollen/rest/api/v1/VoteCountingApi.java b/pollen-rest-api/src/main/java/org/chorem/pollen/rest/api/v1/VoteCountingApi.java index 44caa4e5..d8383aef 100644 --- a/pollen-rest-api/src/main/java/org/chorem/pollen/rest/api/v1/VoteCountingApi.java +++ b/pollen-rest-api/src/main/java/org/chorem/pollen/rest/api/v1/VoteCountingApi.java @@ -41,11 +41,12 @@ import javax.ws.rs.core.MediaType; * @author Tony Chemit - dev@tchemit.fr * @since 2.0 */ -@Path("/results/{pollId}") +@Path("") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) public class VoteCountingApi { + @Path("/polls/{pollId}/results") @GET public VoteCountingResultBean getMainResult(@Context VoteCountingService voteCountingService, @PathParam("pollId") PollenEntityId<Poll> pollId) { @@ -54,7 +55,7 @@ public class VoteCountingApi { } - @Path("/group") + @Path("/polls/{pollId}/results/group") @GET public ListVoteCountingResultBean getGroupResult(@Context VoteCountingService voteCountingService, @PathParam("pollId") PollenEntityId<Poll> pollId) { diff --git a/pollen-rest-api/src/main/java/org/chorem/pollen/rest/api/v1/VoteCountingTypeApi.java b/pollen-rest-api/src/main/java/org/chorem/pollen/rest/api/v1/VoteCountingTypeApi.java index 54f771b7..31cfc829 100644 --- a/pollen-rest-api/src/main/java/org/chorem/pollen/rest/api/v1/VoteCountingTypeApi.java +++ b/pollen-rest-api/src/main/java/org/chorem/pollen/rest/api/v1/VoteCountingTypeApi.java @@ -39,17 +39,18 @@ import java.util.List; * @author garandel * @since 2.0 */ -@Path("/voteCountingTypes") +@Path("") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) public class VoteCountingTypeApi { + @Path("/voteCountingTypes") @GET public List<VoteCountingTypeBean> getVoteCountingTypes(@Context VoteCountingTypeService voteCountingTypeService) { return voteCountingTypeService.getVoteCountingTypes(); } - @Path("/{id}") + @Path("/voteCountingTypes/{id}") @GET public VoteCountingTypeBean getVoteCountingType(@Context VoteCountingTypeService voteCountingTypeService, @PathParam("id") int id) { diff --git a/pollen-rest-api/src/main/java/org/chorem/pollen/rest/api/v1/VoterListApi.java b/pollen-rest-api/src/main/java/org/chorem/pollen/rest/api/v1/VoterListApi.java index 652a4df6..b843445b 100644 --- a/pollen-rest-api/src/main/java/org/chorem/pollen/rest/api/v1/VoterListApi.java +++ b/pollen-rest-api/src/main/java/org/chorem/pollen/rest/api/v1/VoterListApi.java @@ -52,7 +52,7 @@ import java.util.Set; * @author Tony Chemit - dev@tchemit.fr * @since 2.0 */ -@Path("/voterLists/{pollId}") +@Path("") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) public class VoterListApi { @@ -69,7 +69,7 @@ public class VoterListApi { // // } - @Path("/main") + @Path("/polls/{pollId}/voterLists/main") @GET public VoterListBean getMainVoterList(@Context VoterListService voterListService, @PathParam("pollId") PollenEntityId<Poll> pollId) { @@ -78,7 +78,7 @@ public class VoterListApi { } - @Path("/{voterListId}") + @Path("/polls/{pollId}/voterLists/{voterListId}") @GET public List<VoterListBean> getVoterLists(@Context VoterListService voterListService, @PathParam("pollId") PollenEntityId<Poll> pollId, @@ -88,7 +88,7 @@ public class VoterListApi { } - @Path("/{voterListId}") + @Path("/polls/{pollId}/voterLists/{voterListId}") @GET public VoterListBean getVoterList(@Context VoterListService voterListService, @PathParam("pollId") PollenEntityId<Poll> pollId, @@ -98,6 +98,7 @@ public class VoterListApi { } + @Path("/polls/{pollId}/voterLists") @POST public PollenEntityRef<VoterList> createVoterList(@Context VoterListService voterListService, @PathParam("pollId") PollenEntityId<Poll> pollId, @@ -110,7 +111,7 @@ public class VoterListApi { } - @Path("/{voterListId}") + @Path("/polls/{pollId}/voterLists/{voterListId}") @POST @PUT public VoterListBean editVoterList(@Context VoterListService voterListService, @PathParam("pollId") PollenEntityId<Poll> pollId, @@ -120,7 +121,7 @@ public class VoterListApi { } - @Path("/{voterListId}") + @Path("/polls/{pollId}/voterLists/{voterListId}") @DELETE public void deleteVoterList(@Context VoterListService voterListService, @PathParam("pollId") PollenEntityId<Poll> pollId, @@ -130,7 +131,7 @@ public class VoterListApi { } - @Path("/{voterListId}/members") + @Path("/polls/{pollId}/voterLists/{voterListId}/members") @GET public Set<VoterListMemberBean> getMembers(@Context VoterListService voterListService, @PathParam("pollId") PollenEntityId<Poll> pollId, @@ -140,7 +141,7 @@ public class VoterListApi { } - @Path("/{voterListId}/members/{memberId}") + @Path("/polls/{pollId}/voterLists/{voterListId}/members/{memberId}") @GET public VoterListMemberBean getMember(@Context VoterListService voterListService, @PathParam("pollId") PollenEntityId<Poll> pollId, @@ -151,7 +152,7 @@ public class VoterListApi { } - @Path("/{voterListId}/members") + @Path("/polls/{pollId}/voterLists/{voterListId}/members") @POST public VoterListMemberBean addMember(@Context VoterListService voterListService, @PathParam("pollId") PollenEntityId<Poll> pollId, @@ -161,7 +162,7 @@ public class VoterListApi { } - @Path("/{voterListId}/members/{memberId}") + @Path("/polls/{pollId}/voterLists/{voterListId}/members/{memberId}") @POST @PUT public VoterListMemberBean editMember(@Context VoterListService voterListService, @PathParam("pollId") PollenEntityId<Poll> pollId, @@ -171,7 +172,7 @@ public class VoterListApi { } - @Path("/{voterListId}/members/{memberId}") + @Path("/polls/{pollId}/voterLists/{voterListId}/members/{memberId}") @DELETE public void deleteMember(@Context VoterListService voterListService, @PathParam("pollId") PollenEntityId<Poll> pollId, @@ -182,7 +183,7 @@ public class VoterListApi { } - @Path("/save") + @Path("/polls/{pollId}/voterLists/save") @POST public void saveVoters(@Context VoterListService voterListService, @PathParam("pollId") PollenEntityId<Poll> pollId, @@ -204,7 +205,7 @@ public class VoterListApi { memberIds); } - @Path("/{voterListId}/resend") + @Path("/polls/{pollId}/voterLists/{voterListId}/resend") @GET public int resendInvitationVoterList(@Context VoterListService voterListService, @PathParam("pollId") PollenEntityId<Poll> pollId, @@ -212,7 +213,7 @@ public class VoterListApi { return voterListService.resendInvitationVoterList(pollId.getEntityId(), voterListId.getEntityId()); } - @Path("/{voterListId}/members/{memberId}/resend") + @Path("/polls/{pollId}/voterLists/{voterListId}/members/{memberId}/resend") @GET public boolean resendInvitationMember(@Context VoterListService voterListService, @PathParam("pollId") PollenEntityId<Poll> pollId, diff --git a/pollen-services/pom.xml b/pollen-services/pom.xml index 7bc05ad7..a17b864f 100644 --- a/pollen-services/pom.xml +++ b/pollen-services/pom.xml @@ -47,26 +47,11 @@ <dependency> <groupId>${project.groupId}</groupId> - <artifactId>pollen-votecounting-normal</artifactId> - <version>${project.version}</version> - </dependency> - <dependency> - <groupId>${project.groupId}</groupId> - <artifactId>pollen-votecounting-percentage</artifactId> - <version>${project.version}</version> - </dependency> - <dependency> - <groupId>${project.groupId}</groupId> <artifactId>pollen-votecounting-condorcet</artifactId> <version>${project.version}</version> </dependency> <dependency> <groupId>${project.groupId}</groupId> - <artifactId>pollen-votecounting-number</artifactId> - <version>${project.version}</version> - </dependency> - <dependency> - <groupId>${project.groupId}</groupId> <artifactId>pollen-votecounting-borda</artifactId> <version>${project.version}</version> </dependency> @@ -100,11 +85,6 @@ </dependency> <dependency> - <groupId>org.nuiton.topia</groupId> - <artifactId>topia-service-flyway</artifactId> - </dependency> - - <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-core</artifactId> </dependency> @@ -223,14 +203,15 @@ <artifactId>log4j</artifactId> <scope>test</scope> </dependency> + <dependency> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-annotations</artifactId> </dependency> <dependency> - <groupId>org.jboss.resteasy</groupId> - <artifactId>resteasy-jaxrs</artifactId> + <groupId>org.jboss.spec.javax.ws.rs</groupId> + <artifactId>jboss-jaxrs-api_2.0_spec</artifactId> </dependency> </dependencies> diff --git a/pollen-services/src/main/java/org/chorem/pollen/services/service/FeedService.java b/pollen-services/src/main/java/org/chorem/pollen/services/service/FeedService.java index 5f94dcf5..077db343 100644 --- a/pollen-services/src/main/java/org/chorem/pollen/services/service/FeedService.java +++ b/pollen-services/src/main/java/org/chorem/pollen/services/service/FeedService.java @@ -119,6 +119,15 @@ public class FeedService extends PollenServiceSupport { } } + public String getFeedContentForPoll(String pollId) { + checkNotNull(pollId); + checkPermission(PermissionVerb.readPoll, pollId); + + Poll poll = getPollService().getPoll0(pollId); + + return poll.getFeedContent(); + } + private void addVoteFeedEntry(Poll poll, Vote vote, String messageKey) { String voterName; if (vote.isAnonymous()) { diff --git a/pollen-ui-riot-js/src/main/web/js/ChoiceService.js b/pollen-ui-riot-js/src/main/web/js/ChoiceService.js index d908b5e4..94c0d6e5 100644 --- a/pollen-ui-riot-js/src/main/web/js/ChoiceService.js +++ b/pollen-ui-riot-js/src/main/web/js/ChoiceService.js @@ -23,60 +23,47 @@ let FetchService = require("./FetchService"); class ChoiceService extends FetchService { - getChoices(pollId, permission) { - let args = {}; - if (permission) { - args.permission = permission; + _getUrlPrefix(pollId, choiceId) { + let url = "/v1/polls/" + pollId + "/choices"; + if (choiceId) { + url += "/" + choiceId; } - return this.getWithParams("/v1/choices/" + pollId, args); + return url; + } + + getChoices(pollId, permission) { + let url = this._getUrlPrefix(pollId); + return this.get(url, {permission: permission}); } addChoice(pollId, form, permission) { - let url = "/v1/choices/" + pollId + "/"; - if (permission) { - url += "?permission=" + permission; - } - return this.post(url, form); + let url = this._getUrlPrefix(pollId); + return this.post(url, form, {permission: permission}); } updateChoice(pollId, form, permission) { - let url = "/v1/choices/" + pollId + "/" + form.id; - if (permission) { - url += "?permission=" + permission; - } - return this.post(url, form); + let url = this._getUrlPrefix(pollId, form.id); + return this.post(url, form, {permission: permission}); } deleteChoice(pollId, choiceId, permission) { - let url = "/v1/choices/" + pollId + "/" + choiceId; - if (permission) { - url += "?permission=" + permission; - } - return this.doDelete(url); + let url = this._getUrlPrefix(pollId, choiceId); + return this.doDelete(url, {permission: permission}); } addReport(pollId, choiceId, report, permission) { - let url = "/v1/choices/" + pollId + "/" + choiceId + "/reports"; - if (permission) { - url += "?permission=" + permission; - } - return this.post(url, report); + let url = this._getUrlPrefix(pollId, choiceId) + "/reports"; + return this.post(url, report, {permission: permission}); } getReports(pollId, choiceId, permission) { - let args = {}; - if (permission) { - args.permission = permission; - } - return this.getWithParams("/v1/choices/" + pollId + "/" + choiceId + "/reports", args); + let url = this._getUrlPrefix(pollId, choiceId) + "/reports"; + return this.get(url, {permission: permission}); } saveReport(pollId, choiceId, report, permission) { - let url = "/v1/choices/" + pollId + "/" + choiceId + "/reports/" + report.id; - if (permission) { - url += "?permission=" + permission; - } - return this.post(url, report); + let url = this._getUrlPrefix(pollId, choiceId) + "/reports/" + report.id; + return this.post(url, report, {permission: permission}); } } diff --git a/pollen-ui-riot-js/src/main/web/js/CommentService.js b/pollen-ui-riot-js/src/main/web/js/CommentService.js index 4e9870cb..e482d11b 100644 --- a/pollen-ui-riot-js/src/main/web/js/CommentService.js +++ b/pollen-ui-riot-js/src/main/web/js/CommentService.js @@ -23,76 +23,56 @@ let FetchService = require("./FetchService"); class CommentService extends FetchService { + _getUrlPrefix(pollId, commentId) { + let url = "/v1/polls/" + pollId + "/comments"; + if (commentId) { + url += "/" + commentId; + } + return url; + } + getComments(pollId, pagination, permission) { let params = Object.assign({}, pagination); if (permission) { params.permission = permission; } - return this.getWithParams("/v1/comments/" + pollId, params); + let url = this._getUrlPrefix(pollId); + return this.get(url, params); } getNewComment(pollId, permission) { - let args = {}; - if (permission) { - args.permission = permission; - } - return this.getWithParams("/v1/comments/" + pollId + "/new", args); + let url = this._getUrlPrefix(pollId) + "/new"; + return this.get(url, {permission: permission}); } createComment(pollId, form, permission) { - let url = "/v1/comments/" + pollId; - if (permission) { - url += "?permission=" + permission; - } - return this.post(url, form); + let url = this._getUrlPrefix(pollId); + return this.post(url, form, {permission: permission}); } updateComment(pollId, form, permission) { - let url = "/v1/comments/" + pollId + "/" + form.id; - if (permission) { - url += "?permission=" + permission; - } - return this.post(url, form); + let url = this._getUrlPrefix(pollId, form.id); + return this.post(url, form, {permission: permission}); } deleteComment(pollId, commentId, permission) { - let url = "/v1/comments/" + pollId + "/" + commentId; - if (permission) { - url += "?permission=" + permission; - } - return this.doDelete(url); + let url = this._getUrlPrefix(pollId, commentId); + return this.doDelete(url, {permission: permission}); } addReport(pollId, commentId, report, permission) { - let url = "/v1/comments/" + pollId + "/" + commentId + "/reports"; - if (permission) { - url += "?permission=" + permission; - } - return this.post(url, report); + let url = this._getUrlPrefix(pollId, commentId) + "/reports"; + return this.post(url, report, {permission: permission}); } getReports(pollId, commentId, permission) { - let args = {}; - if (permission) { - args.permission = permission; - } - return this.getWithParams("/v1/comments/" + pollId + "/" + commentId + "/reports", args); - } - - ignoreReport(pollId, commentId, reportId, permission) { - let args = {}; - if (permission) { - args.permission = permission; - } - return this.getWithParams("/v1/comments/" + pollId + "/" + commentId + "/reports/" + reportId + "/ignore", args); + let url = this._getUrlPrefix(pollId, commentId) + "/reports"; + return this.get(url, {permission: permission}); } saveReport(pollId, commentId, report, permission) { - let url = "/v1/comments/" + pollId + "/" + commentId + "/reports/" + report.id; - if (permission) { - url += "?permission=" + permission; - } - return this.post(url, report); + let url = this._getUrlPrefix(pollId, commentId) + "/reports/" + report.id; + return this.post(url, report, {permission: permission}); } } diff --git a/pollen-ui-riot-js/src/main/web/js/FavoriteListService.js b/pollen-ui-riot-js/src/main/web/js/FavoriteListService.js index fba20a2b..92037c55 100644 --- a/pollen-ui-riot-js/src/main/web/js/FavoriteListService.js +++ b/pollen-ui-riot-js/src/main/web/js/FavoriteListService.js @@ -26,7 +26,7 @@ class FavoriteListService extends FetchService { favoriteLists(pagination, search) { let params = Object.assign({}, pagination); params.search = search || ""; - return this.getWithParams("/v1/favoriteLists", params); + return this.get("/v1/favoriteLists", params); } favoriteList(favoriteListId) { @@ -60,7 +60,7 @@ class FavoriteListService extends FetchService { members(favoriteListId, search, pagination) { let params = Object.assign({}, pagination); params.search = search || ""; - return this.getWithParams("/v1/favoriteLists/" + favoriteListId + "/members", params); + return this.get("/v1/favoriteLists/" + favoriteListId + "/members", params); } member(favoriteListId, memberId) { @@ -82,7 +82,7 @@ class FavoriteListService extends FetchService { childrenLists(favoriteListId, search, pagination) { let params = Object.assign({}, pagination); params.search = search || ""; - return this.getWithParams("/v1/favoriteLists/" + favoriteListId + "/lists", params); + return this.get("/v1/favoriteLists/" + favoriteListId + "/lists", params); } childList(favoriteListId, childListId) { @@ -108,7 +108,7 @@ class FavoriteListService extends FetchService { allChildren(favoriteListId, pagination, search) { let params = Object.assign({}, pagination); params.search = search || ""; - return this.getWithParams("/v1/favoriteLists/" + favoriteListId + "/all", params); + return this.get("/v1/favoriteLists/" + favoriteListId + "/all", params); } } diff --git a/pollen-ui-riot-js/src/main/web/js/FetchService.js b/pollen-ui-riot-js/src/main/web/js/FetchService.js index 72abddfc..3feec02f 100644 --- a/pollen-ui-riot-js/src/main/web/js/FetchService.js +++ b/pollen-ui-riot-js/src/main/web/js/FetchService.js @@ -71,39 +71,47 @@ class FetchService { }); } - get(url) { + get(url, params) { + url = this._addParamsToUrl(url, params); return this.fetch(url, "GET"); } - getWithParams(url, params) { - let query = "?"; - let keys = Object.keys(params); - keys.forEach((key) => { - let value = params[key]; - if (typeof value === "object") { - value = JSON.stringify(value); - } - if (query.length > 1) { - query += "&"; - } - query += key + "=" + value; - }); - return this.fetch(url + query, "GET"); + + _addParamsToUrl(url, params) { + if (params) { + let query = "?"; + let keys = Object.keys(params); + keys.forEach((key) => { + let value = params[key]; + if (typeof value === "object") { + value = JSON.stringify(value); + } + if (query.length > 1) { + query += "&"; + } + query += key + "=" + value; + }); + return url + query; + } + return url; } - post(url, body) { + post(url, body, params) { + url = this._addParamsToUrl(url, params); return this.fetch(url, "POST", null, body); } - put(url, body) { + put(url, body, params) { + url = this._addParamsToUrl(url, params); return this.fetch(url, "PUT", null, body); } - doDelete(url, body) { + doDelete(url, body, params) { + url = this._addParamsToUrl(url, params); return this.fetch(url, "DELETE", null, body); } - form(url, data, doNotStringify) { + form(url, data, doNotStringify, params) { let formData = null; if (data) { formData = new FormData(); @@ -118,6 +126,7 @@ class FetchService { } }); } + url = this._addParamsToUrl(url, params); return this.fetch(url, "POST", null, formData); } } diff --git a/pollen-ui-riot-js/src/main/web/js/PollService.js b/pollen-ui-riot-js/src/main/web/js/PollService.js index 23af7667..cd27b87a 100644 --- a/pollen-ui-riot-js/src/main/web/js/PollService.js +++ b/pollen-ui-riot-js/src/main/web/js/PollService.js @@ -23,8 +23,17 @@ let FetchService = require("./FetchService"); class PollService extends FetchService { + _getUrlPrefix(pollId) { + let url = "/v1/polls"; + if (pollId) { + url += "/" + pollId; + } + return url; + } + empty(choiceType) { - return this.getWithParams("/v1/polls/new", {choiceType: choiceType}); + let url = this._getUrlPrefix() + "/new"; + return this.get(url, {choiceType: choiceType}); } create(poll, choices, voterLists, voterListMembers) { @@ -35,7 +44,8 @@ class PollService extends FetchService { delete poll2.anonymousVote; delete poll2.alreadyParticipants; delete poll2.limitChoices; - return this.post("/v1/polls", {poll: poll2, choices: choices, voterLists: voterLists, voterListMembers: voterListMembers}); + let url = this._getUrlPrefix(); + return this.post(url, {poll: poll2, choices: choices, voterLists: voterLists, voterListMembers: voterListMembers}); } save(poll) { @@ -46,84 +56,68 @@ class PollService extends FetchService { delete poll2.anonymousVote; delete poll2.alreadyParticipants; delete poll2.limitChoices; - return this.post("/v1/polls/" + poll.id + "?permission=" + poll.permission, poll2); + let url = this._getUrlPrefix(poll.id); + return this.post(url, poll2, {permission: poll.permission}); } createdPolls(pagination) { - return this.getWithParams("/v1/polls/created", pagination); + let url = this._getUrlPrefix() + "/created"; + return this.get(url, pagination); } invitedPolls(pagination) { - return this.getWithParams("/v1/polls/invited", pagination); + let url = this._getUrlPrefix() + "/invited"; + return this.get(url, pagination); } participatedPolls(pagination) { - return this.getWithParams("/v1/polls/participated", pagination); + let url = this._getUrlPrefix() + "/participated"; + return this.get(url, pagination); } polls(pagination) { - return this.getWithParams("/v1/polls", pagination); + let url = this._getUrlPrefix(); + return this.get(url, pagination); } deletePoll(pollId, permission) { - let url = "/v1/polls/" + pollId + "?permission=" + permission; - return this.doDelete(url); + let url = this._getUrlPrefix(pollId); + return this.doDelete(url, {permission: permission}); } getPoll(pollId, permission) { - let url = "/v1/polls/" + pollId; - if (permission) { - url += "?permission=" + permission; - } - return this.get(url); + let url = this._getUrlPrefix(pollId); + return this.get(url, {permission: permission}); } closePoll(pollId, permission) { - let url = "/v1/polls/" + pollId + "/close"; - if (permission) { - url += "?permission=" + permission; - } - return this.put(url); + let url = this._getUrlPrefix(pollId) + "/close"; + return this.put(url, null, {permission: permission}); } reopenPoll(pollId, permission) { - let url = "/v1/polls/" + pollId + "/reopen"; - if (permission) { - url += "?permission=" + permission; - } - return this.put(url); + let url = this._getUrlPrefix(pollId) + "/reopen"; + return this.put(url, null, {permission: permission}); } assignPoll(pollId, permission) { - let url = "/v1/polls/" + pollId + "/assign"; - if (permission) { - url += "?permission=" + permission; - } - return this.put(url); + let url = this._getUrlPrefix(pollId) + "/assign"; + return this.put(url, null, {permission: permission}); } addReport(pollId, targetId, report, permission) { - let url = "/v1/polls/" + pollId + "/reports"; - if (permission) { - url += "?permission=" + permission; - } - return this.form(url, {report: report}); + let url = this._getUrlPrefix(pollId) + "/reports"; + return this.post(url, {report: report}, {permission: permission}); } getReports(pollId, targetId, permission) { - let args = {}; - if (permission) { - args.permission = permission; - } - return this.getWithParams("/v1/polls/" + pollId + "/reports", args); + let url = this._getUrlPrefix(pollId) + "/reports"; + return this.get(url, {permission: permission}); } saveReport(pollId, targetId, report, permission) { - let url = "/v1/polls/" + pollId + "/reports/" + report.id; - if (permission) { - url += "?permission=" + permission; - } - return this.form(url, {report: report}); + let url = this._getUrlPrefix(pollId) + "/reports/" + report.id; + return this.post(url, {report: report}, {permission: permission}); } } diff --git a/pollen-ui-riot-js/src/main/web/js/ResourceService.js b/pollen-ui-riot-js/src/main/web/js/ResourceService.js index 35cfa195..42521b84 100644 --- a/pollen-ui-riot-js/src/main/web/js/ResourceService.js +++ b/pollen-ui-riot-js/src/main/web/js/ResourceService.js @@ -24,25 +24,37 @@ let logger = require("./Logger"); class ResourceService extends FetchService { + _getUrlPrefix(resourceId) { + let url = "/v1/resources"; + if (resourceId) { + url += "/" + resourceId; + } + return url; + } + create(resource) { - logger.log(resource); - return this.form("/v1/resources", {resource: resource}, true); + let url = this._getUrlPrefix(); + return this.form(url, {resource: resource}, true); } getResource(resourceId) { - return this.get("/v1/resources/" + resourceId); + let url = this._getUrlPrefix(resourceId); + return this.get(url); } getPreview(resourceId) { - return this.get("/v1/resources/" + resourceId + "/preview"); + let url = this._getUrlPrefix(resourceId) + "/preview"; + return this.get(url); } getMeta(resourceId) { - return this.get("/v1/resources/" + resourceId + "/meta"); + let url = this._getUrlPrefix(resourceId) + "/meta"; + return this.get(url); } delete(resourceId) { - return this.doDelete("/v1/resources/" + resourceId); + let url = this._getUrlPrefix(resourceId); + return this.doDelete(url); } } diff --git a/pollen-ui-riot-js/src/main/web/js/ResultService.js b/pollen-ui-riot-js/src/main/web/js/ResultService.js index d6e70ccc..fff4c503 100644 --- a/pollen-ui-riot-js/src/main/web/js/ResultService.js +++ b/pollen-ui-riot-js/src/main/web/js/ResultService.js @@ -23,12 +23,14 @@ let FetchService = require("./FetchService"); class ResultService extends FetchService { + _getUrlPrefix(pollId) { + let url = "/v1/polls/" + pollId + "/results"; + return url; + } + getResults(pollId, permission) { - let args = {}; - if (permission) { - args.permission = permission; - } - return this.getWithParams("/v1/results/" + pollId, args); + let url = this._getUrlPrefix(pollId); + return this.get(url, {permission: permission}); } } diff --git a/pollen-ui-riot-js/src/main/web/js/UserService.js b/pollen-ui-riot-js/src/main/web/js/UserService.js index 93c7605d..13f41cb1 100644 --- a/pollen-ui-riot-js/src/main/web/js/UserService.js +++ b/pollen-ui-riot-js/src/main/web/js/UserService.js @@ -23,48 +23,56 @@ let FetchService = require("./FetchService"); class UserService extends FetchService { + _getUrlPrefix(userId) { + let url = "/v1/users"; + if (userId) { + url += "/" + userId; + } + return url; + } + users(pagination) { - return this.getWithParams("/v1/users", pagination); + let url = this._getUrlPrefix(); + return this.get(url, pagination); } user(userId, permission) { - let url = "/v1/users/" + userId; - if (permission) { - url += "?permission=" + permission; - } - return this.get(url); + let url = this._getUrlPrefix(userId); + return this.get(url, {permission: permission}); } makeAdmin(userId) { - let url = "/v1/users/" + userId + "/makeAdmin"; + let url = this._getUrlPrefix(userId) + "/makeAdmin"; return this.post(url); } unmakeAdmin(userId) { - let url = "/v1/users/" + userId + "/unmakeAdmin"; + let url = this._getUrlPrefix(userId) + "/unmakeAdmin"; return this.post(url); } deleteUser(userId) { - let url = "/v1/users/" + userId + "?anonymize=true"; - return this.doDelete(url); + let url = this._getUrlPrefix(userId); + return this.doDelete(url, {anonymize: true}); } banUser(userId) { - let url = "/v1/users/" + userId + "/ban?anonymize=true"; - return this.doDelete(url); + let url = this._getUrlPrefix(userId) + "/ban"; + return this.doDelete(url, {anonymize: true}); } saveUser(user) { - return this.post("/v1/users/edit", user); + let url = this._getUrlPrefix() + "/edit"; + return this.post(url, user); } changePassword(userId, oldPassword, newPassword) { + let url = this._getUrlPrefix(userId) + "/password"; let body = { oldPassword: oldPassword, newPassword: newPassword }; - return this.post("/v1/users/" + userId + "/password", body); + return this.post(url, body); } } diff --git a/pollen-ui-riot-js/src/main/web/js/VoteCountingTypeService.js b/pollen-ui-riot-js/src/main/web/js/VoteCountingTypeService.js index 1cae4268..2bd90a00 100644 --- a/pollen-ui-riot-js/src/main/web/js/VoteCountingTypeService.js +++ b/pollen-ui-riot-js/src/main/web/js/VoteCountingTypeService.js @@ -23,12 +23,22 @@ let FetchService = require("./FetchService"); class VoteCountingTypeService extends FetchService { + _getUrlPrefix(voteCountingTypeId) { + let url = "/v1/voteCountingTypes"; + if (voteCountingTypeId) { + url += "/" + voteCountingTypeId; + } + return url; + } + getVoteCountingType(voteCountingTypeId) { - return this.get("/v1/voteCountingTypes/" + voteCountingTypeId); + let url = this._getUrlPrefix(voteCountingTypeId); + return this.get(url); } getVoteCountingTypes() { - return this.get("/v1/voteCountingTypes"); + let url = this._getUrlPrefix(); + return this.get(url); } } diff --git a/pollen-ui-riot-js/src/main/web/js/VoteService.js b/pollen-ui-riot-js/src/main/web/js/VoteService.js index 92c71e43..2805c44b 100644 --- a/pollen-ui-riot-js/src/main/web/js/VoteService.js +++ b/pollen-ui-riot-js/src/main/web/js/VoteService.js @@ -23,44 +23,37 @@ let FetchService = require("./FetchService"); class VoteService extends FetchService { - getVotes(pollId, permission) { - let args = {}; - if (permission) { - args.permission = permission; + _getUrlPrefix(pollId, voteId) { + let url = "/v1/polls/" + pollId + "/votes"; + if (voteId) { + url += "/" + voteId; } - return this.getWithParams("/v1/votes/" + pollId, args); + return url; + } + + getVotes(pollId, permission) { + let url = this._getUrlPrefix(pollId); + return this.get(url, {permission: permission}); } addVote(pollId, form, permission) { - let url = "/v1/votes/" + pollId; - if (permission) { - url += "?permission=" + permission; - } - return this.post(url, form); + let url = this._getUrlPrefix(pollId); + return this.post(url, form, {permission: permission}); } getNewVote(pollId, permission) { - let args = {}; - if (permission) { - args.permission = permission; - } - return this.getWithParams("/v1/votes/" + pollId + "/new", args); + let url = this._getUrlPrefix(pollId) + "/new"; + return this.get(url, {permission: permission}); } updateVote(pollId, form, permission) { - let url = "/v1/votes/" + pollId + "/" + form.id; - if (permission) { - url += "?permission=" + permission; - } - return this.post(url, form); + let url = this._getUrlPrefix(pollId, form.id); + return this.post(url, form, {permission: permission}); } deleteVote(pollId, voteId, permission) { - let url = "/v1/votes/" + pollId + "/" + voteId; - if (permission) { - url += "?permission=" + permission; - } - return this.doDelete(url); + let url = this._getUrlPrefix(pollId, voteId); + return this.doDelete(url, {permission: permission}); } } diff --git a/pollen-ui-riot-js/src/main/web/js/VoterListService.js b/pollen-ui-riot-js/src/main/web/js/VoterListService.js index ac81784f..088347e5 100644 --- a/pollen-ui-riot-js/src/main/web/js/VoterListService.js +++ b/pollen-ui-riot-js/src/main/web/js/VoterListService.js @@ -42,6 +42,14 @@ class VoterListService extends FetchService { }; } + _getUrlPrefix(pollId, voterListId) { + let url = "/v1/polls/" + pollId + "/voterLists"; + if (voterListId) { + url += "/" + voterListId; + } + return url; + } + init(pollForm) { this.tempId = 1; this.voterListsById = {}; @@ -51,7 +59,8 @@ class VoterListService extends FetchService { this.pollForm = pollForm; let mainVoterListPromise = Promise.resolve(); if (this.pollForm.model && this.pollForm.model.id) { - mainVoterListPromise = this.getWithParams("/v1/voterLists/" + pollForm.model.id + "/main", {permission: pollForm.model.permission}); + let url = this._getUrlPrefix(pollForm.model.id) + "/main"; + mainVoterListPromise = this.get(url, {permission: pollForm.model.permission}); } mainVoterListPromise = mainVoterListPromise.then(list => { let mainList = list || this._newVoterList(); @@ -66,9 +75,10 @@ class VoterListService extends FetchService { if (!voterList.loadded) { voterListPromise = Promise.resolve([[], []]); if (this.pollForm.model && this.pollForm.model.id && !voterList.subLists && !voterList.id.startsWith(this.tempPrefix)) { + let url = this._getUrlPrefix(this.pollForm.model.id, voterList.id); voterListPromise = Promise.all([ - this.getWithParams("/v1/voterLists/" + this.pollForm.model.id + "/" + voterList.id + "/lists", {permission: this.pollForm.model.permission}), - this.getWithParams("/v1/voterLists/" + this.pollForm.model.id + "/" + voterList.id + "/members", {permission: this.pollForm.model.permission})]); + this.get(url + "/lists", {permission: this.pollForm.model.permission}), + this.get(url + "/members", {permission: this.pollForm.model.permission})]); } voterListPromise.then(result => { voterList.subLists = result[0]; @@ -167,13 +177,15 @@ class VoterListService extends FetchService { } save() { - return this.post("/v1/voterLists/" + this.pollForm.model.id + "/save?permission=" + this.pollForm.model.permission, + let url = this._getUrlPrefix(this.pollForm.model.id) + "/save"; + return this.post(url, { listsToSave: this.getVoterLists(), membersToSave: this.getVoterListMembers(), listsToDelete: this.voterListsToDelete, membersToDelete: this.voterListMembersToDelete - }); + }, + {permission: this.pollForm.model.permission}); } importFavoriteList(voterList, favoriteListId) { @@ -207,17 +219,16 @@ class VoterListService extends FetchService { resendInvitationList(voterList) { if (!voterList.temp) { - return this.getWithParams("/v1/voterLists/" + this.pollForm.model.id + "/" + voterList.id + "/resend", {permission: this.pollForm.model.permission}); + let url = this._getUrlPrefix(this.pollForm.model.id, voterList.id) + "/resend"; + return this.get(url, {permission: this.pollForm.model.permission}); } return Promise.reject(); } resendInvitationMember(member) { if (!member.temp) { - return this.getWithParams("/v1/voterLists/" + this.pollForm.model.id - + "/" + member.voterListId - + "/members/" + member.id + "/resend", - {permission: this.pollForm.model.permission}); + let url = this._getUrlPrefix(this.pollForm.model.id, member.voterListId) + "/members/" + member.id + "/resend"; + return this.get(url, {permission: this.pollForm.model.permission}); } return Promise.reject(); } diff --git a/pom.xml b/pom.xml index 8a322595..bcc9711a 100644 --- a/pom.xml +++ b/pom.xml @@ -173,11 +173,13 @@ <projectId>pollen</projectId> <!-- customized versions --> - <resteasy.version>3.0.17.Final</resteasy.version> + <resteasyVersion>3.0.17.Final</resteasyVersion> + <jacksonVersion>2.8.0</jacksonVersion> <nuitonI18nVersion>3.6.2</nuitonI18nVersion> <eugenePluginVersion>3.0-alpha-10</eugenePluginVersion> <topiaVersion>3.2</topiaVersion> + <flywayVersion>4.0.3</flywayVersion> <nuitonWebVersion>1.19-SNAPSHOT</nuitonWebVersion> <nuitonUtilsVersion>3.0-rc-17</nuitonUtilsVersion> @@ -319,6 +321,12 @@ </dependency> <dependency> + <groupId>org.flywaydb</groupId> + <artifactId>flyway-core</artifactId> + <version>${flywayVersion}</version> + </dependency> + + <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-core</artifactId> <version>${hibernateVersion}</version> @@ -369,31 +377,50 @@ <dependency> <groupId>org.jboss.resteasy</groupId> <artifactId>resteasy-jaxrs</artifactId> - <version>${resteasy.version}</version> + <version>${resteasyVersion}</version> </dependency> <dependency> <groupId>org.jboss.resteasy</groupId> <artifactId>resteasy-servlet-initializer</artifactId> - <version>${resteasy.version}</version> + <version>${resteasyVersion}</version> </dependency> <dependency> <groupId>org.jboss.resteasy</groupId> <artifactId>resteasy-jackson2-provider</artifactId> - <version>${resteasy.version}</version> + <version>${resteasyVersion}</version> </dependency> + <dependency> <groupId>org.jboss.resteasy</groupId> <artifactId>resteasy-multipart-provider</artifactId> - <version>${resteasy.version}</version> + <version>${resteasyVersion}</version> </dependency> <dependency> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-annotations</artifactId> + <version>${jacksonVersion}</version> + </dependency> + + <dependency> + <groupId>com.fasterxml.jackson.core</groupId> + <artifactId>jackson-core</artifactId> + <version>${jacksonVersion}</version> + </dependency> + + <dependency> + <groupId>com.fasterxml.jackson.core</groupId> + <artifactId>jackson-databind</artifactId> <version>2.8.0</version> </dependency> + <dependency> + <groupId>org.jboss.spec.javax.ws.rs</groupId> + <artifactId>jboss-jaxrs-api_2.0_spec</artifactId> + <version>1.0.0.Final</version> + </dependency> + <!-- Nuiton libs --> <dependency> -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.