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 Modifier and Type Field Description protected ImportCDMFrComponent_importCDMFrComponentThe import CDMFr component-
Fields inherited from class org.ametys.plugins.contentio.synchronize.AbstractSynchronizableContentsCollection
_contentDAO, _contentTypeEP, _currentUserProvider, _hasGlobalError, _i18nUtils, _nbCreatedContents, _nbDeletedContents, _nbError, _nbNotChangedContents, _nbSynchronizedContents, _observationManager, _resolver, _synchroComponent, SCC_UNIQUE_ID
-
Fields inherited from class org.ametys.plugins.contentio.synchronize.AbstractStaticSynchronizableContentsCollection
_contentPrefix, _contentType, _id, _initialActionId, _label, _languages, _modelId, _modelParamValues, _removalSync, _reportMails, _restrictedField, _searchModelConfiguration, _synchronizeActionId, _synchronizeExistingContentsOnly, _synchronizingContentOperator, _validateActionId, _validateAfterImport, _workflowName
-
Fields inherited from interface org.ametys.plugins.contentio.synchronize.SynchronizableContentsCollection
COLLECTION_ID_PROPERTY
-
-
Constructor Summary
Constructors Constructor Description AbstractCDMFrSynchronizableContentsCollection()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected List<Content>_getContentsToRemove(AmetysObjectIterable<ModifiableDefaultContent> contents)Filter the contents to remove.protected List<ModifiableDefaultContent>_internalPopulate(org.slf4j.Logger logger)Internal implementation ofAbstractSynchronizableContentsCollection.populate(Logger)protected voidconfigureDataSource(Configuration configuration)Configure the data source parameters.protected voidconfigureSearchModel()Configure the search model used by SCCSearchTool.ModifiableDefaultContentgetContent(String lang, String idValue)Gets the content in the repositorySet<String>getExternalOnlyFields(Map<String,Object> additionalParameters)Get the path of field that are valued externally only.StringgetIdField()Get the path of metadata holding the unique identifierSet<String>getLocalAndExternalFields(Map<String,Object> additionalParameters)Get the path of tri-state fields (with local and external values)intgetTotalCount(Map<String,Object> parameters, org.slf4j.Logger logger)Return the total number of results for the search.Map<String,Map<String,Object>>search(Map<String,Object> parameters, int offset, int limit, List<Object> sort, org.slf4j.Logger logger)Search the data to import from parameters.voidservice(ServiceManager manager)voidsynchronizeContent(ModifiableDefaultContent content, org.slf4j.Logger logger)Synchronize a content with remove values.voidupdateSyncInformations(ModifiableDefaultContent content, String syncCode, org.slf4j.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
_getContentPathQuery, _getExpressionsList, _getMetadataHolder, _isParamNotEmpty, _removeEmptyParameters, _removeMetadataIfExists, _synchronizeMetadata, _updateRelation, _updateRelation, applyChanges, applyChanges, createContentAction, deleteUnexistingContents, 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 Detail
-
_importCDMFrComponent
protected ImportCDMFrComponent _importCDMFrComponent
The import CDMFr component
-
-
Constructor Detail
-
AbstractCDMFrSynchronizableContentsCollection
public AbstractCDMFrSynchronizableContentsCollection()
-
-
Method Detail
-
service
public void service(ServiceManager manager) throws ServiceException
- Specified by:
servicein interfaceServiceable- Overrides:
servicein classAbstractSynchronizableContentsCollection- Throws:
ServiceException
-
getIdField
public String getIdField()
Description copied from interface:SynchronizableContentsCollectionGet the path of metadata holding the unique identifier- Returns:
- the path to the metadata. Can be null.
-
getLocalAndExternalFields
public Set<String> getLocalAndExternalFields(Map<String,Object> additionalParameters)
Description copied from interface:SynchronizableContentsCollectionGet the path of tri-state fields (with local and external values)- Parameters:
additionalParameters- Additional parameters- Returns:
- the synchronized fields
-
getExternalOnlyFields
public Set<String> getExternalOnlyFields(Map<String,Object> additionalParameters)
Description copied from interface:SynchronizableContentsCollectionGet the path of field that are valued externally only.- Parameters:
additionalParameters- Additional parameters- Returns:
- the external fields
-
configureDataSource
protected void configureDataSource(Configuration configuration) throws ConfigurationException
Description copied from class:AbstractStaticSynchronizableContentsCollectionConfigure the data source parameters.- Specified by:
configureDataSourcein classAbstractStaticSynchronizableContentsCollection- Parameters:
configuration- Configuration to read- Throws:
ConfigurationException- If an error occurs
-
configureSearchModel
protected void configureSearchModel()
Description copied from class:AbstractStaticSynchronizableContentsCollectionConfigure the search model used by SCCSearchTool.- Specified by:
configureSearchModelin classAbstractStaticSynchronizableContentsCollection
-
synchronizeContent
public void synchronizeContent(ModifiableDefaultContent content, org.slf4j.Logger logger) throws Exception
Description copied from interface:SynchronizableContentsCollectionSynchronize a content with remove values.- Parameters:
content- The content to synchronizelogger- The logger- Throws:
Exception- if an error occurs.
-
getContent
public ModifiableDefaultContent getContent(String lang, String idValue)
Description copied from interface:SynchronizableContentsCollectionGets 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,Object>> search(Map<String,Object> parameters, int offset, int limit, List<Object> sort, org.slf4j.Logger logger)
Description copied from interface:SynchronizableContentsCollectionSearch 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, org.slf4j.Logger logger) throws Exception
Description copied from interface:SynchronizableContentsCollectionMethod 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
public int getTotalCount(Map<String,Object> parameters, org.slf4j.Logger logger)
Description copied from interface:SynchronizableContentsCollectionReturn 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:AbstractSynchronizableContentsCollectionFilter the contents to remove.- Specified by:
_getContentsToRemovein classAbstractSynchronizableContentsCollection- Parameters:
contents- The list of all the available contents- Returns:
- The
ListofContentto remove.
-
_internalPopulate
protected List<ModifiableDefaultContent> _internalPopulate(org.slf4j.Logger logger)
Description copied from class:AbstractSynchronizableContentsCollectionInternal implementation ofAbstractSynchronizableContentsCollection.populate(Logger)- Specified by:
_internalPopulatein classAbstractSynchronizableContentsCollection- Parameters:
logger- The logger- Returns:
- The list of created/synchronized contents
-
-