Class AbstractMappingHelper
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.plugins.odfsync.generic.scc.AbstractMappingHelper
- All Implemented Interfaces:
FileReloader,LogEnabled,PluginAware,Initializable,Component,Configurable,Serviceable
- Direct Known Subclasses:
ODFSynchronizingContentOperatorHelper,PegaseSCCMappingHelper
public abstract class AbstractMappingHelper
extends AbstractLogEnabled
implements Component, Serviceable, Configurable, PluginAware, Initializable, FileReloader
Abstract class for reading mapping files in ODF helpers.
First look for a project mapping files in WEB-INF/param/odf
Then look for the default mapping files in plugin.odf-sync
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected AbstractCacheManagerThe cache managerprotected FileReloaderUtilsThe file reloader utilsprotected StringThe implementation nameprotected SourceResolverThe source resolver -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription_readMapping(String baseUri) Read the mapping file to convert types.voidconfigure(Configuration configuration) protected abstract I18nizableTextGet the cache description.protected abstract I18nizableTextGet the cache label.Get an unique ID for this File Reloadervoidvoidservice(ServiceManager manager) voidsetPluginInfo(String pluginName, String featureName, String id) Sets the plugin info relative to the current component.
Note : The feature name may be null if the targeted component in declared at plugin level.voidupdateFile(String sourceUrl, Source source, InputStream is) Update the file, the sourceUrl is only there if you manage multiple files, the Configuration object is already present to read itMethods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
Field Details
-
_srcResolver
The source resolver -
_cacheManager
The cache manager -
_fileReloaderUtils
The file reloader utils -
_implementationName
The implementation name
-
-
Constructor Details
-
AbstractMappingHelper
public AbstractMappingHelper()
-
-
Method Details
-
setPluginInfo
Description copied from interface:PluginAwareSets the plugin info relative to the current component.
Note : The feature name may be null if the targeted component in declared at plugin level.- Specified by:
setPluginInfoin interfacePluginAware- Parameters:
pluginName- Unique identifier for the plugin hosting the extensionfeatureName- Unique feature identifier (unique for a given pluginName)id- Unique identifier of this component
-
configure
- Specified by:
configurein interfaceConfigurable- Throws:
ConfigurationException
-
service
- Specified by:
servicein interfaceServiceable- Throws:
ServiceException
-
initialize
- Specified by:
initializein interfaceInitializable- Throws:
Exception
-
_readMapping
Read the mapping file to convert types.- Parameters:
baseUri- The base uri of the file- Returns:
- The mapping
- Throws:
Exception- if an exception occurs
-
updateFile
Description copied from interface:FileReloaderUpdate the file, the sourceUrl is only there if you manage multiple files, the Configuration object is already present to read it- Specified by:
updateFilein interfaceFileReloader- Parameters:
sourceUrl- the url of the file.source- the source to read, can be null if no file was readis- the input stream to read, can be null if no file was read- Throws:
Exception- something went wrong while reading the inputstream
-
getId
Description copied from interface:FileReloaderGet an unique ID for this File Reloader- Specified by:
getIdin interfaceFileReloader- Parameters:
sourceUrl- this is passed as an argument if your class read multiple files. If it reads only one file, the full class name can be a good enough ID- Returns:
- an unique ID
-
getCacheLabel
Get the cache label.- Returns:
- the cache label
-
getCacheDescription
Get the cache description.- Returns:
- the cache description
-