Skip to main content
All social and collaboration events relating to annotations (likes, comments etc.) are published to a local event bus. This means that these events can be subscribed to and custom behavior can be implemented when the event is fired. For example, the custom behavior might be invoking some code that submits information to additional systems or that triggers a message such as an email notification. To do this, create a listener for these events. Here is an example to do this for ‘likes’. Add this code to src/main/java/twigkit/events/AnnotationInterceptorModule.java:
And also create this file in src/main/java/twigkit/events/AnnotationInterceptor.java:
You must then register your new module by adding twigkit.events.AnnotationInterceptorModule to the file src/main/resources/META-INF/services/twigkit.TwigKitModule. If this file does not already exist simply create it and add the text twigkit.events.AnnotationInterceptorModule. This is all that is required to implement custom behavior. Add the code you must the annotate method using the information provided in the AnnotationCreated event object. As with other custom modules registered in Appkit you can also inject references to platforms and other core Appkit components and interact with them here.