public class CoAccreditedRemoteImportCDMFrComponent extends RemoteImportCDMFrComponent
Modifier and Type | Class and Description |
---|---|
static class |
CoAccreditedRemoteImportCDMFrComponent.SharedWithType
Enum to define the way to detect shared subProgram
|
AbstractImportCDMFrComponent.ContentWorkflowDescription
Modifier and Type | Field and Description |
---|---|
private Map<String,String> |
_degree2MentionMap |
protected DeleteODFContentHelper |
_deleteODFContent
The delete ODF content helper
|
private ContentType |
_mentionContentType |
private String |
_mentionId |
protected Set<String> |
_mentionMetadataPaths
The list of metadata to copy for mention program
|
protected MergeMetadataForSharedProgramHelper |
_mergeMetadataHelper
The merge metadata helper
|
protected Set<String> |
_metadataPathsToMerge
The list of metadata to merge
|
private String |
_programToLinkCode |
private String |
_sharedSubProgramType |
static String |
SHARED_PROGRAMS_NODE_NAME
The name of the JCR node holding the shared metadata
|
_forcedCatalog, _validateAfterImport, ROLE
_catalogsManager, _cdmFrSyncExtensionPoint, _cocoonContext, _contentPrefix, _contentTypeEP, _currentUserProvider, _domParser, _importedContents, _nbCreatedContents, _nbError, _nbNotChangedContents, _nbSynchronizedContents, _observationManager, _odfLang, _odfRefTableHelper, _resolver, _rootOUProvider, _shareableCourseHelper, _syncFieldsByContentType, _synchroComponent, _synchronizedContents, _TAG_CONTAINER, _TAG_COURSELIST, _TAG_COURSEPART, _TAG_PROGRAM, _TAG_SUBPROGRAM, _updatedContents, _xPathProcessor
Constructor and Description |
---|
CoAccreditedRemoteImportCDMFrComponent() |
Modifier and Type | Method and Description |
---|---|
protected void |
_configureCoAccreditedParams(Configuration configuration)
Configure the co-accredited params
|
protected Program |
_createMention(Document doc,
Node contentNode,
String mentionId,
String catalog,
String lang,
Logger logger)
Create the mention
|
protected SubProgram |
_getMainSharedWithSubProgram(Program mentionProgram,
Node contentNode,
Logger logger)
Get the main subprogram shared with the program representing by the content node
|
protected Program |
_getMention(String mentionId,
String degreeId,
String lang,
String catalog)
Get the mention program
|
protected List<Object> |
_getMultipleValuesFromContent(SubProgram sharedProgram,
String logicalMetadataPath,
MetadataType type,
Logger logger)
Get multiple values from content
|
protected List<Object> |
_getMultipleValuesFromDOM(Document doc,
Node sharedProgramDOM,
SubProgram mainProgram,
MetadataDefinition metadataDefinition,
String logicalMetadataPath,
MetadataType type,
String catalog,
String lang,
Logger logger)
Get multiple values from DOM
|
protected Program |
_getOrCreateMention(Document doc,
Node contentNode,
String mentionCode,
String lang,
String catalog,
Logger logger)
Get of create the mention program
|
protected ModifiableCompositeMetadata |
_getSharedMetadataHolder(Document doc,
Node sharedProgramNode,
SubProgram mainProgram,
SubProgram sharedProgram,
Logger logger)
Get the metadata composite holding shared metadata of subprograms
|
protected SubProgram |
_getSharedSubProgram(Program mentionProgram,
String code,
Logger logger)
Get the shared subprogram with the given code
|
protected List<String> |
_getSharedWithAsString(Node contentNode,
Logger logger)
Get the list of "shared with" program from the remote document
|
protected CoAccreditedRemoteImportCDMFrComponent.SharedWithType |
_getSharedWithType()
Get the defined way to detect shared program
|
protected SubProgram |
_getSubProgramWithSameTitle(Program mentionProgram,
Node contentNode,
String lang)
Get the subProgram with the same title
|
protected boolean |
_hasSubProgramWithSameTitle(Program mentionProgram,
Node contentNode,
String lang,
Logger logger)
True if there is a subProgram with the same title of the content node
|
protected ModifiableDefaultContent |
_importOrSynchronizeContent(Document doc,
Node contentNode,
AbstractImportCDMFrComponent.ContentWorkflowDescription wfDescription,
String title,
String lang,
String catalog,
String syncCode,
Logger logger)
Import or synchronize the content.
|
protected ModifiableDefaultContent |
_importOrSynchronizeSharedSubPrograms(Document doc,
Program mentionProgram,
Node contentNode,
AbstractImportCDMFrComponent.ContentWorkflowDescription contentWfDescription,
String title,
String syncCode,
String lang,
String catalog,
Logger logger)
Import or synchronized shared subPrograms
|
protected boolean |
_isSecondarySharedSubPrograms(Program mentionProgram,
Node contentNode,
String lang,
Logger logger)
True if the subProgram node is shared with a main subProgram.
|
protected boolean |
_synchronizeAndDeleteSharedSubPrograms(Program rootProgram,
SubProgram mainSubProgram,
List<String> sharedWith,
String catalog,
String lang,
Logger logger)
Synchronize the shared metadata of a shared subprogram before deleting the subprogram
|
protected boolean |
_synchronizeMentionMetadata(Document doc,
Node contentNode,
ModifiableDefaultContent mention,
String metadataPath,
String lang,
String catalog,
Logger logger)
Synchronize metadata in the mention program
|
boolean |
_synchronizeSharedMetadata(Document doc,
Node sharedProgramNode,
SubProgram mainProgram,
SubProgram sharedProgram,
Set<String> metadataToMerge,
String catalog,
String lang,
Logger logger)
Synchronize the shared program node for a main subprogram, from a secondary subprogram
|
protected boolean |
_synchronizeSharedMultipleMetadata(Document doc,
Node sharedProgramNode,
SubProgram mainProgram,
SubProgram sharedProgram,
MetadataDefinition metadataDefinition,
ModifiableCompositeMetadata sharedMetadataHolder,
String logicalMetadataPath,
String catalog,
String lang,
Logger logger)
Synchronize a shared multiple metadata for shared program
|
protected boolean |
_synchronizeSharedSingleMetadata(Document doc,
Node sharedProgramNode,
SubProgram mainProgram,
SubProgram sharedProgram,
MetadataDefinition metadataDefinition,
ModifiableCompositeMetadata sharedMetadataHolder,
String logicalMetadataPath,
String catalog,
String lang,
Logger logger)
Synchronize single metadata for shared program
|
protected void |
additionalOperationsBeforeSave(ModifiableDefaultContent content,
Logger logger)
Additional operation to do on the content before saving it.
|
protected void |
additionalParameters(Map<String,Object> parameters)
Additional parameters for specific treatments.
|
void |
configure(Configuration configuration) |
protected void |
deleteSharedSubProgram(ModifiableDefaultContent sharedProgram,
Logger logger)
Delete a shared secondary subprogram.
|
protected SubProgram |
getMainSharedSubProgram(Program mentionProgram,
Node contentNode,
String lang,
Logger logger)
Get the main subprogram shared with the program representing by the content node
|
void |
initialize() |
void |
service(ServiceManager manager) |
protected boolean |
synchronizeRepeaterMetadataFromContent(SubProgram sharedProgram,
ModifiableCompositeMetadata sharedMetadataHolder,
String logicalMetadataPath,
Logger logger)
Synchronize repeater from content
|
protected boolean |
synchronizeRepeaterMetadataFromDOM(Document doc,
Node sharedProgramNode,
SubProgram mainProgram,
MetadataDefinition metadataDefinition,
ModifiableCompositeMetadata sharedMetadataHolder,
String logicalMetadataPath,
String catalog,
String lang,
Logger logger)
Synchronize repeater from DOM
|
boolean |
synchronizeSimpleMetadataFromDOM(Document doc,
SubProgram subProgram,
Node metadataNode,
MetadataDefinition metadataDefinition,
String logicalMetadataPath,
ModifiableCompositeMetadata sharedMetadataHolder,
String metadataName,
String catalog,
String lang,
Logger logger)
Synchronize a simple metadata from DOM
|
getCatalogName, ignoreRights, removalSync, transformDocument, validateAfterImport
_getContent, _getIdFromCDMThenCode, _getOrCreateContent, _handleBinaryMetadata, _handleBinaryMetadata, _handleFileMetadata, _handleFileMetadata, _handleGeocodeMetadata, _handleGeocodeMetadata, _handleMetadataValues, _linkTranslationsIfExist, _saveContentChanges, _setChildren, _setOrgUnitParent, _setRelations, _synchronizeContent, _synchronizeCourseList, _synchronizeMetadata, contextualize, getContainerWfDescription, getCourseListWfDescription, getCoursePartWfDescription, getCourseWfDescription, getExpressionsList, getIdField, getLocalAndExternalFields, getOrgUnitWfDescription, getPersonWfDescription, getProgramWfDescription, getSubProgramWfDescription, handleInputStream
public static final String SHARED_PROGRAMS_NODE_NAME
protected MergeMetadataForSharedProgramHelper _mergeMetadataHelper
protected DeleteODFContentHelper _deleteODFContent
protected Set<String> _mentionMetadataPaths
protected Set<String> _metadataPathsToMerge
private Map<String,String> _degree2MentionMap
private ContentType _mentionContentType
private String _mentionId
private String _programToLinkCode
private String _sharedSubProgramType
public CoAccreditedRemoteImportCDMFrComponent()
public void service(ServiceManager manager) throws ServiceException
service
in interface Serviceable
service
in class AbstractImportCDMFrComponent
ServiceException
public void initialize() throws Exception
initialize
in interface Initializable
initialize
in class AbstractImportCDMFrComponent
Exception
public void configure(Configuration configuration) throws ConfigurationException
configure
in interface Configurable
configure
in class AbstractImportCDMFrComponent
ConfigurationException
protected void _configureCoAccreditedParams(Configuration configuration) throws ConfigurationException
configuration
- the configurationConfigurationException
- if an error occurredprotected void additionalParameters(Map<String,Object> parameters)
AbstractImportCDMFrComponent
additionalParameters
in class RemoteImportCDMFrComponent
parameters
- The parameters map to getprotected ModifiableDefaultContent _importOrSynchronizeContent(Document doc, Node contentNode, AbstractImportCDMFrComponent.ContentWorkflowDescription wfDescription, String title, String lang, String catalog, String syncCode, Logger logger)
AbstractImportCDMFrComponent
_importOrSynchronizeContent
in class AbstractImportCDMFrComponent
doc
- XML documentcontentNode
- Node of the contentwfDescription
- The workflow descriptiontitle
- The titlelang
- The langcatalog
- The catalogsyncCode
- The synchronization codelogger
- The loggerprotected ModifiableDefaultContent _importOrSynchronizeSharedSubPrograms(Document doc, Program mentionProgram, Node contentNode, AbstractImportCDMFrComponent.ContentWorkflowDescription contentWfDescription, String title, String syncCode, String lang, String catalog, Logger logger)
doc
- the documentmentionProgram
- the mention programcontentNode
- the content nodecontentWfDescription
- the content workflow descriptiontitle
- the title of the subprogramsyncCode
- the synchronisation codelang
- the languagecatalog
- the cataloglogger
- the loggerprotected Program _getOrCreateMention(Document doc, Node contentNode, String mentionCode, String lang, String catalog, Logger logger)
doc
- the documentcontentNode
- the content nodementionCode
- the mention codelang
- the languagecatalog
- the cataloglogger
- the loggerprotected Program _createMention(Document doc, Node contentNode, String mentionId, String catalog, String lang, Logger logger)
doc
- the documentcontentNode
- the content nodementionId
- the mention idcatalog
- the cataloglang
- the languagelogger
- the loggerprotected Program _getMention(String mentionId, String degreeId, String lang, String catalog)
mentionId
- the mention content iddegreeId
- the degree content idlang
- the languagecatalog
- the catalognull
if it doesn't existprotected boolean _synchronizeMentionMetadata(Document doc, Node contentNode, ModifiableDefaultContent mention, String metadataPath, String lang, String catalog, Logger logger)
doc
- the documentcontentNode
- the content nodemention
- the mention programmetadataPath
- the metadata path to synchronizelang
- the languagecatalog
- the cataloglogger
- the loggerprotected void additionalOperationsBeforeSave(ModifiableDefaultContent content, Logger logger) throws RepositoryException
AbstractImportCDMFrComponent
additionalOperationsBeforeSave
in class RemoteImportCDMFrComponent
content
- The contentlogger
- The loggerRepositoryException
- if an error occursprotected CoAccreditedRemoteImportCDMFrComponent.SharedWithType _getSharedWithType()
protected SubProgram getMainSharedSubProgram(Program mentionProgram, Node contentNode, String lang, Logger logger)
mentionProgram
- the root mention programcontentNode
- the content nodelang
- the content langlogger
- the loggernull
otherwiseprotected boolean _isSecondarySharedSubPrograms(Program mentionProgram, Node contentNode, String lang, Logger logger)
mentionProgram
- the mention programcontentNode
- the content nodelang
- the langlogger
- the loggerprotected boolean _hasSubProgramWithSameTitle(Program mentionProgram, Node contentNode, String lang, Logger logger)
mentionProgram
- the mention programcontentNode
- the content nodelang
- the langlogger
- the loggerprotected SubProgram _getSubProgramWithSameTitle(Program mentionProgram, Node contentNode, String lang)
mentionProgram
- the mention programcontentNode
- the content nodelang
- the langprotected List<String> _getSharedWithAsString(Node contentNode, Logger logger)
contentNode
- The content nodelogger
- the loggerprotected SubProgram _getMainSharedWithSubProgram(Program mentionProgram, Node contentNode, Logger logger)
mentionProgram
- the root mention programcontentNode
- the content nodelogger
- the loggernull
otherwiseprotected SubProgram _getSharedSubProgram(Program mentionProgram, String code, Logger logger)
mentionProgram
- The root mention programcode
- The CDMfr codelogger
- the loggernull
if not foundprotected void deleteSharedSubProgram(ModifiableDefaultContent sharedProgram, Logger logger)
sharedProgram
- the shared programlogger
- the loggerprotected boolean _synchronizeAndDeleteSharedSubPrograms(Program rootProgram, SubProgram mainSubProgram, List<String> sharedWith, String catalog, String lang, Logger logger)
rootProgram
- The root mentionmainSubProgram
- The main subprogramsharedWith
- The CDMfr of shared subprogramcatalog
- the cataloglang
- the languagelogger
- The loggertrue
if changes were madepublic boolean _synchronizeSharedMetadata(Document doc, Node sharedProgramNode, SubProgram mainProgram, SubProgram sharedProgram, Set<String> metadataToMerge, String catalog, String lang, Logger logger) throws RepositoryException
doc
- the document. Can be null if the sharedProgram is notsharedProgramNode
- the shared program node. Can be null if the sharedProgram is notmainProgram
- the main programsharedProgram
- the shared program. Can be null if the doc and the sharedProgramNode is notmetadataToMerge
- the set of metadata to mergecatalog
- the cataloglang
- the languagelogger
- the loggertrue
if changes were madeRepositoryException
- if an error occurredprotected ModifiableCompositeMetadata _getSharedMetadataHolder(Document doc, Node sharedProgramNode, SubProgram mainProgram, SubProgram sharedProgram, Logger logger) throws RepositoryException
doc
- the document. Can be null if the sharedProgram is notsharedProgramNode
- the shared program node. Can be null if the sharedProgram is notmainProgram
- the main programsharedProgram
- the shared program. Can be null if the doc and the sharedProgramNode is notlogger
- the loggerRepositoryException
- if an error occurredprotected boolean _synchronizeSharedMultipleMetadata(Document doc, Node sharedProgramNode, SubProgram mainProgram, SubProgram sharedProgram, MetadataDefinition metadataDefinition, ModifiableCompositeMetadata sharedMetadataHolder, String logicalMetadataPath, String catalog, String lang, Logger logger)
doc
- the document. Can be null if the sharedProgram is notsharedProgramNode
- the shared program node. Can be null if the sharedProgram is notmainProgram
- the main programsharedProgram
- the shared program. Can be null if the doc and the sharedProgramNode is notmetadataDefinition
- the metadata definitionsharedMetadataHolder
- the metadata composite holding shared metadata of subprogramslogicalMetadataPath
- The logical metadata path (to retrieve the definition)catalog
- the cataloglang
- the languagelogger
- the loggertrue
if changes were madeprotected List<Object> _getMultipleValuesFromContent(SubProgram sharedProgram, String logicalMetadataPath, MetadataType type, Logger logger)
sharedProgram
- the shared programlogicalMetadataPath
- The logical metadata path (to retrieve the definition)type
- the type of the data to retrievelogger
- the loggerprotected List<Object> _getMultipleValuesFromDOM(Document doc, Node sharedProgramDOM, SubProgram mainProgram, MetadataDefinition metadataDefinition, String logicalMetadataPath, MetadataType type, String catalog, String lang, Logger logger)
doc
- the documentsharedProgramDOM
- the shared program nodemainProgram
- the main programmetadataDefinition
- the metadata definitionlogicalMetadataPath
- The logical metadata path (to retrieve the definition)type
- the type of the data to retrievecatalog
- the cataloglang
- the langlogger
- the loggerprotected boolean _synchronizeSharedSingleMetadata(Document doc, Node sharedProgramNode, SubProgram mainProgram, SubProgram sharedProgram, MetadataDefinition metadataDefinition, ModifiableCompositeMetadata sharedMetadataHolder, String logicalMetadataPath, String catalog, String lang, Logger logger)
doc
- the document. Can be null if the sharedProgram is notsharedProgramNode
- the shared program node. Can be null if the sharedProgram is notmainProgram
- the main programsharedProgram
- the shared program. Can be null if the doc and the sharedProgramNode is notmetadataDefinition
- the metadata definitionsharedMetadataHolder
- the metadata composite holding shared metadata of subprogramslogicalMetadataPath
- The logical metadata path (to retrieve the definition)catalog
- the cataloglang
- the languagelogger
- the loggertrue
if changes were madeprotected boolean synchronizeRepeaterMetadataFromContent(SubProgram sharedProgram, ModifiableCompositeMetadata sharedMetadataHolder, String logicalMetadataPath, Logger logger)
sharedProgram
- the shared programsharedMetadataHolder
- the metadata composite holding shared metadata of subprogramslogicalMetadataPath
- The logical metadata path (to retrieve the definition)logger
- the loggertrue
if changes were madeprotected boolean synchronizeRepeaterMetadataFromDOM(Document doc, Node sharedProgramNode, SubProgram mainProgram, MetadataDefinition metadataDefinition, ModifiableCompositeMetadata sharedMetadataHolder, String logicalMetadataPath, String catalog, String lang, Logger logger)
doc
- the documentsharedProgramNode
- the shared program nodemainProgram
- the main programmetadataDefinition
- the metadata definitionsharedMetadataHolder
- the metadata composite holding shared metadata of subprogramslogicalMetadataPath
- The logical metadata path (to retrieve the definition)catalog
- the cataloglang
- the languagelogger
- the loggertrue
if changes were madepublic boolean synchronizeSimpleMetadataFromDOM(Document doc, SubProgram subProgram, Node metadataNode, MetadataDefinition metadataDefinition, String logicalMetadataPath, ModifiableCompositeMetadata sharedMetadataHolder, String metadataName, String catalog, String lang, Logger logger)
doc
- the documentsubProgram
- the subProgram contentmetadataNode
- The metadata DOM nodemetadataDefinition
- the metadata definitionlogicalMetadataPath
- The logical metadata path (to retrieve the definition)sharedMetadataHolder
- the metadata composite holding shared metadata of subprogramsmetadataName
- the metadata namecatalog
- the cataloglang
- the languagelogger
- The loggertrue
if changes were made