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
Modifier and TypeFieldDescriptionDetermines if all parameters are valued, by site.protected DisableConditionsEvaluator<ModelAwareDataHolder>
The disable conditions evaluatorprotected SiteManager
The site manager.protected SiteTypesExtensionPoint
The site type extension point.static final String
Avalon Role -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
Validate the configuration of the given site.protected boolean
_isValidSiteParameter
(ElementDefinition parameter, Site site) Validate the the given site parametervoid
dispose()
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 namevoid
boolean
isSiteConfigurationValid
(String siteName) Validate the configuration of the given site.boolean
isSiteConfigurationValid
(Site site) Validate the configuration of the given site.void
reloadSiteConfiguration
(String siteName) Reload a site's configuration.void
reloadSiteConfiguration
(Site site) Reload a site's configuration.void
removeSiteConfiguration
(String siteName) Remove a site's configuration.void
removeSiteConfiguration
(Site site) Remove a site's configuration.void
service
(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:
service
in interfaceServiceable
- Throws:
ServiceException
-
initialize
- Specified by:
initialize
in interfaceInitializable
- Throws:
Exception
-
dispose
- Specified by:
dispose
in 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:
true
if the site is correctly configured,false
otherwise.- Throws:
UnknownAmetysObjectException
- if the site doesn't exist.
-
isSiteConfigurationValid
Validate the configuration of the given site.- Parameters:
site
- the site to check.- Returns:
true
if the site is correctly configured,false
otherwise.- Throws:
UnknownAmetysObjectException
- if the site doesn't exist.
-
_isSiteConfigurationValid
Validate the configuration of the given site.- Parameters:
site
- the site to check.- Returns:
true
if the site is correctly configured,false
otherwise.
-
_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
-