Package org.ametys.runtime.cocoon
Class SitemapConfigurationExtensionPoint
- java.lang.Object
-
- org.apache.avalon.framework.logger.AbstractLogEnabled
-
- org.ametys.runtime.cocoon.SitemapConfigurationExtensionPoint
-
- All Implemented Interfaces:
ExtensionPoint<Configuration[]>,Component,LogEnabled
public class SitemapConfigurationExtensionPoint extends AbstractLogEnabled implements ExtensionPoint<Configuration[]>, Component
Allows to dynamically declare sitemap components to the main sitemap, subsequently available to all plugins and workspaces
-
-
Field Summary
Fields Modifier and Type Field Description private static Collection<String>__COMPONENTSprivate Map<String,Configuration[]>_extensionsprivate Map<String,Collection<Configuration>>_sitemapConfigurationsstatic StringROLEAvalon Role
-
Constructor Summary
Constructors Constructor Description SitemapConfigurationExtensionPoint()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddExtension(String id, String pluginName, String featureName, Configuration configuration)Add an extension to this point.Collection<Configuration>getConfigurations(String component)Returns all the Configurations for a given sitemap component typeConfiguration[]getExtension(String id)Returns the named extensionSet<String>getExtensionsIds()Returns a Set containing the ids of all known extensionsbooleanhasExtension(String id)Returns true if the named extension existsvoidinitializeExtensions()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.-
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
-
-
-
-
Field Detail
-
__COMPONENTS
private static final Collection<String> __COMPONENTS
-
_sitemapConfigurations
private Map<String,Collection<Configuration>> _sitemapConfigurations
-
_extensions
private Map<String,Configuration[]> _extensions
-
-
Constructor Detail
-
SitemapConfigurationExtensionPoint
public SitemapConfigurationExtensionPoint()
-
-
Method Detail
-
addExtension
public void addExtension(String id, String pluginName, String featureName, Configuration configuration) throws ConfigurationException
Description copied from interface:ExtensionPointAdd an extension to this point. Each implementation knows the meaning of the given configuration.- Specified by:
addExtensionin interfaceExtensionPoint<Configuration[]>- 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
-
getExtension
public Configuration[] getExtension(String id)
Description copied from interface:ExtensionPointReturns the named extension- Specified by:
getExtensionin interfaceExtensionPoint<Configuration[]>- Parameters:
id- the unique id of the extension- Returns:
- the named extension
-
getExtensionsIds
public Set<String> getExtensionsIds()
Description copied from interface:ExtensionPointReturns a Set containing the ids of all known extensions- Specified by:
getExtensionsIdsin interfaceExtensionPoint<Configuration[]>- Returns:
- a Set containing the ids of all known extensions
-
hasExtension
public boolean hasExtension(String id)
Description copied from interface:ExtensionPointReturns true if the named extension exists- Specified by:
hasExtensionin interfaceExtensionPoint<Configuration[]>- Parameters:
id- the unique id of the extension- Returns:
- true if the named extension exists
-
initializeExtensions
public void initializeExtensions() throws Exception
Description copied from interface:ExtensionPointFinalize 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:
initializeExtensionsin interfaceExtensionPoint<Configuration[]>- Throws:
Exception- if something wrong occurs
-
getConfigurations
public Collection<Configuration> getConfigurations(String component)
Returns all the Configurations for a given sitemap component type- Parameters:
component- a sitemap component type (eg. "action", "generator", ...)- Returns:
- all the Configurations for a given sitemap component type. May be null if the given component type does not exist or have not been extended.
-
-