-
Notifications
You must be signed in to change notification settings - Fork 79
Analyzer plugins
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.
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.
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.
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.
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.
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:
- If you have not done so already clone the repository with the analyzer you want to work on.
- From the project view open Module Settings (F4)
- On the left hand side click on modules
- Click on the green plus button
- Click new module
- On the New module dialog box select Java as the module type
- On the second widget down select the content root. As an example for the Weber analyzer select ...\openelisglobal-plugins\analyzers\weberAnalyzer
- This should automatically create the correct name
- Uncheck "create source root" at the bottom of the dialog
- Click on next and then finish.
- You now have the module set up.
- On the left hand side now click on artifacts
- Click on the green plus button
- Click on add jar -> with modules and dependencies
- On the module dropdown select the new module name
- Leave everything else as is and click ok
- The output layout will include a huge number of jar files and app compile and the analyzer compile listing.
- Delete everything accept the analyzer compile listing
- Set the output to the output of the app module, it should be something like ...\openelisglobal-core\app\out\artifacts\app_war_exploded\plugin
- Make sure the build on make checkbox is selected
- Change to the app artifact
- Select the Output layout tab
- Select the green plus button
- Select the artifact icon
- Select the analyzer jar file
- Highlight the jar file in the list
- Select the green plus button
- Select module output
- 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