Introduction
This document describes the steps to create a plugin for OpenSpecimen. This guide is intended for developers or technical IT staff. To write a plugin one should be aware of the OpenSpecimen domain structure.
As a developer you are expected to have working knowledge of:
- Using REST APIs.
- Java Spring
- Angular JS
Following are high level steps:
- Install prerequisite software which can be downloaded from http://demo.openspecimen.org/releases/Prerequisites/
- Download the plugin skeleton os-plugin.zip
- Unzip the downloaded file into a directory.
Prerequisites
Following table lists prerequisites and their supported versions.
Pre-requisite | Version |
---|---|
JDK | 1.8 |
Gradle | 2.0 |
Environment Variables
Following table lists and describes environment variables
Environment Variable | Description |
---|---|
JAVA_HOME | Absolute path of directory where JDK is installed. For example |
Please refer to following variables used throughout the document.
Keyword | Comment |
---|---|
| Directory where plugin source code is kept. For example, |
| Directory where JDK is installed. For example, |
Steps to add custom Java classes:
- Please add all your Java classes under PLUGIN_HOME/src/main/java/com/krishagni/openspecimen
- All the Spring configuration should be done in PLUGIN_HOME/src/main/resources/pluginContext.xml
Steps to create plugin archive
The build system uses Gradle to manage code compilation, building plugin jar archive.
- Open command prompt. Change your current directory PLUGIN_HOME.
- Use the following commands to build the plugin archive:
gradle clean
gradle build - The above target will create the archive in the build directory under respective plugin module. e.g. For current plugin the jar will get created at ${PLUGIN_HOME}/build/libs/os-plugin*.jar