Class StatistiquesBacGeneralSynchronizableContentsCollection
java.lang.Object
org.ametys.plugins.contentio.synchronize.AbstractStaticSynchronizableContentsCollection
org.ametys.plugins.contentio.synchronize.AbstractSynchronizableContentsCollection
org.ametys.plugins.contentio.synchronize.AbstractSimpleSynchronizableContentsCollection
org.ametys.plugins.contentio.synchronize.impl.AbstractDefaultSynchronizableContentsCollection
org.ametys.plugins.odfsync.apogee.scc.impl.StatistiquesBacGeneralSynchronizableContentsCollection
- All Implemented Interfaces:
SynchronizableContentsCollection,Configurable,Serviceable
public class StatistiquesBacGeneralSynchronizableContentsCollection
extends AbstractDefaultSynchronizableContentsCollection
SCC used to fill statistics on "Bac général" from Apogée data, it is a complementary SCC.
-
Field Summary
FieldsModifier and TypeFieldDescriptionThe Apogée SCC helperprotected ApogeeStatistiquesDAOThe DAO for remote DB Apogeeprotected CDMFRHandlerThe CDM-fr handlerstatic final StringName of parameter holding the data source idFields inherited from class org.ametys.plugins.contentio.synchronize.AbstractSimpleSynchronizableContentsCollection
_contentHelper, _synchronizingContentOperatorEPFields 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 boolean_editContent(WorkflowAwareContent content, Optional<View> view, Map<String, Object> values, Map<String, Object> additionalParameters, boolean create, Set<String> notSynchronizedContentIds, org.slf4j.Logger logger) Synchronize the content with given values.protected void_endHandleCDMFR(Set<String> contentIds) End handle CDM-fr treatmentsprotected List<Expression> _getExpressionsList(String lang, String idValue, String contentType, boolean forceStrictCheck) Construct the query to retrieve the content.protected ModifiableContent_importContent(String idValue, Map<String, Object> additionalParameters, String lang, Map<String, List<Object>> remoteValues, org.slf4j.Logger logger) Import a content from remote values.protected voidStart handle CDM-fr treatmentsbooleanWhen returnstrue, the process check the collection of contents to synchronize, can be a list of collections and not only the current one.protected voidensureTitleIsPresent(Content content, Map<String, List<Object>> remoteValues, org.slf4j.Logger logger) Ensure that the title is present and set it to the current title if it is not present.protected StringGet the id of data sourceGet the path of metadata holding the unique identifierGet the languages handled by this collectioninternalSearch(Map<String, Object> initialSearchParameters, int offset, int limit, List<Object> sort, org.slf4j.Logger logger) Search values and return the result without any treatment.populate(org.slf4j.Logger logger, ContainerProgressionTracker progressionTracker) Populates contentsbooleanWhen returnstrue, a content created by a previous synchro will be removed if it does not exist anymore during the current synchro.voidservice(ServiceManager manager) voidupdateSyncInformations(ModifiableContent content, String syncCode, org.slf4j.Logger logger) Method to update the synchronisation informations (collection and value of the ID field).Methods inherited from class org.ametys.plugins.contentio.synchronize.impl.AbstractDefaultSynchronizableContentsCollection
_getMapping, configureDataSource, configureSearchModel, getLocalAndExternalFields, getRemoteValues, putIdParameter, searchMethods inherited from class org.ametys.plugins.contentio.synchronize.AbstractSimpleSynchronizableContentsCollection
_addEditInputsForSCC, _fillContent, _getContentsToRemove, _getEditInputs, _getEditInputsContextParameters, _handleContent, _importOrSynchronizeContent, _importOrSynchronizeContent, _importOrSynchronizeContents, _importOrSynchronizeContents, _internalPopulate, _isHandled, _synchronizeContent, _transformRemoteValues, configure, createContentAction, getAdditionalAttributeValues, getContent, getNotSynchronizedRelatedContentIds, getTotalCount, getTransformedRemoteValues, importContent, synchronizeContent, validateContentMethods inherited from class org.ametys.plugins.contentio.synchronize.AbstractSynchronizableContentsCollection
_deleteContents, _getAdditionalInputsForContentCreation, _getContentPathQuery, _hasSomethingChanged, _internalPopulate, _isParamNotEmpty, _logSynchronizationResult, _removeEmptyParameters, _removeSCCOrDeleteContents, createContentAction, deleteUnexistingContents, empty, getSynchronizationResult, sendErrorMail, validateContentMethods inherited from class org.ametys.plugins.contentio.synchronize.AbstractStaticSynchronizableContentsCollection
_parseMultipleValuesConf, _parseParameters, _transformRemoteValuesCardinality, configureStaticParams, getCompatibleSCC, getContentPrefix, getContentType, getId, getInitialActionId, getLabel, getParameterValues, getReportMails, getRestrictedField, getSearchModelConfiguration, getSynchronizeActionId, getSynchronizeCollectionModelId, getSynchronizingContentOperator, getValidateActionId, getWorkflowName, ignoreRestrictions, 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
additionalCommonOperations, additionalImportOperations, additionalSynchronizeOperations, handleRightAssignmentContext
-
Field Details
-
PARAM_DATASOURCE_ID
Name of parameter holding the data source id- See Also:
-
_apogeeStatistiquesDAO
The DAO for remote DB Apogee -
_apogeeSCCHelper
The Apogée SCC helper -
_cdmfrHandler
The CDM-fr handler
-
-
Constructor Details
-
StatistiquesBacGeneralSynchronizableContentsCollection
-
-
Method Details
-
service
- Specified by:
servicein interfaceServiceable- Overrides:
servicein classAbstractSimpleSynchronizableContentsCollection- Throws:
ServiceException
-
getDataSourceId
Get the id of data source- Returns:
- The id of data source
-
getIdField
Description copied from interface:SynchronizableContentsCollectionGet the path of metadata holding the unique identifier- Returns:
- the path to the metadata. Can be null.
-
checkCollection
Description copied from interface:SynchronizableContentsCollectionWhen returnstrue, the process check the collection of contents to synchronize, can be a list of collections and not only the current one.- Specified by:
checkCollectionin interfaceSynchronizableContentsCollection- Overrides:
checkCollectionin classAbstractStaticSynchronizableContentsCollection- Returns:
trueto check the collection on synchronization
-
removalSync
Description copied from interface:SynchronizableContentsCollectionWhen returnstrue, a content created by a previous synchro will be removed if it does not exist anymore during the current synchro.- Specified by:
removalSyncin interfaceSynchronizableContentsCollection- Overrides:
removalSyncin classAbstractStaticSynchronizableContentsCollection- Returns:
trueif a content created by a previous synchro has to be removed if it does not exist anymore during the current synchro.
-
getLanguages
Description copied from interface:SynchronizableContentsCollectionGet the languages handled by this collection- Specified by:
getLanguagesin interfaceSynchronizableContentsCollection- Overrides:
getLanguagesin classAbstractStaticSynchronizableContentsCollection- Returns:
- the list of language
-
updateSyncInformations
public void updateSyncInformations(ModifiableContent content, String syncCode, org.slf4j.Logger logger) throws Exception Description copied from interface:SynchronizableContentsCollectionMethod to update the synchronisation informations (collection and value of the ID field).- Specified by:
updateSyncInformationsin interfaceSynchronizableContentsCollection- Overrides:
updateSyncInformationsin classAbstractSimpleSynchronizableContentsCollection- Parameters:
content- Content to updatesyncCode- New synchronization codelogger- The logger- Throws:
Exception- if an error occurs.
-
_importContent
protected ModifiableContent _importContent(String idValue, Map<String, Object> additionalParameters, String lang, Map<String, throws ExceptionList<Object>> remoteValues, org.slf4j.Logger logger) Description copied from class:AbstractSimpleSynchronizableContentsCollectionImport a content from remote values.- Overrides:
_importContentin classAbstractSimpleSynchronizableContentsCollection- Parameters:
idValue- Id (for import/synchronization) of the content to importadditionalParameters- Specific parameters for importlang- Lang of the contentremoteValues- Values of the contentlogger- The logger- Returns:
- The content created by import, or null
- Throws:
Exception- if an error occurs.
-
populate
public List<ModifiableContent> populate(org.slf4j.Logger logger, ContainerProgressionTracker progressionTracker) Description copied from interface:SynchronizableContentsCollectionPopulates contents- Specified by:
populatein interfaceSynchronizableContentsCollection- Overrides:
populatein classAbstractSimpleSynchronizableContentsCollection- Parameters:
logger- The loggerprogressionTracker- A progression tracker- Returns:
- Return the populated contents (imported or synchronized)
-
_startHandleCDMFR
Start handle CDM-fr treatments -
_endHandleCDMFR
End handle CDM-fr treatments- Parameters:
contentIds- the updated contents ids
-
internalSearch
protected Map<String,Map<String, internalSearchObject>> (Map<String, Object> initialSearchParameters, int offset, int limit, List<Object> sort, org.slf4j.Logger logger) Description copied from class:AbstractSimpleSynchronizableContentsCollectionSearch values and return the result without any treatment.- Specified by:
internalSearchin classAbstractSimpleSynchronizableContentsCollection- Parameters:
initialSearchParameters- Search parameters to restrict the searchoffset- Begin of the searchlimit- Number of resultssort- Sort of results (ignored for LDAP results)logger- The logger- Returns:
- Map of results without any treatment.
-
_getExpressionsList
protected List<Expression> _getExpressionsList(String lang, String idValue, String contentType, boolean forceStrictCheck) Description copied from class:AbstractSynchronizableContentsCollectionConstruct the query to retrieve the content.- Overrides:
_getExpressionsListin classAbstractSynchronizableContentsCollection- Parameters:
lang- LangidValue- Synchronization valuecontentType- Content typeforceStrictCheck-trueto force strict mode to check the collection, otherwise it read the "checkCollection" option- Returns:
- The
ListofExpression
-
_editContent
protected boolean _editContent(WorkflowAwareContent content, Optional<View> view, Map<String, Object> values, Map<String, throws com.opensymphony.workflow.WorkflowExceptionObject> additionalParameters, boolean create, Set<String> notSynchronizedContentIds, org.slf4j.Logger logger) Description copied from class:AbstractSimpleSynchronizableContentsCollectionSynchronize the content with given values.- Overrides:
_editContentin classAbstractSimpleSynchronizableContentsCollection- Parameters:
content- The content to synchronizeview- the view containing the item to editvalues- the valuesadditionalParameters- Additional parameterscreate-trueif content is creating,falseif it is updatednotSynchronizedContentIds- the ids of the contents related to the given content but that are not part of the synchronizationlogger- The logger- Returns:
trueif the content has been modified,falseotherwise- Throws:
com.opensymphony.workflow.WorkflowException- if an error occurs
-
ensureTitleIsPresent
protected void ensureTitleIsPresent(Content content, Map<String, List<Object>> remoteValues, org.slf4j.Logger logger) Description copied from class:AbstractSimpleSynchronizableContentsCollectionEnsure that the title is present and set it to the current title if it is not present.- Overrides:
ensureTitleIsPresentin classAbstractSimpleSynchronizableContentsCollection- Parameters:
content- The content to synchronizeremoteValues- The remote values that would contain the title (to check)logger- The logger to warn if the title is not present
-