public class SQLSynchronizableUDOrgunitCollection extends SQLSynchronizableContentsCollection
Modifier and Type | Field and Description |
---|---|
private static String |
__PARAM_LOGIN_USER_METADATA_NAME |
private static String |
__PARAM_SQL_LOGIN_USER_COLUMN_NAME |
private static String |
__PARAM_SQL_ORGUNIT_JOIN_COLUMN_NAME |
private static String |
__PARAM_SQL_ORGUNIT_REMOTE_ID_COLUMN_NAME |
private static String |
__PARAM_SQL_ROLE_USER_COLUMN_NAME |
private static String |
__PARAM_SQL_TABLE_USER |
protected ContentWorkflowHelper |
_contentWorkflowHelper
The content workflow helper
|
protected DeleteOrgUnitComponent |
_deleteOrgUnitComponent
The delete orgUnit component
|
protected OrganisationChartPageHandler |
_orgChartPageHandler
The organisation chart page handler
|
protected Map<String,String> |
_orgUnitParents
The map which link orgunit with this parent
|
protected Map<String,String> |
_orgUnitRemoteIds
The map which link orgunit with sql remote ids
|
protected Set<WorkflowAwareContent> |
_orgUnitsToApplyChanges
The set of orgunits to apply changes
|
protected Map<String,Map<String,String>> |
_orgUnitUsers
The map which link orgunit with users (userId and role)
|
protected OutgoingReferencesExtractor |
_outgoingReferencesExtractor
The OutgoingReferences extractor
|
protected SQLUserSearchDAO |
_sqlUserDAO
The sql user search DAO
|
protected CurrentUserProvider |
_userProvider
The current user provider
|
static String |
ORGUNIT_REMOTE_ID_INTERNAL_METADATA
The internal metadata name for orgUnit remote sql id
|
_sqlCollectionDAO
__PARAM_DATASOURCE_ID, __PARAM_FIELD_ID, __PARAM_MAPPING, __PARAM_MAPPING_ATTRIBUTE, __PARAM_MAPPING_METADATA_REF, __PARAM_MAPPING_SYNCHRO, _columnsAndCriteria, _extFields, _jsonUtils, _mapping, _syncFields
_contentHelper, _sccHelper, _synchronizingContentOperatorEP
_contentDAO, _contentTypeEP, _currentUserProvider, _hasGlobalError, _i18nUtils, _nbCreatedContents, _nbDeletedContents, _nbError, _nbNotChangedContents, _nbSynchronizedContents, _observationManager, _resolver, _synchroComponent, SCC_UNIQUE_ID
_contentPrefix, _contentType, _id, _initialActionId, _label, _languages, _modelId, _modelParamValues, _removalSync, _reportMails, _restrictedField, _searchModelConfiguration, _synchronizeActionId, _synchronizeExistingContentsOnly, _synchronizingContentOperator, _validateActionId, _validateAfterImport, _workflowName
COLLECTION_ID_PROPERTY
Constructor and Description |
---|
SQLSynchronizableUDOrgunitCollection() |
Modifier and Type | Method and Description |
---|---|
protected boolean |
_additionalOperations(ModifiableDefaultContent orgUnit,
Map<String,List<Object>> remoteValues,
Logger logger)
Do additional operations
|
private void |
_applyChanges(WorkflowAwareContent content,
int actionId,
String comment) |
protected void |
_fillOrgUnitUserMap(Map<String,Map<String,String>> orgUnitUsers,
String remoteOrgUnitKey,
String loginColumnName,
String roleColumnName,
Map<String,Object> normalizedUserMap,
Logger logger)
Fill the orgUnitUsers map
|
protected Content |
_getOrgUnitContentFromRemoteId(String remoteId,
String lang,
Logger logger)
Get orgunit content from the remote Id
|
protected Map<String,Map<String,String>> |
_getOrgUnitUser(Logger logger)
Get orgUnit user map
|
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
|
protected Map<String,Object> |
_getSearchUserParameters(String orgUnitColumnKey,
Logger logger)
Get the parameters map for user mybatis search
|
protected Content |
_getUserContent(String loginValue,
String lang,
Logger logger)
Get user content from login value
|
protected String |
_getUserIdValue(ModifiableDefaultContent userContent,
Logger logger)
Get the user id value
|
protected List<ModifiableDefaultContent> |
_importOrSynchronizeContent(String idValue,
String lang,
Map<String,List<Object>> remoteValues,
boolean forceImport,
Logger logger)
Imports or synchronizes a content for a given language
|
List<ModifiableDefaultContent> |
_internalPopulate(Logger logger)
Internal implementation of
AbstractSynchronizableContentsCollection.populate(Logger) |
protected void |
_setContentsRelationWithParentOrgunit(List<ModifiableDefaultContent> orgUnitContents,
Logger logger)
Set all orgunit parents relation for each synchronized content
|
protected void |
_setInvertRelationForUser(ModifiableDefaultContent orgUnitContent,
Content userContent)
Set invert relation for user
|
protected void |
_setRelationWithParentOrgunit(ModifiableDefaultContent parentContent,
ModifiableDefaultContent childContent,
Logger logger)
Set the relation between the orgunit parent and its child
|
protected boolean |
_synchronizeUserRepeater(ModifiableDefaultContent orgUnitContent,
Map<String,String> orgUnitUsers,
Logger logger)
True if the user repeater needs changes
|
protected boolean |
_synchronizeUserRepeaterOperation(ModifiableDefaultContent orgUnitContent,
String orgUnitIdValue,
Logger logger)
Synchronize user repeater for orgunit content
|
protected boolean |
additionalImportOperations(ModifiableDefaultContent content,
Map<String,List<Object>> remoteValues,
Map<String,Object> importParams,
Logger logger)
Add specific fields to the content.
|
protected boolean |
additionalSynchronizeOperations(ModifiableDefaultContent content,
Map<String,List<Object>> remoteValues,
Logger logger)
Add specific fields to the content.
|
protected void |
deleteUnexistingContents(Logger logger)
Delete contents created by a previous synchronization which does not exist anymore in remote source
|
String |
getLoginUserColumnName()
Get the login user column name
|
String |
getLoginUserMetadataName()
Get the login user metadata name
|
String |
getOrgunitJoinColumnNameForUser()
Get the name of the orgunit join column name of the user table
|
String |
getOrgUnitRemoteIdColumnName()
Get the orgunit remote id column name
|
String |
getRoleUserColumnName()
Get the role user column name
|
String |
getUserTableName()
Get the name of user SQL table
|
protected Map<String,Map<String,Object>> |
internalSearch(Map<String,Object> parameters,
int offset,
int limit,
List<Object> sort,
Logger logger)
Search values and return the result without any treatment.
|
List<ModifiableDefaultContent> |
populate(Logger logger)
Populates contents
|
protected void |
removeEntry(int position,
ModifiableCompositeMetadata repositoryComposite)
Removes the repeater entry at the given position.
|
void |
service(ServiceManager smanager) |
_checkIdObjectValue, _getNormalizedSearchResult, _getTotalCounParameters, _normalizeSearchResult, getTableName, getTotalCount
configureDataSource, configureSearchModel, getDataSourceId, getExternalOnlyFields, getIdField, getLocalAndExternalFields, getMapping, getRemoteValues, putIdParameter
_fillContent, _getContentsToRemove, _getIdFieldValue, _handleContent, _importContent, _importOrSynchronizeContent, _importOrSynchronizeContents, _isHandled, _synchronizeContent, additionalCommonOperations, configure, createContentAction, getContent, getTransformedRemoteValues, importContent, search, synchronizeContent, updateSyncInformations, validateContent
_getContentPathQuery, _getExpressionsList, _getMetadataHolder, _isParamNotEmpty, _removeEmptyParameters, _removeMetadataIfExists, _synchronizeMetadata, _updateRelation, _updateRelation, applyChanges, applyChanges, createContentAction, sendErrorMail, updateSCCProperty, validateContent
_parseLanguages, _parseParameters, configureStaticParams, getContentPrefix, getContentType, getId, getInitialActionId, getLabel, getLanguages, getParameterValues, getReportMails, getRestrictedField, getSearchModelConfiguration, getSynchronizeActionId, getSynchronizeCollectionModelId, getSynchronizingContentOperator, getValidateActionId, getWorkflowName, removalSync, synchronizeExistingContentsOnly, validateAfterImport
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
handleRightAssignmentContext
public static final String ORGUNIT_REMOTE_ID_INTERNAL_METADATA
private static final String __PARAM_SQL_TABLE_USER
private static final String __PARAM_SQL_ORGUNIT_JOIN_COLUMN_NAME
private static final String __PARAM_LOGIN_USER_METADATA_NAME
private static final String __PARAM_SQL_LOGIN_USER_COLUMN_NAME
private static final String __PARAM_SQL_ROLE_USER_COLUMN_NAME
private static final String __PARAM_SQL_ORGUNIT_REMOTE_ID_COLUMN_NAME
protected Map<String,String> _orgUnitParents
protected Map<String,Map<String,String>> _orgUnitUsers
protected Map<String,String> _orgUnitRemoteIds
protected Set<WorkflowAwareContent> _orgUnitsToApplyChanges
protected SQLUserSearchDAO _sqlUserDAO
protected OrganisationChartPageHandler _orgChartPageHandler
protected ContentWorkflowHelper _contentWorkflowHelper
protected CurrentUserProvider _userProvider
protected OutgoingReferencesExtractor _outgoingReferencesExtractor
protected DeleteOrgUnitComponent _deleteOrgUnitComponent
public SQLSynchronizableUDOrgunitCollection()
public void service(ServiceManager smanager) throws ServiceException
service
in interface Serviceable
service
in class SQLSynchronizableContentsCollection
ServiceException
public String getUserTableName()
public String getOrgunitJoinColumnNameForUser()
public String getLoginUserMetadataName()
public String getLoginUserColumnName()
public String getRoleUserColumnName()
public String getOrgUnitRemoteIdColumnName()
protected Map<String,Object> _getSearchParameters(Map<String,Object> parameters, int offset, int limit, List<Object> sort, List<String> columns)
SQLSynchronizableContentsCollection
_getSearchParameters
in class SQLSynchronizableContentsCollection
parameters
- the filter parameteroffset
- the offsetlimit
- the limitsort
- the sort mapcolumns
- the list of columnsprotected Map<String,Map<String,Object>> internalSearch(Map<String,Object> parameters, int offset, int limit, List<Object> sort, Logger logger)
AbstractSimpleSynchronizableContentsCollection
internalSearch
in class SQLSynchronizableContentsCollection
parameters
- Search parameters to restrict the searchoffset
- Begin of the searchlimit
- Number of resultssort
- Sort of results (ignored for LDAP results)logger
- The loggerpublic List<ModifiableDefaultContent> populate(Logger logger)
SynchronizableContentsCollection
populate
in interface SynchronizableContentsCollection
populate
in class AbstractSimpleSynchronizableContentsCollection
logger
- The loggerpublic List<ModifiableDefaultContent> _internalPopulate(Logger logger)
AbstractSynchronizableContentsCollection
AbstractSynchronizableContentsCollection.populate(Logger)
_internalPopulate
in class AbstractSimpleSynchronizableContentsCollection
logger
- The loggerprotected List<ModifiableDefaultContent> _importOrSynchronizeContent(String idValue, String lang, Map<String,List<Object>> remoteValues, boolean forceImport, Logger logger)
AbstractSimpleSynchronizableContentsCollection
_importOrSynchronizeContent
in class AbstractSimpleSynchronizableContentsCollection
idValue
- The unique identifier of the contentlang
- The language of content to import or synchronizeremoteValues
- The remote valuesforceImport
- To force import and ignoring the synchronize existing contents only optionlogger
- The loggerprotected boolean additionalSynchronizeOperations(ModifiableDefaultContent content, Map<String,List<Object>> remoteValues, Logger logger)
AbstractSimpleSynchronizableContentsCollection
additionalSynchronizeOperations
in class AbstractSimpleSynchronizableContentsCollection
content
- Content to updateremoteValues
- Values of the contentlogger
- The loggertrue
if there are changesprotected boolean additionalImportOperations(ModifiableDefaultContent content, Map<String,List<Object>> remoteValues, Map<String,Object> importParams, Logger logger)
AbstractSimpleSynchronizableContentsCollection
additionalImportOperations
in class AbstractSimpleSynchronizableContentsCollection
content
- Content to updateremoteValues
- Values of the contentimportParams
- Import parameterslogger
- The loggertrue
if there are changesprotected boolean _additionalOperations(ModifiableDefaultContent orgUnit, Map<String,List<Object>> remoteValues, Logger logger)
orgUnit
- the orgUnit contentremoteValues
- the remote valueslogger
- the loggerprotected Map<String,Map<String,String>> _getOrgUnitUser(Logger logger)
logger
- the loggerprotected void _fillOrgUnitUserMap(Map<String,Map<String,String>> orgUnitUsers, String remoteOrgUnitKey, String loginColumnName, String roleColumnName, Map<String,Object> normalizedUserMap, Logger logger)
orgUnitUsers
- the orgunit user mapremoteOrgUnitKey
- the remote keyloginColumnName
- the login column nameroleColumnName
- the role column namenormalizedUserMap
- the normalized search user maplogger
- the loggerprotected void _setContentsRelationWithParentOrgunit(List<ModifiableDefaultContent> orgUnitContents, Logger logger)
orgUnitContents
- the synchronized contentlogger
- the loggerprotected void _setRelationWithParentOrgunit(ModifiableDefaultContent parentContent, ModifiableDefaultContent childContent, Logger logger) throws com.opensymphony.workflow.WorkflowException
parentContent
- the parent contentchildContent
- the child contentlogger
- the loggercom.opensymphony.workflow.WorkflowException
- if an error occurredprivate void _applyChanges(WorkflowAwareContent content, int actionId, String comment) throws com.opensymphony.workflow.WorkflowException
com.opensymphony.workflow.WorkflowException
protected boolean _synchronizeUserRepeaterOperation(ModifiableDefaultContent orgUnitContent, String orgUnitIdValue, Logger logger) throws com.opensymphony.workflow.WorkflowException
orgUnitContent
- the orgunit contentorgUnitIdValue
- the orgUnit id valuelogger
- the loggercom.opensymphony.workflow.WorkflowException
- if an error occurredprotected boolean _synchronizeUserRepeater(ModifiableDefaultContent orgUnitContent, Map<String,String> orgUnitUsers, Logger logger) throws com.opensymphony.workflow.WorkflowException
orgUnitContent
- the orgUnit contentorgUnitUsers
- the map of orgunit userslogger
- the loggercom.opensymphony.workflow.WorkflowException
- if an error occurredprotected void _setInvertRelationForUser(ModifiableDefaultContent orgUnitContent, Content userContent) throws com.opensymphony.workflow.WorkflowException
orgUnitContent
- the orgUnit contentuserContent
- the user contentcom.opensymphony.workflow.WorkflowException
- if an error occurredprotected void removeEntry(int position, ModifiableCompositeMetadata repositoryComposite)
position
- The position of the entry to removerepositoryComposite
- the repository composite of the repeaterIllegalArgumentException
- if the position is not between the negative and positive repeater sizeprotected Content _getUserContent(String loginValue, String lang, Logger logger)
loginValue
- the login valuelang
- the languagelogger
- the loggerprotected Content _getOrgUnitContentFromRemoteId(String remoteId, String lang, Logger logger)
remoteId
- the remote Idlang
- the languagelogger
- the loggerprotected Map<String,Object> _getSearchUserParameters(String orgUnitColumnKey, Logger logger)
orgUnitColumnKey
- the column name of the orgunit keylogger
- the loggerprotected String _getUserIdValue(ModifiableDefaultContent userContent, Logger logger)
userContent
- the user contentlogger
- the loggerprotected void deleteUnexistingContents(Logger logger)
AbstractSynchronizableContentsCollection
deleteUnexistingContents
in class AbstractSynchronizableContentsCollection
logger
- The logger