public class OdfReferenceTableHelper extends AbstractLogEnabled implements Component, Serviceable
Modifier and Type | Field and Description |
---|---|
private ContentTypeExtensionPoint |
_cTypeEP |
private ContentTypesHelper |
_cTypeHelper |
private AmetysObjectResolver |
_resolver |
static String |
ABSTRACT_MENTION
Mention licence
|
static String |
ABSTRACT_TABLE_REF
Abstract table ref
|
static String |
ABSTRACT_TABLE_REF_CATEGORY
Abstract table ref for category
|
static String |
APPRENTICESHIP_CONTRACT
Apprenticeship contract
|
static String |
AVAILABLE_CERTIFICATION
Available certification
|
static String |
CAMPUS
Campus
|
static String |
CODE_CITE97
Code Cite97
|
static String |
CODE_DGESIP
Code DGESIP
|
static String |
CODE_ERASMUS
Code ERASMUS
|
static String |
CODE_ERASMUS_CATEGORY
Category for code Erasmus
|
static String |
CODE_FAP
Code FAP
|
static String |
CODE_FAP_CATEGORY
Category for code FAP
|
static String |
CODE_NSF
Code NSF
|
static String |
CODE_ROME
Code ROME
|
static String |
CODE_SISE
Code SISE
|
static String |
CONTAINER_NATURE
Nature of container
|
static String |
COURSE_NATURE
Nature of course
|
static String |
DEGREE
Degree
|
static String |
DISCIPLINE
Discipline
|
static String |
DISTANCE_LEARNING_MODALITIES
Distance learning modalities
|
static String |
DOMAIN
Domain
|
static String |
DURATION
Duration
|
static String |
ECTS
ECTS
|
static String |
FOREIGN_PLACE
Foreign place
|
static String |
FORMOFTEACHING_METHOD
Form of teaching
|
static String |
FORMOFTEACHING_ORG
Orgnization of teaching
|
static String |
INTERNATIONAL_EDUCATION
International education
|
static String |
INTERNSHIP
Type of training course
|
static String |
JOIN_ORGUNIT
Join orgunit
|
static String |
LANGUAGE
Language
|
static String |
LEVEL
Level
|
static String |
MENTION_LICENCE
Mention licence
|
static String |
MENTION_LICENCEPRO
Mention licence pro
|
static String |
MENTION_MASTER
Mention master
|
static String |
ORGUNIT_TYPE
OrgUnit type
|
static String |
PERIOD
Period
|
static String |
PERSON_ROLE
Person role
|
static String |
PLACE
Place
|
static String |
PROGRAM_FIELD
Program field
|
static String |
PROGRAM_TYPE
Program type.
|
static String |
RNCP_LEVEL
RNCP level
|
static String |
ROLE
Avalon Role
|
static String |
SECTORS
Sectors
|
static String |
TEACHING_ACTIVITY
Teaching method
|
static String |
TEACHING_TERM
Teaching term.
|
static String |
TIME_SLOT
Time slot
|
Constructor and Description |
---|
OdfReferenceTableHelper() |
Modifier and Type | Method and Description |
---|---|
private Map<String,MetadataDefinition> |
_getTableRefMetadata(AbstractMetadataSetElement element,
MetadataDefinitionHolder parentMetaDef,
String prefix) |
private Map<String,MetadataDefinition> |
_getTableRefMetadata(MetadataDefinitionHolder parentMetaDef,
String prefix) |
private void |
_saxItems(ContentHandler contentHandler,
AttributesImpl rootAttrs,
String tableRefId) |
String |
getCDMfrValue(String tableRefIf,
String code)
Get the CDM-fr value associated with the given code
|
String |
getItemCDMfrValue(String tableRefId,
String contentId,
boolean returnCodeIfEmpty)
Returns the CMD value of an reference table entry
|
String |
getItemCode(String tableRefId,
String contentId)
Returns the code of an reference table entry from its CDM value
|
String |
getItemCodeFromCDM(String tableRefId,
String cdmValue)
Returns the code of an reference table entry from its CDM value
|
OdfReferenceTableEntry |
getItemFromCDM(String tableRefId,
String cdmValue)
Returns the entry of an reference table entry from its cdmValue
|
OdfReferenceTableEntry |
getItemFromCode(String tableRefId,
String code)
Returns the entry of an reference table entry from its code
|
String |
getItemLabel(String tableRefId,
String contentId,
String lang)
Returns the label of an reference table entry
|
List<OdfReferenceTableEntry> |
getItems(String tableRefId)
Get all items of an enumeration and their label
|
Map<String,String> |
getMentionContentTypes(List<String> degreeIds)
Get the content type for mention for this degree
|
Set<String> |
getTableReferenceIds()
Get the id of table references
|
Map<String,MetadataDefinition> |
getTableRefMetadataDefinition(String cTypeId)
Get the metadata definitions for table references for a given content type
|
Map<String,MetadataDefinition> |
getTableRefMetadataDefinition(String cTypeId,
String medatataSetName,
boolean isEditionMetadataSet)
Get the metadata definitions for table references for a given content type and a metadata set
|
boolean |
isTableReference(String cTypeId)
Determines if the content type is a ODF table reference
|
boolean |
isTableReferenceEntry(Content content)
Determines if the content is an entry of a ODF table reference
|
void |
saxItems(ContentHandler contentHandler,
MetadataDefinition metaDef)
SAX items of a reference table
|
void |
saxItems(ContentHandler contentHandler,
String tableRefId)
SAX items of a reference table
|
void |
service(ServiceManager manager) |
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
public static final String ABSTRACT_TABLE_REF
public static final String DOMAIN
public static final String DEGREE
public static final String LEVEL
public static final String PROGRAM_TYPE
public static final String FORMOFTEACHING_METHOD
public static final String FORMOFTEACHING_ORG
public static final String TEACHING_ACTIVITY
public static final String INTERNSHIP
public static final String DISTANCE_LEARNING_MODALITIES
public static final String PLACE
public static final String TEACHING_TERM
public static final String TIME_SLOT
public static final String CODE_ROME
public static final String CODE_ERASMUS
public static final String CODE_DGESIP
public static final String CODE_SISE
public static final String CODE_CITE97
public static final String CODE_FAP
public static final String CODE_NSF
public static final String RNCP_LEVEL
public static final String JOIN_ORGUNIT
public static final String ABSTRACT_MENTION
public static final String MENTION_LICENCE
public static final String MENTION_LICENCEPRO
public static final String MENTION_MASTER
public static final String ABSTRACT_TABLE_REF_CATEGORY
public static final String APPRENTICESHIP_CONTRACT
public static final String AVAILABLE_CERTIFICATION
public static final String CAMPUS
public static final String CODE_ERASMUS_CATEGORY
public static final String CODE_FAP_CATEGORY
public static final String CONTAINER_NATURE
public static final String COURSE_NATURE
public static final String DISCIPLINE
public static final String DURATION
public static final String ECTS
public static final String FOREIGN_PLACE
public static final String INTERNATIONAL_EDUCATION
public static final String LANGUAGE
public static final String ORGUNIT_TYPE
public static final String PERIOD
public static final String PERSON_ROLE
public static final String PROGRAM_FIELD
public static final String SECTORS
private AmetysObjectResolver _resolver
private ContentTypeExtensionPoint _cTypeEP
private ContentTypesHelper _cTypeHelper
public OdfReferenceTableHelper()
public void service(ServiceManager manager) throws ServiceException
service
in interface Serviceable
ServiceException
public boolean isTableReference(String cTypeId)
cTypeId
- The id of content typepublic boolean isTableReferenceEntry(Content content)
content
- The contenttrue
if the content is an entry of a ODF table referencepublic Set<String> getTableReferenceIds()
public Map<String,MetadataDefinition> getTableRefMetadataDefinition(String cTypeId)
cTypeId
- The id of content typepublic Map<String,MetadataDefinition> getTableRefMetadataDefinition(String cTypeId, String medatataSetName, boolean isEditionMetadataSet)
cTypeId
- The id of content typemedatataSetName
- the name of the metadata set. Cannot be null.isEditionMetadataSet
- true if the metadata set is for edition.private Map<String,MetadataDefinition> _getTableRefMetadata(MetadataDefinitionHolder parentMetaDef, String prefix)
private Map<String,MetadataDefinition> _getTableRefMetadata(AbstractMetadataSetElement element, MetadataDefinitionHolder parentMetaDef, String prefix)
public Map<String,String> getMentionContentTypes(List<String> degreeIds)
degreeIds
- The ids of degreespublic String getCDMfrValue(String tableRefIf, String code)
tableRefIf
- The id of content typecode
- The codepublic List<OdfReferenceTableEntry> getItems(String tableRefId)
tableRefId
- The id of content typepublic String getItemLabel(String tableRefId, String contentId, String lang)
tableRefId
- The id of content typecontentId
- The content idlang
- The requested language of labelnull
if not foundpublic String getItemCDMfrValue(String tableRefId, String contentId, boolean returnCodeIfEmpty)
tableRefId
- The id of content typecontentId
- The content idreturnCodeIfEmpty
- true
to return the code if CDM-fr value is emptypublic String getItemCode(String tableRefId, String contentId)
tableRefId
- The id of content typecontentId
- The id of contentpublic String getItemCodeFromCDM(String tableRefId, String cdmValue)
tableRefId
- The id of content typecdmValue
- The CDM-fr valuenull
if not foundpublic OdfReferenceTableEntry getItemFromCDM(String tableRefId, String cdmValue)
tableRefId
- The id of content typecdmValue
- The CDM-fr valuenull
if not foundpublic OdfReferenceTableEntry getItemFromCode(String tableRefId, String code)
tableRefId
- The id of content typecode
- The codenull
if not foundpublic void saxItems(ContentHandler contentHandler, String tableRefId) throws SAXException
contentHandler
- The content handler to sax intotableRefId
- The id of reference tableSAXException
- if an error occurred while saxingpublic void saxItems(ContentHandler contentHandler, MetadataDefinition metaDef) throws SAXException
contentHandler
- the content handler to sax intometaDef
- the metadata definitionSAXException
- if an error occurs while saxingprivate void _saxItems(ContentHandler contentHandler, AttributesImpl rootAttrs, String tableRefId) throws SAXException
SAXException