|
|
Writing a new ConnectorThere 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 ConnectorRead 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 ConnectorLearning 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 ConnectorFollow 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.
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
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:
|
|
|