org.cpsolver.studentsct

## Class StudentSectioningXMLSaver

- java.lang.Object
- - org.cpsolver.ifs.util.ProblemSaver<Request,Enrollment,StudentSectioningModel>
  - - org.cpsolver.studentsct.StudentSectioningSaver
    - - org.cpsolver.studentsct.StudentSectioningXMLSaver

- All Implemented Interfaces:
    Runnable

      public class StudentSectioningXMLSaver
      extends StudentSectioningSaver

  Save student sectioning solution into an XML file.
  Parameters:

  Parameter | Type | Comment
  --- | --- | ---
  General.Output | `String` | Folder with the output solution in XML format (solution.xml)
  Xml.ConvertIds | `Boolean` | If true, ids are converted (to be able to make input data public)
  Xml.ShowNames | `Boolean` | If false, names are not exported (to be able to make input data public)
  Xml.SaveBest | `Boolean` | If true, best solution is saved.
  Xml.SaveInitial | `Boolean` | If true, initial solution is saved.
  Xml.SaveCurrent | `Boolean` | If true, current solution is saved.
  Xml.SaveOnlineSectioningInfo | `Boolean` | If true, save online sectioning info (i.e., expected and held space of each section)
  Xml.SaveStudentInfo | `Boolean` | If true, save student information (i.e., academic area classification, major, minor)

  Usage:

       new StudentSectioningXMLSaver(solver).save(new File("solution.xml"));

  Version:
    StudentSct 1.3 (Student Sectioning)
    Copyright (C) 2007 - 2014 Tomáš Müller
    muller@unitime.org
    http://muller.unitime.org
    This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.
    This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
    You should have received a copy of the GNU Lesser General Public License along with this library; if not see http://www.gnu.org/licenses/.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `StudentSectioningXMLSaver(Solver<Request,Enrollment> solver)` Constructor

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected void` | `populate(Document document)` Fill in all the data into the given document
    `void` | `save()` Save an XML file
    `void` | `save(File outFile)` Save an XML file
    `protected void` | `saveConfig(Element configEl, Config config)` Save given config
    `protected void` | `saveCourse(Element courseEl, Course course)` Save given course
    `protected void` | `saveCourseRequest(Element requestEl, CourseRequest request)` Save course request
    `Document` | `saveDocument()`
    `protected void` | `saveEnrollment(Element assignmentEl, Enrollment enrollment)` Save enrollment
    `protected void` | `saveFreeTimeRequest(Element requestEl, FreeTimeRequest request)` Save free time request
    `protected void` | `saveLinkedSections(Element root)` Save linked sections
    `protected void` | `saveOffering(Element offeringEl, Offering offering)` Save given offering
    `protected void` | `saveOfferings(Element root)` Save offerings
    `protected void` | `saveRequest(Element studentEl, Request request)` Save request
    `protected void` | `saveReservation(Element reservationEl, Reservation reservation)` Save reservation
    `protected void` | `saveReservations(Element offeringEl, Offering offering)` Save reservations of the given offering
    `protected void` | `saveRestriction(Element restrictionEl, Restriction restriction)` Save restriction
    `protected void` | `saveRestrictions(Element offeringEl, Offering offering)` Save restrictions of the given offering
    `protected void` | `saveSection(Element sectionEl, Section section)` Save section
    `protected void` | `saveStudent(Element studentEl, Student student)` Save student
    `protected void` | `saveStudents(Element root)` Save students
    `protected void` | `saveSubpart(Element subpartEl, Subpart subpart)` Save scheduling subpart
    `protected void` | `saveTravelTimes(Element root)` Save travel times

    - ### Methods inherited from class org.cpsolver.ifs.util.ProblemSaver

      `getAssignment, getModel, getSolution, getSolver, getTerminationCondition, run, setCallback, setTerminationCondition`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### StudentSectioningXMLSaver

          public StudentSectioningXMLSaver(Solver<Request,Enrollment> solver)

      Constructor
      Parameters:
        `solver` - student sectioning solver

  - ### Method Detail

    - #### save

          public void save()
                    throws Exception

      Save an XML file
      Specified by:
        `save` in class `ProblemSaver<Request,Enrollment,StudentSectioningModel>`
      Throws:
        `Exception` - thrown when save fails

    - #### save

          public void save(File outFile)
                    throws Exception

      Save an XML file
      Parameters:
        `outFile` - output file
      Throws:
        `Exception` - thrown when the save fails

    - #### saveDocument

          public Document saveDocument()

    - #### populate

          protected void populate(Document document)

      Fill in all the data into the given document
      Parameters:
        `document` - document to be populated

    - #### saveOfferings

          protected void saveOfferings(Element root)

      Save offerings
      Parameters:
        `root` - document root

    - #### saveOffering

          protected void saveOffering(Element offeringEl,
                                      Offering offering)

      Save given offering
      Parameters:
        `offeringEl` - offering element to be populated
        `offering` - offering to be saved

    - #### saveCourse

          protected void saveCourse(Element courseEl,
                                    Course course)

      Save given course
      Parameters:
        `courseEl` - course element to be populated
        `course` - course to be saved

    - #### saveConfig

          protected void saveConfig(Element configEl,
                                    Config config)

      Save given config
      Parameters:
        `configEl` - config element to be populated
        `config` - config to be saved

    - #### saveSubpart

          protected void saveSubpart(Element subpartEl,
                                     Subpart subpart)

      Save scheduling subpart
      Parameters:
        `subpartEl` - subpart element to be populated
        `subpart` - subpart to be saved

    - #### saveSection

          protected void saveSection(Element sectionEl,
                                     Section section)

      Save section
      Parameters:
        `sectionEl` - section element to be populated
        `section` - section to be saved

    - #### saveReservations

          protected void saveReservations(Element offeringEl,
                                          Offering offering)

      Save reservations of the given offering
      Parameters:
        `offeringEl` - offering element to be populated with reservations
        `offering` - offering which reservations are to be saved

    - #### saveReservation

          protected void saveReservation(Element reservationEl,
                                         Reservation reservation)

      Save reservation
      Parameters:
        `reservationEl` - reservation element to be populated
        `reservation` - reservation to be saved

    - #### saveRestrictions

          protected void saveRestrictions(Element offeringEl,
                                          Offering offering)

      Save restrictions of the given offering
      Parameters:
        `offeringEl` - offering element to be populated with restrictions
        `offering` - offering which restrictions are to be saved

    - #### saveRestriction

          protected void saveRestriction(Element restrictionEl,
                                         Restriction restriction)

      Save restriction
      Parameters:
        `restrictionEl` - restriction element to be populated
        `restriction` - restriction to be saved

    - #### saveStudents

          protected void saveStudents(Element root)

      Save students
      Parameters:
        `root` - document root

    - #### saveStudent

          protected void saveStudent(Element studentEl,
                                     Student student)

      Save student
      Parameters:
        `studentEl` - student element to be populated
        `student` - student to be saved

    - #### saveRequest

          protected void saveRequest(Element studentEl,
                                     Request request)

      Save request
      Parameters:
        `studentEl` - student element to be populated
        `request` - request to be saved

    - #### saveFreeTimeRequest

          protected void saveFreeTimeRequest(Element requestEl,
                                             FreeTimeRequest request)

      Save free time request
      Parameters:
        `requestEl` - request element to be populated
        `request` - free time request to be saved

    - #### saveCourseRequest

          protected void saveCourseRequest(Element requestEl,
                                           CourseRequest request)

      Save course request
      Parameters:
        `requestEl` - request element to be populated
        `request` - course request to be saved

    - #### saveEnrollment

          protected void saveEnrollment(Element assignmentEl,
                                        Enrollment enrollment)

      Save enrollment
      Parameters:
        `assignmentEl` - assignment element to be populated
        `enrollment` - enrollment to be saved

    - #### saveLinkedSections

          protected void saveLinkedSections(Element root)

      Save linked sections
      Parameters:
        `root` - document root

    - #### saveTravelTimes

          protected void saveTravelTimes(Element root)

      Save travel times
      Parameters:
        `root` - document root