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_CACHE
Parameter 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 String
getMimeType(Source source, Parameters par)
Return the mime type of the configured resource.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.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:ResourceHandler
Initialize the resource handler with a resource.- Specified by:
setup
in interfaceResourceHandler
- Overrides:
setup
in 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:ResourceHandler
Return the mime type of the configured resource.- Specified by:
getMimeType
in interfaceResourceHandler
- Overrides:
getMimeType
in classAbstractResourceHandler
- Parameters:
source
- The sourcepar
- The parameters- Returns:
- The mime type.
-
-