Search in sources :

Example 1 with JSONRequestContext

use of fi.internetix.smvc.controllers.JSONRequestContext in project pyramus by otavanopisto.

the class EditCourseJSONRequestController method processSignupStudentGroups.

private void processSignupStudentGroups(JSONRequestContext requestContext, Course course, StaffMember loggedUser) {
    CourseSignupStudentGroupDAO courseSignupStudentGroupDAO = DAOFactory.getInstance().getCourseSignupStudentGroupDAO();
    StudentGroupDAO studentGroupDAO = DAOFactory.getInstance().getStudentGroupDAO();
    List<CourseSignupStudentGroup> signupStudentGroups = courseSignupStudentGroupDAO.listByCourse(course);
    Integer studentGroupsRowCount = requestContext.getInteger("signupStudentGroupsTable.rowCount");
    if (studentGroupsRowCount != null) {
        Set<Long> studentGroupIdsPresent = new HashSet<>();
        for (int i = 0; i < studentGroupsRowCount; i++) {
            Long studentGroupId = requestContext.getLong(String.format("signupStudentGroupsTable.%d.studentGroupId", i));
            if (studentGroupId != null) {
                studentGroupIdsPresent.add(studentGroupId);
            }
        }
        // Create missing groups
        studentGroupIdsPresent.forEach(studentGroupId -> {
            if (signupStudentGroups.stream().noneMatch(signupStudentGroup -> Objects.equals(signupStudentGroup.getStudentGroup().getId(), studentGroupId))) {
                StudentGroup studentGroup = studentGroupDAO.findById(studentGroupId);
                if ((studentGroup != null) && UserUtils.canAccessOrganization(loggedUser, studentGroup.getOrganization())) {
                    courseSignupStudentGroupDAO.create(course, studentGroup);
                } else {
                    throw new SmvcRuntimeException(PyramusStatusCode.UNAUTHORIZED, "Invalid organization.");
                }
            }
        });
        // Remove groups that don't exist anymore
        signupStudentGroups.stream().filter(signupStudentGroup -> !studentGroupIdsPresent.contains(signupStudentGroup.getStudentGroup().getId())).forEach(signupStudentGroup -> {
            if (UserUtils.canAccessOrganization(loggedUser, signupStudentGroup.getStudentGroup().getOrganization())) {
                courseSignupStudentGroupDAO.delete(signupStudentGroup);
            } else {
                throw new SmvcRuntimeException(PyramusStatusCode.UNAUTHORIZED, "Invalid organization.");
            }
        });
    }
}
Also used : CourseStaffMember(fi.otavanopisto.pyramus.domainmodel.courses.CourseStaffMember) Arrays(java.util.Arrays) StringUtils(org.apache.commons.lang.StringUtils) StaffMember(fi.otavanopisto.pyramus.domainmodel.users.StaffMember) Organization(fi.otavanopisto.pyramus.domainmodel.base.Organization) CourseSignupStudyProgramme(fi.otavanopisto.pyramus.domainmodel.courses.CourseSignupStudyProgramme) CourseDAO(fi.otavanopisto.pyramus.dao.courses.CourseDAO) Enumeration(java.util.Enumeration) UserUtils(fi.otavanopisto.pyramus.framework.UserUtils) Date(java.util.Date) BasicCourseResource(fi.otavanopisto.pyramus.domainmodel.courses.BasicCourseResource) OtherCost(fi.otavanopisto.pyramus.domainmodel.courses.OtherCost) JSONRequestContext(fi.internetix.smvc.controllers.JSONRequestContext) GradeCourseResource(fi.otavanopisto.pyramus.domainmodel.courses.GradeCourseResource) SmvcRuntimeException(fi.internetix.smvc.SmvcRuntimeException) OtherCostDAO(fi.otavanopisto.pyramus.dao.courses.OtherCostDAO) BigDecimal(java.math.BigDecimal) Vector(java.util.Vector) CourseComponentResourceDAO(fi.otavanopisto.pyramus.dao.courses.CourseComponentResourceDAO) CourseParticipationTypeDAO(fi.otavanopisto.pyramus.dao.courses.CourseParticipationTypeDAO) Locale(java.util.Locale) Map(java.util.Map) Tag(fi.otavanopisto.pyramus.domainmodel.base.Tag) CourseEducationTypeDAO(fi.otavanopisto.pyramus.dao.base.CourseEducationTypeDAO) CourseEducationSubtype(fi.otavanopisto.pyramus.domainmodel.base.CourseEducationSubtype) CourseOptionality(fi.otavanopisto.pyramus.domainmodel.base.CourseOptionality) UserRole(fi.otavanopisto.pyramus.framework.UserRole) CourseDescriptionCategory(fi.otavanopisto.pyramus.domainmodel.courses.CourseDescriptionCategory) CourseSignupStudentGroup(fi.otavanopisto.pyramus.domainmodel.courses.CourseSignupStudentGroup) CourseStaffMemberRoleDAO(fi.otavanopisto.pyramus.dao.courses.CourseStaffMemberRoleDAO) CourseStudentDAO(fi.otavanopisto.pyramus.dao.courses.CourseStudentDAO) StudentGroupDAO(fi.otavanopisto.pyramus.dao.students.StudentGroupDAO) StaleObjectStateException(org.hibernate.StaleObjectStateException) CourseSignupStudentGroupDAO(fi.otavanopisto.pyramus.dao.courses.CourseSignupStudentGroupDAO) DuplicateCourseStudentException(fi.otavanopisto.pyramus.exception.DuplicateCourseStudentException) Set(java.util.Set) GradeCourseResourceDAO(fi.otavanopisto.pyramus.dao.courses.GradeCourseResourceDAO) PyramusStatusCode(fi.otavanopisto.pyramus.framework.PyramusStatusCode) Messages(fi.otavanopisto.pyramus.I18N.Messages) CourseEducationType(fi.otavanopisto.pyramus.domainmodel.base.CourseEducationType) Objects(java.util.Objects) List(java.util.List) CourseParticipationType(fi.otavanopisto.pyramus.domainmodel.courses.CourseParticipationType) CourseEnrolmentTypeDAO(fi.otavanopisto.pyramus.dao.courses.CourseEnrolmentTypeDAO) Module(fi.otavanopisto.pyramus.domainmodel.modules.Module) StudentCourseResourceDAO(fi.otavanopisto.pyramus.dao.courses.StudentCourseResourceDAO) EducationType(fi.otavanopisto.pyramus.domainmodel.base.EducationType) CourseDescriptionDAO(fi.otavanopisto.pyramus.dao.courses.CourseDescriptionDAO) CourseStudent(fi.otavanopisto.pyramus.domainmodel.courses.CourseStudent) StudentDAO(fi.otavanopisto.pyramus.dao.students.StudentDAO) CurriculumDAO(fi.otavanopisto.pyramus.dao.base.CurriculumDAO) StaffMemberDAO(fi.otavanopisto.pyramus.dao.users.StaffMemberDAO) Resource(fi.otavanopisto.pyramus.domainmodel.resources.Resource) CourseStaffMemberRole(fi.otavanopisto.pyramus.domainmodel.courses.CourseStaffMemberRole) CourseState(fi.otavanopisto.pyramus.domainmodel.courses.CourseState) CourseStateDAO(fi.otavanopisto.pyramus.dao.courses.CourseStateDAO) CourseDescription(fi.otavanopisto.pyramus.domainmodel.courses.CourseDescription) ResourceType(fi.otavanopisto.pyramus.domainmodel.resources.ResourceType) HashMap(java.util.HashMap) Currency(java.util.Currency) DefaultsDAO(fi.otavanopisto.pyramus.dao.base.DefaultsDAO) Course(fi.otavanopisto.pyramus.domainmodel.courses.Course) CourseSignupStudyProgrammeDAO(fi.otavanopisto.pyramus.dao.courses.CourseSignupStudyProgrammeDAO) CourseTypeDAO(fi.otavanopisto.pyramus.dao.courses.CourseTypeDAO) StudentCourseResource(fi.otavanopisto.pyramus.domainmodel.courses.StudentCourseResource) MonetaryAmount(fi.otavanopisto.pyramus.persistence.usertypes.MonetaryAmount) EducationSubtype(fi.otavanopisto.pyramus.domainmodel.base.EducationSubtype) HashSet(java.util.HashSet) EducationalTimeUnitDAO(fi.otavanopisto.pyramus.dao.base.EducationalTimeUnitDAO) Curriculum(fi.otavanopisto.pyramus.domainmodel.base.Curriculum) Student(fi.otavanopisto.pyramus.domainmodel.students.Student) BasicCourseResourceDAO(fi.otavanopisto.pyramus.dao.courses.BasicCourseResourceDAO) CourseComponent(fi.otavanopisto.pyramus.domainmodel.courses.CourseComponent) EducationalTimeUnit(fi.otavanopisto.pyramus.domainmodel.base.EducationalTimeUnit) CourseStaffMemberDAO(fi.otavanopisto.pyramus.dao.courses.CourseStaffMemberDAO) JSONRequestController(fi.otavanopisto.pyramus.framework.JSONRequestController) SubjectDAO(fi.otavanopisto.pyramus.dao.base.SubjectDAO) Room(fi.otavanopisto.pyramus.domainmodel.accommodation.Room) Role(fi.otavanopisto.pyramus.domainmodel.users.Role) TagDAO(fi.otavanopisto.pyramus.dao.base.TagDAO) StudyProgrammeDAO(fi.otavanopisto.pyramus.dao.base.StudyProgrammeDAO) ResourceDAO(fi.otavanopisto.pyramus.dao.resources.ResourceDAO) OrganizationDAO(fi.otavanopisto.pyramus.dao.base.OrganizationDAO) CourseComponentResource(fi.otavanopisto.pyramus.domainmodel.courses.CourseComponentResource) CourseType(fi.otavanopisto.pyramus.domainmodel.courses.CourseType) EducationSubtypeDAO(fi.otavanopisto.pyramus.dao.base.EducationSubtypeDAO) EducationTypeDAO(fi.otavanopisto.pyramus.dao.base.EducationTypeDAO) ModuleDAO(fi.otavanopisto.pyramus.dao.modules.ModuleDAO) CourseEnrolmentType(fi.otavanopisto.pyramus.domainmodel.courses.CourseEnrolmentType) StudentGroup(fi.otavanopisto.pyramus.domainmodel.students.StudentGroup) StudyProgramme(fi.otavanopisto.pyramus.domainmodel.base.StudyProgramme) CourseComponentDAO(fi.otavanopisto.pyramus.dao.courses.CourseComponentDAO) Subject(fi.otavanopisto.pyramus.domainmodel.base.Subject) CourseDescriptionCategoryDAO(fi.otavanopisto.pyramus.dao.courses.CourseDescriptionCategoryDAO) CourseEducationSubtypeDAO(fi.otavanopisto.pyramus.dao.base.CourseEducationSubtypeDAO) DAOFactory(fi.otavanopisto.pyramus.dao.DAOFactory) StudentGroupDAO(fi.otavanopisto.pyramus.dao.students.StudentGroupDAO) CourseSignupStudentGroupDAO(fi.otavanopisto.pyramus.dao.courses.CourseSignupStudentGroupDAO) SmvcRuntimeException(fi.internetix.smvc.SmvcRuntimeException) CourseSignupStudentGroupDAO(fi.otavanopisto.pyramus.dao.courses.CourseSignupStudentGroupDAO) CourseSignupStudentGroup(fi.otavanopisto.pyramus.domainmodel.courses.CourseSignupStudentGroup) CourseSignupStudentGroup(fi.otavanopisto.pyramus.domainmodel.courses.CourseSignupStudentGroup) StudentGroup(fi.otavanopisto.pyramus.domainmodel.students.StudentGroup) HashSet(java.util.HashSet)

Example 2 with JSONRequestContext

use of fi.internetix.smvc.controllers.JSONRequestContext in project pyramus by otavanopisto.

the class Servlet method doService.

private void doService(HttpServletRequest request, HttpServletResponse response) throws ServletException {
    try {
        userTransaction.begin();
    } catch (Exception e) {
        Logging.logException(e);
        throw new ServletException(e);
    }
    RequestContext requestContext = null;
    RequestController requestController;
    RequestDispatchContext dispatchContext;
    if (requestDispatcher != null && requestDispatcher.canHandle(request, response)) {
        dispatchContext = requestDispatcher.getContext(request, response);
        requestController = dispatchContext.getRequestController();
    } else {
        String uri = request.getRequestURI();
        String ctxPath = request.getContextPath();
        String controllerName = uri.substring(ctxPath.length() + 1);
        if (StringUtils.isNotBlank(applicationPath)) {
            controllerName = controllerName.substring(applicationPath.length());
        }
        requestController = RequestControllerMapper.getRequestController(controllerName);
        dispatchContext = new RequestDispatchContext(requestController, new DefaultParameterHandlerImpl(request, decodeGETUtf));
    }
    int statusCode = StatusCode.OK;
    try {
        if (requestController == null) {
            requestContext = new PageRequestContext(dispatchContext, request, response, getServletContext(), errorJspPage);
            throw new PageNotFoundException(request.getLocale());
        } else if (requestController instanceof PageController) {
            requestContext = new PageRequestContext(dispatchContext, request, response, getServletContext(), errorJspPage);
        } else if (requestController instanceof JSONRequestController) {
            requestContext = new JSONRequestContext(dispatchContext, request, response, getServletContext());
        } else if (requestController instanceof BinaryRequestController) {
            requestContext = new BinaryRequestContext(dispatchContext, request, response, getServletContext());
        }
        // Let the controller authorize the request. Most common exceptions thrown include
        // LoginRequiredException and AccessDeniedException
        requestController.authorize(requestContext);
        if (requestController instanceof PageController) {
            ((PageController) requestController).process((PageRequestContext) requestContext);
        } else if (requestController instanceof JSONRequestController) {
            ((JSONRequestController) requestController).process((JSONRequestContext) requestContext);
        } else if (requestController instanceof BinaryRequestController) {
            ((BinaryRequestController) requestController).process((BinaryRequestContext) requestContext);
        }
    } catch (LoginRequiredException lre) {
        if (platformErrorListener != null)
            platformErrorListener.onLoginRequiredException(request, response, lre);
        Logging.logInfo("Login required for " + getCurrentUrl(request, true));
        if (requestController instanceof PageController) {
            HttpSession session = requestContext.getRequest().getSession(true);
            session.setAttribute("loginRedirectUrl", lre.getRedirectUrl());
            if (lre.getContextType() != null && lre.getContextId() != null) {
                session.setAttribute("loginContextType", lre.getContextType());
                session.setAttribute("loginContextId", lre.getContextId());
            }
            requestContext.setRedirectURL(loginUrl);
        } else {
            // TODO LoginRequiredException for requests other than pages?
            statusCode = lre.getStatusCode();
            requestContext.addMessage(Severity.WARNING, lre.getMessage());
        }
    } catch (PageNotFoundException pnfe) {
        if (platformErrorListener != null)
            platformErrorListener.onPageNotFoundException(request, response, pnfe);
        Logging.logInfo("404 - " + getCurrentUrl(request, true));
        statusCode = pnfe.getStatusCode();
        if (requestContext != null) {
            requestContext.getResponse().setStatus(HttpServletResponse.SC_NOT_FOUND);
            requestContext.addMessage(Severity.WARNING, pnfe.getMessage());
        } else {
            response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
        }
    } catch (AccessDeniedException ade) {
        if (platformErrorListener != null)
            platformErrorListener.onAccessDeniedException(request, response, ade);
        Logging.logInfo("403 - " + getCurrentUrl(request, true) + " - " + requestContext.getLoggedUserId());
        statusCode = ade.getStatusCode();
        requestContext.getResponse().setStatus(HttpServletResponse.SC_FORBIDDEN);
        requestContext.addMessage(Severity.WARNING, ade.getMessage());
    } catch (InvalidLoginException ile) {
        Logging.logInfo("Invalid login credentials");
        statusCode = ile.getStatusCode();
        requestContext.addMessage(Severity.ERROR, ile.getMessage());
    } catch (AlreadyLoggedInException ile) {
        Logging.logInfo("Already logged in");
        statusCode = ile.getStatusCode();
        requestContext.addMessage(Severity.ERROR, ile.getMessage());
    } catch (SmvcRuntimeException pre) {
        if (platformErrorListener != null)
            platformErrorListener.onSmvcRuntimeException(request, response, pre);
        Logging.logException(pre);
        statusCode = pre.getStatusCode();
        requestContext.addMessage(Severity.ERROR, pre.getMessage());
    } catch (Exception e) {
        if (platformErrorListener != null)
            platformErrorListener.onUncontrolledException(request, response, e);
        // All other exceptions are considered to be fatal and unexpected, so the request
        // transaction is rolled back, the stack trace of the exception is printed out, and
        // an error view is shown
        Logging.logException(e);
        statusCode = StatusCode.UNDEFINED;
        requestContext.addMessage(Severity.CRITICAL, e.getMessage());
    } finally {
        try {
            // Pre-commit response
            requestContext.writePreCommitResponse(statusCode);
            if (statusCode == StatusCode.OK) {
                userTransaction.commit();
            } else {
                userTransaction.rollback();
            }
            // Post-commit response
            requestContext.writePostCommitResponse(statusCode);
        } catch (Exception e) {
            if (platformErrorListener != null)
                platformErrorListener.onTransactionCommitException(request, response, e);
            Logging.logException(e);
            throw new ServletException(e);
        }
    }
}
Also used : LoginRequiredException(fi.internetix.smvc.LoginRequiredException) AccessDeniedException(fi.internetix.smvc.AccessDeniedException) HttpSession(javax.servlet.http.HttpSession) SmvcRuntimeException(fi.internetix.smvc.SmvcRuntimeException) AlreadyLoggedInException(fi.internetix.smvc.AlreadyLoggedInException) BinaryRequestContext(fi.internetix.smvc.controllers.BinaryRequestContext) LoginRequiredException(fi.internetix.smvc.LoginRequiredException) ServletException(javax.servlet.ServletException) AlreadyLoggedInException(fi.internetix.smvc.AlreadyLoggedInException) SmvcRuntimeException(fi.internetix.smvc.SmvcRuntimeException) PageNotFoundException(fi.internetix.smvc.PageNotFoundException) InvalidLoginException(fi.internetix.smvc.InvalidLoginException) AccessDeniedException(fi.internetix.smvc.AccessDeniedException) ServletException(javax.servlet.ServletException) JSONRequestController(fi.internetix.smvc.controllers.JSONRequestController) PageNotFoundException(fi.internetix.smvc.PageNotFoundException) PageController(fi.internetix.smvc.controllers.PageController) BinaryRequestController(fi.internetix.smvc.controllers.BinaryRequestController) BinaryRequestController(fi.internetix.smvc.controllers.BinaryRequestController) RequestController(fi.internetix.smvc.controllers.RequestController) JSONRequestController(fi.internetix.smvc.controllers.JSONRequestController) InvalidLoginException(fi.internetix.smvc.InvalidLoginException) BinaryRequestContext(fi.internetix.smvc.controllers.BinaryRequestContext) JSONRequestContext(fi.internetix.smvc.controllers.JSONRequestContext) RequestContext(fi.internetix.smvc.controllers.RequestContext) PageRequestContext(fi.internetix.smvc.controllers.PageRequestContext) PageRequestContext(fi.internetix.smvc.controllers.PageRequestContext) JSONRequestContext(fi.internetix.smvc.controllers.JSONRequestContext)

Example 3 with JSONRequestContext

use of fi.internetix.smvc.controllers.JSONRequestContext in project pyramus by otavanopisto.

the class EditCourseJSONRequestController method processSignupStudyProgrammes.

private void processSignupStudyProgrammes(JSONRequestContext requestContext, Course course, StaffMember loggedUser) {
    CourseSignupStudyProgrammeDAO courseSignupStudyProgrammeDAO = DAOFactory.getInstance().getCourseSignupStudyProgrammeDAO();
    StudyProgrammeDAO studyProgrammeDAO = DAOFactory.getInstance().getStudyProgrammeDAO();
    List<CourseSignupStudyProgramme> signupStudyProgrammes = courseSignupStudyProgrammeDAO.listByCourse(course);
    Integer studyProgrammesRowCount = requestContext.getInteger("signupStudyProgrammesTable.rowCount");
    if (studyProgrammesRowCount != null) {
        Set<Long> studyProgrammeIdsPresent = new HashSet<>();
        for (int i = 0; i < studyProgrammesRowCount; i++) {
            Long studyProgrammeId = requestContext.getLong(String.format("signupStudyProgrammesTable.%d.studyProgrammeId", i));
            if (studyProgrammeId != null) {
                studyProgrammeIdsPresent.add(studyProgrammeId);
            }
        }
        // Create missing groups
        studyProgrammeIdsPresent.forEach(studentGroupId -> {
            if (signupStudyProgrammes.stream().noneMatch(signupStudentGroup -> Objects.equals(signupStudentGroup.getStudyProgramme().getId(), studentGroupId))) {
                StudyProgramme studyProgramme = studyProgrammeDAO.findById(studentGroupId);
                if ((studyProgramme != null) && UserUtils.canAccessOrganization(loggedUser, studyProgramme.getOrganization())) {
                    courseSignupStudyProgrammeDAO.create(course, studyProgramme);
                } else {
                    throw new SmvcRuntimeException(PyramusStatusCode.UNAUTHORIZED, "Invalid organization.");
                }
            }
        });
        // Remove groups that don't exist anymore
        signupStudyProgrammes.stream().filter(signupStudyProgramme -> !studyProgrammeIdsPresent.contains(signupStudyProgramme.getStudyProgramme().getId())).forEach(signupStudyProgramme -> {
            if (UserUtils.canAccessOrganization(loggedUser, signupStudyProgramme.getStudyProgramme().getOrganization())) {
                courseSignupStudyProgrammeDAO.delete(signupStudyProgramme);
            } else {
                throw new SmvcRuntimeException(PyramusStatusCode.UNAUTHORIZED, "Invalid organization.");
            }
        });
    }
}
Also used : CourseStaffMember(fi.otavanopisto.pyramus.domainmodel.courses.CourseStaffMember) Arrays(java.util.Arrays) StringUtils(org.apache.commons.lang.StringUtils) StaffMember(fi.otavanopisto.pyramus.domainmodel.users.StaffMember) Organization(fi.otavanopisto.pyramus.domainmodel.base.Organization) CourseSignupStudyProgramme(fi.otavanopisto.pyramus.domainmodel.courses.CourseSignupStudyProgramme) CourseDAO(fi.otavanopisto.pyramus.dao.courses.CourseDAO) Enumeration(java.util.Enumeration) UserUtils(fi.otavanopisto.pyramus.framework.UserUtils) Date(java.util.Date) BasicCourseResource(fi.otavanopisto.pyramus.domainmodel.courses.BasicCourseResource) OtherCost(fi.otavanopisto.pyramus.domainmodel.courses.OtherCost) JSONRequestContext(fi.internetix.smvc.controllers.JSONRequestContext) GradeCourseResource(fi.otavanopisto.pyramus.domainmodel.courses.GradeCourseResource) SmvcRuntimeException(fi.internetix.smvc.SmvcRuntimeException) OtherCostDAO(fi.otavanopisto.pyramus.dao.courses.OtherCostDAO) BigDecimal(java.math.BigDecimal) Vector(java.util.Vector) CourseComponentResourceDAO(fi.otavanopisto.pyramus.dao.courses.CourseComponentResourceDAO) CourseParticipationTypeDAO(fi.otavanopisto.pyramus.dao.courses.CourseParticipationTypeDAO) Locale(java.util.Locale) Map(java.util.Map) Tag(fi.otavanopisto.pyramus.domainmodel.base.Tag) CourseEducationTypeDAO(fi.otavanopisto.pyramus.dao.base.CourseEducationTypeDAO) CourseEducationSubtype(fi.otavanopisto.pyramus.domainmodel.base.CourseEducationSubtype) CourseOptionality(fi.otavanopisto.pyramus.domainmodel.base.CourseOptionality) UserRole(fi.otavanopisto.pyramus.framework.UserRole) CourseDescriptionCategory(fi.otavanopisto.pyramus.domainmodel.courses.CourseDescriptionCategory) CourseSignupStudentGroup(fi.otavanopisto.pyramus.domainmodel.courses.CourseSignupStudentGroup) CourseStaffMemberRoleDAO(fi.otavanopisto.pyramus.dao.courses.CourseStaffMemberRoleDAO) CourseStudentDAO(fi.otavanopisto.pyramus.dao.courses.CourseStudentDAO) StudentGroupDAO(fi.otavanopisto.pyramus.dao.students.StudentGroupDAO) StaleObjectStateException(org.hibernate.StaleObjectStateException) CourseSignupStudentGroupDAO(fi.otavanopisto.pyramus.dao.courses.CourseSignupStudentGroupDAO) DuplicateCourseStudentException(fi.otavanopisto.pyramus.exception.DuplicateCourseStudentException) Set(java.util.Set) GradeCourseResourceDAO(fi.otavanopisto.pyramus.dao.courses.GradeCourseResourceDAO) PyramusStatusCode(fi.otavanopisto.pyramus.framework.PyramusStatusCode) Messages(fi.otavanopisto.pyramus.I18N.Messages) CourseEducationType(fi.otavanopisto.pyramus.domainmodel.base.CourseEducationType) Objects(java.util.Objects) List(java.util.List) CourseParticipationType(fi.otavanopisto.pyramus.domainmodel.courses.CourseParticipationType) CourseEnrolmentTypeDAO(fi.otavanopisto.pyramus.dao.courses.CourseEnrolmentTypeDAO) Module(fi.otavanopisto.pyramus.domainmodel.modules.Module) StudentCourseResourceDAO(fi.otavanopisto.pyramus.dao.courses.StudentCourseResourceDAO) EducationType(fi.otavanopisto.pyramus.domainmodel.base.EducationType) CourseDescriptionDAO(fi.otavanopisto.pyramus.dao.courses.CourseDescriptionDAO) CourseStudent(fi.otavanopisto.pyramus.domainmodel.courses.CourseStudent) StudentDAO(fi.otavanopisto.pyramus.dao.students.StudentDAO) CurriculumDAO(fi.otavanopisto.pyramus.dao.base.CurriculumDAO) StaffMemberDAO(fi.otavanopisto.pyramus.dao.users.StaffMemberDAO) Resource(fi.otavanopisto.pyramus.domainmodel.resources.Resource) CourseStaffMemberRole(fi.otavanopisto.pyramus.domainmodel.courses.CourseStaffMemberRole) CourseState(fi.otavanopisto.pyramus.domainmodel.courses.CourseState) CourseStateDAO(fi.otavanopisto.pyramus.dao.courses.CourseStateDAO) CourseDescription(fi.otavanopisto.pyramus.domainmodel.courses.CourseDescription) ResourceType(fi.otavanopisto.pyramus.domainmodel.resources.ResourceType) HashMap(java.util.HashMap) Currency(java.util.Currency) DefaultsDAO(fi.otavanopisto.pyramus.dao.base.DefaultsDAO) Course(fi.otavanopisto.pyramus.domainmodel.courses.Course) CourseSignupStudyProgrammeDAO(fi.otavanopisto.pyramus.dao.courses.CourseSignupStudyProgrammeDAO) CourseTypeDAO(fi.otavanopisto.pyramus.dao.courses.CourseTypeDAO) StudentCourseResource(fi.otavanopisto.pyramus.domainmodel.courses.StudentCourseResource) MonetaryAmount(fi.otavanopisto.pyramus.persistence.usertypes.MonetaryAmount) EducationSubtype(fi.otavanopisto.pyramus.domainmodel.base.EducationSubtype) HashSet(java.util.HashSet) EducationalTimeUnitDAO(fi.otavanopisto.pyramus.dao.base.EducationalTimeUnitDAO) Curriculum(fi.otavanopisto.pyramus.domainmodel.base.Curriculum) Student(fi.otavanopisto.pyramus.domainmodel.students.Student) BasicCourseResourceDAO(fi.otavanopisto.pyramus.dao.courses.BasicCourseResourceDAO) CourseComponent(fi.otavanopisto.pyramus.domainmodel.courses.CourseComponent) EducationalTimeUnit(fi.otavanopisto.pyramus.domainmodel.base.EducationalTimeUnit) CourseStaffMemberDAO(fi.otavanopisto.pyramus.dao.courses.CourseStaffMemberDAO) JSONRequestController(fi.otavanopisto.pyramus.framework.JSONRequestController) SubjectDAO(fi.otavanopisto.pyramus.dao.base.SubjectDAO) Room(fi.otavanopisto.pyramus.domainmodel.accommodation.Room) Role(fi.otavanopisto.pyramus.domainmodel.users.Role) TagDAO(fi.otavanopisto.pyramus.dao.base.TagDAO) StudyProgrammeDAO(fi.otavanopisto.pyramus.dao.base.StudyProgrammeDAO) ResourceDAO(fi.otavanopisto.pyramus.dao.resources.ResourceDAO) OrganizationDAO(fi.otavanopisto.pyramus.dao.base.OrganizationDAO) CourseComponentResource(fi.otavanopisto.pyramus.domainmodel.courses.CourseComponentResource) CourseType(fi.otavanopisto.pyramus.domainmodel.courses.CourseType) EducationSubtypeDAO(fi.otavanopisto.pyramus.dao.base.EducationSubtypeDAO) EducationTypeDAO(fi.otavanopisto.pyramus.dao.base.EducationTypeDAO) ModuleDAO(fi.otavanopisto.pyramus.dao.modules.ModuleDAO) CourseEnrolmentType(fi.otavanopisto.pyramus.domainmodel.courses.CourseEnrolmentType) StudentGroup(fi.otavanopisto.pyramus.domainmodel.students.StudentGroup) StudyProgramme(fi.otavanopisto.pyramus.domainmodel.base.StudyProgramme) CourseComponentDAO(fi.otavanopisto.pyramus.dao.courses.CourseComponentDAO) Subject(fi.otavanopisto.pyramus.domainmodel.base.Subject) CourseDescriptionCategoryDAO(fi.otavanopisto.pyramus.dao.courses.CourseDescriptionCategoryDAO) CourseEducationSubtypeDAO(fi.otavanopisto.pyramus.dao.base.CourseEducationSubtypeDAO) DAOFactory(fi.otavanopisto.pyramus.dao.DAOFactory) CourseSignupStudyProgramme(fi.otavanopisto.pyramus.domainmodel.courses.CourseSignupStudyProgramme) CourseSignupStudyProgramme(fi.otavanopisto.pyramus.domainmodel.courses.CourseSignupStudyProgramme) StudyProgramme(fi.otavanopisto.pyramus.domainmodel.base.StudyProgramme) CourseSignupStudyProgrammeDAO(fi.otavanopisto.pyramus.dao.courses.CourseSignupStudyProgrammeDAO) SmvcRuntimeException(fi.internetix.smvc.SmvcRuntimeException) CourseSignupStudyProgrammeDAO(fi.otavanopisto.pyramus.dao.courses.CourseSignupStudyProgrammeDAO) StudyProgrammeDAO(fi.otavanopisto.pyramus.dao.base.StudyProgrammeDAO) HashSet(java.util.HashSet)

Aggregations

SmvcRuntimeException (fi.internetix.smvc.SmvcRuntimeException)3 JSONRequestContext (fi.internetix.smvc.controllers.JSONRequestContext)3 Messages (fi.otavanopisto.pyramus.I18N.Messages)2 DAOFactory (fi.otavanopisto.pyramus.dao.DAOFactory)2 CourseEducationSubtypeDAO (fi.otavanopisto.pyramus.dao.base.CourseEducationSubtypeDAO)2 CourseEducationTypeDAO (fi.otavanopisto.pyramus.dao.base.CourseEducationTypeDAO)2 CurriculumDAO (fi.otavanopisto.pyramus.dao.base.CurriculumDAO)2 DefaultsDAO (fi.otavanopisto.pyramus.dao.base.DefaultsDAO)2 EducationSubtypeDAO (fi.otavanopisto.pyramus.dao.base.EducationSubtypeDAO)2 EducationTypeDAO (fi.otavanopisto.pyramus.dao.base.EducationTypeDAO)2 EducationalTimeUnitDAO (fi.otavanopisto.pyramus.dao.base.EducationalTimeUnitDAO)2 OrganizationDAO (fi.otavanopisto.pyramus.dao.base.OrganizationDAO)2 StudyProgrammeDAO (fi.otavanopisto.pyramus.dao.base.StudyProgrammeDAO)2 SubjectDAO (fi.otavanopisto.pyramus.dao.base.SubjectDAO)2 TagDAO (fi.otavanopisto.pyramus.dao.base.TagDAO)2 BasicCourseResourceDAO (fi.otavanopisto.pyramus.dao.courses.BasicCourseResourceDAO)2 CourseComponentDAO (fi.otavanopisto.pyramus.dao.courses.CourseComponentDAO)2 CourseComponentResourceDAO (fi.otavanopisto.pyramus.dao.courses.CourseComponentResourceDAO)2 CourseDAO (fi.otavanopisto.pyramus.dao.courses.CourseDAO)2 CourseDescriptionCategoryDAO (fi.otavanopisto.pyramus.dao.courses.CourseDescriptionCategoryDAO)2