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;
030import org.ametys.odf.program.SubProgram;
031
032/**
033 * Interface for CMDfr extension.
034 */
035public interface CDMfrExtension
036{
037    /**
038     * Send the content of an user defined ametys extension to be included in the CDM-fr representation the abstract program.<br>
039     * @param contentHandler the receiving contentHandler.
040     * @param program the abstract program (common for program and subprogram)
041     * @param persons collected {@link Person} ids.
042     * @param orgUnits collected {@link OrgUnit} ids.
043     * @throws SAXException if an error occurs during CDM processing.
044     */
045    public void abstractProgram2CDM(ContentHandler contentHandler, AbstractProgram<? extends ProgramFactory> program, Set<String> persons, Set<String> orgUnits) throws SAXException;
046    
047    /**
048     * Send the content of an user defined ametys extension to be included in the CDM-fr representation the program.<br>
049     * @param contentHandler the receiving contentHandler.
050     * @param program the program
051     * @param persons collected {@link Person} ids.
052     * @param orgUnits collected {@link OrgUnit} ids.
053     * @throws SAXException if an error occurs during CDM processing.
054     */
055    public void program2CDM(ContentHandler contentHandler, Program program, Set<String> persons, Set<String> orgUnits) throws SAXException;
056    
057    /**
058     * Send the content of an user defined ametys extension to be included in the CDM-fr representation the subProgram.<br>
059     * @param contentHandler the receiving contentHandler.
060     * @param subProgram the subProgram
061     * @param persons collected {@link Person} ids.
062     * @param orgUnits collected {@link OrgUnit} ids.
063     * @throws SAXException if an error occurs during CDM processing.
064     */
065    public void subProgram2CDM(ContentHandler contentHandler, SubProgram subProgram, Set<String> persons, Set<String> orgUnits) throws SAXException;
066    
067    /**
068     * Send the content of an user defined ametys extension to be included in the CDM-fr representation the course.<br>
069     * @param contentHandler the receiving contentHandler.
070     * @param course the course
071     * @param persons collected {@link Person} ids.
072     * @param orgUnits collected {@link OrgUnit} ids.
073     * @throws SAXException if an error occurs during CDM processing.
074     */
075    public void course2CDM(ContentHandler contentHandler, Course course, Set<String> persons, Set<String> orgUnits) throws SAXException;
076    
077    /**
078     * Send the content of an user defined ametys extension to be included in the CDM-fr representation the orgunit.<br>
079     * @param contentHandler the receiving contentHandler.
080     * @param orgunit the orgunit
081     * @throws SAXException if an error occurs during CDM processing.
082     */
083    public void orgunit2CDM(ContentHandler contentHandler, OrgUnit orgunit) throws SAXException;
084    
085    /**
086     * Send the content of an user defined ametys extension to be included in the CDM-fr representation the orgunit.<br>
087     * @param contentHandler the receiving contentHandler.
088     * @param person the orgunit
089     * @throws SAXException if an error occurs during CDM processing.
090     */
091    public void person2CDM(ContentHandler contentHandler, Person person) throws SAXException;
092    
093    /**
094     * Send the content of an user defined ametys extension to be included in the CDM-fr representation the container.<br>
095     * @param contentHandler the receiving contentHandler.
096     * @param container the container
097     * @param persons collected {@link Person} ids.
098     * @param orgUnits collected {@link OrgUnit} ids.
099     * @throws SAXException if an error occurs during CDM processing.
100     */
101    public void container2CDM(ContentHandler contentHandler, Container container, Set<String> persons, Set<String> orgUnits) throws SAXException;
102}