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
FieldsModifier and TypeFieldDescriptionprotected static final StringName of paramter holding columnsprotected static final StringName of paramter into columns holding columnprotected static final StringName of parameter holding the criteriaprotected static final StringName of parameter into criteria holding a criterionprotected static final StringName of parameter into criterion holding the idprotected static final StringName of parameter into criterion holding the labelprotected static final StringName of parameter into criterion holding the typeprotected static final StringName of parameter holding the field ID columnprotected static final StringName of parameter holding the fields mappingprotected static final StringName of parameter into mapping holding the remote attributeprotected static final StringName of parameter into mapping holding the path of metadataprotected static final StringName of parameter into mapping holding the synchronized propertyprotected BooleanParameter value to add existing children in Ametys on the current elementprotected BooleanParameter value to add unexisting children from Ametys on the current elementprotected ApogeeDAOThe DAO for remote DB ApogeeThe Apogee SCC helperSynchronized fieldsprotected ContextContextprotected Set<ApogeeCriterion>Synchronized fieldsprotected StringName of the Apogée column which contains the IDprotected JSONUtilsThe JSON utilsMapping between metadata and columnsprotected ODFHelperThe ODF helperprotected SynchronizableContentsCollectionDAOSCC DAOSynchronized fieldsstatic final StringName of parameter holding the link existing children parameterstatic final StringName of parameter holding the adding unexisting children parameterstatic final StringName of parameter holding the data source idstatic final StringName of parameter holding the administrative yearFields inherited from class org.ametys.plugins.contentio.synchronize.AbstractSimpleSynchronizableContentsCollection
_contentHelper, _synchronizingContentOperatorEPFields inherited from class org.ametys.plugins.contentio.synchronize.AbstractSynchronizableContentsCollection
_contentWorkflowHelper, _currentUserProvider, _hasGlobalError, _i18nUtils, _nbCreatedContents, _nbDeletedContents, _nbError, _nbNotChangedContents, _nbSynchronizedContents, _observationManager, SCC_UNIQUE_IDFields 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, _workflowNameFields 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
Constructors -
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 theBigDecimalvalues retrieved from database into long values_getChildrenRemoteSyncCode(Content content, SynchronizableContentsCollection scc, org.slf4j.Logger logger) Get the remote sync codes_getChildrenSearchParametersWithParent(String parentSyncCode) Get the children search parameters.protected Stringprotected List<ModifiableContent>_importChildren(String idValue, SynchronizableContentsCollection scc, org.slf4j.Logger logger) Import childrenprotected ModifiableContent_importContent(String idValue, Map<String, Object> additionalParameters, String lang, Map<String, List<Object>> remoteValues, org.slf4j.Logger logger) Import a content from remote values.protected List<ModifiableContent>_importUnexistingChildren(SynchronizableContentsCollection scc, String syncCode, Map<String, List<Object>> additionalParameters, org.slf4j.Logger logger) Import an unexisting child in Ametysprotected List<ModifiableContent>_internalPopulate(org.slf4j.Logger logger, ContainerProgressionTracker progressionTracker) Internal implementation ofAbstractSynchronizableContentsCollection.populate(Logger, ContainerProgressionTracker)protected boolean_isChildWillBeRemoved(ModifiableContent content, SynchronizableContentsCollection scc, Set<String> childrenRemoteSyncCode, org.slf4j.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, org.slf4j.Logger logger) Synchronize childrenprotected ModifiableContent_synchronizeContent(ModifiableContent content, Map<String, List<Object>> remoteValues, org.slf4j.Logger logger) Synchronize a content with remove values.protected Object_transformClobToString(Object value, String idValue, org.slf4j.Logger logger) Transform CLOB value to String value._transformListOfMap2MapOfList(List<Map<String, Object>> lines) protected booleanCheck if existing contents in Ametys should be added from data sourceprotected booleanCheck if unexisting contents in Ametys should be added from data sourceprotected voidconfigureDataSource(Configuration configuration) Configure the data source parameters.protected voidConfigure the search model used by SCCSearchTool.voidcontextualize(Context context) getAdditionalAttributeValues(String idValue, Content content, Map<String, Object> additionalParameters, boolean create, org.slf4j.Logger logger) Retrieves additional values to synchronize for a contentprotected abstract StringGet the attribute name to get childrenprotected StringGet the children SCC model id.Get the list of CLOB column's names.protected StringGet the id of data sourceprotected StringGet 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 StringGet the name of the mapping.getNotSynchronizedRelatedContentIds(Content content, Map<String, Object> contentValues, Map<String, Object> additionalParameters, String lang, org.slf4j.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 aPairof 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, org.slf4j.Logger logger) Search values and return the result organized by attributesintgetTotalCount(Map<String, Object> searchParameters, org.slf4j.Logger logger) Return the total number of results for the search.protected StringgetYear()Get the administrative yearprotected List<ModifiableContent>handleChildren(String idValue, Content content, boolean create, org.slf4j.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 contentsbooleanReturn true if aRightAssignmentContextshould be automatically generated for the contents of this SCCimportContent(String idValue, Map<String, Object> additionalParameters, org.slf4j.Logger logger) Import a content from remote values.protected List<ModifiableContent>importOrSynchronizeChildren(String idValue, Content content, String sccModelId, String attributeName, boolean create, org.slf4j.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, org.slf4j.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, org.slf4j.Logger logger) Search values and return the result without any treatment.populate(org.slf4j.Logger logger, ContainerProgressionTracker progressionTracker) Populates contentsputIdParameter(String idValue) Set search parameters for the ID value.voidservice(ServiceManager manager) voidsynchronizeContent(ModifiableContent content, org.slf4j.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, validateContentMethods inherited from class org.ametys.plugins.contentio.synchronize.AbstractSynchronizableContentsCollection
_deleteContents, _getAdditionalInputsForContentCreation, _getContentPathQuery, _getExpressionsList, _hasSomethingChanged, _internalPopulate, _isParamNotEmpty, _logSynchronizationResult, _removeEmptyParameters, createContentAction, deleteUnexistingContents, empty, getSynchronizationResult, sendErrorMail, validateContentMethods 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, validateAfterImportMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:
servicein interfaceServiceable- Overrides:
servicein classAbstractSimpleSynchronizableContentsCollection- Throws:
ServiceException
-
contextualize
- Specified by:
contextualizein interfaceContextualizable- Throws:
ContextException
-
configureDataSource
Description copied from class:AbstractStaticSynchronizableContentsCollectionConfigure the data source parameters.- Specified by:
configureDataSourcein classAbstractStaticSynchronizableContentsCollection- Parameters:
configuration- Configuration to read- Throws:
ConfigurationException- If an error occurs
-
populate
public List<ModifiableContent> populate(org.slf4j.Logger logger, ContainerProgressionTracker progressionTracker) Description copied from interface:SynchronizableContentsCollectionPopulates contents- Specified by:
populatein interfaceSynchronizableContentsCollection- Overrides:
populatein classAbstractSimpleSynchronizableContentsCollection- Parameters:
logger- The loggerprogressionTracker- A progression tracker- Returns:
- Return the populated contents (imported or synchronized)
-
_internalPopulate
protected List<ModifiableContent> _internalPopulate(org.slf4j.Logger logger, ContainerProgressionTracker progressionTracker) Description copied from class:AbstractSynchronizableContentsCollectionInternal implementation ofAbstractSynchronizableContentsCollection.populate(Logger, ContainerProgressionTracker)- Overrides:
_internalPopulatein 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, org.slf4j.Logger logger) Description copied from class:AbstractSimpleSynchronizableContentsCollectionSearch values and return the result without any treatment.- Specified by:
internalSearchin 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, org.slf4j.Logger logger) Description copied from class:AbstractSimpleSynchronizableContentsCollectionSearch values and return the result organized by attributes- Specified by:
getRemoteValuesin classAbstractSimpleSynchronizableContentsCollection- Parameters:
searchParameters- Search parameters to restrict the searchlogger- The logger- Returns:
- Map of results organized by attributes.
-
getLanguages
Description copied from interface:SynchronizableContentsCollectionGet the languages handled by this collection- Specified by:
getLanguagesin interfaceSynchronizableContentsCollection- Overrides:
getLanguagesin classAbstractStaticSynchronizableContentsCollection- Returns:
- the list of language
-
importContent
public List<ModifiableContent> importContent(String idValue, Map<String, Object> additionalParameters, org.slf4j.Logger logger) throws ExceptionDescription copied from interface:SynchronizableContentsCollectionImport a content from remote values.- Specified by:
importContentin interfaceSynchronizableContentsCollection- Overrides:
importContentin 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:SynchronizableContentsCollectionSynchronize a content with remove values.- Specified by:
synchronizeContentin interfaceSynchronizableContentsCollection- Overrides:
synchronizeContentin 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:AbstractSimpleSynchronizableContentsCollectionSet search parameters for the ID value.- Specified by:
putIdParameterin classAbstractSimpleSynchronizableContentsCollection- Parameters:
idValue- Value to search- Returns:
- Map with the search parameters
-
_search
protected abstract List<Map<String,Object>> _search(Map<String, Object> searchParameters, org.slf4j.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 theBigDecimalvalues 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:
trueif 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:
trueif 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:SynchronizableContentsCollectionGet the path of metadata holding the unique identifier- Specified by:
getIdFieldin interfaceSynchronizableContentsCollection- Returns:
- the path to the metadata. Can be null.
-
getLocalAndExternalFields
Description copied from interface:SynchronizableContentsCollectionGet the path of tri-state fields (with local and external values)- Specified by:
getLocalAndExternalFieldsin interfaceSynchronizableContentsCollection- Parameters:
additionalParameters- Additional parameters- Returns:
- the synchronized fields
-
configureSearchModel
Description copied from class:AbstractStaticSynchronizableContentsCollectionConfigure the search model used by SCCSearchTool.- Specified by:
configureSearchModelin classAbstractStaticSynchronizableContentsCollection
-
getAdditionalAttributeValues
protected Map<String,Object> getAdditionalAttributeValues(String idValue, Content content, Map<String, Object> additionalParameters, boolean create, org.slf4j.Logger logger) Description copied from class:AbstractSimpleSynchronizableContentsCollectionRetrieves additional values to synchronize for a content- Overrides:
getAdditionalAttributeValuesin classAbstractSimpleSynchronizableContentsCollection- Parameters:
idValue- id value of the contentcontent- The contentadditionalParameters- Additional parameterscreate-trueif the content has been newly created,falseotherwiselogger- The logger- Returns:
- the values to add
-
getParentAttribute
Retrieves the attribute to synchronize for the given parent (as aPairof name and value)- Parameters:
parent- the parent content- Returns:
- the parent attribute
-
handleChildren
protected List<ModifiableContent> handleChildren(String idValue, Content content, boolean create, org.slf4j.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-trueif 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, org.slf4j.Logger logger) Description copied from class:AbstractSimpleSynchronizableContentsCollectionRetrieves the ids of the contents related to the given content but that are not part of the synchronization- Overrides:
getNotSynchronizedRelatedContentIdsin 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:SynchronizableContentsCollectionReturn the total number of results for the search.- Specified by:
getTotalCountin interfaceSynchronizableContentsCollection- Overrides:
getTotalCountin 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, org.slf4j.Logger logger) Description copied from class:AbstractSimpleSynchronizableContentsCollectionImport a content from remote values.- Overrides:
_importContentin 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, org.slf4j.Logger logger) throws ExceptionDescription copied from class:AbstractSimpleSynchronizableContentsCollectionSynchronize a content with remove values.- Overrides:
_synchronizeContentin 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, org.slf4j.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-trueif the content has been newly createdlogger- The logger- Returns:
- The imported or synchronized children
-
_importChildren
protected List<ModifiableContent> _importChildren(String idValue, SynchronizableContentsCollection scc, org.slf4j.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, org.slf4j.Logger logger) Synchronize children- Parameters:
content- Parent contentscc- The SCCattributeName- The name of the attribute containing childrenlogger- The logger- Returns:
trueif there are changes
-
_getChildrenRemoteSyncCode
protected Set<String> _getChildrenRemoteSyncCode(Content content, SynchronizableContentsCollection scc, org.slf4j.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
Mapof search parameters
-
_importUnexistingChildren
protected List<ModifiableContent> _importUnexistingChildren(SynchronizableContentsCollection scc, String syncCode, Map<String, List<Object>> additionalParameters, org.slf4j.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, org.slf4j.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:
trueif the content will be removed from the structure
-
importOrSynchronizeContents
public List<ModifiableContent> importOrSynchronizeContents(Map<String, Object> searchParams, org.slf4j.Logger logger) Description copied from interface:ApogeeSynchronizableContentsCollectionMethod used to import the structure of an ODF content or its dependencies, import or synchronize each child recursively.- Specified by:
importOrSynchronizeContentsin interfaceApogeeSynchronizableContentsCollection- Parameters:
searchParams- Search parameterslogger- The logger- Returns:
- The
ListofModifiableContentof children (imported or synchronized)
-
handleRightAssignmentContext
Description copied from interface:SynchronizableContentsCollectionReturn true if aRightAssignmentContextshould be automatically generated for the contents of this SCC- Specified by:
handleRightAssignmentContextin interfaceSynchronizableContentsCollection- Returns:
- true to automatically generate a
RightAssignmentContext. Return false if the rights of contents of this SCC are handle by its ownRightAssignmentContext
-