public class CDMFrSynchronizableContentsCollection extends AbstractCDMFrSynchronizableContentsCollection implements Contextualizable
Modifier and Type | Field and Description |
---|---|
protected static String |
__PARAM_FOLDER
Data source parameter : folder
|
protected File |
_cdmfrFolder
CDM-fr folder
|
protected Context |
_cocoonContext
The Cocoon context
|
private static String |
_COLUMN_FILENAME |
private static String |
_COLUMN_LAST_MODIFIED |
private static String |
_COLUMN_LENGTH |
private static String |
_CRITERIA_FILENAME |
private static String |
_CRITERIA_LAST_MODIFIED_AFTER |
private static String |
_CRITERIA_LAST_MODIFIED_BEFORE |
private static Map<String,Comparator<File>> |
_NAME_TO_COMPARATOR |
protected String |
_odfLang
Default language configured for ODF
|
protected Set<String> |
_updatedContents
List of synchronized contents (to avoid a treatment twice or more)
|
_importCDMFrComponent
_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 |
---|
CDMFrSynchronizableContentsCollection() |
Modifier and Type | Method and Description |
---|---|
protected List<Content> |
_getContentsToRemove(AmetysObjectIterable<ModifiableDefaultContent> contents)
Filter the contents to remove.
|
protected Map<String,Object> |
_handleFile(File cdmfrFile,
Map<String,Object> parameters,
Logger logger)
Handle the CDM-fr file to import all the programs and its dependencies containing into it.
|
protected List<ModifiableDefaultContent> |
_internalPopulate(Logger logger)
Internal implementation of
AbstractSynchronizableContentsCollection.populate(Logger) |
private File[] |
_sortFiles(File[] files,
List<Object> sortList) |
void |
configure(Configuration configuration) |
protected void |
configureDataSource(Configuration configuration)
Configure the data source parameters.
|
protected void |
configureSearchModel()
Configure the search model used by SCCSearchTool.
|
protected void |
configureSpecificParameters()
Configure the specific parameters of this implementation of CDM-fr import.
|
void |
contextualize(Context context) |
ModifiableDefaultContent |
getContent(String lang,
String idValue)
Gets the content in the repository
|
int |
getTotalCount(Map<String,Object> parameters,
Logger logger)
Return the total number of results for the search.
|
boolean |
handleRightAssignmentContext()
Return true if a
RightAssignmentContext should be automatically generated for the contents of this SCC |
List<ModifiableDefaultContent> |
importContent(String idValue,
Map<String,Object> additionalParameters,
Logger logger)
Import a content from remote values.
|
protected File[] |
internalSearch(Map<String,Object> parameters,
Logger logger)
Search values and return the result without any treatment.
|
Map<String,Map<String,Object>> |
search(Map<String,Object> parameters,
int offset,
int limit,
List<Object> sort,
Logger logger)
Search the data to import from parameters.
|
void |
synchronizeContent(ModifiableDefaultContent content,
Logger logger)
Synchronize a content with remove values.
|
void |
updateSyncInformations(ModifiableDefaultContent content,
String syncCode,
Logger logger)
Method to update the synchronisation informations (collection and value of the ID field).
|
getExternalOnlyFields, getIdField, getLocalAndExternalFields, service
_getContentPathQuery, _getExpressionsList, _getMetadataHolder, _isParamNotEmpty, _removeEmptyParameters, _removeMetadataIfExists, _synchronizeMetadata, _updateRelation, _updateRelation, applyChanges, applyChanges, createContentAction, deleteUnexistingContents, populate, sendErrorMail, updateSCCProperty, validateContent
_parseLanguages, _parseParameters, configureStaticParams, getContentPrefix, getContentType, getId, getInitialActionId, getLabel, getLanguages, getParameterValues, getReportMails, getRestrictedField, getSearchModelConfiguration, getSynchronizeActionId, getSynchronizeCollectionModelId, getSynchronizingContentOperator, getValidateActionId, getWorkflowName, removalSync, synchronizeExistingContentsOnly, validateAfterImport
protected static final String __PARAM_FOLDER
private static final String _CRITERIA_FILENAME
private static final String _CRITERIA_LAST_MODIFIED_AFTER
private static final String _CRITERIA_LAST_MODIFIED_BEFORE
private static final String _COLUMN_FILENAME
private static final String _COLUMN_LAST_MODIFIED
private static final String _COLUMN_LENGTH
private static final Map<String,Comparator<File>> _NAME_TO_COMPARATOR
protected Context _cocoonContext
protected File _cdmfrFolder
protected Set<String> _updatedContents
public CDMFrSynchronizableContentsCollection()
public void contextualize(Context context) throws ContextException
contextualize
in interface Contextualizable
ContextException
public void configure(Configuration configuration) throws ConfigurationException
configure
in interface Configurable
configure
in class AbstractStaticSynchronizableContentsCollection
ConfigurationException
protected List<ModifiableDefaultContent> _internalPopulate(Logger logger)
AbstractSynchronizableContentsCollection
AbstractSynchronizableContentsCollection.populate(Logger)
_internalPopulate
in class AbstractCDMFrSynchronizableContentsCollection
logger
- The loggerpublic List<ModifiableDefaultContent> importContent(String idValue, Map<String,Object> additionalParameters, Logger logger) throws Exception
SynchronizableContentsCollection
importContent
in interface SynchronizableContentsCollection
idValue
- Id (for import/synchronization) of the content to importadditionalParameters
- Additional parameterslogger
- The loggerException
- if an error occurs.protected Map<String,Object> _handleFile(File cdmfrFile, Map<String,Object> parameters, Logger logger)
cdmfrFile
- The CDM-fr fileparameters
- Parameters used to import the filelogger
- The loggerpublic Map<String,Map<String,Object>> search(Map<String,Object> parameters, int offset, int limit, List<Object> sort, Logger logger)
SynchronizableContentsCollection
search
in interface SynchronizableContentsCollection
search
in class AbstractCDMFrSynchronizableContentsCollection
parameters
- Parameters for the searchoffset
- Begin of the searchlimit
- Number of resultssort
- Sort of results (ignored for LDAP results)logger
- The loggerpublic int getTotalCount(Map<String,Object> parameters, Logger logger)
SynchronizableContentsCollection
getTotalCount
in interface SynchronizableContentsCollection
getTotalCount
in class AbstractCDMFrSynchronizableContentsCollection
parameters
- Parameters for the searchlogger
- The loggerprivate File[] _sortFiles(File[] files, List<Object> sortList)
protected File[] internalSearch(Map<String,Object> parameters, Logger logger)
parameters
- Search parameters to restrict the searchlogger
- The loggerFile
tab listing the available CDM-fr files corresponding to the filter.protected void configureDataSource(Configuration configuration) throws ConfigurationException
AbstractStaticSynchronizableContentsCollection
configureDataSource
in class AbstractCDMFrSynchronizableContentsCollection
configuration
- Configuration to readConfigurationException
- If an error occursprotected void configureSpecificParameters()
protected void configureSearchModel()
AbstractStaticSynchronizableContentsCollection
configureSearchModel
in class AbstractCDMFrSynchronizableContentsCollection
public void updateSyncInformations(ModifiableDefaultContent content, String syncCode, Logger logger) throws Exception
SynchronizableContentsCollection
updateSyncInformations
in interface SynchronizableContentsCollection
updateSyncInformations
in class AbstractCDMFrSynchronizableContentsCollection
content
- Content to updatesyncCode
- New synchronization codelogger
- The loggerException
- if an error occurs.public void synchronizeContent(ModifiableDefaultContent content, Logger logger) throws Exception
SynchronizableContentsCollection
synchronizeContent
in interface SynchronizableContentsCollection
synchronizeContent
in class AbstractCDMFrSynchronizableContentsCollection
content
- The content to synchronizelogger
- The loggerException
- if an error occurs.public ModifiableDefaultContent getContent(String lang, String idValue)
SynchronizableContentsCollection
getContent
in interface SynchronizableContentsCollection
getContent
in class AbstractCDMFrSynchronizableContentsCollection
lang
- the languageidValue
- the content namepublic boolean handleRightAssignmentContext()
SynchronizableContentsCollection
RightAssignmentContext
should be automatically generated for the contents of this SCChandleRightAssignmentContext
in interface SynchronizableContentsCollection
RightAssignmentContext
. Return false if the rights of contents of this SCC are handle by its own RightAssignmentContext
protected List<Content> _getContentsToRemove(AmetysObjectIterable<ModifiableDefaultContent> contents)
AbstractSynchronizableContentsCollection
_getContentsToRemove
in class AbstractCDMFrSynchronizableContentsCollection
contents
- The list of all the available contentsList
of Content
to remove.