Package org.ametys.web.service
Class ServiceXSLTEnumerator
java.lang.Object
org.apache.avalon.framework.logger.AbstractLogEnabled
org.ametys.web.service.ServiceXSLTEnumerator
- All Implemented Interfaces:
Enumerator<String>
,Enumerator
,PluginAware
,Component
,Configurable
,Contextualizable
,LogEnabled
,Serviceable
public class ServiceXSLTEnumerator
extends AbstractLogEnabled
implements Enumerator<String>, Enumerator, Component, Configurable, PluginAware, Serviceable, Contextualizable
This enuerator return the list of available files for services.
The files are searched in the skin and in the plugin
Configuration is
<path> to specify the path where file are stored
<file> an optionnal regexp to list files in the path (default is ^.*\.xsl$ to list all xsl files)
-
Field Summary
Modifier and TypeFieldDescriptionprotected AmetysObjectResolver
The ametys object resolver instanceprotected Context
The avalon contextprotected String
The default value of the xsl to use.protected String
The feature declaring the enumeratorprotected Pattern
The file patternprotected String
The relative path to searchprotected String
The plugin declaring the enumeratorprotected SourceResolver
The excalibur source resolverprotected ServicesAssignmentHandler
The service assignement handler instanceThe plugin xsl to use. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription_filterNames
(Collection<TraversableSource> files) Filter a list of sources to return thoses matching the _filtervoid
configure
(Configuration configuration) void
contextualize
(Context context) Get the configuration of this enumeratorProvides the enumerated values with their optional label.Retrieves a single label from a value.Provides the enumerated values with their optional label.void
service
(ServiceManager manager) void
setPluginInfo
(String pluginName, String featureName, String id) Sets the plugin info relative to the current component.
Note : The feature name may be null if the targeted component in declared at plugin level.Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
-
Field Details
-
_path
The relative path to search -
_fileFilter
The file pattern -
_pluginName
The plugin declaring the enumerator -
_featureName
The feature declaring the enumerator -
_resolver
The excalibur source resolver -
_defaultValue
The default value of the xsl to use. Can be null. -
_values
The plugin xsl to use. Can be empty. -
_context
The avalon context -
_servicesAssignmentHandler
The service assignement handler instance -
_ametysObjectResolver
The ametys object resolver instance
-
-
Constructor Details
-
ServiceXSLTEnumerator
public ServiceXSLTEnumerator()
-
-
Method Details
-
configure
- Specified by:
configure
in interfaceConfigurable
- Throws:
ConfigurationException
-
contextualize
- Specified by:
contextualize
in interfaceContextualizable
- Throws:
ContextException
-
service
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
setPluginInfo
Description copied from interface:PluginAware
Sets the plugin info relative to the current component.
Note : The feature name may be null if the targeted component in declared at plugin level.- Specified by:
setPluginInfo
in interfacePluginAware
- Parameters:
pluginName
- Unique identifier for the plugin hosting the extensionfeatureName
- Unique feature identifier (unique for a given pluginName)id
- Unique identifier of this component
-
getConfiguration
Description copied from interface:Enumerator
Get the configuration of this enumerator- Specified by:
getConfiguration
in interfaceEnumerator<String>
- Specified by:
getConfiguration
in interfaceEnumerator
- Returns:
- the configuration
-
_filterNames
Filter a list of sources to return thoses matching the _filter- Parameters:
files
- A non null list of files to filter- Returns:
- The non null filtered list of names
-
getTypedEntries
Description copied from interface:Enumerator
Provides the enumerated values with their optional label.- Specified by:
getTypedEntries
in interfaceEnumerator<String>
- Returns:
- the enumerated values and their label.
- Throws:
Exception
- if an error occurs. TODO NEWATTRIBUTEAPI: rename this method whenEnumerator
will be removed
-
getEntries
Description copied from interface:Enumerator
Provides the enumerated values with their optional label.- Specified by:
getEntries
in interfaceEnumerator
- Returns:
- the enumerated values and their label.
- Throws:
Exception
- if an error occurs.
-
getEntry
Description copied from interface:Enumerator
Retrieves a single label from a value.- Specified by:
getEntry
in interfaceEnumerator<String>
- Specified by:
getEntry
in interfaceEnumerator
- Parameters:
value
- the value.- Returns:
- the label or
null
if not found. - Throws:
Exception
- if an error occurs.
-