hudson.model
Interface Action

All Superinterfaces:
ModelObject
All Known Subinterfaces:
BuildBadgeAction, EnvironmentContributingAction, FoldableAction, HealthReportingAction, PermalinkProjectAction, ProminentProjectAction, Queue.QueueAction, RootAction, RunAction
All Known Implementing Classes:
AbstractScmTagAction, AbstractTestResultAction, AggregatedTestResultAction, AggregatedTestResultPublisher.TestResultAction, BackFiller.TentativePlan, CauseAction, FileSystemProvisioner.Default.WorkspaceSnapshotImpl, Fingerprinter.FingerprintAction, HudsonPrivateSecurityRealm.ManageUserLinks, InvisibleAction, JavadocArchiver.JavadocAction, JavadocArchiver.JavadocBuildAction, MailMessageIdAction, ManagementLink, MatrixTestResult, MyViewsProperty, MyViewsProperty.GlobalAction, ParametersAction, ParametersDefinitionProperty, Run.KeepLogBuildBadge, SCMRevisionState, SCMTrigger.BuildAction, SCMTrigger.SCMAction, TaskAction, TestAction, TestResultAction, TestResultProjectAction, WindowsInstallerLink, WorkspaceSnapshot

public interface Action
extends ModelObject

Object that contributes additional information, behaviors, and UIs to ModelObject (more specifically Actionable objects, which most interesting ModelObjects are.)

Actions added to a model object creates additional URL subspace under the parent model object, through which it can interact with users. Actions are also capable of exposing themselves to the left hand side menu of a ModelObject (for example to Project, Build, and etc.)

Some actions use the latter without the former (for example, to add a link to an external website), while others do the former without the latter (for example, to just draw some graphs in floatingBox.jelly), and still some others do both.

If an action has a view named floatingBox.jelly, it will be displayed as a floating box on the top page of the target ModelObject. (For example, this is how the JUnit test result trend shows up in the project top page. See TestResultProjectAction.

Persistence

Actions are often persisted as a part of Actionable (for example with Build) via XStream. In some other cases, Actions are transient and not persisted (such as when it's used with Job).

Author:
Kohsuke Kawaguchi

Method Summary
 String getDisplayName()
          Gets the string to be displayed.
 String getIconFileName()
          Gets the file name of the icon.
 String getUrlName()
          Gets the URL path name.
 

Method Detail

getIconFileName

String getIconFileName()
Gets the file name of the icon.

Returns:
If just a file name (like "abc.png") is returned, it will be interpreted as a file name inside /images/24x24. This is useful for using one of the stock images.

If an absolute file name that starts from '/' is returned (like "/plugin/foo/abc.png'), then it will be interpreted as a path from the context root of Hudson. This is useful to pick up image files from a plugin.

Finally, return null to hide it from the task list. This is normally not very useful, but this can be used for actions that only contribute floatBox.jelly and no task list item. The other case where this is useful is to avoid showing links that require a privilege when the user is anonymous.

See Also:
Hudson.isAdmin()

getDisplayName

String getDisplayName()
Gets the string to be displayed. The convention is to capitalize the first letter of each word, such as "Test Result".

Specified by:
getDisplayName in interface ModelObject

getUrlName

String getUrlName()
Gets the URL path name.

For example, if this method returns "xyz", and if the parent object (that this action is associated with) is bound to /foo/bar/zot, then this action object will be exposed to /foo/bar/zot/xyz.

This method should return a string that's unique among other Actions.

The returned string can be an absolute URL, like "http://www.sun.com/", which is useful for directly connecting to external systems.

If the returned string starts with '/', like '/foo', then it's assumed to be relative to the context path of the Hudson webapp.

Returns:
null if this action object doesn't need to be bound to web (when you do that, be sure to also return null from getIconFileName().


Copyright © 2004-2013 Hudson. All Rights Reserved.