Class AbstractApogeeSynchronizableContentsCollection
java.lang.Object
org.ametys.plugins.contentio.synchronize.AbstractStaticSynchronizableContentsCollection
org.ametys.plugins.contentio.synchronize.AbstractSynchronizableContentsCollection
org.ametys.plugins.contentio.synchronize.AbstractSimpleSynchronizableContentsCollection
org.ametys.plugins.odfsync.apogee.scc.AbstractApogeeSynchronizableContentsCollection
- All Implemented Interfaces:
SynchronizableContentsCollection
,ApogeeSynchronizableContentsCollection
,Configurable
,Contextualizable
,Serviceable
- Direct Known Subclasses:
AbstractApogeeSynchronizableContentsWithCatalogCollection
,OrgUnitSynchronizableContentsCollection
public abstract class AbstractApogeeSynchronizableContentsCollection
extends AbstractSimpleSynchronizableContentsCollection
implements Contextualizable, ApogeeSynchronizableContentsCollection
Abstract class for Apogee synchronization
-
Field Summary
Modifier and TypeFieldDescriptionprotected static final String
Name of paramter holding columnsprotected static final String
Name of paramter into columns holding columnprotected static final String
Name of parameter holding the criteriaprotected static final String
Name of parameter into criteria holding a criterionprotected static final String
Name of parameter into criterion holding the idprotected static final String
Name of parameter into criterion holding the labelprotected static final String
Name of parameter into criterion holding the typeprotected static final String
Name of parameter holding the field ID columnprotected static final String
Name of parameter holding the fields mappingprotected static final String
Name of parameter into mapping holding the remote attributeprotected static final String
Name of parameter into mapping holding the path of metadataprotected static final String
Name of parameter into mapping holding the synchronized propertyprotected Boolean
Parameter value to add existing children in Ametys on the current elementprotected Boolean
Parameter value to add unexisting children from Ametys on the current elementprotected ApogeeDAO
The DAO for remote DB ApogeeThe Apogee SCC helperSynchronized fieldsprotected Context
Contextprotected Set<ApogeeCriterion>
Synchronized fieldsprotected String
Name of the Apogée column which contains the IDprotected JSONUtils
The JSON utilsMapping between metadata and columnsprotected ODFHelper
The ODF helperprotected SynchronizableContentsCollectionDAO
SCC DAOSynchronized fieldsstatic final String
Name of parameter holding the link existing children parameterstatic final String
Name of parameter holding the adding unexisting children parameterstatic final String
Name of parameter holding the data source idstatic final String
Name of parameter holding the administrative yearFields 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, _ignoreRestrictions, _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, LAST_SYNCHRONIZATION_DATA_NAME, LAST_SYNCHRONIZATION_USER_DATA_NAME, RESULT_NB_CREATED_CONTENTS, RESULT_NB_DELETED_CONTENTS, RESULT_NB_NOT_CHANGED_CONTENTS, RESULT_NB_SYNCHRONIZED_CONTENTS
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
_addContentAttributes
(Request request, ModifiableContent content) Add attributes from content in the request.protected Object
_convertBigDecimal
(String contentTypeId, String attributeName, Object objectToConvert) Convert the object in parameter to a long if it's aBigDecimal
, otherwise return the object itself._convertBigDecimal
(List<Map<String, Object>> searchResults) Convert theBigDecimal
values retrieved from database into long values_getChildrenRemoteSyncCode
(Content content, SynchronizableContentsCollection scc, Logger logger) Get the remote sync codes_getChildrenSearchParametersWithParent
(String parentSyncCode) Get the children search parameters.protected String
protected List<ModifiableContent>
_importChildren
(String idValue, SynchronizableContentsCollection scc, Logger logger) Import childrenprotected ModifiableContent
_importContent
(String idValue, Map<String, Object> additionalParameters, String lang, Map<String, List<Object>> remoteValues, Logger logger) Import a content from remote values.protected List<ModifiableContent>
_importUnexistingChildren
(SynchronizableContentsCollection scc, String syncCode, Map<String, List<Object>> additionalParameters, Logger logger) Import an unexisting child in Ametysprotected List<ModifiableContent>
_internalPopulate
(Logger logger, ContainerProgressionTracker progressionTracker) Internal implementation ofAbstractSynchronizableContentsCollection.populate(Logger, ContainerProgressionTracker)
protected boolean
_isChildWillBeRemoved
(ModifiableContent content, SynchronizableContentsCollection scc, Set<String> childrenRemoteSyncCode, Logger logger) True if the content will be removed from the structureprotected void
_removeContentAttributes
(Request request) Remove attributes of the content from the request.Search the contents with the search parameters.protected List<ModifiableContent>
_synchronizeChildren
(Content content, SynchronizableContentsCollection scc, String attributeName, Logger logger) Synchronize childrenprotected ModifiableContent
_synchronizeContent
(ModifiableContent content, Map<String, List<Object>> remoteValues, Logger logger) Synchronize a content with remove values.protected Object
_transformClobToString
(Object value, String idValue, Logger logger) Transform CLOB value to String value._transformListOfMap2MapOfList
(List<Map<String, Object>> lines) protected boolean
Check if existing contents in Ametys should be added from data sourceprotected boolean
Check if unexisting contents in Ametys should be added from data sourceprotected void
configureDataSource
(Configuration configuration) Configure the data source parameters.protected void
Configure the search model used by SCCSearchTool.void
contextualize
(Context context) getAdditionalAttributeValues
(String idValue, Content content, Map<String, Object> additionalParameters, boolean create, Logger logger) Retrieves additional values to synchronize for a contentprotected abstract String
Get the attribute name to get childrenprotected String
Get the children SCC model id.Get the list of CLOB column's names.protected String
Get the id of data sourceprotected String
Get the identifier column (can be a concatened column).Get the path of metadata holding the unique identifierGet the languages handled by this collectiongetLocalAndExternalFields
(Map<String, Object> additionalParameters) Get the path of tri-state fields (with local and external values)protected abstract String
Get the name of the mapping.getNotSynchronizedRelatedContentIds
(Content content, Map<String, Object> contentValues, Map<String, Object> additionalParameters, String lang, Logger logger) Retrieves the ids of the contents related to the given content but that are not part of the synchronizationgetParentAttribute
(ModifiableContent parent) Retrieves the attribute to synchronize for the given parent (as aPair
of name and value)protected Optional<ModifiableContent>
getParentFromAdditionalParameters
(Map<String, Object> additionalParameters) Retrieves the parent id, extracted from additional parametersgetParentIdFromAdditionalParameters
(Map<String, Object> additionalParameters) Retrieves the parent id, extracted from additional parametersgetRemoteValues
(Map<String, Object> searchParameters, Logger logger) Search values and return the result organized by attributesint
getTotalCount
(Map<String, Object> searchParameters, Logger logger) Return the total number of results for the search.protected String
getYear()
Get the administrative yearprotected List<ModifiableContent>
handleChildren
(String idValue, Content content, boolean create, Logger logger) Import and synchronize children of the given content In the usual case, if we are in import mode (create to true) or if we trust the source (removalSync to true) we just synchronize structure but we don't synchronize child contentsboolean
Return true if aRightAssignmentContext
should be automatically generated for the contents of this SCCImport a content from remote values.protected List<ModifiableContent>
importOrSynchronizeChildren
(String idValue, Content content, String sccModelId, String attributeName, boolean create, Logger logger) Import and synchronize children of the given content In the usual case, if we are in import mode (create to true) or if we trust the source (removalSync to true) we just synchronize structure but we don't synchronize child contentsimportOrSynchronizeContents
(Map<String, Object> searchParams, Logger logger) Method used to import the structure of an ODF content or its dependencies, import or synchronize each child recursively.internalSearch
(Map<String, Object> searchParameters, int offset, int limit, List<Object> sort, Logger logger) Search values and return the result without any treatment.populate
(Logger logger, ContainerProgressionTracker progressionTracker) Populates contentsputIdParameter
(String idValue) Set search parameters for the ID value.void
service
(ServiceManager manager) void
synchronizeContent
(ModifiableContent content, Logger logger) Synchronize a content with remove values.Methods inherited from class org.ametys.plugins.contentio.synchronize.AbstractSimpleSynchronizableContentsCollection
_addEditInputsForSCC, _editContent, _fillContent, _getContentsToRemove, _getEditInputs, _getEditInputsContextParameters, _handleContent, _importOrSynchronizeContent, _importOrSynchronizeContent, _importOrSynchronizeContents, _importOrSynchronizeContents, _isHandled, _transformRemoteValues, configure, createContentAction, getContent, getTransformedRemoteValues, search, updateSyncInformations, validateContent
Methods inherited from class org.ametys.plugins.contentio.synchronize.AbstractSynchronizableContentsCollection
_deleteContents, _getAdditionalInputsForContentCreation, _getContentPathQuery, _getExpressionsList, _hasSomethingChanged, _internalPopulate, _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, getParameterValues, getReportMails, getRestrictedField, getSearchModelConfiguration, getSynchronizeActionId, getSynchronizeCollectionModelId, getSynchronizingContentOperator, getValidateActionId, getWorkflowName, ignoreRestrictions, 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
-
Field Details
-
PARAM_DATASOURCE_ID
Name of parameter holding the data source id- See Also:
-
PARAM_YEAR
Name of parameter holding the administrative year- See Also:
-
PARAM_ADD_UNEXISTING_CHILDREN
Name of parameter holding the adding unexisting children parameter- See Also:
-
PARAM_ADD_EXISTING_CHILDREN
Name of parameter holding the link existing children parameter- See Also:
-
__PARAM_ID_COLUMN
Name of parameter holding the field ID column- See Also:
-
__PARAM_MAPPING
Name of parameter holding the fields mapping- See Also:
-
__PARAM_MAPPING_SYNCHRO
Name of parameter into mapping holding the synchronized property- See Also:
-
__PARAM_MAPPING_METADATA_REF
Name of parameter into mapping holding the path of metadata- See Also:
-
__PARAM_MAPPING_ATTRIBUTE
Name of parameter into mapping holding the remote attribute- See Also:
-
__PARAM_CRITERIA
Name of parameter holding the criteria- See Also:
-
__PARAM_CRITERIA_CRITERION
Name of parameter into criteria holding a criterion- See Also:
-
__PARAM_CRITERIA_CRITERION_ID
Name of parameter into criterion holding the id- See Also:
-
__PARAM_CRITERIA_CRITERION_LABEL
Name of parameter into criterion holding the label- See Also:
-
__PARAM_CRITERIA_CRITERION_TYPE
Name of parameter into criterion holding the type- See Also:
-
__PARAM_COLUMNS
Name of paramter holding columns- See Also:
-
__PARAM_COLUMNS_COLUMN
Name of paramter into columns holding column- See Also:
-
_addUnexistingChildren
Parameter value to add unexisting children from Ametys on the current element -
_addExistingChildren
Parameter value to add existing children in Ametys on the current element -
_idColumn
Name of the Apogée column which contains the ID -
_mapping
Mapping between metadata and columns -
_syncFields
Synchronized fields -
_columns
Synchronized fields -
_criteria
Synchronized fields -
_context
Context -
_apogeeDAO
The DAO for remote DB Apogee -
_jsonUtils
The JSON utils -
_sccDAO
SCC DAO -
_odfHelper
The ODF helper -
_apogeeSCCHelper
The Apogee SCC helper
-
-
Constructor Details
-
AbstractApogeeSynchronizableContentsCollection
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Overrides:
service
in classAbstractSimpleSynchronizableContentsCollection
- Throws:
ServiceException
-
contextualize
- Specified by:
contextualize
in interfaceContextualizable
- Throws:
ContextException
-
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
-
populate
public List<ModifiableContent> populate(Logger logger, ContainerProgressionTracker progressionTracker) Description copied from interface:SynchronizableContentsCollection
Populates contents- Specified by:
populate
in interfaceSynchronizableContentsCollection
- Overrides:
populate
in classAbstractSimpleSynchronizableContentsCollection
- Parameters:
logger
- The loggerprogressionTracker
- A progression tracker- Returns:
- Return the populated contents (imported or synchronized)
-
_internalPopulate
protected List<ModifiableContent> _internalPopulate(Logger logger, ContainerProgressionTracker progressionTracker) Description copied from class:AbstractSynchronizableContentsCollection
Internal implementation ofAbstractSynchronizableContentsCollection.populate(Logger, ContainerProgressionTracker)
- Overrides:
_internalPopulate
in classAbstractSimpleSynchronizableContentsCollection
- Parameters:
logger
- The loggerprogressionTracker
- The progression tracker- Returns:
- The list of created/synchronized contents
-
internalSearch
protected Map<String,Map<String, internalSearchObject>> (Map<String, Object> searchParameters, int offset, int limit, List<Object> sort, 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.
-
getRemoteValues
protected Map<String,Map<String, getRemoteValuesList<Object>>> (Map<String, Object> searchParameters, Logger logger) Description copied from class:AbstractSimpleSynchronizableContentsCollection
Search values and return the result organized by attributes- Specified by:
getRemoteValues
in classAbstractSimpleSynchronizableContentsCollection
- Parameters:
searchParameters
- Search parameters to restrict the searchlogger
- The logger- Returns:
- Map of results organized by attributes.
-
getLanguages
Description copied from interface:SynchronizableContentsCollection
Get the languages handled by this collection- Specified by:
getLanguages
in interfaceSynchronizableContentsCollection
- Overrides:
getLanguages
in classAbstractStaticSynchronizableContentsCollection
- Returns:
- the list of language
-
importContent
public List<ModifiableContent> importContent(String idValue, Map<String, Object> additionalParameters, Logger logger) throws ExceptionDescription copied from interface:SynchronizableContentsCollection
Import a content from remote values.- Specified by:
importContent
in interfaceSynchronizableContentsCollection
- Overrides:
importContent
in classAbstractSimpleSynchronizableContentsCollection
- Parameters:
idValue
- Id (for import/synchronization) of the content to importadditionalParameters
- Additional parameterslogger
- The logger- Returns:
- A list of created contents
- Throws:
Exception
- if an error occurs.
-
synchronizeContent
Description copied from interface:SynchronizableContentsCollection
Synchronize a content with remove values.- Specified by:
synchronizeContent
in interfaceSynchronizableContentsCollection
- Overrides:
synchronizeContent
in classAbstractSimpleSynchronizableContentsCollection
- Parameters:
content
- The content to synchronizelogger
- The logger- Throws:
Exception
- if an error occurs.
-
_addContentAttributes
Add attributes from content in the request.- Parameters:
request
- The requestcontent
- The content
-
_removeContentAttributes
Remove attributes of the content from the request.- Parameters:
request
- The request
-
putIdParameter
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
-
_search
protected abstract List<Map<String,Object>> _search(Map<String, Object> searchParameters, Logger logger) Search the contents with the search parameters. Use id parameter to search an unique content.- Parameters:
searchParameters
- Search parameterslogger
- The logger- Returns:
- A Map of mapped metadatas extract from Apogée database ordered by content unique Apogée ID
-
_convertBigDecimal
Convert theBigDecimal
values retrieved from database into long values- Parameters:
searchResults
- The initial search results from database- Returns:
- The converted search results
-
_convertBigDecimal
protected Object _convertBigDecimal(String contentTypeId, String attributeName, Object objectToConvert) Convert the object in parameter to a long if it's aBigDecimal
, otherwise return the object itself.- Parameters:
contentTypeId
- The content type of the parent contentattributeName
- The metadata nameobjectToConvert
- The object to convert if necessary- Returns:
- The converted object
-
_transformClobToString
Transform CLOB value to String value.- Parameters:
value
- The input valueidValue
- The identifier of the programlogger
- The logger- Returns:
- the same value, with CLOB transformed to String.
-
getClobColumns
Get the list of CLOB column's names.- Returns:
- The list of the CLOB column's names to transform to
String
-
_transformListOfMap2MapOfList
-
getMappingName
Get the name of the mapping.- Returns:
- the mapping name
-
getDataSourceId
Get the id of data source- Returns:
- The id of data source
-
getYear
Get the administrative year- Returns:
- The administrative year
-
addUnexistingChildren
Check if unexisting contents in Ametys should be added from data source- Returns:
true
if unexisting contents in Ametys should be added from data source, default value istrue
-
addExistingChildren
Check if existing contents in Ametys should be added from data source- Returns:
true
if existing contents in Ametys should be added from data source, default value isfalse
-
getIdColumn
Get the identifier column (can be a concatened column).- Returns:
- the column id
-
getIdField
Description copied from interface:SynchronizableContentsCollection
Get the path of metadata holding the unique identifier- Specified by:
getIdField
in interfaceSynchronizableContentsCollection
- 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)- Specified by:
getLocalAndExternalFields
in interfaceSynchronizableContentsCollection
- Parameters:
additionalParameters
- Additional parameters- Returns:
- the synchronized fields
-
configureSearchModel
Description copied from class:AbstractStaticSynchronizableContentsCollection
Configure the search model used by SCCSearchTool.- Specified by:
configureSearchModel
in classAbstractStaticSynchronizableContentsCollection
-
getAdditionalAttributeValues
protected Map<String,Object> getAdditionalAttributeValues(String idValue, Content content, Map<String, Object> additionalParameters, boolean create, Logger logger) Description copied from class:AbstractSimpleSynchronizableContentsCollection
Retrieves additional values to synchronize for a content- Overrides:
getAdditionalAttributeValues
in classAbstractSimpleSynchronizableContentsCollection
- Parameters:
idValue
- id value of the contentcontent
- The contentadditionalParameters
- Additional parameterscreate
-true
if the content has been newly created,false
otherwiselogger
- The logger- Returns:
- the values to add
-
getParentAttribute
Retrieves the attribute to synchronize for the given parent (as aPair
of name and value)- Parameters:
parent
- the parent content- Returns:
- the parent attribute
-
handleChildren
protected List<ModifiableContent> handleChildren(String idValue, Content content, boolean create, Logger logger) Import and synchronize children of the given content In the usual case, if we are in import mode (create to true) or if we trust the source (removalSync to true) we just synchronize structure but we don't synchronize child contents- Parameters:
idValue
- The current content synchronization codecontent
- The current contentcreate
-true
if the content has been newly createdlogger
- The logger- Returns:
- The handled children
-
getNotSynchronizedRelatedContentIds
protected Set<String> getNotSynchronizedRelatedContentIds(Content content, Map<String, Object> contentValues, Map<String, Object> additionalParameters, String lang, Logger logger) Description copied from class:AbstractSimpleSynchronizableContentsCollection
Retrieves the ids of the contents related to the given content but that are not part of the synchronization- Overrides:
getNotSynchronizedRelatedContentIds
in classAbstractSimpleSynchronizableContentsCollection
- Parameters:
content
- contentcontentValues
- the content values that will be setadditionalParameters
- Additional parameterslang
- Language of the contentlogger
- The logger- Returns:
- the ids of the contents that are not part of the synchronization
-
getParentFromAdditionalParameters
protected Optional<ModifiableContent> getParentFromAdditionalParameters(Map<String, Object> additionalParameters) Retrieves the parent id, extracted from additional parameters- Parameters:
additionalParameters
- the additional parameters- Returns:
- the parent id
-
getParentIdFromAdditionalParameters
protected Optional<String> getParentIdFromAdditionalParameters(Map<String, Object> additionalParameters) Retrieves the parent id, extracted from additional parameters- Parameters:
additionalParameters
- the additional parameters- Returns:
- the parent id
-
getChildrenSCCModelId
Get the children SCC model id. Can be null if no implementation is defined.- Returns:
- the children SCC model id
-
getChildrenAttributeName
Get the attribute name to get children- Returns:
- the attribute name to get children
-
_getSort
- Parameters:
sortList
- The sort list object to transform to the list of ordered fields compatible with SQL.- Returns:
- A string representing the list of ordered fields
-
getTotalCount
Description copied from interface:SynchronizableContentsCollection
Return the total number of results for the search.- Specified by:
getTotalCount
in interfaceSynchronizableContentsCollection
- Overrides:
getTotalCount
in classAbstractSimpleSynchronizableContentsCollection
- Parameters:
searchParameters
- Parameters for the searchlogger
- The logger- Returns:
- The total count
-
_importContent
protected ModifiableContent _importContent(String idValue, Map<String, Object> additionalParameters, String lang, Map<String, throws ExceptionList<Object>> remoteValues, Logger logger) Description copied from class:AbstractSimpleSynchronizableContentsCollection
Import a content from remote values.- Overrides:
_importContent
in classAbstractSimpleSynchronizableContentsCollection
- Parameters:
idValue
- Id (for import/synchronization) of the content to importadditionalParameters
- Specific parameters for importlang
- Lang of the contentremoteValues
- Values of the contentlogger
- The logger- Returns:
- The content created by import, or null
- Throws:
Exception
- if an error occurs.
-
_synchronizeContent
protected ModifiableContent _synchronizeContent(ModifiableContent content, Map<String, List<Object>> remoteValues, Logger logger) throws ExceptionDescription copied from class:AbstractSimpleSynchronizableContentsCollection
Synchronize a content with remove values.- Overrides:
_synchronizeContent
in classAbstractSimpleSynchronizableContentsCollection
- Parameters:
content
- The content to synchronizeremoteValues
- Values to synchronizelogger
- The logger- Returns:
- The synchronized content
- Throws:
Exception
- if an error occurs
-
importOrSynchronizeChildren
protected List<ModifiableContent> importOrSynchronizeChildren(String idValue, Content content, String sccModelId, String attributeName, boolean create, Logger logger) Import and synchronize children of the given content In the usual case, if we are in import mode (create to true) or if we trust the source (removalSync to true) we just synchronize structure but we don't synchronize child contents- Parameters:
idValue
- The parent content synchronization codecontent
- The parent contentsccModelId
- SCC model IDattributeName
- The name of the attribute containing childrencreate
-true
if the content has been newly createdlogger
- The logger- Returns:
- The imported or synchronized children
-
_importChildren
protected List<ModifiableContent> _importChildren(String idValue, SynchronizableContentsCollection scc, Logger logger) Import children- Parameters:
idValue
- The parent content synchronization codescc
- The SCClogger
- The logger- Returns:
- The imported children
-
_synchronizeChildren
protected List<ModifiableContent> _synchronizeChildren(Content content, SynchronizableContentsCollection scc, String attributeName, Logger logger) Synchronize children- Parameters:
content
- Parent contentscc
- The SCCattributeName
- The name of the attribute containing childrenlogger
- The logger- Returns:
true
if there are changes
-
_getChildrenRemoteSyncCode
protected Set<String> _getChildrenRemoteSyncCode(Content content, SynchronizableContentsCollection scc, Logger logger) Get the remote sync codes- Parameters:
content
- Parent contentscc
- the scclogger
- The logger- Returns:
- the remote sync codes or null if the scc is not from Apogee
-
_getChildrenSearchParametersWithParent
Get the children search parameters.- Parameters:
parentSyncCode
- The parent synchronization code- Returns:
- a
Map
of search parameters
-
_importUnexistingChildren
protected List<ModifiableContent> _importUnexistingChildren(SynchronizableContentsCollection scc, String syncCode, Map<String, List<Object>> additionalParameters, Logger logger) Import an unexisting child in Ametys- Parameters:
scc
- the scc to import the contentsyncCode
- the sync code of the contentadditionalParameters
- the additional paramslogger
- the logger- Returns:
- the list of created children
-
_isChildWillBeRemoved
protected boolean _isChildWillBeRemoved(ModifiableContent content, SynchronizableContentsCollection scc, Set<String> childrenRemoteSyncCode, Logger logger) True if the content will be removed from the structure- Parameters:
content
- the contentscc
- the sccchildrenRemoteSyncCode
- the remote sync codeslogger
- the logger- Returns:
true
if the content will be removed from the structure
-
importOrSynchronizeContents
public List<ModifiableContent> importOrSynchronizeContents(Map<String, Object> searchParams, Logger logger) Description copied from interface:ApogeeSynchronizableContentsCollection
Method used to import the structure of an ODF content or its dependencies, import or synchronize each child recursively.- Specified by:
importOrSynchronizeContents
in interfaceApogeeSynchronizableContentsCollection
- Parameters:
searchParams
- Search parameterslogger
- The logger- Returns:
- The
List
ofModifiableContent
of children (imported or synchronized)
-
handleRightAssignmentContext
Description copied from interface:SynchronizableContentsCollection
Return true if aRightAssignmentContext
should be automatically generated for the contents of this SCC- Specified by:
handleRightAssignmentContext
in interfaceSynchronizableContentsCollection
- Returns:
- true to automatically generate a
RightAssignmentContext
. Return false if the rights of contents of this SCC are handle by its ownRightAssignmentContext
-