Changes between Version 17 and Version 18 of PluginDevelopmentGuide
- Timestamp:
- 15.04.2013 15:46:04 (12 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
PluginDevelopmentGuide
v17 v18 3 3 = Plugin Development Guide = 4 4 5 DeepaMehta is made to be extensible by 3rd-party developers. Developers extend DeepaMehta by developing plugins (resp. "modules" resp. "applications" which is all synonymous). 5 DeepaMehta is made to be extensible by 3rd-party developers. Developers extend DeepaMehta by developing plugins (resp. "modules" resp. "applications" which is all synonymous). This guide teaches you how to develop DeepaMehta plugins. 6 6 7 7 == Build DeepaMehta from source == … … 586 586 === The plugin main file === 587 587 588 You must write a //plugin main file// if your plugin needs to a) listen to DeepaMehta Core events and/or b) provide a service. The plugin main file contains the event handl ing code resp. the implementation of the service methods then. A plugin main file is a Java class that is derived from `de.deepamehta.core.osgi.PluginActivator`.588 You must write a //plugin main file// if your plugin needs to a) listen to DeepaMehta Core events and/or b) provide a service. The plugin main file contains the event handlers resp. the service implementation then. 589 589 590 590 The plugin main file must be located directly in the plugin's `src/main/java/<your plugin package>/` directory. By convention the plugin main class ends with `Plugin`. … … 607 607 Here the plugin package is `org.mydomain.deepamehta4.mycoolplugin` and the plugin main class is `MyCoolPlugin`. 608 608 609 Furthermore you must add 2 entries in the plugin's **`pom.xml`**: 610 1. A <dependencies> element to include the `deepamehta-core` dependency. This is needed as your plugin main file requires the `PluginActivator` class. 611 2. a <build> element to configure the Maven Bundle Plugin. It needs to know what your plugin's main class is. You must specify its fully-qualified class name. 609 A plugin main file is a Java class that is derived from `de.deepamehta.core.osgi.PluginActivator`. The smallest possible plugin main file looks like this: 610 611 {{{ 612 #!java 613 package org.mydomain.deepamehta4.mycoolplugin; 614 615 import de.deepamehta.core.osgi.PluginActivator; 616 617 public class MyCoolPlugin extends PluginActivator { 618 } 619 }}} 620 621 3 things are illustrated here: 622 * The plugin should be packaged in an unique namespace. 623 * The `PluginActivator` class needs to be imported. 624 * The plugin main class must be derived from `PluginActivator` and must be public. 625 626 Furthermore when writing a plugin main file you must add 2 entries in the plugin's **`pom.xml`**: 627 1. a <dependencies> element to include the `deepamehta-core` dependency. This brings you the `PluginActivator` class. 628 2. a <build> element to configure the Maven Bundle Plugin. It needs to know what your plugin main class is. You must specify the fully-qualified class name. 612 629 613 630 {{{