public interface IPluginManager
ListableBeanFactory
For more
information on platform plugins, visit the wiki link below.Modifier and Type | Method and Description |
---|---|
void |
addPluginManagerListener(IPluginManagerListener listener)
Add a
IPluginManagerListener to be notified of IPluginManager events. |
Object |
getBean(String beanId)
If any plugins have registered a bean by id beanId, this method will return a new instance of the object.
|
org.springframework.beans.factory.ListableBeanFactory |
getBeanFactory(String pluginId)
Returns a (Spring) bean factory for retrieving plugin-bound objects
|
ClassLoader |
getClassLoader(String pluginId)
Returns the classloader instance that was assigned by the plugin manager to load all classes for the specified
plugin.
|
IContentGenerator |
getContentGenerator(String type,
String perspectiveName)
Returns a
IContentGenerator that can render the named perspective (e.g. |
IContentGenerator |
getContentGeneratorForType(String type,
IPentahoSession session)
Deprecated.
Use {@link #getContentGenerator(String, String) instead
|
IContentInfo |
getContentTypeInfo(String type)
Gets metadata about a particular content type
|
Set<String> |
getContentTypes()
Returns a set of the content types that the registered plugins can process.
|
List<String> |
getExternalResourcesForContext(String context)
Return a List of scripts registered for a given context.
|
List<org.pentaho.ui.xul.XulOverlay> |
getOverlays()
Returns a list of the XUL overlays that are defined by all the plug-ins.
|
String |
getPluginIdForClassLoader(ClassLoader classLoader)
Each plugin is loaded on its own classloader, we can use this to find the plugin for which the classloader is
serving
|
String |
getPluginIdForType(String contentType)
Returns the plugin (IPlatformPlugin) that handles requests for files of type
contentType |
List<String> |
getPluginRESTPerspectivesForId(String id)
Returns the Plugin perspectives for a plugin of specific id
|
List<String> |
getPluginRESTPerspectivesForType(String contentType)
Returns the Plugin perspectives for files of type
contentType |
Object |
getPluginSetting(String pluginId,
String key,
String defaultValue)
Retrieves a plugin setting for a given plugin and key.
|
List<String> |
getRegisteredPlugins()
Lists the ids of available plugins.
|
String |
getServicePlugin(String path)
Deprecated.
This method may not work correctly for plugins in Sugar or later releases, in which a plugin does not
provide the URL by which to access the resource. Use
isPublic(String, String) if you want to determine if
a particular plugin dir is accessable through the plugin resources REST service. |
InputStream |
getStaticResource(String path)
Deprecated.
This method may not work correctly for plugins in Sugar or later releases, in which a plugin does not
provide the URL by which to access the resource. Use
isPublic(String, String) if you want to determine if
a particular plugin dir is accessable through the plugin resources REST service. |
boolean |
isBeanRegistered(String beanId)
Returns true if a bean with id beanId has been registered with the plugin manager, i.e.
|
boolean |
isCsrfProtectionEnabled(String pluginId)
Gets a value that indicates if CSRF protection is enabled for the system and a given plugin.
|
boolean |
isPublic(String pluginId,
String path)
Returns true if the resource specified by
path is publicly available, meaning this resource can be
accessed by HTTP GET requests |
boolean |
isStaticResource(String path)
Deprecated.
This method may not work correctly for plugins in Sugar or later releases, in which a plugin does not
provide the URL by which to access the resource. Use
isPublic(String, String) if you want to determine if
a particular plugin dir is accessable through the plugin resources REST service. |
Class<?> |
loadClass(String beanId)
Returns a loaded class for the bean registered as beanId.
|
boolean |
reload()
Causes the plug-in manager object to re-register all of the plug-ins that it knows about.
|
boolean |
reload(IPentahoSession session)
Deprecated.
Use
reload() instead |
void |
unloadAllPlugins()
Unloads all the plugins.
|
Set<String> getContentTypes()
IContentInfo getContentTypeInfo(String type)
type
- a content type provided by a plugin@Deprecated IContentGenerator getContentGeneratorForType(String type, IPentahoSession session) throws ObjectFactoryException
ObjectFactoryException
boolean reload()
IPluginProvider
may be invoked to discover plugins from various sources.@Deprecated boolean reload(IPentahoSession session)
reload()
insteadList<org.pentaho.ui.xul.XulOverlay> getOverlays()
Object getBean(String beanId) throws PluginBeanException
beanId
- a unique identifier for a particular bean (cannot be null)PluginBeanException
IContentGenerator getContentGenerator(String type, String perspectiveName)
IContentGenerator
that can render the named perspective (e.g. 'viewer') of a resource of type
type
(e.g. 'prpt'). Essentially the same as (IContentGenerator)getBean
(type+"/"+perspectiveName)
type
- the type of resource to renderperspectiveName
- specifies a distinct view of the resource. Can be null
in which case the
default perspective 'generatedContent' is implied.IContentGenerator
s may generate an unchecked NoSuchBeanDefinitionException - if
there is no bean definition with the specified name may generate an unchecked BeansException - if the bean could
not be obtainedClass<?> loadClass(String beanId) throws PluginBeanException
beanId
- a unique identifier for a particular bean (cannot be null)PluginBeanException
- if there was a problem loading the classboolean isBeanRegistered(String beanId)
getBean(String)
beanId
- Cannot be nullvoid unloadAllPlugins()
String getPluginIdForType(String contentType)
contentType
contentType
- a user-defined file-extension like suffix denoting a type of contentcontentType
or null
if none were foundList<String> getPluginRESTPerspectivesForType(String contentType)
contentType
contentType
- a user-defined file-extension like suffix denoting a type of content. for example xaction, prptcontentType
or null
if none were
foundList<String> getPluginRESTPerspectivesForId(String id)
id
- the id of the pluginnull
if none were foundString getPluginIdForClassLoader(ClassLoader classLoader)
classLoader
- The classloader for the plugin, also used to load all plugin resourcesObject getPluginSetting(String pluginId, String key, String defaultValue)
pluginId
- the ID of the plugin to find settings forkey
- the setting name to lookupdefaultValue
- the default to use if the setting key is not foundboolean isCsrfProtectionEnabled(String pluginId)
pluginId
- the ID of the plugin.@Deprecated String getServicePlugin(String path)
isPublic(String, String)
if you want to determine if
a particular plugin dir is accessable through the plugin resources REST service.null
is returned.path
- the path to the plugin resourcenull
if one cannot be foundClassLoader getClassLoader(String pluginId)
getServicePlugin(String)
, this method can provide you with a way to load
resources from a plugin when all you have is a request URL/path, such as in a servlet environment.pluginId
- the plugin for which we want to get the assigned classloadernull
if the plugin is not known by the plugin
manager, or for some reason a classloader was not assigned to the plugin (an error condition).org.springframework.beans.factory.ListableBeanFactory getBeanFactory(String pluginId)
pluginId
- @Deprecated boolean isStaticResource(String path)
isPublic(String, String)
if you want to determine if
a particular plugin dir is accessable through the plugin resources REST service.path
- static resource pathboolean isPublic(String pluginId, String path)
path
is publicly available, meaning this resource can be
accessed by HTTP GET requestspluginId
- the id of the plugin to search for the dirpath
- a path relative to the plugin folder to check for public availabilitytrue
if publicly available or false
if not available for any reason@Deprecated InputStream getStaticResource(String path)
isPublic(String, String)
if you want to determine if
a particular plugin dir is accessable through the plugin resources REST service.path
- the path to the plugin resourceList<String> getRegisteredPlugins()
List<String> getExternalResourcesForContext(String context)
context
- named area in the platformvoid addPluginManagerListener(IPluginManagerListener listener)
IPluginManagerListener
to be notified of IPluginManager events.listener
- Copyright © 2020 Hitachi Vantara. All rights reserved.