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
FieldsModifier and TypeFieldDescriptionDetermines if all parameters are valued, by site.protected DisableConditionsEvaluator<ModelAwareDataHolder>The disable conditions evaluatorprotected SiteManagerThe site manager.protected SiteTypesExtensionPointThe site type extension point.static final StringAvalon Role -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanValidate the configuration of the given site.protected boolean_isValidSiteParameter(ElementDefinition parameter, Site site) Validate the the given site parametervoiddispose()getSiteParameter(String siteName, String parameterName) Retrieves the parameter of the given site with the given namegetSiteParameter(Site site, String parameterName) Retrieves the parameter of the given site with the given namegetSiteParameters(String siteName) Retrieves the parameters of the given sitegetSiteParameters(Site site) Retrieves the parameters of the given sitegetSiteView(String siteName) Retrieves the view of the site with the given namegetSiteView(Site site) Retrieves the view of the site with the given namevoidbooleanisSiteConfigurationValid(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 Details
-
ROLE
Avalon Role -
_siteManager
The site manager. -
_siteTypesExtensionPoint
The site type extension point. -
_disableConditionsEvaluator
The disable conditions evaluator -
_areSiteComplete
Determines if all parameters are valued, by site.
-
-
Constructor Details
-
SiteConfigurationManager
public SiteConfigurationManager()
-
-
Method Details
-
service
- Specified by:
servicein interfaceServiceable- Throws:
ServiceException
-
initialize
- Specified by:
initializein interfaceInitializable- Throws:
Exception
-
dispose
- Specified by:
disposein interfaceDisposable
-
reloadSiteConfiguration
Reload a site's configuration.- Parameters:
siteName- the site name.- Throws:
UnknownAmetysObjectException- if the site doesn't exist.
-
reloadSiteConfiguration
Reload a site's configuration.- Parameters:
site- the site.- Throws:
UnknownAmetysObjectException- if the site doesn't exist.
-
removeSiteConfiguration
Remove a site's configuration.- Parameters:
site- the site.
-
removeSiteConfiguration
Remove a site's configuration.- Parameters:
siteName- the site name.
-
isSiteConfigurationValid
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
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
Validate the configuration of the given site.- Parameters:
site- the site to check.- Returns:
trueif the site is correctly configured,falseotherwise.
-
_isValidSiteParameter
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
Retrieves the parameters of the given site- Parameters:
siteName- the name of the site- Returns:
- the site's parameters
-
getSiteParameters
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
Retrieves the view of the site with the given name- Parameters:
siteName- the name of the site- Returns:
- the site's view
-
getSiteView
Retrieves the view of the site with the given name- Parameters:
site- the site- Returns:
- the site's view
-