|
|
|
@ -1,12 +1,10 @@
|
|
|
|
|
package org.gcube.portal.social.networking.ws.lib;
|
|
|
|
|
package org.gcube.portal.social.networking.ws.methods.v2;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import com.webcohesion.enunciate.metadata.Ignore;
|
|
|
|
|
import com.webcohesion.enunciate.metadata.rs.RequestHeader;
|
|
|
|
|
import com.webcohesion.enunciate.metadata.rs.RequestHeaders;
|
|
|
|
|
import com.webcohesion.enunciate.metadata.rs.ResponseCode;
|
|
|
|
|
import com.webcohesion.enunciate.metadata.rs.StatusCodes;
|
|
|
|
|
import org.apache.commons.lang.Validate;
|
|
|
|
|
import org.gcube.portal.databook.shared.*;
|
|
|
|
|
import org.gcube.portal.social.networking.ws.outputs.ResponseBean;
|
|
|
|
|
import org.gcube.portal.social.networking.ws.utils.CassandraConnection;
|
|
|
|
@ -18,7 +16,6 @@ import javax.validation.ValidationException;
|
|
|
|
|
import javax.validation.constraints.Min;
|
|
|
|
|
import javax.validation.constraints.NotNull;
|
|
|
|
|
import javax.ws.rs.*;
|
|
|
|
|
import javax.ws.rs.core.GenericType;
|
|
|
|
|
import javax.ws.rs.core.MediaType;
|
|
|
|
|
import javax.ws.rs.core.Response;
|
|
|
|
|
import javax.ws.rs.core.Response.Status;
|
|
|
|
@ -29,22 +26,21 @@ import java.util.Map;
|
|
|
|
|
* REST interface for the social networking library (comments).
|
|
|
|
|
* @author Ahmed Ibrahim ISTI-CNR
|
|
|
|
|
*/
|
|
|
|
|
@Path("lib/")
|
|
|
|
|
@Path("2/lib")
|
|
|
|
|
@RequestHeaders ({
|
|
|
|
|
@RequestHeader( name = "Authorization", description = "Bearer token, see https://dev.d4science.org/how-to-access-resources"),
|
|
|
|
|
@RequestHeader( name = "Content-Type", description = "application/json")
|
|
|
|
|
})
|
|
|
|
|
@Ignore
|
|
|
|
|
public class LibRestAPI {
|
|
|
|
|
public class Lib {
|
|
|
|
|
|
|
|
|
|
// Logger
|
|
|
|
|
private static final org.slf4j.Logger logger = LoggerFactory.getLogger(LibRestAPI.class);
|
|
|
|
|
private static final org.slf4j.Logger logger = LoggerFactory.getLogger(Lib.class);
|
|
|
|
|
|
|
|
|
|
//Comments
|
|
|
|
|
@POST
|
|
|
|
|
@Consumes(MediaType.APPLICATION_JSON)
|
|
|
|
|
@Produces(MediaType.APPLICATION_JSON)
|
|
|
|
|
@Path("add-comment-lib")
|
|
|
|
|
@Path("add-comment-lib/")
|
|
|
|
|
public Response addCommentLib(@NotNull(message="Comment to write is missing")
|
|
|
|
|
@Valid
|
|
|
|
|
Comment comment)throws ValidationException {
|
|
|
|
@ -67,7 +63,7 @@ public class LibRestAPI {
|
|
|
|
|
|
|
|
|
|
@GET
|
|
|
|
|
@Produces(MediaType.APPLICATION_JSON)
|
|
|
|
|
@Path("read-comment-by-id-lib")
|
|
|
|
|
@Path("read-comment-by-id-lib/")
|
|
|
|
|
public Response readCommentByIdLib(@QueryParam("commentid")
|
|
|
|
|
String commentid)throws ValidationException{
|
|
|
|
|
ResponseBean responseBean = new ResponseBean();
|
|
|
|
@ -89,7 +85,7 @@ public class LibRestAPI {
|
|
|
|
|
|
|
|
|
|
@GET
|
|
|
|
|
@Produces(MediaType.APPLICATION_JSON)
|
|
|
|
|
@Path("get-comments-by-post-id-lib")
|
|
|
|
|
@Path("get-comments-by-post-id-lib/")
|
|
|
|
|
@StatusCodes ({
|
|
|
|
|
@ResponseCode ( code = 200, condition = "The list of comments is put into the 'result' field"),
|
|
|
|
|
@ResponseCode ( code = 500, condition = ErrorMessages.ERROR_IN_API_RESULT)
|
|
|
|
@ -120,7 +116,7 @@ public class LibRestAPI {
|
|
|
|
|
|
|
|
|
|
@GET
|
|
|
|
|
@Produces(MediaType.APPLICATION_JSON)
|
|
|
|
|
@Path("get-recent-comments-by-user-and-date-lib")
|
|
|
|
|
@Path("get-recent-comments-by-user-and-date-lib/")
|
|
|
|
|
public Response getRecentCommentsByUserAndDateLib(
|
|
|
|
|
@QueryParam("time")
|
|
|
|
|
@Min(value = 0, message="time cannot be negative")
|
|
|
|
@ -152,7 +148,7 @@ public class LibRestAPI {
|
|
|
|
|
@POST
|
|
|
|
|
@Consumes(MediaType.APPLICATION_JSON)
|
|
|
|
|
@Produces(MediaType.APPLICATION_JSON)
|
|
|
|
|
@Path("edit-comment-lib")
|
|
|
|
|
@Path("edit-comment-lib/")
|
|
|
|
|
public Response editCommentLib(
|
|
|
|
|
@NotNull(message="Comment to edit is missing")
|
|
|
|
|
@Valid
|
|
|
|
@ -178,7 +174,7 @@ public class LibRestAPI {
|
|
|
|
|
@POST
|
|
|
|
|
@Consumes(MediaType.APPLICATION_JSON)
|
|
|
|
|
@Produces(MediaType.APPLICATION_JSON)
|
|
|
|
|
@Path("delete-comment-lib")
|
|
|
|
|
@Path("delete-comment-lib/")
|
|
|
|
|
public Response deleteCommentLib(
|
|
|
|
|
@QueryParam("commentid")
|
|
|
|
|
String commentid,
|
|
|
|
@ -206,7 +202,7 @@ public class LibRestAPI {
|
|
|
|
|
@POST
|
|
|
|
|
@Consumes(MediaType.APPLICATION_JSON)
|
|
|
|
|
@Produces(MediaType.APPLICATION_JSON)
|
|
|
|
|
@Path("save-hashtag-lib")
|
|
|
|
|
@Path("save-hashtag-lib/")
|
|
|
|
|
public Response saveHashTagsLib(
|
|
|
|
|
@QueryParam("feedid")
|
|
|
|
|
String feedid,
|
|
|
|
@ -237,7 +233,7 @@ public class LibRestAPI {
|
|
|
|
|
@POST
|
|
|
|
|
@Consumes(MediaType.APPLICATION_JSON)
|
|
|
|
|
@Produces(MediaType.APPLICATION_JSON)
|
|
|
|
|
@Path("delete-hashtag-lib")
|
|
|
|
|
@Path("delete-hashtag-lib/")
|
|
|
|
|
public Response deleteHashTagsLib(
|
|
|
|
|
@QueryParam("feedid")
|
|
|
|
|
String feedid,
|
|
|
|
@ -268,7 +264,7 @@ public class LibRestAPI {
|
|
|
|
|
@POST
|
|
|
|
|
@Consumes(MediaType.APPLICATION_JSON)
|
|
|
|
|
@Produces(MediaType.APPLICATION_JSON)
|
|
|
|
|
@Path("save-hashtag-comment-lib")
|
|
|
|
|
@Path("save-hashtag-comment-lib/")
|
|
|
|
|
public Response saveHashTagsCommentLib(
|
|
|
|
|
@QueryParam("commentid")
|
|
|
|
|
String commentid,
|
|
|
|
@ -298,7 +294,7 @@ public class LibRestAPI {
|
|
|
|
|
@POST
|
|
|
|
|
@Consumes(MediaType.APPLICATION_JSON)
|
|
|
|
|
@Produces(MediaType.APPLICATION_JSON)
|
|
|
|
|
@Path("delete-hashtag-comment-lib")
|
|
|
|
|
@Path("delete-hashtag-comment-lib/")
|
|
|
|
|
public Response deleteHashTagsCommentLib(
|
|
|
|
|
@QueryParam("commentid")
|
|
|
|
|
String commentid,
|
|
|
|
@ -328,7 +324,7 @@ public class LibRestAPI {
|
|
|
|
|
|
|
|
|
|
@GET
|
|
|
|
|
@Produces(MediaType.APPLICATION_JSON)
|
|
|
|
|
@Path("get-vre-hashtags-occurrences-lib")
|
|
|
|
|
@Path("get-vre-hashtags-occurrences-lib/")
|
|
|
|
|
public Response getVREHashtagsWithOccurrenceLib(
|
|
|
|
|
@QueryParam("vreid")
|
|
|
|
|
String vreid
|
|
|
|
@ -356,7 +352,7 @@ public class LibRestAPI {
|
|
|
|
|
|
|
|
|
|
@GET
|
|
|
|
|
@Produces(MediaType.APPLICATION_JSON)
|
|
|
|
|
@Path("get-vre-hashtags-occurrences-time-lib")
|
|
|
|
|
@Path("get-vre-hashtags-occurrences-time-lib/")
|
|
|
|
|
public Response getVREHashtagsWithOccurrenceFilteredByTimeLib(
|
|
|
|
|
@QueryParam("vreid")
|
|
|
|
|
String vreid,
|
|
|
|
@ -386,7 +382,7 @@ public class LibRestAPI {
|
|
|
|
|
|
|
|
|
|
@GET
|
|
|
|
|
@Produces(MediaType.APPLICATION_JSON)
|
|
|
|
|
@Path("get-vre-post-by-hashtag-lib")
|
|
|
|
|
@Path("get-vre-post-by-hashtag-lib/")
|
|
|
|
|
public Response getVREFeedsByHashtagLib(
|
|
|
|
|
@QueryParam("vreid")
|
|
|
|
|
String vreid,
|
|
|
|
@ -417,7 +413,7 @@ public class LibRestAPI {
|
|
|
|
|
//Invites
|
|
|
|
|
@GET
|
|
|
|
|
@Produces(MediaType.APPLICATION_JSON)
|
|
|
|
|
@Path("is-existing-invite-lib")
|
|
|
|
|
@Path("is-existing-invite-lib/")
|
|
|
|
|
public Response isExistingInviteLib(
|
|
|
|
|
@QueryParam("vreid")
|
|
|
|
|
String vreid,
|
|
|
|
@ -446,7 +442,7 @@ public class LibRestAPI {
|
|
|
|
|
@POST
|
|
|
|
|
@Consumes(MediaType.APPLICATION_JSON)
|
|
|
|
|
@Produces(MediaType.APPLICATION_JSON)
|
|
|
|
|
@Path("save-invite-lib")
|
|
|
|
|
@Path("save-invite-lib/")
|
|
|
|
|
public Response saveInviteLib(
|
|
|
|
|
@NotNull(message="invite to save is missing")
|
|
|
|
|
@Valid
|
|
|
|
@ -472,7 +468,7 @@ public class LibRestAPI {
|
|
|
|
|
|
|
|
|
|
@GET
|
|
|
|
|
@Produces(MediaType.APPLICATION_JSON)
|
|
|
|
|
@Path("read-invite-lib")
|
|
|
|
|
@Path("read-invite-lib/")
|
|
|
|
|
public Response readInviteLib(
|
|
|
|
|
@QueryParam("inviteid")
|
|
|
|
|
String inviteid
|
|
|
|
@ -500,7 +496,7 @@ public class LibRestAPI {
|
|
|
|
|
@POST
|
|
|
|
|
@Consumes(MediaType.APPLICATION_JSON)
|
|
|
|
|
@Produces(MediaType.APPLICATION_JSON)
|
|
|
|
|
@Path("set-invite-status-lib")
|
|
|
|
|
@Path("set-invite-status-lib/")
|
|
|
|
|
public Response setInviteStatusLib(
|
|
|
|
|
@QueryParam("vreid")
|
|
|
|
|
String vreid,
|
|
|
|
@ -532,7 +528,7 @@ public class LibRestAPI {
|
|
|
|
|
@POST
|
|
|
|
|
@Consumes(MediaType.APPLICATION_JSON)
|
|
|
|
|
@Produces(MediaType.APPLICATION_JSON)
|
|
|
|
|
@Path("get-invited-email-by-vre-lib")
|
|
|
|
|
@Path("get-invited-email-by-vre-lib/")
|
|
|
|
|
public Response getInvitedEmailsByVRELib(
|
|
|
|
|
@QueryParam("vreid")
|
|
|
|
|
String vreid,
|
|
|
|
@ -562,7 +558,7 @@ public class LibRestAPI {
|
|
|
|
|
@POST
|
|
|
|
|
@Consumes(MediaType.APPLICATION_JSON)
|
|
|
|
|
@Produces(MediaType.APPLICATION_JSON)
|
|
|
|
|
@Path("like-lib")
|
|
|
|
|
@Path("like-lib/")
|
|
|
|
|
public Response likeLib(
|
|
|
|
|
@NotNull(message="like to add is missing")
|
|
|
|
|
@Valid
|
|
|
|
@ -588,7 +584,7 @@ public class LibRestAPI {
|
|
|
|
|
@POST
|
|
|
|
|
@Consumes(MediaType.APPLICATION_JSON)
|
|
|
|
|
@Produces(MediaType.APPLICATION_JSON)
|
|
|
|
|
@Path("unlike-lib")
|
|
|
|
|
@Path("unlike-lib/")
|
|
|
|
|
public Response unlikeLib(
|
|
|
|
|
@QueryParam("userid")
|
|
|
|
|
String userid,
|
|
|
|
@ -617,7 +613,7 @@ public class LibRestAPI {
|
|
|
|
|
|
|
|
|
|
@GET
|
|
|
|
|
@Produces(MediaType.APPLICATION_JSON)
|
|
|
|
|
@Path("get-all-liked-posts-by-user-lib")
|
|
|
|
|
@Path("get-all-liked-posts-by-user-lib/")
|
|
|
|
|
public Response getAllLikedPostIdsByUserLib(
|
|
|
|
|
@QueryParam("userid")
|
|
|
|
|
String userid
|
|
|
|
@ -645,7 +641,7 @@ public class LibRestAPI {
|
|
|
|
|
|
|
|
|
|
@GET
|
|
|
|
|
@Produces(MediaType.APPLICATION_JSON)
|
|
|
|
|
@Path("get-all-likes-by-post-lib")
|
|
|
|
|
@Path("get-all-likes-by-post-lib/")
|
|
|
|
|
public Response getAllLikesByPostLib(
|
|
|
|
|
@QueryParam("postid")
|
|
|
|
|
String postid
|
|
|
|
@ -674,7 +670,7 @@ public class LibRestAPI {
|
|
|
|
|
@POST
|
|
|
|
|
@Consumes(MediaType.APPLICATION_JSON)
|
|
|
|
|
@Produces(MediaType.APPLICATION_JSON)
|
|
|
|
|
@Path("save-notification-lib")
|
|
|
|
|
@Path("save-notification-lib/")
|
|
|
|
|
public Response saveNotificationLib(
|
|
|
|
|
@NotNull(message="notification to add is missing")
|
|
|
|
|
@Valid
|
|
|
|
@ -698,7 +694,7 @@ public class LibRestAPI {
|
|
|
|
|
|
|
|
|
|
@GET
|
|
|
|
|
@Produces(MediaType.APPLICATION_JSON)
|
|
|
|
|
@Path("read-notification-lib")
|
|
|
|
|
@Path("read-notification-lib/")
|
|
|
|
|
public Response readNotificationLib(
|
|
|
|
|
@QueryParam("notid")
|
|
|
|
|
String notid
|
|
|
|
@ -722,7 +718,7 @@ public class LibRestAPI {
|
|
|
|
|
@POST
|
|
|
|
|
@Consumes(MediaType.APPLICATION_JSON)
|
|
|
|
|
@Produces(MediaType.APPLICATION_JSON)
|
|
|
|
|
@Path("set-notification-read-lib")
|
|
|
|
|
@Path("set-notification-read-lib/")
|
|
|
|
|
public Response setNotificationReadLib(
|
|
|
|
|
@QueryParam("notid")
|
|
|
|
|
String notid
|
|
|
|
@ -745,7 +741,7 @@ public class LibRestAPI {
|
|
|
|
|
|
|
|
|
|
@GET
|
|
|
|
|
@Produces(MediaType.APPLICATION_JSON)
|
|
|
|
|
@Path("get-all-notifications-user")
|
|
|
|
|
@Path("get-all-notifications-user/")
|
|
|
|
|
public Response getAllNotificationByUserLib(
|
|
|
|
|
@QueryParam("userid")
|
|
|
|
|
String userid,
|
|
|
|
@ -770,7 +766,7 @@ public class LibRestAPI {
|
|
|
|
|
|
|
|
|
|
@GET
|
|
|
|
|
@Produces(MediaType.APPLICATION_JSON)
|
|
|
|
|
@Path("get-unread-notifications-user")
|
|
|
|
|
@Path("get-unread-notifications-user/")
|
|
|
|
|
public Response getUnreadNotificationsByUserLib(
|
|
|
|
|
@QueryParam("userid")
|
|
|
|
|
String userid
|
|
|
|
@ -793,7 +789,7 @@ public class LibRestAPI {
|
|
|
|
|
|
|
|
|
|
@GET
|
|
|
|
|
@Produces(MediaType.APPLICATION_JSON)
|
|
|
|
|
@Path("get-range-notifications-user")
|
|
|
|
|
@Path("get-range-notifications-user/")
|
|
|
|
|
public Response getRangeNotificationsByUserLib(
|
|
|
|
|
@QueryParam("userid")
|
|
|
|
|
String userid,
|
|
|
|
@ -821,7 +817,7 @@ public class LibRestAPI {
|
|
|
|
|
@POST
|
|
|
|
|
@Consumes(MediaType.APPLICATION_JSON)
|
|
|
|
|
@Produces(MediaType.APPLICATION_JSON)
|
|
|
|
|
@Path("set-all-notification-read-lib")
|
|
|
|
|
@Path("set-all-notification-read-lib/")
|
|
|
|
|
public Response setAllNotificationReadByUserLib(
|
|
|
|
|
@QueryParam("userid")
|
|
|
|
|
String userid
|
|
|
|
@ -845,7 +841,7 @@ public class LibRestAPI {
|
|
|
|
|
@POST
|
|
|
|
|
@Consumes(MediaType.APPLICATION_JSON)
|
|
|
|
|
@Produces(MediaType.APPLICATION_JSON)
|
|
|
|
|
@Path("check-unread-notification-lib")
|
|
|
|
|
@Path("check-unread-notification-lib/")
|
|
|
|
|
public Response checkUnreadNotificationsLib(
|
|
|
|
|
@QueryParam("userid")
|
|
|
|
|
String userid
|
|
|
|
@ -869,7 +865,7 @@ public class LibRestAPI {
|
|
|
|
|
@POST
|
|
|
|
|
@Consumes(MediaType.APPLICATION_JSON)
|
|
|
|
|
@Produces(MediaType.APPLICATION_JSON)
|
|
|
|
|
@Path("check-unread-messages-notification-lib")
|
|
|
|
|
@Path("check-unread-messages-notification-lib/")
|
|
|
|
|
public Response checkUnreadMessagesNotificationsLib(
|
|
|
|
|
@QueryParam("userid")
|
|
|
|
|
String userid
|
|
|
|
@ -894,18 +890,17 @@ public class LibRestAPI {
|
|
|
|
|
@POST
|
|
|
|
|
@Consumes(MediaType.APPLICATION_JSON)
|
|
|
|
|
@Produces(MediaType.APPLICATION_JSON)
|
|
|
|
|
@Path("get-user-notification-channels-lib")
|
|
|
|
|
@Path("get-user-notification-channels-lib/")
|
|
|
|
|
public Response getUserNotificationChannelsLib(
|
|
|
|
|
@QueryParam("userid")
|
|
|
|
|
String userid,
|
|
|
|
|
@NotNull(message="notificationtype to get is missing")
|
|
|
|
|
@Valid
|
|
|
|
|
NotificationType notificationType
|
|
|
|
|
@QueryParam("type")
|
|
|
|
|
String type
|
|
|
|
|
) throws ValidationException{
|
|
|
|
|
ResponseBean responseBean = new ResponseBean();
|
|
|
|
|
Status status = Status.OK;
|
|
|
|
|
try{
|
|
|
|
|
List<NotificationChannelType> result = CassandraConnection.getInstance().getDatabookStore().getUserNotificationChannels(userid,notificationType);
|
|
|
|
|
List<NotificationChannelType> result = CassandraConnection.getInstance().getDatabookStore().getUserNotificationChannels(userid,NotificationType.valueOf(type));
|
|
|
|
|
responseBean.setResult(result);
|
|
|
|
|
responseBean.setMessage("");
|
|
|
|
|
responseBean.setSuccess(true);
|
|
|
|
@ -921,7 +916,7 @@ public class LibRestAPI {
|
|
|
|
|
@POST
|
|
|
|
|
@Consumes(MediaType.APPLICATION_JSON)
|
|
|
|
|
@Produces(MediaType.APPLICATION_JSON)
|
|
|
|
|
@Path("set-notification-preference-lib")
|
|
|
|
|
@Path("set-notification-preference-lib/")
|
|
|
|
|
public Response setUserNotificationPreferencesLib(
|
|
|
|
|
@QueryParam("userid")
|
|
|
|
|
String userid,
|
|
|
|
@ -930,6 +925,12 @@ public class LibRestAPI {
|
|
|
|
|
Map<NotificationType, NotificationChannelType[]> enabledChannels
|
|
|
|
|
) throws ValidationException{
|
|
|
|
|
ResponseBean responseBean = new ResponseBean();
|
|
|
|
|
for(NotificationType notificationType: enabledChannels.keySet()){
|
|
|
|
|
logger.info("Type: " + notificationType.toString());
|
|
|
|
|
for(NotificationChannelType channelType: enabledChannels.get(notificationType)){
|
|
|
|
|
logger.info(channelType.toString());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
Status status = Status.OK;
|
|
|
|
|
try{
|
|
|
|
|
boolean result = CassandraConnection.getInstance().getDatabookStore().setUserNotificationPreferences(userid,enabledChannels);
|
|
|
|
@ -937,7 +938,7 @@ public class LibRestAPI {
|
|
|
|
|
responseBean.setMessage("");
|
|
|
|
|
responseBean.setSuccess(true);
|
|
|
|
|
}catch(Exception e){
|
|
|
|
|
logger.error("Unable to write comment.", e);
|
|
|
|
|
logger.error("Unable to write settings.", e);
|
|
|
|
|
responseBean.setMessage(e.getMessage());
|
|
|
|
|
responseBean.setSuccess(false);
|
|
|
|
|
status = Status.INTERNAL_SERVER_ERROR;
|
|
|
|
@ -948,7 +949,7 @@ public class LibRestAPI {
|
|
|
|
|
|
|
|
|
|
@GET
|
|
|
|
|
@Produces(MediaType.APPLICATION_JSON)
|
|
|
|
|
@Path("get-notification-preference-lib")
|
|
|
|
|
@Path("get-notification-preference-lib/")
|
|
|
|
|
public Response getUserNotificationPreferencesLib(
|
|
|
|
|
@QueryParam("userid")
|
|
|
|
|
String userid
|
|
|
|
@ -973,7 +974,7 @@ public class LibRestAPI {
|
|
|
|
|
@POST
|
|
|
|
|
@Consumes(MediaType.APPLICATION_JSON)
|
|
|
|
|
@Produces(MediaType.APPLICATION_JSON)
|
|
|
|
|
@Path("save-user-post-lib")
|
|
|
|
|
@Path("save-user-post-lib/")
|
|
|
|
|
public Response saveUserPostLib(
|
|
|
|
|
@NotNull(message="post to add is missing")
|
|
|
|
|
@Valid
|
|
|
|
@ -998,7 +999,7 @@ public class LibRestAPI {
|
|
|
|
|
@POST
|
|
|
|
|
@Consumes(MediaType.APPLICATION_JSON)
|
|
|
|
|
@Produces(MediaType.APPLICATION_JSON)
|
|
|
|
|
@Path("save-attachment-lib")
|
|
|
|
|
@Path("save-attachment-lib/")
|
|
|
|
|
public Response saveAttachmentEntryLib(
|
|
|
|
|
@QueryParam("postid")
|
|
|
|
|
String postkey,
|
|
|
|
@ -1026,7 +1027,7 @@ public class LibRestAPI {
|
|
|
|
|
@POST
|
|
|
|
|
@Consumes(MediaType.APPLICATION_JSON)
|
|
|
|
|
@Produces(MediaType.APPLICATION_JSON)
|
|
|
|
|
@Path("save-app-post-lib")
|
|
|
|
|
@Path("save-app-post-lib/")
|
|
|
|
|
public Response saveAppPostLib(
|
|
|
|
|
@NotNull(message="post to add is missing")
|
|
|
|
|
@Valid
|
|
|
|
@ -1052,7 +1053,7 @@ public class LibRestAPI {
|
|
|
|
|
@POST
|
|
|
|
|
@Consumes(MediaType.APPLICATION_JSON)
|
|
|
|
|
@Produces(MediaType.APPLICATION_JSON)
|
|
|
|
|
@Path("save-post-to-vretimeline-lib")
|
|
|
|
|
@Path("save-post-to-vretimeline-lib/")
|
|
|
|
|
public Response savePostToVRETimelineLib(
|
|
|
|
|
@QueryParam("postid")
|
|
|
|
|
String postid,
|
|
|
|
@ -1078,7 +1079,7 @@ public class LibRestAPI {
|
|
|
|
|
|
|
|
|
|
@GET
|
|
|
|
|
@Produces(MediaType.APPLICATION_JSON)
|
|
|
|
|
@Path("read-post-lib")
|
|
|
|
|
@Path("read-post-lib/")
|
|
|
|
|
public Response readPostLib(
|
|
|
|
|
@QueryParam("postid")
|
|
|
|
|
String postid
|
|
|
|
@ -1102,7 +1103,7 @@ public class LibRestAPI {
|
|
|
|
|
|
|
|
|
|
@GET
|
|
|
|
|
@Produces(MediaType.APPLICATION_JSON)
|
|
|
|
|
@Path("get-recent-posts-by-user-date-lib")
|
|
|
|
|
@Path("get-recent-posts-by-user-date-lib/")
|
|
|
|
|
public Response getRecentPostsByUserAndDateLib(
|
|
|
|
|
@QueryParam("userid")
|
|
|
|
|
String userid,
|
|
|
|
@ -1128,7 +1129,7 @@ public class LibRestAPI {
|
|
|
|
|
@POST
|
|
|
|
|
@Consumes(MediaType.APPLICATION_JSON)
|
|
|
|
|
@Produces(MediaType.APPLICATION_JSON)
|
|
|
|
|
@Path("delete-post-lib")
|
|
|
|
|
@Path("delete-post-lib/")
|
|
|
|
|
public Response deletePostLib(
|
|
|
|
|
@QueryParam("postid")
|
|
|
|
|
String postid
|
|
|
|
@ -1152,7 +1153,7 @@ public class LibRestAPI {
|
|
|
|
|
|
|
|
|
|
@GET
|
|
|
|
|
@Produces(MediaType.APPLICATION_JSON)
|
|
|
|
|
@Path("get-all-posts-by-user-lib")
|
|
|
|
|
@Path("get-all-posts-by-user-lib/")
|
|
|
|
|
public Response getAllPostsByUserLib(
|
|
|
|
|
@QueryParam("userid")
|
|
|
|
|
String userid
|
|
|
|
@ -1176,7 +1177,7 @@ public class LibRestAPI {
|
|
|
|
|
|
|
|
|
|
@GET
|
|
|
|
|
@Produces(MediaType.APPLICATION_JSON)
|
|
|
|
|
@Path("get-all-posts-by-app-lib")
|
|
|
|
|
@Path("get-all-posts-by-app-lib/")
|
|
|
|
|
public Response getAllPostsByAppLib(
|
|
|
|
|
@QueryParam("appid")
|
|
|
|
|
String appid
|
|
|
|
@ -1200,7 +1201,7 @@ public class LibRestAPI {
|
|
|
|
|
|
|
|
|
|
@GET
|
|
|
|
|
@Produces(MediaType.APPLICATION_JSON)
|
|
|
|
|
@Path("get-recent-commented-posts-by-user-lib")
|
|
|
|
|
@Path("get-recent-commented-posts-by-user-lib/")
|
|
|
|
|
public Response getRecentCommentedPostsByUserAndDateLib(
|
|
|
|
|
@QueryParam("userid")
|
|
|
|
|
String userid,
|
|
|
|
@ -1227,7 +1228,7 @@ public class LibRestAPI {
|
|
|
|
|
|
|
|
|
|
@GET
|
|
|
|
|
@Produces(MediaType.APPLICATION_JSON)
|
|
|
|
|
@Path("get-portal-privacy-level-posts-lib")
|
|
|
|
|
@Path("get-portal-privacy-level-posts-lib/")
|
|
|
|
|
public Response getAllPortalPrivacyLevelPostsLib() throws ValidationException{
|
|
|
|
|
ResponseBean responseBean = new ResponseBean();
|
|
|
|
|
Status status = Status.OK;
|
|
|
|
@ -1248,7 +1249,7 @@ public class LibRestAPI {
|
|
|
|
|
|
|
|
|
|
@GET
|
|
|
|
|
@Produces(MediaType.APPLICATION_JSON)
|
|
|
|
|
@Path("get-recent-posts-by-user-lib")
|
|
|
|
|
@Path("get-recent-posts-by-user-lib/")
|
|
|
|
|
public Response getRecentPostsByUserLib(
|
|
|
|
|
@QueryParam("userid")
|
|
|
|
|
String userid,
|
|
|
|
@ -1273,7 +1274,7 @@ public class LibRestAPI {
|
|
|
|
|
|
|
|
|
|
@GET
|
|
|
|
|
@Produces(MediaType.APPLICATION_JSON)
|
|
|
|
|
@Path("get-all-posts-by-vre-lib")
|
|
|
|
|
@Path("get-all-posts-by-vre-lib/")
|
|
|
|
|
public Response getAllPostsByVRELib(
|
|
|
|
|
@QueryParam("vreid")
|
|
|
|
|
String vreid
|
|
|
|
@ -1296,7 +1297,7 @@ public class LibRestAPI {
|
|
|
|
|
|
|
|
|
|
@GET
|
|
|
|
|
@Produces(MediaType.APPLICATION_JSON)
|
|
|
|
|
@Path("get-recent-posts-by-vre-lib")
|
|
|
|
|
@Path("get-recent-posts-by-vre-lib/")
|
|
|
|
|
public Response getRecentPostsByVRELib(
|
|
|
|
|
@QueryParam("vreid")
|
|
|
|
|
String vreid,
|
|
|
|
@ -1321,7 +1322,7 @@ public class LibRestAPI {
|
|
|
|
|
|
|
|
|
|
@GET
|
|
|
|
|
@Produces(MediaType.APPLICATION_JSON)
|
|
|
|
|
@Path("get-recent-posts-by-vre-range-lib")
|
|
|
|
|
@Path("get-recent-posts-by-vre-range-lib/")
|
|
|
|
|
public Response getRecentPostsByVREAndRangeLib(
|
|
|
|
|
@QueryParam("vreid")
|
|
|
|
|
String vreid,
|
|
|
|
@ -1349,7 +1350,7 @@ public class LibRestAPI {
|
|
|
|
|
|
|
|
|
|
@GET
|
|
|
|
|
@Produces(MediaType.APPLICATION_JSON)
|
|
|
|
|
@Path("get-attachment-by-postid-lib")
|
|
|
|
|
@Path("get-attachment-by-postid-lib/")
|
|
|
|
|
public Response getAttachmentsByFeedIdLib(
|
|
|
|
|
@QueryParam("postid")
|
|
|
|
|
String postid
|
|
|
|
@ -1373,7 +1374,7 @@ public class LibRestAPI {
|
|
|
|
|
|
|
|
|
|
@GET
|
|
|
|
|
@Produces(MediaType.APPLICATION_JSON)
|
|
|
|
|
@Path("get-all-vre-ids-lib")
|
|
|
|
|
@Path("get-all-vre-ids-lib/")
|
|
|
|
|
public Response getAllVREIdsLib() throws ValidationException{
|
|
|
|
|
ResponseBean responseBean = new ResponseBean();
|
|
|
|
|
Status status = Status.OK;
|