Package org.ametys.odf.cdmfr
Class ExportCDMfrManager
- java.lang.Object
-
- org.ametys.odf.cdmfr.ExportCDMfrManager
-
- All Implemented Interfaces:
Component,Contextualizable,Serviceable
public class ExportCDMfrManager extends Object implements Component, Serviceable, Contextualizable
Component able to generate CDM-fr for aCDMEntity.
-
-
Field Summary
Fields Modifier and Type Field Description private static String[]__FIXED_DOMAIN_NAMESprotected CDMfrExtensionPoint_cdmFrExtensionPointThe CDMfr extension pointprotected Context_contextThe avalon contextprotected ContentTypeExtensionPoint_cTypeEPThe content type extension pointprotected ContentTypesHelper_cTypeHelperHelper for content typesprotected ODFHelper_odfHelperThe ODF helperprotected OdfReferenceTableHelper_refTableHelperThe ODF enumeration helperprotected AmetysObjectResolver_resolverThe Ametys object resolverprotected RootOrgUnitProvider_rootOrgUnitProviderThe root orgunit providerprotected SourceResolver_sourceResolverThe source resolverstatic StringREQUEST_ATTRIBUTE_EXPORT_FOR_AMETYSRequest attribute to get if the export is for Ametys applicationstatic StringROLEThe Avalon role
-
Constructor Summary
Constructors Constructor Description ExportCDMfrManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void_abstractProgram2CDMCode(ContentHandler contentHandler, AbstractProgram<? extends ProgramFactory> program)SAX CDMfr events for aAbstractProgramcodesprotected void_abstractProgram2CDMContacts(ContentHandler contentHandler, AbstractProgram<? extends ProgramFactory> program, Set<String> persons, Set<String> orgUnits)SAX CDMfr events for aAbstractProgramcontactsprotected void_addNotNullAttribute(AttributesImpl attrs, String localName, String value)SAX value as attributes if not null nor emptyprotected void_addPositiveAttribute(AttributesImpl attrs, String localName, double value)SAX value as attributes if not null nor emptyprotected void_admissionInfo2CDM(ContentHandler contentHandler, AbstractProgram<? extends ProgramFactory> program)SAX CDMfr admission infoprotected void_course2CDMContacts(ContentHandler contentHandler, Course course, Set<String> persons, Set<String> orgUnits)SAX CDMfr events for aCoursecontactsprotected void_courselist2CDM(ContentHandler contentHandler, CourseList cl)Convert course list info to CDM (without child courses)protected Set<String>_courseLists2CDM(ContentHandler contentHandler, Course course)Sax the courses lists for a course.protected void_credits2CDM(ContentHandler contentHandler, Course course)Sax the course credits.protected void_degree2CDM(ContentHandler contentHandler, AbstractProgram<? extends ProgramFactory> program)SAX CDMfr degreeprivate String_getMentionType(Program program)protected String_getRootOrgUnitId(Program program)Get the root organization unit uai codeprotected void_level2CDM(ContentHandler contentHandler, AbstractProgram<? extends ProgramFactory> program)SAX CDMfr levelprotected void_orgunit2CDM(ContentHandler contentHandler, OrgUnit orgunit, Set<String> persons)SAX CDMfr event for aOrgUnitprotected void_orgunit2CDM(ContentHandler contentHandler, OrgUnit orgunit, Set<String> persons, boolean showChildren)SAX CDMfr event for aOrgUnitprotected void_place2CDM(ContentHandler contentHandler, AbstractProgram<? extends ProgramFactory> program)SAX CDM-fr teaching placesprotected void_programPart2CDMSubPrograms(ContentHandler contentHandler, TraversableProgramPart programPart, Set<String> persons, Set<String> orgUnits, Set<String> courses)SAX CDMfr events for aProgramPartstrcutureprotected void_qualification2CDM(ContentHandler contentHandler, AbstractProgram<? extends ProgramFactory> program)SAX CDM-fr qualificationprotected void_romeCodes2CDM(ContentHandler contentHandler, AbstractProgram<? extends ProgramFactory> program)SAX CDMfr rome codesprotected void_saxCohabilitation(ContentHandler contentHandler, Program program)Sax cohabilitation informations.protected void_saxHabilitationDiploma(ContentHandler contentHandler, Program program)Sax habilitation informations of the diploma.protected void_saxHabilitationDomains(ContentHandler contentHandler, String[] domains)Sax habilitation informations of domains.protected void_saxHabilitationJointOrgUnit(ContentHandler contentHandler, Program program)Sax habilitation informations of joint orgunits.protected void_saxHabilitationLicPro(ContentHandler contentHandler, Program program)Sax habilitation informations of professional license.protected void_saxHabilitationMention(ContentHandler contentHandler, Program program, String mention)Sax habilitation informations of mention.protected void_saxHabilitationOtherDiploma(ContentHandler contentHandler, Program program)Sax habilitation informations for another diploma : no mention, not a license.protected void_saxHabilitationPartnerShip(ContentHandler contentHandler, Program program)Sax habilitation informations of partner ship.protected void_saxHabilitationSpeciality(ContentHandler contentHandler, Program program, String speciality)Sax habilitation informations of speciality.protected void_syllabus2CDM(ContentHandler contentHandler, Course course)SAX the syllabus elements of the course.protected void_teachingLocation2CDM(ContentHandler contentHandler, Course course)Sax the course teaching locations.voidabstractProgram2CDM(ContentHandler contentHandler, AbstractProgram<? extends ProgramFactory> program, Set<String> persons, Set<String> orgUnits, Set<String> courses)Send the CDM-fr representation of their ProgramPart to the given Contenthandler.
Also collects referenced orgUnits, persons and courses, so that they could be sent afterwards.voidcontainer2CDM(ContentHandler contentHandler, Container container, Set<String> persons, Set<String> orgUnits, Set<String> courses)Send the CDM-fr representation of their ProgramPart to the given Contenthandler.
Also collects referenced orgUnits, persons and courses, so that they could be sent afterwards.voidcontextualize(Context context)voidcourse2CDM(ContentHandler contentHandler, Course course)Export this entity in CDM-fr format.Set<String>course2CDM(ContentHandler contentHandler, Course course, Set<String> orgUnits, Set<String> persons)Export this entity in CDM-fr format.voidcourselist2CDM(ContentHandler contentHandler, CourseList cl, Set<String> courses)SAX the course list structurevoidgenerateCDM(ContentHandler contentHandler, Program program)Entry point to generate the CDM for a programprotected StringgetDiplomaType(Program program)Get the type of diplomaprotected booleanisExportForAmetys()Determines if this CDM export if for a Ametys applicationvoidorgunit2CDM(ContentHandler contentHandler, OrgUnit orgunit)Export this entity in CDM-fr format.voidperson2CDM(ContentHandler contentHandler, Person person)Export this entity in CDM-fr format.voidprogram2CDM(ContentHandler contentHandler, Program program)Export this entity in CDM-fr format.voidsaxHabilitation(ContentHandler contentHandler, Program program)SAX CDMfr events for program's habilitationvoidservice(ServiceManager smanager)protected voidswitchToLiveVersionIfNeeded(DefaultAmetysObject ao)Switch to Live version if it was required
-
-
-
Field Detail
-
REQUEST_ATTRIBUTE_EXPORT_FOR_AMETYS
public static final String REQUEST_ATTRIBUTE_EXPORT_FOR_AMETYS
Request attribute to get if the export is for Ametys application
-
__FIXED_DOMAIN_NAMES
private static final String[] __FIXED_DOMAIN_NAMES
-
_resolver
protected AmetysObjectResolver _resolver
The Ametys object resolver
-
_sourceResolver
protected SourceResolver _sourceResolver
The source resolver
-
_refTableHelper
protected OdfReferenceTableHelper _refTableHelper
The ODF enumeration helper
-
_rootOrgUnitProvider
protected RootOrgUnitProvider _rootOrgUnitProvider
The root orgunit provider
-
_cdmFrExtensionPoint
protected CDMfrExtensionPoint _cdmFrExtensionPoint
The CDMfr extension point
-
_cTypeEP
protected ContentTypeExtensionPoint _cTypeEP
The content type extension point
-
_cTypeHelper
protected ContentTypesHelper _cTypeHelper
Helper for content types
-
_odfHelper
protected ODFHelper _odfHelper
The ODF helper
-
-
Constructor Detail
-
ExportCDMfrManager
public ExportCDMfrManager()
-
-
Method Detail
-
service
public void service(ServiceManager smanager) throws ServiceException
- Specified by:
servicein interfaceServiceable- Throws:
ServiceException
-
contextualize
public void contextualize(Context context) throws ContextException
- Specified by:
contextualizein interfaceContextualizable- Throws:
ContextException
-
generateCDM
public void generateCDM(ContentHandler contentHandler, Program program) throws SAXException
Entry point to generate the CDM for a program- Parameters:
contentHandler- The content handler to sax intoprogram- The program- Throws:
SAXException- if failed to generate CDM
-
switchToLiveVersionIfNeeded
protected void switchToLiveVersionIfNeeded(DefaultAmetysObject ao)
Switch to Live version if it was required- Parameters:
ao- the Ametys object- Throws:
IllegalStateException- if the Live version is required but not exist
-
isExportForAmetys
protected boolean isExportForAmetys()
Determines if this CDM export if for a Ametys application- Returns:
- true if this CDM export if for a Ametys application
-
saxHabilitation
public void saxHabilitation(ContentHandler contentHandler, Program program) throws SAXException
SAX CDMfr events for program's habilitation- Parameters:
contentHandler- the content handler to sax intoprogram- the program- Throws:
SAXException- if an error occurred
-
_saxHabilitationDiploma
protected void _saxHabilitationDiploma(ContentHandler contentHandler, Program program) throws SAXException
Sax habilitation informations of the diploma.- Parameters:
contentHandler- The content handlerprogram- The program to sax- Throws:
SAXException- if an error occurs
-
_saxHabilitationLicPro
protected void _saxHabilitationLicPro(ContentHandler contentHandler, Program program) throws SAXException
Sax habilitation informations of professional license.- Parameters:
contentHandler- The content handlerprogram- The program to sax- Throws:
SAXException- if an error occurs
-
_saxHabilitationOtherDiploma
protected void _saxHabilitationOtherDiploma(ContentHandler contentHandler, Program program) throws SAXException
Sax habilitation informations for another diploma : no mention, not a license.- Parameters:
contentHandler- The content handlerprogram- The program to sax- Throws:
SAXException- if an error occurs
-
_saxHabilitationMention
protected void _saxHabilitationMention(ContentHandler contentHandler, Program program, String mention) throws SAXException
Sax habilitation informations of mention.- Parameters:
contentHandler- The content handlerprogram- The program to saxmention- The mention to sax- Throws:
SAXException- if an error occurs
-
_saxHabilitationSpeciality
protected void _saxHabilitationSpeciality(ContentHandler contentHandler, Program program, String speciality) throws SAXException
Sax habilitation informations of speciality.- Parameters:
contentHandler- The content handlerprogram- The program to saxspeciality- The speciality to sax- Throws:
SAXException- if an error occurs
-
_saxCohabilitation
protected void _saxCohabilitation(ContentHandler contentHandler, Program program) throws SAXException
Sax cohabilitation informations.- Parameters:
contentHandler- The content handlerprogram- The program to sax- Throws:
SAXException- if an error occurs
-
_saxHabilitationDomains
protected void _saxHabilitationDomains(ContentHandler contentHandler, String[] domains) throws SAXException
Sax habilitation informations of domains.- Parameters:
contentHandler- The content handlerdomains- The domains to SAX- Throws:
SAXException- if an error occurs
-
_saxHabilitationJointOrgUnit
protected void _saxHabilitationJointOrgUnit(ContentHandler contentHandler, Program program) throws SAXException
Sax habilitation informations of joint orgunits.- Parameters:
contentHandler- The content handlerprogram- The program to sax- Throws:
SAXException- if an error occurs
-
_saxHabilitationPartnerShip
protected void _saxHabilitationPartnerShip(ContentHandler contentHandler, Program program) throws SAXException
Sax habilitation informations of partner ship.- Parameters:
contentHandler- The content handlerprogram- The program to sax- Throws:
SAXException- if an error occurs
-
_getRootOrgUnitId
protected String _getRootOrgUnitId(Program program)
Get the root organization unit uai code- Parameters:
program- the exported program- Returns:
- the uai code of the root organization unit corresponding to the exported program
-
getDiplomaType
protected String getDiplomaType(Program program)
Get the type of diploma- Parameters:
program- the program- Returns:
- diploma type
-
program2CDM
public void program2CDM(ContentHandler contentHandler, Program program) throws SAXException
Export this entity in CDM-fr format.- Parameters:
contentHandler- the target handlerprogram- the program- Throws:
SAXException- if an error occurs during export.
-
abstractProgram2CDM
public void abstractProgram2CDM(ContentHandler contentHandler, AbstractProgram<? extends ProgramFactory> program, Set<String> persons, Set<String> orgUnits, Set<String> courses) throws SAXException
Send the CDM-fr representation of their ProgramPart to the given Contenthandler.
Also collects referenced orgUnits, persons and courses, so that they could be sent afterwards.- Parameters:
contentHandler- the receiving contentHandler.program- the programpersons- collectedPersonids.orgUnits- collectedOrgUnitids.courses- collectedCourseids.- Throws:
SAXException- if an error occurs during CDM processing.
-
_place2CDM
protected void _place2CDM(ContentHandler contentHandler, AbstractProgram<? extends ProgramFactory> program) throws SAXException
SAX CDM-fr teaching places- Parameters:
contentHandler- the content handler to sax intoprogram- the program or subprogram- Throws:
SAXException- if an error occurred
-
_qualification2CDM
protected void _qualification2CDM(ContentHandler contentHandler, AbstractProgram<? extends ProgramFactory> program) throws SAXException
SAX CDM-fr qualification- Parameters:
contentHandler- the content handler to sax intoprogram- the program or subprogram- Throws:
SAXException- if an error occurred
-
_degree2CDM
protected void _degree2CDM(ContentHandler contentHandler, AbstractProgram<? extends ProgramFactory> program) throws SAXException
SAX CDMfr degree- Parameters:
contentHandler- the content handler to sax intoprogram- the program or subprogram- Throws:
SAXException- if an error occurred
-
_romeCodes2CDM
protected void _romeCodes2CDM(ContentHandler contentHandler, AbstractProgram<? extends ProgramFactory> program) throws SAXException
SAX CDMfr rome codes- Parameters:
contentHandler- the content handler to sax intoprogram- the program or subprogram- Throws:
SAXException- if an error occurred
-
_level2CDM
protected void _level2CDM(ContentHandler contentHandler, AbstractProgram<? extends ProgramFactory> program) throws SAXException
SAX CDMfr level- Parameters:
contentHandler- the content handler to sax intoprogram- the program or subprogram- Throws:
SAXException- if an error occurred
-
_admissionInfo2CDM
protected void _admissionInfo2CDM(ContentHandler contentHandler, AbstractProgram<? extends ProgramFactory> program) throws SAXException
SAX CDMfr admission info- Parameters:
contentHandler- the content handler to sax intoprogram- the program or subprogram- Throws:
SAXException- if an error occurred
-
_abstractProgram2CDMCode
protected void _abstractProgram2CDMCode(ContentHandler contentHandler, AbstractProgram<? extends ProgramFactory> program) throws SAXException
SAX CDMfr events for aAbstractProgramcodes- Parameters:
contentHandler- the content handler to sax intoprogram- the program or subprogram- Throws:
SAXException- if an error occurred
-
_abstractProgram2CDMContacts
protected void _abstractProgram2CDMContacts(ContentHandler contentHandler, AbstractProgram<? extends ProgramFactory> program, Set<String> persons, Set<String> orgUnits) throws SAXException
SAX CDMfr events for aAbstractProgramcontacts- Parameters:
contentHandler- the content handler to sax intoprogram- the program or subprogrampersons- the contactsorgUnits- the orgunits- Throws:
SAXException- if an error occurred
-
_programPart2CDMSubPrograms
protected void _programPart2CDMSubPrograms(ContentHandler contentHandler, TraversableProgramPart programPart, Set<String> persons, Set<String> orgUnits, Set<String> courses) throws SAXException
SAX CDMfr events for aProgramPartstrcuture- Parameters:
contentHandler- the content handler to sax intoprogramPart- the program partpersons- the contactsorgUnits- the orgunitscourses- the courses- Throws:
SAXException- if an error occurred
-
container2CDM
public void container2CDM(ContentHandler contentHandler, Container container, Set<String> persons, Set<String> orgUnits, Set<String> courses) throws SAXException
Send the CDM-fr representation of their ProgramPart to the given Contenthandler.
Also collects referenced orgUnits, persons and courses, so that they could be sent afterwards.- Parameters:
contentHandler- the receiving contentHandler.container- The containerpersons- collectedPersonids.orgUnits- collectedOrgUnitids.courses- collectedCourseids.- Throws:
SAXException- if an error occurs during CDM processing.
-
courselist2CDM
public void courselist2CDM(ContentHandler contentHandler, CourseList cl, Set<String> courses) throws SAXException
SAX the course list structure- Parameters:
contentHandler- The content handler to SAX intocl- The course listcourses- References of saxed courses- Throws:
SAXException- if an error occurs
-
_courselist2CDM
protected void _courselist2CDM(ContentHandler contentHandler, CourseList cl) throws SAXException
Convert course list info to CDM (without child courses)- Parameters:
contentHandler- The content handler to sax intocl- The course list- Throws:
SAXException- if an error occurs
-
course2CDM
public void course2CDM(ContentHandler contentHandler, Course course) throws SAXException
Export this entity in CDM-fr format.- Parameters:
contentHandler- the target handlercourse- The course- Throws:
SAXException- if an error occurs during export.
-
course2CDM
public Set<String> course2CDM(ContentHandler contentHandler, Course course, Set<String> orgUnits, Set<String> persons) throws SAXException
Export this entity in CDM-fr format.- Parameters:
contentHandler- the content handler to SAX intocourse- the courseorgUnits- the org unitspersons- the persons- Returns:
- the saxed coursed
- Throws:
SAXException- if failed to generate CDM
-
_courseLists2CDM
protected Set<String> _courseLists2CDM(ContentHandler contentHandler, Course course) throws SAXException
Sax the courses lists for a course.- Parameters:
contentHandler- the content handler to SAX intocourse- The courselist container.- Returns:
- The list of courses into the course list.
- Throws:
SAXException- if failed to generate CDM
-
_credits2CDM
protected void _credits2CDM(ContentHandler contentHandler, Course course) throws SAXException
Sax the course credits.- Parameters:
contentHandler- the content handler to SAX intocourse- The course to sax- Throws:
SAXException- if failed to generate CDM
-
_syllabus2CDM
protected void _syllabus2CDM(ContentHandler contentHandler, Course course) throws SAXException
SAX the syllabus elements of the course.- Parameters:
contentHandler- The content handlercourse- The course to SAX- Throws:
SAXException- if an error occurs
-
_teachingLocation2CDM
protected void _teachingLocation2CDM(ContentHandler contentHandler, Course course) throws SAXException
Sax the course teaching locations.- Parameters:
contentHandler- the content handler to SAX intocourse- The course to sax- Throws:
SAXException- if failed to generate CDM
-
_course2CDMContacts
protected void _course2CDMContacts(ContentHandler contentHandler, Course course, Set<String> persons, Set<String> orgUnits) throws SAXException
SAX CDMfr events for aCoursecontacts- Parameters:
contentHandler- the content handler to sax intocourse- the coursepersons- the contactsorgUnits- the orgunits- Throws:
SAXException- if an error occurred
-
orgunit2CDM
public void orgunit2CDM(ContentHandler contentHandler, OrgUnit orgunit) throws SAXException
Export this entity in CDM-fr format.- Parameters:
contentHandler- the target handlerorgunit- the orgunit- Throws:
SAXException- if an error occurs during export.
-
_orgunit2CDM
protected void _orgunit2CDM(ContentHandler contentHandler, OrgUnit orgunit, Set<String> persons) throws SAXException
SAX CDMfr event for aOrgUnit- Parameters:
contentHandler- the content handler to sax intoorgunit- the orgunitpersons- the contacts of orgunit- Throws:
SAXException- if an error occurred
-
_orgunit2CDM
protected void _orgunit2CDM(ContentHandler contentHandler, OrgUnit orgunit, Set<String> persons, boolean showChildren) throws SAXException
SAX CDMfr event for aOrgUnit- Parameters:
contentHandler- the content handler to sax intoorgunit- the orgunitpersons- the contacts of orgunitshowChildren- true to sax child orgunits- Throws:
SAXException- if an error occurred
-
person2CDM
public void person2CDM(ContentHandler contentHandler, Person person) throws SAXException
Export this entity in CDM-fr format.- Parameters:
contentHandler- the target handlerperson- the person- Throws:
SAXException- if an error occurs during export.
-
_getMentionType
private String _getMentionType(Program program)
-
_addNotNullAttribute
protected void _addNotNullAttribute(AttributesImpl attrs, String localName, String value)
SAX value as attributes if not null nor empty- Parameters:
attrs- the XML attributeslocalName- the local namevalue- the value
-
_addPositiveAttribute
protected void _addPositiveAttribute(AttributesImpl attrs, String localName, double value)
SAX value as attributes if not null nor empty- Parameters:
attrs- the XML attributeslocalName- the local namevalue- the value
-
-