Package org.ametys.odf.enumeration
Class OdfReferenceTableHelper
- java.lang.Object
-
- org.ametys.runtime.plugin.component.AbstractLogEnabled
-
- org.ametys.odf.enumeration.OdfReferenceTableHelper
-
- All Implemented Interfaces:
LogEnabled,Component,Serviceable
public class OdfReferenceTableHelper extends AbstractLogEnabled implements Component, Serviceable
This component handles ODF reference tables
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classOdfReferenceTableHelper.SortFieldThis class represents a sort field for reference table.
-
Field Summary
Fields Modifier and Type Field Description static StringABSTRACT_MENTIONMention licencestatic StringABSTRACT_TABLE_REFAbstract table refstatic StringABSTRACT_TABLE_REF_CATEGORYAbstract table ref for categorystatic StringAPPRENTICESHIP_CONTRACTApprenticeship contractstatic StringAVAILABLE_CERTIFICATIONAvailable certificationstatic StringCAMPUSCampusstatic StringCODE_CITE97Code Cite97static StringCODE_DGESIPCode DGESIPstatic StringCODE_ERASMUSCode ERASMUSstatic StringCODE_ERASMUS_CATEGORYCategory for code Erasmusstatic StringCODE_FAPCode FAPstatic StringCODE_FAP_CATEGORYCategory for code FAPstatic StringCODE_NSFCode NSFstatic StringCODE_ROMECode ROMEstatic StringCODE_SISECode SISEstatic StringCONTAINER_NATURENature of containerstatic StringCOURSE_NATURENature of coursestatic StringDEGREEDegreestatic StringDEGREE_MENTION_TYPEAttribute name for mention type in table refe degreestatic StringDISCIPLINEDisciplinestatic StringDISTANCE_LEARNING_MODALITIESDistance learning modalitiesstatic StringDOMAINDomainstatic StringDURATIONDurationstatic StringECTSECTSstatic StringENSEIGNEMENT_NATURENature of course partstatic StringENSEIGNEMENT_NATURE_CATEGORYCategory of nature of course partstatic StringFOREIGN_PLACEForeign placestatic StringFORMOFTEACHING_METHODForm of teachingstatic StringFORMOFTEACHING_ORGOrgnization of teachingstatic StringINTERNATIONAL_EDUCATIONInternational educationstatic StringINTERNSHIPType of training coursestatic StringJOIN_ORGUNITJoin orgunitstatic StringLANGUAGELanguagestatic StringLEVELLevelstatic StringMENTION_BUTMention BUTstatic StringMENTION_BUT_ATTRIBUTE_PARCOURSMention BUTstatic StringMENTION_LICENCEMention licencestatic StringMENTION_LICENCEPROMention licence prostatic StringMENTION_MASTERMention masterstatic StringORGUNIT_TYPEOrgUnit typestatic StringPERIODPeriodstatic StringPERIOD_TYPEPeriod typestatic StringPERSON_ROLEPerson rolestatic StringPLACEPlacestatic StringPROGRAM_FIELDProgram fieldstatic StringPROGRAM_TYPEProgram type.static StringRNCP_LEVELRNCP levelstatic StringROLEAvalon Rolestatic StringSECTORSSectorsstatic StringSKILLSkillstatic StringSKILL_SETSkill setstatic StringTEACHING_ACTIVITYTeaching methodstatic StringTEACHING_TERMTeaching term.static StringTIME_SLOTTime slot
-
Constructor Summary
Constructors Constructor Description OdfReferenceTableHelper()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description ContentValue[]getBUTParcoursForMention(String mentionId)Get the available BUT training paths for a BUT mentionContentValue[]getBUTParcoursItems(String programItemId)Get the available BUT training paths for aProgramItemList<Map<String,String>>getBUTParcoursItems(String contentId, String mentionId)Get the available BUT training paths for a contentStringgetCDMfrValue(String tableRefId, String code)Get the CDM-fr value associated with the given codeOdfReferenceTableEntrygetItem(String contentId)Returns the reference table entry from its CDM valueStringgetItemCDMfrValue(String contentId, boolean returnCodeIfEmpty)Returns the CMD value of an reference table entryStringgetItemCDMfrValue(String tableRefId, String contentId, boolean returnCodeIfEmpty)Deprecated.UsegetItemCDMfrValue(String, boolean)insteadStringgetItemCode(String contentId)Returns the code of an reference table entry from its CDM valueStringgetItemCode(String tableRefId, String contentId)Deprecated.UsegetItemCode(String)insteadStringgetItemCodeFromCDM(String tableRefId, String cdmValue)Returns the code of an reference table entry from its CDM valueOdfReferenceTableEntrygetItemFromApogee(String tableRefId, String codeApogee)Returns the entry of a reference table entry from its code ApogeeOdfReferenceTableEntrygetItemFromCDM(String tableRefId, String cdmValue)Returns the entry of an reference table entry from its cdmValueOdfReferenceTableEntrygetItemFromCode(String tableRefId, String code)Returns the entry of an reference table entry from its codeStringgetItemLabel(String contentId, String lang)Returns the label of an reference table entryStringgetItemLabel(String tableRefId, String contentId, String lang)Deprecated.UsegetItemLabel(String, String)insteadList<OdfReferenceTableEntry>getItems(String tableRefId)Get all items of an enumeration and their labelList<OdfReferenceTableEntry>getItems(String tableRefId, OdfReferenceTableHelper.SortField... sortFields)Get all items of an enumeration and their label, sorted by given fieldsMap<String,String>getMentionContentTypes(List<String> degreeIds)Get the content type for mention for this degreeStringgetMentionForDegree(String degreeId)Get the mention for a given degree.StringgetMentionType(Program program)Get the type of mention for a programMap<String,ContentAttributeDefinition>getTableRefAttributeDefinitions(String cTypeId)Get the attribute definitions for table references for a given content typeMap<String,ContentAttributeDefinition>getTableRefAttributeDefinitions(String cTypeId, String viewName)Get the attribute definitions for table references for a given content type and a viewSet<String>getTableReferenceIds()Get the id of table referencesbooleanisBUTDiploma(Program program)Determines if the program is a BUT diplomabooleanisTableReference(String cTypeId)Determines if the content type is a ODF table referencebooleanisTableReferenceEntry(Content content)Determines if the content is an entry of a ODF table referencevoidsaxItems(ContentHandler contentHandler, String tableRefId)SAX items of a reference tablevoidsaxItems(ContentHandler contentHandler, String tableRefId, String lang)SAX items of a reference tablevoidsaxItems(ContentHandler contentHandler, ContentAttributeDefinition attributeDefinition)SAX items of a reference tablevoidsaxItems(ContentHandler contentHandler, ContentAttributeDefinition attributeDefinition, String lang)SAX items of a reference tablevoidservice(ServiceManager manager)-
Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
-
-
-
Field Detail
-
ABSTRACT_TABLE_REF
public static final String ABSTRACT_TABLE_REF
Abstract table ref- See Also:
- Constant Field Values
-
DOMAIN
public static final String DOMAIN
Domain- See Also:
- Constant Field Values
-
DEGREE
public static final String DEGREE
Degree- See Also:
- Constant Field Values
-
LEVEL
public static final String LEVEL
Level- See Also:
- Constant Field Values
-
PROGRAM_TYPE
public static final String PROGRAM_TYPE
Program type.- See Also:
- Constant Field Values
-
FORMOFTEACHING_METHOD
public static final String FORMOFTEACHING_METHOD
Form of teaching- See Also:
- Constant Field Values
-
FORMOFTEACHING_ORG
public static final String FORMOFTEACHING_ORG
Orgnization of teaching- See Also:
- Constant Field Values
-
TEACHING_ACTIVITY
public static final String TEACHING_ACTIVITY
Teaching method- See Also:
- Constant Field Values
-
INTERNSHIP
public static final String INTERNSHIP
Type of training course- See Also:
- Constant Field Values
-
DISTANCE_LEARNING_MODALITIES
public static final String DISTANCE_LEARNING_MODALITIES
Distance learning modalities- See Also:
- Constant Field Values
-
PLACE
public static final String PLACE
Place- See Also:
- Constant Field Values
-
TEACHING_TERM
public static final String TEACHING_TERM
Teaching term.- See Also:
- Constant Field Values
-
TIME_SLOT
public static final String TIME_SLOT
Time slot- See Also:
- Constant Field Values
-
CODE_ROME
public static final String CODE_ROME
Code ROME- See Also:
- Constant Field Values
-
CODE_ERASMUS
public static final String CODE_ERASMUS
Code ERASMUS- See Also:
- Constant Field Values
-
CODE_DGESIP
public static final String CODE_DGESIP
Code DGESIP- See Also:
- Constant Field Values
-
CODE_SISE
public static final String CODE_SISE
Code SISE- See Also:
- Constant Field Values
-
CODE_CITE97
public static final String CODE_CITE97
Code Cite97- See Also:
- Constant Field Values
-
CODE_FAP
public static final String CODE_FAP
Code FAP- See Also:
- Constant Field Values
-
CODE_NSF
public static final String CODE_NSF
Code NSF- See Also:
- Constant Field Values
-
RNCP_LEVEL
public static final String RNCP_LEVEL
RNCP level- See Also:
- Constant Field Values
-
JOIN_ORGUNIT
public static final String JOIN_ORGUNIT
Join orgunit- See Also:
- Constant Field Values
-
ABSTRACT_MENTION
public static final String ABSTRACT_MENTION
Mention licence- See Also:
- Constant Field Values
-
MENTION_BUT
public static final String MENTION_BUT
Mention BUT- See Also:
- Constant Field Values
-
MENTION_BUT_ATTRIBUTE_PARCOURS
public static final String MENTION_BUT_ATTRIBUTE_PARCOURS
Mention BUT- See Also:
- Constant Field Values
-
MENTION_LICENCE
public static final String MENTION_LICENCE
Mention licence- See Also:
- Constant Field Values
-
MENTION_LICENCEPRO
public static final String MENTION_LICENCEPRO
Mention licence pro- See Also:
- Constant Field Values
-
MENTION_MASTER
public static final String MENTION_MASTER
Mention master- See Also:
- Constant Field Values
-
ABSTRACT_TABLE_REF_CATEGORY
public static final String ABSTRACT_TABLE_REF_CATEGORY
Abstract table ref for category- See Also:
- Constant Field Values
-
APPRENTICESHIP_CONTRACT
public static final String APPRENTICESHIP_CONTRACT
Apprenticeship contract- See Also:
- Constant Field Values
-
AVAILABLE_CERTIFICATION
public static final String AVAILABLE_CERTIFICATION
Available certification- See Also:
- Constant Field Values
-
CAMPUS
public static final String CAMPUS
Campus- See Also:
- Constant Field Values
-
CODE_ERASMUS_CATEGORY
public static final String CODE_ERASMUS_CATEGORY
Category for code Erasmus- See Also:
- Constant Field Values
-
CODE_FAP_CATEGORY
public static final String CODE_FAP_CATEGORY
Category for code FAP- See Also:
- Constant Field Values
-
CONTAINER_NATURE
public static final String CONTAINER_NATURE
Nature of container- See Also:
- Constant Field Values
-
COURSE_NATURE
public static final String COURSE_NATURE
Nature of course- See Also:
- Constant Field Values
-
DISCIPLINE
public static final String DISCIPLINE
Discipline- See Also:
- Constant Field Values
-
DURATION
public static final String DURATION
Duration- See Also:
- Constant Field Values
-
ECTS
public static final String ECTS
ECTS- See Also:
- Constant Field Values
-
FOREIGN_PLACE
public static final String FOREIGN_PLACE
Foreign place- See Also:
- Constant Field Values
-
INTERNATIONAL_EDUCATION
public static final String INTERNATIONAL_EDUCATION
International education- See Also:
- Constant Field Values
-
LANGUAGE
public static final String LANGUAGE
Language- See Also:
- Constant Field Values
-
ORGUNIT_TYPE
public static final String ORGUNIT_TYPE
OrgUnit type- See Also:
- Constant Field Values
-
PERIOD
public static final String PERIOD
Period- See Also:
- Constant Field Values
-
PERIOD_TYPE
public static final String PERIOD_TYPE
Period type- See Also:
- Constant Field Values
-
PERSON_ROLE
public static final String PERSON_ROLE
Person role- See Also:
- Constant Field Values
-
PROGRAM_FIELD
public static final String PROGRAM_FIELD
Program field- See Also:
- Constant Field Values
-
SECTORS
public static final String SECTORS
Sectors- See Also:
- Constant Field Values
-
ENSEIGNEMENT_NATURE
public static final String ENSEIGNEMENT_NATURE
Nature of course part- See Also:
- Constant Field Values
-
ENSEIGNEMENT_NATURE_CATEGORY
public static final String ENSEIGNEMENT_NATURE_CATEGORY
Category of nature of course part- See Also:
- Constant Field Values
-
SKILL
public static final String SKILL
Skill- See Also:
- Constant Field Values
-
SKILL_SET
public static final String SKILL_SET
Skill set- See Also:
- Constant Field Values
-
DEGREE_MENTION_TYPE
public static final String DEGREE_MENTION_TYPE
Attribute name for mention type in table refe degree- See Also:
- Constant Field Values
-
-
Constructor Detail
-
OdfReferenceTableHelper
public OdfReferenceTableHelper()
-
-
Method Detail
-
service
public void service(ServiceManager manager) throws ServiceException
- Specified by:
servicein interfaceServiceable- Throws:
ServiceException
-
isTableReference
public boolean isTableReference(String cTypeId)
Determines if the content type is a ODF table reference- Parameters:
cTypeId- The id of content type- Returns:
- true if the content type is a ODF table reference
-
isTableReferenceEntry
public boolean isTableReferenceEntry(Content content)
Determines if the content is an entry of a ODF table reference- Parameters:
content- The content- Returns:
trueif the content is an entry of a ODF table reference
-
getTableReferenceIds
public Set<String> getTableReferenceIds()
Get the id of table references- Returns:
- The content type's id
-
getTableRefAttributeDefinitions
public Map<String,ContentAttributeDefinition> getTableRefAttributeDefinitions(String cTypeId)
Get the attribute definitions for table references for a given content type- Parameters:
cTypeId- The id of content type- Returns:
- The attribute definitions for table references
-
getTableRefAttributeDefinitions
public Map<String,ContentAttributeDefinition> getTableRefAttributeDefinitions(String cTypeId, String viewName)
Get the attribute definitions for table references for a given content type and a view- Parameters:
cTypeId- The id of content typeviewName- the name of the view. Cannot be null.- Returns:
- The attributes definitions for table references
-
getMentionContentTypes
public Map<String,String> getMentionContentTypes(List<String> degreeIds)
Get the content type for mention for this degree- Parameters:
degreeIds- The ids of degrees- Returns:
- A map with the id of content type or null if there is no mention for this degree
-
getBUTParcoursForMention
public ContentValue[] getBUTParcoursForMention(String mentionId)
Get the available BUT training paths for a BUT mention- Parameters:
mentionId- the id of BUT mention- Returns:
- the BUT training paths
-
getBUTParcoursItems
public List<Map<String,String>> getBUTParcoursItems(String contentId, String mentionId)
Get the available BUT training paths for a content- Parameters:
contentId- the content's idmentionId- the id of mention. Can be null or empty- Returns:
- the available BUT training paths
-
getBUTParcoursItems
public ContentValue[] getBUTParcoursItems(String programItemId)
Get the available BUT training paths for aProgramItem- Parameters:
programItemId- the id of program item- Returns:
- the BUT training paths
-
isBUTDiploma
public boolean isBUTDiploma(Program program)
Determines if the program is a BUT diploma- Parameters:
program- the program- Returns:
- true if the program has a BUT
-
getMentionType
public String getMentionType(Program program)
Get the type of mention for a program- Parameters:
program- the program- Returns:
- the type of mention or null if there is no mention for this program
-
getMentionForDegree
public String getMentionForDegree(String degreeId)
Get the mention for a given degree.- Parameters:
degreeId- The degree ID- Returns:
- The associated mention reference table, null if there isn't
-
getCDMfrValue
public String getCDMfrValue(String tableRefId, String code)
Get the CDM-fr value associated with the given code- Parameters:
tableRefId- The id of content typecode- The code- Returns:
- The CDM-fr value or empty string if not found
-
getItems
public List<OdfReferenceTableEntry> getItems(String tableRefId)
Get all items of an enumeration and their label- Parameters:
tableRefId- The id of content type- Returns:
- items of enumeration
-
getItems
public List<OdfReferenceTableEntry> getItems(String tableRefId, OdfReferenceTableHelper.SortField... sortFields)
Get all items of an enumeration and their label, sorted by given fields- Parameters:
tableRefId- The id of content typesortFields- The sort fields to order results- Returns:
- items of enumeration
-
getItemLabel
public String getItemLabel(String contentId, String lang)
Returns the label of an reference table entry- Parameters:
contentId- The content idlang- The requested language of label- Returns:
- the item label or
nullif not found
-
getItemLabel
@Deprecated public String getItemLabel(String tableRefId, String contentId, String lang)
Deprecated.UsegetItemLabel(String, String)insteadReturns the label of an reference table entry- Parameters:
tableRefId- The id of content type (useless)contentId- The content idlang- The requested language of label- Returns:
- the item label or
nullif not found
-
getItemCDMfrValue
public String getItemCDMfrValue(String contentId, boolean returnCodeIfEmpty)
Returns the CMD value of an reference table entry- Parameters:
contentId- The content idreturnCodeIfEmpty-trueto return the code if CDM-fr value is empty- Returns:
- the CDM-fr value or empty value if not found
-
getItemCDMfrValue
@Deprecated public String getItemCDMfrValue(String tableRefId, String contentId, boolean returnCodeIfEmpty)
Deprecated.UsegetItemCDMfrValue(String, boolean)insteadReturns the CMD value of an reference table entry- Parameters:
tableRefId- The id of content type (useless)contentId- The content idreturnCodeIfEmpty-trueto return the code if CDM-fr value is empty- Returns:
- the CDM-fr value or empty value if not found
-
getItemCode
public String getItemCode(String contentId)
Returns the code of an reference table entry from its CDM value- Parameters:
contentId- The id of content- Returns:
- the code or empty value if not found
-
getItemCode
@Deprecated public String getItemCode(String tableRefId, String contentId)
Deprecated.UsegetItemCode(String)insteadReturns the code of an reference table entry from its CDM value- Parameters:
tableRefId- The id of content type (useless)contentId- The id of content- Returns:
- the code or empty value if not found
-
getItemCodeFromCDM
public String getItemCodeFromCDM(String tableRefId, String cdmValue)
Returns the code of an reference table entry from its CDM value- Parameters:
tableRefId- The id of content typecdmValue- The CDM-fr value- Returns:
- the code or
nullif not found
-
getItemFromCDM
public OdfReferenceTableEntry getItemFromCDM(String tableRefId, String cdmValue)
Returns the entry of an reference table entry from its cdmValue- Parameters:
tableRefId- The id of content typecdmValue- The CDM-fr value- Returns:
- the entry or
nullif not found
-
getItemFromCode
public OdfReferenceTableEntry getItemFromCode(String tableRefId, String code)
Returns the entry of an reference table entry from its code- Parameters:
tableRefId- The id of content typecode- The code- Returns:
- the entry or
nullif not found
-
getItemFromApogee
public OdfReferenceTableEntry getItemFromApogee(String tableRefId, String codeApogee)
Returns the entry of a reference table entry from its code Apogee- Parameters:
tableRefId- The id of content typecodeApogee- The Apogee code- Returns:
- the entry or
nullif not found
-
getItem
public OdfReferenceTableEntry getItem(String contentId)
Returns the reference table entry from its CDM value- Parameters:
contentId- The id of content- Returns:
- the item as an
OdfReferenceTableEntryor null if not found
-
saxItems
public void saxItems(ContentHandler contentHandler, String tableRefId) throws SAXException
SAX items of a reference table- Parameters:
contentHandler- The content handler to sax intotableRefId- The id of reference table- Throws:
SAXException- if an error occurred while saxing
-
saxItems
public void saxItems(ContentHandler contentHandler, ContentAttributeDefinition attributeDefinition) throws SAXException
SAX items of a reference table- Parameters:
contentHandler- the content handler to sax intoattributeDefinition- the metadata definition- Throws:
SAXException- if an error occurs while saxing
-
saxItems
public void saxItems(ContentHandler contentHandler, String tableRefId, String lang) throws SAXException
SAX items of a reference table- Parameters:
contentHandler- The content handler to sax intotableRefId- The id of reference tablelang- the language to use to display items, can benullthen odf language is used- Throws:
SAXException- if an error occurred while saxing
-
saxItems
public void saxItems(ContentHandler contentHandler, ContentAttributeDefinition attributeDefinition, String lang) throws SAXException
SAX items of a reference table- Parameters:
contentHandler- the content handler to sax intoattributeDefinition- the metadata definitionlang- the language to use to display items, can benullthen odf language is used- Throws:
SAXException- if an error occurs while saxing
-
-