hudson.model
Class PageDecorator

java.lang.Object
  extended by hudson.model.Descriptor<PageDecorator>
      extended by hudson.model.PageDecorator
All Implemented Interfaces:
ExtensionPoint, Describable<PageDecorator>, Saveable
Direct Known Subclasses:
DownloadService, UpdateCenter.PageDecoratorImpl, 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 augument 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 Extension on the class.

Associated Views

global.jelly

If this extension point needs to expose a global configuration, write this jelly page. See Descriptor for 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 the X-Jenkins header 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
static List<PageDecorator> ALL
          Deprecated. as of 1.286 Use all() for read access, and use Extension for registration.
 
Fields inherited from class hudson.model.Descriptor
clazz
 
Fields inherited from interface hudson.model.Saveable
NOOP
 
Constructor Summary
protected PageDecorator()
           
protected PageDecorator(Class<? extends PageDecorator> yourClass)
          Deprecated. as of 1.425 Use the default constructor that's less error prone
 
Method Summary
static ExtensionList<PageDecorator> all()
          Returns all the registered PageDecorator descriptors.
 Descriptor<PageDecorator> getDescriptor()
          Gets the descriptor for this instance.
 String getDisplayName()
          Unless this object has additional web presence, display name is not used at all.
 String getUrl()
          Obtains the URL of this object, excluding the context path.
 
Methods inherited from class hudson.model.Descriptor
addHelpFileRedirect, calcAutoCompleteSettings, calcFillSettings, configure, configure, doHelp, find, find, getCheckUrl, getConfigFile, getConfigPage, getCurrentDescriptorByNameUrl, getDescriptorFullUrl, getDescriptorUrl, getGlobalConfigPage, getGlobalPropertyType, getHelpFile, getHelpFile, getHelpFile, getId, getJsonSafeClassName, getKlass, getPlugin, getPossibleViewNames, getPropertyType, getPropertyType, getPropertyTypeOrDie, getT, getViewPage, isInstance, isSubTypeOf, load, newInstance, newInstance, newInstancesFromHeteroList, newInstancesFromHeteroList, save, self, toArray, toList, toMap
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ALL

public static final List<PageDecorator> ALL
Deprecated. as of 1.286 Use all() for read access, and use Extension for registration.
All the registered instances.

Constructor Detail

PageDecorator

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: Describable
Gets the descriptor for this instance.

Descriptor is a singleton for every concrete Describable implementation, so if a.getClass()==b.getClass() then a.getDescriptor()==b.getDescriptor() must hold.

Specified by:
getDescriptor in interface Describable<PageDecorator>

getDisplayName

public String getDisplayName()
Unless this object has additional web presence, display name is not used at all. So default to "".

Specified by:
getDisplayName in class Descriptor<PageDecorator>

getUrl

public final String getUrl()
Obtains the URL of this object, excluding the context path.

Every PageDecorator is bound to URL via Jenkins.getDescriptor(). This method returns such an URL.


all

public static ExtensionList<PageDecorator> all()
Returns all the registered PageDecorator descriptors.



Copyright © 2004-2013. All Rights Reserved.