Class PluginServiceImpl
- java.lang.Object
-
- org.craftercms.engine.plugin.impl.PluginServiceImpl
-
- All Implemented Interfaces:
PluginService
public class PluginServiceImpl extends Object implements PluginService
Default implementation forPluginService
- Since:
- 4.0.0
- Author:
- joseross
-
-
Field Summary
Fields Modifier and Type Field Description protected String
configurationPathPattern
protected org.craftercms.commons.config.EncryptionAwareConfigurationReader
configurationReader
protected org.craftercms.core.service.ContentStoreService
contentStoreService
protected Pattern
pattern
static String
PLUGIN_CONFIG_KEY
static String
PLUGIN_ID_KEY
static String
PLUGIN_ID_PLACEHOLDER
-
Constructor Summary
Constructors Constructor Description PluginServiceImpl(org.craftercms.core.service.ContentStoreService contentStoreService, org.craftercms.commons.config.EncryptionAwareConfigurationReader configurationReader, String configurationPathPattern)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addPluginVariables(String url, BiConsumer<String,Object> setter)
Adds variables related to plugins if the given URL belongs to a pluginprotected org.craftercms.core.service.Context
getCurrentContext()
org.apache.commons.configuration2.HierarchicalConfiguration<?>
getPluginConfig(String pluginId)
Loads the configuration for a given pluginprotected String
getPluginConfigPath(String pluginPath)
protected String
getPluginId(String pluginPath)
protected org.apache.commons.configuration2.HierarchicalConfiguration<?>
loadPluginConfiguration(org.craftercms.core.service.Context context, String pluginPath)
protected boolean
pluginConfigExists(String path)
-
-
-
Field Detail
-
PLUGIN_ID_KEY
public static final String PLUGIN_ID_KEY
- See Also:
- Constant Field Values
-
PLUGIN_CONFIG_KEY
public static final String PLUGIN_CONFIG_KEY
- See Also:
- Constant Field Values
-
PLUGIN_ID_PLACEHOLDER
public static final String PLUGIN_ID_PLACEHOLDER
- See Also:
- Constant Field Values
-
pattern
protected Pattern pattern
-
contentStoreService
protected org.craftercms.core.service.ContentStoreService contentStoreService
-
configurationReader
protected org.craftercms.commons.config.EncryptionAwareConfigurationReader configurationReader
-
configurationPathPattern
protected String configurationPathPattern
-
-
Constructor Detail
-
PluginServiceImpl
@ConstructorProperties({"contentStoreService","configurationReader","configurationPathPattern"}) public PluginServiceImpl(org.craftercms.core.service.ContentStoreService contentStoreService, org.craftercms.commons.config.EncryptionAwareConfigurationReader configurationReader, String configurationPathPattern)
-
-
Method Detail
-
getPluginConfig
public org.apache.commons.configuration2.HierarchicalConfiguration<?> getPluginConfig(String pluginId)
Description copied from interface:PluginService
Loads the configuration for a given plugin- Specified by:
getPluginConfig
in interfacePluginService
- Parameters:
pluginId
- the id of the plugin- Returns:
- the configuration object
-
loadPluginConfiguration
protected org.apache.commons.configuration2.HierarchicalConfiguration<?> loadPluginConfiguration(org.craftercms.core.service.Context context, String pluginPath)
-
addPluginVariables
public void addPluginVariables(String url, BiConsumer<String,Object> setter)
Description copied from interface:PluginService
Adds variables related to plugins if the given URL belongs to a plugin- Specified by:
addPluginVariables
in interfacePluginService
- Parameters:
url
- the URL to checksetter
- the setter for the variables
-
pluginConfigExists
protected boolean pluginConfigExists(String path)
-
getCurrentContext
protected org.craftercms.core.service.Context getCurrentContext()
-
-