ImpEx:WritingDrivers

From Cerberus Helpdesk Wiki

Jump to: navigation, search

(Some steps in these instructions assume a Unix-based development environment. For Windows you can use TortoiseSVN to access Subversion. Since Eclipse runs on most major platforms, the majority of the instructions will be platform agnostic.)

Contents

Requirements

Setting up the development environment



Creating your driver sub-project

You're now ready to create a new sub-project for your own driver.

Writing your export driver

At the very minimum your exporter will need a 'Driver' class that is responsible for reading the configuration file provided by the user. Each exporter is completely free to define the possible options in its configuration file template. We'll cover this more in the following steps.





Distributing your exporter

Exporter drivers are distributed as JAR (Java ARchive) files -- which are essentially just ZIP files with a special manifest.

Running your exporter (from Eclipse)

Running your exporter (from the command-line)

Actually doing something useful

Up to this point we've demonstrated how to create a new driver with its own configuration file and how to run it. Since your driver may read from any datasource, this should provide you with a clean starting point.

You can look at the code for Cerb2Exporter and Cerb3Exporter for examples of working with JDBC database queries and writing XML using Dom4J. You should use Dom4J to write your output XML since it's provided by the project already.

Any driver worth its disk space will need to write output files that can be read by Cerb4's import system. Here's a reference of the XML format for the currently supported import objects.

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox