View source | Discuss this page | Page history | Printable version   
Toolbox
Main Page
Upload file
What links here
Recent changes
Help

PDF Books
Add page
Show collection (0 pages)
Collections help

Search

Modules:Java Extension Points/How to add class to exsiting Extension Point

Contents

Objective

The objective of this How to article is to describe how to add a new class to an exsisting Java Extension Point and integrate it in your module.

Creating the Java Class

Application Dictionary

To let the extension point know which classes have to execute, a record must be created in the Java Extension Point Class tab. This record will be exported in the src-db folder of your module.


JavaExtensionPointClass.png

The Java Class

All the extension points classes must extend the JavaExtensionPointBase and override the execute method.

We can obtain the parameters value calling the get methods from the params object.

Bulbgraph.png   Available methods can be found here

public class PickingProcessExtension extends JavaExtensionPointBase {

 @Override
 public JavaExtensionPointParams execute(JavaExtensionPointParams params) {
   // Get the param PickingList as a BaseOBObject
   final PickingList pl = (PickingList) params.getBaseOBObjectParameter("PickingList");
   
   // Your code here...

   // Return the params object to allow the next class to use them
   return params;
 }
}

Retrieved from "http://wiki.openbravo.com/wiki/Modules:Java_Extension_Points/How_to_add_class_to_exsiting_Extension_Point"

This page has been accessed 173 times. This page was last modified on 14 January 2016, at 17:58. Content is available under Creative Commons Attribution-ShareAlike 2.5 Spain License.