com.atlassian.bamboo.v2.build
Class BaseBuildConfigurationAwarePlugin

java.lang.Object
  extended by com.atlassian.bamboo.v2.build.BaseBuildConfigurationAwarePlugin
All Implemented Interfaces:
InitablePluginModule, BambooPluginModule, BuildConfigurationAwarePlugin, RenderableBuildConfiguration
Direct Known Subclasses:
BaseConfigurablePlugin, ConcurrentBuildsPlanConfigurationPlugin, PlansGreenCondition

public class BaseBuildConfigurationAwarePlugin
extends java.lang.Object
implements BuildConfigurationAwarePlugin


Field Summary
protected  com.atlassian.plugin.ModuleDescriptor moduleDescriptor
           
protected  TemplateRenderer templateRenderer
           
 
Constructor Summary
BaseBuildConfigurationAwarePlugin()
           
 
Method Summary
 void addDefaultValues(BuildConfiguration buildConfiguration)
          Extension point for adding default values to the form for RenderableBuildConfiguration.getEditHtml(com.atlassian.bamboo.ww2.actions.build.admin.create.BuildConfiguration, com.atlassian.bamboo.plan.Plan)
 java.lang.String getEditHtml(BuildConfiguration buildConfiguration, Plan plan)
          Returns HTML that represents the form fragment for editing the repository.
 java.lang.String getViewHtml(Plan plan)
          Returns the HTML that represents the view of the repository configuration
 void init(com.atlassian.plugin.ModuleDescriptor moduleDescriptor)
          Initialises the Plugin with the plugin module descriptor
 boolean isConfigurationMissing(BuildConfiguration buildConfiguration)
          By default we assume that empty values in BuildConfiguration are ok
protected  void populateContextForEdit(java.util.Map<java.lang.String,java.lang.Object> context, BuildConfiguration buildConfiguration, Plan plan)
           
protected  void populateContextForView(java.util.Map<java.lang.String,java.lang.Object> context, Plan plan)
           
 void prepareConfigObject(BuildConfiguration buildConfiguration)
          Do any preprocessing work before validation occurs.
 void setTemplateRenderer(TemplateRenderer templateRenderer)
           
 ErrorCollection validate(BuildConfiguration buildConfiguration)
          Validates the properties in the BuildConfiguration object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

templateRenderer

protected TemplateRenderer templateRenderer

moduleDescriptor

protected com.atlassian.plugin.ModuleDescriptor moduleDescriptor
Constructor Detail

BaseBuildConfigurationAwarePlugin

public BaseBuildConfigurationAwarePlugin()
Method Detail

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
Parameters:
moduleDescriptor - Plugin module descriptor

isConfigurationMissing

public boolean isConfigurationMissing(@NotNull
                                      BuildConfiguration buildConfiguration)
By default we assume that empty values in BuildConfiguration are ok

Parameters:
buildConfiguration -
Returns:
always false

addDefaultValues

public void addDefaultValues(@NotNull
                             BuildConfiguration buildConfiguration)
Description copied from interface: BuildConfigurationAwarePlugin
Extension point for adding default values to the form for RenderableBuildConfiguration.getEditHtml(com.atlassian.bamboo.ww2.actions.build.admin.create.BuildConfiguration, com.atlassian.bamboo.plan.Plan)

Specified by:
addDefaultValues in interface BuildConfigurationAwarePlugin
Parameters:
buildConfiguration - - @NotNull

prepareConfigObject

public void prepareConfigObject(@NotNull
                                BuildConfiguration buildConfiguration)
Description copied from interface: BuildConfigurationAwarePlugin
Do any preprocessing work before validation occurs. For repository, builder and web repository plugins this will only be called if the plugin is select by the user.

Specified by:
prepareConfigObject in interface BuildConfigurationAwarePlugin
Parameters:
buildConfiguration - - @NotNull

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
Parameters:
buildConfiguration - - @NotNull
Returns:
ErrorCollection keyed by the field name. @NotNull

getViewHtml

@Nullable
public java.lang.String getViewHtml(@NotNull
                                             Plan plan)
Description copied from interface: RenderableBuildConfiguration
Returns the HTML that represents the view of the repository configuration

Specified by:
getViewHtml in interface RenderableBuildConfiguration
Returns:
HTML string. May be null.

populateContextForView

protected void populateContextForView(@NotNull
                                      java.util.Map<java.lang.String,java.lang.Object> context,
                                      @NotNull
                                      Plan plan)

getEditHtml

@Nullable
public java.lang.String getEditHtml(@NotNull
                                             BuildConfiguration buildConfiguration,
                                             @NotNull
                                             Plan plan)
Description copied from interface: RenderableBuildConfiguration
Returns HTML that represents the form fragment for editing the repository. No opening and closing form tags are required.

Specified by:
getEditHtml in interface RenderableBuildConfiguration
Parameters:
buildConfiguration - BuildConfiguration for which edit HTML has to be rendered.
plan - Plan for which edit HTML has to be rendered. May be null during creation phase of plan.
Returns:
HTML string. May be null.

populateContextForEdit

protected void populateContextForEdit(@NotNull
                                      java.util.Map<java.lang.String,java.lang.Object> context,
                                      @NotNull
                                      BuildConfiguration buildConfiguration,
                                      @NotNull
                                      Plan plan)

setTemplateRenderer

public void setTemplateRenderer(TemplateRenderer templateRenderer)


Copyright © 2011 Atlassian. All Rights Reserved.