|
Instructions on how to issue an alert are detailed in the dynamo docs in the
'Adding Custom Alert Messages to Gears' chapter of the Portal Developers Guide.
- The Alert Source
- Create a subclass of atg.portal.alert.GearMessage for each type
of Alert you want to send
- Ensure that your Alert source gear has access to the GearMessagePublisher
component /atg/portal/alert/GearMessagePublisher either via JNDI
lookup or via the nucleus
- To send an alert, call writeMessage on the GearMessagePublisher
with an instance of your GearMessage subclass.
- Scenario Manager Integration
- Register your GearMessage subclass in the patch-bay
message-registry, this creates the 'custom event' which you'll use
in the dispatch scenario
- Create a scenario to respond to your new custom event and dispatch the
message to the target principal using the Send Alert action (see
the example above)
- Localize the Gear Alert Messages
- Create at least one resource bundle
- Add the alertDisplayString property in the resource bundle
- Add alerts properties the alertPropertyNames array in the
resource bundle
- Provide an email template jsp / jhtml file
- Specify the alertEmailTemplate property in the resource bundle
- Update Alert Preferences Instance Config
- Add the alerts configuration section to the gear's instanceConfig
as described above
- Add the instanceConfig to the gear manifest (if it's a new gear mode)
- Register the Alerts with the Portal Alerts Framework
- Add Alerts to the gear manifest xml
- Reload the gear manifest
- Set up the Gear Instance Preferences in the Repository
- In the gear's instance config, configure and submit changes to the
alert preferences setting the value to yes_locked
- Test the gear
- Add an alerts gear to your community, if it's not there
- Configure the alerts gear to display alerts of the target type which
your gear sends
- Ensure that your dispatch scenario is enabled
- Enable logDebug in the AlertMgr, GearMessagePublisher
and the AlertsRepositoryManager.
- Cause your gear to send the Alert
- View the alerts gear
- Examine the debug logs
Next Section
|