I created a simple event handler to track activity on IBM Connections. The instructions are available here: https://ibm.biz/BdH53e. Yes, it's an old link but the instructions are still good! Here are the steps:
- Create the Java code. I'm attaching my source code to this post; feel free to take a look, with the understanding that it's sample code, not meant for production use, and the usual other disclaimers. You need to compile this code against a jar file provided by Connections called lc.events.spi.jar. Note that the SPI just identifies that an event has occurred; it doesn't give you the content of the event. For example, it tells you that someone created a blog post but doesn't give you the text of the post. However, it does give you the ID of the post and you can fetch the content using that ID.
- Edit the event-config.xml file on your Deployment Manager. On my server, it's here: /opt/IBM/WebSphere/AppServer/profiles/Dmgr01/config/cells/connectionsCell/LotusConnections-config/events-config.xml. In the postHandlers section, add this element:
<postHandler enabled="true" invoke="ASYNC" name="SPI_Auditor" class="com.ibm.cacy.spi_sample.SPI_Auditor">
<subscription source="*" type="*" eventName="*"/>
NOTE: This configuration means that we will capture any create/edit event, and there are many. For example, a forum response can be created, edited, deleted, liked, accepted, and probably other things, too. For each event there is a SOURCE (such as Forums), a TYPE (such as create), and a name (such as forum.topic.followed). The events-config.xml file allows you to specify precisely which event(s), type(s), and name(s) you wish to consume, so you can get as granular or as coarse as you wish. See the link above for a list.
- Create a shared library as described in the link above.
- Add the shared library to the News application only, since this is an asynchronous post-event handler.
- Restart Connections.
Note: Once this is working, I can make changes to my code and copy a new jar file to the directory (/opt/IBM/Connections/eventHandlers), and Connections will notice that and automatically reload it...no need to restart Connections or even an app. Nice.