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
Fields Modifier and Type Field Description protected Context_contextThe avalon contextprotected String_defaultValueThe default value of the xsl to use.protected String_featureNameThe feature declaring the enumeratorprotected Pattern_fileFilterThe file patternprotected String_pathThe relative path to searchprotected String_pluginNameThe plugin declaring the enumeratorprotected SourceResolver_resolverThe excalibur source resolverprotected Set<String>_valuesThe plugin xsl to use.
-
Constructor Summary
Constructors Constructor Description ServiceXSLTEnumerator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected List<String>_filterNames(Collection<TraversableSource> files)Filter a list of sources to return thoses matching the _filtervoidconfigure(Configuration configuration)voidcontextualize(Context context)Map<String,Object>getConfiguration()Get the configuration of this enumeratorMap<Object,I18nizableText>getEntries()Provides the enumerated values with their optional label.I18nizableTextgetEntry(String value)Retrieves a single label from a value.Map<String,I18nizableText>getTypedEntries()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 Detail
-
_fileFilter
protected Pattern _fileFilter
The file pattern
-
_pluginName
protected String _pluginName
The plugin declaring the enumerator
-
_featureName
protected String _featureName
The feature declaring the enumerator
-
_resolver
protected SourceResolver _resolver
The excalibur source resolver
-
_defaultValue
protected String _defaultValue
The default value of the xsl to use. Can be null.
-
-
Constructor Detail
-
ServiceXSLTEnumerator
public ServiceXSLTEnumerator()
-
-
Method Detail
-
configure
public void configure(Configuration configuration) throws ConfigurationException
- Specified by:
configurein interfaceConfigurable- Throws:
ConfigurationException
-
contextualize
public void contextualize(Context context) throws ContextException
- Specified by:
contextualizein interfaceContextualizable- Throws:
ContextException
-
service
public void service(ServiceManager manager) throws ServiceException
- Specified by:
servicein interfaceServiceable- Throws:
ServiceException
-
setPluginInfo
public void setPluginInfo(String pluginName, String featureName, String id)
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
public Map<String,Object> getConfiguration()
Description copied from interface:EnumeratorGet the configuration of this enumerator- Specified by:
getConfigurationin interfaceEnumerator<String>- Specified by:
getConfigurationin interfaceEnumerator- Returns:
- the configuration
-
_filterNames
protected List<String> _filterNames(Collection<TraversableSource> files)
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
public Map<String,I18nizableText> getTypedEntries() throws Exception
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
public Map<Object,I18nizableText> getEntries() throws Exception
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
public I18nizableText getEntry(String value) throws Exception
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.
-
-