Package org.ametys.core.resources
Class JSResourceHandler
- java.lang.Object
-
- org.ametys.runtime.plugin.component.AbstractLogEnabled
-
- org.ametys.core.resources.AbstractResourceHandler
-
- org.ametys.core.resources.I18nTextResourceHandler
-
- org.ametys.core.resources.JSResourceHandler
-
- All Implemented Interfaces:
ResourceHandler,LogEnabled,Component,Configurable,Contextualizable,Serviceable
- Direct Known Subclasses:
MinimizedJSResourceHandler
public class JSResourceHandler extends I18nTextResourceHandler
Resource handler for JavaScript files
-
-
Field Summary
Fields Modifier and Type Field Description protected static String__PARAMETER_SET_EXPIRES_HEADER_TO_NO_CACHEParameter to enable or not the expire 0 header.-
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 JSResourceHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetMimeType(Source source, Parameters par)Return the mime type of the configured resource.Sourcesetup(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.I18nTextResourceHandler
generateResource, getKey, getLocale, service
-
Methods inherited from class org.ametys.core.resources.AbstractResourceHandler
configure, contextualize, getLastModified, getPriority, getSize, getValidity, isSupported
-
Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
-
-
-
Field Detail
-
__PARAMETER_SET_EXPIRES_HEADER_TO_NO_CACHE
protected static final String __PARAMETER_SET_EXPIRES_HEADER_TO_NO_CACHE
Parameter to enable or not the expire 0 header. Default to true- See Also:
- Constant Field Values
-
-
Constructor Detail
-
JSResourceHandler
public JSResourceHandler()
-
-
Method Detail
-
setup
public Source setup(String location, Map objectModel, Parameters par, Map<String,Object> additionalParameters) throws ProcessingException, IOException
Description copied from interface:ResourceHandlerInitialize the resource handler with a resource.- Specified by:
setupin interfaceResourceHandler- Overrides:
setupin classI18nTextResourceHandler- 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:
ProcessingException- If an error occursIOException- If an error occurs
-
getMimeType
public String getMimeType(Source source, Parameters par)
Description copied from interface:ResourceHandlerReturn the mime type of the configured resource.- Specified by:
getMimeTypein interfaceResourceHandler- Overrides:
getMimeTypein classAbstractResourceHandler- Parameters:
source- The sourcepar- The parameters- Returns:
- The mime type.
-
-