Search in sources :

Example 1 with StudentActivityType

use of fi.otavanopisto.pyramus.domainmodel.students.StudentActivityType in project pyramus by otavanopisto.

the class StudentsService method createStudent.

public StudentEntity createStudent(@WebParam(name = "abstractStudentId") Long abstractStudentId, @WebParam(name = "firstName") String firstName, @WebParam(name = "lastName") String lastName, @WebParam(name = "nickname") String nickname, @WebParam(name = "phone") String phone, @WebParam(name = "additionalInfo") String additionalInfo, @WebParam(name = "parentalInfo") String parentalInfo, @WebParam(name = "studyTimeEnd") Date studyTimeEnd, @WebParam(name = "activityTypeId") Long activityTypeId, @WebParam(name = "examinationTypeId") Long examinationTypeId, @WebParam(name = "educationalLevelId") Long educationalLevelId, @WebParam(name = "education") String education, @WebParam(name = "nationalityId") Long nationalityId, @WebParam(name = "municipalityId") Long municipalityId, @WebParam(name = "languageId") Long languageId, @WebParam(name = "schoolId") Long schoolId, @WebParam(name = "studyProgrammeId") Long studyProgrammeId, @WebParam(name = "previousStudies") Double previousStudies, @WebParam(name = "studyStartDate") Date studyStartDate, @WebParam(name = "studyEndDate") Date studyEndDate, @WebParam(name = "studyEndReasonId") Long studyEndReasonId, @WebParam(name = "studyEndText") String studyEndText, @WebParam(name = "lodging") Boolean lodging) {
    StudentDAO studentDAO = DAOFactory.getInstance().getStudentDAO();
    PersonDAO personDAO = DAOFactory.getInstance().getPersonDAO();
    StudentActivityTypeDAO activityTypeDAO = DAOFactory.getInstance().getStudentActivityTypeDAO();
    StudentExaminationTypeDAO examinationTypeDAO = DAOFactory.getInstance().getStudentExaminationTypeDAO();
    StudentEducationalLevelDAO educationalLevelDAO = DAOFactory.getInstance().getStudentEducationalLevelDAO();
    StudentStudyEndReasonDAO studyEndReasonDAO = DAOFactory.getInstance().getStudentStudyEndReasonDAO();
    LanguageDAO languageDAO = DAOFactory.getInstance().getLanguageDAO();
    MunicipalityDAO municipalityDAO = DAOFactory.getInstance().getMunicipalityDAO();
    NationalityDAO nationalityDAO = DAOFactory.getInstance().getNationalityDAO();
    SchoolDAO schoolDAO = DAOFactory.getInstance().getSchoolDAO();
    StudyProgrammeDAO studyProgrammeDAO = DAOFactory.getInstance().getStudyProgrammeDAO();
    ContactInfoDAO contactInfoDAO = DAOFactory.getInstance().getContactInfoDAO();
    PhoneNumberDAO phoneNumberDAO = DAOFactory.getInstance().getPhoneNumberDAO();
    ContactTypeDAO contactTypeDAO = DAOFactory.getInstance().getContactTypeDAO();
    StudentLodgingPeriodDAO studentLodgingPeriodDAO = DAOFactory.getInstance().getStudentLodgingPeriodDAO();
    Person person = personDAO.findById(abstractStudentId);
    Nationality nationality = nationalityId == null ? null : nationalityDAO.findById(nationalityId);
    Municipality municipality = municipalityId == null ? null : municipalityDAO.findById(municipalityId);
    Language language = languageId == null ? null : languageDAO.findById(languageId);
    StudentActivityType activityType = activityTypeId == null ? null : activityTypeDAO.findById(activityTypeId);
    StudentExaminationType examinationType = examinationTypeId == null ? null : examinationTypeDAO.findById(examinationTypeId);
    StudentEducationalLevel educationalLevel = educationalLevelId == null ? null : educationalLevelDAO.findById(educationalLevelId);
    School school = schoolId == null ? null : schoolDAO.findById(schoolId);
    StudyProgramme studyProgramme = studyProgrammeId == null ? null : studyProgrammeDAO.findById(studyProgrammeId);
    StudentStudyEndReason studyEndReason = studyEndReasonId == null ? null : studyEndReasonDAO.findById(studyEndReasonId);
    firstName = StringUtils.trim(firstName);
    lastName = StringUtils.trim(lastName);
    nickname = StringUtils.trim(nickname);
    Student student = studentDAO.create(person, firstName, lastName, nickname, additionalInfo, studyTimeEnd, activityType, examinationType, educationalLevel, education, nationality, municipality, language, school, studyProgramme, null, previousStudies, studyStartDate, studyEndDate, studyEndReason, studyEndText, false);
    if (lodging && studyStartDate != null)
        studentLodgingPeriodDAO.create(student, studyStartDate, studyEndDate);
    if (phone != null) {
        ContactType contactType = contactTypeDAO.findById(new Long(1));
        phoneNumberDAO.create(student.getContactInfo(), contactType, Boolean.TRUE, phone);
    }
    contactInfoDAO.update(student.getContactInfo(), parentalInfo);
    // Default user
    personDAO.updateDefaultUser(person, student);
    validateEntity(student);
    return EntityFactoryVault.buildFromDomainObject(student);
}
Also used : PhoneNumberDAO(fi.otavanopisto.pyramus.dao.base.PhoneNumberDAO) ContactType(fi.otavanopisto.pyramus.domainmodel.base.ContactType) StudyProgramme(fi.otavanopisto.pyramus.domainmodel.base.StudyProgramme) StudentStudyEndReason(fi.otavanopisto.pyramus.domainmodel.students.StudentStudyEndReason) StudentStudyEndReasonDAO(fi.otavanopisto.pyramus.dao.students.StudentStudyEndReasonDAO) StudentEducationalLevel(fi.otavanopisto.pyramus.domainmodel.students.StudentEducationalLevel) StudentLodgingPeriodDAO(fi.otavanopisto.pyramus.dao.students.StudentLodgingPeriodDAO) PersonDAO(fi.otavanopisto.pyramus.dao.base.PersonDAO) School(fi.otavanopisto.pyramus.domainmodel.base.School) Language(fi.otavanopisto.pyramus.domainmodel.base.Language) MunicipalityDAO(fi.otavanopisto.pyramus.dao.base.MunicipalityDAO) StudentEducationalLevelDAO(fi.otavanopisto.pyramus.dao.students.StudentEducationalLevelDAO) SchoolDAO(fi.otavanopisto.pyramus.dao.base.SchoolDAO) ContactTypeDAO(fi.otavanopisto.pyramus.dao.base.ContactTypeDAO) StudentExaminationTypeDAO(fi.otavanopisto.pyramus.dao.students.StudentExaminationTypeDAO) Municipality(fi.otavanopisto.pyramus.domainmodel.base.Municipality) StudentExaminationType(fi.otavanopisto.pyramus.domainmodel.students.StudentExaminationType) LanguageDAO(fi.otavanopisto.pyramus.dao.base.LanguageDAO) NationalityDAO(fi.otavanopisto.pyramus.dao.base.NationalityDAO) StudentActivityTypeDAO(fi.otavanopisto.pyramus.dao.students.StudentActivityTypeDAO) Student(fi.otavanopisto.pyramus.domainmodel.students.Student) StudyProgrammeDAO(fi.otavanopisto.pyramus.dao.base.StudyProgrammeDAO) Nationality(fi.otavanopisto.pyramus.domainmodel.base.Nationality) StudentDAO(fi.otavanopisto.pyramus.dao.students.StudentDAO) ContactInfoDAO(fi.otavanopisto.pyramus.dao.base.ContactInfoDAO) StudentActivityType(fi.otavanopisto.pyramus.domainmodel.students.StudentActivityType) Person(fi.otavanopisto.pyramus.domainmodel.base.Person)

Example 2 with StudentActivityType

use of fi.otavanopisto.pyramus.domainmodel.students.StudentActivityType in project pyramus by otavanopisto.

the class StudentsService method updateStudent.

public void updateStudent(@WebParam(name = "studentId") Long studentId, @WebParam(name = "firstName") String firstName, @WebParam(name = "lastName") String lastName, @WebParam(name = "nickname") String nickname, @WebParam(name = "phone") String phone, @WebParam(name = "additionalInfo") String additionalInfo, @WebParam(name = "parentalInfo") String parentalInfo, @WebParam(name = "studyTimeEnd") Date studyTimeEnd, @WebParam(name = "activityTypeId") Long activityTypeId, @WebParam(name = "examinationTypeId") Long examinationTypeId, @WebParam(name = "educationalLevelId") Long educationalLevelId, @WebParam(name = "education") String education, @WebParam(name = "nationalityId") Long nationalityId, @WebParam(name = "municipalityId") Long municipalityId, @WebParam(name = "languageId") Long languageId, @WebParam(name = "schoolId") Long schoolId, @WebParam(name = "studyProgrammeId") Long studyProgrammeId, @WebParam(name = "previousStudies") Double previousStudies, @WebParam(name = "studyStartDate") Date studyStartDate, @WebParam(name = "studyEndDate") Date studyEndDate, @WebParam(name = "studyEndReasonId") Long studyEndReasonId, @WebParam(name = "studyEndText") String studyEndText, @WebParam(name = "lodging") Boolean lodging) {
    // TODO Get rid of phone number and parental info
    StudentDAO studentDAO = DAOFactory.getInstance().getStudentDAO();
    StudentActivityTypeDAO activityTypeDAO = DAOFactory.getInstance().getStudentActivityTypeDAO();
    StudentExaminationTypeDAO examinationTypeDAO = DAOFactory.getInstance().getStudentExaminationTypeDAO();
    StudentEducationalLevelDAO educationalLevelDAO = DAOFactory.getInstance().getStudentEducationalLevelDAO();
    StudentStudyEndReasonDAO studyEndReasonDAO = DAOFactory.getInstance().getStudentStudyEndReasonDAO();
    LanguageDAO languageDAO = DAOFactory.getInstance().getLanguageDAO();
    MunicipalityDAO municipalityDAO = DAOFactory.getInstance().getMunicipalityDAO();
    NationalityDAO nationalityDAO = DAOFactory.getInstance().getNationalityDAO();
    SchoolDAO schoolDAO = DAOFactory.getInstance().getSchoolDAO();
    StudyProgrammeDAO studyProgrammeDAO = DAOFactory.getInstance().getStudyProgrammeDAO();
    Student student = studentDAO.findById(studentId);
    Nationality nationality = nationalityId == null ? null : nationalityDAO.findById(nationalityId);
    Municipality municipality = municipalityId == null ? null : municipalityDAO.findById(municipalityId);
    Language language = languageId == null ? null : languageDAO.findById(languageId);
    StudentActivityType activityType = activityTypeId == null ? null : activityTypeDAO.findById(activityTypeId);
    StudentExaminationType examinationType = activityTypeId == null ? null : examinationTypeDAO.findById(examinationTypeId);
    StudentEducationalLevel educationalLevel = educationalLevelId == null ? null : educationalLevelDAO.findById(educationalLevelId);
    School school = schoolId == null ? null : schoolDAO.findById(schoolId);
    StudyProgramme studyProgramme = studyProgrammeId == null ? null : studyProgrammeDAO.findById(studyProgrammeId);
    StudentStudyEndReason studyEndReason = studyEndReasonId == null ? null : studyEndReasonDAO.findById(studyEndReasonId);
    Curriculum curriculum = student.getCurriculum();
    firstName = StringUtils.trim(firstName);
    lastName = StringUtils.trim(lastName);
    nickname = StringUtils.trim(nickname);
    // TODO lodging cannot be updated with a single boolean (remove parameter)
    studentDAO.update(student, firstName, lastName, nickname, additionalInfo, studyTimeEnd, activityType, examinationType, educationalLevel, education, nationality, municipality, language, school, studyProgramme, curriculum, previousStudies, studyStartDate, studyEndDate, studyEndReason, studyEndText);
    validateEntity(student);
}
Also used : StudentExaminationTypeDAO(fi.otavanopisto.pyramus.dao.students.StudentExaminationTypeDAO) Municipality(fi.otavanopisto.pyramus.domainmodel.base.Municipality) StudyProgramme(fi.otavanopisto.pyramus.domainmodel.base.StudyProgramme) StudentExaminationType(fi.otavanopisto.pyramus.domainmodel.students.StudentExaminationType) StudentStudyEndReason(fi.otavanopisto.pyramus.domainmodel.students.StudentStudyEndReason) StudentStudyEndReasonDAO(fi.otavanopisto.pyramus.dao.students.StudentStudyEndReasonDAO) LanguageDAO(fi.otavanopisto.pyramus.dao.base.LanguageDAO) NationalityDAO(fi.otavanopisto.pyramus.dao.base.NationalityDAO) StudentActivityTypeDAO(fi.otavanopisto.pyramus.dao.students.StudentActivityTypeDAO) Student(fi.otavanopisto.pyramus.domainmodel.students.Student) StudentEducationalLevel(fi.otavanopisto.pyramus.domainmodel.students.StudentEducationalLevel) StudyProgrammeDAO(fi.otavanopisto.pyramus.dao.base.StudyProgrammeDAO) Nationality(fi.otavanopisto.pyramus.domainmodel.base.Nationality) StudentDAO(fi.otavanopisto.pyramus.dao.students.StudentDAO) School(fi.otavanopisto.pyramus.domainmodel.base.School) Language(fi.otavanopisto.pyramus.domainmodel.base.Language) StudentActivityType(fi.otavanopisto.pyramus.domainmodel.students.StudentActivityType) MunicipalityDAO(fi.otavanopisto.pyramus.dao.base.MunicipalityDAO) StudentEducationalLevelDAO(fi.otavanopisto.pyramus.dao.students.StudentEducationalLevelDAO) Curriculum(fi.otavanopisto.pyramus.domainmodel.base.Curriculum) SchoolDAO(fi.otavanopisto.pyramus.dao.base.SchoolDAO)

Example 3 with StudentActivityType

use of fi.otavanopisto.pyramus.domainmodel.students.StudentActivityType in project pyramus by otavanopisto.

the class StudentRESTService method updateStudentActivityType.

@Path("/activityTypes/{ID:[0-9]*}")
@PUT
@RESTPermit(StudentActivityTypePermissions.UPDATE_STUDENTACTIVITYTYPE)
public Response updateStudentActivityType(@PathParam("ID") Long id, fi.otavanopisto.pyramus.rest.model.StudentActivityType entity) {
    StudentActivityType studentActivityType = studentActivityTypeController.findStudentActivityTypeById(id);
    if (studentActivityType == null) {
        return Response.status(Status.NOT_FOUND).build();
    }
    if (studentActivityType.getArchived()) {
        return Response.status(Status.NOT_FOUND).build();
    }
    String name = entity.getName();
    if (StringUtils.isBlank(name)) {
        return Response.status(Status.BAD_REQUEST).build();
    }
    return Response.ok().entity(objectFactory.createModel(studentActivityTypeController.updateStudentActivityType(studentActivityType, name))).build();
}
Also used : StudentActivityType(fi.otavanopisto.pyramus.domainmodel.students.StudentActivityType) Path(javax.ws.rs.Path) RESTPermit(fi.otavanopisto.pyramus.rest.annotation.RESTPermit) PUT(javax.ws.rs.PUT)

Example 4 with StudentActivityType

use of fi.otavanopisto.pyramus.domainmodel.students.StudentActivityType in project pyramus by otavanopisto.

the class StudentRESTService method updateStudent.

@Path("/students/{ID:[0-9]*}")
@PUT
@RESTPermit(handling = Handling.INLINE)
public Response updateStudent(@PathParam("ID") Long id, fi.otavanopisto.pyramus.rest.model.Student entity) {
    if (entity == null) {
        return Response.status(Status.BAD_REQUEST).build();
    }
    Student student = studentController.findStudentById(id);
    Status studentStatus = checkStudent(student);
    if (studentStatus != Status.OK)
        return Response.status(studentStatus).build();
    if (!restSecurity.hasPermission(new String[] { StudentPermissions.UPDATE_STUDENT, StudentPermissions.STUDENT_OWNER }, entity, Style.OR)) {
        return Response.status(Status.FORBIDDEN).build();
    }
    Long personId = entity.getPersonId();
    Long studyProgrammeId = entity.getStudyProgrammeId();
    String firstName = StringUtils.trim(entity.getFirstName());
    String lastName = StringUtils.trim(entity.getLastName());
    String nickname = StringUtils.trim(entity.getNickname());
    if (personId == null || studyProgrammeId == null) {
        return Response.status(Status.BAD_REQUEST).build();
    }
    if (StringUtils.isBlank(firstName) || StringUtils.isBlank(lastName)) {
        return Response.status(Status.BAD_REQUEST).build();
    }
    Person person = personController.findPersonById(personId);
    if (person == null) {
        return Response.status(Status.BAD_REQUEST).build();
    }
    StudyProgramme studyProgramme = studyProgrammeController.findStudyProgrammeById(studyProgrammeId);
    if (studyProgramme == null) {
        return Response.status(Status.BAD_REQUEST).build();
    }
    if (!sessionController.hasEnvironmentPermission(OrganizationPermissions.ACCESS_ALL_ORGANIZATIONS)) {
        // Needs to be member of both organizations
        if (!(UserUtils.isMemberOf(sessionController.getUser(), studyProgramme.getOrganization()) && UserUtils.isMemberOf(sessionController.getUser(), student.getOrganization()))) {
            return Response.status(Status.FORBIDDEN).build();
        }
    }
    if (!userController.checkUserVariableKeysExist(entity.getVariables().keySet())) {
        return Response.status(Status.BAD_REQUEST).build();
    }
    StudentActivityType activityType = entity.getActivityTypeId() != null ? studentActivityTypeController.findStudentActivityTypeById(entity.getActivityTypeId()) : null;
    StudentExaminationType examinationType = entity.getExaminationTypeId() != null ? studentExaminationTypeController.findStudentExaminationTypeById(entity.getExaminationTypeId()) : null;
    StudentEducationalLevel educationalLevel = entity.getEducationalLevelId() != null ? studentEducationalLevelController.findStudentEducationalLevelById(entity.getEducationalLevelId()) : null;
    Nationality nationality = entity.getNationalityId() != null ? nationalityController.findNationalityById(entity.getNationalityId()) : null;
    Municipality municipality = entity.getMunicipalityId() != null ? municipalityController.findMunicipalityById(entity.getMunicipalityId()) : null;
    Language language = entity.getLanguageId() != null ? languageController.findLanguageById(entity.getLanguageId()) : null;
    School school = entity.getSchoolId() != null ? schoolController.findSchoolById(entity.getSchoolId()) : null;
    StudentStudyEndReason studyEndReason = entity.getStudyEndReasonId() != null ? studentStudyEndReasonController.findStudentStudyEndReasonById(entity.getStudyEndReasonId()) : null;
    Curriculum curriculum = entity.getCurriculumId() != null ? curriculumController.findCurriculumById(entity.getCurriculumId()) : null;
    // TODO lodging cannot be updated via boolean
    studentController.updateStudent(student, firstName, lastName, nickname, entity.getAdditionalInfo(), toDate(entity.getStudyTimeEnd()), activityType, examinationType, educationalLevel, entity.getEducation(), nationality, municipality, language, school, curriculum, entity.getPreviousStudies(), toDate(entity.getStudyStartDate()), toDate(entity.getStudyEndDate()), studyEndReason, entity.getStudyEndText());
    studentController.updateStudyProgramme(student, studyProgramme);
    studentController.updateStudentPerson(student, person);
    userController.updateUserVariables(student, entity.getVariables());
    studentController.updateStudentTags(student, entity.getTags());
    studentController.updateStudentAdditionalContactInfo(student, entity.getAdditionalContactInfo());
    return Response.ok(objectFactory.createModel(student)).build();
}
Also used : Status(javax.ws.rs.core.Response.Status) Municipality(fi.otavanopisto.pyramus.domainmodel.base.Municipality) StudyProgramme(fi.otavanopisto.pyramus.domainmodel.base.StudyProgramme) StudentExaminationType(fi.otavanopisto.pyramus.domainmodel.students.StudentExaminationType) StudentStudyEndReason(fi.otavanopisto.pyramus.domainmodel.students.StudentStudyEndReason) CourseStudent(fi.otavanopisto.pyramus.domainmodel.courses.CourseStudent) StudentGroupStudent(fi.otavanopisto.pyramus.domainmodel.students.StudentGroupStudent) Student(fi.otavanopisto.pyramus.domainmodel.students.Student) StudentEducationalLevel(fi.otavanopisto.pyramus.domainmodel.students.StudentEducationalLevel) Nationality(fi.otavanopisto.pyramus.domainmodel.base.Nationality) School(fi.otavanopisto.pyramus.domainmodel.base.School) Language(fi.otavanopisto.pyramus.domainmodel.base.Language) StudentActivityType(fi.otavanopisto.pyramus.domainmodel.students.StudentActivityType) Curriculum(fi.otavanopisto.pyramus.domainmodel.base.Curriculum) Person(fi.otavanopisto.pyramus.domainmodel.base.Person) Path(javax.ws.rs.Path) RESTPermit(fi.otavanopisto.pyramus.rest.annotation.RESTPermit) PUT(javax.ws.rs.PUT)

Example 5 with StudentActivityType

use of fi.otavanopisto.pyramus.domainmodel.students.StudentActivityType in project pyramus by otavanopisto.

the class StudentRESTService method createStudent.

@Path("/students")
@POST
@RESTPermit(StudentPermissions.CREATE_STUDENT)
public Response createStudent(fi.otavanopisto.pyramus.rest.model.Student entity) {
    Long personId = entity.getPersonId();
    Long studyProgrammeId = entity.getStudyProgrammeId();
    String firstName = StringUtils.trim(entity.getFirstName());
    String lastName = StringUtils.trim(entity.getLastName());
    String nickname = StringUtils.trim(entity.getNickname());
    Boolean lodging = entity.getLodging();
    if (personId == null || studyProgrammeId == null || lodging == null) {
        return Response.status(Status.BAD_REQUEST).build();
    }
    if (StringUtils.isBlank(firstName) || StringUtils.isBlank(lastName)) {
        return Response.status(Status.BAD_REQUEST).build();
    }
    Person person = personController.findPersonById(personId);
    if (person == null) {
        return Response.status(Status.BAD_REQUEST).build();
    }
    StudyProgramme studyProgramme = studyProgrammeController.findStudyProgrammeById(studyProgrammeId);
    if (studyProgramme == null) {
        return Response.status(Status.BAD_REQUEST).build();
    }
    if (!sessionController.hasEnvironmentPermission(OrganizationPermissions.ACCESS_ALL_ORGANIZATIONS)) {
        if (!(studyProgramme.getOrganization() != null && UserUtils.isMemberOf(sessionController.getUser(), studyProgramme.getOrganization()))) {
            return Response.status(Status.FORBIDDEN).build();
        }
    }
    if (!userController.checkUserVariableKeysExist(entity.getVariables().keySet())) {
        return Response.status(Status.BAD_REQUEST).build();
    }
    StudentActivityType activityType = entity.getActivityTypeId() != null ? studentActivityTypeController.findStudentActivityTypeById(entity.getActivityTypeId()) : null;
    StudentExaminationType examinationType = entity.getExaminationTypeId() != null ? studentExaminationTypeController.findStudentExaminationTypeById(entity.getExaminationTypeId()) : null;
    StudentEducationalLevel educationalLevel = entity.getEducationalLevelId() != null ? studentEducationalLevelController.findStudentEducationalLevelById(entity.getEducationalLevelId()) : null;
    Nationality nationality = entity.getNationalityId() != null ? nationalityController.findNationalityById(entity.getNationalityId()) : null;
    Municipality municipality = entity.getMunicipalityId() != null ? municipalityController.findMunicipalityById(entity.getMunicipalityId()) : null;
    Language language = entity.getLanguageId() != null ? languageController.findLanguageById(entity.getLanguageId()) : null;
    School school = entity.getSchoolId() != null ? schoolController.findSchoolById(entity.getSchoolId()) : null;
    StudentStudyEndReason studyEndReason = entity.getStudyEndReasonId() != null ? studentStudyEndReasonController.findStudentStudyEndReasonById(entity.getStudyEndReasonId()) : null;
    Curriculum curriculum = entity.getCurriculumId() != null ? curriculumController.findCurriculumById(entity.getCurriculumId()) : null;
    Student student = studentController.createStudent(person, firstName, lastName, nickname, entity.getAdditionalInfo(), toDate(entity.getStudyTimeEnd()), activityType, examinationType, educationalLevel, entity.getEducation(), nationality, municipality, language, school, studyProgramme, curriculum, entity.getPreviousStudies(), toDate(entity.getStudyStartDate()), toDate(entity.getStudyEndDate()), studyEndReason, entity.getStudyEndText());
    if (Boolean.TRUE.equals(lodging) && entity.getStudyStartDate() != null)
        studentController.addLodgingPeriod(student, toDate(entity.getStudyStartDate()), toDate(entity.getStudyEndDate()));
    userController.updateUserVariables(student, entity.getVariables());
    studentController.updateStudentTags(student, entity.getTags());
    studentController.updateStudentAdditionalContactInfo(student, entity.getAdditionalContactInfo());
    return Response.ok(objectFactory.createModel(student)).build();
}
Also used : Municipality(fi.otavanopisto.pyramus.domainmodel.base.Municipality) StudyProgramme(fi.otavanopisto.pyramus.domainmodel.base.StudyProgramme) StudentExaminationType(fi.otavanopisto.pyramus.domainmodel.students.StudentExaminationType) StudentStudyEndReason(fi.otavanopisto.pyramus.domainmodel.students.StudentStudyEndReason) StudentEducationalLevel(fi.otavanopisto.pyramus.domainmodel.students.StudentEducationalLevel) CourseStudent(fi.otavanopisto.pyramus.domainmodel.courses.CourseStudent) StudentGroupStudent(fi.otavanopisto.pyramus.domainmodel.students.StudentGroupStudent) Student(fi.otavanopisto.pyramus.domainmodel.students.Student) Nationality(fi.otavanopisto.pyramus.domainmodel.base.Nationality) School(fi.otavanopisto.pyramus.domainmodel.base.School) Language(fi.otavanopisto.pyramus.domainmodel.base.Language) StudentActivityType(fi.otavanopisto.pyramus.domainmodel.students.StudentActivityType) Curriculum(fi.otavanopisto.pyramus.domainmodel.base.Curriculum) Person(fi.otavanopisto.pyramus.domainmodel.base.Person) Path(javax.ws.rs.Path) RESTPermit(fi.otavanopisto.pyramus.rest.annotation.RESTPermit) POST(javax.ws.rs.POST)

Aggregations

StudentActivityType (fi.otavanopisto.pyramus.domainmodel.students.StudentActivityType)13 Language (fi.otavanopisto.pyramus.domainmodel.base.Language)10 Municipality (fi.otavanopisto.pyramus.domainmodel.base.Municipality)10 Nationality (fi.otavanopisto.pyramus.domainmodel.base.Nationality)10 School (fi.otavanopisto.pyramus.domainmodel.base.School)10 Student (fi.otavanopisto.pyramus.domainmodel.students.Student)10 StudentEducationalLevel (fi.otavanopisto.pyramus.domainmodel.students.StudentEducationalLevel)10 StudentExaminationType (fi.otavanopisto.pyramus.domainmodel.students.StudentExaminationType)10 StudentStudyEndReason (fi.otavanopisto.pyramus.domainmodel.students.StudentStudyEndReason)10 Person (fi.otavanopisto.pyramus.domainmodel.base.Person)9 StudyProgramme (fi.otavanopisto.pyramus.domainmodel.base.StudyProgramme)9 StudentDAO (fi.otavanopisto.pyramus.dao.students.StudentDAO)7 Curriculum (fi.otavanopisto.pyramus.domainmodel.base.Curriculum)7 PersonDAO (fi.otavanopisto.pyramus.dao.base.PersonDAO)6 ContactInfoDAO (fi.otavanopisto.pyramus.dao.base.ContactInfoDAO)5 EmailDAO (fi.otavanopisto.pyramus.dao.base.EmailDAO)5 PhoneNumberDAO (fi.otavanopisto.pyramus.dao.base.PhoneNumberDAO)5 StudyProgrammeDAO (fi.otavanopisto.pyramus.dao.base.StudyProgrammeDAO)5 StudentActivityTypeDAO (fi.otavanopisto.pyramus.dao.students.StudentActivityTypeDAO)5 ContactType (fi.otavanopisto.pyramus.domainmodel.base.ContactType)5