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.common.ui.client.service; 17 18 import java.util.List; 19 20 import org.kuali.student.core.comment.dto.CommentInfo; 21 import org.kuali.student.core.comment.dto.CommentTypeInfo; 22 import org.kuali.student.core.dto.StatusInfo; 23 24 import com.google.gwt.user.client.rpc.AsyncCallback; 25 26 public interface CommentRpcServiceAsync extends BaseRpcServiceAsync { 27 /** 28 * Adds a comment to a reference. 29 * @param referenceId identifier of reference 30 * @param referenceTypeKey reference type 31 * @param commentInfo detailed information about the comment 32 * @param detailed information about the comment 33 * @throws Exception 34 */ 35 public void addComment(String referenceId, String referenceTypeKey, CommentInfo commentInfo, AsyncCallback<CommentInfo> callback) throws Exception; 36 /** 37 * 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. 38 * @param referenceId reference identifier 39 * @param referenceTypeKey reference type 40 * @param list of comment information 41 * @throws Exception 42 */ 43 public void getComments(String referenceId, String referenceTypeKey, AsyncCallback<List<CommentInfo>> callback) throws Exception; 44 /** 45 * 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. 46 * @param referenceId reference identifier 47 * @param referenceTypeKey reference type 48 * @param commentTypeKey comment type 49 * @param list of comment information 50 * @throws Exception 51 */ 52 public void getCommentsByType(String referenceId, String referenceTypeKey, String commentTypeKey, AsyncCallback<List<CommentInfo>> callback) throws Exception; 53 54 /** 55 * Updates a comment for a reference. 56 * @param referenceId identifier of reference 57 * @param referenceTypeKey reference type 58 * @param commentInfo detailed information about the comment 59 * @param detailed information about the comment 60 * @throws Exception 61 */ 62 public void updateComment(String referenceId, String referenceTypeKey, CommentInfo commentInfo, AsyncCallback<CommentInfo> callback) throws Exception; 63 64 /** 65 * Removes a comment. 66 * @param commentId id of comment to be removed 67 * @param referenceId identifier of reference 68 * @param referenceTypeKey reference type 69 */ 70 public void removeComment(String commentId, String referenceId, String referenceTypeKey, AsyncCallback<StatusInfo> callback) throws Exception; 71 72 /** 73 * Gets the comment types for a particular reference type. 74 * @param referenceTypeKey reference type 75 */ 76 public void getCommentTypesForReferenceType(String referenceTypeKey, AsyncCallback<List<CommentTypeInfo>> callback) throws Exception; 77 78 /** 79 * Check for authorization to add a comment 80 * @param id identifier of the object related to the reference type key 81 * @param referenceTypeKey reference type key of the object the comment is being set on 82 */ 83 public void isAuthorizedAddComment(String id, String referenceTypeKey, AsyncCallback<Boolean> callback); 84 85 /** 86 * user IdentityService to get user name 87 * @param userId 88 * @param callback 89 */ 90 public void getUserRealName(String userId, AsyncCallback<String> callback); 91 }