Interface WebResourceManager
<script> and <link> tags.
By using the WebResourceManager, components can declare dependencies on javascript and css that they would
otherwise have to embed inline (which means that it can't be cached, and are often duplicated in a page).
- Since:
- 6.3.0
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiongetRequiredResources(UrlMode urlMode) This is the equivalent of callinggetRequiredResources(UrlMode, WebResourceFilter)with the given url mode and a default filter that is dependent on the implementation.getRequiredResources(UrlMode urlMode, WebResourceFilter webResourceFilter) Returns the resource tags for the previously required resources called viarequireResource(String)that match the specified web resource filter.getResourceTags(String moduleCompleteKey, UrlMode urlMode) Returns the resource tags of the specified resource.voidincludeResources(Writer writer, UrlMode urlMode) This is the equivalent of callingincludeResources(Writer, UrlMode, WebResourceFilter)with the given url mode and a default web resource filter that is dependent on the implementation.voidincludeResources(Writer writer, UrlMode urlMode, WebResourceFilter webResourceFilter) Writes out the resource tags to the previously required resources called viarequireResource(String)for the specified resource type.voidincludeResources(Iterable<String> moduleCompleteKeys, Writer writer, UrlMode urlMode) Writes out the resource tags for a specified set of required resources and their dependencies.voidrequireResource(String moduleCompleteKey) Indicates that a given plugin web resource is required.voidrequireResource(String moduleCompleteKey, Writer writer, UrlMode urlMode) Writes the resource tags of the specified resource to the writer.voidrequireResourcesForContext(String context) Writes the resource tags of all resources that have the given context specified in their descriptor.
-
Method Details
-
requireResource
Indicates that a given plugin web resource is required. All resources called via this method must be included whenincludeResources(Writer, UrlMode)is called.- Parameters:
moduleCompleteKey- The fully qualified plugin web resource module (egjira.webresources:scriptaculous)- See Also:
-
includeResources
Writes out the resource tags for a specified set of required resources and their dependencies. Does not write out tags for resources specified in calls torequireResource(String).- Parameters:
moduleCompleteKeys- The set of web resource modules to includewriter- the writer to write the links tourlMode- specifies whether to use absolute URLs, relative URLs, or allow the concrete implementation to decide- Since:
- 2.4.0
-
includeResources
This is the equivalent of callingincludeResources(Writer, UrlMode, WebResourceFilter)with the given url mode and a default web resource filter that is dependent on the implementation. -
includeResources
Writes out the resource tags to the previously required resources called viarequireResource(String)for the specified resource type. If you need it as a String to embed the tags in a template, usegetRequiredResources(UrlMode).This method formats resource URLs in either relative or absolute format, depending on the value of
urlMode. SeeUrlModefor details of the different options for URL format.- Parameters:
writer- the writer to write the links tourlMode- specifies whether to use absolute URLs, relative URLs, or allow the concrete implementation to decidewebResourceFilter- the web resource filter to filter resources on- Since:
- 2.4
- See Also:
-
getRequiredResources
This is the equivalent of callinggetRequiredResources(UrlMode, WebResourceFilter)with the given url mode and a default filter that is dependent on the implementation.- Returns:
- the resource tags for all resources previously required
- Since:
- 2.3.1
- See Also:
-
getRequiredResources
Returns the resource tags for the previously required resources called viarequireResource(String)that match the specified web resource filter. If you are outputting the value to aWriter, useincludeResources(Writer, UrlMode).This method formats resource URLs in either relative or absolute format, depending on the value of
urlMode. SeeUrlModefor details of the different options for URL format.- Parameters:
urlMode- specifies whether to use absolute URLs, relative URLs, or allow the concrete implementation to decidewebResourceFilter- the web resource filter to filter resources on- Returns:
- the resource tags for all resources previously required
- Since:
- 2.4
- See Also:
-
requireResource
Writes the resource tags of the specified resource to the writer. If you need it as a String to embed the tags in a template, usegetResourceTags(String, UrlMode).This method formats resource URLs in either relative or absolute format, depending on the value of
urlMode. SeeUrlModefor details of the different options for URL format.- Parameters:
moduleCompleteKey- The fully qualified plugin web resource module (egjira.webresources:scriptaculous)writer- The writer to write the resource tags to.urlMode- specifies whether to use absolute URLs, relative URLs, or allow the concrete implementation to decide- Since:
- 2.3.0
-
requireResourcesForContext
Writes the resource tags of all resources that have the given context specified in their descriptor.- Parameters:
context- The name of the context for which you want to require resources (eg "atl.admin")- Since:
- 2.5.0
- See Also:
-
getResourceTags
Returns the resource tags of the specified resource. If you are outputting the value to aWriter, userequireResource(String, Writer, UrlMode).This method formats resource URLs in either relative or absolute format, depending on the value of
urlMode. SeeUrlModefor details of the different options for URL format.- Parameters:
moduleCompleteKey- The fully qualified plugin web resource module (egjira.webresources:scriptaculous)urlMode- specifies whether to use absolute URLs, relative URLs, or allow the concrete implementation to decide- Returns:
- the resource tags for the specified resource
- Since:
- 2.3.0
- See Also:
-