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
Nested ClassesModifier and TypeClassDescriptionprotected static classThe cache is a HashSet of String + a dateprotected static classThe cache is a HashMap of String + a date -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected AbstractCacheManagerThe cache managerprotected ServiceExtensionPointThe services managerprotected SiteTypesExtensionPointThe site type managerprotected SourceResolverThe source resolverFields inherited from interface org.ametys.web.repository.page.ServicesAssignmentHandler
ROLE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet the public services._parseServices(Configuration configuration, long lastModificationDade) Parses the valid services in a configuration._parseServices(Source configFile) Parses the valid services for the site type_parseServicesViews(Configuration configuration, long lastModificationDade) Parses the valid services in a configuration._parseServicesViews(Source configFile) Parses the valid services views for the site type_parseTemplateServices(Source configFile) Parse a template configuration file._parseTemplateServicesViews(Source configFile) Parse a template configuration file._parseZoneServices(Source configFile, String zoneName) Parse a template configuration file and get the set of available services for a given zone._parseZoneServicesViews(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.voidlimitAvailableServiceViews(Set<String> allViews, SitemapElement page, String zoneName, String serviceId) Returns the list of authorized view for a givenPage, zone name and servicevoidservice(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:
servicein interfaceServiceable- Throws:
ServiceException
-
initialize
- Specified by:
initializein interfaceInitializable- Throws:
Exception
-
getAvailableServices
Description copied from interface:ServicesAssignmentHandlerReturns the list of available services for a givenZone.- Specified by:
getAvailableServicesin 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
-
limitAvailableServiceViews
public Set<String> limitAvailableServiceViews(Set<String> allViews, SitemapElement page, String zoneName, String serviceId) Description copied from interface:ServicesAssignmentHandlerReturns the list of authorized view for a givenPage, zone name and service- Specified by:
limitAvailableServiceViewsin interfaceServicesAssignmentHandler- Parameters:
allViews- All existing view to limitpage- The page to considerzoneName- The zone name to considerserviceId- The service to consider- Returns:
- The non null list of available views
-
_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.
-
_parseTemplateServicesViews
Parse a template configuration file.- Parameters:
configFile- the template configuration file.- Returns:
- the set of available services views for the template.
-
_parseZoneServices
protected DefaultServicesAssignmentHandler.ServiceCache _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.
-
_parseZoneServicesViews
protected DefaultServicesAssignmentHandler.ViewCache _parseZoneServicesViews(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 views 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
-
_parseServicesViews
Parses the valid services views for the site type- Parameters:
configFile- the configuration file.- Returns:
- the services views id in a Set
-
_parseServices
protected DefaultServicesAssignmentHandler.ServiceCache _parseServices(Configuration configuration, long lastModificationDade) throws ConfigurationException Parses the valid services in a configuration.- Parameters:
configuration- the configuration.lastModificationDade- last date of modification- Returns:
- the services id in a Set
- Throws:
ConfigurationException- if configuration is invalid
-
_parseServicesViews
protected DefaultServicesAssignmentHandler.ViewCache _parseServicesViews(Configuration configuration, long lastModificationDade) throws ConfigurationException Parses the valid services in a configuration.- Parameters:
configuration- the configuration.lastModificationDade- last date of modification- Returns:
- the services id in a Set
- Throws:
ConfigurationException- if configuration is invalid
-