Class AbstractImportCDMFrComponent
- java.lang.Object
-
- org.ametys.plugins.odfsync.cdmfr.components.AbstractImportCDMFrComponent
-
- All Implemented Interfaces:
ImportCDMFrComponent
,Initializable
,Component
,Configurable
,Contextualizable
,Serviceable
- Direct Known Subclasses:
RemoteImportCDMFrComponent
,SCCImportCDMFrComponent
public abstract class AbstractImportCDMFrComponent extends Object implements ImportCDMFrComponent, Serviceable, Initializable, Contextualizable, Configurable, Component
Abstract class of a component to import a CDM-fr input stream.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
AbstractImportCDMFrComponent.ContentWorkflowDescription
Internal object to describe content workflow elements.private static class
AbstractImportCDMFrComponent.DocbookPrefixResolver
-
Field Summary
-
Fields inherited from interface org.ametys.plugins.odfsync.cdmfr.components.ImportCDMFrComponent
ROLE
-
-
Constructor Summary
Constructors Constructor Description AbstractImportCDMFrComponent()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description private Set<String>
_configureSynchronizedFields(Configuration configuration, String prefix)
private void
_fetchImages(Node docbookNode, ModifiableDefaultContent content, ModifiableRichText richText, String metadataPath, org.slf4j.Logger logger)
protected ModifiableDefaultContent
_getContent(String lang, String catalog, String syncCode, AbstractImportCDMFrComponent.ContentWorkflowDescription wfDescription)
Get the content from the synchronization code, the lang, the catalog and the content type.protected String
_getIdFromCDMThenCode(String tableRefId, String cdmCode)
Get the content ID from the CDM code, if there is no match with the CDM code, then we search with the code.protected ModifiableDefaultContent
_getOrCreateContent(String title, String lang, String catalog, String syncCode, AbstractImportCDMFrComponent.ContentWorkflowDescription wfDescription, org.slf4j.Logger logger)
Get or create the content from the synchronization code, the lang, the catalog and the content type.private String
_getXPathString(Node metadataNode, String xPath, String defaultValue)
protected boolean
_handleBinaryMetadata(Node metadataNode, ModifiableDefaultContent content, String completeMetadataPath, boolean synchronize, org.slf4j.Logger logger)
Synchronize binary metadataprotected boolean
_handleBinaryMetadata(Node metadataNode, ModifiableDefaultContent content, ModifiableCompositeMetadata metadataHolder, String metadataName, boolean synchronize, org.slf4j.Logger logger)
Synchronize binary metadataprivate boolean
_handleCompositeMetadata(Document doc, Node metadataNode, ModifiableDefaultContent content, String logicalMetadataPath, String completeMetadataPath, ContentType contentType, String lang, String catalog, org.slf4j.Logger logger)
protected boolean
_handleFileMetadata(Node metadataNode, ModifiableDefaultContent content, String logicalMetadataPath, String completeMetadataPath, boolean synchronize, ContentType contentType, org.slf4j.Logger logger)
Synchronize file metadataprotected boolean
_handleFileMetadata(Node metadataNode, ModifiableDefaultContent content, String logicalMetadataPath, ModifiableCompositeMetadata metadataHolder, String metadataName, boolean synchronize, ContentType contentType, org.slf4j.Logger logger)
Synchronize file metadataprotected boolean
_handleGeocodeMetadata(Node metadataNode, ModifiableDefaultContent content, String completeMetadataPath, boolean synchronize)
Synchronize geocode metadataprotected boolean
_handleGeocodeMetadata(Node metadataNode, ModifiableDefaultContent content, ModifiableCompositeMetadata metadataHolder, String metadataName, boolean synchronize)
Synchronize geocode metadataprotected List<Object>
_handleMetadataValues(Document doc, ModifiableDefaultContent content, MetadataDefinition metadataDef, List<String> untypedValues, String lang, String catalog, org.slf4j.Logger logger)
Handle metadata valuesprivate Object
_handleMetadataValuesAsContent(Document doc, MetadataDefinition metadataDef, String metadataValue, String lang, String catalog, org.slf4j.Logger logger)
private boolean
_handleRepeaterMetadata(Document doc, Node metadataNode, ModifiableDefaultContent content, String logicalMetadataPath, String completeMetadataPath, ContentType contentType, String lang, String catalog, org.slf4j.Logger logger)
private boolean
_handleRichTextMetadata(ModifiableDefaultContent content, String logicalMetadataPath, String completeMetadataPath, Node metadataNode, boolean synchronize, org.slf4j.Logger logger)
protected ModifiableDefaultContent
_importOrSynchronizeContent(Document doc, Node contentNode, AbstractImportCDMFrComponent.ContentWorkflowDescription wfDescription, String title, String lang, String catalog, String syncCode, org.slf4j.Logger logger)
Import or synchronize the content.protected void
_linkTranslationsIfExist(ModifiableContent importedContent, String contentType)
Search for translated contentsprivate void
_parseSynchronizedFields()
Get the synchronized metadata from the configuration fileprotected void
_saveContentChanges(ModifiableDefaultContent content, String contentTypeId, boolean hasChanges, org.slf4j.Logger logger)
Save the changes of the content.protected boolean
_setChildren(ModifiableDefaultContent content, List<ModifiableDefaultContent> children, org.slf4j.Logger logger)
Set children for the given content.protected boolean
_setOrgUnitParent(ModifiableDefaultContent orgUnit, org.slf4j.Logger logger)
Set the orgUnit parent to rootOrgUnit.protected boolean
_setRelations(ModifiableDefaultContent content, List<ModifiableDefaultContent> children, List<ModifiableDefaultContent> courseParts, boolean removeOldCourseParts, org.slf4j.Logger logger)
Set relations for the content.protected void
_synchronizeContent(Document doc, Node contentNode, ModifiableDefaultContent content, String contentTypeId, String lang, String catalog, String syncCode, org.slf4j.Logger logger)
Synchronize contentprotected void
_synchronizeCourseList(Document doc, Node courseListNode, ModifiableDefaultContent courseList, String lang, String catalog, org.slf4j.Logger logger)
Synchronize a course list, it has attributes to synchronize.protected boolean
_synchronizeMetadata(Document doc, Node metadataNode, ModifiableDefaultContent content, String logicalMetadataPath, String completeMetadataPath, ContentType contentType, String lang, String catalog, org.slf4j.Logger logger)
Synchronize a metadata (can be a composite or a repeater).private boolean
_updateDoubleRelation(ModifiableDefaultContent content, List<ModifiableDefaultContent> children, String metadataName, String invertMetadataName, org.slf4j.Logger logger)
protected abstract void
additionalOperationsBeforeSave(ModifiableDefaultContent content, org.slf4j.Logger logger)
Additional operation to do on the content before saving it.protected abstract void
additionalParameters(Map<String,Object> parameters)
Additional parameters for specific treatments.void
configure(Configuration configuration)
void
contextualize(Context context)
protected String
getCatalogName(Node contentNode)
Get the name of catalog to use for importprotected AbstractImportCDMFrComponent.ContentWorkflowDescription
getContainerWfDescription()
Get the container workflow description.protected AbstractImportCDMFrComponent.ContentWorkflowDescription
getCourseListWfDescription()
Get the course list workflow description.protected AbstractImportCDMFrComponent.ContentWorkflowDescription
getCoursePartWfDescription()
Get the course part workflow description.protected AbstractImportCDMFrComponent.ContentWorkflowDescription
getCourseWfDescription()
Get the course workflow description.List<Expression>
getExpressionsList(String lang, String idValue, String contentType, String catalog)
Construct the query to retrieve the content.String
getIdField()
Return the metadata identifier for CDM-fr synchronization.Set<String>
getLocalAndExternalFields(Map<String,Object> additionalParameters)
Get the path of tri-state fields (with local and external values)protected AbstractImportCDMFrComponent.ContentWorkflowDescription
getOrgUnitWfDescription()
Get the orgunit workflow description.protected AbstractImportCDMFrComponent.ContentWorkflowDescription
getPersonWfDescription()
Get the person workflow description.protected AbstractImportCDMFrComponent.ContentWorkflowDescription
getProgramWfDescription()
Get the program workflow description.protected AbstractImportCDMFrComponent.ContentWorkflowDescription
getSubProgramWfDescription()
Get the subprogram workflow description.Map<String,Object>
handleInputStream(InputStream input, Map<String,Object> parameters, org.slf4j.Logger logger)
Handle the CDM-fr input stream to import all the programs and its dependencies containing into it.protected boolean
ignoreRights()
If true, bypass the rights check during the import processvoid
initialize()
protected abstract boolean
removalSync()
When returns true, a content created by a previous synchro will be removed if it does not exist anymore during the current synchro.void
service(ServiceManager manager)
protected Document
transformDocument(Document document, Map<String,Object> parameters, org.slf4j.Logger logger)
Transform the document depending of it structure.protected abstract boolean
validateAfterImport()
True to validate the contents after import
-
-
-
Field Detail
-
_TAG_PROGRAM
protected static final String _TAG_PROGRAM
Tag to identify a program- See Also:
- Constant Field Values
-
_TAG_SUBPROGRAM
protected static final String _TAG_SUBPROGRAM
Tag to identify a subprogram- See Also:
- Constant Field Values
-
_TAG_CONTAINER
protected static final String _TAG_CONTAINER
Tag to identify a container- See Also:
- Constant Field Values
-
_TAG_COURSELIST
protected static final String _TAG_COURSELIST
Tag to identify a courseList- See Also:
- Constant Field Values
-
_TAG_COURSEPART
protected static final String _TAG_COURSEPART
Tag to identify a coursePart- See Also:
- Constant Field Values
-
SYNCHRONIZE_WORKFLOW_ACTION_ID
private static final int SYNCHRONIZE_WORKFLOW_ACTION_ID
The synchronize workflow action id- See Also:
- Constant Field Values
-
_PROGRAM_WF_DESCRIPTION
private static final AbstractImportCDMFrComponent.ContentWorkflowDescription _PROGRAM_WF_DESCRIPTION
-
_SUBPROGRAM_WF_DESCRIPTION
private static final AbstractImportCDMFrComponent.ContentWorkflowDescription _SUBPROGRAM_WF_DESCRIPTION
-
_CONTAINER_WF_DESCRIPTION
private static final AbstractImportCDMFrComponent.ContentWorkflowDescription _CONTAINER_WF_DESCRIPTION
-
_COURSELIST_WF_DESCRIPTION
private static final AbstractImportCDMFrComponent.ContentWorkflowDescription _COURSELIST_WF_DESCRIPTION
-
_COURSE_WF_DESCRIPTION
private static final AbstractImportCDMFrComponent.ContentWorkflowDescription _COURSE_WF_DESCRIPTION
-
_COURSEPART_WF_DESCRIPTION
private static final AbstractImportCDMFrComponent.ContentWorkflowDescription _COURSEPART_WF_DESCRIPTION
-
_ORGUNIT_WF_DESCRIPTION
private static final AbstractImportCDMFrComponent.ContentWorkflowDescription _ORGUNIT_WF_DESCRIPTION
-
_PERSON_WF_DESCRIPTION
private static final AbstractImportCDMFrComponent.ContentWorkflowDescription _PERSON_WF_DESCRIPTION
-
_PREFIX_RESOLVER
private static final PrefixResolver _PREFIX_RESOLVER
-
_cocoonContext
protected Context _cocoonContext
The Cocoon context
-
_domParser
protected DOMParser _domParser
The DOM parser
-
_xPathProcessor
protected XPathProcessor _xPathProcessor
The XPath processor
-
_cdmFrSyncExtensionPoint
protected CDMFrSyncExtensionPoint _cdmFrSyncExtensionPoint
Extension point to transform CDM-fr
-
_catalogsManager
protected CatalogsManager _catalogsManager
The catalog manager
-
_resolver
protected AmetysObjectResolver _resolver
The ametys object resolver
-
_odfRefTableHelper
protected OdfReferenceTableHelper _odfRefTableHelper
The ODF TableRef Helper
-
_contentTypeEP
protected ContentTypeExtensionPoint _contentTypeEP
The content type extension point
-
_currentUserProvider
protected CurrentUserProvider _currentUserProvider
The current user provider
-
_observationManager
protected ObservationManager _observationManager
The observation manager
-
_rootOUProvider
protected RootOrgUnitProvider _rootOUProvider
The root orgunit provider
-
_synchroComponent
protected BaseSynchroComponent _synchroComponent
The base SCC component
-
_shareableCourseHelper
protected ShareableCourseHelper _shareableCourseHelper
The shareable course helper
-
_importedContents
protected Map<String,Integer> _importedContents
List of synchronized contents
-
_synchronizedContents
protected Set<String> _synchronizedContents
List of synchronized contents having differences
-
_updatedContents
protected Set<String> _updatedContents
List of synchronized contents (to avoid a treatment twice or more)
-
_nbError
protected int _nbError
Number of errors encountered
-
_nbCreatedContents
protected int _nbCreatedContents
Number of created contents
-
_nbSynchronizedContents
protected int _nbSynchronizedContents
Number of synchronized contents
-
_nbNotChangedContents
protected int _nbNotChangedContents
Number of unchanged contents
-
_contentPrefix
protected String _contentPrefix
The prefix of the contents
-
_syncFieldsByContentType
protected Map<String,Set<String>> _syncFieldsByContentType
Synchronized fields by content type
-
-
Constructor Detail
-
AbstractImportCDMFrComponent
public AbstractImportCDMFrComponent()
-
-
Method Detail
-
initialize
public void initialize() throws Exception
- Specified by:
initialize
in interfaceInitializable
- Throws:
Exception
-
contextualize
public void contextualize(Context context) throws ContextException
- Specified by:
contextualize
in interfaceContextualizable
- Throws:
ContextException
-
configure
public void configure(Configuration configuration) throws ConfigurationException
- Specified by:
configure
in interfaceConfigurable
- Throws:
ConfigurationException
-
service
public void service(ServiceManager manager) throws ServiceException
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
getIdField
public String getIdField()
Description copied from interface:ImportCDMFrComponent
Return the metadata identifier for CDM-fr synchronization.- Specified by:
getIdField
in interfaceImportCDMFrComponent
- Returns:
- The metadata name (cdmfrSyncCode)
-
_parseSynchronizedFields
private void _parseSynchronizedFields() throws ConfigurationException
Get the synchronized metadata from the configuration file- Throws:
ConfigurationException
- if the configuration is not valid.
-
_configureSynchronizedFields
private Set<String> _configureSynchronizedFields(Configuration configuration, String prefix) throws ConfigurationException
- Throws:
ConfigurationException
-
handleInputStream
public Map<String,Object> handleInputStream(InputStream input, Map<String,Object> parameters, org.slf4j.Logger logger) throws ProcessingException
Description copied from interface:ImportCDMFrComponent
Handle the CDM-fr input stream to import all the programs and its dependencies containing into it.- Specified by:
handleInputStream
in interfaceImportCDMFrComponent
- Parameters:
input
- The CDM-fr input streamparameters
- The parameters useful for the operationlogger
- The logger- Returns:
- The list of imported/synchronized programs
- Throws:
ProcessingException
- If an error occurs
-
validateAfterImport
protected abstract boolean validateAfterImport()
True to validate the contents after import- Returns:
- True to validate the contents after import
-
removalSync
protected abstract boolean removalSync()
When returns true, a content created by a previous synchro will be removed if it does not exist anymore during the current synchro.- Returns:
- true if a content created by a previous synchro has to be removed if it does not exist anymore during the current synchro.
-
transformDocument
protected Document transformDocument(Document document, Map<String,Object> parameters, org.slf4j.Logger logger) throws IOException, SAXException, ProcessingException
Transform the document depending of it structure.- Parameters:
document
- Document to transform.parameters
- Optional parameters for transformationlogger
- The logger- Returns:
- The transformed document.
- Throws:
IOException
- if an error occurs.SAXException
- if an error occurs.ProcessingException
- if an error occurs.
-
getCatalogName
protected String getCatalogName(Node contentNode)
Get the name of catalog to use for import- Parameters:
contentNode
- The node of program- Returns:
- The catalog to used
-
_getOrCreateContent
protected ModifiableDefaultContent _getOrCreateContent(String title, String lang, String catalog, String syncCode, AbstractImportCDMFrComponent.ContentWorkflowDescription wfDescription, org.slf4j.Logger logger) throws RepositoryException
Get or create the content from the synchronization code, the lang, the catalog and the content type.- Parameters:
title
- The titlelang
- The langcatalog
- The catalogsyncCode
- The synchronization codewfDescription
- The workflow descriptionlogger
- The logger- Returns:
- the retrieved or created content
- Throws:
RepositoryException
- if an error occurs
-
_getContent
protected ModifiableDefaultContent _getContent(String lang, String catalog, String syncCode, AbstractImportCDMFrComponent.ContentWorkflowDescription wfDescription)
Get the content from the synchronization code, the lang, the catalog and the content type.- Parameters:
lang
- The langcatalog
- The catalogsyncCode
- The synchronization codewfDescription
- The workflow description- Returns:
- the retrieved content
-
additionalParameters
protected abstract void additionalParameters(Map<String,Object> parameters)
Additional parameters for specific treatments.- Parameters:
parameters
- The parameters map to get
-
additionalOperationsBeforeSave
protected abstract void additionalOperationsBeforeSave(ModifiableDefaultContent content, org.slf4j.Logger logger) throws RepositoryException
Additional operation to do on the content before saving it.- Parameters:
content
- The contentlogger
- The logger- Throws:
RepositoryException
- if an error occurs
-
_importOrSynchronizeContent
protected ModifiableDefaultContent _importOrSynchronizeContent(Document doc, Node contentNode, AbstractImportCDMFrComponent.ContentWorkflowDescription wfDescription, String title, String lang, String catalog, String syncCode, org.slf4j.Logger logger)
Import or synchronize the content.- Parameters:
doc
- XML documentcontentNode
- Node of the contentwfDescription
- The workflow descriptiontitle
- The titlelang
- The langcatalog
- The catalogsyncCode
- The synchronization codelogger
- The logger- Returns:
- The imported or synchronized content
-
_synchronizeContent
protected void _synchronizeContent(Document doc, Node contentNode, ModifiableDefaultContent content, String contentTypeId, String lang, String catalog, String syncCode, org.slf4j.Logger logger)
Synchronize content- Parameters:
doc
- The root documentcontentNode
- the DOM content nodecontent
- The content to synchronizecontentTypeId
- The content type IDlang
- Parent program language (to select the good courses in the CDM-FR file)catalog
- The catalog of parent programsyncCode
- The synchronization codelogger
- The logger
-
_synchronizeCourseList
protected void _synchronizeCourseList(Document doc, Node courseListNode, ModifiableDefaultContent courseList, String lang, String catalog, org.slf4j.Logger logger)
Synchronize a course list, it has attributes to synchronize.- Parameters:
doc
- The XML documentcourseListNode
- The XML node of the course listcourseList
- The course list contentlang
- The langcatalog
- The cataloglogger
- The logger
-
_fetchImages
private void _fetchImages(Node docbookNode, ModifiableDefaultContent content, ModifiableRichText richText, String metadataPath, org.slf4j.Logger logger)
-
_synchronizeMetadata
protected boolean _synchronizeMetadata(Document doc, Node metadataNode, ModifiableDefaultContent content, String logicalMetadataPath, String completeMetadataPath, ContentType contentType, String lang, String catalog, org.slf4j.Logger logger)
Synchronize a metadata (can be a composite or a repeater).- Parameters:
doc
- The XML documentmetadataNode
- The metadata nodecontent
- The contentlogicalMetadataPath
- The logical metadata path (to retrieve the definition)completeMetadataPath
- The complete metadata path (to retrieve the metadata holder)contentType
- The content typelang
- The langcatalog
- The cataloglogger
- The logger- Returns:
true
if changes occurs
-
_handleGeocodeMetadata
protected boolean _handleGeocodeMetadata(Node metadataNode, ModifiableDefaultContent content, String completeMetadataPath, boolean synchronize)
Synchronize geocode metadata- Parameters:
metadataNode
- The metadata nodecontent
- The contentcompleteMetadataPath
- The complete metadata path (to retrieve the metadata holder)synchronize
- true if the data is external- Returns:
- true if some changes has been made
-
_handleGeocodeMetadata
protected boolean _handleGeocodeMetadata(Node metadataNode, ModifiableDefaultContent content, ModifiableCompositeMetadata metadataHolder, String metadataName, boolean synchronize)
Synchronize geocode metadata- Parameters:
metadataNode
- The metadata nodecontent
- The contentmetadataHolder
- the metadata holdermetadataName
- the metadata namesynchronize
- true if the data is external- Returns:
- true if some changes has been made
-
_handleFileMetadata
protected boolean _handleFileMetadata(Node metadataNode, ModifiableDefaultContent content, String logicalMetadataPath, String completeMetadataPath, boolean synchronize, ContentType contentType, org.slf4j.Logger logger)
Synchronize file metadata- Parameters:
metadataNode
- The metadata nodecontent
- The contentlogicalMetadataPath
- The logical metadata path (to retrieve the definition)completeMetadataPath
- The complete metadata path (to retrieve the metadata holder)synchronize
- true if the data is externalcontentType
- the content typelogger
- the logger- Returns:
- true if some changes has been made
-
_handleFileMetadata
protected boolean _handleFileMetadata(Node metadataNode, ModifiableDefaultContent content, String logicalMetadataPath, ModifiableCompositeMetadata metadataHolder, String metadataName, boolean synchronize, ContentType contentType, org.slf4j.Logger logger)
Synchronize file metadata- Parameters:
metadataNode
- The metadata nodecontent
- The contentlogicalMetadataPath
- The logical metadata path (to retrieve the definition)metadataHolder
- the metadata holdermetadataName
- the metadata namesynchronize
- true if the data is externalcontentType
- the content typelogger
- the logger- Returns:
- true if some changes has been made
-
_handleBinaryMetadata
protected boolean _handleBinaryMetadata(Node metadataNode, ModifiableDefaultContent content, String completeMetadataPath, boolean synchronize, org.slf4j.Logger logger)
Synchronize binary metadata- Parameters:
metadataNode
- The metadata nodecontent
- The contentcompleteMetadataPath
- The complete metadata path (to retrieve the metadata holder)synchronize
- true if the data is externallogger
- the logger- Returns:
- true if some changes has been made
-
_handleBinaryMetadata
protected boolean _handleBinaryMetadata(Node metadataNode, ModifiableDefaultContent content, ModifiableCompositeMetadata metadataHolder, String metadataName, boolean synchronize, org.slf4j.Logger logger)
Synchronize binary metadata- Parameters:
metadataNode
- The metadata nodecontent
- The contentmetadataHolder
- the metadata holdermetadataName
- the metadata namesynchronize
- true if the data is externallogger
- the logger- Returns:
- true if some changes has been made
-
_handleRepeaterMetadata
private boolean _handleRepeaterMetadata(Document doc, Node metadataNode, ModifiableDefaultContent content, String logicalMetadataPath, String completeMetadataPath, ContentType contentType, String lang, String catalog, org.slf4j.Logger logger)
-
_handleCompositeMetadata
private boolean _handleCompositeMetadata(Document doc, Node metadataNode, ModifiableDefaultContent content, String logicalMetadataPath, String completeMetadataPath, ContentType contentType, String lang, String catalog, org.slf4j.Logger logger)
-
_handleRichTextMetadata
private boolean _handleRichTextMetadata(ModifiableDefaultContent content, String logicalMetadataPath, String completeMetadataPath, Node metadataNode, boolean synchronize, org.slf4j.Logger logger)
-
_handleMetadataValues
protected List<Object> _handleMetadataValues(Document doc, ModifiableDefaultContent content, MetadataDefinition metadataDef, List<String> untypedValues, String lang, String catalog, org.slf4j.Logger logger)
Handle metadata values- Parameters:
doc
- the documentcontent
- the contentmetadataDef
- the metadata definitionuntypedValues
- the metadata values, untypedlang
- the languagecatalog
- the cataloglogger
- the logger- Returns:
- the list of handle value, typed
-
_handleMetadataValuesAsContent
private Object _handleMetadataValuesAsContent(Document doc, MetadataDefinition metadataDef, String metadataValue, String lang, String catalog, org.slf4j.Logger logger)
-
_linkTranslationsIfExist
protected void _linkTranslationsIfExist(ModifiableContent importedContent, String contentType)
Search for translated contents- Parameters:
importedContent
- The imported contentcontentType
- The content type
-
_saveContentChanges
protected void _saveContentChanges(ModifiableDefaultContent content, String contentTypeId, boolean hasChanges, org.slf4j.Logger logger)
Save the changes of the content.- Parameters:
content
- Content to savecontentTypeId
- The content type (for logs)hasChanges
- If there are changes to savelogger
- The logger
-
_setRelations
protected boolean _setRelations(ModifiableDefaultContent content, List<ModifiableDefaultContent> children, List<ModifiableDefaultContent> courseParts, boolean removeOldCourseParts, org.slf4j.Logger logger)
Set relations for the content.- Parameters:
content
- The content to updatechildren
- Children to setcourseParts
-List
ofCoursePart
to set forCourse
contentremoveOldCourseParts
- If the course parts doesn't have a code, we remove all the oldCoursePart
s before adding the new oneslogger
- The logger- Returns:
true
if changes occurs
-
_setChildren
protected boolean _setChildren(ModifiableDefaultContent content, List<ModifiableDefaultContent> children, org.slf4j.Logger logger)
Set children for the given content.- Parameters:
content
- Content to add the childrenchildren
- Children to addlogger
- The logger- Returns:
true
if changes occurs
-
_setOrgUnitParent
protected boolean _setOrgUnitParent(ModifiableDefaultContent orgUnit, org.slf4j.Logger logger)
Set the orgUnit parent to rootOrgUnit.- Parameters:
orgUnit
- The orgunit to linklogger
- The logger- Returns:
true
if changes occurs
-
_getIdFromCDMThenCode
protected String _getIdFromCDMThenCode(String tableRefId, String cdmCode)
Get the content ID from the CDM code, if there is no match with the CDM code, then we search with the code. If nothing is found we return null.- Parameters:
tableRefId
- The reference table IDcdmCode
- The CDM code- Returns:
- A content ID or
null
-
_updateDoubleRelation
private boolean _updateDoubleRelation(ModifiableDefaultContent content, List<ModifiableDefaultContent> children, String metadataName, String invertMetadataName, org.slf4j.Logger logger)
-
_getXPathString
private String _getXPathString(Node metadataNode, String xPath, String defaultValue)
-
ignoreRights
protected boolean ignoreRights()
If true, bypass the rights check during the import process- Returns:
- True if the rights check are bypassed during the import process
-
getProgramWfDescription
protected AbstractImportCDMFrComponent.ContentWorkflowDescription getProgramWfDescription()
Get the program workflow description.- Returns:
- A
AbstractImportCDMFrComponent.ContentWorkflowDescription
containing informations about the program workflow
-
getSubProgramWfDescription
protected AbstractImportCDMFrComponent.ContentWorkflowDescription getSubProgramWfDescription()
Get the subprogram workflow description.- Returns:
- A
AbstractImportCDMFrComponent.ContentWorkflowDescription
containing informations about the subprogram workflow
-
getContainerWfDescription
protected AbstractImportCDMFrComponent.ContentWorkflowDescription getContainerWfDescription()
Get the container workflow description.- Returns:
- A
AbstractImportCDMFrComponent.ContentWorkflowDescription
containing informations about the container workflow
-
getCourseListWfDescription
protected AbstractImportCDMFrComponent.ContentWorkflowDescription getCourseListWfDescription()
Get the course list workflow description.- Returns:
- A
AbstractImportCDMFrComponent.ContentWorkflowDescription
containing informations about the course list workflow
-
getCourseWfDescription
protected AbstractImportCDMFrComponent.ContentWorkflowDescription getCourseWfDescription()
Get the course workflow description.- Returns:
- A
AbstractImportCDMFrComponent.ContentWorkflowDescription
containing informations about the course workflow
-
getCoursePartWfDescription
protected AbstractImportCDMFrComponent.ContentWorkflowDescription getCoursePartWfDescription()
Get the course part workflow description.- Returns:
- A
AbstractImportCDMFrComponent.ContentWorkflowDescription
containing informations about the course part workflow
-
getOrgUnitWfDescription
protected AbstractImportCDMFrComponent.ContentWorkflowDescription getOrgUnitWfDescription()
Get the orgunit workflow description.- Returns:
- A
AbstractImportCDMFrComponent.ContentWorkflowDescription
containing informations about the orgunit workflow
-
getPersonWfDescription
protected AbstractImportCDMFrComponent.ContentWorkflowDescription getPersonWfDescription()
Get the person workflow description.- Returns:
- A
AbstractImportCDMFrComponent.ContentWorkflowDescription
containing informations about the person workflow
-
getExpressionsList
public List<Expression> getExpressionsList(String lang, String idValue, String contentType, String catalog)
Description copied from interface:ImportCDMFrComponent
Construct the query to retrieve the content.- Specified by:
getExpressionsList
in interfaceImportCDMFrComponent
- Parameters:
lang
- LangidValue
- Synchronization valuecontentType
- Content typecatalog
- The catalog- Returns:
- The
List
ofExpression
-
getLocalAndExternalFields
public Set<String> getLocalAndExternalFields(Map<String,Object> additionalParameters)
Description copied from interface:ImportCDMFrComponent
Get the path of tri-state fields (with local and external values)- Specified by:
getLocalAndExternalFields
in interfaceImportCDMFrComponent
- Parameters:
additionalParameters
- Additional parameters- Returns:
- the synchronized fields
-
-