public class FreemarkerContext extends Object implements BareFreeMarkerContext
Constructor and Description |
---|
FreemarkerContext(AdministrationConfigurationAccessor administrationConfigurationAccessor,
BambooLicenseManager bambooLicenseManager,
BambooPermissionManager bambooPermissionManager,
BambooUserManager bambooUserManager,
BootstrapManager bootstrapManager,
CachedPlanManager cachedPlanManager,
CachedRepositoryDefinitionManager cachedRepositoryDefinitionManager,
CommentManager commentManager,
DarkFeatureService darkFeatureService,
DocumentationLinkProvider documentationLinkProvider,
FeatureManager featureManager,
GravatarService gravatarService,
LinkedDeploymentProjectCacheService linkedDeploymentProjectCacheService,
NotificationManager notificationManager,
PlanFavouriteService planFavouriteService,
PlanManager planManager,
com.atlassian.plugin.PluginAccessor pluginAccessor,
RepositoryDefinitionManager repositoryDefinitionManager,
ServerStatusProvider serverStatusProvider,
StorageCappingService storageCappingService,
VcsRepositoryViewerManager vcsRepositoryViewerManager,
com.atlassian.plugin.web.WebInterfaceManager webInterfaceManager) |
Modifier and Type | Method and Description |
---|---|
boolean |
canCreatePlan() |
boolean |
canCreatePlanInProject(Project project) |
boolean |
canCreateProject() |
boolean |
canRunCustomBuild(PlanIdentifier plan)
Checks if the current user has permissions sufficient to run custom/parameterised build of a given plan
|
BambooLicenseManager |
getBambooLicenseManager() |
BambooUser |
getBambooUser(String username) |
BootstrapManager |
getBootstrapManager() |
String |
getCurrentUrl(javax.servlet.http.HttpServletRequest request) |
DarkFeatureService |
getDarkFeatureService() |
FeatureManager |
getFeatureManager() |
String |
getGravatarUrl(String userName,
String size) |
DocumentationLinkProvider |
getHelpLink() |
String |
getInstanceName() |
NotificationManager |
getNotificationManager() |
PluggableFooter |
getPluggableFooter()
Gets the pluggable footer plugin.
|
PluggableTopNavigation |
getPluggableTopNavigation()
Gets the pluggable top navigation plugin.
|
int |
getRemainingJobsLimit() |
String |
getRssLink(ImmutablePlan plan) |
ServerLifecycleState |
getServerLifecycleState() |
ServerStatusInfo |
getServerStatusInfo() |
StorageCappingService |
getStorageCappingService() |
com.atlassian.user.User |
getUser(javax.servlet.http.HttpServletRequest request) |
Map<String,Object> |
getWebFragmentsContextMapNoAction(javax.servlet.http.HttpServletRequest request)
A context map that gets appended to for web fragments.
|
List<Map<String,Object>> |
getWebItems(String sectionName,
javax.servlet.http.HttpServletRequest request)
Returns a list of Map objects with prefilled text, id, accesskey, href fields for a template engine layer to consome
|
List<com.atlassian.plugin.web.descriptors.WebItemModuleDescriptor> |
getWebItemsForSectionNoAction(String sectionName,
javax.servlet.http.HttpServletRequest request)
Will not bother putting any build information on the context
|
Collection<String> |
getWebPanels(String location)
Gets all the rendered
WebPanel s for the location specified. |
Collection<String> |
getWebPanels(String location,
Map<String,Object> context) |
Collection<String> |
getWebPanelsForPlan(String location,
String planKey)
Gets all the rendered
WebPanel s for the location specified for a specific plan key. |
Collection<String> |
getWebPanelsForResultsSummary(String location,
ResultsSummary resultsSummary)
Gets all the rendered
WebPanel s for the location specified for a specific ResultSummary. |
List<com.atlassian.plugin.web.descriptors.WebSectionModuleDescriptor> |
getWebSectionsForLocationNoAction(String location,
javax.servlet.http.HttpServletRequest request)
Will not bother putting any build information on the context
|
String |
getXsrfToken() |
boolean |
hasAdminPermission() |
boolean |
hasBuilds() |
boolean |
hasComments(BambooIdProvider entity) |
boolean |
hasGlobalAdminPermission() |
boolean |
hasGlobalPermission(String permission)
Does this user have the global permission right?
|
boolean |
hasLinkedDeployments(PlanKey planKey) |
boolean |
hasProjectAdminPermission(Project project) |
boolean |
hasRestrictedAdminPermission() |
boolean |
isAuthorBambooServer(String userName)
Is the supplied author user the bamboo server?
|
boolean |
isBambooSpecsFailure(ImmutableResultsSummary buildResult) |
boolean |
isBambooSpecsSuccess(ImmutableResultsSummary buildResult) |
boolean |
isEc2ConfigurationWarningRequired() |
boolean |
isEnableSignup() |
boolean |
isFavourite(ImmutablePlan plan,
javax.servlet.http.HttpServletRequest request) |
boolean |
isFunctionalTest() |
boolean |
isOnDemandInstance() |
boolean |
isShowAdminContactDetailsToAnonymousUsers() |
boolean |
isUserAutocompleteAllowed() |
boolean |
isXsrfTokenNeeded(String formActionDestination) |
String |
renderFreemarkerTemplateNoAction(String templateString,
javax.servlet.http.HttpServletRequest request)
Will not bother putting any build information on the context
|
Boolean |
shouldShowActionTip(String actionKey,
javax.servlet.http.HttpServletRequest request)
Check if provided action-key is
available inside user preferences.
|
@Inject public FreemarkerContext(AdministrationConfigurationAccessor administrationConfigurationAccessor, BambooLicenseManager bambooLicenseManager, BambooPermissionManager bambooPermissionManager, BambooUserManager bambooUserManager, BootstrapManager bootstrapManager, CachedPlanManager cachedPlanManager, CachedRepositoryDefinitionManager cachedRepositoryDefinitionManager, CommentManager commentManager, DarkFeatureService darkFeatureService, DocumentationLinkProvider documentationLinkProvider, FeatureManager featureManager, GravatarService gravatarService, LinkedDeploymentProjectCacheService linkedDeploymentProjectCacheService, NotificationManager notificationManager, PlanFavouriteService planFavouriteService, PlanManager planManager, com.atlassian.plugin.PluginAccessor pluginAccessor, RepositoryDefinitionManager repositoryDefinitionManager, ServerStatusProvider serverStatusProvider, StorageCappingService storageCappingService, VcsRepositoryViewerManager vcsRepositoryViewerManager, com.atlassian.plugin.web.WebInterfaceManager webInterfaceManager)
@Nullable public String getInstanceName()
@Nullable public com.atlassian.user.User getUser(@Nullable javax.servlet.http.HttpServletRequest request)
public boolean isEnableSignup()
public boolean isUserAutocompleteAllowed()
public boolean isOnDemandInstance()
public boolean isEc2ConfigurationWarningRequired()
@Nullable public String getCurrentUrl(javax.servlet.http.HttpServletRequest request)
public boolean hasBuilds()
public int getRemainingJobsLimit()
public boolean isFavourite(ImmutablePlan plan, javax.servlet.http.HttpServletRequest request)
@Nullable public BambooUser getBambooUser(@Nullable String username)
public boolean isAuthorBambooServer(@Nullable String userName)
userName
- public List<com.atlassian.plugin.web.descriptors.WebItemModuleDescriptor> getWebItemsForSectionNoAction(String sectionName, javax.servlet.http.HttpServletRequest request)
sectionName
- - the section to retrieve the web items forrequest
- - the http request@NotNull public List<Map<String,Object>> getWebItems(String sectionName, javax.servlet.http.HttpServletRequest request)
sectionName
- request
- public List<com.atlassian.plugin.web.descriptors.WebSectionModuleDescriptor> getWebSectionsForLocationNoAction(String location, javax.servlet.http.HttpServletRequest request)
location
- - the location to retrieve the web sections forrequest
- - the http requestpublic String renderFreemarkerTemplateNoAction(String templateString, javax.servlet.http.HttpServletRequest request)
templateString
- - to renderrequest
- - the http requestpublic boolean hasGlobalPermission(String permission)
permission
- The global permission being checked.true
if the current user has this permission; false
otherwise.public boolean hasGlobalAdminPermission()
public boolean hasRestrictedAdminPermission()
public boolean hasProjectAdminPermission(@NotNull Project project)
public boolean canCreateProject()
public boolean canCreatePlanInProject(@NotNull Project project)
public boolean canCreatePlan()
public boolean canRunCustomBuild(PlanIdentifier plan)
public boolean hasAdminPermission()
public BambooLicenseManager getBambooLicenseManager()
@NotNull public ServerLifecycleState getServerLifecycleState()
@NotNull public ServerStatusInfo getServerStatusInfo()
@Nullable public PluggableTopNavigation getPluggableTopNavigation()
@Nullable public PluggableFooter getPluggableFooter()
@Nullable public Boolean shouldShowActionTip(@NotNull String actionKey, @NotNull javax.servlet.http.HttpServletRequest request)
request
- actionKey
- public Map<String,Object> getWebFragmentsContextMapNoAction(javax.servlet.http.HttpServletRequest request)
request
- - servlet requestpublic Collection<String> getWebPanelsForPlan(@NotNull String location, @NotNull String planKey)
WebPanel
s for the location specified for a specific plan key. Allows the same web
panel location to be used in multiple places on page with different plan contexts. If called in the context of
rendering a BambooActionSupport
action the context used is taken from BambooActionSupport.getWebPanelContext(String)
location
- the web panel will be displayedplanKey
- key of the plan for the contextpublic Collection<String> getWebPanelsForResultsSummary(@NotNull String location, @NotNull ResultsSummary resultsSummary)
WebPanel
s for the location specified for a specific ResultSummary. Allows the same
web panel location to be used in multiple places on page with different plan contexts. If called in the context
of rendering a BambooActionSupport
action the context used is taken from BambooActionSupport.getWebPanelContext(String)
location
- the web panel will be displayedresultsSummary
- passed to the web panels in the contextpublic Collection<String> getWebPanels(@NotNull String location)
WebPanel
s for the location specified.
If called in the context of rendering a BambooActionSupport
action the context used is taken from BambooActionSupport.getWebPanelContext(String)
location
- public Collection<String> getWebPanels(@NotNull String location, @NotNull Map<String,Object> context)
public FeatureManager getFeatureManager()
public DarkFeatureService getDarkFeatureService()
public DocumentationLinkProvider getHelpLink()
public StorageCappingService getStorageCappingService()
@Nullable public String getRssLink(@NotNull ImmutablePlan plan)
public BootstrapManager getBootstrapManager()
@Nullable public String getXsrfToken()
getXsrfToken
in interface BareFreeMarkerContext
public boolean isXsrfTokenNeeded(@Nullable String formActionDestination)
isXsrfTokenNeeded
in interface BareFreeMarkerContext
public boolean hasLinkedDeployments(@Nullable PlanKey planKey)
public boolean isFunctionalTest()
public boolean hasComments(@NotNull BambooIdProvider entity)
public boolean isShowAdminContactDetailsToAnonymousUsers()
public NotificationManager getNotificationManager()
public boolean isBambooSpecsFailure(@Nullable ImmutableResultsSummary buildResult)
public boolean isBambooSpecsSuccess(@Nullable ImmutableResultsSummary buildResult)
Copyright © 2018 Atlassian Software Systems Pty Ltd. All rights reserved.