Class StashWebRepositoryViewer
java.lang.Object
com.atlassian.bamboo.v2.build.BaseBuildConfigurationAwarePlugin
com.atlassian.bamboo.v2.build.BaseConfigurablePlugin
com.atlassian.bamboo.webrepository.AbstractWebRepositoryViewer
com.atlassian.bamboo.plugins.stash.StashWebRepositoryViewer
- All Implemented Interfaces:
ConvertibleFromConfig,InitablePluginModule,BambooPluginModule,BuildConfigurationAwarePlugin,ConfigurablePlugin,RenderableBuildConfiguration,CommitUrlProvider,DeploymentsAwareCommitUrlProvider,WebRepositoryViewer,Serializable
public class StashWebRepositoryViewer
extends AbstractWebRepositoryViewer
implements DeploymentsAwareCommitUrlProvider
URL FORMATS:
file
https://caviardog.atlassian.com/caviar/projects/STASH/repos/stash/browse/webapp/default/src/main/webapp/static/page/repository/editRepository.soy?at=8127e6af149297ae95219c3b0a202a84d9a20b33
revision/changeset
https://caviardog.atlassian.com/caviar/projects/STASH/repos/stash/commits/8127e6af149297ae95219c3b0a202a84d9a20b33
diff
https://caviardog.atlassian.com/caviar/projects/STASH/repos/stash/diff/webapp/default/src/main/webapp/static/page/repository/editRepository.soy?at=8127e6af149297ae95219c3b0a202a84d9a20b33&until=8127e6af149297ae95219c3b0a202a84d9a20b33
- See Also:
-
Field Summary
FieldsFields inherited from class com.atlassian.bamboo.v2.build.BaseBuildConfigurationAwarePlugin
moduleDescriptor, templateRendererFields inherited from interface com.atlassian.bamboo.webrepository.WebRepositoryViewer
SELECTED_WEB_REPOSITORY_VIEWER, WEB_REPOSITORY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetHtmlForCommitsFull(@NotNull ResultsSummary resultsSummary, @NotNull RepositoryChangeset repositoryChangeset, @NotNull RepositoryData repositoryData) Renders the html to display the full commits on the changes tab.getHtmlForCommitsSummary(@NotNull ResultsSummary resultsSummary, @NotNull RepositoryChangeset repositoryChangeset, @NotNull RepositoryData repositoryData, int maxChanges) Renders the html to display a summary of the commits on the Build Results Summary tab.@Nullable StringgetStashUrlForFile(@NotNull CommitFile file, RepositoryData repositoryData) Generate the link to a given file in the selected stash repository@Nullable StringgetStashUrlForFileAtItsRevision(@NotNull CommitFile file, RepositoryData repositoryData) Generate the link to a given file in the selected stash repository at the revision pointed by the commit@Nullable StringgetStashUrlForFileDiff(@NotNull CommitFile file, RepositoryData repositoryData) Generate the link to a diff between given file and its direct ancestor@NotNull Collection<String>The keys for theRepositoryclasses that the web viewer currently supports.@Nullable StringgetWebRepositoryUrlForCommit(Commit commit, @NotNull RepositoryData repositoryData) Provide the url to link to the given commit in the web repositorygetWebRepositoryUrlForCommits(Collection<Commit> commits, RepositoryData repositoryDefinition) Provide the urls to link all the given commits in the web repositorygetWebRepositoryUrlForDeploymentVersionCommits(Collection<DeploymentVersionVcsCommit> commits, RepositoryData repositoryData) Provide the urls to link all the given commits in the web repository@Nullable StringgetWebRepositoryUrlForRevision(String revisionId, @NotNull RepositoryData repositoryData) Provide the url to link to the given revision in the web repositoryvoidinit(@NotNull com.atlassian.plugin.ModuleDescriptor moduleDescriptor) Initialises the Plugin with the plugin module descriptor@NotNull ErrorCollectionvalidate(@NotNull BuildConfiguration buildConfiguration) Validates the properties in theBuildConfigurationobject.Methods inherited from class com.atlassian.bamboo.webrepository.AbstractWebRepositoryViewer
getKey, getName, getShortKey, populateFromConfig, populateFromParams, toConfigurationMethods inherited from class com.atlassian.bamboo.v2.build.BaseConfigurablePlugin
customizeBuildRequirements, removeBuildRequirementsMethods inherited from class com.atlassian.bamboo.v2.build.BaseBuildConfigurationAwarePlugin
addDefaultValues, getEditHtml, getTemplateRenderer, getViewHtml, populateContextForEdit, populateContextForView, prepareConfigObject, setTemplateRendererMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.atlassian.bamboo.v2.build.BuildConfigurationAwarePlugin
addDefaultValues, isConfigurationMissing, prepareConfigObjectMethods inherited from interface com.atlassian.bamboo.v2.build.ConfigurablePlugin
customizeBuildRequirements, removeBuildRequirementsMethods inherited from interface com.atlassian.bamboo.fieldvalue.ConvertibleFromConfig
populateFromConfig, toConfigurationMethods inherited from interface com.atlassian.bamboo.v2.build.RenderableBuildConfiguration
getEditHtml, getViewHtmlMethods inherited from interface com.atlassian.bamboo.webrepository.WebRepositoryViewer
getKey, getName, getShortKey, populateFromParams
-
Field Details
-
PLUGIN_KEY
- See Also:
-
-
Constructor Details
-
StashWebRepositoryViewer
public StashWebRepositoryViewer()
-
-
Method Details
-
init
public void init(@NotNull @NotNull com.atlassian.plugin.ModuleDescriptor moduleDescriptor) Description copied from interface:InitablePluginModuleInitialises the Plugin with the plugin module descriptor- Specified by:
initin interfaceInitablePluginModule- Overrides:
initin classBaseBuildConfigurationAwarePlugin- Parameters:
moduleDescriptor- Plugin module descriptor
-
getSupportedRepositories
Description copied from interface:WebRepositoryViewerThe keys for theRepositoryclasses that the web viewer currently supports. If list is empty or null it assumes support for all repositories.- Specified by:
getSupportedRepositoriesin interfaceWebRepositoryViewer- Overrides:
getSupportedRepositoriesin classAbstractWebRepositoryViewer- Returns:
- a list of repositories which can be rendered by this WebRepositoryViewer.
-
getHtmlForCommitsFull
public String getHtmlForCommitsFull(@NotNull @NotNull ResultsSummary resultsSummary, @NotNull @NotNull RepositoryChangeset repositoryChangeset, @NotNull @NotNull RepositoryData repositoryData) Description copied from interface:WebRepositoryViewerRenders the html to display the full commits on the changes tab.- Specified by:
getHtmlForCommitsFullin interfaceWebRepositoryViewer- Parameters:
resultsSummary- the summary to show commits forrepositoryData- the commits belong to aka the plans repository- Returns:
- Html to be displayed on the UI in the Changes Tab.
-
getHtmlForCommitsSummary
public String getHtmlForCommitsSummary(@NotNull @NotNull ResultsSummary resultsSummary, @NotNull @NotNull RepositoryChangeset repositoryChangeset, @NotNull @NotNull RepositoryData repositoryData, int maxChanges) Description copied from interface:WebRepositoryViewerRenders the html to display a summary of the commits on the Build Results Summary tab.- Specified by:
getHtmlForCommitsSummaryin interfaceWebRepositoryViewer- Parameters:
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.- Returns:
- Html to displayed on the UI in the Build Results Summary Tab.
-
validate
@NotNull public @NotNull ErrorCollection validate(@NotNull @NotNull BuildConfiguration buildConfiguration) Description copied from interface:BuildConfigurationAwarePluginValidates the properties in theBuildConfigurationobject. The name of the properties match those passed in through the form fragments inRenderableBuildConfiguration.getEditHtml(com.atlassian.bamboo.ww2.actions.build.admin.create.BuildConfiguration, com.atlassian.bamboo.plan.Plan)template.- Specified by:
validatein interfaceBuildConfigurationAwarePlugin- Overrides:
validatein classBaseBuildConfigurationAwarePlugin- Parameters:
buildConfiguration- -- Returns:
ErrorCollectionkeyed by the field name.
-
getWebRepositoryUrlForCommit
@Nullable public @Nullable String getWebRepositoryUrlForCommit(Commit commit, @NotNull @NotNull RepositoryData repositoryData) Description copied from interface:CommitUrlProviderProvide the url to link to the given commit in the web repository- Specified by:
getWebRepositoryUrlForCommitin interfaceCommitUrlProvider- Parameters:
commit- the commit to links torepositoryData- the repository type the commit came from- Returns:
- a full url string.
-
getWebRepositoryUrlForRevision
@Nullable public @Nullable String getWebRepositoryUrlForRevision(String revisionId, @NotNull @NotNull RepositoryData repositoryData) Description copied from interface:CommitUrlProviderProvide the url to link to the given revision in the web repository- Specified by:
getWebRepositoryUrlForRevisionin interfaceCommitUrlProvider- Parameters:
revisionId- the revision to links torepositoryData- the repository type the commit came from- Returns:
- a full url string.
-
getWebRepositoryUrlForCommits
public Map<Commit,String> getWebRepositoryUrlForCommits(Collection<Commit> commits, RepositoryData repositoryDefinition) Description copied from interface:CommitUrlProviderProvide the urls to link all the given commits in the web repository- Specified by:
getWebRepositoryUrlForCommitsin interfaceCommitUrlProvider- Parameters:
commits- to generate links forrepositoryDefinition- the repository type the commit came from- Returns:
- a map of the commit to its url.
-
getWebRepositoryUrlForDeploymentVersionCommits
public Map<DeploymentVersionVcsCommit,String> getWebRepositoryUrlForDeploymentVersionCommits(Collection<DeploymentVersionVcsCommit> commits, RepositoryData repositoryData) Description copied from interface:DeploymentsAwareCommitUrlProviderProvide the urls to link all the given commits in the web repository- Specified by:
getWebRepositoryUrlForDeploymentVersionCommitsin interfaceDeploymentsAwareCommitUrlProvider- Parameters:
commits- to generate links forrepositoryData- the repository the commit came from- Returns:
- a map of the commit to its url.
-
getStashUrlForFile
@Nullable public @Nullable String getStashUrlForFile(@NotNull @NotNull CommitFile file, RepositoryData repositoryData) Generate the link to a given file in the selected stash repository- Parameters:
file- The file we want to link to.repositoryData- For the build (and hense the repository file belongs to).- Returns:
- The url
-
getStashUrlForFileAtItsRevision
@Nullable public @Nullable String getStashUrlForFileAtItsRevision(@NotNull @NotNull CommitFile file, RepositoryData repositoryData) Generate the link to a given file in the selected stash repository at the revision pointed by the commit- Parameters:
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).- Returns:
- The url
-
getStashUrlForFileDiff
@Nullable public @Nullable String getStashUrlForFileDiff(@NotNull @NotNull CommitFile file, RepositoryData repositoryData) Generate the link to a diff between given file and its direct ancestor- Parameters:
file- The file we want to link to.repositoryData- For the build (and hense the repository file belongs to).- Returns:
- The url
-