Package org.ametys.plugins.odfsync.cdmfr
Class AbstractCDMFrSynchronizableContentsCollection
java.lang.Object
org.ametys.plugins.contentio.synchronize.AbstractStaticSynchronizableContentsCollection
org.ametys.plugins.contentio.synchronize.AbstractSynchronizableContentsCollection
org.ametys.plugins.odfsync.cdmfr.AbstractCDMFrSynchronizableContentsCollection
- All Implemented Interfaces:
SynchronizableContentsCollection
,Configurable
,Serviceable
- Direct Known Subclasses:
CDMFrSynchronizableContentsCollection
,RemoteCDMFrSynchronizableContentsCollection
public abstract class AbstractCDMFrSynchronizableContentsCollection
extends AbstractSynchronizableContentsCollection
Abstract class to import CDMFr contents
-
Field Summary
Fields inherited from class org.ametys.plugins.contentio.synchronize.AbstractSynchronizableContentsCollection
_contentTypeEP, _currentUserProvider, _hasGlobalError, _i18nUtils, _nbCreatedContents, _nbDeletedContents, _nbError, _nbNotChangedContents, _nbSynchronizedContents, _observationManager, _synchroComponent, SCC_UNIQUE_ID
Fields inherited from class org.ametys.plugins.contentio.synchronize.AbstractStaticSynchronizableContentsCollection
_contentDAO, _contentPrefix, _contentType, _id, _initialActionId, _label, _languages, _modelId, _modelParamValues, _removalSync, _reportMails, _resolver, _restrictedField, _sccHelper, _searchModelConfiguration, _synchronizeActionId, _synchronizeExistingContentsOnly, _synchronizingContentOperator, _validateActionId, _validateAfterImport, _workflowName
Fields inherited from interface org.ametys.plugins.contentio.synchronize.SynchronizableContentsCollection
COLLECTION_ID_PROPERTY
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionFilter the contents to remove.protected List<ModifiableDefaultContent>
_internalPopulate
(Logger logger) Internal implementation ofAbstractSynchronizableContentsCollection.populate(Logger)
protected void
configureDataSource
(Configuration configuration) Configure the data source parameters.protected void
Configure the search model used by SCCSearchTool.getContent
(String lang, String idValue) Gets the content in the repositorygetExternalOnlyFields
(Map<String, Object> additionalParameters) Get the path of field that are valued externally only.Get the path of metadata holding the unique identifiergetLocalAndExternalFields
(Map<String, Object> additionalParameters) Get the path of tri-state fields (with local and external values)int
getTotalCount
(Map<String, Object> parameters, Logger logger) Return the total number of results for the search.Search the data to import from parameters.void
service
(ServiceManager manager) void
synchronizeContent
(ModifiableDefaultContent content, Logger logger) Synchronize a content with remove values.void
updateSyncInformations
(ModifiableDefaultContent content, String syncCode, Logger logger) Method to update the synchronisation informations (collection and value of the ID field).Methods inherited from class org.ametys.plugins.contentio.synchronize.AbstractSynchronizableContentsCollection
_deleteContents, _getContentPathQuery, _getExpressionsList, _getMetadataHolder, _isParamNotEmpty, _removeEmptyParameters, _removeMetadataIfExists, _synchronizeMetadata, _updateRelation, _updateRelation, applyChanges, applyChanges, createContentAction, deleteUnexistingContents, empty, populate, sendErrorMail, updateSCCProperty, validateContent
Methods inherited from class org.ametys.plugins.contentio.synchronize.AbstractStaticSynchronizableContentsCollection
_parseLanguages, _parseParameters, configure, configureStaticParams, getContentPrefix, getContentType, getId, getInitialActionId, getLabel, getLanguages, getParameterValues, getReportMails, getRestrictedField, getSearchModelConfiguration, getSynchronizeActionId, getSynchronizeCollectionModelId, getSynchronizingContentOperator, getValidateActionId, getWorkflowName, removalSync, synchronizeExistingContentsOnly, validateAfterImport
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.ametys.plugins.contentio.synchronize.SynchronizableContentsCollection
handleRightAssignmentContext, importContent
-
Field Details
-
_importCDMFrComponent
The import CDMFr component
-
-
Constructor Details
-
AbstractCDMFrSynchronizableContentsCollection
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Overrides:
service
in classAbstractSynchronizableContentsCollection
- Throws:
ServiceException
-
getIdField
Description copied from interface:SynchronizableContentsCollection
Get the path of metadata holding the unique identifier- Returns:
- the path to the metadata. Can be null.
-
getLocalAndExternalFields
Description copied from interface:SynchronizableContentsCollection
Get the path of tri-state fields (with local and external values)- Parameters:
additionalParameters
- Additional parameters- Returns:
- the synchronized fields
-
getExternalOnlyFields
Description copied from interface:SynchronizableContentsCollection
Get the path of field that are valued externally only.- Parameters:
additionalParameters
- Additional parameters- Returns:
- the external fields
-
configureDataSource
Description copied from class:AbstractStaticSynchronizableContentsCollection
Configure the data source parameters.- Specified by:
configureDataSource
in classAbstractStaticSynchronizableContentsCollection
- Parameters:
configuration
- Configuration to read- Throws:
ConfigurationException
- If an error occurs
-
configureSearchModel
Description copied from class:AbstractStaticSynchronizableContentsCollection
Configure the search model used by SCCSearchTool.- Specified by:
configureSearchModel
in classAbstractStaticSynchronizableContentsCollection
-
synchronizeContent
Description copied from interface:SynchronizableContentsCollection
Synchronize a content with remove values.- Parameters:
content
- The content to synchronizelogger
- The logger- Throws:
Exception
- if an error occurs.
-
getContent
Description copied from interface:SynchronizableContentsCollection
Gets the content in the repository- Parameters:
lang
- the languageidValue
- the content name- Returns:
- the content in the repository, or null if does not exist
-
search
public Map<String,Map<String, searchObject>> (Map<String, Object> parameters, int offset, int limit, List<Object> sort, Logger logger) Description copied from interface:SynchronizableContentsCollection
Search the data to import from parameters.- Parameters:
parameters
- Parameters for the searchoffset
- Begin of the searchlimit
- Number of resultssort
- Sort of results (ignored for LDAP results)logger
- The logger- Returns:
- A map of remote values by content
-
updateSyncInformations
public void updateSyncInformations(ModifiableDefaultContent content, String syncCode, Logger logger) throws Exception Description copied from interface:SynchronizableContentsCollection
Method to update the synchronisation informations (collection and value of the ID field).- Parameters:
content
- Content to updatesyncCode
- New synchronization codelogger
- The logger- Throws:
Exception
- if an error occurs.
-
getTotalCount
Description copied from interface:SynchronizableContentsCollection
Return the total number of results for the search.- Parameters:
parameters
- Parameters for the searchlogger
- The logger- Returns:
- The total count
-
_getContentsToRemove
protected List<Content> _getContentsToRemove(AmetysObjectIterable<ModifiableDefaultContent> contents) Description copied from class:AbstractSynchronizableContentsCollection
Filter the contents to remove.- Specified by:
_getContentsToRemove
in classAbstractSynchronizableContentsCollection
- Parameters:
contents
- The list of all the available contents- Returns:
- The
List
ofContent
to remove.
-
_internalPopulate
Description copied from class:AbstractSynchronizableContentsCollection
Internal implementation ofAbstractSynchronizableContentsCollection.populate(Logger)
- Specified by:
_internalPopulate
in classAbstractSynchronizableContentsCollection
- Parameters:
logger
- The logger- Returns:
- The list of created/synchronized contents
-