Package org.ametys.core.minimize.js
Class MinimizedJSResourceHandler
- java.lang.Object
-
- org.ametys.runtime.plugin.component.AbstractLogEnabled
-
- org.ametys.core.resources.AbstractResourceHandler
-
- org.ametys.core.resources.I18nTextResourceHandler
-
- org.ametys.core.resources.JSResourceHandler
-
- org.ametys.core.minimize.js.MinimizedJSResourceHandler
-
- All Implemented Interfaces:
ResourceHandler,LogEnabled,Component,Configurable,Contextualizable,Serviceable
public class MinimizedJSResourceHandler extends JSResourceHandler
Resource handler for minimized javascript file
-
-
Field Summary
Fields Modifier and Type Field Description private static String__FILE_LOCATIONprivate static String__REAL_FILE_URIprotected MinimizeJSManager_jSMinimizeManagerJS minimize manager-
Fields inherited from class org.ametys.core.resources.JSResourceHandler
__PARAMETER_SET_EXPIRES_HEADER_TO_NO_CACHE
-
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 MinimizedJSResourceHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidgenerateResource(Source source, OutputStream out, Map objectModel, Parameters par, Map<String,Object> additionalParameters)Generate the resource configured during setup, and output itSerializablegetKey(Source source, Map objectModel, Parameters parameters, Map<String,Object> additionalParameters)Get the unique key for this resource, for cache purpose.intgetPriority()Get the priority of this handlervoidservice(ServiceManager manager)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.JSResourceHandler
getMimeType
-
Methods inherited from class org.ametys.core.resources.I18nTextResourceHandler
getLocale
-
Methods inherited from class org.ametys.core.resources.AbstractResourceHandler
configure, contextualize, getLastModified, getSize, getValidity, isSupported
-
Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
-
-
-
Field Detail
-
__REAL_FILE_URI
private static final String __REAL_FILE_URI
- See Also:
- Constant Field Values
-
__FILE_LOCATION
private static final String __FILE_LOCATION
- See Also:
- Constant Field Values
-
_jSMinimizeManager
protected MinimizeJSManager _jSMinimizeManager
JS minimize manager
-
-
Constructor Detail
-
MinimizedJSResourceHandler
public MinimizedJSResourceHandler()
-
-
Method Detail
-
service
public void service(ServiceManager manager) throws ServiceException
- Specified by:
servicein interfaceServiceable- Overrides:
servicein classI18nTextResourceHandler- Throws:
ServiceException
-
getPriority
public int getPriority()
Description copied from interface:ResourceHandlerGet the priority of this handler- Specified by:
getPriorityin interfaceResourceHandler- Overrides:
getPriorityin 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:ResourceHandlerInitialize the resource handler with a resource.- Specified by:
setupin interfaceResourceHandler- Overrides:
setupin classJSResourceHandler- 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:ResourceHandlerGet the unique key for this resource, for cache purpose.- Specified by:
getKeyin interfaceResourceHandler- Overrides:
getKeyin classI18nTextResourceHandler- 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:ResourceHandlerGenerate the resource configured during setup, and output it- Specified by:
generateResourcein interfaceResourceHandler- Overrides:
generateResourcein classI18nTextResourceHandler- 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
-
-