public Resolution createEntranceExam() {
String message = EsimsConstants._BLANK_STRING;
AcademicYear academicYear = this.academicYearService.getById(new Long(
this.getContext().getRequest().getParameter("academicYearId")));
EntranceExam entranceExam = new EntranceExam(academicYear,
this.dateOfExam, this.description, this.startTime, this.endTime);
// Check if entrance exam already exists
if (this.entranceExamService.checkIfAlreadyExists(entranceExam)) {
message = EsimsUtils.createWarnMessage(this.getContext()
.getContextPath(),
"<strong>The entrance exam already exists !!</strong>");
} else {
this.entranceExamService.save(entranceExam);
message = EsimsUtils.createInfoMessage(this.getContext()
.getContextPath(), "<strong>The entrance exam "
+ entranceExam.getDescription()
+ " has been created succesfully !</strong>");
}
this.getContext().removeAttributeFromSession("academicYear");
FlashScope.getCurrent(this.getContext().getRequest(),true).put("message", message);
return new RedirectResolution(DisplayMessageAction.class, "forwardToMessagePage");