Class ManagementLink
- java.lang.Object
-
- hudson.model.ManagementLink
-
- All Implemented Interfaces:
ExtensionPoint
,Action
,ModelObject
- Direct Known Subclasses:
AboutJenkins
,CliLink
,ConfigureLink
,ConsoleLink
,GlobalSecurityConfiguration
,GlobalToolConfiguration
,HudsonPrivateSecurityRealm.ManageUserLinks
,NodesLink
,OldDataMonitor.ManagementLinkImpl
,PluginsLink
,ReloadLink
,ShutdownLink
,StatisticsLink
,SystemInfoLink
,SystemLogLink
,WindowsInstallerLink
public abstract class ManagementLink extends Object implements ExtensionPoint, Action
Extension point to add icon tohttp://server/hudson/manage
page.This is a place for exposing features that are only meant for system admins (whereas features that are meant for Hudson users at large should probably be added to
Jenkins.getActions()
.)To register a new instance, put
Extension
on your implementation class.- Since:
- 1.194
- Author:
- Kohsuke Kawaguchi
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ManagementLink.Category
Categories supported by this version of core.-
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
-
Field Summary
Fields Modifier and Type Field Description static List<ManagementLink>
LIST
-
Constructor Summary
Constructors Constructor Description ManagementLink()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static ExtensionList<ManagementLink>
all()
All registered instances.Badge
getBadge()
ABadge
shown as overlay over the icon on "Manage Jenkins".ManagementLink.Category
getCategory()
Category for management link, usesString
so it can be done with core dependency pre-dating the version this feature was added.protected String
getCategoryName()
Name of the category for this management link.String
getDescription()
Returns a short description of what this link does.abstract String
getIconFileName()
Mostly works likeAction.getIconFileName()
, except that the expected icon format is SVG.Permission
getRequiredPermission()
Returns the permission required for user to see this management link on the "Manage Jenkins" page (ManageJenkinsAction
).boolean
getRequiresConfirmation()
Allows implementations to request that this link show a confirmation dialog, and use POST if confirmed.boolean
getRequiresPOST()
Define if the rendered link will use the default GET method or POST.abstract String
getUrlName()
Gets the URL path name.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface hudson.model.Action
getDisplayName
-
-
-
-
Field Detail
-
LIST
@Deprecated public static final List<ManagementLink> LIST
All registered instances.
-
-
Method Detail
-
getIconFileName
@CheckForNull public abstract String getIconFileName()
Mostly works likeAction.getIconFileName()
, except that the expected icon format is SVG. So if you give just a file name, "/images/svgs" will be assumed.- Specified by:
getIconFileName
in interfaceAction
- Returns:
- As a special case, return null to exclude this object from the management link.
This is useful for defining
ManagementLink
that only shows up under certain circumstances. - See Also:
- Jenkins Symbols,
Functions.isAnonymous()
,Functions.getIconFilePath(Action)
-
getDescription
public String getDescription()
Returns a short description of what this link does. This text is the one that's displayed in grey. This can include HTML, although the use of block tags is highly discouraged. Optional.
-
getUrlName
@CheckForNull public abstract 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
Action
s.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 Jenkins webapp.
In case of
ManagementLink
, this value is put straight into the href attribute, so relative paths are interpreted against the rootJenkins
object.- Specified by:
getUrlName
in interfaceAction
- 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
Action.getIconFileName()
. - See Also:
Functions.getActionUrl(String, Action)
-
getRequiresConfirmation
public boolean getRequiresConfirmation()
Allows implementations to request that this link show a confirmation dialog, and use POST if confirmed. Suitable for links which perform an action rather than simply displaying a page.- Returns:
- true if this link takes an action
- Since:
- 1.512
- See Also:
RequirePOST
-
all
@NonNull public static ExtensionList<ManagementLink> all()
All registered instances.
-
getRequiredPermission
@NonNull public Permission getRequiredPermission()
Returns the permission required for user to see this management link on the "Manage Jenkins" page (ManageJenkinsAction
). Historically, this returned null, which amounted to the same behavior, asJenkins.ADMINISTER
was required to access the page.- Returns:
- the permission required for the link to be shown on "Manage Jenkins".
-
getRequiresPOST
public boolean getRequiresPOST()
Define if the rendered link will use the default GET method or POST.- Returns:
- true if POST must be used
- Since:
- 1.584
- See Also:
RequirePOST
-
getCategoryName
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) @NonNull protected String getCategoryName()
Name of the category for this management link. Exists so that plugins with core dependency pre-dating the version when this was introduced can define a category. Plugins with newer core dependency overridegetCategory()
instead.- Returns:
- name of the desired category, one of the enum values of
ManagementLink.Category
, e.g.STATUS
. - Since:
- 2.226
-
getCategory
@NonNull public ManagementLink.Category getCategory()
Category for management link, usesString
so it can be done with core dependency pre-dating the version this feature was added.- Returns:
- An enum value of
ManagementLink.Category
. - Since:
- 2.226
-
-