View Javadoc
1   package org.kuali.student.ap.plannerreview;
2   
3   import org.kuali.student.ap.plannerreview.infc.Conversation;
4   import org.kuali.student.ap.plannerreview.infc.ConversationAdvisor;
5   import org.kuali.student.ap.plannerreview.infc.ConversationComment;
6   import org.kuali.student.ap.plannerreview.infc.LearningPlanReviewRequest;
7   import org.kuali.student.r2.common.exceptions.PermissionDeniedException;
8   import org.kuali.student.r2.common.infc.RichText;
9   
10  import java.util.List;
11  
12  /**
13   * Defines methods for interacting with Learning Plan Reviews
14   * @author Chris Maurer <chmaurer@iu.edu>
15   *
16   */
17  public interface LearningPlanReviewStrategy {
18  
19      /**
20  	 * Get all available advisors for the current student
21  	 * @return
22  	 */
23  	List<ConversationAdvisor> getAdvisors();
24  	
25  	/**
26  	 * Calls {@link #getAdvisors()} and returns true if the list is not empty.
27  	 * @return
28  	 */
29  	boolean hasAdvisors();
30  	
31  	/**
32  	 * Create a new learning plan review, based on an existing learning plan,
33  	 * and return the learning plan ID for the review.
34  	 * 
35  	 * <p>
36  	 * The resulting learning plan will have a type of
37  	 * {@link org.kuali.student.ap.academicplan.constants.AcademicPlanServiceConstants.LEARNING_PLAN_TYPE_PLAN_REVIEW}
38  	 * </p>
39  	 * 
40  	 * @param request
41  	 *            The request for review.
42  	 * @return The ID for the newly created learning plan review.
43  	 * @throws org.kuali.student.r2.common.exceptions.PermissionDeniedException
44  	 *             If the current user does not have access to the create a
45  	 *             learning plan review.
46  	 */
47  	String createLearningPlanReview(LearningPlanReviewRequest request)  throws PermissionDeniedException;
48  
49  	/**
50  	 * Create a new conversation based on a learning plan review.
51  	 *
52  	 * @param learningPlanId
53  	 *            The ID of the learning plan review.
54  	 * @return The newly created conversation.
55  	 * @throws org.kuali.student.r2.common.exceptions.PermissionDeniedException
56  	 *             If the current user does not have access to the requested
57  	 *             learning plan.
58  	 */
59  	Conversation getConversation(String learningPlanId) throws PermissionDeniedException;
60  
61  	/**
62  	 * Add a comment to the conversation on a learning plan review.
63  	 * @param learningPlanId The ID of the learning plan review.
64  	 * @param byAdvisor	Flag indicating if the comment is from the advisor.  False means it is from the student.
65  	 * @param comment The comment to add
66  	 * @return The newly added comment
67  	 * @throws org.kuali.student.r2.common.exceptions.PermissionDeniedException
68  	 *             If the current user does not have access to the requested
69  	 *             learning plan.
70  	 */
71  	ConversationComment addCommentToConversation(String learningPlanId, boolean byAdvisor,
72                                                   RichText comment) throws PermissionDeniedException;
73  
74  	/**
75  	 * Get all conversations for a student
76  	 * @return A list of Conversations
77  	 * @throws org.kuali.student.r2.common.exceptions.PermissionDeniedException
78  	 *             If the current user does not have access to view conversations.
79  	 */
80  	List<Conversation> getConversations() throws PermissionDeniedException;
81  
82  	/**
83  	 * Mark a single comment as read
84  	 * @param conversationCommentId
85  	 * 				The ID of the comment to mark as read
86  	 * @return A success or failure to do the update
87  	 * @throws org.kuali.student.r2.common.exceptions.PermissionDeniedException
88  	 *             If the current user does not have access to the requested
89  	 *             conversation comment.
90  	 */
91  	boolean markCommentAsRead(String conversationCommentId) throws PermissionDeniedException;
92  
93  	/**
94  	 * Mark all comments inside a conversation as read
95  	 * @param learningPlanId The ID of the learning plan review
96  	 * @return A success or failure to do the update
97  	 * @throws org.kuali.student.r2.common.exceptions.PermissionDeniedException
98  	 *             If the current user does not have access to the requested
99  	 *             learning plan.
100 	 */
101 	boolean markAllConversationCommentsAsRead(String learningPlanId) throws PermissionDeniedException;
102 
103 }