Class ODFSynchronizingContentOperatorHelper
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.plugins.odfsync.scc.operator.ODFSynchronizingContentOperatorHelper
- All Implemented Interfaces:
LogEnabled,Initializable,Component,Configurable,Serviceable
- Direct Known Subclasses:
ImportSynchronizingContentOperatorHelper
public class ODFSynchronizingContentOperatorHelper
extends AbstractLogEnabled
implements Component, Serviceable, Initializable, Configurable
Get mapped values from a given connector to Ametys.
-
Field Summary
FieldsModifier and TypeFieldDescriptionMappings connector code - Ametys codeprotected StringThe implementation nameprotected OdfReferenceTableHelperThe ODF TableRef Helperprotected SourceResolverThe source resolver -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected String_getConvertedCode(String connectorCode, String contentTypeId) Get the converter code of the connector code from the mapped values.protected Optional<OdfReferenceTableEntry>_getReferenceTableEntry(String contentTypeId, String connectorCode) Get the reference table entry from the connector codeprotected Optional<OdfReferenceTableEntry>_getReferenceTableEntryFromMapping(String connectorCode, String contentTypeId) Get the reference table entry from the connector code in the mapped values._readMapping(String contentTypeId) Read the mapping file to convert codes.voidconfigure(Configuration configuration) getReferenceTableEntryId(String contentTypeId, String connectorCode) Get the id of content associated with this connector codevoidvoidservice(ServiceManager manager) Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
Field Details
-
_srcResolver
The source resolver -
_odfRefTableHelper
The ODF TableRef Helper -
_codeMappings
Mappings connector code - Ametys code -
_implementationName
The implementation name
-
-
Constructor Details
-
ODFSynchronizingContentOperatorHelper
-
-
Method Details
-
service
- Specified by:
servicein interfaceServiceable- Throws:
ServiceException
-
configure
- Specified by:
configurein interfaceConfigurable- Throws:
ConfigurationException
-
initialize
- Specified by:
initializein interfaceInitializable- Throws:
Exception
-
getReferenceTableEntryId
Get the id of content associated with this connector code- Parameters:
contentTypeId- The content type idconnectorCode- The code into the connector- Returns:
- The id of content or null if no match found
-
_getReferenceTableEntry
protected Optional<OdfReferenceTableEntry> _getReferenceTableEntry(String contentTypeId, String connectorCode) Get the reference table entry from the connector code- Parameters:
contentTypeId- The content type identifierconnectorCode- The connector code- Returns:
- the table entry corresponding to the given connector code
-
_getReferenceTableEntryFromMapping
protected Optional<OdfReferenceTableEntry> _getReferenceTableEntryFromMapping(String connectorCode, String contentTypeId) Get the reference table entry from the connector code in the mapped values.- Parameters:
connectorCode- The initial connector codecontentTypeId- The content type identifier- Returns:
- the table entry corresponding to the given connector code
-
_getConvertedCode
Get the converter code of the connector code from the mapped values. It the code does not correspond to any entry, the code itself is returned.- Parameters:
connectorCode- The initial connector codecontentTypeId- The content type identifier- Returns:
- The converted code or the connector code itself
-
_readMapping
Read the mapping file to convert codes.- Parameters:
contentTypeId- The content type identifier- Returns:
- The mapping of the file
-