Package org.ametys.core.ui
Class AbstractClientSideExtensionPoint<T extends ClientSideElement>
- java.lang.Object
-
- org.ametys.runtime.plugin.component.AbstractLogEnabled
-
- org.ametys.runtime.plugin.component.AbstractThreadSafeComponentExtensionPoint<T>
-
- org.ametys.core.ui.AbstractClientSideExtensionPoint<T>
-
- Type Parameters:
T
- The client side element implementation
- All Implemented Interfaces:
LogEnabled
,ExtensionPoint<T>
,Disposable
,Initializable
,Component
,Contextualizable
,Serviceable
,ThreadSafe
- Direct Known Subclasses:
AdminSkinActionExtensionPoint
,CreateSkinActionExtensionPoint
,HTMLExpertToolbarExtensionPoint
,ImportModelActionExtensionPoint
,ImportSkinActionExtensionPoint
,MenuSkinActionExtensionPoint
,MessageTargetFactoriesManager
,RelationsManager
,RepositoryViewExtensionPoint
,RibbonControlsManager
,RibbonManager
,RibbonTabsManager
,RightAssignmentContextExtensionPoint
,StaticFileImportsManager
,UIToolsFactoriesManager
public abstract class AbstractClientSideExtensionPoint<T extends ClientSideElement> extends AbstractThreadSafeComponentExtensionPoint<T>
Implementation of an ExtensionPoint for client side elements.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private class
AbstractClientSideExtensionPoint.ReferencingExtension
-
Field Summary
Fields Modifier and Type Field Description private Map<String,String>
_configurationPlugins
private Map<String,Configuration>
_configurations
private boolean
_initialized
private List<AbstractClientSideExtensionPoint.ReferencingExtension>
_referencingExtensions
private List<AbstractClientSideExtensionPoint<T>>
_registeredManagers
-
Fields inherited from class org.ametys.runtime.plugin.component.AbstractThreadSafeComponentExtensionPoint
_cocoonManager, _context, _manager
-
-
Constructor Summary
Constructors Constructor Description AbstractClientSideExtensionPoint()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
_addReferencingExtension(String id, String pluginName, String featureName, Configuration configuration)
private void
_contexutalizeConfiguration(MutableConfiguration configuration, String pluginName)
private Configuration
_getConfiguration(String id)
private Configuration
_getContexutalizedConfiguration(Configuration configuration, String pluginName)
private void
_getMerdedChildsConfiguration(Configuration configuration, MutableConfiguration base)
private void
_lazyInitializeReferencingExtension(AbstractClientSideExtensionPoint.ReferencingExtension ext, Map<String,AbstractClientSideExtensionPoint.ReferencingExtension> refExtIds, List<String> processing)
private void
_mergeChildsConfiguration(Configuration configuration, MutableConfiguration base)
void
addExtension(String id, String pluginName, String featureName, Configuration configuration)
Add an extension to this point.List<ClientSideElement>
findDependency(String pattern)
Find a dependency of this manager from the Client side elements it knows.T
getExtension(String id)
Returns the named extensionSet<String>
getExtensionsIds()
Returns a Set containing the ids of all known extensionsvoid
initializeExtensions()
Finalize the initialization of the extensions.
This method is called after alladdExtension()
calls.
This is the last step before the actual startup of the application.void
registerRibbonManager(AbstractClientSideExtensionPoint<T> manager)
Register a new ribbon manager whose extensions will also be managed by this RibbonControlsManagervoid
unregisterRibbonManager(AbstractClientSideExtensionPoint<T> manager)
Remove a previously registered ribbon manager-
Methods inherited from class org.ametys.runtime.plugin.component.AbstractThreadSafeComponentExtensionPoint
addComponent, contextualize, dispose, hasExtension, initialize, service
-
Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
-
-
-
Field Detail
-
_configurations
private Map<String,Configuration> _configurations
-
_configurationPlugins
private Map<String,String> _configurationPlugins
-
_registeredManagers
private List<AbstractClientSideExtensionPoint<T extends ClientSideElement>> _registeredManagers
-
_referencingExtensions
private List<AbstractClientSideExtensionPoint.ReferencingExtension> _referencingExtensions
-
_initialized
private boolean _initialized
-
-
Constructor Detail
-
AbstractClientSideExtensionPoint
public AbstractClientSideExtensionPoint()
-
-
Method Detail
-
addExtension
public void addExtension(String id, String pluginName, String featureName, Configuration configuration) throws ConfigurationException
Description copied from interface:ExtensionPoint
Add an extension to this point. Each implementation knows the meaning of the given configuration.- Specified by:
addExtension
in interfaceExtensionPoint<T extends ClientSideElement>
- Overrides:
addExtension
in classAbstractThreadSafeComponentExtensionPoint<T extends ClientSideElement>
- Parameters:
id
- the unique identifier of the extension.pluginName
- Unique identifier for the plugin hosting the extensionfeatureName
- Unique feature identifier (unique for a given pluginName)configuration
- the information about the extension to be added- Throws:
ConfigurationException
- when a configuration problem occurs
-
_addReferencingExtension
private void _addReferencingExtension(String id, String pluginName, String featureName, Configuration configuration) throws ConfigurationException
- Throws:
ConfigurationException
-
_getConfiguration
private Configuration _getConfiguration(String id) throws ConfigurationException
- Throws:
ConfigurationException
-
_getContexutalizedConfiguration
private Configuration _getContexutalizedConfiguration(Configuration configuration, String pluginName) throws ConfigurationException
- Throws:
ConfigurationException
-
_contexutalizeConfiguration
private void _contexutalizeConfiguration(MutableConfiguration configuration, String pluginName) throws ConfigurationException
- Throws:
ConfigurationException
-
_getMerdedChildsConfiguration
private void _getMerdedChildsConfiguration(Configuration configuration, MutableConfiguration base) throws ConfigurationException
- Throws:
ConfigurationException
-
_mergeChildsConfiguration
private void _mergeChildsConfiguration(Configuration configuration, MutableConfiguration base) throws ConfigurationException
- Throws:
ConfigurationException
-
initializeExtensions
public void initializeExtensions() throws Exception
Description copied from interface:ExtensionPoint
Finalize the initialization of the extensions.
This method is called after alladdExtension()
calls.
This is the last step before the actual startup of the application.- Specified by:
initializeExtensions
in interfaceExtensionPoint<T extends ClientSideElement>
- Overrides:
initializeExtensions
in classAbstractThreadSafeComponentExtensionPoint<T extends ClientSideElement>
- Throws:
Exception
- if something wrong occurs
-
_lazyInitializeReferencingExtension
private void _lazyInitializeReferencingExtension(AbstractClientSideExtensionPoint.ReferencingExtension ext, Map<String,AbstractClientSideExtensionPoint.ReferencingExtension> refExtIds, List<String> processing) throws ConfigurationException
- Throws:
ConfigurationException
-
registerRibbonManager
public void registerRibbonManager(AbstractClientSideExtensionPoint<T> manager)
Register a new ribbon manager whose extensions will also be managed by this RibbonControlsManager- Parameters:
manager
- The manager to register
-
unregisterRibbonManager
public void unregisterRibbonManager(AbstractClientSideExtensionPoint<T> manager)
Remove a previously registered ribbon manager- Parameters:
manager
- The manager to remove
-
getExtension
public T getExtension(String id)
Description copied from interface:ExtensionPoint
Returns the named extension- Specified by:
getExtension
in interfaceExtensionPoint<T extends ClientSideElement>
- Overrides:
getExtension
in classAbstractThreadSafeComponentExtensionPoint<T extends ClientSideElement>
- Parameters:
id
- the unique id of the extension- Returns:
- the named extension
-
getExtensionsIds
public Set<String> getExtensionsIds()
Description copied from interface:ExtensionPoint
Returns a Set containing the ids of all known extensions- Specified by:
getExtensionsIds
in interfaceExtensionPoint<T extends ClientSideElement>
- Overrides:
getExtensionsIds
in classAbstractThreadSafeComponentExtensionPoint<T extends ClientSideElement>
- Returns:
- a Set containing the ids of all known extensions
-
findDependency
public List<ClientSideElement> findDependency(String pattern)
Find a dependency of this manager from the Client side elements it knows.- Parameters:
pattern
- The matching pattern to find the dependency.- Returns:
- The dependency, or null if no Client side element matched.
-
-