use of fi.otavanopisto.muikku.plugins.transcriptofrecords.TranscriptofRecordsUserProperties in project muikku by otavanopisto.
the class TranscriptofRecordsRESTService method createHopsRESTModelForStudent.
private HopsRESTModel createHopsRESTModelForStudent(SchoolDataIdentifier userIdentifier) {
User user = userController.findUserByIdentifier(userIdentifier);
UserEntity userEntity = userEntityController.findUserEntityByUser(user);
EnvironmentUser environmentUser = environmentUserController.findEnvironmentUserByUserEntity(userEntity);
EnvironmentRoleEntity roleEntity = environmentUser.getRole();
if (!EnvironmentRoleArchetype.STUDENT.equals(roleEntity.getArchetype())) {
return null;
}
TranscriptofRecordsUserProperties userProperties = vopsController.loadUserProperties(user);
return new HopsRESTModel(userProperties.asString("goalSecondarySchoolDegree"), userProperties.asString("goalMatriculationExam"), userProperties.asString("vocationalYears"), userProperties.asString("goalJustMatriculationExam"), userProperties.asString("justTransferCredits"), userProperties.asString("transferCreditYears"), userProperties.asString("completionYears"), userProperties.asString("mathSyllabus"), userProperties.asString("finnish"), userProperties.asBoolean("swedish"), userProperties.asBoolean("english"), userProperties.asBoolean("german"), userProperties.asBoolean("french"), userProperties.asBoolean("italian"), userProperties.asBoolean("spanish"), userProperties.asString("science"), userProperties.asString("religion"), userProperties.asString("additionalInfo"));
}
Aggregations