com.atlassian.bamboo.webrepository
Class DefaultWebRepositoryViewer

java.lang.Object
  extended by com.atlassian.bamboo.v2.build.BaseConfigurablePlugin
      extended by com.atlassian.bamboo.webrepository.AbstractWebRepositoryViewer
          extended by com.atlassian.bamboo.webrepository.DefaultWebRepositoryViewer
All Implemented Interfaces:
ConvertibleFromConfig, InitablePluginModule, BambooPluginModule, ConfigurablePlugin, CommitUrlProvider, WebRepositoryViewer, java.io.Serializable

public class DefaultWebRepositoryViewer
extends AbstractWebRepositoryViewer
implements CommitUrlProvider

The code to show the commits etc when no web repository

See Also:
Serialized Form

Field Summary
static java.lang.String WEB_REPOSITORY_NAME
           
static java.lang.String WEB_REPOSITORY_URL
           
 
Fields inherited from class com.atlassian.bamboo.v2.build.BaseConfigurablePlugin
moduleDescriptor, templateRenderer
 
Fields inherited from interface com.atlassian.bamboo.webrepository.WebRepositoryViewer
SELECTED_WEB_REPOSITORY_VIEWER
 
Constructor Summary
DefaultWebRepositoryViewer()
           
 
Method Summary
 java.lang.String getHtmlForCommitsFull(ExtendedBuildResultsSummary buildResultsSummary, Repository repository)
          Renders the html to display the full commits on the changes tab.
 java.lang.String getHtmlForCommitsSummary(ExtendedBuildResultsSummary buildResultsSummary, Repository repository)
          Renders the html to display a summary of the commits on the Build Results Summary tab.
 java.util.Collection<java.lang.String> getSupportedRepositories()
          The keys for the Repository classes that the web viewer currently supports.
 java.lang.String getWebRepositoryName()
           
 java.lang.String getWebRepositoryUrl()
           
 java.lang.String getWebRepositoryUrlForCommit(Commit commit, Repository repository)
          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, Repository repository)
           
 java.lang.String getWebRepositoryUrlForDiff(CommitFile file, Repository repository)
           
 java.lang.String getWebRepositoryUrlForFile(CommitFile file, Repository repository)
          Generate the link to a given file in a given repository
 java.lang.String getWebRepositoryUrlForRevision(CommitFile file, Repository repository)
           
 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
 void setVariableSubstitutionBean(VariableSubstitutionBean variableSubstitutionBean)
           
 void setWebRepositoryName(java.lang.String webRepositoryName)
           
 void setWebRepositoryUrl(java.lang.String webRepositoryUrl)
           
 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
addDefaultValues, customizeBuildRequirements, getEditHtml, getViewHtml, init, populateContextForEdit, populateContextForView, prepareConfigObject, removeBuildRequirements, 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
addDefaultValues, customizeBuildRequirements, getEditHtml, getViewHtml, prepareConfigObject, removeBuildRequirements
 
Methods inherited from interface com.atlassian.bamboo.plugin.InitablePluginModule
init
 

Field Detail

WEB_REPOSITORY_URL

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

WEB_REPOSITORY_NAME

public static final java.lang.String WEB_REPOSITORY_NAME
See Also:
Constant Field Values
Constructor Detail

DefaultWebRepositoryViewer

public DefaultWebRepositoryViewer()
Method Detail

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.

getHtmlForCommitsFull

public java.lang.String getHtmlForCommitsFull(@NotNull
                                              ExtendedBuildResultsSummary buildResultsSummary,
                                              Repository repository)
Description copied from interface: WebRepositoryViewer
Renders the html to display the full commits on the changes tab.

Specified by:
getHtmlForCommitsFull in interface WebRepositoryViewer
Parameters:
buildResultsSummary - the summary to show commits for
repository - 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
                                                 ExtendedBuildResultsSummary buildResultsSummary,
                                                 Repository repository)
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:
buildResultsSummary - the summary to show commits for
repository - the commits belong to aka the plans repository
Returns:
Html to displayed on the UI in the Build Results Summary Tab.

populateFromParams

public void populateFromParams(@NotNull
                               ActionParametersMap params)
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: ConfigurablePlugin
Validates the properties in the BuildConfiguration object. The name of the properties match those passed in through the form fragments in ConfigurablePlugin.getEditHtml(com.atlassian.bamboo.ww2.actions.build.admin.create.BuildConfiguration, com.atlassian.bamboo.plan.Plan) template.

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

getWebRepositoryUrlForFile

@Nullable
public java.lang.String getWebRepositoryUrlForFile(@NotNull
                                                            CommitFile file,
                                                            Repository repository)
Generate the link to a given file in a given repository

Parameters:
file - The file we want to link to.
repository - For the build (and hense the repository file belongs to).
Returns:
The url

getWebRepositoryUrlForRevision

@Nullable
public java.lang.String getWebRepositoryUrlForRevision(CommitFile file,
                                                                Repository repository)

getWebRepositoryUrlForDiff

@Nullable
public java.lang.String getWebRepositoryUrlForDiff(CommitFile file,
                                                            Repository repository)

getWebRepositoryUrlForCommits

public java.util.Map<Commit,java.lang.String> getWebRepositoryUrlForCommits(java.util.Collection<Commit> commits,
                                                                            Repository repository)

getWebRepositoryUrlForCommit

@Nullable
public java.lang.String getWebRepositoryUrlForCommit(Commit commit,
                                                              Repository repository)
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
repository - the repository type the commit came from
Returns:
a full url string.

getWebRepositoryUrl

public java.lang.String getWebRepositoryUrl()

setWebRepositoryUrl

public void setWebRepositoryUrl(java.lang.String webRepositoryUrl)

getWebRepositoryName

public java.lang.String getWebRepositoryName()

setWebRepositoryName

public void setWebRepositoryName(java.lang.String webRepositoryName)

setVariableSubstitutionBean

public void setVariableSubstitutionBean(VariableSubstitutionBean variableSubstitutionBean)


Copyright © 2010 Atlassian. All Rights Reserved.