use of fi.otavanopisto.muikku.plugins.communicator.events.CommunicatorMessageSent in project muikku by otavanopisto.
the class Evaluation2RESTService method sendAssessmentNotification.
private void sendAssessmentNotification(WorkspaceEntity workspaceEntity, WorkspaceAssessment workspaceAssessment, UserEntity evaluator, UserEntity student, Workspace workspace, String grade) {
String workspaceUrl = String.format("%s/workspace/%s/materials", baseUrl, workspaceEntity.getUrlName());
Locale locale = userEntityController.getLocale(student);
CommunicatorMessageCategory category = communicatorController.persistCategory("assessments");
CommunicatorMessage communicatorMessage = communicatorController.createMessage(communicatorController.createMessageId(), evaluator, Arrays.asList(student), null, null, null, category, localeController.getText(locale, "plugin.workspace.assessment.notificationTitle", new Object[] { workspace.getName(), grade }), localeController.getText(locale, "plugin.workspace.assessment.notificationContent", new Object[] { workspaceUrl, workspace.getName(), grade, workspaceAssessment.getVerbalAssessment() }), Collections.<Tag>emptySet());
communicatorMessageSentEvent.fire(new CommunicatorMessageSent(communicatorMessage.getId(), student.getId(), baseUrl));
}
Aggregations