Package org.exoplatform.news
Interface NewsService
-
- All Known Implementing Classes:
NewsServiceImpl
public interface NewsService
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidarchiveNews(String newsId)booleancanArchiveNews(String newsAuthor)NewscancelScheduleNews(News news)booleancanDeleteNews(String posterId, String spaceId)booleancanEditNews(String posterId, String spaceId)booleancanEditNews(News news, String authenticatedUser)booleancanPinNews()booleancanViewNews(News news, String authenticatedUser)NewsconvertNodeToNews(javax.jcr.Node node, boolean editMode)NewscreateNews(News news)NewscreateNews(News news, javax.jcr.Session session)NewscreateNewsDraft(News news)voiddeleteNews(String id, boolean isDraft)List<News>getNews(NewsFilter filter)NewsgetNewsByActivityId(String activityId, String authenticatedUser)Retrives a news identified by originating Activity identifier or a shared activity identifierNewsgetNewsById(String newsId, boolean editMode)Retrives a news identified by its technical identifierNewsgetNewsById(String newsId, String authenticatedUser, boolean editMode)Retrives a news identified by its technical identifierintgetNewsCount(NewsFilter filter)voidmarkAsRead(News news, String userId)voidpinNews(String newsId)NewsscheduleNews(News news)List<NewsESSearchResult>search(org.exoplatform.social.core.identity.model.Identity currentUser, String term, int offset, int limit)List<News>searchNews(NewsFilter filter, String lang)voidshareNews(News news, org.exoplatform.social.core.space.model.Space space, org.exoplatform.social.core.identity.model.Identity userIdentity, String sharedActivityId)Shares a news into a dedicated spacevoidunarchiveNews(String newsId)voidunpinNews(String newsId)NewsupdateNews(News news)
-
-
-
Method Detail
-
getNewsById
News getNewsById(String newsId, boolean editMode)
Retrives a news identified by its technical identifier
-
getNewsById
News getNewsById(String newsId, String authenticatedUser, boolean editMode) throws IllegalAccessException
Retrives a news identified by its technical identifier- Parameters:
newsId-NewsidentifierauthenticatedUser- user attempting to access newseditMode- access mode to news: whether to edit news to to view it.- Returns:
Newsif found else null- Throws:
IllegalAccessException- when user doesn't have access toNews
-
getNewsByActivityId
News getNewsByActivityId(String activityId, String authenticatedUser) throws IllegalAccessException, org.exoplatform.commons.exception.ObjectNotFoundException
Retrives a news identified by originating Activity identifier or a shared activity identifier- Parameters:
activityId-ExoSocialActivityidentifierauthenticatedUser- user attempting to access news- Returns:
Newsif found else null- Throws:
IllegalAccessException- when user doesn't have access toNewsorExoSocialActivityorg.exoplatform.commons.exception.ObjectNotFoundException- when aNewswasn't found for this activity identifier
-
getNews
List<News> getNews(NewsFilter filter) throws Exception
- Throws:
Exception
-
getNewsCount
int getNewsCount(NewsFilter filter) throws Exception
- Throws:
Exception
-
shareNews
void shareNews(News news, org.exoplatform.social.core.space.model.Space space, org.exoplatform.social.core.identity.model.Identity userIdentity, String sharedActivityId) throws IllegalAccessException, org.exoplatform.commons.exception.ObjectNotFoundException
Shares a news into a dedicated space- Parameters:
news-Newsto sharespace-Spaceto share with, the newsuserIdentity-Identityof user making the modificationsharedActivityId- newly generated activity identifier- Throws:
IllegalAccessException- when user doesn't have access toNewsorg.exoplatform.commons.exception.ObjectNotFoundException- whenNewsis not found
-
convertNodeToNews
News convertNodeToNews(javax.jcr.Node node, boolean editMode) throws Exception
- Throws:
Exception
-
canViewNews
boolean canViewNews(News news, String authenticatedUser)
- Parameters:
news-Newsto checkauthenticatedUser- authenticated username- Returns:
- true if user has access to news, else false
-
canEditNews
boolean canEditNews(News news, String authenticatedUser)
- Parameters:
news-Newsto checkauthenticatedUser- authenticated username- Returns:
- true if user has access to news, else false
-
canPinNews
boolean canPinNews()
-
canArchiveNews
boolean canArchiveNews(String newsAuthor)
-
searchNews
List<News> searchNews(NewsFilter filter, String lang) throws Exception
- Throws:
Exception
-
search
List<NewsESSearchResult> search(org.exoplatform.social.core.identity.model.Identity currentUser, String term, int offset, int limit)
-
-