Package com.darkhonor.rage.model

Examples of com.darkhonor.rage.model.Section


    private List<Section> createCheckSectionList(Course course)
    {
        List<Section> sections = new ArrayList<Section>();
       
        Section section1 = new Section("M1A");
        section1.setCourse(course);
        sections.add(section1);
        course.addSection(section1);

        Section section2 = new Section("M1B");
        section2.setCourse(course);
        sections.add(section2);
        course.addSection(section2);

        Section section3 = new Section("M2A");
        section3.setCourse(course);
        sections.add(section3);
        course.addSection(section3);

        Section section4 = new Section("M3A");
        section4.setCourse(course);
        sections.add(section4);
        course.addSection(section4);

        Section section5 = new Section("T1A");
        section5.setCourse(course);
        sections.add(section5);
        course.addSection(section5);

        Section section6 = new Section("T6A");
        section6.setCourse(course);
        sections.add(section6);
        course.addSection(section6);
       
        Section section7 = new Section("T6B");
        section7.setCourse(course);
        sections.add(section7);
        course.addSection(section7);

        return sections;
    }
View Full Code Here


    private List<Instructor> createCheckInstructorList(Course course)
    {
        List<Instructor> instructors = new ArrayList<Instructor>();
        Instructor instructor1 = new Instructor("Alexander", "Ackerman", "Alexander.Ackerman");
        instructor1.setDomainAccount(instructor1.getWebID());
        Section section1;

        return instructors;
    }
View Full Code Here

                new Integer(2013));
        Student student3 = new Student("Bob", "Reimer", "C13Robert.Reimer",
                new Integer(2013));
        Student student4 = new Student("Andrew", "Callow", "C13Andrew.Callow",
                new Integer(2013));
        Section section1 = new Section("M1A");
        Section section2 = new Section("M2B");
        Instructor instructor1 = new Instructor("David", "Roberts", "David.Roberts");
        instructor1.setDomainAccount(instructor1.getWebID());
        Instructor instructor2 = new Instructor("Sarah", "O'Reilly", "Sarah.OReilly");
        instructor2.setDomainAccount(instructor2.getWebID());

        // Set the Instructors for Sections 1 & 2
        section1.setInstructor(instructor1);
        section2.setInstructor(instructor2);

        // Add Instructors to Course
        course.addInstructor(instructor1);
        course.addInstructor(instructor2);

        // Add Students 1 & 2 to Section 1
        section1.addStudent(student1);
        student1.addSection(section1);
        section1.addStudent(student2);
        student2.addSection(section1);

        // Add Students 3 & 4 to Section 2
        section2.addStudent(student3);
        student3.addSection(section2);
        section2.addStudent(student4);
        student4.addSection(section2);

        // Add Sections 1 & 2 to Course
        section1.setCourse(course);
        section2.setCourse(course);
        course.addSection(section1);
        course.addSection(section2);

        return course;
    }
View Full Code Here

                new Integer(2013));
        Student student4 = new Student("Andrew", "Callow", "C13Andrew.Callow",
                new Integer(2013));
        Student student5 = new Student("Kerry", "Beevers", "C11Kerry.Beevers",
                new Integer(2011));
        Section section1 = new Section("M2A");
        Section section2 = new Section("T1A");
        Instructor instructor1 = new Instructor("David", "Roberts", "David.Roberts");
        instructor1.setDomainAccount(instructor1.getWebID());

        // Set the Instructors for Sections 1 & 2
        section1.setInstructor(instructor1);
        section2.setInstructor(instructor1);

        // Add Instructor to Course
        course.addInstructor(instructor1);

        // Add Students 1 & 2 to Section 1
        section1.addStudent(student1);
        student1.addSection(section1);
        section1.addStudent(student2);
        student2.addSection(section1);

        // Add Students 3, 4, & 5 to Section 2
        section2.addStudent(student3);
        student3.addSection(section2);
        section2.addStudent(student4);
        student4.addSection(section2);
        section2.addStudent(student5);
        student5.addSection(section2);

        // Add Sections 1 & 2 to Course
        section1.setCourse(course);
        section2.setCourse(course);
        course.addSection(section1);
        course.addSection(section2);

        return course;
    }
View Full Code Here

                    LOGGER.debug("Header information correct");
                    for (int i = 1; i < totalRows; i++)
                    {
                        LOGGER.debug("Parsing Section Row #" + i);
                        XSSFRow sectionRow = sectionSheet.getRow(i);
                        Section section = new Section(sectionRow.getCell(0).getStringCellValue());
                        section.setCourse(course);
                        if (!sections.contains(section))
                        {
                            LOGGER.debug("Adding Section " + section.getName()
                                    + " to Course " + course);
                            sections.add(section);
                        }
                    }
                }
View Full Code Here

                        /**
                         * The assumption is that all Course Sections will be
                         * identified prior to loading instructors.
                         */
                        Section importedSection = new Section();
                        importedSection.setName(instructorRow.getCell(4).getStringCellValue());
                        importedSection.setCourse(course);
                        int sectionIndex = sections.indexOf(importedSection);

                        int instructorIndex = instructors.indexOf(instructor);
                        if (instructorIndex > -1)
                        {
View Full Code Here

                        /**
                         * The assumption is that all Course Sections will be
                         * identified prior to loading students.
                         */
                        Section importedSection = new Section();
                        importedSection.setName(studentRow.getCell(5).getStringCellValue());
                        importedSection.setCourse(course);

                        int sectionIndex = sections.indexOf(importedSection);

                        int studentIndex = students.indexOf(student);
                        if (studentIndex > -1)
View Full Code Here

                    section.getCourse().getName()));
            criteria = cb.and(criteria, cb.equal(sectionRoot.get("name"), section.getName()));
            cq.where(criteria);
            TypedQuery<Section> sectionQuery = em.createQuery(cq);

            Section dbSection = sectionQuery.getSingleResult();
            LOGGER.error("(create) The provided Section already exists");
            throw new IllegalArgumentException("The provided Section already exists");
        } catch (NoResultException ex)
        {
            LOGGER.error("(getSectionsForCourse) Exception Caught: "
View Full Code Here

        } else if (section.getInstructor() == null)
        {
            LOGGER.error("(update) The provided Section's Instructor is null");
            throw new NullPointerException("The provided Section's Instructor is null");
        }
        Section dbSection = em.find(Section.class, section.getId());
        if (dbSection == null)
        {
            LOGGER.error("(delete) The provided Section is not persisted");
            throw new IllegalArgumentException("The provided Section is not persisted");
        }
View Full Code Here

        } else if (section.getCourse() == null)
        {
            LOGGER.error("(delete) The provided Section's Course is null");
            throw new NullPointerException("The provided Section's Course is null");
        }
        Section dbSection = em.find(Section.class, section.getId());
        if (dbSection == null)
        {
            LOGGER.error("(delete) The provided Section is not persisted");
            throw new IllegalArgumentException("The provided Section is not persisted");
        }
View Full Code Here

TOP

Related Classes of com.darkhonor.rage.model.Section

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.