Class AbstractODFSynchronizingContentOperator
- java.lang.Object
-
- org.ametys.plugins.contentio.synchronize.impl.DefaultSynchronizingContentOperator
-
- org.ametys.plugins.odfsync.scc.operator.AbstractODFSynchronizingContentOperator
-
- All Implemented Interfaces:
SynchronizingContentOperator
,PluginAware
,Configurable
,Serviceable
- Direct Known Subclasses:
ApogeeSynchronizingContentOperator
,PegaseSynchronizingContentOperator
public abstract class AbstractODFSynchronizingContentOperator extends DefaultSynchronizingContentOperator implements Serviceable
The abstract ODF synchronizing content operator. Each implementation can override this to add its helper role and specific mappings.
-
-
Field Summary
Fields Modifier and Type Field Description protected ContentTypeExtensionPoint
_contentTypeEP
The content type extension pointprotected ODFSynchronizingContentOperatorHelper
_odfSCCOperatorHelper
The connector conversion helper-
Fields inherited from class org.ametys.plugins.contentio.synchronize.impl.DefaultSynchronizingContentOperator
_label, _pluginName
-
-
Constructor Summary
Constructors Constructor Description AbstractODFSynchronizingContentOperator()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected String
_getFirstValueAsString(List<Object> values)
Get the first value as a string.protected String
_getReferenceTableEntryId(ContentAttributeDefinition definition, String value, org.slf4j.Logger logger)
Get the id of content associated with the given attribute valueprotected List<Object>
_transformAttributeValues(ModelItem definition, List<Object> values, org.slf4j.Logger logger)
Transform the given attribute valuesprotected List<Object>
_transformContentAttributeValues(ContentAttributeDefinition definition, List<Object> values, org.slf4j.Logger logger)
Transform the given values to content IDs, using Apogée conversion if needed.protected List<Object>
_transformRichTextAttributeValues(ElementDefinition definition, List<Object> values, org.slf4j.Logger logger)
Transform the given values to concatenate them and get the final rich text valueprotected abstract String
getHelperRole()
Get the SCC operator helper for the current implementation.void
service(ServiceManager manager)
Map<String,List<Object>>
transform(ContentType contentType, Map<String,List<Object>> remoteValues, org.slf4j.Logger logger)
Transforms the remote values of aSynchronizableContentsCollection
before synchronizing attributes.-
Methods inherited from class org.ametys.plugins.contentio.synchronize.impl.DefaultSynchronizingContentOperator
additionalOperation, configure, getLabel, setPluginInfo
-
-
-
-
Field Detail
-
_odfSCCOperatorHelper
protected ODFSynchronizingContentOperatorHelper _odfSCCOperatorHelper
The connector conversion helper
-
_contentTypeEP
protected ContentTypeExtensionPoint _contentTypeEP
The content type extension point
-
-
Constructor Detail
-
AbstractODFSynchronizingContentOperator
public AbstractODFSynchronizingContentOperator()
-
-
Method Detail
-
service
public void service(ServiceManager manager) throws ServiceException
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
getHelperRole
protected abstract String getHelperRole()
Get the SCC operator helper for the current implementation.- Returns:
- a SCC operator helper role
-
transform
public Map<String,List<Object>> transform(ContentType contentType, Map<String,List<Object>> remoteValues, org.slf4j.Logger logger)
Description copied from interface:SynchronizingContentOperator
Transforms the remote values of aSynchronizableContentsCollection
before synchronizing attributes.- Specified by:
transform
in interfaceSynchronizingContentOperator
- Overrides:
transform
in classDefaultSynchronizingContentOperator
- Parameters:
contentType
- The content typeremoteValues
- The remote values to transformlogger
- The logger- Returns:
- The transformed remote values
-
_transformAttributeValues
protected List<Object> _transformAttributeValues(ModelItem definition, List<Object> values, org.slf4j.Logger logger)
Transform the given attribute values- Parameters:
definition
- The definition of the attributevalues
- The values to transformlogger
- The logger- Returns:
- The transformed values
-
_transformContentAttributeValues
protected List<Object> _transformContentAttributeValues(ContentAttributeDefinition definition, List<Object> values, org.slf4j.Logger logger)
Transform the given values to content IDs, using Apogée conversion if needed.- Parameters:
definition
- The definition of the attributevalues
- The values to transformlogger
- The logger- Returns:
- The corresponding content IDs of the values
-
_getReferenceTableEntryId
protected String _getReferenceTableEntryId(ContentAttributeDefinition definition, String value, org.slf4j.Logger logger)
Get the id of content associated with the given attribute value- Parameters:
definition
- The definition of the attributevalue
- The attribute valuelogger
- The logger- Returns:
- The id of content or null if no match found
-
_transformRichTextAttributeValues
protected List<Object> _transformRichTextAttributeValues(ElementDefinition definition, List<Object> values, org.slf4j.Logger logger)
Transform the given values to concatenate them and get the final rich text value- Parameters:
definition
- The definition of the attributevalues
- The values to transformlogger
- The logger- Returns:
- The concatenated values
-
_getFirstValueAsString
protected String _getFirstValueAsString(List<Object> values)
Get the first value as a string.- Parameters:
values
- The list of values to iterate on- Returns:
- The first value as a string or null
-
-