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 fromAbstractSynchronizableContentsCollection
-
-
Field Summary
Fields Modifier and Type Field Description protected ContentDAO_contentDAOThe content DAOprotected String_contentPrefixThe prefix of the contentsprotected String_contentTypeThe handled content typeprotected ContentTypeExtensionPoint_contentTypeEPThe content type extension pointprotected String_idThe idprotected int_initialActionIdThe id of the initial action of the workflowprotected I18nizableText_labelThe labelprotected List<String>_languagesThe handled languagesprotected String_modelIdThe id of controllerprotected Map<String,Object>_modelParamValuesThe untyped values of controller's parametersprotected boolean_removalSyncTrue if removal syncprotected String_reportMailsThe report mailsprotected AmetysObjectResolver_resolverThe Ametys object resolverprotected String_restrictedFieldThe path to the metadata holding the 'restricted' propertyprotected SynchronizableContentsCollectionHelper_sccHelperThe SCC helperprotected SCCSearchModelConfiguration_searchModelConfigurationSearch model configuration for search toolprotected int_synchronizeActionIdThe id of the synchronize action of the workflowprotected boolean_synchronizeExistingContentsOnlyThe id of the content operator to useprotected String_synchronizingContentOperatorThe id of the content operator to useprotected int_validateActionIdThe id of the validate action of the workflowprotected boolean_validateAfterImportTrue to validate contents after importprotected String_workflowNameThe name of the workflow-
Fields inherited from interface org.ametys.plugins.contentio.synchronize.SynchronizableContentsCollection
COLLECTION_ID_DATA_NAME, RESULT_NB_CREATED_CONTENTS, RESULT_NB_DELETED_CONTENTS, RESULT_NB_NOT_CHANGED_CONTENTS, RESULT_NB_SYNCHRONIZED_CONTENTS
-
-
Constructor Summary
Constructors Constructor Description AbstractStaticSynchronizableContentsCollection()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected List<String>_parseLanguages(Configuration configuration)Parse languages configurationprotected Map<String,Object>_parseParameters(Configuration configuration)Parse parameters' valuesprotected Map<String,Object>_transformRemoteValuesCardinality(Map<String,List<Object>> remoteValues, String contentTypeId)Transform the remote values to take each attribute cardinality into accountvoidconfigure(Configuration configuration)protected abstract voidconfigureDataSource(Configuration configuration)Configure the data source parameters.protected abstract voidconfigureSearchModel()Configure the search model used by SCCSearchTool.protected voidconfigureStaticParams(Configuration configuration)Called inconfigure(Configuration)for first configurations needed.StringgetContentPrefix()Get the prefix to use for the creation of contentsStringgetContentType()Get the type of content handled by this collectionStringgetId()Get the id of synchronizable collection.intgetInitialActionId()Get the id of the initial action of the workflowI18nizableTextgetLabel()Get the label of synchronizable collectionList<String>getLanguages()Get the languages handled by this collectionMap<String,Object>getParameterValues()Get the untyped values of parameters for controllerStringgetReportMails()If an exception occurs during synchronization, an error report mail will be sent to those email addresses (separated by new lines)StringgetRestrictedField()Get the path of boolean metadata for restricted content.SCCSearchModelConfigurationgetSearchModelConfiguration()Get the search UI model for search tool (columns, criterias, url for buttons, etc.)intgetSynchronizeActionId()Get the id of the synchronize action of the workflowStringgetSynchronizeCollectionModelId()Get the id of controller responsible of synchronization of this collectionStringgetSynchronizingContentOperator()Gets the id of theSynchronizingContentOperatorextension to use during synchronizationintgetValidateActionId()Get the id of the validate action of the workflowStringgetWorkflowName()Get the name of the workflow to use for the synchronized contentsbooleanremovalSync()When returns true, a content created by a previous synchro will be removed if it does not exist anymore during the current synchro.voidservice(ServiceManager manager)booleansynchronizeExistingContentsOnly()True to synchronize only existing contentsbooleanvalidateAfterImport()True to validate the contents after import-
Methods 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 Detail
-
_resolver
protected AmetysObjectResolver _resolver
The Ametys object resolver
-
_sccHelper
protected SynchronizableContentsCollectionHelper _sccHelper
The SCC helper
-
_contentDAO
protected ContentDAO _contentDAO
The content DAO
-
_contentTypeEP
protected ContentTypeExtensionPoint _contentTypeEP
The content type extension point
-
_label
protected I18nizableText _label
The label
-
_restrictedField
protected String _restrictedField
The path to the metadata holding the 'restricted' property
-
_contentType
protected String _contentType
The handled content type
-
_languages
protected List<String> _languages
The handled languages
-
_modelParamValues
protected Map<String,Object> _modelParamValues
The untyped values of controller's parameters
-
_removalSync
protected boolean _removalSync
True if removal sync
-
_workflowName
protected String _workflowName
The name of the workflow
-
_initialActionId
protected int _initialActionId
The id of the initial action of the workflow
-
_synchronizeActionId
protected int _synchronizeActionId
The id of the synchronize action of the workflow
-
_validateActionId
protected int _validateActionId
The id of the validate action of the workflow
-
_contentPrefix
protected String _contentPrefix
The prefix of the contents
-
_validateAfterImport
protected boolean _validateAfterImport
True to validate contents after import
-
_reportMails
protected String _reportMails
The report mails
-
_synchronizingContentOperator
protected String _synchronizingContentOperator
The id of the content operator to use
-
_synchronizeExistingContentsOnly
protected boolean _synchronizeExistingContentsOnly
The id of the content operator to use
-
_searchModelConfiguration
protected SCCSearchModelConfiguration _searchModelConfiguration
Search model configuration for search tool
-
-
Constructor Detail
-
AbstractStaticSynchronizableContentsCollection
public AbstractStaticSynchronizableContentsCollection()
-
-
Method Detail
-
service
public void service(ServiceManager manager) throws ServiceException
- Specified by:
servicein interfaceServiceable- Throws:
ServiceException
-
configure
public void configure(Configuration configuration) throws ConfigurationException
- Specified by:
configurein interfaceConfigurable- Throws:
ConfigurationException
-
configureStaticParams
protected void configureStaticParams(Configuration configuration) throws ConfigurationException
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
protected abstract void configureSearchModel()
Configure the search model used by SCCSearchTool.
-
getId
public String getId()
Description copied from interface:SynchronizableContentsCollectionGet the id of synchronizable collection.- Specified by:
getIdin interfaceSynchronizableContentsCollection- Returns:
- the id
-
getLabel
public I18nizableText getLabel()
Description copied from interface:SynchronizableContentsCollectionGet the label of synchronizable collection- Specified by:
getLabelin interfaceSynchronizableContentsCollection- Returns:
- the label
-
getContentType
public String getContentType()
Description copied from interface:SynchronizableContentsCollectionGet the type of content handled by this collection- Specified by:
getContentTypein interfaceSynchronizableContentsCollection- Returns:
- the type of content
-
getLanguages
public List<String> getLanguages()
Description copied from interface:SynchronizableContentsCollectionGet the languages handled by this collection- Specified by:
getLanguagesin interfaceSynchronizableContentsCollection- Returns:
- the list of language
-
getRestrictedField
public String getRestrictedField()
Description copied from interface:SynchronizableContentsCollectionGet the path of boolean metadata for restricted content. If true, the content will be visible only for connected users.- Specified by:
getRestrictedFieldin interfaceSynchronizableContentsCollection- Returns:
- the path to the metadata. Can be null.
-
getSynchronizeCollectionModelId
public String getSynchronizeCollectionModelId()
Description copied from interface:SynchronizableContentsCollectionGet the id of controller responsible of synchronization of this collection- Specified by:
getSynchronizeCollectionModelIdin interfaceSynchronizableContentsCollection- Returns:
- The id of controller
-
getParameterValues
public Map<String,Object> getParameterValues()
Description copied from interface:SynchronizableContentsCollectionGet the untyped values of parameters for controller- Specified by:
getParameterValuesin interfaceSynchronizableContentsCollection- Returns:
- the untyped values
-
removalSync
public boolean removalSync()
Description copied from interface:SynchronizableContentsCollectionWhen returns true, a content created by a previous synchro will be removed if it does not exist anymore during the current synchro.- Specified by:
removalSyncin 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.
-
getWorkflowName
public String getWorkflowName()
Description copied from interface:SynchronizableContentsCollectionGet the name of the workflow to use for the synchronized contents- Specified by:
getWorkflowNamein interfaceSynchronizableContentsCollection- Returns:
- the name of the workflow to use for the synchronized contents
-
getInitialActionId
public int getInitialActionId()
Description copied from interface:SynchronizableContentsCollectionGet the id of the initial action of the workflow- Specified by:
getInitialActionIdin interfaceSynchronizableContentsCollection- Returns:
- The id of the initial action of the workflow
-
getSynchronizeActionId
public int getSynchronizeActionId()
Description copied from interface:SynchronizableContentsCollectionGet the id of the synchronize action of the workflow- Specified by:
getSynchronizeActionIdin interfaceSynchronizableContentsCollection- Returns:
- The id of the synchronize action of the workflow
-
getValidateActionId
public int getValidateActionId()
Description copied from interface:SynchronizableContentsCollectionGet the id of the validate action of the workflow- Specified by:
getValidateActionIdin interfaceSynchronizableContentsCollection- Returns:
- The id of the validate action of the workflow
-
getContentPrefix
public String getContentPrefix()
Description copied from interface:SynchronizableContentsCollectionGet the prefix to use for the creation of contents- Specified by:
getContentPrefixin interfaceSynchronizableContentsCollection- Returns:
- The prefix to use for the creation of contents
-
validateAfterImport
public boolean validateAfterImport()
Description copied from interface:SynchronizableContentsCollectionTrue to validate the contents after import- Specified by:
validateAfterImportin interfaceSynchronizableContentsCollection- Returns:
- True to validate the contents after import
-
getReportMails
public String getReportMails()
Description copied from interface:SynchronizableContentsCollectionIf an exception occurs during synchronization, an error report mail will be sent to those email addresses (separated by new lines)- Specified by:
getReportMailsin interfaceSynchronizableContentsCollection- Returns:
- The email addresses to send an error report if an exception occurs during synchronization (separated by new lines)
-
getSynchronizingContentOperator
public String getSynchronizingContentOperator()
Description copied from interface:SynchronizableContentsCollectionGets the id of theSynchronizingContentOperatorextension to use during synchronization- Specified by:
getSynchronizingContentOperatorin interfaceSynchronizableContentsCollection- Returns:
- the id of the
SynchronizingContentOperatorextension to use during synchronization
-
synchronizeExistingContentsOnly
public boolean synchronizeExistingContentsOnly()
Description copied from interface:SynchronizableContentsCollectionTrue to synchronize only existing contents- Specified by:
synchronizeExistingContentsOnlyin interfaceSynchronizableContentsCollection- Returns:
- True to synchronize only existing contents
-
getSearchModelConfiguration
public SCCSearchModelConfiguration getSearchModelConfiguration()
Description copied from interface:SynchronizableContentsCollectionGet the search UI model for search tool (columns, criterias, url for buttons, etc.)- Specified by:
getSearchModelConfigurationin 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
protected List<String> _parseLanguages(Configuration configuration) throws ConfigurationException
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
-
-