Package org.ametys.core.right
Class RightsExtensionPoint
java.lang.Object
org.apache.avalon.framework.logger.AbstractLogEnabled
org.ametys.core.right.RightsExtensionPoint
- All Implemented Interfaces:
- ExtensionPoint<Right>,- Initializable,- Component,- LogEnabled,- ThreadSafe
public class RightsExtensionPoint
extends AbstractLogEnabled
implements ExtensionPoint<Right>, Initializable, ThreadSafe, Component
This extension point handle a list of rights handled by the plugins or the application.
- 
Field SummaryFields
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidaddExtension(String id, String pluginName, String pluginId, Configuration configuration) Add an extension to this point.voidaddRight(String id, I18nizableText labelKey, I18nizableText descriptionKey, I18nizableText categoryKey) Declare a new right as used.protected voidaddRight(String pluginName, Configuration configuration) Declare a new right (not as used)getExtension(String id) Returns the named extensionReturns a Set containing the ids of all known extensionsbooleanhasExtension(String id) Returns true if the named extension existsvoidvoidFinalize the initialization of the extensions.
 This method is called after alladdExtension()calls.
 This is the last step before the actual startup of the application.voidremoveRight(String id) Remove a right from the list of used rightsvoidtoSAX(ContentHandler handler) SAX all managed rightsMethods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabledenableLogging, getLogger, setupLogger, setupLogger, setupLogger
- 
Field Details- 
ROLEThe avalon role
- 
_rightsThe map of rightId, Right of declared rights
 
- 
- 
Constructor Details- 
RightsExtensionPointpublic RightsExtensionPoint()
 
- 
- 
Method Details- 
initialize- Specified by:
- initializein interface- Initializable
- Throws:
- Exception
 
- 
hasExtensionDescription copied from interface:ExtensionPointReturns true if the named extension exists- Specified by:
- hasExtensionin interface- ExtensionPoint<Right>
- Parameters:
- id- the unique id of the extension
- Returns:
- true if the named extension exists
 
- 
addExtensionpublic void addExtension(String id, String pluginName, String pluginId, 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 interface- ExtensionPoint<Right>
- Parameters:
- id- the unique identifier of the extension.
- pluginName- Unique identifier for the plugin hosting the extension
- pluginId- Unique feature identifier (unique for a given pluginName)
- configuration- the information about the extension to be added
- Throws:
- ConfigurationException- when a configuration problem occurs
 
- 
addRightprotected void addRight(String pluginName, Configuration configuration) throws ConfigurationException Declare a new right (not as used)- Parameters:
- pluginName- The name of the plugin declaring the extension
- configuration- The configuration of the extension
- Throws:
- ConfigurationException- if configuration if not complete
 
- 
addRightpublic void addRight(String id, I18nizableText labelKey, I18nizableText descriptionKey, I18nizableText categoryKey) throws IllegalArgumentException Declare a new right as used. Use this method to add a right programmatically.- Parameters:
- id- The id of the right (not null or empty)
- labelKey- The label of the right (i18n key) (not null or empty)
- descriptionKey- The description of the right (i18n key) (not null or empty)
- categoryKey- The category of the right (i18n key) (not null or empty)
- Throws:
- IllegalArgumentException- if the id is already declared
 
- 
removeRightRemove a right from the list of used rights- Parameters:
- id- id of the right to remove
 
- 
getExtensionDescription copied from interface:ExtensionPointReturns the named extension- Specified by:
- getExtensionin interface- ExtensionPoint<Right>
- Parameters:
- id- the unique id of the extension
- Returns:
- the named extension
 
- 
getExtensionsIdsDescription copied from interface:ExtensionPointReturns a Set containing the ids of all known extensions- Specified by:
- getExtensionsIdsin interface- ExtensionPoint<Right>
- Returns:
- a Set containing the ids of all known extensions
 
- 
initializeExtensionsDescription 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 interface- ExtensionPoint<Right>
- Throws:
- Exception- if something wrong occurs
 
- 
toSAXSAX all managed rights- Parameters:
- handler- the handler receiving SAX events
- Throws:
- SAXException- if something wrong occurs
 
 
-