Search in sources :

Example 1 with TranscriptofRecordsUserProperties

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"));
}
Also used : EnvironmentUser(fi.otavanopisto.muikku.model.users.EnvironmentUser) EnvironmentRoleEntity(fi.otavanopisto.muikku.model.users.EnvironmentRoleEntity) User(fi.otavanopisto.muikku.schooldata.entity.User) EnvironmentUser(fi.otavanopisto.muikku.model.users.EnvironmentUser) UserEntity(fi.otavanopisto.muikku.model.users.UserEntity) TranscriptofRecordsUserProperties(fi.otavanopisto.muikku.plugins.transcriptofrecords.TranscriptofRecordsUserProperties)

Aggregations

EnvironmentRoleEntity (fi.otavanopisto.muikku.model.users.EnvironmentRoleEntity)1 EnvironmentUser (fi.otavanopisto.muikku.model.users.EnvironmentUser)1 UserEntity (fi.otavanopisto.muikku.model.users.UserEntity)1 TranscriptofRecordsUserProperties (fi.otavanopisto.muikku.plugins.transcriptofrecords.TranscriptofRecordsUserProperties)1 User (fi.otavanopisto.muikku.schooldata.entity.User)1