Wiki Markup |
---|
{scrollbar} |
There are four ways of creating a BI Component: create a BI Component from scratch, convert an existing class into a BI Component, create a subclass of ComponentBase (org.pentaho.plugin.ComponentBase), or create a subclass of SimpleComponent (org.pentaho.plugin.core.SimpleComponent).
...
You can create your BI Components in whatever package you like whether they are subclasses of Pentaho classes or not. There are no required methods that will be inaccessible if you use a non-Pentaho package.
Extend SimpleComponent
This is the easiest way to create a new component and the recommended place to start.
- Create a new Java class that is a subclass of (extends) org.pentaho.plugin.core.SimpleComponent.
- Implement an executeAction() method and a getLogger() method. See 'Component #Component Methods' below for a description of these methods.
Extend ComponentBase
If your component needs to validate its inputs and/or system settings or needs to perform any initialization and/or cleanup, you should extend org.pentaho.plugin.ComponentBase.
- Create a new Java class that is a subclass of (extends) org.pentaho.plugin.ComponentBase.
- Add code to the init(), validateSystemSettings(), validateAction(), executeAction(), done(), and getLogger() methods as appropriate. See 'Component Methods' below for a description of these methods.
Convert a Java Object into a BI Component
If you have an existing object that you wish to convert into a BI Component there are two options.
Create a new object that subclasses your existing object and implements the required interfaces
Change your object to implement the required interfaces
...
- Copy the imports, member variables, and methods from org.pentaho.plugin.ComponentSubclassExample into your Java class.
- Add code to the init(), validateSystemSettings(), validateAction(), executeAction(), done(), and getLogger() methods as appropriate. See 'Component Methods' below for a description of these methods.
Components from Scratch
In order to create a component from scratch a new class that implements the interface org.pentaho.core.component.IComponent must be created. To implement all three interfaces requires about 30 methods to be implemented. It is not recommended to use this option and there should be no need to do this given the options above.
Anchor | ||||
---|---|---|---|---|
|
Component Methods
If using one of the three recommended methods for creating new components, the methods below are the BI Component methods that need to be customized to provide your needed functionality. The methods are listed in the order that they are typically called during normal processing. Depending on the option used to create your component, not all of these methods are required. See above sections for more details.
...