com.atlassian.jira.util.velocity
Interface VelocityRequestContextFactory

All Known Implementing Classes:
DefaultVelocityRequestContextFactory

public interface VelocityRequestContextFactory

Provides a request context that can be used to get the 'correct' baseurl. It will use information from the HttpRequest if one was made or applicationProperties otherwise to determine the baseurl.

Since:
v4.0

Method Summary
 void cacheVelocityRequestContext(VelocityRequestContext velocityRequestContext)
          Update the threadlocal storage with the given velocityRequestContext.
 void clearVelocityRequestContext()
          Resets the thread local storage as if no request has occurred, effectively nulling out the current thread local velocity request context.
 Map<String,Object> getDefaultVelocityParams(Map<String,Object> startingParams, JiraAuthenticationContext authenticationContext)
          Constructs a map with a number of common parameters used by velocity templates.
 VelocityRequestContext getJiraVelocityRequestContext()
          Get the request context.
 

Method Detail

getJiraVelocityRequestContext

VelocityRequestContext getJiraVelocityRequestContext()
Get the request context.

Returns:
The request context

getDefaultVelocityParams

Map<String,Object> getDefaultVelocityParams(Map<String,Object> startingParams,
                                            JiraAuthenticationContext authenticationContext)
Constructs a map with a number of common parameters used by velocity templates.

Parameters:
startingParams - Map of parameters that may be used to override any of the parameters set here.
authenticationContext - JiraAuthenticationContext
Returns:
a Map with common velocity parameters

cacheVelocityRequestContext

void cacheVelocityRequestContext(VelocityRequestContext velocityRequestContext)
Update the threadlocal storage with the given velocityRequestContext.

Parameters:
velocityRequestContext - The velocity request context to store
Since:
4.3

clearVelocityRequestContext

void clearVelocityRequestContext()
Resets the thread local storage as if no request has occurred, effectively nulling out the current thread local velocity request context.

Since:
4.3


Copyright © 2002-2011 Atlassian. All Rights Reserved.