public class CDMFrSynchronizableContentsCollection extends AbstractSynchronizableContentsCollection implements Contextualizable
| Modifier and Type | Field and Description | 
|---|---|
| protected static String | __PARAM_FOLDERData source parameter : folder | 
| protected File | _cdmfrFolderCDM-fr folder | 
| protected Context | _cocoonContextThe 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> | _extFieldsExternal fields | 
| protected ImportCDMFrComponent | _importCDMFrComponentThe CDM-fr SCC component | 
| private static Map<String,Comparator<File>> | _NAME_TO_COMPARATOR | 
| protected String | _odfLangDefault language configured for ODF | 
| protected Set<String> | _updatedContentsList 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, _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 | 
| 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  RightAssignmentContextshould 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, 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> _extFields
protected Set<String> _updatedContents
protected ImportCDMFrComponent _importCDMFrComponent
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 AbstractStaticSynchronizableContentsCollectionConfigurationExceptionpublic void service(ServiceManager manager) throws ServiceException
service in interface Serviceableservice in class AbstractSynchronizableContentsCollectionServiceExceptionpublic String getIdField()
SynchronizableContentsCollectiongetIdField in interface SynchronizableContentsCollectionprotected List<ModifiableDefaultContent> _internalPopulate(Logger logger)
AbstractSynchronizableContentsCollectionAbstractSynchronizableContentsCollection.populate(Logger)_internalPopulate in class AbstractSynchronizableContentsCollectionlogger - 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 SynchronizableContentsCollectionparameters - 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 SynchronizableContentsCollectionparameters - 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 AbstractStaticSynchronizableContentsCollectionconfiguration - Configuration to readConfigurationException - If an error occursprotected void configureSpecificParameters()
protected void configureSearchModel()
AbstractStaticSynchronizableContentsCollectionconfigureSearchModel in class AbstractStaticSynchronizableContentsCollectionpublic Set<String> getLocalAndExternalFields(Map<String,Object> additionalParameters)
SynchronizableContentsCollectiongetLocalAndExternalFields in interface SynchronizableContentsCollectionadditionalParameters - Additional parameterspublic Set<String> getExternalOnlyFields(Map<String,Object> additionalParameters)
SynchronizableContentsCollectiongetExternalOnlyFields in interface SynchronizableContentsCollectionadditionalParameters - Additional parameterspublic void updateSyncInformations(ModifiableDefaultContent content, String syncCode, Logger logger) throws Exception
SynchronizableContentsCollectionupdateSyncInformations in interface SynchronizableContentsCollectioncontent - Content to updatesyncCode - New synchronization codelogger - The loggerException - if an error occurs.public void synchronizeContent(ModifiableDefaultContent content, Logger logger) throws Exception
SynchronizableContentsCollectionsynchronizeContent in interface SynchronizableContentsCollectioncontent - The content to synchronizelogger - The loggerException - if an error occurs.public ModifiableDefaultContent getContent(String lang, String idValue)
SynchronizableContentsCollectiongetContent in interface SynchronizableContentsCollectionlang - 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 AbstractSynchronizableContentsCollectioncontents - The list of all the available contentsList of Content to remove.