Skip to content

Spls plugin development

Yifan NIng edited this page Nov 16, 2013 · 26 revisions

SPLs plugin is designed to enable the creation and curation of annotations on sentence sequences in the text sections of drug product labeling. Our initial work focuses on marking up clinical pharmacogenomics statements, and providing manual annotation of the information provided by the sentences. The SPLs plugin is similar the Antibody plugin but does not currently use a resource plugin (i.e., NCBO or NIF services)

1.Plugin Linkage

In order to link a plugin to the GWT codebase it is necessary to add in the Domeo.gwt.xml file a line specifying the inheritance. 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 in the root a .gwt.xml file. 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

2.Plugin Creation

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 MPharmgx.java which is Plain Old Java Object for the basic elements of a pharmacogenomics annotation (quote: add Antibody into class diagram to show hierarchy of inheritence of classes)

CD_Model_MPharmgx.gif

Class diagram for MSPLsAnnotation.java which inheritence from MAnnotation.java to follows standard of Open Annotation Data Model

CD_Model_MSPLsAnnotation.gif

  • search: contains the implementation of the interfaces for enabling annotation search within the client.

  • ui: contains the ui components that can be of different kind:

    • forms
    • viewers
    • tiles
    • cards.

Class diagram for UI (form, card and tile) CD_SPLs_UI.gif

  • serialization: contains the serializer components that converting from RDF to JSON-LD:

Class diagram for Serialization CD_SPLs_Seralization.gif

3. Plugin Registration

Register SPLs plugin in Domeo by adding code as below in 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 will make sure 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 have 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.