@ProviderType public interface HtmlLibraryManager
HtmlLibraryManager
provides access to repository defined
html libraries.Modifier and Type | Field and Description |
---|---|
static java.lang.String |
PARAM_DEBUG_CLIENT_LIBS
request parameter name for turning on HtmlLibraryServlet debugging
|
static java.lang.String |
PARAM_DEBUG_CONSOLE
request parameter name for enabling debug console (firebug + cq logging)
|
static java.lang.String |
PARAM_FORCE_THEME
request parameter name for testing a theme
|
static java.lang.String |
REQUEST_ATTR_FORCE_CQ_URLINFO
Request attribute flag that forces the inclusion of the CQURLInfo
|
Modifier and Type | Method and Description |
---|---|
void |
ensureCached()
Ensures that all client libraries are compiled
|
java.util.Map<java.lang.String,ClientLibrary> |
getLibraries()
Returns all client libraries
|
java.util.Collection<ClientLibrary> |
getLibraries(java.lang.String[] categories,
LibraryType type,
boolean ignoreThemed,
boolean transitive)
Returns all client libraries that match the specified filters.
|
HtmlLibrary |
getLibrary(LibraryType type,
java.lang.String path)
Returns the html library that is configured at the given path.
|
HtmlLibrary |
getLibrary(SlingHttpServletRequest request)
Returns the html library that is address by the given request.
|
java.util.Collection<ClientLibrary> |
getThemeLibraries(java.lang.String[] categories,
LibraryType type,
java.lang.String themeName,
boolean transitive)
Returns all themed client libraries that match the type.
|
void |
invalidateOutputCache()
Invalidates the output cache.
|
boolean |
isDebugEnabled()
Checks if debug support is enabled.
|
boolean |
isGzipEnabled()
Checks if gzip compression is enabled.
|
boolean |
isMinifyEnabled()
Checks if library minification is enabled.
|
void |
writeCssInclude(SlingHttpServletRequest request,
java.io.Writer out,
boolean themed,
java.lang.String... categories)
Writes the CSS include snippets to the given writer.
|
void |
writeCssInclude(SlingHttpServletRequest request,
java.io.Writer out,
java.lang.String... categories)
Writes the CSS include snippets to the given writer.
|
void |
writeIncludes(SlingHttpServletRequest request,
java.io.Writer out,
java.lang.String... categories)
Writes the include snippets to the given writer.
|
void |
writeJsInclude(SlingHttpServletRequest request,
java.io.Writer out,
boolean themed,
java.lang.String... categories)
Writes the JS include snippets to the given writer.
|
void |
writeJsInclude(SlingHttpServletRequest request,
java.io.Writer out,
java.lang.String... categories)
Writes the JS include snippets to the given writer.
|
void |
writeThemeInclude(SlingHttpServletRequest request,
java.io.Writer out,
java.lang.String... categories)
Writes all CSS and only themed JS include snippets to the given writer.
|
static final java.lang.String PARAM_DEBUG_CONSOLE
static final java.lang.String PARAM_DEBUG_CLIENT_LIBS
static final java.lang.String PARAM_FORCE_THEME
static final java.lang.String REQUEST_ATTR_FORCE_CQ_URLINFO
void writeJsInclude(SlingHttpServletRequest request, java.io.Writer out, java.lang.String... categories) throws java.io.IOException
request
- requestout
- writercategories
- categoriesjava.io.IOException
- if an I/O error occursvoid writeJsInclude(SlingHttpServletRequest request, java.io.Writer out, boolean themed, java.lang.String... categories) throws java.io.IOException
themed
is false
, only non-themed
libraries are included.
If themed
is true
only themed libraries are
included and if the request contains a "forceTheme"
parameter, the themed libraries are overlaid with their respective
counterparts with that given theme.request
- requestout
- writerthemed
- controls if themed or non themed libraries should be includedcategories
- categoriesjava.io.IOException
- if an I/O error occursvoid writeCssInclude(SlingHttpServletRequest request, java.io.Writer out, java.lang.String... categories) throws java.io.IOException
request
- requestout
- writercategories
- categoriesjava.io.IOException
- if an I/O error occursvoid writeCssInclude(SlingHttpServletRequest request, java.io.Writer out, boolean themed, java.lang.String... categories) throws java.io.IOException
themed
is false
, only non-themed
libraries are included.
If themed
is true
only themed libraries are
included and if the request contains a "forceTheme"
parameter, the themed libraries are overlaid with their respective
counterparts with that given theme.request
- requestout
- writerthemed
- controls if themed or non themed libraries should be includedcategories
- categoriesjava.io.IOException
- if an I/O error occursvoid writeThemeInclude(SlingHttpServletRequest request, java.io.Writer out, java.lang.String... categories) throws java.io.IOException
request
- requestout
- writercategories
- categoriesjava.io.IOException
- if an I/O error occursvoid writeIncludes(SlingHttpServletRequest request, java.io.Writer out, java.lang.String... categories) throws java.io.IOException
writeCssInclude(...);
writeJsInclude(...);
writeThemeInclude(...);
If one of the libraries to be included has assigned channels, then the
inclusion is delegated to the client side library manager.request
- requestout
- writercategories
- categoriesjava.io.IOException
- if an I/O error occursHtmlLibrary getLibrary(LibraryType type, java.lang.String path)
null
is returned.type
- the library typepath
- the pathHtmlLibrary getLibrary(SlingHttpServletRequest request)
null
is returned.request
- the requestboolean isMinifyEnabled()
true
if minification is enabled.boolean isDebugEnabled()
true
if debug is enabled.boolean isGzipEnabled()
true
if gzip is enabled.java.util.Map<java.lang.String,ClientLibrary> getLibraries()
java.util.Collection<ClientLibrary> getLibraries(java.lang.String[] categories, LibraryType type, boolean ignoreThemed, boolean transitive)
categories
- the categoriestype
- type or null
to match all typesignoreThemed
- true
to filter out themed librariestransitive
- true
to resolve recursivelyjava.util.Collection<ClientLibrary> getThemeLibraries(java.lang.String[] categories, LibraryType type, java.lang.String themeName, boolean transitive)
null
all libraries are returned. If theme name is an empty
string, the configured default theme is used. If theme name is null
all themed libraries are returned.categories
- the categoriestype
- type or null
to match all typesthemeName
- theme name or null
transitive
- true
to resolve recursivelyvoid invalidateOutputCache() throws RepositoryException
RepositoryException
- if an error occurrsvoid ensureCached() throws java.io.IOException, RepositoryException
java.io.IOException
- if an error occursRepositoryException
- if an error occursCopyright © 2010 - 2020 Adobe. All Rights Reserved