Class ConfluenceVelocityManager
java.lang.Object
com.atlassian.confluence.setup.struts.ConfluenceVelocityManager
- All Implemented Interfaces:
org.apache.struts2.views.velocity.VelocityManagerInterface
public class ConfluenceVelocityManager
extends Object
implements org.apache.struts2.views.velocity.VelocityManagerInterface
Lightweight variant of the Struts VelocityManager
. Responsible for reading and loading configuration
in order to initialise the Velocity engine, as well as constructing rendering contexts.
createContext(com.opensymphony.xwork2.util.ValueStack, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
is called to construct a context for rendering Struts Velocity Results and SiteMesh decoratorsgetConfluenceVelocityContext()
can be called to construct a base context for other rendering purposes
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.velocity.context.Context
createContext
(com.opensymphony.xwork2.util.ValueStack stack, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res) Constructs a Velocity rendering context for use by Struts Velocity Results and SiteMesh decorators.static org.apache.velocity.context.Context
Constructs a base Velocity rendering context for other rendering purposes such as Confluence Macros.org.apache.velocity.app.VelocityEngine
void
init
(javax.servlet.ServletContext context) static org.apache.velocity.context.Context
processContextForRendering
(org.apache.velocity.context.Context context)
-
Constructor Details
-
ConfluenceVelocityManager
public ConfluenceVelocityManager()
-
-
Method Details
-
getVelocityEngine
public org.apache.velocity.app.VelocityEngine getVelocityEngine()- Specified by:
getVelocityEngine
in interfaceorg.apache.struts2.views.velocity.VelocityManagerInterface
-
createContext
public org.apache.velocity.context.Context createContext(com.opensymphony.xwork2.util.ValueStack stack, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res) Constructs a Velocity rendering context for use by Struts Velocity Results and SiteMesh decorators.- Specified by:
createContext
in interfaceorg.apache.struts2.views.velocity.VelocityManagerInterface
-
getConfluenceVelocityContext
public static org.apache.velocity.context.Context getConfluenceVelocityContext()Constructs a base Velocity rendering context for other rendering purposes such as Confluence Macros. This differs fromcreateContext(com.opensymphony.xwork2.util.ValueStack, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
in that it does not return aStrutsVelocityContext
which exhibitsValueStack
lookup fallback. -
init
public void init(javax.servlet.ServletContext context) - Specified by:
init
in interfaceorg.apache.struts2.views.velocity.VelocityManagerInterface
-
processContextForRendering
public static org.apache.velocity.context.Context processContextForRendering(org.apache.velocity.context.Context context) - Parameters:
context
- is currently modified and returned, but do not rely on this as it may change in future.
-