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
FieldsModifier and TypeFieldDescriptionprotected ContextThe avalon contextprotected StringThe default value of the xsl to use.protected StringThe feature declaring the enumeratorprotected PatternThe file patternprotected StringThe relative path to searchprotected StringThe plugin declaring the enumeratorprotected SourceResolverThe excalibur source resolverThe plugin xsl to use. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription_filterNames(Collection<TraversableSource> files) Filter a list of sources to return thoses matching the _filtervoidconfigure(Configuration configuration) voidcontextualize(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.voidservice(ServiceManager manager) voidsetPluginInfo(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
-
-
Constructor Details
-
ServiceXSLTEnumerator
public ServiceXSLTEnumerator()
-
-
Method Details
-
configure
- Specified by:
configurein interfaceConfigurable- Throws:
ConfigurationException
-
contextualize
- Specified by:
contextualizein interfaceContextualizable- Throws:
ContextException
-
service
- Specified by:
servicein interfaceServiceable- Throws:
ServiceException
-
setPluginInfo
Description copied from interface:PluginAwareSets 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:
setPluginInfoin 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:EnumeratorGet the configuration of this enumerator- Specified by:
getConfigurationin interfaceEnumerator<String>- Specified by:
getConfigurationin 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:EnumeratorProvides the enumerated values with their optional label.- Specified by:
getTypedEntriesin interfaceEnumerator<String>- Returns:
- the enumerated values and their label.
- Throws:
Exception- if an error occurs. TODO NEWATTRIBUTEAPI: rename this method whenEnumeratorwill be removed
-
getEntries
Description copied from interface:EnumeratorProvides the enumerated values with their optional label.- Specified by:
getEntriesin interfaceEnumerator- Returns:
- the enumerated values and their label.
- Throws:
Exception- if an error occurs.
-
getEntry
Description copied from interface:EnumeratorRetrieves a single label from a value.- Specified by:
getEntryin interfaceEnumerator<String>- Specified by:
getEntryin interfaceEnumerator- Parameters:
value- the value.- Returns:
- the label or
nullif not found. - Throws:
Exception- if an error occurs.
-