Class CommentsAndReportsTreeComponent

java.lang.Object
org.ametys.cms.repository.comment.ui.CommentsAndReportsTreeComponent
All Implemented Interfaces:
Component, Contextualizable, Serviceable

Action for getting the list of comments.
  • Field Details

  • Constructor Details

  • Method Details

    • service

      public void service(ServiceManager smanager) throws ServiceException
      Specified by:
      service in interface Serviceable
      Throws:
      ServiceException
    • contextualize

      public void contextualize(Context context) throws ContextException
      Specified by:
      contextualize in interface Contextualizable
      Throws:
      ContextException
    • getCommentsAndReportsFromSelectedContents

      Retrieves the comments and reports of the given selected contents
      Parameters:
      contentIds - identifiers of the contents
      Returns:
      the comments and reports of the contents
    • getCommentsAndReportsFromContentTypeId

      public Map getCommentsAndReportsFromContentTypeId(String contentTypeId) throws javax.jcr.RepositoryException
      Retrieves the comments and reports of the contents of the given type Manages only contents that have at least one report (on itself or on a comment)
      Parameters:
      contentTypeId - the content type identifier
      Returns:
      the comments and reports of the contents
      Throws:
      javax.jcr.RepositoryException - if an error occurs while retrieving contents from the repository
    • getCommentsAndReportsFromContentTypeId

      public Map getCommentsAndReportsFromContentTypeId(String contentTypeId, String rightToCheck) throws javax.jcr.RepositoryException
      Retrieves the comments and reports of the contents of the given type Manages only contents that have at least one report (on itself or on a comment)
      Parameters:
      contentTypeId - the content type identifier
      rightToCheck - the right to check for retrieving comments
      Returns:
      the comments and reports of the contents
      Throws:
      javax.jcr.RepositoryException - if an error occurs while retrieving contents from the repository
    • _getReportedContentsFromContentType

      protected Iterable<Content> _getReportedContentsFromContentType(String contentTypeId) throws javax.jcr.RepositoryException
      Retrieves the contents from the current site with the given content type that have at least a report or a reported comment
      Parameters:
      contentTypeId - the content type identifier
      Returns:
      the contents
      Throws:
      javax.jcr.RepositoryException - if an error occurs while retrieving the contents from the repository
    • _content2json

      protected Map<String,Object> _content2json(Content content, UserIdentity user)
      Get the JSON representation of a content
      Parameters:
      content - The content
      user - the current user
      Returns:
      The content as JSON object
    • _content2json

      protected Map<String,Object> _content2json(Content content, UserIdentity user, boolean includeNoReportedComments)
      Get the JSON representation of a content
      Parameters:
      content - The content
      user - the current user
      includeNoReportedComments - true to include the comment that have no report, false otherwise
      Returns:
      The content as JSON object
    • _comment2json

      protected Map<String,Object> _comment2json(Comment comment, Content content, boolean includeNoReportedComments)
      Get the JSON representation of a comment
      Parameters:
      comment - the comment
      content - the content
      includeNoReportedComments - true to include the comment that have no report, false otherwise
      Returns:
      The comment as JSON object