Class SQLSynchronizableContentsCollection
- 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
-
- org.ametys.plugins.contentio.synchronize.impl.SQLSynchronizableContentsCollection
-
- All Implemented Interfaces:
SynchronizableContentsCollection
,Component
,Configurable
,Serviceable
- Direct Known Subclasses:
SQLSynchronizableUDOrgunitCollection
,SQLSynchronizableUsersCollection
public class SQLSynchronizableContentsCollection extends AbstractDataSourceSynchronizableContentsCollection implements Component
Implementation ofSynchronizableContentsCollection
to be synchronized with a LDAP data source
-
-
Field Summary
Fields Modifier and Type Field Description protected SQLCollectionDAO
_sqlCollectionDAO
The SQL collection DAO-
Fields inherited from class org.ametys.plugins.contentio.synchronize.impl.AbstractDataSourceSynchronizableContentsCollection
__PARAM_DATASOURCE_ID, __PARAM_FIELD_ID, __PARAM_MAPPING, __PARAM_MAPPING_ATTRIBUTE, __PARAM_MAPPING_METADATA_REF, __PARAM_MAPPING_SYNCHRO, _columnsAndCriteria, _jsonUtils, _mapping, _syncFields
-
Fields inherited from class org.ametys.plugins.contentio.synchronize.AbstractSimpleSynchronizableContentsCollection
_contentHelper, _synchronizingContentOperatorEP
-
Fields inherited from class org.ametys.plugins.contentio.synchronize.AbstractSynchronizableContentsCollection
_contentWorkflowHelper, _currentUserProvider, _hasGlobalError, _i18nUtils, _nbCreatedContents, _nbDeletedContents, _nbError, _nbNotChangedContents, _nbSynchronizedContents, _observationManager, SCC_UNIQUE_ID
-
Fields inherited from class org.ametys.plugins.contentio.synchronize.AbstractStaticSynchronizableContentsCollection
_contentDAO, _contentPrefix, _contentType, _contentTypeEP, _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_DATA_NAME, RESULT_NB_CREATED_CONTENTS, RESULT_NB_DELETED_CONTENTS, RESULT_NB_NOT_CHANGED_CONTENTS, RESULT_NB_SYNCHRONIZED_CONTENTS
-
-
Constructor Summary
Constructors Constructor Description SQLSynchronizableContentsCollection()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
_checkIdObjectValue(String remoteKey, Object idObjectValue, org.slf4j.Logger logger)
Check if the id object value is correctprotected Map<String,Object>
_getNormalizedSearchResult(List<String> columns, Map<String,Object> searchResult)
Get normalized search result Indeed we need to normalize the search result for each database type For example, with Oracle, the returned SQL column names are uppercased so we need to retrieve for each returned column its real name for the mapping,protected Map<String,Object>
_getSearchParameters(Map<String,Object> parameters, int offset, int limit, List<Object> sort, List<String> columns)
Get the parameters map for mybatis searchprotected Map<String,Object>
_getTotalCounParameters(Map<String,Object> parameters)
Get the parameters map for mybatis total countprotected Map<String,Map<String,Object>>
_normalizeSearchResult(String remoteKey, List<String> columns, List<Map<String,Object>> searchResults, org.slf4j.Logger logger)
We need to normalize the search result for each database type For example, with Oracle, the returned SQL column names are upper-cased so we need to retrieve for each returned column its real name for the mapping,String
getTableName()
Get the name of SQL tableint
getTotalCount(Map<String,Object> parameters, org.slf4j.Logger logger)
Return the total number of results for the search.protected Map<String,Map<String,Object>>
internalSearch(Map<String,Object> searchParameters, int offset, int limit, List<Object> sort, org.slf4j.Logger logger)
Search values and return the result without any treatment.void
service(ServiceManager smanager)
-
Methods inherited from class org.ametys.plugins.contentio.synchronize.impl.AbstractDataSourceSynchronizableContentsCollection
configureDataSource, configureSearchModel, getDataSourceId, getIdField, getLocalAndExternalFields, getMapping, getRemoteValues, putIdParameter
-
Methods inherited from class org.ametys.plugins.contentio.synchronize.AbstractSimpleSynchronizableContentsCollection
_editContent, _fillContent, _getContentsToRemove, _handleContent, _importContent, _importOrSynchronizeContent, _importOrSynchronizeContent, _importOrSynchronizeContents, _internalPopulate, _isHandled, _synchronizeContent, _transformRemoteValues, configure, createContentAction, getAdditionalAttributeValues, getContent, getNotSynchronizedRelatedContentIds, getTransformedRemoteValues, importContent, populate, search, synchronizeContent, updateSyncInformations, validateContent
-
Methods inherited from class org.ametys.plugins.contentio.synchronize.AbstractSynchronizableContentsCollection
_deleteContents, _getAdditionalInputsForContentCreation, _getContentPathQuery, _getExpressionsList, _hasSomethingChanged, _isParamNotEmpty, _logSynchronizationResult, _removeEmptyParameters, createContentAction, deleteUnexistingContents, empty, getSynchronizationResult, sendErrorMail, validateContent
-
Methods inherited from class org.ametys.plugins.contentio.synchronize.AbstractStaticSynchronizableContentsCollection
_parseLanguages, _parseParameters, _transformRemoteValuesCardinality, 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
additionalCommonOperations, additionalImportOperations, additionalSynchronizeOperations, handleRightAssignmentContext
-
-
-
-
Field Detail
-
_sqlCollectionDAO
protected SQLCollectionDAO _sqlCollectionDAO
The SQL collection DAO
-
-
Constructor Detail
-
SQLSynchronizableContentsCollection
public SQLSynchronizableContentsCollection()
-
-
Method Detail
-
service
public void service(ServiceManager smanager) throws ServiceException
- Specified by:
service
in interfaceServiceable
- Overrides:
service
in classAbstractDataSourceSynchronizableContentsCollection
- Throws:
ServiceException
-
getTableName
public String getTableName()
Get the name of SQL table- Returns:
- The SQL table name
-
internalSearch
protected Map<String,Map<String,Object>> internalSearch(Map<String,Object> searchParameters, int offset, int limit, List<Object> sort, org.slf4j.Logger logger)
Description copied from class:AbstractSimpleSynchronizableContentsCollection
Search values and return the result without any treatment.- Specified by:
internalSearch
in classAbstractSimpleSynchronizableContentsCollection
- Parameters:
searchParameters
- Search parameters to restrict the searchoffset
- Begin of the searchlimit
- Number of resultssort
- Sort of results (ignored for LDAP results)logger
- The logger- Returns:
- Map of results without any treatment.
-
_getSearchParameters
protected Map<String,Object> _getSearchParameters(Map<String,Object> parameters, int offset, int limit, List<Object> sort, List<String> columns)
Get the parameters map for mybatis search- Parameters:
parameters
- the filter parameteroffset
- the offsetlimit
- the limitsort
- the sort mapcolumns
- the list of columns- Returns:
- the parameter map
-
_normalizeSearchResult
protected Map<String,Map<String,Object>> _normalizeSearchResult(String remoteKey, List<String> columns, List<Map<String,Object>> searchResults, org.slf4j.Logger logger)
We need to normalize the search result for each database type For example, with Oracle, the returned SQL column names are upper-cased so we need to retrieve for each returned column its real name for the mapping,- Parameters:
remoteKey
- the remote key handling the idcolumns
- the list of columnssearchResults
- the search result maplogger
- the logger- Returns:
- the normalize search result map
-
_checkIdObjectValue
protected boolean _checkIdObjectValue(String remoteKey, Object idObjectValue, org.slf4j.Logger logger)
Check if the id object value is correct- Parameters:
remoteKey
- the remove keyidObjectValue
- the id object valuelogger
- the logger- Returns:
- true if the id object value is correct
-
_getNormalizedSearchResult
protected Map<String,Object> _getNormalizedSearchResult(List<String> columns, Map<String,Object> searchResult)
Get normalized search result Indeed we need to normalize the search result for each database type For example, with Oracle, the returned SQL column names are uppercased so we need to retrieve for each returned column its real name for the mapping,- Parameters:
columns
- the columns listsearchResult
- the search result- Returns:
- the normalized search result
-
getTotalCount
public int getTotalCount(Map<String,Object> parameters, org.slf4j.Logger logger)
Description copied from interface:SynchronizableContentsCollection
Return the total number of results for the search.- Specified by:
getTotalCount
in interfaceSynchronizableContentsCollection
- Overrides:
getTotalCount
in classAbstractSimpleSynchronizableContentsCollection
- Parameters:
parameters
- Parameters for the searchlogger
- The logger- Returns:
- The total count
-
-