Search in sources :

Example 1 with PyramusEducationType

use of fi.otavanopisto.muikku.plugins.schooldatapyramus.entities.PyramusEducationType in project muikku by otavanopisto.

the class PyramusCourseMetaSchoolDataBridge method findEducationType.

@Override
public EducationType findEducationType(String identifier) {
    Long educationTypeId = pyramusIdentifierMapper.getPyramusEducationTypeId(identifier);
    fi.otavanopisto.pyramus.rest.model.EducationType restEducationType = pyramusClient.get("/common/educationTypes/" + educationTypeId, fi.otavanopisto.pyramus.rest.model.EducationType.class);
    if (restEducationType != null) {
        return new PyramusEducationType(new SchoolDataIdentifier(identifier, getSchoolDataSource()), restEducationType.getName());
    }
    return null;
}
Also used : SchoolDataIdentifier(fi.otavanopisto.muikku.schooldata.SchoolDataIdentifier) PyramusEducationType(fi.otavanopisto.muikku.plugins.schooldatapyramus.entities.PyramusEducationType)

Example 2 with PyramusEducationType

use of fi.otavanopisto.muikku.plugins.schooldatapyramus.entities.PyramusEducationType in project muikku by otavanopisto.

the class PyramusCourseMetaSchoolDataBridge method listEducationTypes.

@Override
public List<EducationType> listEducationTypes() {
    List<EducationType> result = new ArrayList<>();
    fi.otavanopisto.pyramus.rest.model.EducationType[] types = pyramusClient.get("/common/educationTypes", fi.otavanopisto.pyramus.rest.model.EducationType[].class);
    if (types != null) {
        for (fi.otavanopisto.pyramus.rest.model.EducationType type : types) {
            SchoolDataIdentifier identifier = pyramusIdentifierMapper.getEducationTypeIdentifier(type.getId());
            result.add(new PyramusEducationType(identifier, type.getName()));
        }
    }
    return result;
}
Also used : SchoolDataIdentifier(fi.otavanopisto.muikku.schooldata.SchoolDataIdentifier) PyramusEducationType(fi.otavanopisto.muikku.plugins.schooldatapyramus.entities.PyramusEducationType) EducationType(fi.otavanopisto.muikku.schooldata.entity.EducationType) PyramusEducationType(fi.otavanopisto.muikku.plugins.schooldatapyramus.entities.PyramusEducationType) ArrayList(java.util.ArrayList)

Aggregations

PyramusEducationType (fi.otavanopisto.muikku.plugins.schooldatapyramus.entities.PyramusEducationType)2 SchoolDataIdentifier (fi.otavanopisto.muikku.schooldata.SchoolDataIdentifier)2 EducationType (fi.otavanopisto.muikku.schooldata.entity.EducationType)1 ArrayList (java.util.ArrayList)1