Package org.ametys.cms.source
Class DefaultViewSelector
- java.lang.Object
-
- org.ametys.runtime.plugin.component.AbstractLogEnabled
-
- org.ametys.cms.source.DefaultViewSelector
-
- All Implemented Interfaces:
ViewSelector,LogEnabled,Serviceable
- Direct Known Subclasses:
WebViewSelector
public class DefaultViewSelector extends AbstractLogEnabled implements ViewSelector, Serviceable
Default implementation ofViewSelector. First looks the wanted file in context://WEB-INF/param/view/path_to_file If it's not present, it will look in the cms plugin.
-
-
Field Summary
Fields Modifier and Type Field Description protected SourceResolver_resolverThe source resolver-
Fields inherited from interface org.ametys.cms.source.ViewSelector
ROLE
-
-
Constructor Summary
Constructors Constructor Description DefaultViewSelector()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected List<String>_getDefaultSourceURIs(String pluginName, String filePath)Get the default URIsprotected List<String>getLocations(String pluginName, String filePath)Returns the ordered list of URI to be tested to find the corresponding view.SourcegetSource(String pluginName, String fileLocation)Get the file source for the requested location.voidservice(ServiceManager manager)-
Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
-
-
-
Field Detail
-
_resolver
protected SourceResolver _resolver
The source resolver
-
-
Constructor Detail
-
DefaultViewSelector
public DefaultViewSelector()
-
-
Method Detail
-
service
public void service(ServiceManager manager) throws ServiceException
- Specified by:
servicein interfaceServiceable- Throws:
ServiceException
-
getSource
public Source getSource(String pluginName, String fileLocation) throws IOException
Description copied from interface:ViewSelectorGet the file source for the requested location.- Specified by:
getSourcein interfaceViewSelector- Parameters:
pluginName- The current plugin name. Can be null.fileLocation- the requested location.- Returns:
- the file source.
- Throws:
IOException- if the Source cannot be resolved.
-
getLocations
protected List<String> getLocations(String pluginName, String filePath)
Returns the ordered list of URI to be tested to find the corresponding view.- Parameters:
pluginName- The current plugin namefilePath- the requested location.- Returns:
- a list of possible URIs for the resource.
-
_getDefaultSourceURIs
protected List<String> _getDefaultSourceURIs(String pluginName, String filePath)
Get the default URIs- Parameters:
pluginName- The current plugin namefilePath- the requested location.- Returns:
- a list of URIs
-
-