Class LessResourceHandler
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.core.resources.SimpleResourceHandler
org.ametys.plugins.core.ui.resources.AbstractCompiledResourceHandler
org.ametys.plugins.core.ui.resources.css.less.LessResourceHandler
- All Implemented Interfaces:
ResourceHandler
,LogEnabled
,Component
,Serviceable
Reader for LESS files, compile them on the fly into CSS files.
-
Field Summary
Fields inherited from class org.ametys.core.resources.SimpleResourceHandler
_objectModel, _parameters, _readForDownload, _requestedLocation, _resolver, _source
-
Constructor Summary
ConstructorDescriptionLessResourceHandler
(Source source) Constructor with an already resolvedSource
. -
Method Summary
Modifier and TypeMethodDescriptionvoid
generate
(OutputStream out) Generate the resource configured during setup, and output itgetDependenciesList
(Source inputSource) Calculate the list of dependencies for the given source, for validity calculations.Return the mime type of the configured resource.setup
(String location, Map objectModel, Parameters par, boolean readForDownload) Initialize the resource handler with a resource.Methods inherited from class org.ametys.plugins.core.ui.resources.AbstractCompiledResourceHandler
getKey, getValidity
Methods inherited from class org.ametys.core.resources.SimpleResourceHandler
getLastModified, service
Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.ametys.core.resources.ResourceHandler
acceptRanges, generate, getLength, shouldUseSourceContentLength
-
Constructor Details
-
LessResourceHandler
Constructor with an already resolvedSource
.- Parameters:
source
- the source
-
-
Method Details
-
setup
public Source setup(String location, Map objectModel, Parameters par, boolean readForDownload) throws ProcessingException, IOException Description copied from interface:ResourceHandler
Initialize the resource handler with a resource.- Specified by:
setup
in interfaceResourceHandler
- Overrides:
setup
in classSimpleResourceHandler
- Parameters:
location
- The source uriobjectModel
- The object modelpar
- The parametersreadForDownload
- if the resource is to be downloaded and not rendered.- Returns:
- the resolved source
- Throws:
ProcessingException
- If an error occursIOException
- If an error occurs
-
generate
Description copied from interface:ResourceHandler
Generate the resource configured during setup, and output it- Specified by:
generate
in interfaceResourceHandler
- Overrides:
generate
in classSimpleResourceHandler
- Parameters:
out
- The output stream to write to- Throws:
IOException
- If an error occursProcessingException
- If an error occurs
-
getDependenciesList
Description copied from class:AbstractCompiledResourceHandler
Calculate the list of dependencies for the given source, for validity calculations.- Specified by:
getDependenciesList
in classAbstractCompiledResourceHandler
- Parameters:
inputSource
- The source- Returns:
- The list of uri
-
getMimeType
Description copied from interface:ResourceHandler
Return the mime type of the configured resource.- Specified by:
getMimeType
in interfaceResourceHandler
- Overrides:
getMimeType
in classSimpleResourceHandler
- Returns:
- The mime type.
-