Class NewsServiceImpl
- java.lang.Object
-
- javax.servlet.GenericServlet
-
- javax.servlet.http.HttpServlet
-
- com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet
-
- com.google.gwt.user.server.rpc.RemoteServiceServlet
-
- org.gcube.portlets.user.newsfeed.server.NewsServiceImpl
-
- All Implemented Interfaces:
com.google.gwt.user.client.rpc.RemoteService,com.google.gwt.user.server.rpc.SerializationPolicyProvider,Serializable,javax.servlet.Servlet,javax.servlet.ServletConfig,NewsService
public class NewsServiceImpl extends com.google.gwt.user.server.rpc.RemoteServiceServlet implements NewsService
The server side implementation of the RPC service.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static StringLAST_RETRIEVED_TIMEstatic StringNF_ORGANIZATIONUSERS_CACHE
-
Constructor Summary
Constructors Constructor Description NewsServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description OperationResultcomment(String feedid, String commentText, HashSet<MentionedDTO> mentionedItemsSet, String feedOwnerId, boolean isAppFeed)booleandeleteComment(String commentid, String feedid)booleandeletePost(String postid)voiddestroy()OperationResulteditComment(String text, org.gcube.portal.databook.shared.Comment toEdit, HashSet<MentionedDTO> mentionedItemsSet)ArrayList<org.gcube.portal.databook.shared.Comment>getAllCommentsByPost(String postid)ArrayList<org.gcube.portal.databook.shared.Like>getAllLikesByPost(String postid)ArrayList<org.gcube.portal.databook.shared.EnhancedFeed>getAllUpdateUserFeeds(int postsNoPerCategory)MorePostsBeangetMorePosts(int start, int quantity)MorePostsBean contains the timeline index of the last returned valid post (because if you delete a feed is stays on in the timeline and is marked deleted) and contains the FeedsArrayList<org.gcube.portal.databook.shared.EnhancedFeed>getOnlyConnectionsUserPosts()return only the user connection postsArrayList<org.gcube.portal.databook.shared.EnhancedFeed>getOnlyLikedPosts()ArrayList<org.gcube.portal.databook.shared.EnhancedFeed>getOnlyMyUserPosts()ArrayList<org.gcube.portlets.widgets.pickitem.shared.ItemBean>getOrganizationUsers()ArrayList<org.gcube.portal.databook.shared.EnhancedFeed>getPostsByHashtag(String hashtag)return the posts having the hashtag passed as param the user has access onArrayList<org.gcube.portal.databook.shared.EnhancedFeed>getPostsByQuery(String query, int from, int quantity)ArrayList<org.gcube.portal.databook.shared.EnhancedFeed>getPostsRelatedToUserStatistics(org.gcube.portal.databook.shared.ShowUserStatisticAction action, int from, int quantity)org.gcube.portal.databook.shared.EnhancedFeedgetSinglePost(String postKey)return only one post with all the commentsUserSettingsgetUserSettings()this is the first method called by the web appvoidinit()booleanlike(String postid, String postText, String postOwnerId)booleanunlike(String postid, String postText, String postOwnerId)-
Methods inherited from class com.google.gwt.user.server.rpc.RemoteServiceServlet
checkPermutationStrongName, doGetSerializationPolicy, getCodeServerPolicyUrl, getRequestModuleBasePath, getSerializationPolicy, init, loadPolicyFromCodeServer, onAfterResponseSerialized, onBeforeRequestDeserialized, processCall, processCall, processPost, shouldCompressResponse
-
Methods inherited from class com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet
doPost, doUnexpectedFailure, getPermutationStrongName, getThreadLocalRequest, getThreadLocalResponse, onAfterRequestDeserialized, readContent
-
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doGet, doHead, doOptions, doPut, doTrace, getLastModified, service, service
-
-
-
-
Field Detail
-
NF_ORGANIZATIONUSERS_CACHE
public static final String NF_ORGANIZATIONUSERS_CACHE
- See Also:
- Constant Field Values
-
LAST_RETRIEVED_TIME
public static final String LAST_RETRIEVED_TIME
- See Also:
- Constant Field Values
-
-
Method Detail
-
init
public void init()
- Overrides:
initin classjavax.servlet.GenericServlet
-
destroy
public void destroy()
- Specified by:
destroyin interfacejavax.servlet.Servlet- Overrides:
destroyin classjavax.servlet.GenericServlet
-
getUserSettings
public UserSettings getUserSettings()
this is the first method called by the web app- Specified by:
getUserSettingsin interfaceNewsService
-
getAllUpdateUserFeeds
public ArrayList<org.gcube.portal.databook.shared.EnhancedFeed> getAllUpdateUserFeeds(int postsNoPerCategory)
- Specified by:
getAllUpdateUserFeedsin interfaceNewsService
-
getPostsByHashtag
public ArrayList<org.gcube.portal.databook.shared.EnhancedFeed> getPostsByHashtag(String hashtag)
return the posts having the hashtag passed as param the user has access on- Specified by:
getPostsByHashtagin interfaceNewsService- Parameters:
hashtag- the hashtag to look for including '#'
-
getPostsByQuery
public ArrayList<org.gcube.portal.databook.shared.EnhancedFeed> getPostsByQuery(String query, int from, int quantity)
- Specified by:
getPostsByQueryin interfaceNewsService
-
getOnlyConnectionsUserPosts
public ArrayList<org.gcube.portal.databook.shared.EnhancedFeed> getOnlyConnectionsUserPosts()
return only the user connection posts- Specified by:
getOnlyConnectionsUserPostsin interfaceNewsService
-
getSinglePost
public org.gcube.portal.databook.shared.EnhancedFeed getSinglePost(String postKey)
return only one post with all the comments- Specified by:
getSinglePostin interfaceNewsService
-
getMorePosts
public MorePostsBean getMorePosts(int start, int quantity)
MorePostsBean contains the timeline index of the last returned valid post (because if you delete a feed is stays on in the timeline and is marked deleted) and contains the Feeds- Specified by:
getMorePostsin interfaceNewsService- Parameters:
strat- the range start (most recent posts for this vre) has to be greater than 0quantity- the number of most recent posts for this vre starting from "start" param
-
getOnlyMyUserPosts
public ArrayList<org.gcube.portal.databook.shared.EnhancedFeed> getOnlyMyUserPosts()
- Specified by:
getOnlyMyUserPostsin interfaceNewsService
-
getOnlyLikedPosts
public ArrayList<org.gcube.portal.databook.shared.EnhancedFeed> getOnlyLikedPosts()
- Specified by:
getOnlyLikedPostsin interfaceNewsService
-
like
public boolean like(String postid, String postText, String postOwnerId)
- Specified by:
likein interfaceNewsService
-
unlike
public boolean unlike(String postid, String postText, String postOwnerId)
- Specified by:
unlikein interfaceNewsService
-
comment
public OperationResult comment(String feedid, String commentText, HashSet<MentionedDTO> mentionedItemsSet, String feedOwnerId, boolean isAppFeed)
- Specified by:
commentin interfaceNewsService- Parameters:
feedid- the id of the commented postcommentText- the comment textfeedOwnerId- the username of the user who created the post that was commented
-
editComment
public OperationResult editComment(String text, org.gcube.portal.databook.shared.Comment toEdit, HashSet<MentionedDTO> mentionedItemsSet)
- Specified by:
editCommentin interfaceNewsService
-
getAllLikesByPost
public ArrayList<org.gcube.portal.databook.shared.Like> getAllLikesByPost(String postid)
- Specified by:
getAllLikesByPostin interfaceNewsService
-
getAllCommentsByPost
public ArrayList<org.gcube.portal.databook.shared.Comment> getAllCommentsByPost(String postid)
- Specified by:
getAllCommentsByPostin interfaceNewsService
-
deleteComment
public boolean deleteComment(String commentid, String feedid)
- Specified by:
deleteCommentin interfaceNewsService
-
deletePost
public boolean deletePost(String postid)
- Specified by:
deletePostin interfaceNewsService
-
getOrganizationUsers
public ArrayList<org.gcube.portlets.widgets.pickitem.shared.ItemBean> getOrganizationUsers()
- Specified by:
getOrganizationUsersin interfaceNewsService
-
getPostsRelatedToUserStatistics
public ArrayList<org.gcube.portal.databook.shared.EnhancedFeed> getPostsRelatedToUserStatistics(org.gcube.portal.databook.shared.ShowUserStatisticAction action, int from, int quantity)
- Specified by:
getPostsRelatedToUserStatisticsin interfaceNewsService
-
-