*
Metamerge logo
Search

Advanced Search
*
*
*
* HOME DOCUMENTS & RESOURCES DOWNLOADS EARLY TECH ACCESS SUPPORT FAQ KNOWN ISSUES OLD VERSIONS
*

Writing a new Connector

There are generally two ways of writing new Connectors. The first way is to write a script that implements a set of functions using your favorite scripting language. The second way is to write the Connector using Java.

Script based Connector

Read the documentation for the Script Connector and also take a look at the sample Outlook Connector. Both will give you the necessary information to roll your own Connector.

Java based Connector

Learning by example is probably the best way to learn new things. The source code for the HTTP Client Connector is freely available for download here and should give you a firm understanding as to how the Java based Connectors are implemented.

Building and Installing a Java based Connector

Follow these steps to get your Connector built and activated. The build instructions assumes you have installed the Java2 SDK and that those binaries are in your PATH.


1. In order to compile your code you must include rs.jar from the metamerge distribution in your classpath

javac -classpath \metamerge\rs.jar com\myname\HTTPConnector.java

2. Add your class files to a jar file ( myconnector.jar )

jar cvfM myconnector.jar com\myname\HTTPConnector.class

3.  Copy the jar file to a suitable directory, such as metamerge/myjars (avoid lib/ext directory in your Java2 runtime as it will prevent you from extending the existing connector classes at runtime)

4. Update the LAX.CLASS.PATH in  miadmin.lax and miserver.lax to reflect where your libraries are found.

5. Make the Connector available as a template

Using the admin tool add a Connector template with the following values:

Name:        MyConnector
Class:        com.myname.HTTPConnector

When you configure the Connector you will get a simple table with keywords and values. These key/value pairs are accessible to your Connector using the getParam function. You can also provide a form to enhance the configuration of your Connector. Add the following to your configuration file:

[form com.myname.HTTPConnector]
	title:The title
	
	parameterlist [
		myparam1
		myparam2
	]

	parameter {
		myparam1 {
			label:URL
			syntax:string
			default:http://localhost
		}

		myparam2 {
			label:Port
			syntax:droplist
			values [
				80
				8080
			]
			default:80
		}
	}
[end]

The parameterlist section lists the order in which the parameters are presented. The parameters section contains a subsection for each parameter and has the following keywords:

Keyword Value/Description
label The text shown in the form
default The default value for the parameter
description Descriptive text for the parameter. This text will appear when the user hovers over the label 
syntax
string One line text
textarea Multi line text
droplist Dropdown list with values
dropedit Dropdown list with value and edit box for user defined value
boolean Checkbox using "true" or "false" as value

 

 
*
  Metamerge Integrator version 4.5 ©Copyright Metamerge AS 2000-2002 Last edited 2002-04-30 contact us