There's a great list of Confluence Objects Accessible From Velocity on the Atlassian Developers site. I often refer to that page. However, the list is not exactly complete.
Scott Dudley wrote a handy user macro that displays all the available objects. I've improved a little on Scott's user macro by linking to the latest Confluence JavaDocs for each class.
Here's the user macro:
## Based on Scott Dudley's answer here:
## http://stackoverflow.com/a/23819584/1958200
##
## @noparams
#set($cashMoney = "$") ## just for display
#set($macroUtilClass=$action.class.forName('com.atlassian.confluence.renderer.radeox.macros.MacroUtils'))
#set($getContextMethod=$macroUtilClass.getDeclaredMethod('defaultVelocityContext',null))
#set($ctx=$getContextMethod.invoke(null))
#set($objects = $ctx.keySet().toArray())</pre>
<ul>
<ul>#foreach($p in $objects)</ul>
</ul>
<ul>
<ul>#set($className = $ctx.get($p).getClass().getName().toString())</ul>
</ul>
<ul>
<ul>
<li><code>$cashMoney$p.toString()</code> –
#if ($className.contains("$") == true || $className.startsWith("com.atlassian") == false)
$className
#else
#set($classUrl = "https://docs.atlassian.com/com/atlassian/confluence/atlassian-confluence/latest/" + $className.replace(".", "/") + ".html")
<a href="$classUrl">$className</a>
#end</li>
</ul>
</ul>
<ul id="velocityObjects">#end</ul>
<pre>
<script type="text/javascript">// <![CDATA[
// Sort them - Confluence doesn't have velocity SortTool, so doing this client side.
AJS.toInit(function ($) {
var sort_by_name = function(a, b) {
return a.innerHTML.toLowerCase().localeCompare(b.innerHTML.toLowerCase());
}
var velocityObjects = $("#velocityObjects > li").get();
velocityObjects.sort(sort_by_name);
for (var i = 0; i < velocityObjects.length; i++) {
velocityObjects[i].parentNode.appendChild(velocityObjects[i]);
}
});
// ]]></script></pre>
<style><!--
/* add some style */
#com-atlassian-confluence #velocityObjects code {
margin: 0 2px;
padding: 0px 5px;
border: 1px solid #ddd;
background-color: #f5f5f5;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
}
--></style>
<pre>
And the resulting HTML displayed:
Complete list of Confluence object available to Velocity
For completeness, I've copied over from a Confluence 5.5.x instance with links to the latest JavaDocs below. I won't be updating the list as you can use the user macro instead.
$action– com.atlassian.confluence.pages.actions.ViewPageAction$applicationConfig– com.atlassian.config.ApplicationConfig$attachmentManager– com.sun.proxy.$Proxy26$bootstrap– com.atlassian.confluence.setup.DefaultBootstrapManager$buildInfo– com.atlassian.confluence.setup.BuildInformation$confluenceFlavour– com.atlassian.confluence.setup.settings.ConfluenceFlavour$contentUiSupport– com.atlassian.confluence.content.ui.DefaultContentUiSupport$darkFeatures– com.atlassian.confluence.setup.settings.DarkFeatures$deprecated– com.atlassian.confluence.velocity.Deprecated$docBean– com.atlassian.confluence.util.i18n.VersionSpecificDocumentationBean$docThemeHelper– com.atlassian.confluence.plugins.doctheme.DocThemeHelper$fileUtil– com.atlassian.core.util.FileUtils$generalUtil– com.atlassian.confluence.util.GeneralUtil$i18n– com.atlassian.confluence.util.i18n.DefaultI18NBean$i18nBean– com.atlassian.confluence.util.i18n.DefaultI18NBean$jsonator– com.sun.proxy.$Proxy2372$licenseManager– com.atlassian.license.LicenseManager$messageManager– com.sun.proxy.$Proxy91$officeVelocityHelper– com.atlassian.confluence.extra.office.velocity.VelocityHelper$pageManager– com.sun.proxy.$Proxy58$permissionCheckDispatcher– com.atlassian.confluence.security.PermissionCheckDispatcher$permissionHelper– com.atlassian.confluence.security.PermissionHelper$renderBean– com.atlassian.confluence.util.QuickPageRenderBean$req– com.atlassian.confluence.web.filter.DebugFilter$DebugHttpServletRequestWrapper$res– com.atlassian.confluence.web.filter.DebugFilter$LoggingResponseWrapper$seraph– com.atlassian.confluence.util.SeraphUtils$settingsManager– com.atlassian.confluence.setup.settings.DefaultSettingsManager$setup– com.atlassian.confluence.setup.DefaultBootstrapManager$setupPersister– com.atlassian.confluence.setup.DefaultSetupPersister$soyTemplateRendererHelper– com.atlassian.confluence.plugins.soy.VelocityFriendlySoyTemplateRenderer$spaceManager– com.sun.proxy.$Proxy62$spaceToolsTabsHelper– com.atlassian.confluence.spaces.actions.SpaceToolsTabsHelper$spaceUtils– com.atlassian.confluence.spaces.SpaceUtils$staticResourceUrlPrefix– java.lang.String$stringUtils– org.apache.commons.lang.StringUtils$systemProperties– com.atlassian.confluence.core.ConfluenceSystemProperties$textUtil– com.opensymphony.util.TextUtils$userAccessor– com.sun.proxy.$Proxy53$userHelper– com.atlassian.confluence.user.UserHelper$utilTimerStack– com.atlassian.util.profiling.UtilTimerStack$webInterfaceManager– com.atlassian.confluence.plugin.descriptor.web.ConfluenceWebInterfaceManager$webMenuManager– com.atlassian.confluence.web.LegacyConfluenceWebMenuManager$webResourceHelper– com.atlassian.confluence.setup.velocity.VelocityFriendlyPageBuilderService$webResourceManager– com.atlassian.confluence.plugin.webresource.DefaultConfluenceWebResourceManager$webwork– com.opensymphony.webwork.util.VelocityWebWorkUtil$xsrfTokenGenerator– com.atlassian.xwork.SimpleXsrfTokenGenerator
