Package org.ametys.web.repository.page
Class DefaultServicesAssignmentHandler
java.lang.Object
org.apache.avalon.framework.logger.AbstractLogEnabled
org.ametys.web.repository.page.DefaultServicesAssignmentHandler
- All Implemented Interfaces:
ServicesAssignmentHandler
,Initializable
,LogEnabled
,Serviceable
public class DefaultServicesAssignmentHandler
extends AbstractLogEnabled
implements ServicesAssignmentHandler, Serviceable, Initializable
This implementation of the services handler is based on services declared in the whole application
-
Nested Class Summary
Modifier and TypeClassDescriptionprotected static class
The cache is a HashSet of String + a date -
Field Summary
Modifier and TypeFieldDescriptionprotected AbstractCacheManager
The cache managerprotected ServiceExtensionPoint
The services managerprotected SiteTypesExtensionPoint
The site type managerprotected SourceResolver
The source resolverFields inherited from interface org.ametys.web.repository.page.ServicesAssignmentHandler
ROLE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected DefaultServicesAssignmentHandler.Cache
Get the public services.protected DefaultServicesAssignmentHandler.Cache
_parseServices
(Configuration configuration, long lastModificationDade) Parses the valid services in a configuration.protected DefaultServicesAssignmentHandler.Cache
_parseServices
(Source configFile) Parses the valid services for the site typeprotected DefaultServicesAssignmentHandler.Cache
_parseTemplateServices
(Source configFile) Parse a template configuration file.protected DefaultServicesAssignmentHandler.Cache
_parseZoneServices
(Source configFile, String zoneName) Parse a template configuration file and get the set of available services for a given zone.getAvailableServices
(SitemapElement page, String zoneName) Returns the list of available services for a givenZone
.void
void
service
(ServiceManager manager) Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
-
Field Details
-
_serviceEP
The services manager -
_siteTypeExtensionPoint
The site type manager -
_srcResolver
The source resolver -
_cacheManager
The cache manager
-
-
Constructor Details
-
DefaultServicesAssignmentHandler
public DefaultServicesAssignmentHandler()
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
initialize
- Specified by:
initialize
in interfaceInitializable
- Throws:
Exception
-
getAvailableServices
Description copied from interface:ServicesAssignmentHandler
Returns the list of available services for a givenZone
.- Specified by:
getAvailableServices
in interfaceServicesAssignmentHandler
- Parameters:
page
- the Page to considerzoneName
- the zone name to consider- Returns:
- the list of available services ' id for a given Page and Zone
-
_getPublicServices
Get the public services.- Returns:
- the public services.
-
_parseTemplateServices
Parse a template configuration file.- Parameters:
configFile
- the template configuration file.- Returns:
- the set of available services for the template.
-
_parseZoneServices
protected DefaultServicesAssignmentHandler.Cache _parseZoneServices(Source configFile, String zoneName) Parse a template configuration file and get the set of available services for a given zone.- Parameters:
configFile
- the template configuration file.zoneName
- the zone name.- Returns:
- the set of available services for the given zone.
-
_parseServices
Parses the valid services for the site type- Parameters:
configFile
- the configuration file.- Returns:
- the services id in a Set
-
_parseServices
protected DefaultServicesAssignmentHandler.Cache _parseServices(Configuration configuration, long lastModificationDade) throws ConfigurationException Parses the valid services in a configuration.- Parameters:
configuration
- the configuration.lastModificationDade
- date de dernière modification- Returns:
- the services id in a Set
- Throws:
ConfigurationException
- if configuration is invalid
-