com.atlassian.bamboo.ww2
Class FreemarkerContext

java.lang.Object
  extended by com.atlassian.bamboo.ww2.FreemarkerContext

public class FreemarkerContext
extends java.lang.Object

This class is similar to BambooActionSupport but does not require an action or action context. This makes this functionality available to any servlets as well.


Constructor Summary
FreemarkerContext(BambooLicenseManager bambooLicenseManager, AdministrationConfigurationManager administrationConfigurationManager, BambooPermissionManager bambooPermissionManager, DashboardCachingManager dashboardCachingManager, com.atlassian.plugin.web.WebInterfaceManager webInterfaceManager, BambooUserManager bambooUserManager, com.atlassian.plugin.PluginAccessor pluginAccessor)
           
 
Method Summary
 BambooLicenseManager getBambooLicenseManager()
           
 java.lang.String getCurrentUrl(javax.servlet.http.HttpServletRequest request)
           
 java.lang.String getInstanceName()
           
 PluggableFooter getPluggableFooter()
          Gets the pluggable footer plugin.
 PluggableTopNavigation getPluggableTopNavigation()
          Gets the pluggable top navigation plugin.
 com.atlassian.user.User getUser(javax.servlet.http.HttpServletRequest request)
           
 java.util.Map<java.lang.String,java.lang.Object> getWebFragmentsContextMapForAdminMenu(javax.servlet.http.HttpServletRequest request)
          A context map that gets appended to for web fragments.
 java.util.List<com.atlassian.plugin.web.descriptors.WebItemModuleDescriptor> getWebItemsForAdminSection(java.lang.String sectionName, javax.servlet.http.HttpServletRequest request)
          Will not bother putting any build information on the context
 java.util.List<com.atlassian.plugin.web.descriptors.WebSectionModuleDescriptor> getWebSectionsForAdminLocation(java.lang.String location, javax.servlet.http.HttpServletRequest request)
          Will not bother putting any build information on the context
 boolean hasAdminPermission()
           
 boolean hasBuilds()
           
 boolean hasGlobalAdminPermission()
           
 boolean hasGlobalPermission(java.lang.String permission)
          Does this user have the global permission right?
 boolean hasRestrictedAdminPermission()
           
 boolean isChainsEnabled()
           
 boolean isEnableSignup()
           
 java.lang.String renderFreemarkerTemplateForAdmin(java.lang.String templateString, javax.servlet.http.HttpServletRequest request)
          Will not bother putting any build information on the context
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FreemarkerContext

public FreemarkerContext(BambooLicenseManager bambooLicenseManager,
                         AdministrationConfigurationManager administrationConfigurationManager,
                         BambooPermissionManager bambooPermissionManager,
                         DashboardCachingManager dashboardCachingManager,
                         com.atlassian.plugin.web.WebInterfaceManager webInterfaceManager,
                         BambooUserManager bambooUserManager,
                         com.atlassian.plugin.PluginAccessor pluginAccessor)
Method Detail

getInstanceName

@Nullable
public java.lang.String getInstanceName()

getUser

@Nullable
public com.atlassian.user.User getUser(javax.servlet.http.HttpServletRequest request)

isEnableSignup

public boolean isEnableSignup()

isChainsEnabled

public boolean isChainsEnabled()

getCurrentUrl

@Nullable
public java.lang.String getCurrentUrl(javax.servlet.http.HttpServletRequest request)

hasBuilds

public boolean hasBuilds()

getWebItemsForAdminSection

public java.util.List<com.atlassian.plugin.web.descriptors.WebItemModuleDescriptor> getWebItemsForAdminSection(java.lang.String sectionName,
                                                                                                               javax.servlet.http.HttpServletRequest request)
Will not bother putting any build information on the context

Parameters:
sectionName - - the section to retrieve the web items for
request - - the http request
Returns:
List - all web items contained within the provided section

getWebSectionsForAdminLocation

public java.util.List<com.atlassian.plugin.web.descriptors.WebSectionModuleDescriptor> getWebSectionsForAdminLocation(java.lang.String location,
                                                                                                                      javax.servlet.http.HttpServletRequest request)
Will not bother putting any build information on the context

Parameters:
location - - the location to retrieve the web sections for
request - - the http request
Returns:
List - all web sections contained within the provided location

renderFreemarkerTemplateForAdmin

public java.lang.String renderFreemarkerTemplateForAdmin(java.lang.String templateString,
                                                         javax.servlet.http.HttpServletRequest request)
Will not bother putting any build information on the context

Parameters:
templateString - - to render
request - - the http request
Returns:
The rendered string

hasGlobalPermission

public boolean hasGlobalPermission(java.lang.String permission)
Does this user have the global permission right?

Parameters:
permission - The global permission being checked.
Returns:
true if the current user has this permission; false otherwise.

hasGlobalAdminPermission

public boolean hasGlobalAdminPermission()

hasRestrictedAdminPermission

public boolean hasRestrictedAdminPermission()

hasAdminPermission

public boolean hasAdminPermission()

getBambooLicenseManager

public BambooLicenseManager getBambooLicenseManager()

getPluggableTopNavigation

@Nullable
public PluggableTopNavigation getPluggableTopNavigation()
Gets the pluggable top navigation plugin.

Returns:
The pluggable top navigation plugin, if it exists, or null.

getPluggableFooter

@Nullable
public PluggableFooter getPluggableFooter()
Gets the pluggable footer plugin.

Returns:
The pluggable footer plugin, if it exists, or null.

getWebFragmentsContextMapForAdminMenu

public java.util.Map<java.lang.String,java.lang.Object> getWebFragmentsContextMapForAdminMenu(javax.servlet.http.HttpServletRequest request)
A context map that gets appended to for web fragments. Will not lok for any build information to put on the context path.

Parameters:
request - - servlet request
Returns:
A context map that gets appended to for web fragments.


Copyright © 2010 Atlassian. All Rights Reserved.