Package org.exoplatform.news.storage.jcr
Class JcrNewsStorage
- java.lang.Object
-
- org.exoplatform.news.storage.jcr.JcrNewsStorage
-
- All Implemented Interfaces:
NewsStorage
public class JcrNewsStorage extends Object implements NewsStorage
-
-
Field Summary
Fields Modifier and Type Field Description static StringAPPLICATION_DATA_PATHstatic StringMIX_NEWS_MODIFIERSstatic StringMIX_NEWS_MODIFIERS_PROPstatic StringNEWS_ACTIVITY_POSTED_MIXIN_PROPstatic StringNEWS_ACTIVITY_POSTING_MIXIN_TYPEstatic StringNEWS_DRAFT_VISIBILE_MIXIN_PROPstatic StringNEWS_DRAFT_VISIBILITY_MIXIN_TYPEstatic StringNEWS_NODES_FOLDERstatic StringPUBLISHED_NEWS_NODES_FOLDERstatic String[]SHARE_NEWS_PERMISSIONS
-
Constructor Summary
Constructors Constructor Description JcrNewsStorage(org.exoplatform.services.jcr.RepositoryService repositoryService, org.exoplatform.services.jcr.ext.app.SessionProviderService sessionProviderService, org.exoplatform.services.jcr.ext.hierarchy.NodeHierarchyCreator nodeHierarchyCreator, org.exoplatform.services.jcr.ext.distribution.DataDistributionManager dataDistributionManager, org.exoplatform.social.core.manager.ActivityManager activityManager, org.exoplatform.social.core.space.spi.SpaceService spaceService, org.exoplatform.upload.UploadService uploadService, org.exoplatform.social.common.service.HTMLUploadImageProcessor imageProcessor, org.exoplatform.services.ecm.publication.PublicationService publicationService, org.exoplatform.services.wcm.extensions.publication.PublicationManager publicationManager, NewsAttachmentsStorage newsAttachmentsService, org.exoplatform.social.core.manager.IdentityManager identityManager, org.exoplatform.services.cms.link.LinkManager linkManager, NewsSearchConnector newsSearchConnector, org.exoplatform.services.wcm.publication.WCMPublicationService wCMPublicationService)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidarchiveNews(String newsId)Archive a newsNewscreateNews(News news)Create the exo:news draft node in CMSvoiddeleteNews(String newsId, boolean isDraft)List<News>getNews(NewsFilter newsFilter)Get all newsNewsgetNewsById(String newsId, boolean editMode)intgetNewsCount(NewsFilter newsFilter)StringgetNewsIllustration(News news)javax.jcr.NodegetNewsNodeById(String newsId, org.exoplatform.services.jcr.ext.common.SessionProvider sessionProvider)booleanisCurrentUserInNewsViewers(String newsId, String userId)voidmarkAsRead(News news, String userId)voidpublishNews(News news)Publish a newsNewsscheduleNews(News news)List<News>searchNews(NewsFilter filter, String lang)Search news with the given textvoidshareNews(News news, org.exoplatform.social.core.space.model.Space space, org.exoplatform.social.core.identity.model.Identity userIdentity, String sharedActivityId)StringsubstituteUsernames(String portalOwner, String message)voidunarchiveNews(String newsId)Unarchive a newsvoidunpublishNews(String newsId)NewsunScheduleNews(News news)NewsupdateNews(News news)voidupdateNewsActivities(String newsActivityId, News news)
-
-
-
Field Detail
-
APPLICATION_DATA_PATH
public static final String APPLICATION_DATA_PATH
- See Also:
- Constant Field Values
-
MIX_NEWS_MODIFIERS
public static final String MIX_NEWS_MODIFIERS
- See Also:
- Constant Field Values
-
MIX_NEWS_MODIFIERS_PROP
public static final String MIX_NEWS_MODIFIERS_PROP
- See Also:
- Constant Field Values
-
NEWS_ACTIVITY_POSTING_MIXIN_TYPE
public static final String NEWS_ACTIVITY_POSTING_MIXIN_TYPE
- See Also:
- Constant Field Values
-
NEWS_ACTIVITY_POSTED_MIXIN_PROP
public static final String NEWS_ACTIVITY_POSTED_MIXIN_PROP
- See Also:
- Constant Field Values
-
NEWS_DRAFT_VISIBILE_MIXIN_PROP
public static final String NEWS_DRAFT_VISIBILE_MIXIN_PROP
- See Also:
- Constant Field Values
-
NEWS_DRAFT_VISIBILITY_MIXIN_TYPE
public static final String NEWS_DRAFT_VISIBILITY_MIXIN_TYPE
- See Also:
- Constant Field Values
-
NEWS_NODES_FOLDER
public static final String NEWS_NODES_FOLDER
- See Also:
- Constant Field Values
-
PUBLISHED_NEWS_NODES_FOLDER
public static final String PUBLISHED_NEWS_NODES_FOLDER
- See Also:
- Constant Field Values
-
SHARE_NEWS_PERMISSIONS
public static final String[] SHARE_NEWS_PERMISSIONS
-
-
Constructor Detail
-
JcrNewsStorage
public JcrNewsStorage(org.exoplatform.services.jcr.RepositoryService repositoryService, org.exoplatform.services.jcr.ext.app.SessionProviderService sessionProviderService, org.exoplatform.services.jcr.ext.hierarchy.NodeHierarchyCreator nodeHierarchyCreator, org.exoplatform.services.jcr.ext.distribution.DataDistributionManager dataDistributionManager, org.exoplatform.social.core.manager.ActivityManager activityManager, org.exoplatform.social.core.space.spi.SpaceService spaceService, org.exoplatform.upload.UploadService uploadService, org.exoplatform.social.common.service.HTMLUploadImageProcessor imageProcessor, org.exoplatform.services.ecm.publication.PublicationService publicationService, org.exoplatform.services.wcm.extensions.publication.PublicationManager publicationManager, NewsAttachmentsStorage newsAttachmentsService, org.exoplatform.social.core.manager.IdentityManager identityManager, org.exoplatform.services.cms.link.LinkManager linkManager, NewsSearchConnector newsSearchConnector, org.exoplatform.services.wcm.publication.WCMPublicationService wCMPublicationService)
-
-
Method Detail
-
createNews
public News createNews(News news) throws Exception
Create the exo:news draft node in CMS- Specified by:
createNewsin interfaceNewsStorage- Parameters:
news- the news- Returns:
- News draft id
- Throws:
Exception- when error
-
getNews
public List<News> getNews(NewsFilter newsFilter) throws Exception
Get all news- Specified by:
getNewsin interfaceNewsStorage- Returns:
- all news
- Throws:
Exception- when error
-
getNewsCount
public int getNewsCount(NewsFilter newsFilter) throws Exception
- Specified by:
getNewsCountin interfaceNewsStorage- Throws:
Exception
-
publishNews
public void publishNews(News news) throws Exception
Publish a news- Specified by:
publishNewsin interfaceNewsStorage- Parameters:
newsId- The id of the news to be published- Throws:
Exception- when error
-
getNewsById
public News getNewsById(String newsId, boolean editMode) throws Exception
- Specified by:
getNewsByIdin interfaceNewsStorage- Throws:
Exception
-
getNewsIllustration
public String getNewsIllustration(News news) throws Exception
- Specified by:
getNewsIllustrationin interfaceNewsStorage- Throws:
Exception
-
updateNews
public News updateNews(News news) throws Exception
- Specified by:
updateNewsin interfaceNewsStorage- Throws:
Exception
-
deleteNews
public void deleteNews(String newsId, boolean isDraft) throws Exception
- Specified by:
deleteNewsin interfaceNewsStorage- Throws:
Exception
-
scheduleNews
public News scheduleNews(News news) throws Exception
- Specified by:
scheduleNewsin interfaceNewsStorage- Throws:
Exception
-
updateNewsActivities
public void updateNewsActivities(String newsActivityId, News news) throws Exception
- Specified by:
updateNewsActivitiesin interfaceNewsStorage- Throws:
Exception
-
markAsRead
public void markAsRead(News news, String userId) throws Exception
- Specified by:
markAsReadin interfaceNewsStorage- Throws:
Exception
-
isCurrentUserInNewsViewers
public boolean isCurrentUserInNewsViewers(String newsId, String userId) throws Exception
- Specified by:
isCurrentUserInNewsViewersin interfaceNewsStorage- Throws:
Exception
-
unpublishNews
public void unpublishNews(String newsId) throws Exception
- Specified by:
unpublishNewsin interfaceNewsStorage- Throws:
Exception
-
unScheduleNews
public News unScheduleNews(News news) throws Exception
- Specified by:
unScheduleNewsin interfaceNewsStorage- Throws:
Exception
-
archiveNews
public void archiveNews(String newsId) throws Exception
Archive a news- Specified by:
archiveNewsin interfaceNewsStorage- Parameters:
newsId- The id of the news to be archived- Throws:
Exception- when error
-
unarchiveNews
public void unarchiveNews(String newsId) throws Exception
Unarchive a news- Specified by:
unarchiveNewsin interfaceNewsStorage- Parameters:
newsId- The id of the news to be unarchived- Throws:
Exception- when error
-
searchNews
public List<News> searchNews(NewsFilter filter, String lang) throws Exception
Search news with the given text- Specified by:
searchNewsin interfaceNewsStorage- Parameters:
filter- news filterlang- language- Throws:
Exception- when error
-
shareNews
public 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
- Specified by:
shareNewsin interfaceNewsStorage- Throws:
IllegalAccessExceptionorg.exoplatform.commons.exception.ObjectNotFoundException
-
getNewsNodeById
public javax.jcr.Node getNewsNodeById(String newsId, org.exoplatform.services.jcr.ext.common.SessionProvider sessionProvider) throws javax.jcr.RepositoryException, javax.jcr.ItemNotFoundException
- Throws:
javax.jcr.RepositoryExceptionjavax.jcr.ItemNotFoundException
-
-