public class StashWebRepositoryViewer extends AbstractWebRepositoryViewer implements DeploymentsAwareCommitUrlProvider
Modifier and Type | Field and Description |
---|---|
static String |
PLUGIN_KEY |
moduleDescriptor, templateRenderer
SELECTED_WEB_REPOSITORY_VIEWER, WEB_REPOSITORY
Constructor and Description |
---|
StashWebRepositoryViewer() |
Modifier and Type | Method and Description |
---|---|
String |
getHtmlForCommitsFull(ResultsSummary resultsSummary,
RepositoryChangeset repositoryChangeset,
RepositoryData repositoryData)
Renders the html to display the full commits on the changes tab.
|
String |
getHtmlForCommitsSummary(ResultsSummary resultsSummary,
RepositoryChangeset repositoryChangeset,
RepositoryData repositoryData,
int maxChanges)
Renders the html to display a summary of the commits on the Build Results Summary tab.
|
String |
getStashUrlForFile(CommitFile file,
RepositoryData repositoryData)
Generate the link to a given file in the selected stash repository
|
String |
getStashUrlForFileAtItsRevision(CommitFile file,
RepositoryData repositoryData)
Generate the link to a given file in the selected stash repository at the revision pointed by the commit
|
String |
getStashUrlForFileDiff(CommitFile file,
RepositoryData repositoryData)
Generate the link to a diff between given file and its direct ancestor
|
Collection<String> |
getSupportedRepositories()
The keys for the
Repository classes that the web viewer currently supports. |
String |
getWebRepositoryUrlForCommit(Commit commit,
RepositoryData repositoryData)
Provide the url to link to the given commit in the web repository
|
Map<Commit,String> |
getWebRepositoryUrlForCommits(Collection<Commit> commits,
RepositoryData repositoryDefinition)
Provide the urls to link all the given commits in the web repository
|
Map<DeploymentVersionVcsCommit,String> |
getWebRepositoryUrlForDeploymentVersionCommits(Collection<DeploymentVersionVcsCommit> commits,
RepositoryData repositoryData)
Provide the urls to link all the given commits in the web repository
|
String |
getWebRepositoryUrlForRevision(String revisionId,
RepositoryData repositoryData)
Provide the url to link to the given revision in the web repository
|
void |
init(com.atlassian.plugin.ModuleDescriptor moduleDescriptor)
Initialises the Plugin with the plugin module descriptor
|
ErrorCollection |
validate(BuildConfiguration buildConfiguration)
Validates the properties in the
BuildConfiguration object. |
getKey, getName, getShortKey, populateFromConfig, populateFromParams, toConfiguration
customizeBuildRequirements, removeBuildRequirements
addDefaultValues, getEditHtml, getViewHtml, populateContextForEdit, populateContextForView, prepareConfigObject, setTemplateRenderer
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getKey, getName, getShortKey, populateFromParams
customizeBuildRequirements, removeBuildRequirements
addDefaultValues, isConfigurationMissing, prepareConfigObject
getEditHtml, getViewHtml
populateFromConfig, toConfiguration
public static final String PLUGIN_KEY
public void init(@NotNull com.atlassian.plugin.ModuleDescriptor moduleDescriptor)
InitablePluginModule
init
in interface InitablePluginModule
init
in class BaseBuildConfigurationAwarePlugin
moduleDescriptor
- Plugin module descriptor@NotNull public Collection<String> getSupportedRepositories()
WebRepositoryViewer
Repository
classes that the web viewer currently supports.
If list is empty or null it assumes support for all repositories.getSupportedRepositories
in interface WebRepositoryViewer
getSupportedRepositories
in class AbstractWebRepositoryViewer
public String getHtmlForCommitsFull(@NotNull ResultsSummary resultsSummary, @NotNull RepositoryChangeset repositoryChangeset, @NotNull RepositoryData repositoryData)
WebRepositoryViewer
getHtmlForCommitsFull
in interface WebRepositoryViewer
resultsSummary
- the summary to show commits forrepositoryData
- the commits belong to aka the plans repositorypublic String getHtmlForCommitsSummary(@NotNull ResultsSummary resultsSummary, @NotNull RepositoryChangeset repositoryChangeset, @NotNull RepositoryData repositoryData, int maxChanges)
WebRepositoryViewer
getHtmlForCommitsSummary
in interface WebRepositoryViewer
resultsSummary
- the summary to show commits forrepositoryData
- the commits belong to aka the plans repositorymaxChanges
- maximum number of commits to be shown. Negative value means that all commits should be shown.@NotNull public ErrorCollection validate(@NotNull BuildConfiguration buildConfiguration)
BuildConfigurationAwarePlugin
BuildConfiguration
object. The name of the properties match those passed
in through the form fragments in RenderableBuildConfiguration.getEditHtml(com.atlassian.bamboo.ww2.actions.build.admin.create.BuildConfiguration, com.atlassian.bamboo.plan.Plan)
template.validate
in interface BuildConfigurationAwarePlugin
validate
in class BaseBuildConfigurationAwarePlugin
buildConfiguration
- -ErrorCollection
keyed by the field name.@Nullable public String getWebRepositoryUrlForCommit(Commit commit, @NotNull RepositoryData repositoryData)
CommitUrlProvider
getWebRepositoryUrlForCommit
in interface CommitUrlProvider
commit
- the commit to links torepositoryData
- the repository type the commit came from@Nullable public String getWebRepositoryUrlForRevision(String revisionId, @NotNull RepositoryData repositoryData)
CommitUrlProvider
getWebRepositoryUrlForRevision
in interface CommitUrlProvider
revisionId
- the revision to links torepositoryData
- the repository type the commit came frompublic Map<Commit,String> getWebRepositoryUrlForCommits(Collection<Commit> commits, RepositoryData repositoryDefinition)
CommitUrlProvider
getWebRepositoryUrlForCommits
in interface CommitUrlProvider
commits
- to generate links forrepositoryDefinition
- the repository type the commit came frompublic Map<DeploymentVersionVcsCommit,String> getWebRepositoryUrlForDeploymentVersionCommits(Collection<DeploymentVersionVcsCommit> commits, RepositoryData repositoryData)
DeploymentsAwareCommitUrlProvider
getWebRepositoryUrlForDeploymentVersionCommits
in interface DeploymentsAwareCommitUrlProvider
commits
- to generate links forrepositoryData
- the repository the commit came from@Nullable public String getStashUrlForFile(@NotNull CommitFile file, RepositoryData repositoryData)
file
- The file we want to link to.repositoryData
- For the build (and hense the repository file belongs to).@Nullable public String getStashUrlForFileAtItsRevision(@NotNull CommitFile file, RepositoryData repositoryData)
file
- The file we want to link to. It should contain the revision we want to link to.repositoryData
- For the build (and hense the repository file belongs to).@Nullable public String getStashUrlForFileDiff(@NotNull CommitFile file, RepositoryData repositoryData)
file
- The file we want to link to.repositoryData
- For the build (and hense the repository file belongs to).Copyright © 2019 Atlassian Software Systems Pty Ltd. All rights reserved.