Class ODFSynchronizingContentOperatorHelper
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.plugins.odfsync.generic.scc.AbstractMappingHelper
org.ametys.plugins.odfsync.scc.operator.ODFSynchronizingContentOperatorHelper
- All Implemented Interfaces:
LogEnabled,Initializable,Component,Configurable,Serviceable
- Direct Known Subclasses:
ImportSynchronizingContentOperatorHelper
public class ODFSynchronizingContentOperatorHelper
extends AbstractMappingHelper
implements Component, Initializable
Get mapped values from a given connector to Ametys.
-
Field Summary
FieldsModifier and TypeFieldDescriptionMappings connector code - Ametys codeprotected OdfReferenceTableHelperThe ODF TableRef HelperFields inherited from class org.ametys.plugins.odfsync.generic.scc.AbstractMappingHelper
_implementationName, _srcResolver -
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._readContentTypeMapping(String contentTypeId) Read the mapping file to convert codes.getReferenceTableEntryId(String contentTypeId, String connectorCode) Get the id of content associated with this connector codevoidvoidservice(ServiceManager manager) Methods inherited from class org.ametys.plugins.odfsync.generic.scc.AbstractMappingHelper
_parseMappingFile, _readMapping, configureMethods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
Field Details
-
_odfRefTableHelper
The ODF TableRef Helper -
_codeMappings
Mappings connector code - Ametys code
-
-
Constructor Details
-
ODFSynchronizingContentOperatorHelper
-
-
Method Details
-
service
- Specified by:
servicein interfaceServiceable- Overrides:
servicein classAbstractMappingHelper- Throws:
ServiceException
-
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
-
_readContentTypeMapping
Read the mapping file to convert codes.- Parameters:
contentTypeId- The content type identifier- Returns:
- The mapping of the file
-