Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Adding more details

Configuration to Turn On Events

Use the 'NotificationLifecycleController.doEvents' preference to turn on event processing for a portlet definition. This needs to be done in both Notifications Portlet and Notifications Icon.

Adding Support to A Portlet

The follow changes will need to be performed on the portlet that wishes to publish Notifications entries into the Notifications system.

Add dependency for the Notifications API

First off, the portlet will need to have access to the Notifications API artifacts. Include these in pom.xml

Code Block
languagexml
titlepom.xml
...
             <dependency>
                 <groupId>org.jasig.portlet.notification</groupId>
                 <artifactId>notification-portlet-api</artifactId>
                 <version>3.0.0</version>
             </dependency>
...
         <dependency>
             <groupId>org.jasig.portlet.notification</groupId>
             <artifactId>notification-portlet-api</artifactId>
         </dependency>

Listen for Notification Events and Respond

Next, configure portlet.xml with the inter-portlet events to process and publish for each portlet.

Code Block
languagexml
titleportlet.xml
...
        </portlet-preferences>
         <supported-processing-event>
             <qname xmlns:x="https://source.jasig.org/schemas/portlet/notification">x:NotificationQuery</qname>
         </supported-processing-event>
         <supported-publishing-event>
             <qname xmlns:x="https://source.jasig.org/schemas/portlet/notification">x:NotificationResult</qname>
         </supported-publishing-event>
      </portlet>

And at the end of the file, add the event definitions.

Code Block
languagexml
...
   <event-definition>
         <qname xmlns:x="https://source.jasig.org/schemas/portlet/notification">x:NotificationQuery</qname>
         <value-type>org.jasig.portlet.notice.NotificationQuery</value-type>
     </event-definition>
     <event-definition>
         <qname xmlns:x="https://source.jasig.org/schemas/portlet/notification">x:NotificationResult</qname>
         <value-type>org.jasig.portlet.notice.NotificationResult</value-type>
     </event-definition>
  </portlet-app>

Example NotificationResult Response Code

Use code like the following -- within another portlet -- to in a @Controller to respond to NotificationQuery events and feed items to the NotificationPortlet.

...