Class NotificationBell
java.lang.Object
hudson.model.Descriptor<PageDecorator>
hudson.model.PageDecorator
io.jenkins.plugins.interactiveinput.ui.NotificationBell
- All Implemented Interfaces:
ExtensionPoint,Describable<PageDecorator>,Saveable,Loadable,OnMaster
Injects the notification-centre data mount and shared client into every Jenkins page (§6.2.1, §8.4).
The header button itself is a primary RootAction
(NotificationBellAction); this PageDecorator only contributes header.jelly
(the interactive-input.bell adjunct) and footer.jelly (a hidden data mount plus the
run-scoped sidebar/console controllers). bell.js finds the core header button by
NotificationBellAction.HEADER_BUTTON_ID and attaches the live pending-count badge.
The bell is context-aware: on the dashboard it lists every question the viewer can answer;
inside a pipeline (a page under a Job) it scopes to that pipeline's questions. The current
job is resolved from the Stapler ancestor chain and handed to the client via a data-job
attribute; the initial server-rendered count is scoped to match.
-
Nested Class Summary
Nested classes/interfaces inherited from class hudson.model.Descriptor
Descriptor.FormException, Descriptor.PropertyType, Descriptor.SelfNested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson -
Field Summary
Fields inherited from class hudson.model.PageDecorator
ALLFields inherited from class hudson.model.Descriptor
clazz -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintintintintintbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanMethods inherited from class hudson.model.PageDecorator
all, getDescriptor, getUrlMethods inherited from class hudson.model.Descriptor
addHelpFileRedirect, bindJSON, bindJSON, calcAutoCompleteSettings, calcFillSettings, configure, configure, configure, doHelp, 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, getStaticHelpUrl, getT, getViewPage, isInstance, isSubTypeOf, load, newInstance, newInstance, newInstance, newInstancesFromHeteroList, newInstancesFromHeteroList, newInstancesFromHeteroList, newInstancesFromHeteroList, save, self, toArray, toList, toMap
-
Constructor Details
-
NotificationBell
public NotificationBell()
-
-
Method Details
-
isBellVisible
public boolean isBellVisible()- Returns:
trueif the bell should render on the current page: the feature is enabled and the viewer has at least Overall/Read (so it never shows on the login page to anonymous).
-
isClientVisible
public boolean isClientVisible()- Returns:
trueif the shared client adjunct should load on this page: the viewer has at least Overall/Read. The adjunct is loaded even when the bell mount itself is hidden (the notification centre is off) so its delegated click handlers work on every page — the build-history badge and, for B6, the console "Open interactive input" link, which opens the dialog in place on the Console Output page. Without a mount the adjunct only wires those handlers; it never polls. It stays gated on Overall/Read so it never loads for anonymous users on the login page.
-
getCurrentJobFullName
- Returns:
- the full name of the
Jobthe current request is under, or an empty string on the dashboard / non-job pages. Drives the client's dashboard-vs-pipeline scoping.
-
getInitialCount
public int getInitialCount()- Returns:
- the pending count for the initial server render, scoped to the current job if any.
-
isRunContextActive
public boolean isRunContextActive()- Returns:
truewhen the run-scoped controllers should render: the per-project centre is on (so the run's "Interactive Input" side link exists), the page is under a build, and that build has at least one interactive-input question. Mirrors the run-action attach condition.
-
getCurrentRunJobFullName
- Returns:
- the full name of the job owning the current build, or an empty string off a build page.
-
getCurrentRunBuildNumber
public int getCurrentRunBuildNumber()- Returns:
- the current build number, or
0off a build page.
-
getCurrentRunPendingCount
public int getCurrentRunPendingCount()- Returns:
- the pending (WAITING) count scoped to the current build for the sidebar badge's initial render.
-
isRunViewContextActive
public boolean isRunViewContextActive()- Returns:
truewhen the run-scoped Interactive View controller should render: the per-project centre and theinteractiveViewfeature are on, the page is under a build, and that build has at least one review document. MirrorsInteractiveViewRunAction's attach condition so the sidebar "Interactive View" link's count stays live on every run sub-page.
-
getCurrentRunViewPendingCount
public int getCurrentRunViewPendingCount()- Returns:
- the open-review count scoped to the current build for the view sidebar badge's initial render.
-
isConsolePage
public boolean isConsolePage()- Returns:
truewhen the current request is a build's HTML Console Output page (…/consoleor…/consoleFull). Used to scope the auto-open dialog to the console page only (the raw…/consoleTextendpoint returns plain text with no page decoration, so it never reaches this decorator).
-
isReopenBuildDialogEveryVisit
public boolean isReopenBuildDialogEveryVisit()- Returns:
- whether the auto-open dialog re-opens on every console visit (mode B) rather than once per browser session (mode A, the default). Read by the client from the auto-open controller.
-
getPollingIntervalSeconds
public int getPollingIntervalSeconds() -
isRichModalEnabled
public boolean isRichModalEnabled() -
getIconClassName
- Returns:
- the theme-aware symbol class for the configured notification icon.
-
isTabNotificationBadge
public boolean isTabNotificationBadge()- Returns:
- whether the client should mirror the pending count in the browser tab (title prefix +
a dot painted on top of the existing favicon). On by default; a look-and-feel toggle under
Manage Jenkins → Appearance. The client reads this from the bell mount's
data-tab-badgeattribute.
-
getHeaderActionId
- Returns:
- the id core assigns to
NotificationBellAction's header button, sobell.jscan attach the live badge without guessing a CSS insertion point.
-