Commit 818c37e7 authored by Alex Proca's avatar Alex Proca

Plugin: userservice. Get REST responses in JSON too

parent ee1801ee
......@@ -25,7 +25,7 @@ public class UserGroupService {
}
@GET
@Produces(MediaType.APPLICATION_XML)
@Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
public UserGroupsEntity getUserGroups(@PathParam("username") String username) throws ServiceException {
return new UserGroupsEntity(plugin.getUserGroups(username));
}
......
......@@ -35,7 +35,7 @@ public class UserRosterService {
}
@GET
@Produces(MediaType.APPLICATION_XML)
@Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
public RosterEntities getUserRoster(@PathParam("username") String username) throws ServiceException {
return plugin.getRosterEntities(username);
}
......
......@@ -28,7 +28,7 @@ public class UserService {
}
@GET
@Produces(MediaType.APPLICATION_XML)
@Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
public UserEntities getUsers(@QueryParam("search") String userSearch) {
return plugin.getUserEntities(userSearch);
}
......@@ -41,7 +41,7 @@ public class UserService {
@GET
@Path("/{username}")
@Produces(MediaType.APPLICATION_XML)
@Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
public UserEntity getUser(@PathParam("username") String username) throws ServiceException {
return plugin.getUserEntity(username);
}
......
......@@ -22,14 +22,14 @@ public class UserServiceProperties {
}
@GET
@Produces(MediaType.APPLICATION_XML)
@Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
@Path("/{key}")
public UserEntities getUsersByPropertyKey(@PathParam("key") String key) throws ServiceException {
return plugin.getUserEntitiesByProperty(key, null);
}
@GET
@Produces(MediaType.APPLICATION_XML)
@Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
@Path("/{key}/{value}")
public UserEntities getUsersByPropertyKeyValue(@PathParam("key") String key, @PathParam("value") String value)
throws ServiceException {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment