Package org.ametys.web.source
Class ServiceSourceFactory
- java.lang.Object
-
- org.ametys.runtime.plugin.component.AbstractLogEnabled
-
- org.ametys.web.source.ServiceSourceFactory
-
- All Implemented Interfaces:
LogEnabled,Component,Contextualizable,Serviceable,SourceFactory
public class ServiceSourceFactory extends AbstractLogEnabled implements SourceFactory, Serviceable, Contextualizable
This factory looks for files in the current skin and fallback in the current plugin dir.<br> Use: service://path_to_file<br> Will first loon in the current template in the <i>stylesheets/services/{pluginName}</i> sub-directory => skins/{skin}/templates/{template}/stylesheets/services/{pluginName}/path_to_file<br> If not found, then it will look in the skin of the current site in the sub-directory services/{pluginName} => skins/{skin}/services/{currentPluginName}/path_to_file<br> And if the file does not exist will search in plugin:{currentPluginName}://path_to_file
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classServiceSourceFactory.ServiceSourceA wrapping source to know real locationstatic classServiceSourceFactory.SourceTypeThe enum of existing types of servicesources
-
Field Summary
Fields Modifier and Type Field Description private static Pattern__SOURCE_PATTERNprivate Context_contextprivate ServiceManager_managerprivate SourceResolver_resolverprivate ServiceExtensionPoint_sep-
Fields inherited from interface org.apache.excalibur.source.SourceFactory
ROLE
-
-
Constructor Summary
Constructors Constructor Description ServiceSourceFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private ElementDefinition_findParameter(Service service, String parameterName, String location)voidcontextualize(Context context)protected Map<ServiceSourceFactory.SourceType,String>getLocations(String pluginName, String uri)Returns the ordered list of URIs to be tested to find the service stylesheet.SourcegetSource(String location, Map parameters)voidrelease(Source source)voidservice(ServiceManager manager)-
Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
-
-
-
Field Detail
-
__SOURCE_PATTERN
private static final Pattern __SOURCE_PATTERN
-
_resolver
private SourceResolver _resolver
-
_sep
private ServiceExtensionPoint _sep
-
_manager
private ServiceManager _manager
-
-
Constructor Detail
-
ServiceSourceFactory
public ServiceSourceFactory()
-
-
Method Detail
-
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
-
getSource
public Source getSource(String location, Map parameters) throws IOException, MalformedURLException
- Specified by:
getSourcein interfaceSourceFactory- Throws:
IOExceptionMalformedURLException
-
_findParameter
private ElementDefinition _findParameter(Service service, String parameterName, String location) throws MalformedURLException
- Throws:
MalformedURLException
-
getLocations
protected Map<ServiceSourceFactory.SourceType,String> getLocations(String pluginName, String uri)
Returns the ordered list of URIs to be tested to find the service stylesheet.- Parameters:
pluginName- the service plugin name.uri- the service stylesheet.- Returns:
- a list of possible URIs (id is the source type associated).
-
release
public void release(Source source)
- Specified by:
releasein interfaceSourceFactory
-
-