Package com.jalios.jcms.plugin
Class PluginManager
- java.lang.Object
-
- com.jalios.jcms.plugin.PluginManager
-
- All Implemented Interfaces:
PluginComponent
,ReplicaMessageListener
public final class PluginManager extends java.lang.Object implements ReplicaMessageListener
Singleton used to manage plugin's life cycle.
It also contains utility methods and constants for plugins.- Initialization of PluginManager
- Loading Plugins
- Initialize dependencies
- Initializing deployed Plugins
- Setup deployed plugins
- Since:
- jcms-5.7.0
- Author:
- Jean-Philippe Encausse
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
MAIN_PLUGIN_CHECK_PROP
static java.lang.String
MAIN_PLUGIN_PROP
protected static java.lang.String
PAYLOAD_DISABLE
protected static java.lang.String
PAYLOAD_ENABLE
protected static java.lang.String
PAYLOAD_REQUEST_FOR_ACTIVATION
protected static java.lang.String
PAYLOAD_REQUEST_FOR_DEACTIVATION
static java.lang.String
PLUGIN_BACKUP
static java.lang.String
PLUGIN_BUILD
static java.lang.String
PLUGIN_EXTENSION
static java.lang.String
PLUGIN_I18N_OVERRIDE_PATH_DEFAULT
Default folder path in which to look for I18N plugin properties overrides.static java.lang.String
PLUGIN_I18N_OVERRIDE_PATH_PROP
Property use to specified a folder path in which to look for I18N plugin properties overrides.static java.lang.String
PLUGIN_PRIVATE_PATH
static java.lang.String
PLUGIN_PUBLIC_PATH
protected static java.lang.String
PLUGIN_SYNC_PROP
static java.lang.String
PLUGIN_XML
protected static java.lang.String
REPLICA_MESSAGE_PLUGIN
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
checkResourceAccess(java.lang.String resource)
Returns true if the given plugin's resource (JSP) is provided by an active plugin.void
clearCachedInclude()
boolean
deletePluginFiles(Plugin plugin)
Delete all deployed files of the given plugin.boolean
deployPlugin(Plugin plugin, java.lang.String archiveName)
Deploy all files from a given archive to the current JCMS directory tree.boolean
disablePlugin(Plugin plugin)
Disable the given plugin.boolean
disablePlugin(java.lang.String pluginName)
Disable the given plugin.boolean
enablePlugin(Plugin plugin)
Enable the given plugin.boolean
enablePlugin(java.lang.String pluginName)
Enable the given plugin.Plugin
findPluginProvidingType(java.lang.String className)
Return the plugin providing the given type.Plugin
findPluginProvidingWorkflow(java.lang.String wfId)
Returns the plugin providing the given workflow.java.util.Set<java.lang.String>
getAllPathSet(boolean sources)
Returns a Set of relative path to all plugins declared filesjava.util.Set<java.lang.String>
getAllPathSet(boolean sources, boolean generated, boolean signature, boolean pkg, boolean jar, java.lang.String prefix, boolean directory)
Returns a Set of relative path to all plugins declared filesvoid
getCssFiles(java.util.Collection<java.io.File> cssPaths, java.io.FileFilter filter)
Fill given cssPaths collection with plugins css path used for portalsvoid
getCssFiles(java.util.Collection<java.io.File> cssPaths, java.util.Collection<Plugin> collection, java.io.FileFilter filter)
Fill given cssPaths collection with plugins css path used for portalsstatic PluginManager
getInstance()
Returns a PluginManager.java.util.Set<java.lang.String>
getJarsPath()
Returns a Set of relative Path to all webapp's jarPlugin
getMainPlugin()
Returns the main plugin (or null if there is no main plugin)LangProperties
getMainPluginCoreProperties()
Returns the core properties the main plugin override.java.lang.String
getMainPluginName()
Returns the name of the main plugin (or null if there is no main plugin)Plugin
getPlugin(java.lang.String pluginName)
Returns the plugin for the given name or null if it does not exists.org.xml.sax.EntityResolver
getPluginEntityResolver()
static PluginManager
getPluginManager()
java.util.Set<java.lang.String>
getPluginPath(boolean priv, java.lang.String pluginName, java.util.Set<java.lang.String> pluginSet)
Returns a Set of relative Path to plugin public/private folder with all files stored on disk even if they are not declared in xmljava.util.Collection<Plugin>
getPlugins()
Returns a Collection of plugins.org.jdom.input.SAXBuilder
getSAXBuilder()
java.util.Set<java.lang.String>
getWorkflowsPath()
Returns a Set of relative Path to all webapp's workflowvoid
init(Channel channel)
Inits the PluginManager.void
initMainPlugin()
Initialize main plugin (reserved for JCMS internals).void
initPlugins()
Inits all plugins that have been correctly loaded.void
initPlugins(java.util.Collection<Plugin> collection)
Inits all plugins that have been correctly loaded.void
initReplicaMessageListener()
void
invalidateIncludeCache()
Invalidate cache of plugin's JSP to include for given tags.boolean
isMainPluginDefined()
Returns true if the main plugin has been defined.boolean
isPluginActive(java.lang.String pluginName)
Returns true if this plugin is active.boolean
isPluginEnabled(java.lang.String pluginName)
Returns true if this plugin is enabled.boolean
isPluginSyncEnabled()
Plugin
loadArchive(java.io.File file)
Load a given Plugin Archive if it has not been already loaddedvoid
loadLanguageProperties(LangProperties properties, java.util.List<java.lang.String> jcmsLangList)
Iterates on plugin's collection and load only languages properties for initialized plugins.void
loadMainPluginProperties(LangProperties properties, java.util.List<java.lang.String> jcmsLangList)
Loads all the properties of the main plugin.Plugin
loadPluginXML(java.io.File file)
Load a given Plugin Archive if it has not been already loaddedvoid
loadProperties(LangProperties properties, java.util.List<java.lang.String> jcmsLangList)
Iterates on plugin's collection and load properties, including language properties for initialized plugins.void
loadProperties(LangProperties properties, java.util.List<java.lang.String> jcmsLangList, java.util.Collection<Plugin> collection, boolean onlyLangProp)
Iterates on plugin's collection and load properties for initialized pluginsstatic java.util.Collection<Plugin>
orderPlugins(java.util.Collection<Plugin> plugins, boolean useDefaultOnFailure)
Computes a topological sort of all the plugins and inter-dependencies.boolean
performDeletePackage(java.lang.String packageName)
Delete the given plugin packagejava.util.Map<Plugin,java.util.Set<SignatureDiffEntry>>
performDiffPlugins()
Perform a Diff on each loaded plugins and store results in a Mapvoid
performInclude(java.lang.String tag, javax.servlet.jsp.PageContext pageContext)
Iterates on plugin's collection and retrieve Plugins' JSP to include for the given anchor.void
processMessage(ReplicaMessage msg)
Process the given ReplicaMessage.void
register(Plugin plugin)
Register a loaded plugin in PluginManagervoid
registerAlarmListener()
Iterates on plugin's collection and register AlarmListener for initialized plugins.void
registerAlarmListener(java.util.Collection<Plugin> collection)
Iterates on plugin's collection and register AlarmListener for initialized pluginsvoid
registerAlertChannel()
Iterates on plugin's collection and register AlertChannel for initialized plugins.void
registerAlertChannel(java.util.Collection<Plugin> collection)
Iterates on plugin's collection and register AlertChannel for initialized pluginsvoid
registerAuthenticationHandler()
Iterates on plugin's collection and register AuthenticationHandlers for initialized plugins.void
registerAuthenticationHandler(java.util.Collection<Plugin> collection)
Iterates on plugin's collection and register AuthenticationHandlers for initialized pluginsvoid
registerChannelListener()
Iterates on plugin's collection and register ChannelListener for initialized plugins.void
registerChannelListener(java.util.Collection<Plugin> collection)
Iterates on plugin's collection and register ChannelListener for initialized pluginsvoid
registerCleanFilter()
Iterates on plugin's collection and register CleanFilter for initialized plugins.void
registerCleanFilter(java.util.Collection<Plugin> collection)
Iterates on plugin's collection and register CleanFilter for initialized pluginsvoid
registerDataController()
Iterates on plugin's collection and register DataController for initialized plugins.void
registerDataController(java.util.Collection<Plugin> collection)
Iterates on plugin's collection and register DataController for initialized pluginsvoid
registerDBListener()
Iterates on plugin's collection and register DBlistener for initialized plugins.void
registerDBListener(java.util.Collection<Plugin> collection)
Iterates on plugin's collection and register DBlistener for initialized pluginsvoid
registerHibernateMapping()
Iterates on plugin's collection and register Hibernate mappings for initialized plugins.void
registerHibernateMapping(java.util.Collection<Plugin> collection)
Iterates on plugin's collection and register Hibernate mappings for initialized pluginsvoid
registerJSyncListener()
Iterates on plugin's collection and register JSyncListener for initialized plugins.void
registerJSyncListener(java.util.Collection<Plugin> collection)
Iterates on plugin's collection and register JSyncListener for initialized pluginsvoid
registerOpenApiResources(java.util.Collection<Plugin> collection)
Iterates on plugin's collection and register RestResource for initialized pluginsvoid
registerPolicyFilter()
Iterates on plugin's collection and register PolicyFilter for initialized plugins.void
registerPolicyFilter(java.util.Collection<Plugin> collection)
Iterates on plugin's collection and register PolicyFilter for initialized pluginsvoid
registerQueryFilter()
Iterates on plugin's collection and register QueryFilter for initialized plugins.void
registerQueryFilter(java.util.Collection<Plugin> collection)
Iterates on plugin's collection and register QueryFilter for initialized pluginsvoid
registerRestResource()
Iterates on plugin's collection and register RestResource for initialized plugins.void
registerStoreListener(boolean beforeStoreLoad)
Iterates on plugin's collection and register StoreListener for initialized plugins.void
registerStoreListener(java.util.Collection<Plugin> collection, boolean beforeStoreLoad)
Iterates on plugin's collection and register StoreListener for initialized pluginsvoid
registerTemplates()
Iterates on plugin's collection and register types' template for initialized plugins.void
registerTemplates(java.util.Collection<Plugin> collection)
Iterates on plugin's collection and register types' template for initialized pluginsvoid
setupPlugins()
Setup all plugins that have been correctly initialized.void
setupPlugins(java.util.Collection<Plugin> collection)
Setup all plugins that have been correctly initialized.void
signPlugins()
Sign all plugins that have been correctly initialized.void
signPlugins(java.util.Collection<Plugin> collection)
Sign all plugins that have been correctly initialized.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.jalios.jcms.plugin.PluginComponent
init
-
-
-
-
Field Detail
-
PLUGIN_PRIVATE_PATH
public static final java.lang.String PLUGIN_PRIVATE_PATH
- See Also:
- Constant Field Values
-
PLUGIN_PUBLIC_PATH
public static final java.lang.String PLUGIN_PUBLIC_PATH
- See Also:
- Constant Field Values
-
PLUGIN_XML
public static final java.lang.String PLUGIN_XML
- See Also:
- Constant Field Values
-
PLUGIN_BUILD
public static final java.lang.String PLUGIN_BUILD
- See Also:
- Constant Field Values
-
PLUGIN_EXTENSION
public static final java.lang.String PLUGIN_EXTENSION
- See Also:
- Constant Field Values
-
PLUGIN_BACKUP
public static final java.lang.String PLUGIN_BACKUP
- See Also:
- Constant Field Values
-
MAIN_PLUGIN_PROP
public static final java.lang.String MAIN_PLUGIN_PROP
- See Also:
- Constant Field Values
-
MAIN_PLUGIN_CHECK_PROP
public static final java.lang.String MAIN_PLUGIN_CHECK_PROP
- See Also:
- Constant Field Values
-
PLUGIN_SYNC_PROP
protected static final java.lang.String PLUGIN_SYNC_PROP
- See Also:
- Constant Field Values
-
REPLICA_MESSAGE_PLUGIN
protected static final java.lang.String REPLICA_MESSAGE_PLUGIN
- See Also:
- Constant Field Values
-
PAYLOAD_ENABLE
protected static final java.lang.String PAYLOAD_ENABLE
- See Also:
- Constant Field Values
-
PAYLOAD_DISABLE
protected static final java.lang.String PAYLOAD_DISABLE
- See Also:
- Constant Field Values
-
PAYLOAD_REQUEST_FOR_ACTIVATION
protected static final java.lang.String PAYLOAD_REQUEST_FOR_ACTIVATION
- See Also:
- Constant Field Values
-
PAYLOAD_REQUEST_FOR_DEACTIVATION
protected static final java.lang.String PAYLOAD_REQUEST_FOR_DEACTIVATION
- See Also:
- Constant Field Values
-
PLUGIN_I18N_OVERRIDE_PATH_PROP
public static final java.lang.String PLUGIN_I18N_OVERRIDE_PATH_PROP
Property use to specified a folder path in which to look for I18N plugin properties overrides. The value of the property must contain pattern${pluginName}
which is replaced by each plugin name. Default value is "WEB-INF/plugins/LangPatchPlugin/properties/languages/${pluginName}/"- Since:
- 10.0.6 / JCMS-8916
- See Also:
- Constant Field Values
-
PLUGIN_I18N_OVERRIDE_PATH_DEFAULT
public static final java.lang.String PLUGIN_I18N_OVERRIDE_PATH_DEFAULT
Default folder path in which to look for I18N plugin properties overrides.- Since:
- 10.0.6 / JCMS-8916
- See Also:
- Constant Field Values
-
-
Method Detail
-
getInstance
public static PluginManager getInstance()
Returns a PluginManager. Singleton method initalized by Channel (not synchronized)- Returns:
- PluginManager the Pluginmanager
-
getPluginManager
public static PluginManager getPluginManager()
-
init
public void init(Channel channel)
Inits the PluginManager.- Parameters:
channel
- the Channel singleton instance
-
initPlugins
public void initPlugins()
Inits all plugins that have been correctly loaded. Called after Channelinitialized most important stuff.
-
initPlugins
public void initPlugins(java.util.Collection<Plugin> collection)
Inits all plugins that have been correctly loaded. Called juste after PluginManager Initialisation, Channel not completly initialised. Properties not loaded.- Parameters:
collection
- a collection of Plugin
-
setupPlugins
public void setupPlugins()
Setup all plugins that have been correctly initialized. Channel properties have been loaded.
-
setupPlugins
public void setupPlugins(java.util.Collection<Plugin> collection)
Setup all plugins that have been correctly initialized. Channel properties have been loaded.- Parameters:
collection
- a collection of Plugin
-
getMainPluginName
public java.lang.String getMainPluginName()
Returns the name of the main plugin (or null if there is no main plugin)- Returns:
- the name of the main plugin (or null if there is no main plugin)
- Since:
- jcms-8.0.1
-
getMainPlugin
public Plugin getMainPlugin()
Returns the main plugin (or null if there is no main plugin)- Returns:
- the main plugin (or null if there is no main plugin)
- Since:
- jcms-8.0.1
-
isMainPluginDefined
public boolean isMainPluginDefined()
Returns true if the main plugin has been defined.- Returns:
- true if the main plugin has been defined.
- Since:
- jcms-8.0.1
-
initMainPlugin
public void initMainPlugin() throws java.lang.IllegalStateException
Initialize main plugin (reserved for JCMS internals).- Throws:
java.lang.IllegalStateException
- if the main plugin is not correctly started- Since:
- jcms-8.0.1
-
loadMainPluginProperties
public void loadMainPluginProperties(LangProperties properties, java.util.List<java.lang.String> jcmsLangList)
Loads all the properties of the main plugin.- Parameters:
properties
- the properties where to load the main plugin propertiesjcmsLangList
- the JCMS language list- Since:
- jcms-8.0.1
-
getMainPluginCoreProperties
public LangProperties getMainPluginCoreProperties()
Returns the core properties the main plugin override.- Returns:
- the core properties the main plugin override.
- Since:
- jcms-8.0.1
-
signPlugins
public void signPlugins()
Sign all plugins that have been correctly initialized. Channel properties have been loaded.
-
signPlugins
public void signPlugins(java.util.Collection<Plugin> collection)
Sign all plugins that have been correctly initialized. Channel properties have been loaded.- Parameters:
collection
- a collection of Plugin
-
performDiffPlugins
public java.util.Map<Plugin,java.util.Set<SignatureDiffEntry>> performDiffPlugins()
Perform a Diff on each loaded plugins and store results in a Map- Returns:
- Return a Map of Plugin/Set of DiffEntry.
-
getAllPathSet
public java.util.Set<java.lang.String> getAllPathSet(boolean sources)
Returns a Set of relative path to all plugins declared files- Parameters:
sources
- also include .java sources- Returns:
- Set of relative path
-
getAllPathSet
public java.util.Set<java.lang.String> getAllPathSet(boolean sources, boolean generated, boolean signature, boolean pkg, boolean jar, java.lang.String prefix, boolean directory)
Returns a Set of relative path to all plugins declared files- Parameters:
sources
- also include .java sourcesgenerated
- include generated contentsignature
- add signature filepkg
- add package filejar
- add jar fileprefix
- add prefix to pathdirectory
- should resolve directory path- Returns:
- Set of relative path
-
getPluginEntityResolver
public org.xml.sax.EntityResolver getPluginEntityResolver()
-
getSAXBuilder
public org.jdom.input.SAXBuilder getSAXBuilder()
-
register
public void register(Plugin plugin)
Register a loaded plugin in PluginManager- Parameters:
plugin
- the loaded plugin
-
loadPluginXML
public Plugin loadPluginXML(java.io.File file)
Load a given Plugin Archive if it has not been already loadded- Parameters:
file
- the folder that contains PLUGIN_XML- Returns:
- Plugin or null if there is an error
-
loadArchive
public Plugin loadArchive(java.io.File file)
Load a given Plugin Archive if it has not been already loadded- Parameters:
file
- the archive that ends with PLUGIN_EXTENSION- Returns:
- Plugin or null if there is an error
-
orderPlugins
public static java.util.Collection<Plugin> orderPlugins(java.util.Collection<Plugin> plugins, boolean useDefaultOnFailure)
Computes a topological sort of all the plugins and inter-dependencies.- Plugin must be Comparable
- Any cycle in the plugin dependencies will result in a naive sorting implementation being used
- Parameters:
plugins
- a collection of plugin, must not be nulluseDefaultOnFailure
- true to use a naive sorting implementation if a cycle is detected, false to return null- Returns:
- a sorted collection of plugins according to their dependencies, names and order
- Since:
- jcms-10.0.2 / JCMS-6901
-
deployPlugin
public boolean deployPlugin(Plugin plugin, java.lang.String archiveName)
Deploy all files from a given archive to the current JCMS directory tree. If file already exists backup it to plugin backup directory.- Parameters:
plugin
- the loaded PluginarchiveName
- the archive to deploy- Returns:
- boolean true if deployement has been correctly done
-
deletePluginFiles
public boolean deletePluginFiles(Plugin plugin)
Delete all deployed files of the given plugin.- Parameters:
plugin
- the loaded Plugin- Returns:
- boolean true if delete has been correctly done
-
performDeletePackage
public boolean performDeletePackage(java.lang.String packageName)
Delete the given plugin package- Parameters:
packageName
- the name of the package to delete- Returns:
- boolean
- Since:
- jcms-5.7.1
-
registerTemplates
public void registerTemplates()
Iterates on plugin's collection and register types' template for initialized plugins.
-
registerTemplates
public void registerTemplates(java.util.Collection<Plugin> collection)
Iterates on plugin's collection and register types' template for initialized plugins- Parameters:
collection
- a collection of Plugin
-
registerStoreListener
public void registerStoreListener(boolean beforeStoreLoad)
Iterates on plugin's collection and register StoreListener for initialized plugins.- Parameters:
beforeStoreLoad
- boolean true before loading store
-
registerStoreListener
public void registerStoreListener(java.util.Collection<Plugin> collection, boolean beforeStoreLoad)
Iterates on plugin's collection and register StoreListener for initialized plugins- Parameters:
collection
- a collection of PluginbeforeStoreLoad
- boolean true before loading store
-
registerDBListener
public void registerDBListener()
Iterates on plugin's collection and register DBlistener for initialized plugins.
-
registerDBListener
public void registerDBListener(java.util.Collection<Plugin> collection)
Iterates on plugin's collection and register DBlistener for initialized plugins- Parameters:
collection
- a collection of Plugin
-
registerJSyncListener
public void registerJSyncListener()
Iterates on plugin's collection and register JSyncListener for initialized plugins.
-
registerJSyncListener
public void registerJSyncListener(java.util.Collection<Plugin> collection)
Iterates on plugin's collection and register JSyncListener for initialized plugins- Parameters:
collection
- a collection of Plugin
-
registerDataController
public void registerDataController()
Iterates on plugin's collection and register DataController for initialized plugins.
-
registerDataController
public void registerDataController(java.util.Collection<Plugin> collection)
Iterates on plugin's collection and register DataController for initialized plugins- Parameters:
collection
- a collection of Plugin
-
registerAlarmListener
public void registerAlarmListener()
Iterates on plugin's collection and register AlarmListener for initialized plugins.
-
registerAlarmListener
public void registerAlarmListener(java.util.Collection<Plugin> collection)
Iterates on plugin's collection and register AlarmListener for initialized plugins- Parameters:
collection
- a collection of Plugin
-
registerAlertChannel
public void registerAlertChannel()
Iterates on plugin's collection and register AlertChannel for initialized plugins.
-
registerAlertChannel
public void registerAlertChannel(java.util.Collection<Plugin> collection)
Iterates on plugin's collection and register AlertChannel for initialized plugins- Parameters:
collection
- a collection of Plugin
-
registerRestResource
public void registerRestResource()
Iterates on plugin's collection and register RestResource for initialized plugins.
-
registerOpenApiResources
public void registerOpenApiResources(java.util.Collection<Plugin> collection)
Iterates on plugin's collection and register RestResource for initialized plugins- Parameters:
collection
- a collection of Plugin
-
registerChannelListener
public void registerChannelListener()
Iterates on plugin's collection and register ChannelListener for initialized plugins.
-
registerChannelListener
public void registerChannelListener(java.util.Collection<Plugin> collection)
Iterates on plugin's collection and register ChannelListener for initialized plugins- Parameters:
collection
- a collection of Plugin
-
registerQueryFilter
public void registerQueryFilter()
Iterates on plugin's collection and register QueryFilter for initialized plugins.
-
registerQueryFilter
public void registerQueryFilter(java.util.Collection<Plugin> collection)
Iterates on plugin's collection and register QueryFilter for initialized plugins- Parameters:
collection
- a collection of Plugin
-
registerCleanFilter
public void registerCleanFilter()
Iterates on plugin's collection and register CleanFilter for initialized plugins.
-
registerCleanFilter
public void registerCleanFilter(java.util.Collection<Plugin> collection)
Iterates on plugin's collection and register CleanFilter for initialized plugins- Parameters:
collection
- a collection of Plugin
-
registerPolicyFilter
public void registerPolicyFilter()
Iterates on plugin's collection and register PolicyFilter for initialized plugins.
-
registerPolicyFilter
public void registerPolicyFilter(java.util.Collection<Plugin> collection)
Iterates on plugin's collection and register PolicyFilter for initialized plugins- Parameters:
collection
- a collection of Plugin
-
registerAuthenticationHandler
public void registerAuthenticationHandler()
Iterates on plugin's collection and register AuthenticationHandlers for initialized plugins.
-
registerAuthenticationHandler
public void registerAuthenticationHandler(java.util.Collection<Plugin> collection)
Iterates on plugin's collection and register AuthenticationHandlers for initialized plugins- Parameters:
collection
- a collection of Plugin
-
registerHibernateMapping
public void registerHibernateMapping()
Iterates on plugin's collection and register Hibernate mappings for initialized plugins.
-
registerHibernateMapping
public void registerHibernateMapping(java.util.Collection<Plugin> collection)
Iterates on plugin's collection and register Hibernate mappings for initialized plugins- Parameters:
collection
- a collection of Plugin
-
getCssFiles
public void getCssFiles(java.util.Collection<java.io.File> cssPaths, java.io.FileFilter filter)
Fill given cssPaths collection with plugins css path used for portals- Parameters:
cssPaths
- Collection of css pathfilter
- FileFilter for css
-
getCssFiles
public void getCssFiles(java.util.Collection<java.io.File> cssPaths, java.util.Collection<Plugin> collection, java.io.FileFilter filter)
Fill given cssPaths collection with plugins css path used for portals- Parameters:
cssPaths
- Collection of css pathcollection
- Collection of pluginsfilter
- FileFilter for css
-
invalidateIncludeCache
public void invalidateIncludeCache()
Invalidate cache of plugin's JSP to include for given tags.
-
performInclude
public void performInclude(java.lang.String tag, javax.servlet.jsp.PageContext pageContext)
Iterates on plugin's collection and retrieve Plugins' JSP to include for the given anchor. WARNING ! This method must be called from a jsp taglib- Parameters:
tag
- the scope of includepageContext
- the current Jsp's pageContext, required !
-
clearCachedInclude
public void clearCachedInclude()
-
loadProperties
public void loadProperties(LangProperties properties, java.util.List<java.lang.String> jcmsLangList)
Iterates on plugin's collection and load properties, including language properties for initialized plugins.- Parameters:
properties
- the channel propertiesjcmsLangList
- the lang list of JCMS
-
loadLanguageProperties
public void loadLanguageProperties(LangProperties properties, java.util.List<java.lang.String> jcmsLangList)
Iterates on plugin's collection and load only languages properties for initialized plugins.- Parameters:
properties
- the channel propertiesjcmsLangList
- the lang list of JCMS- Since:
- jcms-6.1.0
-
loadProperties
public void loadProperties(LangProperties properties, java.util.List<java.lang.String> jcmsLangList, java.util.Collection<Plugin> collection, boolean onlyLangProp)
Iterates on plugin's collection and load properties for initialized plugins- Parameters:
properties
- the channel propertiesjcmsLangList
- the lang list of JCMScollection
- a collection of PluginonlyLangProp
- only the language properties
-
getWorkflowsPath
public java.util.Set<java.lang.String> getWorkflowsPath()
Returns a Set of relative Path to all webapp's workflow- Returns:
- Set of relative path
-
getJarsPath
public java.util.Set<java.lang.String> getJarsPath()
Returns a Set of relative Path to all webapp's jar- Returns:
- Set of relative path
-
getPluginPath
public java.util.Set<java.lang.String> getPluginPath(boolean priv, java.lang.String pluginName, java.util.Set<java.lang.String> pluginSet)
Returns a Set of relative Path to plugin public/private folder with all files stored on disk even if they are not declared in xml- Parameters:
priv
- boolean true if private or false if publicpluginName
- the name og the pluginpluginSet
- the set of known path to add- Returns:
- Set of relative path
-
getPlugins
public java.util.Collection<Plugin> getPlugins()
Returns a Collection of plugins.- Returns:
- Collenction the plugin's collection
-
getPlugin
public Plugin getPlugin(java.lang.String pluginName)
Returns the plugin for the given name or null if it does not exists.- Parameters:
pluginName
- the name of the plugin- Returns:
- Plugin the plugin
-
isPluginEnabled
public boolean isPluginEnabled(java.lang.String pluginName)
Returns true if this plugin is enabled.- Parameters:
pluginName
- the name of the plugin- Returns:
- true if this plugin is enabled.
- Since:
- jcms-10.0.2
-
isPluginActive
public boolean isPluginActive(java.lang.String pluginName)
Returns true if this plugin is active.- Parameters:
pluginName
- the name of the plugin- Returns:
- true if this plugin is active.
- Since:
- jcms-10.0.2
-
enablePlugin
public boolean enablePlugin(java.lang.String pluginName)
Enable the given plugin.- Parameters:
pluginName
- the name of the plugin.- Returns:
- true if the plugin has been successfully enabled.
- Since:
- jcms-10.0.0
-
enablePlugin
public boolean enablePlugin(Plugin plugin)
Enable the given plugin.- Parameters:
plugin
- the plugin.- Returns:
- true if the plugin has been successfully enabled.
- Since:
- jcms-10.0.0
-
disablePlugin
public boolean disablePlugin(java.lang.String pluginName)
Disable the given plugin.- Parameters:
pluginName
- the name of the plugin.- Returns:
- true if the plugin has been successfully disabled.
- Since:
- jcms-10.0.0
-
disablePlugin
public boolean disablePlugin(Plugin plugin)
Disable the given plugin.- Parameters:
plugin
- the plugin.- Returns:
- true if the plugin has been successfully disabled.
- Since:
- jcms-10.0.0
-
findPluginProvidingType
public Plugin findPluginProvidingType(java.lang.String className)
Return the plugin providing the given type.- Parameters:
className
- the class name of the type- Returns:
- the plugin providing the given type.
- Since:
- jcms-10.0.0
-
findPluginProvidingWorkflow
public Plugin findPluginProvidingWorkflow(java.lang.String wfId)
Returns the plugin providing the given workflow.- Parameters:
wfId
- the workflow ID- Returns:
- the plugin providing the given workflow.
- Since:
- jcms-10.0.0
-
checkResourceAccess
public boolean checkResourceAccess(java.lang.String resource)
Returns true if the given plugin's resource (JSP) is provided by an active plugin.- Parameters:
resource
- the resource.- Returns:
- true if the given plugin's resource (JSP) is provided by an active plugin.
- Since:
- jcms-10.0.0
-
isPluginSyncEnabled
public boolean isPluginSyncEnabled()
-
initReplicaMessageListener
public void initReplicaMessageListener()
-
processMessage
public void processMessage(ReplicaMessage msg)
Description copied from interface:ReplicaMessageListener
Process the given ReplicaMessage.- Specified by:
processMessage
in interfaceReplicaMessageListener
- Parameters:
msg
- the ReplicaMessage to process
-
-