Info | ||
---|---|---|
| ||
Axis2 Handler is one of many well-defined extension points supported by the WSO2 Governance Registry. Read more on Supported Extension Points for a complete list of extension points supported by WSO2 Governance Registry. |
WSO2 Governance Registry generates notifications for events triggered by various operations performed on resources and collections stored in the repository. Notifications can be consumed in a variety of formats including E-mail. Read more about Notifications and also the API-Level Access provided for subscription operations. The contents of notification E-mails can be customized by using an Axis2 Handler. WSO2 Governance Registry contains an Apache Axis2 based runtime as a part of the WSO2 Carbon Framework. We will be reusing the code of the Handler Sample in this example. This sample requires Apache Maven. See Installing Apache Maven for Governance Registry on Windows or Installing Apache Maven for Governance Registry on Linux.
This sample also includes two advanced use-cases which have been included at the bottom of this page.
...
Info | ||
---|---|---|
| ||
The command |
A successful run of Apache Maven will generate a report similar to the following:
...
Info | |||||
---|---|---|---|---|---|
| |||||
The
This might be useful if you have already defined any other handlers in the Out Flow. |
6. Configure Governance Registry to send E-mails in GREG_HOME/repository/conf/axis2/axis2.xml
.
7. Start the server and observe the command prompt. See Starting Governance Registry Management Console Installing on Windows or Starting Governance Registry Management Console Installing on Linux and Solaris.
8. Navigate to the / collection of the Resource Browser and add an E-mail subscription for Update events.
Click the "Subscribe" button to create the subscription. Read about Managing the Resources and Managing Breadcrumb to learn how to navigate to the / collection. And read more about Managing Subscriptions.
9. Click on the E-mail Address verification link that you will receive via E-mail.
Info | ||
---|---|---|
| ||
In this example, John Smith uses a Gmail account. |
10. Make some update to the Root collection like adding a new property. Read Managing Properties to learn how to add a new property.
...
Code Block |
---|
This message was intercepted by EmailTransformHandler |
See also Notifications and Managing Subscriptions.
Advanced Use-case 1
This sample can be improved to include a clickable link in the E-mail body, making it possible for users to easily navigate to the resources in which changes have been made. The following modification can be made to the code segment to achieve this:
...
Info | ||
---|---|---|
| ||
In here, the link that we have used requires the user to sign-in to the management console to browse the resource. Such notifications are useful for approvals. However, there can be situations where those who approve do not need to sing-in to the management console. Such situations can be addressed by providing a clickable link that directs the user to a web service hosted on Governance Registry which does not require authentication. Learn more on how to add web services to Governance Registry by following the Endpoint Look-up Sample. Please be informed that this might introduce a security risk unless necessary precautions have been taken. As a precaution, for example, a token can be generated at the point of notifying the user, which will also appear on the URL within the E-mail. The web service logic can validate the presence of this token to prevent fraudulent access. |
...
Info | ||
---|---|---|
| ||
In this example we have used the default We have also assumed that the For this to work, each user on Governance Registry should fill out their User Profile. |
Info | ||
---|---|---|
| ||
In here, we have enumerated a list of E-mail addresses that would be treated as blacklisted. However, in a real-world scenario it might be cumbersome to hard-code all E-mail addresses. In such situations the User Management APIs of Governance Registry can be used. The |
...