User information
 Loading ...
Show article in Knowledge Base

 Plugins ‑ general instructions Export knowledge base Export     SubscribeSubscribe      Show article info

Plug-in / hook architecture in VisionProject

A simple plugin architecture are available for the installed version of VisionProject. Using that you can execute your own custom business logic when an issue or a user is:

  • Created
  • Updated
  • Deleted

To enable a plugin you should implement one or more of the following interfaces, ProjectIssueListener, SystemUserListener, forumListeners, documentListeners, workLogListeners, CustomerListener or issueHistoryListeners and then register the implementation-classes in a file named that should be placed in the WEB-INF/classes directory.


For example to listen for issue or  user events you should implement one or both of two interfaces, ProjectIssueListener and SystemUserListener.

package se.visionera.VisionProject.event;

public interface ProjectIssueListener {
    void objectCreated(BaseEvent event) throws VetoException;
    void objectLoaded(BaseEvent event) throws VetoException;
    void objectRemoved(BaseEvent event) throws VetoException;
    void objectStored(BaseEvent event) throws VetoException;
public interface SystemUserListener {
    void objectCreated(BaseEvent event) throws VetoException;
    void objectLoaded(BaseEvent event) throws VetoException;
    void objectRemoved(BaseEvent event) throws VetoException;
    String objectStored(BaseEvent event, String passwordInClearText) throws VetoException;

Sample plugins included in the distribution

The easiest way to learn how you can implement you own plugin is with a sample.


In the distribution we have included one sample plugin for issue changes and one sample plugin for user changes. The plugins are available in the directory: 'WEB-INF/src/se/visionera/visionproject/plugins'. 

The samples will print out information text to the console, like:
The issue 'Testing plugin' is about to be updated
The issue 'Testing plugin' was updated

NOTE! The samples are also included pre-compiled so if you would like to test them you can just create the file and add these lines:

Compile the classes

We have included a compile-script for Windows and Linux that will compile all the files that are available in the directory 'WEB-INF/src/se/visionera/visionproject/plugins'. The scripts are named 'compile-plugins.bat' and '' respectively and they are available in the 'WEB-INF/src' directory.

"Register" the plugin

First you should create a file named in the 'WEB-INF/classes' directory.

In this file you "register" your plugin-classes. It should have two  lines like this:



If you want, you can also add listeners / plugins for the following events:






NOTE! To  the right of the equal sign you can have one or more classes that  implements the respective interfaces. If you have more than one class  for each interface you should separate them with a comma like this:




  • You always have to restart Tomcat if you make changes to the plugin-classes or the file!
  • If you are updating a user object using the Web Service API, a change event on will not be triggered!

User comments
 Loading ...