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 class
OdfReferenceTableHelper.SortField
This class represents a sort field for reference table.
-
Field Summary
Fields Modifier and Type Field Description static String
ABSTRACT_MENTION
Mention licencestatic String
ABSTRACT_TABLE_REF
Abstract table refstatic String
ABSTRACT_TABLE_REF_CATEGORY
Abstract table ref for categorystatic String
APPRENTICESHIP_CONTRACT
Apprenticeship contractstatic String
AVAILABLE_CERTIFICATION
Available certificationstatic String
CAMPUS
Campusstatic String
CODE_CITE97
Code Cite97static String
CODE_DGESIP
Code DGESIPstatic String
CODE_ERASMUS
Code ERASMUSstatic String
CODE_ERASMUS_CATEGORY
Category for code Erasmusstatic String
CODE_FAP
Code FAPstatic String
CODE_FAP_CATEGORY
Category for code FAPstatic String
CODE_NSF
Code NSFstatic String
CODE_ROME
Code ROMEstatic String
CODE_SISE
Code SISEstatic String
CONTAINER_NATURE
Nature of containerstatic String
COURSE_NATURE
Nature of coursestatic String
DEGREE
Degreestatic String
DEGREE_MENTION_TYPE
Attribute name for mention type in table refe degreestatic String
DISCIPLINE
Disciplinestatic String
DISTANCE_LEARNING_MODALITIES
Distance learning modalitiesstatic String
DOMAIN
Domainstatic String
DURATION
Durationstatic String
ECTS
ECTSstatic String
ENSEIGNEMENT_NATURE
Nature of course partstatic String
ENSEIGNEMENT_NATURE_CATEGORY
Category of nature of course partstatic String
FOREIGN_PLACE
Foreign placestatic String
FORMOFTEACHING_METHOD
Form of teachingstatic String
FORMOFTEACHING_ORG
Orgnization of teachingstatic String
INTERNATIONAL_EDUCATION
International educationstatic String
INTERNSHIP
Type of training coursestatic String
JOIN_ORGUNIT
Join orgunitstatic String
LANGUAGE
Languagestatic String
LEVEL
Levelstatic String
MENTION_BUT
Mention BUTstatic String
MENTION_BUT_ATTRIBUTE_PARCOURS
Mention BUTstatic String
MENTION_LICENCE
Mention licencestatic String
MENTION_LICENCEPRO
Mention licence prostatic String
MENTION_MASTER
Mention masterstatic String
ORGUNIT_TYPE
OrgUnit typestatic String
PERIOD
Periodstatic String
PERIOD_TYPE
Period typestatic String
PERSON_ROLE
Person rolestatic String
PLACE
Placestatic String
PROGRAM_FIELD
Program fieldstatic String
PROGRAM_TYPE
Program type.static String
RNCP_LEVEL
RNCP levelstatic String
ROLE
Avalon Rolestatic String
SECTORS
Sectorsstatic String
SKILL
Skillstatic String
SKILL_SET
Skill setstatic String
TEACHING_ACTIVITY
Teaching methodstatic String
TEACHING_TERM
Teaching term.static String
TIME_SLOT
Time 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 aProgramItem
List<Map<String,String>>
getBUTParcoursItems(String contentId, String mentionId)
Get the available BUT training paths for a contentString
getCDMfrValue(String tableRefId, String code)
Get the CDM-fr value associated with the given codeOdfReferenceTableEntry
getItem(String contentId)
Returns the reference table entry from its CDM valueString
getItemCDMfrValue(String contentId, boolean returnCodeIfEmpty)
Returns the CMD value of an reference table entryString
getItemCDMfrValue(String tableRefId, String contentId, boolean returnCodeIfEmpty)
Deprecated.UsegetItemCDMfrValue(String, boolean)
insteadString
getItemCode(String contentId)
Returns the code of an reference table entry from its CDM valueString
getItemCode(String tableRefId, String contentId)
Deprecated.UsegetItemCode(String)
insteadString
getItemCodeFromCDM(String tableRefId, String cdmValue)
Returns the code of an reference table entry from its CDM valueOdfReferenceTableEntry
getItemFromApogee(String tableRefId, String codeApogee)
Returns the entry of a reference table entry from its code ApogeeOdfReferenceTableEntry
getItemFromCDM(String tableRefId, String cdmValue)
Returns the entry of an reference table entry from its cdmValueOdfReferenceTableEntry
getItemFromCode(String tableRefId, String code)
Returns the entry of an reference table entry from its codeString
getItemLabel(String contentId, String lang)
Returns the label of an reference table entryString
getItemLabel(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 degreeString
getMentionForDegree(String degreeId)
Get the mention for a given degree.String
getMentionType(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 referencesboolean
isBUTDiploma(Program program)
Determines if the program is a BUT diplomaboolean
isTableReference(String cTypeId)
Determines if the content type is a ODF table referenceboolean
isTableReferenceEntry(Content content)
Determines if the content is an entry of a ODF table referencevoid
saxItems(ContentHandler contentHandler, String tableRefId)
SAX items of a reference tablevoid
saxItems(ContentHandler contentHandler, String tableRefId, String lang)
SAX items of a reference tablevoid
saxItems(ContentHandler contentHandler, ContentAttributeDefinition attributeDefinition)
SAX items of a reference tablevoid
saxItems(ContentHandler contentHandler, ContentAttributeDefinition attributeDefinition, String lang)
SAX items of a reference tablevoid
service(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:
service
in 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:
true
if 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
null
if 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
null
if not found
-
getItemCDMfrValue
public String getItemCDMfrValue(String contentId, boolean returnCodeIfEmpty)
Returns the CMD value of an reference table entry- Parameters:
contentId
- The content idreturnCodeIfEmpty
-true
to 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
-true
to 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
null
if 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
null
if 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
null
if 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
null
if 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
OdfReferenceTableEntry
or 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 benull
then 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 benull
then odf language is used- Throws:
SAXException
- if an error occurs while saxing
-
-