001/*
002 *  Copyright 2010 Anyware Services
003 *
004 *  Licensed under the Apache License, Version 2.0 (the "License");
005 *  you may not use this file except in compliance with the License.
006 *  You may obtain a copy of the License at
007 *
008 *      http://www.apache.org/licenses/LICENSE-2.0
009 *
010 *  Unless required by applicable law or agreed to in writing, software
011 *  distributed under the License is distributed on an "AS IS" BASIS,
012 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 *  See the License for the specific language governing permissions and
014 *  limitations under the License.
015 */
016
017package org.ametys.cms.repository.comment;
018
019import java.util.List;
020
021import org.ametys.cms.repository.ModifiableContent;
022import org.ametys.plugins.repository.AmetysRepositoryException;
023
024/**
025 * A content that can be commented by the users
026 */
027public interface CommentableContent extends ModifiableContent
028{
029    /**
030     * Creates a comment
031     * @return The new comment
032     */
033    public Comment createComment();
034    
035    /**
036     * Get a comment
037     * @param commentId The comment
038     * @return The comment
039     * @throws AmetysRepositoryException if the comment does not exist
040     */
041    public Comment getComment(String commentId) throws AmetysRepositoryException;
042
043    /**
044     * Get the list of available comments (validated, not validated, both or none :))
045     * @param includeNotValidatedComments true to get the non validated comments.
046     * @param includeValidatedComments true to get the validated comment.
047     * @return A non null list of comments on the content.
048     * @throws AmetysRepositoryException if an error occured
049     */
050    public List<Comment> getComments(boolean includeNotValidatedComments, boolean includeValidatedComments) throws AmetysRepositoryException;
051}