-
Notifications
You must be signed in to change notification settings - Fork 2
Spls plugin development
The SPLs plugin enables pharmacogenomics annotation. Pharmacogenomics annotation involves marking up specific sentence sequences in the text of drug product labels that discuss a drug’s pharmacacogenomics, and providing manual annotations about the information provided by these sentences. The SPLs plugin is similar to the Antibody plugin but currently it does not use a resource plugin (i.e., NCBO or NIF services).
In order to link a plugin to the GWT codebase it is necessary to add a line specifying the inheritance into the Domeo.gwt.xml file. The name of the module to inherit has to contain the full package name:
<inherits name="org.mindinformatics.gwt.domeo.plugins.annotation.spls.SPLs" />
The plugin project needs to include a .gwt.xml file in the root. The file would be in the directory and would be named 'SPLs.gwt.xml':
src>org>mindinformatics>gwt>domeo>plugins>annotation>spls>SPLs.gwt.xml
The file contains the dependencies and specifies the sub-directories.
SPLs Plugin contains following directories:
-
info: contains the plugin and resources descriptors.
-
model: contains the classes that encode the annotation and domain model.
Class Diagram for spls/model (quotes Antibody to clarifies hierarchy of associations)
-
search: contains the implementation of the interfaces for enabling annotation search within the client.
-
ui: contains the ui components that can be of different kinds:
- forms
- viewers
- tiles
- cards.
Class Diagram for spls/ui
Register SPLs plugin in Domeo by adding code as below in the Domeo.java main file.
// SPLs
// Registers the plugin
pluginsManager.registerPlugin(SPLsPlugin.getInstance(), true);
// Domeo supports profiles, the annotation creator form gets loaded only if that plugin is enabled.
if (_profileManager.getUserCurrentProfile().isPluginEnabled(
SPLsPlugin.getInstance().getPluginName())) {
// Registers the UI annotation creation form
annotationFormsManager
.registerAnnotationForm(MSPLsAnnotation.class.getName(),
new SPLsFormProvider(this));
}
// Registers the UI tile component
annotationTailsManager.registerAnnotationTile(
MSPLsAnnotation.class.getName(), new SPLsTileProvider(this));
// Registers the UI card component
annotationCardsManager.registerAnnotationCard(
MSPLsAnnotation.class.getName(), new SPLsCardProvider(this));
pluginsManager.registerPlugin(PostitPlugin.getInstance(), true);
The conditional statement checks that the plugin is active for the current profile before registering the annotation creation form. All the other UI components are currently always active (don't belong to the conditional block) to make sure that when an annotation is loaded it always has a proper set of UI components that could render it.
Note: Domeo provides ways for defining profiles. Every profile details which plugins are activated or disactivated. This will be addressed elsewhere in the wiki.