public interface IAddonContext
Modifier and Type | Method and Description |
---|---|
PicApportPluginAction |
createAction(java.lang.String title,
java.io.File fileOrDirectory)
create a button with text title to execute a dir:"fileOrDirectory" query
author Eric 29.04.2020
|
PicApportPluginAction |
createAction(java.lang.String title,
java.lang.String query)
create a button with text title to execute a query
author Eric 29.04.2020
|
java.lang.String |
getAddonName()
Returns the name of the addon
author Eric 25.10.2018
|
java.io.File |
getAddonPath()
Returns the path where the addon is installed.
|
boolean |
getConfigParAsBoolean(java.lang.String name,
boolean defaultVaulue)
Get's a parameter from the UTF-8 encoded config.json file in the addon-directory
If there are more than one .groovy add-ons in one directory make sure that only one
of them uses the config file.
|
java.lang.String |
getConfigParAsString(java.lang.String name,
java.lang.String defaultVaulue)
Get's a parameter from the UTF-8 encoded config.json file in the addon-directory
If there are more than one .groovy add-ons in one directory make sure that only one
of them uses the config file.
|
IPicApportPlugInLogger |
getLogger()
All console output should be created with the IPicApportPlugInLogger
author Eric 24.10.2018
|
java.lang.String |
i18n(java.lang.String id)
Utilitiy method.
|
java.lang.String |
i18n(java.lang.String defaultValue,
java.util.Map localeMap)
author Eric 09.07.2020
|
void |
putConfigPar(java.lang.String name,
boolean value)
Updates a parameter in Server memory
author Eric 22.07.2020
|
void |
putConfigPar(java.lang.String name,
java.lang.String value)
Updates a parameter in Server memory
author Eric 22.07.2020
|
void |
rescanDirectoryAfterUpdate(java.io.File directory)
if an Addon has created one or more new Files it should call this function
to make sure that the update is recognized
author Eric 28.04.2020
|
void |
updateConfigFile()
Writes current parameters from memory to the config.json in the addon directory
Important!
|
IPicApportPlugInLogger getLogger()
java.io.File getAddonPath()
java.lang.String getAddonName()
void rescanDirectoryAfterUpdate(java.io.File directory)
directory
- Directory that should be rescanned by the crawlerjava.lang.String i18n(java.lang.String id)
id
- id of the requested map entryjava.lang.String i18n(java.lang.String defaultValue, java.util.Map localeMap)
defaultValue
- String representing the default value (should be English)localeMap
- A Map with key-value pairs for translation e.G.
["de":"Stadt", "fr":"ville", "en":"city"]PicApportPluginAction createAction(java.lang.String title, java.io.File fileOrDirectory)
title
- Button textfileOrDirectory
- file or Directory that should be displayed when the button is pressedPicApportPluginAction createAction(java.lang.String title, java.lang.String query)
title
- Button textquery
- the query that should be started when the button is pressedboolean getConfigParAsBoolean(java.lang.String name, boolean defaultVaulue)
name
- Parameter namedefaultVaulue
- will be returned if parameter does not existjava.lang.String getConfigParAsString(java.lang.String name, java.lang.String defaultVaulue)
name
- Parameter namedefaultVaulue
- will be returned if parameter does not existvoid putConfigPar(java.lang.String name, java.lang.String value)
name
- Parameter namevalue
- Parameter valuevoid putConfigPar(java.lang.String name, boolean value)
name
- Parameter namevalue
- Parameter valuevoid updateConfigFile() throws java.io.IOException
java.io.IOException
- if error occurs