Package org.ametys.web.site
Class SiteConfigurationManager
- java.lang.Object
-
- org.ametys.runtime.plugin.component.AbstractLogEnabled
-
- org.ametys.web.site.SiteConfigurationManager
-
- All Implemented Interfaces:
LogEnabled,Disposable,Initializable,Component,Serviceable
public class SiteConfigurationManager extends AbstractLogEnabled implements Component, Serviceable, Initializable, Disposable
Helper component for managing sites configuration.
-
-
Field Summary
Fields Modifier and Type Field Description protected Map<String,Boolean>_areSiteCompleteDetermines if all parameters are valued, by site.protected SiteManager_siteManagerThe site manager.protected SiteTypesExtensionPoint_siteTypesExtensionPointThe site type extension point.static StringROLEAvalon Role
-
Constructor Summary
Constructors Constructor Description SiteConfigurationManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean_isSiteConfigurationValid(Site site)Validate the configuration of the given site.protected boolean_isValidSiteParameter(ElementDefinition parameter, Site site)Validate the the given site parametervoiddispose()ElementDefinitiongetSiteParameter(String siteName, String parameterName)Retrieves the parameter of the given site with the given nameElementDefinitiongetSiteParameter(Site site, String parameterName)Retrieves the parameter of the given site with the given nameCollection<ElementDefinition>getSiteParameters(String siteName)Retrieves the parameters of the given siteCollection<ElementDefinition>getSiteParameters(Site site)Retrieves the parameters of the given siteViewgetSiteView(String siteName)Retrieves the view of the site with the given nameViewgetSiteView(Site site)Retrieves the view of the site with the given namevoidinitialize()booleanisSiteConfigurationValid(String siteName)Validate the configuration of the given site.booleanisSiteConfigurationValid(Site site)Validate the configuration of the given site.voidreloadSiteConfiguration(String siteName)Reload a site's configuration.voidreloadSiteConfiguration(Site site)Reload a site's configuration.voidremoveSiteConfiguration(String siteName)Remove a site's configuration.voidremoveSiteConfiguration(Site site)Remove a site's configuration.voidservice(ServiceManager manager)-
Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
-
-
-
Field Detail
-
_siteManager
protected SiteManager _siteManager
The site manager.
-
_siteTypesExtensionPoint
protected SiteTypesExtensionPoint _siteTypesExtensionPoint
The site type extension point.
-
_areSiteComplete
protected Map<String,Boolean> _areSiteComplete
Determines if all parameters are valued, by site.
-
-
Constructor Detail
-
SiteConfigurationManager
public SiteConfigurationManager()
-
-
Method Detail
-
service
public void service(ServiceManager manager) throws ServiceException
- Specified by:
servicein interfaceServiceable- Throws:
ServiceException
-
initialize
public void initialize() throws Exception
- Specified by:
initializein interfaceInitializable- Throws:
Exception
-
dispose
public void dispose()
- Specified by:
disposein interfaceDisposable
-
reloadSiteConfiguration
public void reloadSiteConfiguration(String siteName) throws UnknownAmetysObjectException
Reload a site's configuration.- Parameters:
siteName- the site name.- Throws:
UnknownAmetysObjectException- if the site doesn't exist.
-
reloadSiteConfiguration
public void reloadSiteConfiguration(Site site) throws UnknownAmetysObjectException
Reload a site's configuration.- Parameters:
site- the site.- Throws:
UnknownAmetysObjectException- if the site doesn't exist.
-
removeSiteConfiguration
public void removeSiteConfiguration(Site site)
Remove a site's configuration.- Parameters:
site- the site.
-
removeSiteConfiguration
public void removeSiteConfiguration(String siteName)
Remove a site's configuration.- Parameters:
siteName- the site name.
-
isSiteConfigurationValid
public boolean isSiteConfigurationValid(String siteName) throws UnknownAmetysObjectException
Validate the configuration of the given site.- Parameters:
siteName- the name of the site to check.- Returns:
trueif the site is correctly configured,falseotherwise.- Throws:
UnknownAmetysObjectException- if the site doesn't exist.
-
isSiteConfigurationValid
public boolean isSiteConfigurationValid(Site site) throws UnknownAmetysObjectException
Validate the configuration of the given site.- Parameters:
site- the site to check.- Returns:
trueif the site is correctly configured,falseotherwise.- Throws:
UnknownAmetysObjectException- if the site doesn't exist.
-
_isSiteConfigurationValid
protected boolean _isSiteConfigurationValid(Site site)
Validate the configuration of the given site.- Parameters:
site- the site to check.- Returns:
trueif the site is correctly configured,falseotherwise.
-
_isValidSiteParameter
protected boolean _isValidSiteParameter(ElementDefinition parameter, Site site)
Validate the the given site parameter- Parameters:
parameter- the site parameter to validate.site- the site- Returns:
- true if the parameter's value is valid, false otherwise.
-
getSiteParameters
public Collection<ElementDefinition> getSiteParameters(String siteName)
Retrieves the parameters of the given site- Parameters:
siteName- the name of the site- Returns:
- the site's parameters
-
getSiteParameters
public Collection<ElementDefinition> getSiteParameters(Site site)
Retrieves the parameters of the given site- Parameters:
site- the site- Returns:
- the site's parameters
-
getSiteParameter
public ElementDefinition getSiteParameter(String siteName, String parameterName) throws UndefinedItemPathException
Retrieves the parameter of the given site with the given name- Parameters:
siteName- the name of the siteparameterName- the name of the parameter to retrieve- Returns:
- the site's parameter
- Throws:
UndefinedItemPathException- if there is no site parameter defined with the given name
-
getSiteParameter
public ElementDefinition getSiteParameter(Site site, String parameterName) throws UndefinedItemPathException
Retrieves the parameter of the given site with the given name- Parameters:
site- the siteparameterName- the name of the parameter to retrieve- Returns:
- the site's parameter
- Throws:
UndefinedItemPathException- if there is no site parameter defined with the given name
-
getSiteView
public View getSiteView(String siteName)
Retrieves the view of the site with the given name- Parameters:
siteName- the name of the site- Returns:
- the site's view
-
getSiteView
public View getSiteView(Site site)
Retrieves the view of the site with the given name- Parameters:
site- the site- Returns:
- the site's view
-
-