Extension Points

Please note that this page is outdated as it only targets HALE up to version 2.1.2

Services and Providers

The main extension pattern for the HUMBOLDT alignment editor can be described as follows: There are several services in the project which maintain the state of all important models. These services, such as the SchemaService, the InstanceService and the AlignmentService can make use of multiple Providers, which are managed by a ProviderFactory. If you would now like to provide e.g. the capability to parse a new conceptual schema type, you would have to provide a new SchemaProvider implementation.

Adding a Wizard for a CstFunction

To add a function wizard to HALE you first need to implement a factory for the wizard. The factory must implement the FunctionWizardFactory interface (eu.esdihumboldt.hale.rcp.wizards.functions.FunctionWizardFactory). There are two methods to be implemented:

a) public boolean supports(AlignmentInfo selection);

The AlignmentInfo holds the source and target schema items on which the function shall be applied. It can also be queried for the existing alignment cell of a combination of source and target schema items.
In this method you have to decide if your wizard is applicable for the given input (Source and target schema items and their alignment) and return true if that's the case. Otherwise the wizard will not be presented to the user as an option for mapping the selected schema items. If an alignment cell already exists, you should check if your wizard is the right choice for editing this cell.

b) public FunctionWizard createWizard(AlignmentInfo selection);

This method will only be called after a call to "supports" with the same parameter returned true. So at this point you can be sure (because you ensured it in "supports") that the input is valid for your wizard.
Create an instance of your function wizard and configure it using the AlignmentInfo. The wizard must implement the FunctionWizard interface (eu.esdihumboldt.hale.rcp.wizards.functions.FunctionWizard). For most cases - where the ouput of the wizard is a single cell - you can base your wizard on AbstractSingleCellWizard. If your function uses composed properties you might want to use AbstractSingleComposedCellWizard instead. Look for implementation examples in the eu.esdihumboldt.hale.rcp.wizards.functions.core project.

When you have implemented your function wizard factory there is still one step missing: Registering the factory with the corresponding extension point. To register the factory, open the Plug-in Manifest Editor of your project (by opening either plugin.xml or META-INF/MANIFEST.MF) and there open the "Extensions" tab. If it is not already added, add the extension eu.esdihumboldt.hale.rcp.wizards.functions.FunctionWizardFactory to the extension list. Open the context menu of the extension and select "New"->"factory". Now select the new factory and enter the values for "class" (Name of your function wizard factory implementation class), "name" (Name for the wizard that is displayed to the user) and "icon" (Wizard icon, optional).

Adding an augmentation wizard

Augmentations are special functions that only apply to elements already transformed to the target schema. Implementing an augmentation wizard is very similar to implementing a function wizard. For the factory class instead of implementing the FunctionWizardFactory interface you have to extend the AugmentationWizardFactory (eu.esdihumboldt.hale.rcp.wizards.augmentations.AugmentationWizardFactory). The wizard has to be based on the AugmentationWizard class (eu.esdihumboldt.hale.rcp.wizards.augmentations.AugmentationWizard).

Registering the wizard with the extension works exactly like registering a function wizard factory, just use the name of the augmentation wizard factory class instead of a function wizard factory class.

Provide new kinds of tasks

HALE allows generating tasks from the state of the alignment project. Those tasks will be visible in the Tasks view. Additional to the tasks that will be generated by HALE by default (e.g. tasks to map feature types from the target schema) you can implement a TaskProvider to provide new kinds of tasks.

Adding your custom TaskProvider to HALE is done using the Plug-in Manifest Editor in your Plug-in project. In the Extensions-tab add the extension with the ID given below (eu.esdihumboldt.hale must be a dependency of your project), create a new tasks element and specify the name, the TaskProvider implementation class, an ID and if the task provider shall be enabled by default.

ID of the extension point: eu.esdihumboldt.hale.task.TaskProvider
Interface to be implemented: eu.esdihumboldt.hale.task.TaskProvider

Before implementing a TaskProvider take a look at the implementations that already exist to get an idea of what a TaskProvider must fullfill. There are also some abstract implementations that can be reused in most of the cases (e.g. eu.esdihumboldt.hale.task.providers.schema.AbstractSchemaTaskProvider). Keep in mind that the tasks generated must be invalidated when they no longer apply.

Adding support for an additional mapping export format

Similar to TaskProviders a MappingExportProvider can be added through an extension point to support an additional mapping export format. The MappingExportProvider makes use of the alignment model used in HALE and can access the information about source and target schemas.

Adding your custom MappingExportProvider to HALE is done using the Plug-in Manifest Editor in your Plug-in project. In the Extensions-tab add the extension with the ID given below (eu.esdihumboldt.hale must be a dependency of your project), create a new MappingExportFactory element and specify the format name, the MappingExportProvider implementation class, a format description and the format file extension (e.g. *.goml).

ID of the extension point: eu.esdihumboldt.hale.MappingExport
Interface to be implemented: eu.esdihumboldt.hale.rcp.wizards.io.mappingexport.MappingExportProvider