Class PageDecorator
- java.lang.Object
-
- hudson.model.Descriptor<PageDecorator>
-
- hudson.model.PageDecorator
-
- All Implemented Interfaces:
ExtensionPoint,Describable<PageDecorator>,Saveable,Loadable,OnMaster
- Direct Known Subclasses:
AdministrativeMonitorsDecorator,FormElementPathPageDecorator,FrameOptionsPageDecorator,SetupWizard,UsageStatistics
public abstract class PageDecorator extends Descriptor<PageDecorator> implements ExtensionPoint, Describable<PageDecorator>
Participates in the rendering of HTML pages for all pages of Hudson.This class provides a few hooks to augment the HTML generation process of Hudson, across all the HTML pages that Hudson delivers.
For example, if you'd like to add a Google Analytics stat to Hudson, then you need to inject a small script fragment to all Hudson pages. This extension point provides a means to do that.
Life-cycle
Plugins that contribute this extension point should implement a new decorator and put
Extensionon the class.Associated Views
global.jelly
If this extension point needs to expose a global configuration, write this jelly page. SeeDescriptorfor more about this. Optional.footer.jelly
This page is added right before the</body>tag. Convenient place for adding tracking beacons, etc.header.jelly
This page is added right before the</head>tag. Convenient place for additional stylesheet,<meta>tags, etc.httpHeaders.jelly
This is a generalization of theX-Jenkinsheader that aids auto-discovery. This fragment can write additional<st:header name="…" value="…"/>tags that go along with it.- Since:
- 1.235
- Author:
- Kohsuke Kawaguchi
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class hudson.model.Descriptor
Descriptor.FormException, Descriptor.PropertyType, Descriptor.Self
-
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
-
Field Summary
Fields Modifier and Type Field Description static List<PageDecorator>ALL-
Fields inherited from class hudson.model.Descriptor
clazz
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedPageDecorator()protectedPageDecorator(Class<? extends PageDecorator> yourClass)Deprecated.as of 1.425 Use the default constructor that's less error prone
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ExtensionList<PageDecorator>all()Returns all the registeredPageDecoratordescriptors.Descriptor<PageDecorator>getDescriptor()Gets the descriptor for this instance.StringgetUrl()Obtains the URL of this object, excluding the context path.-
Methods inherited from class hudson.model.Descriptor
addHelpFileRedirect, bindJSON, calcAutoCompleteSettings, calcFillSettings, configure, configure, doHelp, find, find, findByDescribableClassName, findById, getCategory, getCheckMethod, getCheckUrl, getConfigFile, getConfigPage, getCurrentDescriptorByNameUrl, getDescriptorFullUrl, getDescriptorUrl, getDisplayName, getGlobalConfigPage, getGlobalPropertyType, getHelpFile, getHelpFile, getHelpFile, getId, getJsonSafeClassName, getKlass, getPlugin, getPossibleViewNames, getPropertyType, getPropertyType, getPropertyTypeOrDie, getRequiredGlobalConfigPagePermission, getStaticHelpUrl, getT, getViewPage, isInstance, isSubTypeOf, load, newInstance, newInstance, newInstancesFromHeteroList, newInstancesFromHeteroList, save, self, toArray, toList, toMap
-
-
-
-
Field Detail
-
ALL
@Deprecated public static final List<PageDecorator> ALL
All the registered instances.
-
-
Constructor Detail
-
PageDecorator
@Deprecated protected PageDecorator(Class<? extends PageDecorator> yourClass)
Deprecated.as of 1.425 Use the default constructor that's less error prone- Parameters:
yourClass- pass-in "this.getClass()" (except that the constructor parameters cannot use 'this', so you'd have to hard-code the class name.
-
PageDecorator
protected PageDecorator()
-
-
Method Detail
-
getDescriptor
public final Descriptor<PageDecorator> getDescriptor()
Description copied from interface:DescribableGets the descriptor for this instance.Descriptoris a singleton for every concreteDescribableimplementation, so ifa.getClass() == b.getClass()then by defaulta.getDescriptor() == b.getDescriptor()as well. (In rare cases a single implementation class may be used for instances with distinct descriptors.)- Specified by:
getDescriptorin interfaceDescribable<PageDecorator>
-
getUrl
public final String getUrl()
Obtains the URL of this object, excluding the context path.Every
PageDecoratoris bound to URL viaJenkins.getDescriptor(). This method returns such an URL.
-
all
public static ExtensionList<PageDecorator> all()
Returns all the registeredPageDecoratordescriptors.
-
-