r1 - 09 Jun 2008 - 15:36:11 - MarcelBihrYou are here: TWiki >  Main Web > EclipseUIFoundationMain > FoundationNotifierTutorial

Using & Extending the Notifier for Events

Introduction

RTC provides a very generic and extensible framework for notifications and events. The framework defines the following terms in order to describe its functionality
  • Notifier
  • Events
  • Trigger
A Notifier is a mechanism to inform the user about a certain Event. For instance, the alert-notifier opens a small alert above the tray-area to inform the user about an Event. The Event provides a generic description that is used by the UI of the Notifier. E.g. the Event provides a description, severity and priority. Lastly, a Trigger defines the enabled-state of a certain Notifier for a certain Event. E.g., a Trigger may define to show the alert-notifier for high-severity work item change-events. Thus, a Trigger is the combination of a Notifier and a family of Events under a certain condition.

Contributing a Notifier

Follow these steps to contribute a Notifier for Events
  • Use the com.ibm.team.foundation.rcp.core.notifier extension point
    • provide a unique ID and a human readable name
    • Extend the abstract class Notifier and implement Notifier.notify()

The framework will automatically call Notifier.notify() in case a trigger is enabled that matches the provided conditions.

List of contributed notifiers to choose from
notifierlist.png

Contributing an Event Category with Event Types

Follow these steps to contribute event categories and event types for your domain
  • Use the com.ibm.team.foundation.rcp.core.notification extension point
    • Add an element eventcategory with a unique ID and human readable name
    • Add any number of eventtype to the eventcategory

As soon as your events are described in this way, they will show up in the notification-preferences page so that the user is able to enable a Notifier for this Event.

List of contributed event categories and types
notificationslist.png

Contributing Event Triggers to inform the user about a certain event

Contributing an event trigger makes it possible to have certain Notifier be enabled for Events out of the box without configuration by the user. Follow these steps to contribute a Trigger for your domain

  • Use the com.ibm.team.foundation.rcp.core.notification extension point
    • Add an element trigger with a unique ID and human readable name
      • Define the eventCategoryId and eventTypeId the Trigger is responsible for
      • Define the notifierId that points to the actual Notifier that should be used
      • Define the Trigger options as described below

The Trigger comes with a couple of settings that define under which condition the Notifier should be triggered

  • enabled - specify if the trigger is initially enabled
  • textMatch - Can be used as Filter on the Title and Message of a Notification. Use the wildcards '*' for any and '?' for any single character.
  • showInfos - If set to TRUE, this Trigger will show Notifications with the Severity set to INFO. If set to FALSE, this Trigger will not show Notifications of that Severity.
  • showWarnings - If set to TRUE, this Trigger will show Notifications with the Severity set to WARNING. If set to FALSE, this Trigger will not show Notifications of that Severity.
  • showErrors - If set to TRUE, this Trigger will show Notifications with the Severity set to ERROR. If set to FALSE, this Trigger will not show Notifications of that Severity.
  • minimumPriority - Allows to select the minimum priority of the Notifications the trigger should process.

List of triggers
triggerlist.png

Sending Events

Sending events is very easy - simply call the static method Notification.send(String eventTypeId, NotificationInfo? info). The two parameters indicate the origin and value of the event:
  • eventTypeId - the ID of the event type as specified in the com.ibm.team.foundation.rcp.core.notification extension point
  • info - the actual event

-- MarcelBihr - 09 Jun 2008

Topic attachments
I Attachment Action Size Date Who Comment
pngpng notificationslist.png manage 5.0 K 09 Jun 2008 - 15:30 MarcelBihr List of contributed event categories and types
pngpng notifierlist.png manage 3.7 K 09 Jun 2008 - 15:31 MarcelBihr List of contributed notifiers to choose from
pngpng triggerlist.png manage 5.2 K 09 Jun 2008 - 15:32 MarcelBihr List of triggers
Edit | WYSIWYG | Attach | Printable | Raw View | Backlinks: Web, All Webs | History: r1 | More topic actions
 

This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Contributions are governed by our Terms of Use
Ideas, requests, problems regarding TWiki? Send feedback