private void addProgrammeRequirements(String graduateDegree) {
String labelThe =
getDocumentRequest().getRequestedCycle().equals(CycleType.FIRST_CYCLE) ? BundleUtil.getString(Bundle.ACADEMIC,
getLocale(), "label.the.female") : BundleUtil.getString(Bundle.ACADEMIC, getLocale(), "label.the.male");
long ectsCredits = getDocumentRequest().getEctsCredits();
DegreeOfficialPublication dr = getDocumentRequest().getDegreeOfficialPublication();
if (dr == null) {
throw new DomainException("error.DiplomaSupplement.degreeOfficialPublicationNotFound");
}
String officialPublication = dr.getOfficialReference();
String programmeRequirements;
if (getDocumentRequest().isRequestForPhd()) {
programmeRequirements =
applyMessageArguments(BundleUtil.getString(Bundle.ACADEMIC, getLocale(),
"diploma.supplement.four.two.programmerequirements.template.noareas.with.official.publication"),
labelThe, graduateDegree, Long.toString(ectsCredits), officialPublication);
} else if (getDocumentRequest().getRequestedCycle().equals(CycleType.FIRST_CYCLE)
|| dr.getSpecializationAreaSet().size() == 0) {
programmeRequirements =
applyMessageArguments(BundleUtil.getString(Bundle.ACADEMIC, getLocale(),
"diploma.supplement.four.two.programmerequirements.template.noareas"), labelThe, graduateDegree,
Long.toString(ectsCredits));
} else {
List<String> areas = new ArrayList<String>();
for (DegreeSpecializationArea area : dr.getSpecializationAreaSet()) {
areas.add(area.getName().getContent(getLanguage()));
}
programmeRequirements =
applyMessageArguments(BundleUtil.getString(Bundle.ACADEMIC, getLocale(),
"diploma.supplement.four.two.programmerequirements.template.withareas"), labelThe, graduateDegree,