public interface CacheKeyGenerator
| Modifier and Type | Method and Description |
|---|---|
String |
generate(Resource resource,
RenderContext renderContext,
Properties properties)
Generates the output cache key based on the provided data.
|
Properties |
getAttributesForKey(RenderContext renderContext,
Resource resource)
Get all cache attributes that need to be applied on this fragment and that will impact key generation.
|
CacheKeyPartGenerator |
getPartGenerator(String field)
Return the cache key part generator corresponding to the given field
|
Map<String,String> |
parse(String key)
Parses the specified key into separate fields.
|
Map<String,Object> |
prepareContextForContentGeneration(Map<String,String> keyParts,
Resource resource,
RenderContext renderContext)
Before generating a sub-fragment during aggregation, this function will be called to modify the render context.
|
String |
replaceField(String key,
String fieldName,
String newValue)
Deprecated.
Not used anymore
|
String |
replacePlaceholdersInCacheKey(RenderContext renderContext,
String key)
Transform the fragment key into the final key used for caching the fragment
|
void |
restoreContextAfterContentGeneration(Map<String,String> keyParts,
Resource resource,
RenderContext renderContext,
Map<String,Object> original)
After generating a sub-fragment during aggregation, this function will be called to restore the render context.
|
String generate(Resource resource, RenderContext renderContext, Properties properties)
resource - the current resource being renderedrenderContext - the current rendering contextproperties - Fragment propertiesMap<String,String> parse(String key)
key - the cache key to be decomposed@Deprecated String replaceField(String key, String fieldName, String newValue)
CacheKeyPartGenerator getPartGenerator(String field)
field - the given fieldString replacePlaceholdersInCacheKey(RenderContext renderContext, String key)
renderContext - the current render contextkey - the key to be transformedMap<String,Object> prepareContextForContentGeneration(Map<String,String> keyParts, Resource resource, RenderContext renderContext)
keyParts - The fragment key parsed, typically a map returned by the parse methodresource - The current rendered resourcerenderContext - The current renderContextvoid restoreContextAfterContentGeneration(Map<String,String> keyParts, Resource resource, RenderContext renderContext, Map<String,Object> original)
keyParts - The fragment key parsed, typically a map returned by the parse methodresource - The current rendered resourcerenderContext - The current renderContextoriginal - The map previously retrieved via prepareContextForContentGeneration() invocationProperties getAttributesForKey(RenderContext renderContext, Resource resource) throws javax.jcr.RepositoryException
javax.jcr.RepositoryExceptionCopyright © 2004–2020 Jahia Solutions Group SA. All rights reserved.