Interface NewsService

  • All Known Implementing Classes:
    NewsServiceImpl

    public interface NewsService
    • Method Detail

      • getNewsById

        News getNewsById​(String newsId,
                         boolean editMode)
        Retrives a news identified by its technical identifier
        Parameters:
        newsId - News identifier
        editMode -
        Returns:
        News if found else null
      • getNewsById

        News getNewsById​(String newsId,
                         String authenticatedUser,
                         boolean editMode)
                  throws IllegalAccessException
        Retrives a news identified by its technical identifier
        Parameters:
        newsId - News identifier
        authenticatedUser - user attempting to access news
        editMode - access mode to news: whether to edit news to to view it.
        Returns:
        News if found else null
        Throws:
        IllegalAccessException - when user doesn't have access to News
      • 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 - ExoSocialActivity identifier
        authenticatedUser - user attempting to access news
        Returns:
        News if found else null
        Throws:
        IllegalAccessException - when user doesn't have access to News or ExoSocialActivity
        org.exoplatform.commons.exception.ObjectNotFoundException - when a News wasn't found for this activity identifier
      • 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 - News to share
        space - Space to share with, the news
        userIdentity - Identity of user making the modification
        sharedActivityId - newly generated activity identifier
        Throws:
        IllegalAccessException - when user doesn't have access to News
        org.exoplatform.commons.exception.ObjectNotFoundException - when News is not found
      • convertNodeToNews

        News convertNodeToNews​(javax.jcr.Node node,
                               boolean editMode)
                        throws Exception
        Throws:
        Exception
      • canEditNews

        boolean canEditNews​(String posterId,
                            String spaceId)
      • canViewNews

        boolean canViewNews​(News news,
                            String authenticatedUser)
        Parameters:
        news - News to check
        authenticatedUser - authenticated username
        Returns:
        true if user has access to news, else false
      • canEditNews

        boolean canEditNews​(News news,
                            String authenticatedUser)
        Parameters:
        news - News to check
        authenticatedUser - authenticated username
        Returns:
        true if user has access to news, else false
      • canPinNews

        boolean canPinNews()
      • canArchiveNews

        boolean canArchiveNews​(String newsAuthor)
      • canDeleteNews

        boolean canDeleteNews​(String posterId,
                              String spaceId)
      • search

        List<NewsESSearchResult> search​(org.exoplatform.social.core.identity.model.Identity currentUser,
                                        String term,
                                        int offset,
                                        int limit)