Equinox Integration 2/Tutorial Plugin

From ADempiere
Revision as of 02:56, 13 March 2010 by Viola (Talk)

Jump to: navigation, search
This Wiki is read-only for reference purposes to avoid broken links.

If you want to change existing functionality in ADempiere, write a plugin. It is simple!

Create Plugin Project

  • In Eclipse, chose New/Plugin Development/Plugin Project
  • as a convention, choose a folder under adempiereTrunk/plugins
  • The manifest editor opens, fill in appropriate attributes
    • regarding versioning: I found the default versioning scheme using a qualifier (which is replaced by a timestamp at deployment time) quite annoying, because bundles are never overridden - but maybe I missed something here

Activation

  • If you need action to be done, specify an activator in the manifest.
  • Certainly you may implement the plain BundleActivator, but preferrably use org.adempiere.plugin.utils.AdempiereActivator
    • You have to import this package in the bundle manifest - it is provided by pluginUtils
  • The AdempiereActivator:
    • registeres your plugin as an ADempiere package
    • If you provide /META-INF/PackOut.xml in your plugin, it automagically does a 2Pack Packin with in.
  • If nothing is to do on yours plugin start or stop, you may use AdempiereActivator itself as the activator of your plugin
  • If you want to do something, subclass and override one of these methods:
    • install() - called after the packIn when your plugin is started in this version for the first time
    • start() - called - optionally after install() - when your plugin is started
    • stop() - called when your plugin is stopped
  • You may use each of these utility methods:
    • getName() - name of the plugin
    • getVersion() - version of the plugin

Extension Points


Return to ADempiere/Equinox Integration 2