Class AbstractDataSourceSynchronizableContentsCollection
- java.lang.Object
-
- org.ametys.plugins.contentio.synchronize.AbstractStaticSynchronizableContentsCollection
-
- org.ametys.plugins.contentio.synchronize.AbstractSynchronizableContentsCollection
-
- org.ametys.plugins.contentio.synchronize.AbstractSimpleSynchronizableContentsCollection
-
- org.ametys.plugins.contentio.synchronize.impl.AbstractDataSourceSynchronizableContentsCollection
-
- All Implemented Interfaces:
SynchronizableContentsCollection
,Configurable
,Serviceable
- Direct Known Subclasses:
LDAPSynchronizableContentsCollection
,SQLSynchronizableContentsCollection
public abstract class AbstractDataSourceSynchronizableContentsCollection extends AbstractSimpleSynchronizableContentsCollection
Abstract implementation ofSynchronizableContentsCollection
to be synchronized with a data source
-
-
Field Summary
Fields Modifier and Type Field Description protected static String
__PARAM_DATASOURCE_ID
Name of parameter holding the data source idprotected static String
__PARAM_FIELD_ID
Name of parameter holding the data source idprotected static String
__PARAM_MAPPING
Name of parameter holding the fields mappingprotected static String
__PARAM_MAPPING_ATTRIBUTE
Name of parameter into mapping holding the remote attributeprotected static String
__PARAM_MAPPING_METADATA_REF
Name of parameter into mapping holding the path of metadataprotected static String
__PARAM_MAPPING_SYNCHRO
Name of parameter into mapping holding the synchronized propertyprotected Set<String>
_columnsAndCriteria
Columns and criteria for searchprotected Set<String>
_extFields
External fieldsprotected JSONUtils
_jsonUtils
The JSON Utilsprotected Map<String,List<String>>
_mapping
Mapping of the metadata with source dataprotected Set<String>
_syncFields
Synchronized fields-
Fields inherited from class org.ametys.plugins.contentio.synchronize.AbstractSimpleSynchronizableContentsCollection
_contentHelper, _sccHelper, _synchronizingContentOperatorEP
-
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 AbstractDataSourceSynchronizableContentsCollection()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
configureDataSource(Configuration configuration)
Configure the data source parameters.protected void
configureSearchModel()
Configure the search model used by SCCSearchTool.String
getDataSourceId()
Get the id of data sourceSet<String>
getExternalOnlyFields(Map<String,Object> additionalParameters)
Get the path of field that are valued externally only.String
getIdField()
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)Map<String,List<String>>
getMapping()
Get the field mappingprotected Map<String,Map<String,List<Object>>>
getRemoteValues(Map<String,Object> parameters, org.slf4j.Logger logger)
Search values and return the result organized by metadataprotected Map<String,Object>
putIdParameter(String idValue)
Set search parameters for the ID value.void
service(ServiceManager smanager)
-
Methods inherited from class org.ametys.plugins.contentio.synchronize.AbstractSimpleSynchronizableContentsCollection
_fillContent, _getContentsToRemove, _getIdFieldValue, _handleContent, _importContent, _importOrSynchronizeContent, _importOrSynchronizeContent, _importOrSynchronizeContents, _internalPopulate, _isHandled, _synchronizeContent, additionalCommonOperations, additionalImportOperations, additionalSynchronizeOperations, configure, createContentAction, getContent, getTotalCount, getTransformedRemoteValues, importContent, internalSearch, populate, search, synchronizeContent, updateSyncInformations, validateContent
-
Methods inherited from class org.ametys.plugins.contentio.synchronize.AbstractSynchronizableContentsCollection
_getContentPathQuery, _getExpressionsList, _getMetadataHolder, _isParamNotEmpty, _removeEmptyParameters, _removeMetadataIfExists, _synchronizeMetadata, _updateRelation, _updateRelation, applyChanges, applyChanges, createContentAction, deleteUnexistingContents, sendErrorMail, updateSCCProperty, validateContent
-
Methods inherited from class org.ametys.plugins.contentio.synchronize.AbstractStaticSynchronizableContentsCollection
_parseLanguages, _parseParameters, 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
-
-
-
-
Field Detail
-
__PARAM_DATASOURCE_ID
protected static final String __PARAM_DATASOURCE_ID
Name of parameter holding the data source id- See Also:
- Constant Field Values
-
__PARAM_FIELD_ID
protected static final String __PARAM_FIELD_ID
Name of parameter holding the data source id- See Also:
- Constant Field Values
-
__PARAM_MAPPING
protected static final String __PARAM_MAPPING
Name of parameter holding the fields mapping- See Also:
- Constant Field Values
-
__PARAM_MAPPING_SYNCHRO
protected static final String __PARAM_MAPPING_SYNCHRO
Name of parameter into mapping holding the synchronized property- See Also:
- Constant Field Values
-
__PARAM_MAPPING_METADATA_REF
protected static final String __PARAM_MAPPING_METADATA_REF
Name of parameter into mapping holding the path of metadata- See Also:
- Constant Field Values
-
__PARAM_MAPPING_ATTRIBUTE
protected static final String __PARAM_MAPPING_ATTRIBUTE
Name of parameter into mapping holding the remote attribute- See Also:
- Constant Field Values
-
_jsonUtils
protected JSONUtils _jsonUtils
The JSON Utils
-
_columnsAndCriteria
protected Set<String> _columnsAndCriteria
Columns and criteria for search
-
_syncFields
protected Set<String> _syncFields
Synchronized fields
-
_extFields
protected Set<String> _extFields
External fields
-
-
Constructor Detail
-
AbstractDataSourceSynchronizableContentsCollection
public AbstractDataSourceSynchronizableContentsCollection()
-
-
Method Detail
-
service
public void service(ServiceManager smanager) throws ServiceException
- Specified by:
service
in interfaceServiceable
- Overrides:
service
in classAbstractSimpleSynchronizableContentsCollection
- Throws:
ServiceException
-
getIdField
public String getIdField()
Description copied from interface:SynchronizableContentsCollection
Get the path of metadata holding the unique identifier- Returns:
- the path to the metadata. Can be null.
-
getDataSourceId
public String getDataSourceId()
Get the id of data source- Returns:
- The id of data source
-
configureDataSource
protected void configureDataSource(Configuration configuration) throws ConfigurationException
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
protected void configureSearchModel()
Description copied from class:AbstractStaticSynchronizableContentsCollection
Configure the search model used by SCCSearchTool.- Specified by:
configureSearchModel
in classAbstractStaticSynchronizableContentsCollection
-
getExternalOnlyFields
public Set<String> getExternalOnlyFields(Map<String,Object> additionalParameters)
Description copied from interface:SynchronizableContentsCollection
Get the path of field that are valued externally only.- Parameters:
additionalParameters
- Additional parameters- Returns:
- the external fields
-
getLocalAndExternalFields
public Set<String> getLocalAndExternalFields(Map<String,Object> additionalParameters)
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
-
getMapping
public Map<String,List<String>> getMapping()
Get the field mapping- Returns:
- The mapping
-
putIdParameter
protected Map<String,Object> putIdParameter(String idValue)
Description copied from class:AbstractSimpleSynchronizableContentsCollection
Set search parameters for the ID value.- Specified by:
putIdParameter
in classAbstractSimpleSynchronizableContentsCollection
- Parameters:
idValue
- Value to search- Returns:
- Map with the search parameters
-
getRemoteValues
protected Map<String,Map<String,List<Object>>> getRemoteValues(Map<String,Object> parameters, org.slf4j.Logger logger)
Description copied from class:AbstractSimpleSynchronizableContentsCollection
Search values and return the result organized by metadata- Specified by:
getRemoteValues
in classAbstractSimpleSynchronizableContentsCollection
- Parameters:
parameters
- Search parameters to restrict the searchlogger
- The logger- Returns:
- Map of results organized by metadata.
-
-