public class CDMFrSynchronizableContentsCollection extends AbstractSynchronizableContentsCollection 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 |
protected Set<String> |
_extFields
External fields
|
protected ImportCDMFrComponent |
_importCDMFrComponent
The CDM-fr SCC component
|
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)
|
_contentDAO, _contentTypeEP, _currentUserProvider, _hasGlobalError, _i18nUtils, _nbCreatedContents, _nbDeletedContents, _nbError, _nbNotChangedContents, _nbSynchronizedContents, _observationManager, _resolver, _synchroComponent, SCC_UNIQUE_ID
_contentPrefix, _contentType, _id, _initialActionId, _label, _modelId, _modelParamValues, _removalSync, _reportMails, _restrictedField, _searchModelConfiguration, _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
|
Set<String> |
getExternalOnlyFields(Map<String,Object> additionalParameters)
Get the path of field that are valued externally only.
|
String |
getIdField()
Get the path of metadata holding the unique identifier
|
Set<String> |
getLocalAndExternalFields(Map<String,Object> additionalParameters)
Get the path of tri-state fields (with local and external values)
|
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 |
service(ServiceManager manager) |
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).
|
_getContentPathQuery, _getExpressionsList, _getMetadataHolder, _isParamNotEmpty, _removeEmptyParameters, _removeMetadataIfExists, _synchronizeMetadata, _updateRelation, _updateRelation, applyChanges, applyChanges, createContentAction, deleteUnexistingContents, populate, sendErrorMail, updateSCCProperty, validateContent
_parseParameters, configureStaticParams, getContentPrefix, getContentType, getId, getInitialActionId, getLabel, getParameterValues, getReportMails, getRestrictedField, getSearchModelConfiguration, 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> _extFields
protected Set<String> _updatedContents
protected ImportCDMFrComponent _importCDMFrComponent
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
public void service(ServiceManager manager) throws ServiceException
service
in interface Serviceable
service
in class AbstractSynchronizableContentsCollection
ServiceException
public String getIdField()
SynchronizableContentsCollection
getIdField
in interface SynchronizableContentsCollection
protected List<ModifiableDefaultContent> _internalPopulate(Logger logger)
AbstractSynchronizableContentsCollection
AbstractSynchronizableContentsCollection.populate(Logger)
_internalPopulate
in class AbstractSynchronizableContentsCollection
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
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
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 AbstractStaticSynchronizableContentsCollection
configuration
- Configuration to readConfigurationException
- If an error occursprotected void configureSpecificParameters()
protected void configureSearchModel()
AbstractStaticSynchronizableContentsCollection
configureSearchModel
in class AbstractStaticSynchronizableContentsCollection
public Set<String> getLocalAndExternalFields(Map<String,Object> additionalParameters)
SynchronizableContentsCollection
getLocalAndExternalFields
in interface SynchronizableContentsCollection
additionalParameters
- Additional parameterspublic Set<String> getExternalOnlyFields(Map<String,Object> additionalParameters)
SynchronizableContentsCollection
getExternalOnlyFields
in interface SynchronizableContentsCollection
additionalParameters
- Additional parameterspublic void updateSyncInformations(ModifiableDefaultContent content, String syncCode, Logger logger) throws Exception
SynchronizableContentsCollection
updateSyncInformations
in interface SynchronizableContentsCollection
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
content
- The content to synchronizelogger
- The loggerException
- if an error occurs.public ModifiableDefaultContent getContent(String lang, String idValue)
SynchronizableContentsCollection
getContent
in interface SynchronizableContentsCollection
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 AbstractSynchronizableContentsCollection
contents
- The list of all the available contentsList
of Content
to remove.