Table of Contents
- Downloaded Eclipse IDE for Java Developers
- Installed Java JDK
- Working automaIT Server with at least one attached agent
- automaIT XSD files (found under
Eclipse will be used as development environment. It is possible to use any editor but since a all model elements are defined with automaIT's XML based DSL, it is advisable to use some kind of editor supporting XML. The Eclipse IDE packs some handy features when working with XML like XSD validation and auto completion.
Unzip the eclipse archive to a location of your choice. Start eclipse with
Select a folder where the workspace should be placed. The workspace contains all configuration elements and project resources created with eclipse.
Leave the welcome screen by clicking on Workbench.
This is the default layout. Task List and Outline won't be useful for now and can be closed.
Open File > New > Project and select General > Project. At the next step name the project XSD and finish. Copy all automaIT XSD files into the project folder.
Open Window > Preferences > General > Editors > Text Editors
Check Insert spaces for tabs and Show line numbers.
Open Window > Preferences > XML > XML Catalog and click Add. In the dialog select Workspace go to the
XSD project and select
model.xsd and confirm. This step publishes the automaIT XSDs so that eclipse can validate the XML files.
The Template Project
There is a template project which can be used to start the development of an automaIT plugin: info.novatec.automait.Template.tar.bz2 Copy the file into your workspace folder and unpack it.
Now got to Eclipse and open File > Import > General > Existing Projects into Workspace and in the next step select the extracted folder and finish the dialog.
Now you can copy this project each time you want to create a new automaIT plug-in.
Building a Plug-In
Building an automaIT plug-in simply means to zip it into a
.jar file. This is already implemented in the
build.xml inside the project. To execute a build right-click in build.xml and select Run As > Ant build.
The console view will contain some information about the build. If everything was successful one of the last line contains the path to the new plug-in .jar file. After running a build once it is added to the External Tools menu. The last build can be repeated by clicking on that icon.
Creating Plans and Components
Eclipse has a built-in feature to create a minimal
.xml file that satisfies a given
.xsd. This can be used when creating a new plan or component. Open File > New > Other > XML > XML File and click next. Choose a path and file name and click next. Choose Create XML file from a XML Schema file and click next. Now choose
plan.xsd from the
XSD project depending on what you want to create. Finish the wizzard. Eclipse will open an editor with the new
The namespace definition (
tns) can be removed. The required field
name must be filled with the component name. In case the component is used for a plug-in a
path should be set. Since the schema file was added to the xml catalog in Eclipse the schema definition in the
xsi:schemaLocation attribute can be removed as well.
Now, if you put your mouse cursor between the opening and closing
component tag and press Ctrl+Space you get an autocompletion dialog suggesting all the elements that are allowed at this place. This makes development a lot easier since you also can browse the statements for their comments.