Interface ClientlibService
- 
- All Known Implementing Classes:
- DefaultClientlibService
 
 public interface ClientlibServiceVarious internal functionality about client libraries.
- 
- 
Nested Class SummaryNested Classes Modifier and Type Interface Description static classClientlibService.ClientlibInfo
 - 
Field SummaryFields Modifier and Type Field Description static StringENCODING_GZIP
 - 
Method SummaryAll Methods Instance Methods Abstract Methods Modifier and Type Method Description voidclearCache(org.apache.sling.api.resource.ResourceResolver resolver)Clears the whole cache for all clientlibs.voiddeliverContent(org.apache.sling.api.resource.ResourceResolver resolver, ClientlibRef clientlibRef, boolean minified, OutputStream outputStream, String encoding)Writes the cached content to outputStream.ClientlibConfiguration.ConfiggetClientlibConfig()@NotNull org.apache.sling.api.resource.ResourcegetMinifiedSibling(@NotNull org.apache.sling.api.resource.Resource resource)ClientlibService.ClientlibInfoprepareContent(org.apache.sling.api.SlingHttpServletRequest request, ClientlibRef clientlibRef, boolean minified, String encoding, boolean forceRefreshCache, String requestedHash, long ifModifiedSince)Writes the content to a cache if it wasn't there, and returns a collection of information to be put into the response headers.voidrenderClientlibLinks(ClientlibElement clientlib, Writer writer, org.apache.sling.api.SlingHttpServletRequest request, RendererContext context)Renders the references to the ressources of the clientlibs into the page.ClientlibElementresolve(ClientlibRef ref, org.apache.sling.api.resource.ResourceResolver resolver)Resolves the element corresponding to the ref.@Nullable StringverifyClientlibPermissions(Clientlib.Type type, @Nullable org.apache.sling.api.resource.ResourceResolver resolver, boolean onlyErrors)Generates a human readable descriptions of inconsistencies of the client libraries wrt.
 
- 
- 
- 
Field Detail- 
ENCODING_GZIPstatic final String ENCODING_GZIP - See Also:
- Constant Field Values
 
 
- 
 - 
Method Detail- 
resolveClientlibElement resolve(ClientlibRef ref, org.apache.sling.api.resource.ResourceResolver resolver) Resolves the element corresponding to the ref.- Returns:
- the corresponding element or null if we can't find it.
 
 - 
getMinifiedSibling@NotNull @NotNull org.apache.sling.api.resource.Resource getMinifiedSibling(@NotNull @NotNull org.apache.sling.api.resource.Resource resource)
 - 
getClientlibConfigClientlibConfiguration.Config getClientlibConfig() 
 - 
renderClientlibLinksvoid renderClientlibLinks(ClientlibElement clientlib, Writer writer, org.apache.sling.api.SlingHttpServletRequest request, RendererContext context) throws IOException, javax.jcr.RepositoryException Renders the references to the ressources of the clientlibs into the page.- Parameters:
- clientlib- a- Clientlibor- ClientlibCategory
- Throws:
- IOException
- javax.jcr.RepositoryException
 
 - 
prepareContentClientlibService.ClientlibInfo prepareContent(org.apache.sling.api.SlingHttpServletRequest request, ClientlibRef clientlibRef, boolean minified, String encoding, boolean forceRefreshCache, String requestedHash, long ifModifiedSince) throws IOException, javax.jcr.RepositoryException Writes the content to a cache if it wasn't there, and returns a collection of information to be put into the response headers.- Parameters:
- clientlibRef- reference to the clientlib / category to render
- minified- when true, the minified version
- encoding- the needed encoding, if applicable
- forceRefreshCache- if true, the cache will be refreshed even if it is up to date
- requestedHash- the hash value the client requested
- ifModifiedSince- the value of the If-Modified-Since header, if present
- Returns:
- information about the file
- Throws:
- IOException
- javax.jcr.RepositoryException
 
 - 
deliverContentvoid deliverContent(org.apache.sling.api.resource.ResourceResolver resolver, ClientlibRef clientlibRef, boolean minified, OutputStream outputStream, String encoding) throws IOException, javax.jcr.RepositoryExceptionWrites the cached content to outputStream.- Parameters:
- clientlibRef- reference to the clientlib / category to render
- minified- when true, the minified version
- outputStream- the stream to write to
- encoding- the needed encoding, if applicable
- Throws:
- IOException
- javax.jcr.RepositoryException
 
 - 
verifyClientlibPermissions@Nullable @Nullable String verifyClientlibPermissions(@Nullable Clientlib.Type type, @Nullable @Nullable org.apache.sling.api.resource.ResourceResolver resolver, boolean onlyErrors) Generates a human readable descriptions of inconsistencies of the client libraries wrt. the given resolver (or an anonymous resolver, of none is given). Checks for each client library readable for the given resolver, that all elements of these client libraries and the files referenced from them are readable, too. Also we check that for all categories either all client libraries with this reference are readable, or none of them. All these are errors, since if that's not the case, this can cause a permanent recalculation of the clientlibs content, or, even worse, break the rendering. If {onlyErrors} is false, we also include informational messages about all unreadable libraries.- Parameters:
- type- if not null, only clientlibs / files of that type are checked
- resolver- if not null, we use this resolver instead of an anonymous resolver to check readability
- onlyErrors- if true, we skip informational messages
- Returns:
- null if everything is OK, otherwise a description of the problems
 
 - 
clearCachevoid clearCache(org.apache.sling.api.resource.ResourceResolver resolver) throws org.apache.sling.api.resource.PersistenceExceptionClears the whole cache for all clientlibs. Obviously something to used sparingly.- Parameters:
- resolver- the resolver to use.
- Throws:
- org.apache.sling.api.resource.PersistenceException
 
 
- 
 
-