public class FreemarkerContext extends Object implements BareFreeMarkerContext
Modifier and Type | Class and Description |
---|---|
static class |
FreemarkerContext.WebItemDto |
static class |
FreemarkerContext.WebSectionDto |
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,
ServerStatusProvider serverStatusProvider,
StorageCappingService storageCappingService,
VcsRepositoryViewerManager vcsRepositoryViewerManager,
com.atlassian.plugin.web.api.DynamicWebInterfaceManager webInterfaceManager,
com.atlassian.plugin.webresource.WebResourceIntegration webResourceIntegration,
SystemInfo systemInfo,
com.atlassian.plugin.webresource.WebResourceUrlProvider webResourceUrlProvider,
CustomVariableContext customVariableContext) |
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() |
List<com.atlassian.plugin.web.api.WebItem> |
getDynamicWebItemsForSectionNoAction(String sectionName,
javax.servlet.http.HttpServletRequest request)
Obtain a list of web items within the provided location.
|
List<com.atlassian.plugin.web.api.WebSection> |
getDynamicWebSectionsForLocationNoAction(String location,
javax.servlet.http.HttpServletRequest request)
Obtain a list of web sections within the provided location.
|
String |
getFaviconPath() |
FeatureManager |
getFeatureManager() |
String |
getGravatarUrl(String userName,
String size) |
DocumentationLinkProvider |
getHelpLink() |
String |
getInstanceName() |
String |
getLogoPath() |
NotificationManager |
getNotificationManager() |
PluggableFooter |
getPluggableFooter()
Gets the pluggable footer plugin.
|
PluggableTopNavigation |
getPluggableTopNavigation()
Gets the pluggable top navigation plugin.
|
int |
getRemainingJobsLimit() |
String |
getRssLink(DeploymentProject project) |
String |
getRssLink(ImmutablePlan plan) |
String |
getRssRepositoryId(DeploymentProject project) |
String |
getRssRepositoryId(ImmutablePlan plan) |
ServerLifecycleState |
getServerLifecycleState() |
ServerStatusInfo |
getServerStatusInfo() |
StorageCappingService |
getStorageCappingService() |
String |
getSystemEncoding() |
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)
Deprecated.
|
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)
Deprecated.
|
List<FreemarkerContext.WebSectionDto> |
getWebSectionsWithItems(String location,
javax.servlet.http.HttpServletRequest request,
String pageCrumb)
Return a DTO storing all web sections for the given
location together with a list of all web items
under each web section. |
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 |
isAwaitingSpecsExecution(ImmutablePlan plan) |
boolean |
isBambooSpecsFailure(ImmutableResultsSummary buildResult) |
boolean |
isBambooSpecsResult(ImmutableResultsSummary buildResult) |
boolean |
isBambooSpecsSuccess(ImmutableResultsSummary buildResult) |
boolean |
isEc2ConfigurationWarningRequired() |
boolean |
isEnableSignup() |
boolean |
isFavourite(ImmutablePlan plan,
javax.servlet.http.HttpServletRequest request) |
boolean |
isFunctionalTest() |
boolean |
isOnDemandInstance() |
boolean |
isRepositoryDashboardOn() |
boolean |
isRssManagedPlan(ImmutablePlan plan) |
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
|
String |
sanitizeUrl(String url) |
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, ServerStatusProvider serverStatusProvider, StorageCappingService storageCappingService, VcsRepositoryViewerManager vcsRepositoryViewerManager, com.atlassian.plugin.web.api.DynamicWebInterfaceManager webInterfaceManager, com.atlassian.plugin.webresource.WebResourceIntegration webResourceIntegration, SystemInfo systemInfo, com.atlassian.plugin.webresource.WebResourceUrlProvider webResourceUrlProvider, CustomVariableContext customVariableContext)
@NotNull public String getInstanceName()
@Nullable public String getLogoPath()
@Nullable public String getFaviconPath()
@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
- @Deprecated public List<com.atlassian.plugin.web.descriptors.WebItemModuleDescriptor> getWebItemsForSectionNoAction(String sectionName, javax.servlet.http.HttpServletRequest request)
getDynamicWebItemsForSectionNoAction(String, HttpServletRequest)
sectionName
- - the section to retrieve the web items forrequest
- - the http requestpublic List<com.atlassian.plugin.web.api.WebItem> getDynamicWebItemsForSectionNoAction(String sectionName, javax.servlet.http.HttpServletRequest request)
WebItem
,
WebItemProvider
,
DynamicWebInterfaceManager
@NotNull public List<Map<String,Object>> getWebItems(String sectionName, javax.servlet.http.HttpServletRequest request)
sectionName
- request
- @Deprecated public List<com.atlassian.plugin.web.descriptors.WebSectionModuleDescriptor> getWebSectionsForLocationNoAction(String location, javax.servlet.http.HttpServletRequest request)
getDynamicWebSectionsForLocationNoAction(String, HttpServletRequest)
location
- - the location to retrieve the web sections forrequest
- - the http requestpublic List<com.atlassian.plugin.web.api.WebSection> getDynamicWebSectionsForLocationNoAction(String location, javax.servlet.http.HttpServletRequest request)
WebSection
,
WebSectionProvider
,
DynamicWebInterfaceManager
public List<FreemarkerContext.WebSectionDto> getWebSectionsWithItems(@NotNull String location, @NotNull javax.servlet.http.HttpServletRequest request, @NotNull String pageCrumb)
location
together with a list of all web items
under each web section.
Based on the pageCrumb
the result will also contain information whether a web section or a web item is
currently active or not.
This method supports dynamically generated web sections and web items (produced by web section providers and web item providers, respectively).
public 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)
@Nullable public String getRssRepositoryId(@NotNull ImmutablePlan plan)
@Nullable public String getRssLink(@NotNull DeploymentProject project)
@Nullable public String getRssRepositoryId(@NotNull DeploymentProject project)
public boolean isRssManagedPlan(@Nullable ImmutablePlan plan)
@NotNull public String getSystemEncoding()
public boolean isRepositoryDashboardOn()
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)
public boolean isBambooSpecsResult(@Nullable ImmutableResultsSummary buildResult)
public boolean isAwaitingSpecsExecution(@Nullable ImmutablePlan plan)
Copyright © 2021 Atlassian Software Systems Pty Ltd. All rights reserved.