Using the Eclipse User Interface for Abator

See the Quickstart Guide for a quick start!

The Abator user interface consists of these elements

Configuration File Editor

The configuration file editor is a low function editor. In this release, it only provides enough functionality to be somewhat better than a plain text editor (like some color syntax highlighting). In future releases we hope to add more function to this editor. If you have some better XML file editor available in your environment, it will likely be a better than this editor. The editor is useful in a very basic Eclipse installation which has no other XML editor.

The editor is automatically associated with files named "abatorConfig.xml". If you are using a very basic Eclipse install, you might consider associating this editor with any XML file. In the Eclipse 3.1 version of the plug-in, we will associate the editor with any Abator configuration file, regardless of the file name.

New Configuration File Wizard

The new configuration file wizard will create a new XML file with a basic outline of a configuration file for Abator. You do not need to use this wizard, but it is useful for setting up a new configuration file.

You can access the wizard from the menu: "File>New>Abator for iBATIS Configuration File"

Run Abator Action

The run Abator action is the heart of the Eclipse user interface. The plug-in will add a popup menu option called "Generate iBATIS Artifacts" to any XML file that has the root element of "abatorConfiguration". To run Abator, right click on an Abator configuration file in any view and select the menu option.

Integrated Ant Task

The Abator plug-in declares an Ant task for use within the Eclipse JRE. The task is called "abator.generate". Here is en example Ant build file:

<project default="runAbator">
  <target name="runAbator">
    <eclipse.convertPath resourcepath="AbatorTest/src/config/abatorConfig.xml"
                         property="thePath"/>
    <eclipse.convertPath resourcepath="AbatorTest/lib/hsqldb.jar"
                         property="jdbc.driver.jar"/>
    <abator.generate configfile="${thePath}" >
      <propertyset>
        <propertyref name="jdbc.driver.jar"/>
      </propertyset>
    </abator.generate>
  </target>
</project>

This file uses the Eclipse supplied "eclipse.convertPath" task to calculate the actual path of the configuration file and the JDBC driver. Then we use the "abator.generate" task to run Abator. When running this from Eclipse interactively, the Ant launch must be setup to run in the same JRE as the workspace. This setting is a standard configuration setting for running Ant in Eclipse.

The task supports an optional nested <propertyset> element which is the standard Ant property set type. This can be used to pass parameters into a configuration file. For example, the above property jdbc.driver.jar can be accessed in the Abator configuration file with the escape sequence ${jdbc.driver.jar}