001/*
002 *  Copyright 2014 Anyware Services
003 *
004 *  Licensed under the Apache License, Version 2.0 (the "License");
005 *  you may not use this file except in compliance with the License.
006 *  You may obtain a copy of the License at
007 *
008 *      http://www.apache.org/licenses/LICENSE-2.0
009 *
010 *  Unless required by applicable law or agreed to in writing, software
011 *  distributed under the License is distributed on an "AS IS" BASIS,
012 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 *  See the License for the specific language governing permissions and
014 *  limitations under the License.
015 */
016package org.ametys.odf.cdmfr;
017
018import java.util.Set;
019
020import org.xml.sax.ContentHandler;
021import org.xml.sax.SAXException;
022
023import org.ametys.odf.course.Course;
024import org.ametys.odf.orgunit.OrgUnit;
025import org.ametys.odf.person.Person;
026import org.ametys.odf.program.AbstractProgram;
027import org.ametys.odf.program.Container;
028import org.ametys.odf.program.Program;
029import org.ametys.odf.program.ProgramFactory;
030
031/**
032 * Interface for CMDfr extension.
033 */
034public interface CDMfrExtension
035{
036    /**
037     * Send the content of an user defined ametys extension to be included in the CDM-fr representation the abstract program.<br>
038     * @param contentHandler the receiving contentHandler.
039     * @param program the abstract program (common for program and subprogram)
040     * @param persons collected {@link Person} ids.
041     * @param orgUnits collected {@link OrgUnit} ids.
042     * @throws SAXException if an error occurs during CDM processing.
043     */
044    public void abstractProgram2CDM(ContentHandler contentHandler, AbstractProgram<? extends ProgramFactory> program, Set<String> persons, Set<String> orgUnits) throws SAXException;
045    
046    /**
047     * Send the content of an user defined ametys extension to be included in the CDM-fr representation the program.<br>
048     * @param contentHandler the receiving contentHandler.
049     * @param program the program
050     * @param persons collected {@link Person} ids.
051     * @param orgUnits collected {@link OrgUnit} ids.
052     * @throws SAXException if an error occurs during CDM processing.
053     */
054    public void program2CDM(ContentHandler contentHandler, Program program, Set<String> persons, Set<String> orgUnits) throws SAXException;
055    
056    /**
057     * Send the content of an user defined ametys extension to be included in the CDM-fr representation the course.<br>
058     * @param contentHandler the receiving contentHandler.
059     * @param course the course
060     * @param persons collected {@link Person} ids.
061     * @param orgUnits collected {@link OrgUnit} ids.
062     * @throws SAXException if an error occurs during CDM processing.
063     */
064    public void course2CDM(ContentHandler contentHandler, Course course, Set<String> persons, Set<String> orgUnits) throws SAXException;
065    
066    /**
067     * Send the content of an user defined ametys extension to be included in the CDM-fr representation the orgunit.<br>
068     * @param contentHandler the receiving contentHandler.
069     * @param orgunit the orgunit
070     * @throws SAXException if an error occurs during CDM processing.
071     */
072    public void orgunit2CDM(ContentHandler contentHandler, OrgUnit orgunit) throws SAXException;
073    
074    /**
075     * Send the content of an user defined ametys extension to be included in the CDM-fr representation the orgunit.<br>
076     * @param contentHandler the receiving contentHandler.
077     * @param person the orgunit
078     * @throws SAXException if an error occurs during CDM processing.
079     */
080    public void person2CDM(ContentHandler contentHandler, Person person) throws SAXException;
081    
082    /**
083     * Send the content of an user defined ametys extension to be included in the CDM-fr representation the container.<br>
084     * @param contentHandler the receiving contentHandler.
085     * @param container the container
086     * @param persons collected {@link Person} ids.
087     * @param orgUnits collected {@link OrgUnit} ids.
088     * @throws SAXException if an error occurs during CDM processing.
089     */
090    public void container2CDM(ContentHandler contentHandler, Container container, Set<String> persons, Set<String> orgUnits) throws SAXException;
091}