Package org.ametys.core.minimize.css
Class MinimizedCSSResourceHandler
- java.lang.Object
-
- org.ametys.runtime.plugin.component.AbstractLogEnabled
-
- org.ametys.core.resources.AbstractResourceHandler
-
- org.ametys.core.minimize.css.MinimizedCSSResourceHandler
-
- All Implemented Interfaces:
ResourceHandler
,LogEnabled
,Configurable
,Contextualizable
,Serviceable
public class MinimizedCSSResourceHandler extends AbstractResourceHandler
Resource handler for minimized css
-
-
Field Summary
Fields Modifier and Type Field Description private static String
__MINIMIZED_URI
private static String
__ORIGINAL_URI
protected MinimizeCSSManager
_cssMinimizeManager
JS minimize managerprivate JSASSResourceURIExtensionPoint
_jsassResourceURIExtensionPoint
-
Fields inherited from class org.ametys.core.resources.AbstractResourceHandler
_cocoonContext, _context, _resolver, _supportedSuffixes
-
Fields inherited from interface org.ametys.core.resources.ResourceHandler
MAX_PRIORITY, MIN_PRIORITY
-
-
Constructor Summary
Constructors Constructor Description MinimizedCSSResourceHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
generateResource(Source source, OutputStream out, Map objectModel, Parameters par, Map<String,Object> additionalParameters)
Generate the resource configured during setup, and output itSerializable
getKey(Source source, Map objectModel, Parameters parameters, Map<String,Object> additionalParameters)
Get the unique key for this resource, for cache purpose.int
getPriority()
Get the priority of this handlerboolean
isSupported(String source)
Determines if the resource is supported by this handlervoid
service(ServiceManager manager)
Source
setup(String location, Map objectModel, Parameters par, Map<String,Object> additionalParameters)
Initialize the resource handler with a resource.-
Methods inherited from class org.ametys.core.resources.AbstractResourceHandler
configure, contextualize, getLastModified, getMimeType, getSize, getValidity
-
Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
-
-
-
Field Detail
-
__ORIGINAL_URI
private static final String __ORIGINAL_URI
- See Also:
- Constant Field Values
-
__MINIMIZED_URI
private static final String __MINIMIZED_URI
- See Also:
- Constant Field Values
-
_cssMinimizeManager
protected MinimizeCSSManager _cssMinimizeManager
JS minimize manager
-
_jsassResourceURIExtensionPoint
private JSASSResourceURIExtensionPoint _jsassResourceURIExtensionPoint
-
-
Constructor Detail
-
MinimizedCSSResourceHandler
public MinimizedCSSResourceHandler()
-
-
Method Detail
-
service
public void service(ServiceManager manager) throws ServiceException
- Specified by:
service
in interfaceServiceable
- Overrides:
service
in classAbstractResourceHandler
- Throws:
ServiceException
-
isSupported
public boolean isSupported(String source)
Description copied from interface:ResourceHandler
Determines if the resource is supported by this handler- Specified by:
isSupported
in interfaceResourceHandler
- Overrides:
isSupported
in classAbstractResourceHandler
- Parameters:
source
- The uri of resource- Returns:
true
if the resource is supported
-
getPriority
public int getPriority()
Description copied from interface:ResourceHandler
Get the priority of this handler- Specified by:
getPriority
in interfaceResourceHandler
- Overrides:
getPriority
in classAbstractResourceHandler
- Returns:
- the priority. The bigger the highest priority
-
setup
public Source setup(String location, Map objectModel, Parameters par, Map<String,Object> additionalParameters) throws IOException, ProcessingException
Description copied from interface:ResourceHandler
Initialize the resource handler with a resource.- Specified by:
setup
in interfaceResourceHandler
- Overrides:
setup
in classAbstractResourceHandler
- Parameters:
location
- The source uriobjectModel
- The object modelpar
- The parametersadditionalParameters
- Additional parameters that can be filled, and will be transmitted to getKey, getValidity and generateResource- Returns:
- the resolved source
- Throws:
IOException
- If an error occursProcessingException
- If an error occurs
-
getKey
public Serializable getKey(Source source, Map objectModel, Parameters parameters, Map<String,Object> additionalParameters)
Description copied from interface:ResourceHandler
Get the unique key for this resource, for cache purpose.- Specified by:
getKey
in interfaceResourceHandler
- Overrides:
getKey
in classAbstractResourceHandler
- Parameters:
source
- The sourceobjectModel
- The object modelparameters
- The parametersadditionalParameters
- Additional parameters- Returns:
- The cache key.
-
generateResource
public void generateResource(Source source, OutputStream out, Map objectModel, Parameters par, Map<String,Object> additionalParameters) throws IOException, ProcessingException
Description copied from interface:ResourceHandler
Generate the resource configured during setup, and output it- Parameters:
source
- The sourceout
- The output stream to write toobjectModel
- The object modelpar
- The sitemap parametersadditionalParameters
- Additional parameters- Throws:
IOException
- If an error occursProcessingException
- If an error occurs
-
-