Class RendererContext
- java.lang.Object
-
- com.composum.sling.clientlibs.processor.RendererContext
-
public class RendererContext extends Object
The context implementation for the clientlib link rendering, request scoped. This context provides a registry to avoid clientlib duplicates.
-
-
Field Summary
Fields Modifier and Type Field Description protected ClientlibService
clientlibService
static String
CONTEXT_KEY
protected Set<ClientlibLink>
renderedClientlibs
protected org.apache.sling.api.resource.ResourceResolver
resolver
-
Constructor Summary
Constructors Modifier Constructor Description protected
RendererContext(BeanContext context, org.apache.sling.api.SlingHttpServletRequest request)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ClientlibService
getClientlibService()
ClientlibConfiguration.Config
getConfiguration()
Set<ClientlibLink>
getRenderedClientlibs()
org.apache.sling.api.resource.ResourceResolver
getResolver()
static RendererContext
instance(BeanContext context, org.apache.sling.api.SlingHttpServletRequest request)
boolean
isClientlibRendered(ClientlibRef reference)
Checks whether a referenced resource or client library is satisfied by an already rendered resource.boolean
mapClientlibURLs()
void
registerClientlibLink(ClientlibLink link, ClientlibResourceFolder parent)
Registers rendered resources / client libraries that have already been rendered for the current request, that is, over all clientlib tag calls of a requestboolean
useMinifiedFiles()
-
-
-
Field Detail
-
CONTEXT_KEY
public static final String CONTEXT_KEY
-
renderedClientlibs
protected final Set<ClientlibLink> renderedClientlibs
-
resolver
protected transient org.apache.sling.api.resource.ResourceResolver resolver
-
clientlibService
protected transient ClientlibService clientlibService
-
-
Constructor Detail
-
RendererContext
protected RendererContext(BeanContext context, org.apache.sling.api.SlingHttpServletRequest request)
-
-
Method Detail
-
instance
public static RendererContext instance(BeanContext context, org.apache.sling.api.SlingHttpServletRequest request)
-
isClientlibRendered
public boolean isClientlibRendered(ClientlibRef reference)
Checks whether a referenced resource or client library is satisfied by an already rendered resource.
-
registerClientlibLink
public void registerClientlibLink(ClientlibLink link, ClientlibResourceFolder parent)
Registers rendered resources / client libraries that have already been rendered for the current request, that is, over all clientlib tag calls of a request- Parameters:
link
- the element to be registeredparent
- the element referencing it, for logging purposes
-
mapClientlibURLs
public boolean mapClientlibURLs()
-
useMinifiedFiles
public boolean useMinifiedFiles()
-
getClientlibService
public ClientlibService getClientlibService()
-
getRenderedClientlibs
public Set<ClientlibLink> getRenderedClientlibs()
-
getConfiguration
public ClientlibConfiguration.Config getConfiguration()
-
getResolver
public org.apache.sling.api.resource.ResourceResolver getResolver()
-
-