Package org.ametys.plugins.odfsync.cdmfr
Class CDMFrSynchronizableContentsCollection
java.lang.Object
org.ametys.plugins.contentio.synchronize.AbstractStaticSynchronizableContentsCollection
org.ametys.plugins.contentio.synchronize.AbstractSynchronizableContentsCollection
org.ametys.plugins.odfsync.cdmfr.AbstractCDMFrSynchronizableContentsCollection
org.ametys.plugins.odfsync.cdmfr.CDMFrSynchronizableContentsCollection
- All Implemented Interfaces:
SynchronizableContentsCollection,Configurable,Contextualizable,Serviceable
public class CDMFrSynchronizableContentsCollection
extends AbstractCDMFrSynchronizableContentsCollection
implements Contextualizable
Class for CDMFr import and synchronization
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final StringData source parameter : folderprotected FileCDM-fr folderprotected ContextThe Cocoon contextprotected StringDefault language configured for ODFList of synchronized contents (to avoid a treatment twice or more)Fields inherited from class org.ametys.plugins.odfsync.cdmfr.AbstractCDMFrSynchronizableContentsCollection
_cdmfrHandler, _importCDMFrComponentFields inherited from class org.ametys.plugins.contentio.synchronize.AbstractSynchronizableContentsCollection
_contentWorkflowHelper, _currentUserProvider, _hasGlobalError, _i18nUtils, _nbCreatedContents, _nbDeletedContents, _nbError, _nbNotChangedContents, _nbSynchronizedContents, _observationManager, _userLanguagesManager, SCC_UNIQUE_IDFields inherited from class org.ametys.plugins.contentio.synchronize.AbstractStaticSynchronizableContentsCollection
_checkCollection, _compatibleSCC, _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 List<ModifiableContent> Filter the contents to remove._handleFile(File cdmfrFile, Map<String, Object> parameters, org.slf4j.Logger logger) Handle the CDM-fr file to import all the programs and its dependencies containing into it.protected List<ModifiableContent> _internalPopulate(org.slf4j.Logger logger, ContainerProgressionTracker progressionTracker) Internal implementation ofAbstractSynchronizableContentsCollection.populate(Logger, ContainerProgressionTracker)voidconfigure(Configuration configuration) protected voidconfigureDataSource(Configuration configuration) Configure the data source parameters.protected voidConfigure the search model used by SCCSearchTool.protected voidConfigure the specific parameters of this implementation of CDM-fr import.voidcontextualize(Context context) getContent(String lang, String idValue, boolean forceStrictCheck) Gets the content in the repositoryintgetTotalCount(Map<String, Object> searchParameters, org.slf4j.Logger logger) Return the total number of results for the search.booleanReturn 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 File[]internalSearch(Map<String, Object> searchParameters, org.slf4j.Logger logger) Search values and return the result without any treatment.search(Map<String, Object> searchParameters, int offset, int limit, List<Object> sort, org.slf4j.Logger logger) Search the data to import from parameters.Methods inherited from class org.ametys.plugins.odfsync.cdmfr.AbstractCDMFrSynchronizableContentsCollection
_endHandleCDMFR, _startHandleCDMFR, additionalCommonOperations, getIdField, getLocalAndExternalFields, service, synchronizeContent, updateSyncInformationsMethods inherited from class org.ametys.plugins.contentio.synchronize.AbstractSynchronizableContentsCollection
_deleteContents, _getAdditionalInputsForContentCreation, _getContentPathQuery, _getExpressionsList, _hasSomethingChanged, _internalPopulate, _isParamNotEmpty, _logSynchronizationResult, _removeEmptyParameters, _removeSCCOrDeleteContents, createContentAction, deleteUnexistingContents, empty, getSynchronizationResult, populate, sendErrorMail, validateContentMethods inherited from class org.ametys.plugins.contentio.synchronize.AbstractStaticSynchronizableContentsCollection
_parseMultipleValuesConf, _parseParameters, _transformRemoteValuesCardinality, checkCollection, configureStaticParams, getCompatibleSCC, getContentPrefix, getContentType, getId, getInitialActionId, getLabel, getLanguages, 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
additionalImportOperations, additionalSynchronizeOperations
-
Field Details
-
__PARAM_FOLDER
Data source parameter : folder- See Also:
-
_cocoonContext
The Cocoon context -
_cdmfrFolder
CDM-fr folder -
_odfLang
Default language configured for ODF -
_updatedContents
List of synchronized contents (to avoid a treatment twice or more)
-
-
Constructor Details
-
CDMFrSynchronizableContentsCollection
-
-
Method Details
-
contextualize
- Specified by:
contextualizein interfaceContextualizable- Throws:
ContextException
-
configure
- Specified by:
configurein interfaceConfigurable- Overrides:
configurein classAbstractStaticSynchronizableContentsCollection- Throws:
ConfigurationException
-
_internalPopulate
protected List<ModifiableContent> _internalPopulate(org.slf4j.Logger logger, ContainerProgressionTracker progressionTracker) Description copied from class:AbstractSynchronizableContentsCollectionInternal implementation ofAbstractSynchronizableContentsCollection.populate(Logger, ContainerProgressionTracker)- Overrides:
_internalPopulatein classAbstractCDMFrSynchronizableContentsCollection- Parameters:
logger- The loggerprogressionTracker- The progression tracker- Returns:
- The list of created/synchronized contents
-
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- 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.
-
_handleFile
protected Map<String,Object> _handleFile(File cdmfrFile, Map<String, Object> parameters, org.slf4j.Logger logger) Handle the CDM-fr file to import all the programs and its dependencies containing into it.- Parameters:
cdmfrFile- The CDM-fr fileparameters- Parameters used to import the filelogger- The logger- Returns:
- The list of imported/synchronized programs
-
search
public Map<String,Map<String, searchObject>> (Map<String, Object> searchParameters, int offset, int limit, List<Object> sort, org.slf4j.Logger logger) Description copied from interface:SynchronizableContentsCollectionSearch the data to import from parameters.- Specified by:
searchin interfaceSynchronizableContentsCollection- Overrides:
searchin classAbstractCDMFrSynchronizableContentsCollection- Parameters:
searchParameters- Parameters for the searchoffset- Begin of the searchlimit- Number of resultssort- Sort of results (ignored for LDAP results)logger- The logger- Returns:
- A map of remote values by content
-
getTotalCount
Description copied from interface:SynchronizableContentsCollectionReturn the total number of results for the search.- Specified by:
getTotalCountin interfaceSynchronizableContentsCollection- Overrides:
getTotalCountin classAbstractCDMFrSynchronizableContentsCollection- Parameters:
searchParameters- Parameters for the searchlogger- The logger- Returns:
- The total count
-
internalSearch
Search values and return the result without any treatment.- Parameters:
searchParameters- Search parameters to restrict the searchlogger- The logger- Returns:
Filetab listing the available CDM-fr files corresponding to the filter.
-
configureDataSource
Description copied from class:AbstractStaticSynchronizableContentsCollectionConfigure the data source parameters.- Overrides:
configureDataSourcein classAbstractCDMFrSynchronizableContentsCollection- Parameters:
configuration- Configuration to read- Throws:
ConfigurationException- If an error occurs
-
configureSpecificParameters
Configure the specific parameters of this implementation of CDM-fr import. -
configureSearchModel
Description copied from class:AbstractStaticSynchronizableContentsCollectionConfigure the search model used by SCCSearchTool.- Overrides:
configureSearchModelin classAbstractCDMFrSynchronizableContentsCollection
-
getContent
Description copied from interface:SynchronizableContentsCollectionGets the content in the repository- Specified by:
getContentin interfaceSynchronizableContentsCollection- Overrides:
getContentin classAbstractCDMFrSynchronizableContentsCollection- Parameters:
lang- the languageidValue- the content nameforceStrictCheck-trueto force strict mode to search for the content only in the current collection, otherwise it read the "checkCollection" option- Returns:
- the content in the repository, or null if does not exist
-
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
-
_getContentsToRemove
protected List<ModifiableContent> _getContentsToRemove(AmetysObjectIterable<ModifiableContent> contents) Description copied from class:AbstractSynchronizableContentsCollectionFilter the contents to remove.- Overrides:
_getContentsToRemovein classAbstractCDMFrSynchronizableContentsCollection- Parameters:
contents- The list of all the available contents- Returns:
- The
ListofContentto remove.
-