Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
CommentRpcService |
|
| 1.0;1 |
1 | /** | |
2 | * Copyright 2010 The Kuali Foundation Licensed under the | |
3 | * Educational Community License, Version 2.0 (the "License"); you may | |
4 | * not use this file except in compliance with the License. You may | |
5 | * obtain a copy of the License at | |
6 | * | |
7 | * http://www.osedu.org/licenses/ECL-2.0 | |
8 | * | |
9 | * Unless required by applicable law or agreed to in writing, | |
10 | * software distributed under the License is distributed on an "AS IS" | |
11 | * BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express | |
12 | * or implied. See the License for the specific language governing | |
13 | * permissions and limitations under the License. | |
14 | */ | |
15 | ||
16 | package org.kuali.student.core.comments.ui.client.service; | |
17 | ||
18 | import java.util.List; | |
19 | ||
20 | import org.kuali.student.common.dto.StatusInfo; | |
21 | import org.kuali.student.common.ui.client.service.BaseRpcService; | |
22 | import org.kuali.student.core.comment.dto.CommentInfo; | |
23 | import org.kuali.student.core.comment.dto.CommentTypeInfo; | |
24 | ||
25 | import com.google.gwt.user.client.rpc.RemoteServiceRelativePath; | |
26 | ||
27 | @RemoteServiceRelativePath("rpcservices/CommentRpcService") | |
28 | public interface CommentRpcService extends BaseRpcService { | |
29 | /** | |
30 | * Adds a comment to a reference. | |
31 | * @param referenceId identifier of reference | |
32 | * @param referenceTypeKey reference type | |
33 | * @param commentInfo detailed information about the comment | |
34 | * @return detailed information about the comment | |
35 | * @throws Exception | |
36 | */ | |
37 | public CommentInfo addComment(String referenceId, String referenceTypeKey, CommentInfo commentInfo) throws Exception; | |
38 | /** | |
39 | * Retrieves comment information for a reference. The expected behavior is that if the caller is not authorized to invoke the getComments operation, a PERMISSION_DENIED error is returned. Assuming that the caller is authorized to invoke getComments, only comments that the caller is authorized to view are included in the returned commentInfoList; comments that the caller is unauthorized to view are filtered out of the return parameter. | |
40 | * @param referenceId reference identifier | |
41 | * @param referenceTypeKey reference type | |
42 | * @return list of comment information | |
43 | * @throws Exception | |
44 | */ | |
45 | public List<CommentInfo> getComments(String referenceId, String referenceTypeKey) throws Exception; | |
46 | /** | |
47 | * Retrieves comment information for a reference of a particular type. The expected behavior is that if the caller is not authorized to invoke the getCommentsByType operation, a PERMISSION_DENIED error is returned. Assuming that the caller is authorized to invoke getCommentsByType, only comments that the caller is authorized to view are included in the returned commentInfoList; comments that the caller is unauthorized to view are filtered out of the return parameter. | |
48 | * @param referenceId reference identifier | |
49 | * @param referenceTypeKey reference type | |
50 | * @param commentTypeKey comment type | |
51 | * @return list of comment information | |
52 | * @throws Exception | |
53 | */ | |
54 | public List<CommentInfo> getCommentsByType(String referenceId, String referenceTypeKey, String commentTypeKey) throws Exception; | |
55 | ||
56 | /** | |
57 | * Updates a comment for a reference. | |
58 | * @param referenceId identifier of reference | |
59 | * @param referenceTypeKey reference type | |
60 | * @param commentInfo detailed information about the comment | |
61 | * @return detailed information about the comment | |
62 | * @throws Exception | |
63 | */ | |
64 | public CommentInfo updateComment(String referenceId, String referenceTypeKey, CommentInfo commentInfo) throws Exception; | |
65 | ||
66 | /** | |
67 | * Removes a comment. | |
68 | * @param commentId id of comment to be removed | |
69 | * @param referenceId identifier of reference | |
70 | * @param referenceTypeKey reference type | |
71 | */ | |
72 | public StatusInfo removeComment(String commentId, String referenceId, String referenceTypeKey) throws Exception; | |
73 | ||
74 | /** | |
75 | * Gets the comment types for a particular reference type. | |
76 | * @param referenceTypeKey reference type | |
77 | */ | |
78 | public List<CommentTypeInfo> getCommentTypesForReferenceType(String referenceTypeKey) throws Exception; | |
79 | ||
80 | /** | |
81 | * Check for authorization to add a comment | |
82 | * @param id identifier of the object | |
83 | * @param referenceTypeKey reference type of the object | |
84 | */ | |
85 | public Boolean isAuthorizedAddComment(String id, String referenceTypeKey); | |
86 | ||
87 | /** | |
88 | * user IdentityService to get user name | |
89 | * @param userId | |
90 | */ | |
91 | public String getUserRealName(String userId); | |
92 | } |