hudson.plugins.violations
Class ViolationsBuildAction

java.lang.Object
  extended by hudson.model.AbstractModelObject
      extended by hudson.model.Actionable
          extended by hudson.plugins.violations.ViolationsBuildAction
All Implemented Interfaces:
hudson.model.Action, hudson.model.HealthReportingAction, hudson.model.ModelObject, hudson.search.SearchableModelObject, hudson.search.SearchItem, java.io.Serializable, org.kohsuke.stapler.StaplerProxy

public class ViolationsBuildAction
extends hudson.model.Actionable
implements hudson.model.Action, hudson.model.HealthReportingAction, org.kohsuke.stapler.StaplerProxy

This is the build action for the violations. It has the violation report for the build and is able to graph the violations. The rendering of the build is done by the associated summary.jelly script.

See Also:
Serialized Form

Constructor Summary
ViolationsBuildAction(hudson.model.Build owner, ViolationsReport report)
          Construct a build action.
 
Method Summary
 void doGraph(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp)
          This corresponds to the url .
 hudson.model.Build getBuild()
          Get the build that owns this action.
 hudson.model.HealthReport getBuildHealth()
          Get the build report.
 java.lang.String getDisplayName()
          The display name for the url to be displayed on the build page right hand side.
 java.lang.String getIconFileName()
          Get the icon to display.
 ViolationsBuildAction getPreviousResult()
          get rhe previous valid build result.
 ViolationsReport getReport()
          Get the report.
 java.lang.String getSearchUrl()
          Get the search url.
 java.lang.Object getTarget()
          The object to use then the URL is pressed This handles the url's from "${buildpage}/violations/" except for any overridded by do methods in this class (in this instance doGraph).
 java.lang.String getUrlName()
          The url to get to the "target" object.
static ViolationsBuildAction getViolationsAction(hudson.model.Build start)
          Get the violations build action from a build.
 
Methods inherited from class hudson.model.Actionable
addAction, getAction, getAction, getActions, getActions, getDynamic
 
Methods inherited from class hudson.model.AbstractModelObject
getSearch, getSearchIndex, getSearchName, makeSearchIndex, sendError, sendError
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ViolationsBuildAction

public ViolationsBuildAction(hudson.model.Build owner,
                             ViolationsReport report)
Construct a build action.

Parameters:
owner - the build that has created this action.
report - the report for this build.
Method Detail

getBuild

public hudson.model.Build getBuild()
Get the build that owns this action.

Returns:
the build.

getTarget

public java.lang.Object getTarget()
The object to use then the URL is pressed This handles the url's from "${buildpage}/violations/" except for any overridded by do methods in this class (in this instance doGraph).

Specified by:
getTarget in interface org.kohsuke.stapler.StaplerProxy
Returns:
the violations report.

getDisplayName

public java.lang.String getDisplayName()
The display name for the url to be displayed on the build page right hand side.

Specified by:
getDisplayName in interface hudson.model.Action
Specified by:
getDisplayName in interface hudson.model.ModelObject
Returns:
the display name.

getIconFileName

public java.lang.String getIconFileName()
Get the icon to display. FIXME: MAY NEED TO SPECIFY ROOT DIR.

Specified by:
getIconFileName in interface hudson.model.Action
Returns:
the violations 24x24 icon.

getUrlName

public java.lang.String getUrlName()
The url to get to the "target" object.

Specified by:
getUrlName in interface hudson.model.Action
Returns:
the url

getSearchUrl

public java.lang.String getSearchUrl()
Get the search url.

Specified by:
getSearchUrl in interface hudson.search.SearchItem
Returns:
the url.

getReport

public ViolationsReport getReport()
Get the report.

Returns:
the report.

getPreviousResult

public ViolationsBuildAction getPreviousResult()
get rhe previous valid build result.

Returns:
the previous violations build action.

getBuildHealth

public hudson.model.HealthReport getBuildHealth()
Get the build report.

Specified by:
getBuildHealth in interface hudson.model.HealthReportingAction
Returns:
the build report (null if not available).

doGraph

public void doGraph(org.kohsuke.stapler.StaplerRequest req,
                    org.kohsuke.stapler.StaplerResponse rsp)
             throws java.io.IOException
This corresponds to the url ./graph.

Parameters:
req - the request parameters.
rsp - the response.
Throws:
java.io.IOException - if there is an error writing the graph

getViolationsAction

public static ViolationsBuildAction getViolationsAction(hudson.model.Build start)
Get the violations build action from a build.

Parameters:
start - the build to start looking in.
Returns:
the action if found, null otherwise.


Copyright © 2008. All Rights Reserved.