com.atlassian.bamboo.v2.build
Class BaseConfigurablePlugin

java.lang.Object
  extended by com.atlassian.bamboo.v2.build.BaseConfigurablePlugin
All Implemented Interfaces:
InitablePluginModule, BambooPluginModule, ConfigurablePlugin
Direct Known Subclasses:
AbstractWebRepositoryViewer, AutoLabelBuildCompleteAction, BaseConfigurableBuildPlugin, BuildExpiryPerPlanPlugin, BuildLabeller, BuildMonitoringPerPlanPlugin

public abstract class BaseConfigurablePlugin
extends java.lang.Object
implements ConfigurablePlugin

Helper class that allows you to


Field Summary
protected  com.atlassian.plugin.ModuleDescriptor moduleDescriptor
           
protected  TemplateRenderer templateRenderer
           
 
Constructor Summary
BaseConfigurablePlugin()
           
 
Method Summary
 void addDefaultValues(BuildConfiguration buildConfiguration)
          Extension point for adding default values to the form for ConfigurablePlugin.getEditHtml(com.atlassian.bamboo.ww2.actions.build.admin.create.BuildConfiguration, com.atlassian.bamboo.plan.Plan)
 void customizeBuildRequirements(BuildConfiguration buildConfiguration, RequirementSet requirementSet)
          Extension point for adding/customizing requirements when editing a build's builder configuration.
 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
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 removeBuildRequirements(BuildConfiguration buildConfiguration, RequirementSet requirementSet)
          Extension point for removing requirements when given plugin is excluded from build's builder configuration.
 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

BaseConfigurablePlugin

public BaseConfigurablePlugin()
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

addDefaultValues

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

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

prepareConfigObject

public void prepareConfigObject(@NotNull
                                BuildConfiguration buildConfiguration)
Description copied from interface: ConfigurablePlugin
Do any preprocessing work before validation occurs

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

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

customizeBuildRequirements

public void customizeBuildRequirements(@NotNull
                                       BuildConfiguration buildConfiguration,
                                       @NotNull
                                       RequirementSet requirementSet)
Description copied from interface: ConfigurablePlugin
Extension point for adding/customizing requirements when editing a build's builder configuration.

Specified by:
customizeBuildRequirements in interface ConfigurablePlugin
Parameters:
buildConfiguration - source of information for customizing build requirements
requirementSet - requirements to be customized

removeBuildRequirements

public void removeBuildRequirements(@NotNull
                                    BuildConfiguration buildConfiguration,
                                    @NotNull
                                    RequirementSet requirementSet)
Description copied from interface: ConfigurablePlugin
Extension point for removing requirements when given plugin is excluded from build's builder configuration.

Specified by:
removeBuildRequirements in interface ConfigurablePlugin
Parameters:
buildConfiguration - source of information for customizing build requirements
requirementSet - requirements to be customized

getViewHtml

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

Specified by:
getViewHtml in interface ConfigurablePlugin
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: ConfigurablePlugin
Returns HTML that represents the form fragment for editing the repository. No opening and closing form tags are required.

Specified by:
getEditHtml in interface ConfigurablePlugin
Parameters:
buildConfiguration - BuildConfiguration for which edit HTML has to be rendered.
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 © 2010 Atlassian. All Rights Reserved.