Class AbstractStaticSynchronizableContentsCollection
java.lang.Object
org.ametys.plugins.contentio.synchronize.AbstractStaticSynchronizableContentsCollection
- All Implemented Interfaces:
SynchronizableContentsCollection
,Configurable
,Serviceable
- Direct Known Subclasses:
AbstractSynchronizableContentsCollection
public abstract class AbstractStaticSynchronizableContentsCollection
extends Object
implements SynchronizableContentsCollection, Configurable, Serviceable
Configuration is separated from
AbstractSynchronizableContentsCollection
-
Field Summary
Modifier and TypeFieldDescriptionprotected ContentDAO
The content DAOprotected String
The prefix of the contentsprotected String
The handled content typeprotected ContentTypeExtensionPoint
The content type extension pointprotected String
The idprotected boolean
True to ignore restrictions on attributes while synchronizationprotected int
The id of the initial action of the workflowprotected I18nizableText
The labelThe handled languagesprotected String
The id of controllerThe untyped values of controller's parametersprotected boolean
True if removal syncprotected String
The report mailsprotected AmetysObjectResolver
The Ametys object resolverprotected String
The path to the metadata holding the 'restricted' propertyprotected SynchronizableContentsCollectionHelper
The SCC helperprotected SCCSearchModelConfiguration
Search model configuration for search toolprotected int
The id of the synchronize action of the workflowprotected boolean
The id of the content operator to useprotected String
The id of the content operator to useprotected int
The id of the validate action of the workflowprotected boolean
True to validate contents after importprotected String
The name of the workflowFields 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
-
Method Summary
Modifier and TypeMethodDescription_parseLanguages
(Configuration configuration) Parse languages configuration_parseParameters
(Configuration configuration) Parse parameters' valuesTransform the remote values to take each attribute cardinality into accountvoid
configure
(Configuration configuration) protected abstract void
configureDataSource
(Configuration configuration) Configure the data source parameters.protected abstract void
Configure the search model used by SCCSearchTool.protected void
configureStaticParams
(Configuration configuration) Called inconfigure(Configuration)
for first configurations needed.Get the prefix to use for the creation of contentsGet the type of content handled by this collectiongetId()
Get the id of synchronizable collection.int
Get the id of the initial action of the workflowgetLabel()
Get the label of synchronizable collectionGet the languages handled by this collectionGet the untyped values of parameters for controllerIf an exception occurs during synchronization, an error report mail will be sent to those email addresses (separated by new lines)Get the path of boolean metadata for restricted content.Get the search UI model for search tool (columns, criterias, url for buttons, etc.)int
Get the id of the synchronize action of the workflowGet the id of controller responsible of synchronization of this collectionGets the id of theSynchronizingContentOperator
extension to use during synchronizationint
Get the id of the validate action of the workflowGet the name of the workflow to use for the synchronized contentsboolean
When returnstrue
, the process ignore restrictions on attributes to synchronize it.boolean
When returnstrue
, a content created by a previous synchro will be removed if it does not exist anymore during the current synchro.void
service
(ServiceManager manager) boolean
True to synchronize only existing contentsboolean
True to validate the contents after importMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.ametys.plugins.contentio.synchronize.SynchronizableContentsCollection
additionalCommonOperations, additionalImportOperations, additionalSynchronizeOperations, empty, getContent, getIdField, getLocalAndExternalFields, getSynchronizationResult, getTotalCount, handleRightAssignmentContext, importContent, populate, search, synchronizeContent, updateSyncInformations
-
Field Details
-
_resolver
The Ametys object resolver -
_sccHelper
The SCC helper -
_contentDAO
The content DAO -
_contentTypeEP
The content type extension point -
_id
The id -
_label
The label -
_restrictedField
The path to the metadata holding the 'restricted' property -
_contentType
The handled content type -
_languages
The handled languages -
_modelId
The id of controller -
_modelParamValues
The untyped values of controller's parameters -
_removalSync
True if removal sync -
_ignoreRestrictions
True to ignore restrictions on attributes while synchronization -
_workflowName
The name of the workflow -
_initialActionId
The id of the initial action of the workflow -
_synchronizeActionId
The id of the synchronize action of the workflow -
_validateActionId
The id of the validate action of the workflow -
_contentPrefix
The prefix of the contents -
_validateAfterImport
True to validate contents after import -
_reportMails
The report mails -
_synchronizingContentOperator
The id of the content operator to use -
_synchronizeExistingContentsOnly
The id of the content operator to use -
_searchModelConfiguration
Search model configuration for search tool
-
-
Constructor Details
-
AbstractStaticSynchronizableContentsCollection
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
configure
- Specified by:
configure
in interfaceConfigurable
- Throws:
ConfigurationException
-
configureStaticParams
Called inconfigure(Configuration)
for first configurations needed.- Parameters:
configuration
- Configuration to read- Throws:
ConfigurationException
- If an error occurs
-
configureDataSource
protected abstract void configureDataSource(Configuration configuration) throws ConfigurationException Configure the data source parameters.- Parameters:
configuration
- Configuration to read- Throws:
ConfigurationException
- If an error occurs
-
configureSearchModel
Configure the search model used by SCCSearchTool. -
getId
Description copied from interface:SynchronizableContentsCollection
Get the id of synchronizable collection.- Specified by:
getId
in interfaceSynchronizableContentsCollection
- Returns:
- the id
-
getLabel
Description copied from interface:SynchronizableContentsCollection
Get the label of synchronizable collection- Specified by:
getLabel
in interfaceSynchronizableContentsCollection
- Returns:
- the label
-
getContentType
Description copied from interface:SynchronizableContentsCollection
Get the type of content handled by this collection- Specified by:
getContentType
in interfaceSynchronizableContentsCollection
- Returns:
- the type of content
-
getLanguages
Description copied from interface:SynchronizableContentsCollection
Get the languages handled by this collection- Specified by:
getLanguages
in interfaceSynchronizableContentsCollection
- Returns:
- the list of language
-
getRestrictedField
Description copied from interface:SynchronizableContentsCollection
Get the path of boolean metadata for restricted content. If true, the content will be visible only for connected users.- Specified by:
getRestrictedField
in interfaceSynchronizableContentsCollection
- Returns:
- the path to the metadata. Can be null.
-
getSynchronizeCollectionModelId
Description copied from interface:SynchronizableContentsCollection
Get the id of controller responsible of synchronization of this collection- Specified by:
getSynchronizeCollectionModelId
in interfaceSynchronizableContentsCollection
- Returns:
- The id of controller
-
getParameterValues
Description copied from interface:SynchronizableContentsCollection
Get the untyped values of parameters for controller- Specified by:
getParameterValues
in interfaceSynchronizableContentsCollection
- Returns:
- the untyped values
-
removalSync
Description copied from interface:SynchronizableContentsCollection
When returnstrue
, a content created by a previous synchro will be removed if it does not exist anymore during the current synchro.- Specified by:
removalSync
in interfaceSynchronizableContentsCollection
- Returns:
true
if a content created by a previous synchro has to be removed if it does not exist anymore during the current synchro.
-
ignoreRestrictions
Description copied from interface:SynchronizableContentsCollection
When returnstrue
, the process ignore restrictions on attributes to synchronize it.- Specified by:
ignoreRestrictions
in interfaceSynchronizableContentsCollection
- Returns:
true
to ignore restrictions on synchronization
-
getWorkflowName
Description copied from interface:SynchronizableContentsCollection
Get the name of the workflow to use for the synchronized contents- Specified by:
getWorkflowName
in interfaceSynchronizableContentsCollection
- Returns:
- the name of the workflow to use for the synchronized contents
-
getInitialActionId
Description copied from interface:SynchronizableContentsCollection
Get the id of the initial action of the workflow- Specified by:
getInitialActionId
in interfaceSynchronizableContentsCollection
- Returns:
- The id of the initial action of the workflow
-
getSynchronizeActionId
Description copied from interface:SynchronizableContentsCollection
Get the id of the synchronize action of the workflow- Specified by:
getSynchronizeActionId
in interfaceSynchronizableContentsCollection
- Returns:
- The id of the synchronize action of the workflow
-
getValidateActionId
Description copied from interface:SynchronizableContentsCollection
Get the id of the validate action of the workflow- Specified by:
getValidateActionId
in interfaceSynchronizableContentsCollection
- Returns:
- The id of the validate action of the workflow
-
getContentPrefix
Description copied from interface:SynchronizableContentsCollection
Get the prefix to use for the creation of contents- Specified by:
getContentPrefix
in interfaceSynchronizableContentsCollection
- Returns:
- The prefix to use for the creation of contents
-
validateAfterImport
Description copied from interface:SynchronizableContentsCollection
True to validate the contents after import- Specified by:
validateAfterImport
in interfaceSynchronizableContentsCollection
- Returns:
- True to validate the contents after import
-
getReportMails
Description copied from interface:SynchronizableContentsCollection
If an exception occurs during synchronization, an error report mail will be sent to those email addresses (separated by new lines)- Specified by:
getReportMails
in interfaceSynchronizableContentsCollection
- Returns:
- The email addresses to send an error report if an exception occurs during synchronization (separated by new lines)
-
getSynchronizingContentOperator
Description copied from interface:SynchronizableContentsCollection
Gets the id of theSynchronizingContentOperator
extension to use during synchronization- Specified by:
getSynchronizingContentOperator
in interfaceSynchronizableContentsCollection
- Returns:
- the id of the
SynchronizingContentOperator
extension to use during synchronization
-
synchronizeExistingContentsOnly
Description copied from interface:SynchronizableContentsCollection
True to synchronize only existing contents- Specified by:
synchronizeExistingContentsOnly
in interfaceSynchronizableContentsCollection
- Returns:
- True to synchronize only existing contents
-
getSearchModelConfiguration
Description copied from interface:SynchronizableContentsCollection
Get the search UI model for search tool (columns, criterias, url for buttons, etc.)- Specified by:
getSearchModelConfiguration
in interfaceSynchronizableContentsCollection
- Returns:
- A
SCCSearchModelConfiguration
-
_parseParameters
protected Map<String,Object> _parseParameters(Configuration configuration) throws ConfigurationException Parse parameters' values- Parameters:
configuration
- The root configuration- Returns:
- The parameters
- Throws:
ConfigurationException
- if an error occurred
-
_parseLanguages
Parse languages configuration- Parameters:
configuration
- the configuration- Returns:
- the list of handled languages
- Throws:
ConfigurationException
- if an error occurred
-
_transformRemoteValuesCardinality
protected Map<String,Object> _transformRemoteValuesCardinality(Map<String, List<Object>> remoteValues, String contentTypeId) Transform the remote values to take each attribute cardinality into account- Parameters:
remoteValues
- the remote valuescontentTypeId
- the content type ID from which attributes come from- Returns:
- the transformed values
-