private Set<String> populateRecipientEmails( String courseId, List<StudentAttributes> allStudents, CourseRoster roster, Map<String, List<StudentAttributes>> teamStudentTable, Map<String, List<StudentAttributes>> sectionStudentTable) throws EntityDoesNotExistException { Set<String> recipientEmailsList = new HashSet<String>(); List<CommentAttributes> sendingCommentsList = commentsDb.getCommentsForSendingState(courseId, CommentSendingState.SENDING); populateRecipientEmailsFromPendingComments( sendingCommentsList, allStudents, roster, teamStudentTable, sectionStudentTable, recipientEmailsList); List<FeedbackResponseCommentAttributes> sendingResponseCommentsList = frcLogic.getFeedbackResponseCommentsForSendingState(courseId, CommentSendingState.SENDING); populateRecipientEmailsFromPendingResponseComments( sendingResponseCommentsList, allStudents, roster, teamStudentTable, recipientEmailsList); return recipientEmailsList; }
/** ********** CRUD *********** */ public CommentAttributes createComment(CommentAttributes comment) throws InvalidParametersException, EntityAlreadyExistsException, EntityDoesNotExistException { verifyIsCoursePresent(comment.courseId, "create"); verifyIsInstructorOfCourse(comment.courseId, comment.giverEmail); return commentsDb.createEntity(comment); }
public List<CommentAttributes> getCommentsForReceiver( String courseId, String giverEmail, CommentParticipantType recipientType, String receiverEmail) throws EntityDoesNotExistException { verifyIsCoursePresent(courseId, "get"); List<CommentAttributes> comments = commentsDb.getCommentsForReceiver(courseId, recipientType, receiverEmail); Iterator<CommentAttributes> iterator = comments.iterator(); while (iterator.hasNext()) { CommentAttributes c = iterator.next(); if (!c.giverEmail.equals(giverEmail)) { iterator.remove(); } } return comments; }
public CommentSearchResultBundle searchComment( String queryString, List<InstructorAttributes> instructors, String cursorString) { return commentsDb.search(queryString, instructors, cursorString); }
/** * Create or update document for comment * * @param comment */ public void putDocument(CommentAttributes comment) { commentsDb.putDocument(comment); }
public List<CommentAttributes> getCommentDrafts(String giverEmail) { return commentsDb.getCommentDrafts(giverEmail); }
public List<CommentAttributes> getCommentsForSendingState( String courseId, CommentSendingState sendingState) throws EntityDoesNotExistException { verifyIsCoursePresent(courseId, "get"); return commentsDb.getCommentsForSendingState(courseId, sendingState); }
public CommentAttributes getComment(Long commentId) { return commentsDb.getComment(commentId); }
public void deleteCommentsForTeam(String courseId, String teamName) { commentsDb.deleteCommentsForTeam(courseId, teamName); }
public void deleteCommentsForStudent(String courseId, String studentEmail) { commentsDb.deleteCommentsByStudentEmail(courseId, studentEmail); }
public void deleteCommentsForInstructor(String courseId, String instructorEmail) { commentsDb.deleteCommentsByInstructorEmail(courseId, instructorEmail); }
/** * update comment's recipient email (assume to be a student) * * @param courseId * @param oldStudentEmail * @param updatedStudentEmail */ public void updateStudentEmail( String courseId, String oldStudentEmail, String updatedStudentEmail) { commentsDb.updateStudentEmail(courseId, oldStudentEmail, updatedStudentEmail); }
/** * update comment's giver email (assume to be an instructor) * * @param courseId * @param oldInstrEmail * @param updatedInstrEmail */ public void updateInstructorEmail( String courseId, String oldInstrEmail, String updatedInstrEmail) { commentsDb.updateInstructorEmail(courseId, oldInstrEmail, updatedInstrEmail); }
public CommentAttributes updateComment(CommentAttributes comment) throws InvalidParametersException, EntityDoesNotExistException { verifyIsCoursePresent(comment.courseId, "update"); return commentsDb.updateComment(comment); }
public void updateCommentsSendingState( String courseId, CommentSendingState oldState, CommentSendingState newState) throws EntityDoesNotExistException { verifyIsCoursePresent(courseId, "clear pending"); commentsDb.updateComments(courseId, oldState, newState); }
private List<CommentAttributes> getCommentsForCommentViewer( String courseId, CommentParticipantType commentViewerType) throws EntityDoesNotExistException { verifyIsCoursePresent(courseId, "get"); return commentsDb.getCommentsForCommentViewer(courseId, commentViewerType); }
private List<CommentAttributes> getCommentsForGiverAndStatus( String courseId, String giverEmail, CommentStatus status) throws EntityDoesNotExistException { verifyIsCoursePresent(courseId, "get"); return commentsDb.getCommentsForGiverAndStatus(courseId, giverEmail, status); }
public void deleteCommentsForSection(String courseId, String sectionName) { commentsDb.deleteCommentsForSection(courseId, sectionName); }
public void deleteCommentsForCourse(String courseId) { commentsDb.deleteCommentsForCourse(courseId); }
public void deleteComment(CommentAttributes comment) { commentsDb.deleteEntity(comment); }
public List<CommentAttributes> getCommentsForGiver(String courseId, String giverEmail) throws EntityDoesNotExistException { verifyIsCoursePresent(courseId, "get"); return commentsDb.getCommentsForGiver(courseId, giverEmail); }
public void deleteDocument(CommentAttributes comment) { commentsDb.deleteDocument(comment); }
public List<CommentAttributes> getCommentsForReceiver( String courseId, CommentParticipantType recipientType, String receiverEmail) throws EntityDoesNotExistException { verifyIsCoursePresent(courseId, "get"); return commentsDb.getCommentsForReceiver(courseId, recipientType, receiverEmail); }
@SuppressWarnings("deprecation") public List<CommentAttributes> getAllComments() { return commentsDb.getAllComments(); }