}
@HandlesEvent("createStandard")
public Resolution createStandard() {
String message = EsimsConstants._BLANK_STRING;
AcademicYear academicYearToBeLinkedWith = this.standardService
.getAcademicYearsById(this.academicYearId);
Standard standard = new Standard(this.name, academicYearToBeLinkedWith);
// Check if the standard already exists inthe system before performing a
// save.
if (this.standardService.checkIfStdExists(standard)) {
message = EsimsUtils.createWarnMessage(this.getContext()
.getContextPath(), "<strong>The standard " + this.getName()
+ " already exists !!</strong>");
} else {
this.standardService.save(standard);
message = EsimsUtils.createInfoMessage(this.getContext()
.getContextPath(), "<strong>" + this.name
+ "</strong> was created succesfully for "
+ academicYearToBeLinkedWith.getDescription());
this.getContext().removeAttributeFromSession("listOfAcademicYears");
}
FlashScope.getCurrent(this.getContext().getRequest(),true).put("message", message);
return new RedirectResolution(DisplayMessageAction.class, "forwardToMessagePage");
}