Social service - More REST API resoruces
This commit is contained in:
parent
0551ee95f3
commit
a55ba31d9a
2
pom.xml
2
pom.xml
|
@ -6,7 +6,7 @@
|
|||
<parent>
|
||||
<groupId>org.gcube.tools</groupId>
|
||||
<artifactId>maven-parent</artifactId>
|
||||
<version>1.2.0</version>
|
||||
<version>1.1.0</version>
|
||||
</parent>
|
||||
|
||||
<groupId>org.gcube.portal</groupId>
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
package org.gcube.portal.social.networking.ws.methods.v2;
|
||||
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
@ -16,12 +15,10 @@ import javax.ws.rs.POST;
|
|||
import javax.ws.rs.Path;
|
||||
import javax.ws.rs.Produces;
|
||||
import javax.ws.rs.QueryParam;
|
||||
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;
|
||||
|
||||
import org.apache.commons.lang.Validate;
|
||||
import org.gcube.common.authorization.library.provider.AuthorizationProvider;
|
||||
import org.gcube.common.authorization.library.utils.Caller;
|
||||
import org.gcube.common.scope.api.ScopeProvider;
|
||||
|
@ -235,6 +232,8 @@ public class Comments {
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
//lib api
|
||||
@POST
|
||||
@Consumes(MediaType.APPLICATION_JSON)
|
||||
|
@ -396,4 +395,6 @@ public class Comments {
|
|||
}
|
||||
return Response.status(status).entity(responseBean).build();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
package org.gcube.portal.social.networking.ws.methods.v2;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
@ -10,18 +8,14 @@ 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;
|
||||
|
||||
import org.apache.commons.lang.Validate;
|
||||
import org.gcube.common.authorization.library.provider.AuthorizationProvider;
|
||||
import org.gcube.common.authorization.library.utils.Caller;
|
||||
import org.gcube.common.scope.api.ScopeProvider;
|
||||
import org.gcube.portal.databook.server.DatabookStore;
|
||||
import org.gcube.portal.databook.shared.Comment;
|
||||
import org.gcube.portal.databook.shared.Feed;
|
||||
import org.gcube.portal.databook.shared.Post;
|
||||
import org.gcube.portal.social.networking.liferay.ws.GroupManagerWSBuilder;
|
||||
import org.gcube.portal.social.networking.ws.outputs.ResponseBean;
|
||||
|
@ -41,7 +35,7 @@ import com.webcohesion.enunciate.metadata.rs.StatusCodes;
|
|||
@RequestHeaders ({
|
||||
@RequestHeader( name = "Authorization", description = "Bearer token, see https://dev.d4science.org/how-to-access-resources"),
|
||||
@RequestHeader( name = "Content-Type", description = "application/json")
|
||||
})
|
||||
})
|
||||
public class HashTags {
|
||||
|
||||
// Logger
|
||||
|
@ -103,7 +97,7 @@ public class HashTags {
|
|||
@NotNull(message="hashtag to save is missing")
|
||||
@Valid
|
||||
List<String> hashtags
|
||||
) throws ValidationException{
|
||||
) throws ValidationException {
|
||||
ResponseBean responseBean = new ResponseBean();
|
||||
Status status = Status.OK;
|
||||
try{
|
||||
|
@ -281,6 +275,7 @@ public class HashTags {
|
|||
@QueryParam("hashtag")
|
||||
String hashtag
|
||||
) throws ValidationException {
|
||||
hashtag = "#" + hashtag;
|
||||
|
||||
ResponseBean responseBean = new ResponseBean();
|
||||
Status status = Status.OK;
|
||||
|
@ -300,4 +295,5 @@ public class HashTags {
|
|||
}
|
||||
return Response.status(status).entity(responseBean).build();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,12 +1,10 @@
|
|||
package org.gcube.portal.social.networking.ws.methods.v2;
|
||||
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.ValidationException;
|
||||
import javax.validation.constraints.Min;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.ws.rs.Consumes;
|
||||
import javax.ws.rs.GET;
|
||||
|
@ -14,16 +12,13 @@ import javax.ws.rs.POST;
|
|||
import javax.ws.rs.Path;
|
||||
import javax.ws.rs.Produces;
|
||||
import javax.ws.rs.QueryParam;
|
||||
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;
|
||||
|
||||
import org.apache.commons.lang.Validate;
|
||||
import org.gcube.common.authorization.library.provider.AuthorizationProvider;
|
||||
import org.gcube.common.authorization.library.utils.Caller;
|
||||
import org.gcube.common.scope.api.ScopeProvider;
|
||||
import org.gcube.portal.databook.shared.Comment;
|
||||
import org.gcube.portal.databook.shared.Like;
|
||||
import org.gcube.portal.social.networking.ws.inputs.LikeInputBean;
|
||||
import org.gcube.portal.social.networking.ws.inputs.PostId;
|
||||
|
@ -93,7 +88,7 @@ public class Likes {
|
|||
|
||||
/**
|
||||
* Create a new like to a post in the context of the token
|
||||
* @param post The post id to be liked
|
||||
* @param postid The post id to be liked
|
||||
* @return true if everything is OK
|
||||
* @throws ValidationException
|
||||
*/
|
||||
|
@ -133,7 +128,7 @@ public class Likes {
|
|||
|
||||
/**
|
||||
* Unlike to a post in the context of the token
|
||||
* @param likeInputBean The post id to be liked
|
||||
* @param postid The post id to be liked
|
||||
* @return true if everything is OK
|
||||
* @throws ValidationException
|
||||
*/
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
package org.gcube.portal.social.networking.ws.methods.v2;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.ValidationException;
|
||||
|
@ -14,12 +17,10 @@ import javax.ws.rs.POST;
|
|||
import javax.ws.rs.Path;
|
||||
import javax.ws.rs.Produces;
|
||||
import javax.ws.rs.QueryParam;
|
||||
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;
|
||||
|
||||
import org.apache.commons.lang.Validate;
|
||||
import org.gcube.applicationsupportlayer.social.ApplicationNotificationsManager;
|
||||
import org.gcube.applicationsupportlayer.social.NotificationsManager;
|
||||
import org.gcube.applicationsupportlayer.social.shared.SocialNetworkingSite;
|
||||
|
@ -30,7 +31,10 @@ import org.gcube.common.authorization.library.provider.SecurityTokenProvider;
|
|||
import org.gcube.common.authorization.library.utils.Caller;
|
||||
import org.gcube.common.scope.api.ScopeProvider;
|
||||
import org.gcube.common.scope.impl.ScopeBean;
|
||||
import org.gcube.portal.databook.shared.*;
|
||||
import org.gcube.portal.databook.shared.Notification;
|
||||
import org.gcube.portal.databook.shared.NotificationChannelType;
|
||||
import org.gcube.portal.databook.shared.NotificationType;
|
||||
import org.gcube.portal.databook.shared.RunningJob;
|
||||
import org.gcube.portal.notifications.bean.GenericItemBean;
|
||||
import org.gcube.portal.notifications.thread.JobStatusNotificationThread;
|
||||
import org.gcube.portal.social.networking.caches.SocialNetworkingSiteFinder;
|
||||
|
@ -672,6 +676,7 @@ public class Notifications {
|
|||
|
||||
|
||||
|
||||
|
||||
//library api
|
||||
@POST
|
||||
@Consumes(MediaType.APPLICATION_JSON)
|
||||
|
@ -970,4 +975,5 @@ public class Notifications {
|
|||
}
|
||||
return Response.status(status).entity(responseBean).build();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -2,7 +2,6 @@ package org.gcube.portal.social.networking.ws.methods.v2;
|
|||
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
@ -17,12 +16,10 @@ import javax.ws.rs.POST;
|
|||
import javax.ws.rs.Path;
|
||||
import javax.ws.rs.Produces;
|
||||
import javax.ws.rs.QueryParam;
|
||||
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;
|
||||
|
||||
import org.apache.commons.lang.Validate;
|
||||
import org.gcube.common.authorization.library.provider.AuthorizationProvider;
|
||||
import org.gcube.common.authorization.library.utils.Caller;
|
||||
import org.gcube.common.scope.api.ScopeProvider;
|
||||
|
@ -32,7 +29,6 @@ import org.gcube.portal.databook.shared.ex.ColumnNameNotFoundException;
|
|||
import org.gcube.portal.databook.shared.ex.FeedIDNotFoundException;
|
||||
import org.gcube.portal.databook.shared.ex.FeedTypeNotFoundException;
|
||||
import org.gcube.portal.databook.shared.ex.PrivacyLevelTypeNotFoundException;
|
||||
import org.gcube.portal.social.networking.ws.inputs.PostId;
|
||||
import org.gcube.portal.social.networking.ws.inputs.PostInputBean;
|
||||
import org.gcube.portal.social.networking.ws.outputs.ResponseBean;
|
||||
import org.gcube.portal.social.networking.ws.utils.CassandraConnection;
|
||||
|
@ -646,6 +642,7 @@ public class Posts {
|
|||
|
||||
|
||||
|
||||
|
||||
//library api
|
||||
@POST
|
||||
@Consumes(MediaType.APPLICATION_JSON)
|
||||
|
|
Loading…
Reference in New Issue