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.

  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    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.
    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)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ConfluenceVelocityManager

      public ConfluenceVelocityManager()
  • Method Details

    • getVelocityEngine

      public org.apache.velocity.app.VelocityEngine getVelocityEngine()
      Specified by:
      getVelocityEngine in interface org.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 interface org.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 from createContext(com.opensymphony.xwork2.util.ValueStack, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) in that it does not return a StrutsVelocityContext which exhibits ValueStack lookup fallback.
    • init

      public void init(javax.servlet.ServletContext context)
      Specified by:
      init in interface org.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.