Package org.exoplatform.news.utils
Class NewsUtils
- java.lang.Object
-
- org.exoplatform.news.utils.NewsUtils
-
public class NewsUtils extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static StringARCHIVE_NEWSstatic StringCOMMENT_NEWSstatic StringDELETE_NEWSstatic StringDISPLAYED_STATUSstatic StringLIKE_NEWSstatic StringNEWS_METADATA_OBJECT_TYPEstatic StringPOST_NEWSstatic StringPOST_NEWS_ARTICLEstatic StringPUBLISH_NEWSstatic StringSCHEDULE_NEWSstatic StringSHARE_NEWSstatic StringUNARCHIVE_NEWSstatic StringUNSCHEDULE_NEWSstatic StringUPDATE_NEWSstatic StringVIEW_NEWS
-
Constructor Summary
Constructors Constructor Description NewsUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidbroadcastEvent(String eventName, Object source, Object data)static booleancanManageNewsPublishTargets(org.exoplatform.services.security.Identity currentIdentity)static booleancanPublishNews(org.exoplatform.services.security.Identity currentIdentity)static List<org.exoplatform.social.core.space.model.Space>getRedactorOrManagerSpaces(String userId)static org.exoplatform.services.security.IdentitygetUserIdentity(String username)static Set<String>processMentions(String body)Processes Mentioners who has been mentioned via the news body.
-
-
-
Field Detail
-
POST_NEWS
public static final String POST_NEWS
- See Also:
- Constant Field Values
-
POST_NEWS_ARTICLE
public static final String POST_NEWS_ARTICLE
- See Also:
- Constant Field Values
-
PUBLISH_NEWS
public static final String PUBLISH_NEWS
- See Also:
- Constant Field Values
-
VIEW_NEWS
public static final String VIEW_NEWS
- See Also:
- Constant Field Values
-
SHARE_NEWS
public static final String SHARE_NEWS
- See Also:
- Constant Field Values
-
ARCHIVE_NEWS
public static final String ARCHIVE_NEWS
- See Also:
- Constant Field Values
-
UNARCHIVE_NEWS
public static final String UNARCHIVE_NEWS
- See Also:
- Constant Field Values
-
COMMENT_NEWS
public static final String COMMENT_NEWS
- See Also:
- Constant Field Values
-
LIKE_NEWS
public static final String LIKE_NEWS
- See Also:
- Constant Field Values
-
DELETE_NEWS
public static final String DELETE_NEWS
- See Also:
- Constant Field Values
-
UPDATE_NEWS
public static final String UPDATE_NEWS
- See Also:
- Constant Field Values
-
SCHEDULE_NEWS
public static final String SCHEDULE_NEWS
- See Also:
- Constant Field Values
-
UNSCHEDULE_NEWS
public static final String UNSCHEDULE_NEWS
- See Also:
- Constant Field Values
-
NEWS_METADATA_OBJECT_TYPE
public static final String NEWS_METADATA_OBJECT_TYPE
- See Also:
- Constant Field Values
-
DISPLAYED_STATUS
public static final String DISPLAYED_STATUS
- See Also:
- Constant Field Values
-
-
Method Detail
-
processMentions
public static Set<String> processMentions(String body)
Processes Mentioners who has been mentioned via the news body.- Parameters:
body-- Returns:
- set of mentioned users
-
getRedactorOrManagerSpaces
public static List<org.exoplatform.social.core.space.model.Space> getRedactorOrManagerSpaces(String userId) throws Exception
- Throws:
Exception
-
canPublishNews
public static boolean canPublishNews(org.exoplatform.services.security.Identity currentIdentity)
-
canManageNewsPublishTargets
public static boolean canManageNewsPublishTargets(org.exoplatform.services.security.Identity currentIdentity)
-
getUserIdentity
public static org.exoplatform.services.security.Identity getUserIdentity(String username)
-
-