public class Controller extends BaseController
| Modifier and Type | Field and Description |
|---|---|
static String |
APPLICATION_JSON |
globals, request, response| Constructor and Description |
|---|
Controller(Globals globals,
Request request,
Response response) |
| Modifier and Type | Method and Description |
|---|---|
protected String |
buildCacheKey(String url)
Creates cache key for resource or batch.
|
protected boolean |
checkIfCachedAndNotModified(Date updatedAt)
Check if resource is not modified and replies with not-modified response if so.
|
protected List<Resource> |
getBatchResources(Collection<String> included,
LinkedHashSet<String> excluded,
String type,
boolean resolveDependencies,
boolean withLegacyConditions)
Get Resources for Batch (all types of Batch - Web Resource Batch, Super Batch, Context Batch).
|
protected Resource |
getResourceRelativeToBatch(Collection<String> included,
LinkedHashSet<String> excluded,
String resourceName,
boolean resolveDependencies,
boolean withLegacyConditions)
Get Resource relative to Batch.
|
protected boolean |
handleNotFoundRedirectAndNotModified(Resource resource)
Handle not found resources, redirects and not modified resources.
|
protected boolean |
isSourceMapEnabled()
If Source Map is enabled for the current Request.
|
protected void |
sendCached(Content content,
Map<String,String> params,
boolean isCachingEnabled) |
protected void |
sendCachedInDevelopment(Content content,
boolean isCachingEnabled) |
protected void |
sendCachedInProduction(Content content,
boolean isCachingEnabled) |
void |
serveBatch(Collection<String> included,
LinkedHashSet<String> excluded,
String type,
boolean resolveDependencies,
boolean withLegacyConditions,
boolean isCachingEnabled)
Serves Batch (all types of Batch - Web Resource Batch, Super Batch, Context Batch).
|
void |
serveBatchSourceMap(Collection<String> included,
LinkedHashSet<String> excluded,
String type,
boolean resolveDependencies,
boolean withLegacyConditions)
Serves Source Map for Batch.
|
protected void |
serveResource(LinkedHashSet<String> requiredResources,
Resource resource,
boolean applyTransformations,
boolean isCachingEnabled)
Serves Resource.
|
void |
serveResource(String completeKey,
String resourceName)
Serves single Resource.
|
void |
serveResourceRelativeToBatch(Collection<String> included,
LinkedHashSet<String> excluded,
String resourceName,
boolean resolveDependencies,
boolean withLegacyConditions)
Serves Resource relative to Batch.
|
void |
serveResourceRelativeToBatchSourceMap(Collection<String> included,
LinkedHashSet<String> excluded,
String resourceName,
boolean resolveDependencies,
boolean withLegacyConditions)
Serves Source Map for Resource relative to Batch.
|
protected void |
serveResources(LinkedHashSet<String> requiredResources,
com.google.common.base.Supplier<Collection<Resource>> resources,
boolean isCachingEnabled)
Serves resources.
|
void |
serveResourceSourceMap(String completeKey,
String resourceName)
Serves Source Map for single Resource.
|
void |
serveSource(String completeKey,
String resourceName)
Serves Source Code of the Resource.
|
protected void |
serveSourceMap(LinkedHashSet<String> requiredResources,
Resource resource,
boolean isCachingEnabled)
Serves Source Map.
|
beforepublic static final String APPLICATION_JSON
public void serveResource(String completeKey, String resourceName)
public void serveResourceSourceMap(String completeKey, String resourceName)
public void serveBatch(Collection<String> included, LinkedHashSet<String> excluded, String type, boolean resolveDependencies, boolean withLegacyConditions, boolean isCachingEnabled)
included - keys of included Web Resources.excluded - keys of excluded Web Resources.type - type of Batch.resolveDependencies - if dependencies should be resolved.public void serveBatchSourceMap(Collection<String> included, LinkedHashSet<String> excluded, String type, boolean resolveDependencies, boolean withLegacyConditions)
protected List<Resource> getBatchResources(Collection<String> included, LinkedHashSet<String> excluded, String type, boolean resolveDependencies, boolean withLegacyConditions)
included - keys of included Web Resources.excluded - keys of excluded Web Resources.type - type of Batch.resolveDependencies - if dependencies should be resolved.public void serveResourceRelativeToBatch(Collection<String> included, LinkedHashSet<String> excluded, String resourceName, boolean resolveDependencies, boolean withLegacyConditions)
public void serveResourceRelativeToBatchSourceMap(Collection<String> included, LinkedHashSet<String> excluded, String resourceName, boolean resolveDependencies, boolean withLegacyConditions)
protected Resource getResourceRelativeToBatch(Collection<String> included, LinkedHashSet<String> excluded, String resourceName, boolean resolveDependencies, boolean withLegacyConditions)
public void serveSource(String completeKey, String resourceName)
protected void serveResource(LinkedHashSet<String> requiredResources, Resource resource, boolean applyTransformations, boolean isCachingEnabled)
applyTransformations - if transformations should be applied.protected void serveResources(LinkedHashSet<String> requiredResources, com.google.common.base.Supplier<Collection<Resource>> resources, boolean isCachingEnabled)
protected void serveSourceMap(LinkedHashSet<String> requiredResources, Resource resource, boolean isCachingEnabled)
protected boolean handleNotFoundRedirectAndNotModified(Resource resource)
protected boolean checkIfCachedAndNotModified(Date updatedAt)
updatedAt - when resource has been updated.protected void sendCached(Content content, Map<String,String> params, boolean isCachingEnabled)
protected void sendCachedInProduction(Content content, boolean isCachingEnabled)
protected void sendCachedInDevelopment(Content content, boolean isCachingEnabled)
protected boolean isSourceMapEnabled()
Copyright © 2019 Atlassian. All rights reserved.