Skip to content

Analyzer plugins

Paul Schwartz edited this page Jan 7, 2014 · 28 revisions

Background

We support two models of importing analyzer results. The older model, which we are phasing out, has the code for importing analyzer results as part of the core of OpenELIS. The newer model which all new analyzers should use is a plugin model.

Basics

There is a directory /plugin in OpenElis. Any jar file in this directory will be processed and if it is a valid analyzer plugin it will be added to the application. If the plugin is later removed any imported data will be retained but the analyzer will no longer appear in the menu and openELIS will not accept analyzer files meant for that analyzer.

The plugins are loaded during the application startup. A future feature will be to enable/disable them during runtime.

Working with plugins

Plugins can be developed completely independently of OpenELIS or they can be checked into https://github.com/openelisglobal/openelisglobal-plugins. Currently we are only supporting plugins for analyzers but we expect to also support plugins for electronic and paper reports. The analyzer plugins should be added under "analyzer". There is an example called WeberAnalyzer which can be used as a template. Note that it also includes a SMALL input file sample as well as contact information.

Good manners

If you want to modify an existing analyzer written by a different organization please contact the creator of the analyzer and work with them to make sure that your changes do not break their imports. You should also include the core group with confirmation that you have the right to modify the work from a different organization or else we will not allow the change to be made in repository. An alternative is to make a copy of the other persons work. Note that you should honor the copyright notice and name yourself as a contributor, not as the creator.

If you no longer are using a particular analyzer and do not care if the work is modified please note that in the contact file.

Working with git

The plugins are in a separate repository from the core but the IDE is only tracking the core repository. When you do a commit from within the IDE you are only committing what is in openelisglobal-core, not anything from openelisglobal-plugin. To maintain that repository you will need to either work from the command line or use a tool such as SourceTree.

Setting up for IntelliJ

The overarching unit of work in IntelliJ is a project. Each project is made up of one or more modules and each module is made up of one or more artifacts.

We are assuming that openelis-global is already a project in IntelliJ and just the analyzer part needs to be set up.

Steps:

  1. If you have not done so already clone the repository with the analyzer you want to work on.
  2. From the project view open Module Settings (F4)
  3. On the left hand side click on modules
  4. Click on the green plus button
  5. Click new module
  6. On the New module dialog box select Java as the module type
  7. On the second widget down select the content root. As an example for the Weber analyzer select ...\openelisglobal-plugins\analyzers\weberAnalyzer
  8. This should automatically create the correct name
  9. Uncheck "create source root" at the bottom of the dialog
  10. Click on next and then finish.
  11. You now have the module set up.
  12. On the left hand side now click on artifacts
  13. Click on the green plus button
  14. Click on add jar -> with modules and dependencies
  15. On the module dropdown select the new module name
  16. Leave everything else as is and click ok
  17. The output layout will include a huge number of jar files and app compile and the analyzer compile listing.
  18. Delete everything accept the analyzer compile listing
  19. Set the output to the output of the app module, it should be something like ...\openelisglobal-core\app\out\artifacts\app_war_exploded\plugin
  20. Make sure the build on make checkbox is selected
  21. Change to the app artifact
  22. Select the Output layout tab
  23. Select the green plus button
  24. Select the artifact icon
  25. Select the analyzer jar file
  26. Highlight the jar file in the list
  27. Select the green plus button
  28. Select module output
  29. Select the analyzer module

The next time you do a complete build the analyzer jar file should be in the ...\openelisglobal-core\app\out\artifacts\app_war_exploded\plugin directory and it should be loaded into the application

Clone this wiki locally