public class SiteConfigurationExtensionPoint extends AbstractThreadSafeComponentExtensionPoint<RepositoryElementType> implements Model
SiteParameter definitions.| Modifier and Type | Class and Description |
|---|---|
(package private) class |
SiteConfigurationExtensionPoint.I18nizableTextTranslationComparator
I18nizableText comparator for site parameters
General information category is the first one, then sort the I18nizableText with their translation
|
(package private) class |
SiteConfigurationExtensionPoint.SiteParameterParser
Parser for SiteParameter.
|
| Modifier and Type | Field and Description |
|---|---|
private static String |
__GENERAL_INFORMATIONS_I18N_KEY |
private static Pattern |
__PARAM_NAME_PATTERN |
private ThreadSafeComponentManager<Enumerator> |
_enumeratorManager
ComponentManager for
Enumerators. |
protected I18nUtils |
_i18nUtils
Component gathering utility methods for internationalizable text translation
I18nUtils |
private Map<String,Boolean> |
_isComplete
Determines if all parameters are valued, by site.
|
private SiteConfigurationExtensionPoint.SiteParameterParser |
_parameterParser
Site parameter parser.
|
private Map<String,SiteParameter> |
_parameters
Parameters map, indexed by parameter ID.
|
protected SiteManager |
_siteManager
The site manager.
|
private SiteParameterTypeExtensionPoint |
_siteParameterTypeEP |
protected SiteTypesExtensionPoint |
_siteTypeEP
The site type extension point.
|
private ThreadSafeComponentManager<Validator> |
_validatorManager
ComponentManager for
Validators. |
static String |
ROLE
Avalon Role
|
_cocoonManager, _context, _manager| Constructor and Description |
|---|
SiteConfigurationExtensionPoint() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
_addParameter(String pluginName,
String featureName,
Configuration configuration)
Declare a site parameter.
|
protected Map<I18nizableText,Map<I18nizableText,List<SiteParameter>>> |
_categorize(Collection<SiteParameter> parameters)
Organize a collection of site parameters by categories and groups.
|
protected boolean |
_validateParameter(SiteParameter parameter,
String siteName)
Validate a parameter value for a given site.
|
protected boolean |
_validateSiteConfig(String siteName)
Validate the configuration of a site.
|
void |
addExtension(String id,
String pluginName,
String featureName,
Configuration configuration)
Add an extension to this point.
|
void |
dispose()
Dispose the manager before restarting it
|
Map<I18nizableText,Map<I18nizableText,List<SiteParameter>>> |
getCategorizedParameters(String siteName)
Get all the parameters of a given site, classified by category and group.
|
RepositoryElementType |
getExtension(String id)
Returns the named extension
|
Set<String> |
getExtensionsIds()
Returns a Set containing the ids of all known extensions
|
String |
getFamilyId()
Retrieves the Family Id (for example the extension point)
Each model Id have to be unique in it's family Id
|
String |
getId()
Retrieves the model id (an id must be unique in the family
Model.getFamilyId() |
ModelItem |
getModelItem(String itemPath)
Retrieves the model item at given path
|
Collection<? extends ModelItem> |
getModelItems()
Retrieves all the model items of this container
|
Map<String,SiteParameter> |
getParameters(String siteName)
Get all the parameters for a given site.
|
boolean |
hasExtension(String id)
Returns true if the named extension exists
|
void |
initialize() |
void |
initializeExtensions()
Finalize the initialization of the extensions.
This method is called after all addExtension() calls.This is the last step before the actual startup of the application. |
boolean |
isValid(String siteName)
Test if a site configuration is valid.
|
void |
reloadConfiguration(String siteName)
Reload a site's configuration.
|
void |
removeConfiguration(String siteName)
Remove a site's configuration.
|
void |
service(ServiceManager manager) |
addComponent, contextualizegetLogger, setLoggerclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetChild, hasModelItemprivate static final Pattern __PARAM_NAME_PATTERN
private static final String __GENERAL_INFORMATIONS_I18N_KEY
protected SiteManager _siteManager
protected SiteTypesExtensionPoint _siteTypeEP
protected I18nUtils _i18nUtils
I18nUtilsprivate Map<String,SiteParameter> _parameters
private Map<String,Boolean> _isComplete
private ThreadSafeComponentManager<Validator> _validatorManager
Validators.private ThreadSafeComponentManager<Enumerator> _enumeratorManager
Enumerators.private SiteConfigurationExtensionPoint.SiteParameterParser _parameterParser
private SiteParameterTypeExtensionPoint _siteParameterTypeEP
public SiteConfigurationExtensionPoint()
public void initialize() throws Exception
initialize in interface Initializableinitialize in class AbstractThreadSafeComponentExtensionPoint<RepositoryElementType>Exceptionpublic void service(ServiceManager manager) throws ServiceException
service in interface Serviceableservice in class AbstractThreadSafeComponentExtensionPoint<RepositoryElementType>ServiceExceptionpublic void dispose()
dispose in interface Disposabledispose in class AbstractThreadSafeComponentExtensionPoint<RepositoryElementType>public boolean hasExtension(String id)
ExtensionPointhasExtension in interface ExtensionPoint<RepositoryElementType>hasExtension in class AbstractThreadSafeComponentExtensionPoint<RepositoryElementType>id - the unique id of the extensionpublic void addExtension(String id, String pluginName, String featureName, Configuration configuration) throws ConfigurationException
ExtensionPointaddExtension in interface ExtensionPoint<RepositoryElementType>addExtension in class AbstractThreadSafeComponentExtensionPoint<RepositoryElementType>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 addedConfigurationException - when a configuration problem occurspublic RepositoryElementType getExtension(String id)
ExtensionPointgetExtension in interface ExtensionPoint<RepositoryElementType>getExtension in class AbstractThreadSafeComponentExtensionPoint<RepositoryElementType>id - the unique id of the extensionpublic Set<String> getExtensionsIds()
ExtensionPointgetExtensionsIds in interface ExtensionPoint<RepositoryElementType>getExtensionsIds in class AbstractThreadSafeComponentExtensionPoint<RepositoryElementType>public void initializeExtensions() throws Exception
ExtensionPointaddExtension() calls.initializeExtensions in interface ExtensionPoint<RepositoryElementType>initializeExtensions in class AbstractThreadSafeComponentExtensionPoint<RepositoryElementType>Exception - if something wrong occurspublic boolean isValid(String siteName) throws UnknownAmetysObjectException
siteName - the site name.UnknownAmetysObjectException - if the site doesn't exist.public void reloadConfiguration(String siteName) throws UnknownAmetysObjectException
siteName - the site name.UnknownAmetysObjectException - if the site doesn't exist.public void removeConfiguration(String siteName)
siteName - the site name.public Map<String,SiteParameter> getParameters(String siteName)
siteName - the site name.public Map<I18nizableText,Map<I18nizableText,List<SiteParameter>>> getCategorizedParameters(String siteName)
siteName - the site name.protected void _addParameter(String pluginName, String featureName, Configuration configuration) throws ConfigurationException
pluginName - The name of the plugin declaring the extension.featureName - the name of the featureconfiguration - The parameter configuration.ConfigurationException - if configuration if not complete.protected boolean _validateSiteConfig(String siteName)
siteName - the name of the site to check.protected boolean _validateParameter(SiteParameter parameter, String siteName)
parameter - the site parameter to validate.siteName - the site name on which to check.protected Map<I18nizableText,Map<I18nizableText,List<SiteParameter>>> _categorize(Collection<SiteParameter> parameters)
parameters - a collection of site parameters.public ModelItem getModelItem(String itemPath) throws UndefinedItemPathException
ModelItemContainergetModelItem in interface ModelItemContaineritemPath - the item pathUndefinedItemPathException - if there is no item defined at the given pathpublic Collection<? extends ModelItem> getModelItems()
ModelItemContainergetModelItems in interface ModelItemContainerpublic String getId()
ModelModel.getFamilyId()public String getFamilyId()
ModelgetFamilyId in interface Model