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, _workflowNameCOLLECTION_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, validateAfterImportprotected 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 ContextualizableContextExceptionpublic void configure(Configuration configuration) throws ConfigurationException
configure in interface Configurableconfigure in class AbstractStaticSynchronizableContentsCollectionConfigurationExceptionprotected List<ModifiableDefaultContent> _internalPopulate(Logger logger)
AbstractSynchronizableContentsCollectionAbstractSynchronizableContentsCollection.populate(Logger)_internalPopulate in class AbstractCDMFrSynchronizableContentsCollectionlogger - The loggerpublic List<ModifiableDefaultContent> importContent(String idValue, Map<String,Object> additionalParameters, Logger logger) throws Exception
SynchronizableContentsCollectionimportContent in interface SynchronizableContentsCollectionidValue - 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)
SynchronizableContentsCollectionsearch in interface SynchronizableContentsCollectionsearch in class AbstractCDMFrSynchronizableContentsCollectionparameters - 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)
SynchronizableContentsCollectiongetTotalCount in interface SynchronizableContentsCollectiongetTotalCount in class AbstractCDMFrSynchronizableContentsCollectionparameters - 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
AbstractStaticSynchronizableContentsCollectionconfigureDataSource in class AbstractCDMFrSynchronizableContentsCollectionconfiguration - Configuration to readConfigurationException - If an error occursprotected void configureSpecificParameters()
protected void configureSearchModel()
AbstractStaticSynchronizableContentsCollectionconfigureSearchModel in class AbstractCDMFrSynchronizableContentsCollectionpublic void updateSyncInformations(ModifiableDefaultContent content, String syncCode, Logger logger) throws Exception
SynchronizableContentsCollectionupdateSyncInformations in interface SynchronizableContentsCollectionupdateSyncInformations in class AbstractCDMFrSynchronizableContentsCollectioncontent - Content to updatesyncCode - New synchronization codelogger - The loggerException - if an error occurs.public void synchronizeContent(ModifiableDefaultContent content, Logger logger) throws Exception
SynchronizableContentsCollectionsynchronizeContent in interface SynchronizableContentsCollectionsynchronizeContent in class AbstractCDMFrSynchronizableContentsCollectioncontent - The content to synchronizelogger - The loggerException - if an error occurs.public ModifiableDefaultContent getContent(String lang, String idValue)
SynchronizableContentsCollectiongetContent in interface SynchronizableContentsCollectiongetContent in class AbstractCDMFrSynchronizableContentsCollectionlang - the languageidValue - the content namepublic boolean handleRightAssignmentContext()
SynchronizableContentsCollectionRightAssignmentContext should be automatically generated for the contents of this SCChandleRightAssignmentContext in interface SynchronizableContentsCollectionRightAssignmentContext. Return false if the rights of contents of this SCC are handle by its own RightAssignmentContextprotected List<Content> _getContentsToRemove(AmetysObjectIterable<ModifiableDefaultContent> contents)
AbstractSynchronizableContentsCollection_getContentsToRemove in class AbstractCDMFrSynchronizableContentsCollectioncontents - The list of all the available contentsList of Content to remove.