KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > outerj > daisy > repository > comment > CommentManager


1 /*
2  * Copyright 2004 Outerthought bvba and Schaubroeck nv
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16 package org.outerj.daisy.repository.comment;
17
18 import org.outerj.daisy.repository.RepositoryException;
19 import org.outerj.daisy.repository.VariantKey;
20
21 public interface CommentManager {
22     Comment addComment(long documentId, long branchId, long languageId, CommentVisibility visibility, String JavaDoc commentText) throws RepositoryException;
23
24     /**
25      * Adds a comment to the branch "main", language "default" of this document.
26      */

27     Comment addComment(long documentId, CommentVisibility visibility, String JavaDoc commentText) throws RepositoryException;
28
29     /**
30      * Deletes a comment. These are the rules for deleting comments:
31      * <ul>
32      * <li>Administrators can delete all comments, also private comments from other users.
33      * <li>Users with write access to the document can delete their own private comments,
34      * public comments and editors-only comments.
35      * <li>Other users can only delete their own private comments.
36      * </ul>
37      */

38     void deleteComment(long documentId, long branchId, long languageId, long commentId) throws RepositoryException;
39
40     /**
41      * Deletes a comment from the branch "main", language "default" of the document.
42      */

43     void deleteComment(long documentId, long commentId) throws RepositoryException;
44
45     void deleteComment(Comment comment) throws RepositoryException;
46
47     /**
48      * Returns the comments for a specific document variant. Only private comment of the current
49      * user will be included (also for administrators). Editors-only comments are only
50      * included when the user has write access to the document.
51      *
52      * <p>The comments are ordered by creation date.
53      */

54     Comments getComments(long documentId, long branchId, long langugeId) throws RepositoryException;
55
56     /**
57      * @see #getComments(long, long, long)
58      */

59     Comments getComments(VariantKey variantKey) throws RepositoryException;
60
61     /**
62      * Gets the comments from the branch "main", languge "default" of the document.
63      */

64     Comments getComments(long documentId) throws RepositoryException;
65
66     /**
67      * Returns all comments with the specified visibility, created by the current user.
68      */

69     Comments getComments(CommentVisibility visibility) throws RepositoryException;
70
71     /**
72      * Returns all comments created by the current user.
73      */

74     Comments getComments() throws RepositoryException;
75 }
76
Popular Tags