com.atlassian.bamboo.plugins.hg
Class HgWebRepositoryViewer

java.lang.Object
  extended by com.atlassian.bamboo.v2.build.BaseBuildConfigurationAwarePlugin
      extended by com.atlassian.bamboo.v2.build.BaseConfigurablePlugin
          extended by com.atlassian.bamboo.webrepository.AbstractWebRepositoryViewer
              extended by com.atlassian.bamboo.plugins.hg.HgWebRepositoryViewer
All Implemented Interfaces:
ConvertibleFromConfig, InitablePluginModule, BambooPluginModule, BuildConfigurationAwarePlugin, ConfigurablePlugin, RenderableBuildConfiguration, CommitUrlProvider, WebRepositoryViewer, java.io.Serializable

public class HgWebRepositoryViewer
extends AbstractWebRepositoryViewer
implements CommitUrlProvider

See Also:
Serialized Form

Field Summary
static java.util.Map<java.lang.String,HgWebRepositoryUrlProvider> urlProviders
           
static java.lang.String WEB_REPOSITORY_SCHEME
           
 
Fields inherited from class com.atlassian.bamboo.v2.build.BaseBuildConfigurationAwarePlugin
moduleDescriptor, templateRenderer
 
Fields inherited from interface com.atlassian.bamboo.webrepository.WebRepositoryViewer
SELECTED_WEB_REPOSITORY_VIEWER, WEB_REPOSITORY
 
Constructor Summary
HgWebRepositoryViewer()
           
 
Method Summary
 java.lang.String getHtmlForCommitsFull(ResultsSummary resultsSummary, RepositoryChangeset repositoryChangeset, RepositoryData repositoryData)
          Renders the html to display the full commits on the changes tab.
 java.lang.String getHtmlForCommitsFull(ResultsSummary resultsSummary, RepositoryChangeset repositoryChangeset, RepositoryDefinition repositoryData)
          Renders the html to display the full commits on the changes tab.
 java.lang.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.
 java.lang.String getHtmlForCommitsSummary(ResultsSummary resultsSummary, RepositoryChangeset repositoryChangeset, RepositoryDefinition repositoryData)
          Renders the html to display a summary of the commits on the Build Results Summary tab.
 java.lang.String getHtmlForCommitsSummary(ResultsSummary resultsSummary, RepositoryChangeset repositoryChangeset, RepositoryDefinition repositoryData, int maxChanges)
          Renders the html to display a summary of the commits on the Build Results Summary tab.
 java.lang.String getSchemeName()
           
 java.util.Collection<HgWebRepositoryUrlProvider> getSchemeTypes()
           
 java.util.Collection<java.lang.String> getSupportedRepositories()
          The keys for the Repository classes that the web viewer currently supports.
 java.lang.String getWebRepositoryUrlForCommit(Commit commit, RepositoryData repositoryData)
          Provide the url to link to the given commit in the web repository
 java.util.Map<Commit,java.lang.String> getWebRepositoryUrlForCommits(java.util.Collection<Commit> commits, RepositoryData repositoryData)
          Used in defaultCommitSummaryView.ftl
 java.lang.String getWebRepositoryUrlForDiff(CommitFile file, RepositoryData repositoryData)
          Used in defaultCommitView.ftl
 java.lang.String getWebRepositoryUrlForFile(CommitFile file, RepositoryData repositoryData)
          Used in defaultCommitView.ftl
 java.lang.String getWebRepositoryUrlForRevision(CommitFile file, RepositoryData repositoryData)
          Used in defaultCommitView.ftl
 java.lang.String getWebRepositoryUrlForRevision(java.lang.String revisionId, RepositoryData repositoryDefinition)
          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
 void populateFromConfig(org.apache.commons.configuration.HierarchicalConfiguration config)
          Update the current object with data in the HierarchicalConfiguration
 void populateFromParams(ActionParametersMap params)
          takes the map of config data from action and extracts the parameters it needs
 org.apache.commons.configuration.HierarchicalConfiguration toConfiguration()
          Generate a HierarchicalConfiguration from the current state of the object
 ErrorCollection validate(BuildConfiguration buildConfiguration)
          Validates the properties in the BuildConfiguration object.
 
Methods inherited from class com.atlassian.bamboo.webrepository.AbstractWebRepositoryViewer
getKey, getName, getShortKey
 
Methods inherited from class com.atlassian.bamboo.v2.build.BaseConfigurablePlugin
customizeBuildRequirements, customizeBuildRequirements, removeBuildRequirements, removeBuildRequirements
 
Methods inherited from class com.atlassian.bamboo.v2.build.BaseBuildConfigurationAwarePlugin
addDefaultValues, getEditHtml, getViewHtml, isConfigurationMissing, populateContextForEdit, populateContextForView, prepareConfigObject, setTemplateRenderer
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.atlassian.bamboo.webrepository.WebRepositoryViewer
getKey, getName, getShortKey
 
Methods inherited from interface com.atlassian.bamboo.v2.build.ConfigurablePlugin
customizeBuildRequirements, removeBuildRequirements
 
Methods inherited from interface com.atlassian.bamboo.v2.build.BuildConfigurationAwarePlugin
addDefaultValues, prepareConfigObject
 
Methods inherited from interface com.atlassian.bamboo.v2.build.RenderableBuildConfiguration
getEditHtml, getViewHtml
 

Field Detail

WEB_REPOSITORY_SCHEME

public static final java.lang.String WEB_REPOSITORY_SCHEME
See Also:
Constant Field Values

urlProviders

public static final java.util.Map<java.lang.String,HgWebRepositoryUrlProvider> urlProviders
Constructor Detail

HgWebRepositoryViewer

public HgWebRepositoryViewer()
Method Detail

getSchemeTypes

public java.util.Collection<HgWebRepositoryUrlProvider> getSchemeTypes()

init

public void init(@NotNull
                 com.atlassian.plugin.ModuleDescriptor moduleDescriptor)
Description copied from interface: InitablePluginModule
Initialises the Plugin with the plugin module descriptor

Specified by:
init in interface InitablePluginModule
Overrides:
init in class BaseBuildConfigurationAwarePlugin
Parameters:
moduleDescriptor - Plugin module descriptor

getSupportedRepositories

@NotNull
public java.util.Collection<java.lang.String> getSupportedRepositories()
Description copied from interface: WebRepositoryViewer
The keys for the Repository classes that the web viewer currently supports. If list is empty or null it assumes support for all repositories.

Specified by:
getSupportedRepositories in interface WebRepositoryViewer
Overrides:
getSupportedRepositories in class AbstractWebRepositoryViewer
Returns:
a list of repositories which can be rendered by this WebRepositoryViewer.

getWebRepositoryUrlForCommit

public java.lang.String getWebRepositoryUrlForCommit(Commit commit,
                                                     @NotNull
                                                     RepositoryData repositoryData)
Description copied from interface: CommitUrlProvider
Provide the url to link to the given commit in the web repository

Specified by:
getWebRepositoryUrlForCommit in interface CommitUrlProvider
Parameters:
commit - the commit to links to
repositoryData - the repository type the commit came from
Returns:
a full url string.

getWebRepositoryUrlForRevision

public java.lang.String getWebRepositoryUrlForRevision(java.lang.String revisionId,
                                                       @NotNull
                                                       RepositoryData repositoryDefinition)
Description copied from interface: CommitUrlProvider
Provide the url to link to the given revision in the web repository

Specified by:
getWebRepositoryUrlForRevision in interface CommitUrlProvider
Parameters:
revisionId - the revision to links to
repositoryDefinition - the repository type the commit came from
Returns:
a full url string.

getHtmlForCommitsFull

public java.lang.String getHtmlForCommitsFull(@NotNull
                                              ResultsSummary resultsSummary,
                                              @NotNull
                                              RepositoryChangeset repositoryChangeset,
                                              @NotNull
                                              RepositoryData repositoryData)
Description copied from interface: WebRepositoryViewer
Renders the html to display the full commits on the changes tab.

Specified by:
getHtmlForCommitsFull in interface WebRepositoryViewer
Overrides:
getHtmlForCommitsFull in class AbstractWebRepositoryViewer
Parameters:
resultsSummary - the summary to show commits for
repositoryData - the commits belong to aka the plans repository
Returns:
Html to be displayed on the UI in the Changes Tab.

getHtmlForCommitsSummary

public java.lang.String getHtmlForCommitsSummary(@NotNull
                                                 ResultsSummary resultsSummary,
                                                 @NotNull
                                                 RepositoryChangeset repositoryChangeset,
                                                 @NotNull
                                                 RepositoryDefinition repositoryData)
Description copied from interface: WebRepositoryViewer
Renders the html to display a summary of the commits on the Build Results Summary tab.

Specified by:
getHtmlForCommitsSummary in interface WebRepositoryViewer
Parameters:
resultsSummary - the summary to show commits for
Returns:
Html to displayed on the UI in the Build Results Summary Tab.

getHtmlForCommitsFull

public java.lang.String getHtmlForCommitsFull(@NotNull
                                              ResultsSummary resultsSummary,
                                              @NotNull
                                              RepositoryChangeset repositoryChangeset,
                                              @NotNull
                                              RepositoryDefinition repositoryData)
Description copied from interface: WebRepositoryViewer
Renders the html to display the full commits on the changes tab.

Specified by:
getHtmlForCommitsFull in interface WebRepositoryViewer
Parameters:
resultsSummary - the summary to show commits for
repositoryData - the commits belong to aka the plans repository
Returns:
Html to be displayed on the UI in the Changes Tab.

getHtmlForCommitsSummary

public java.lang.String getHtmlForCommitsSummary(@NotNull
                                                 ResultsSummary resultsSummary,
                                                 @NotNull
                                                 RepositoryChangeset repositoryChangeset,
                                                 @NotNull
                                                 RepositoryDefinition repositoryData,
                                                 int maxChanges)
Description copied from interface: WebRepositoryViewer
Renders the html to display a summary of the commits on the Build Results Summary tab.

Specified by:
getHtmlForCommitsSummary in interface WebRepositoryViewer
Parameters:
resultsSummary - the summary to show commits for
repositoryData - the commits belong to aka the plans repository
maxChanges - 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.

getHtmlForCommitsSummary

public java.lang.String getHtmlForCommitsSummary(@NotNull
                                                 ResultsSummary resultsSummary,
                                                 @NotNull
                                                 RepositoryChangeset repositoryChangeset,
                                                 @NotNull
                                                 RepositoryData repositoryData,
                                                 int maxChanges)
Description copied from interface: WebRepositoryViewer
Renders the html to display a summary of the commits on the Build Results Summary tab.

Specified by:
getHtmlForCommitsSummary in interface WebRepositoryViewer
Overrides:
getHtmlForCommitsSummary in class AbstractWebRepositoryViewer
Parameters:
resultsSummary - the summary to show commits for
repositoryData - the commits belong to aka the plans repository
maxChanges - 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.

populateFromParams

public void populateFromParams(@NotNull
                               ActionParametersMap params)
Description copied from class: AbstractWebRepositoryViewer
takes the map of config data from action and extracts the parameters it needs

Specified by:
populateFromParams in interface WebRepositoryViewer
Overrides:
populateFromParams in class AbstractWebRepositoryViewer
Parameters:
params - map of key (String), value (String []) pairs from action

populateFromConfig

public void populateFromConfig(@NotNull
                               org.apache.commons.configuration.HierarchicalConfiguration config)
Description copied from interface: ConvertibleFromConfig
Update the current object with data in the HierarchicalConfiguration

Specified by:
populateFromConfig in interface ConvertibleFromConfig
Overrides:
populateFromConfig in class AbstractWebRepositoryViewer

toConfiguration

@NotNull
public org.apache.commons.configuration.HierarchicalConfiguration toConfiguration()
Description copied from interface: ConvertibleFromConfig
Generate a HierarchicalConfiguration from the current state of the object

Specified by:
toConfiguration in interface ConvertibleFromConfig
Overrides:
toConfiguration in class AbstractWebRepositoryViewer
Returns:
Always returns an HierarchicalConfiguration. Never null

validate

@NotNull
public ErrorCollection validate(@NotNull
                                        BuildConfiguration buildConfiguration)
Description copied from interface: BuildConfigurationAwarePlugin
Validates the properties in the 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.

Specified by:
validate in interface BuildConfigurationAwarePlugin
Overrides:
validate in class BaseBuildConfigurationAwarePlugin
Parameters:
buildConfiguration - - @NotNull
Returns:
ErrorCollection keyed by the field name. @NotNull

getWebRepositoryUrlForFile

public java.lang.String getWebRepositoryUrlForFile(@NotNull
                                                   CommitFile file,
                                                   RepositoryData repositoryData)
Used in defaultCommitView.ftl


getWebRepositoryUrlForRevision

public java.lang.String getWebRepositoryUrlForRevision(CommitFile file,
                                                       RepositoryData repositoryData)
Used in defaultCommitView.ftl


getWebRepositoryUrlForDiff

public java.lang.String getWebRepositoryUrlForDiff(CommitFile file,
                                                   RepositoryData repositoryData)
Used in defaultCommitView.ftl


getWebRepositoryUrlForCommits

public java.util.Map<Commit,java.lang.String> getWebRepositoryUrlForCommits(java.util.Collection<Commit> commits,
                                                                            RepositoryData repositoryData)
Used in defaultCommitSummaryView.ftl


getSchemeName

public java.lang.String getSchemeName()


Copyright © 2012 Atlassian. All Rights Reserved.