Search in sources :

Example 6 with StudyProgramme

use of fi.otavanopisto.pyramus.domainmodel.base.StudyProgramme in project pyramus by otavanopisto.

the class SearchStudentsViewController method process.

/**
 * Processes the page request.
 *
 * @param pageRequestContext Request context
 */
public void process(PageRequestContext pageRequestContext) {
    StudyProgrammeDAO studyProgrammeDAO = DAOFactory.getInstance().getStudyProgrammeDAO();
    MunicipalityDAO municipalityDAO = DAOFactory.getInstance().getMunicipalityDAO();
    NationalityDAO nationalityDAO = DAOFactory.getInstance().getNationalityDAO();
    LanguageDAO languageDAO = DAOFactory.getInstance().getLanguageDAO();
    StaffMemberDAO staffMemberDAO = DAOFactory.getInstance().getStaffMemberDAO();
    User loggedUser = staffMemberDAO.findById(pageRequestContext.getLoggedUserId());
    List<StudyProgramme> studyProgrammes = UserUtils.canAccessAllOrganizations(loggedUser) ? studyProgrammeDAO.listUnarchived() : studyProgrammeDAO.listByOrganization(loggedUser.getOrganization(), Archived.UNARCHIVED);
    Collections.sort(studyProgrammes, new StringAttributeComparator("getName"));
    List<Nationality> nationalities = nationalityDAO.listUnarchived();
    Collections.sort(nationalities, new StringAttributeComparator("getName"));
    List<Municipality> municipalities = municipalityDAO.listUnarchived();
    Collections.sort(municipalities, new StringAttributeComparator("getName"));
    List<Language> languages = languageDAO.listUnarchived();
    Collections.sort(languages, new StringAttributeComparator("getName"));
    pageRequestContext.getRequest().setAttribute("nationalities", nationalities);
    pageRequestContext.getRequest().setAttribute("municipalities", municipalities);
    pageRequestContext.getRequest().setAttribute("languages", languages);
    pageRequestContext.getRequest().setAttribute("studyProgrammes", studyProgrammes);
    pageRequestContext.setIncludeJSP("/templates/students/searchstudents.jsp");
}
Also used : User(fi.otavanopisto.pyramus.domainmodel.users.User) Municipality(fi.otavanopisto.pyramus.domainmodel.base.Municipality) StudyProgramme(fi.otavanopisto.pyramus.domainmodel.base.StudyProgramme) StringAttributeComparator(fi.otavanopisto.pyramus.util.StringAttributeComparator) NationalityDAO(fi.otavanopisto.pyramus.dao.base.NationalityDAO) LanguageDAO(fi.otavanopisto.pyramus.dao.base.LanguageDAO) StudyProgrammeDAO(fi.otavanopisto.pyramus.dao.base.StudyProgrammeDAO) Nationality(fi.otavanopisto.pyramus.domainmodel.base.Nationality) StaffMemberDAO(fi.otavanopisto.pyramus.dao.users.StaffMemberDAO) Language(fi.otavanopisto.pyramus.domainmodel.base.Language) MunicipalityDAO(fi.otavanopisto.pyramus.dao.base.MunicipalityDAO)

Example 7 with StudyProgramme

use of fi.otavanopisto.pyramus.domainmodel.base.StudyProgramme in project pyramus by otavanopisto.

the class CreateStudentViewController method process.

public void process(PageRequestContext pageRequestContext) {
    StudentActivityTypeDAO studentActivityTypeDAO = DAOFactory.getInstance().getStudentActivityTypeDAO();
    StudentEducationalLevelDAO studentEducationalLevelDAO = DAOFactory.getInstance().getStudentEducationalLevelDAO();
    StudentExaminationTypeDAO studentExaminationTypeDAO = DAOFactory.getInstance().getStudentExaminationTypeDAO();
    StudentStudyEndReasonDAO studyEndReasonDAO = DAOFactory.getInstance().getStudentStudyEndReasonDAO();
    UserVariableKeyDAO variableKeyDAO = DAOFactory.getInstance().getUserVariableKeyDAO();
    StudyProgrammeDAO studyProgrammeDAO = DAOFactory.getInstance().getStudyProgrammeDAO();
    MunicipalityDAO municipalityDAO = DAOFactory.getInstance().getMunicipalityDAO();
    NationalityDAO nationalityDAO = DAOFactory.getInstance().getNationalityDAO();
    SchoolDAO schoolDAO = DAOFactory.getInstance().getSchoolDAO();
    LanguageDAO languageDAO = DAOFactory.getInstance().getLanguageDAO();
    ContactTypeDAO contactTypeDAO = DAOFactory.getInstance().getContactTypeDAO();
    ContactURLTypeDAO contactURLTypeDAO = DAOFactory.getInstance().getContactURLTypeDAO();
    PersonDAO personDAO = DAOFactory.getInstance().getPersonDAO();
    StaffMemberDAO staffMemberDAO = DAOFactory.getInstance().getStaffMemberDAO();
    CurriculumDAO curriculumDAO = DAOFactory.getInstance().getCurriculumDAO();
    User loggedUser = staffMemberDAO.findById(pageRequestContext.getLoggedUserId());
    Long personId = pageRequestContext.getLong("personId");
    if (personId != null) {
        Person person = personDAO.findById(personId);
        StaffMember staffMember = staffMemberDAO.findByPerson(person);
        pageRequestContext.getRequest().setAttribute("person", person);
        pageRequestContext.getRequest().setAttribute("staffMember", staffMember);
        String emails = new JSONArrayExtractor("defaultAddress", "contactType", "address").extractString(staffMember.getContactInfo().getEmails());
        String addresses = new JSONArrayExtractor("defaultAddress", "name", "contactType", "streetAddress", "postalCode", "city", "country").extractString(staffMember.getContactInfo().getAddresses());
        String phones = new JSONArrayExtractor("defaultNumber", "contactType", "number").extractString(staffMember.getContactInfo().getPhoneNumbers());
        setJsDataVariable(pageRequestContext, "createstudent_emails", emails);
        setJsDataVariable(pageRequestContext, "createstudent_addresses", addresses);
        setJsDataVariable(pageRequestContext, "createstudent_phones", phones);
    }
    List<StudyProgramme> studyProgrammes = UserUtils.canAccessAllOrganizations(loggedUser) ? studyProgrammeDAO.listUnarchived() : studyProgrammeDAO.listByOrganization(loggedUser.getOrganization(), Archived.UNARCHIVED);
    Collections.sort(studyProgrammes, new StringAttributeComparator("getName"));
    List<Nationality> nationalities = nationalityDAO.listUnarchived();
    Collections.sort(nationalities, new StringAttributeComparator("getName"));
    List<Municipality> municipalities = municipalityDAO.listUnarchived();
    Collections.sort(municipalities, new StringAttributeComparator("getName"));
    List<Language> languages = languageDAO.listUnarchived();
    Collections.sort(languages, new StringAttributeComparator("getName"));
    List<School> schools = schoolDAO.listUnarchived();
    Collections.sort(schools, new StringAttributeComparator("getName"));
    List<ContactURLType> contactURLTypes = contactURLTypeDAO.listUnarchived();
    Collections.sort(contactURLTypes, new StringAttributeComparator("getName"));
    List<ContactType> contactTypes = contactTypeDAO.listUnarchived();
    Collections.sort(contactTypes, new StringAttributeComparator("getName"));
    List<UserVariableKey> userVariableKeys = variableKeyDAO.listByUserEditable(Boolean.TRUE);
    Collections.sort(userVariableKeys, new StringAttributeComparator("getVariableName"));
    List<Curriculum> curriculums = curriculumDAO.listUnarchived();
    Collections.sort(curriculums, new StringAttributeComparator("getName"));
    String jsonContactTypes = new JSONArrayExtractor("name", "id").extractString(contactTypes);
    String jsonVariableKeys = new JSONArrayExtractor("variableKey", "variableName", "variableType").extractString(userVariableKeys);
    setJsDataVariable(pageRequestContext, "contactTypes", jsonContactTypes);
    setJsDataVariable(pageRequestContext, "variableKeys", jsonVariableKeys);
    pageRequestContext.getRequest().setAttribute("schools", schools);
    pageRequestContext.getRequest().setAttribute("activityTypes", studentActivityTypeDAO.listUnarchived());
    pageRequestContext.getRequest().setAttribute("contactURLTypes", contactURLTypes);
    pageRequestContext.getRequest().setAttribute("examinationTypes", studentExaminationTypeDAO.listUnarchived());
    pageRequestContext.getRequest().setAttribute("educationalLevels", studentEducationalLevelDAO.listUnarchived());
    pageRequestContext.getRequest().setAttribute("nationalities", nationalities);
    pageRequestContext.getRequest().setAttribute("municipalities", municipalities);
    pageRequestContext.getRequest().setAttribute("languages", languages);
    pageRequestContext.getRequest().setAttribute("studyProgrammes", studyProgrammes);
    pageRequestContext.getRequest().setAttribute("curriculums", curriculums);
    pageRequestContext.getRequest().setAttribute("studyEndReasons", studyEndReasonDAO.listByParentReason(null));
    pageRequestContext.getRequest().setAttribute("variableKeys", userVariableKeys);
    pageRequestContext.setIncludeJSP("/templates/students/createstudent.jsp");
}
Also used : User(fi.otavanopisto.pyramus.domainmodel.users.User) ContactType(fi.otavanopisto.pyramus.domainmodel.base.ContactType) StudyProgramme(fi.otavanopisto.pyramus.domainmodel.base.StudyProgramme) UserVariableKey(fi.otavanopisto.pyramus.domainmodel.users.UserVariableKey) StringAttributeComparator(fi.otavanopisto.pyramus.util.StringAttributeComparator) StudentStudyEndReasonDAO(fi.otavanopisto.pyramus.dao.students.StudentStudyEndReasonDAO) StaffMember(fi.otavanopisto.pyramus.domainmodel.users.StaffMember) JSONArrayExtractor(fi.otavanopisto.pyramus.util.JSONArrayExtractor) PersonDAO(fi.otavanopisto.pyramus.dao.base.PersonDAO) ContactURLTypeDAO(fi.otavanopisto.pyramus.dao.base.ContactURLTypeDAO) School(fi.otavanopisto.pyramus.domainmodel.base.School) StaffMemberDAO(fi.otavanopisto.pyramus.dao.users.StaffMemberDAO) 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) CurriculumDAO(fi.otavanopisto.pyramus.dao.base.CurriculumDAO) Municipality(fi.otavanopisto.pyramus.domainmodel.base.Municipality) NationalityDAO(fi.otavanopisto.pyramus.dao.base.NationalityDAO) LanguageDAO(fi.otavanopisto.pyramus.dao.base.LanguageDAO) StudentActivityTypeDAO(fi.otavanopisto.pyramus.dao.students.StudentActivityTypeDAO) StudyProgrammeDAO(fi.otavanopisto.pyramus.dao.base.StudyProgrammeDAO) Nationality(fi.otavanopisto.pyramus.domainmodel.base.Nationality) ContactURLType(fi.otavanopisto.pyramus.domainmodel.base.ContactURLType) UserVariableKeyDAO(fi.otavanopisto.pyramus.dao.users.UserVariableKeyDAO) Curriculum(fi.otavanopisto.pyramus.domainmodel.base.Curriculum) Person(fi.otavanopisto.pyramus.domainmodel.base.Person)

Example 8 with StudyProgramme

use of fi.otavanopisto.pyramus.domainmodel.base.StudyProgramme 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 9 with StudyProgramme

use of fi.otavanopisto.pyramus.domainmodel.base.StudyProgramme 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)

Example 10 with StudyProgramme

use of fi.otavanopisto.pyramus.domainmodel.base.StudyProgramme in project pyramus by otavanopisto.

the class CourseSignupRESTService method createSignupStudyProgramme.

/**
 * Creates a signup study programme.
 *
 * Organization information within entity is not used.
 */
@Path("/courses/{COURSEID:[0-9]*}/signupStudyProgrammes")
@POST
@RESTPermit(CourseSignupGroupPermissions.CREATE_SIGNUP_STUDYPROGRAMME)
public Response createSignupStudyProgramme(@PathParam("COURSEID") Long pathCourseId, fi.otavanopisto.pyramus.rest.model.course.CourseSignupStudyProgramme entity) {
    if (entity == null) {
        return Response.status(Status.BAD_REQUEST).build();
    }
    Long courseId = entity.getCourseId();
    Long studyProgrammeId = entity.getStudyProgrammeId();
    if (courseId == null || studyProgrammeId == null || !courseId.equals(pathCourseId)) {
        return Response.status(Status.BAD_REQUEST).build();
    }
    Course course = courseController.findCourseById(courseId);
    StudyProgramme studyProgramme = studyProgrammeController.findStudyProgrammeById(studyProgrammeId);
    if (course == null || studyProgramme == null) {
        return Response.status(Status.NOT_FOUND).build();
    }
    User loggedUser = sessionController.getUser();
    if (UserUtils.canAccessOrganization(loggedUser, course.getOrganization()) && UserUtils.canAccessOrganization(loggedUser, studyProgramme.getOrganization())) {
        return Response.ok(objectFactory.createModel(courseSignupStudyProgrammeDAO.create(course, studyProgramme))).build();
    } else {
        return Response.status(Status.FORBIDDEN).build();
    }
}
Also used : User(fi.otavanopisto.pyramus.domainmodel.users.User) CourseSignupStudyProgramme(fi.otavanopisto.pyramus.domainmodel.courses.CourseSignupStudyProgramme) StudyProgramme(fi.otavanopisto.pyramus.domainmodel.base.StudyProgramme) Course(fi.otavanopisto.pyramus.domainmodel.courses.Course) Path(javax.ws.rs.Path) RESTPermit(fi.otavanopisto.pyramus.rest.annotation.RESTPermit) POST(javax.ws.rs.POST)

Aggregations

StudyProgramme (fi.otavanopisto.pyramus.domainmodel.base.StudyProgramme)43 StudyProgrammeDAO (fi.otavanopisto.pyramus.dao.base.StudyProgrammeDAO)26 Student (fi.otavanopisto.pyramus.domainmodel.students.Student)21 StudentDAO (fi.otavanopisto.pyramus.dao.students.StudentDAO)15 StaffMemberDAO (fi.otavanopisto.pyramus.dao.users.StaffMemberDAO)14 Person (fi.otavanopisto.pyramus.domainmodel.base.Person)14 Language (fi.otavanopisto.pyramus.domainmodel.base.Language)13 Municipality (fi.otavanopisto.pyramus.domainmodel.base.Municipality)13 Nationality (fi.otavanopisto.pyramus.domainmodel.base.Nationality)13 School (fi.otavanopisto.pyramus.domainmodel.base.School)12 StaffMember (fi.otavanopisto.pyramus.domainmodel.users.StaffMember)12 PersonDAO (fi.otavanopisto.pyramus.dao.base.PersonDAO)10 Curriculum (fi.otavanopisto.pyramus.domainmodel.base.Curriculum)9 StudentActivityType (fi.otavanopisto.pyramus.domainmodel.students.StudentActivityType)9 StudentEducationalLevel (fi.otavanopisto.pyramus.domainmodel.students.StudentEducationalLevel)9 StudentExaminationType (fi.otavanopisto.pyramus.domainmodel.students.StudentExaminationType)9 StudentStudyEndReason (fi.otavanopisto.pyramus.domainmodel.students.StudentStudyEndReason)9 RESTPermit (fi.otavanopisto.pyramus.rest.annotation.RESTPermit)8 Path (javax.ws.rs.Path)8 ContactType (fi.otavanopisto.pyramus.domainmodel.base.ContactType)7