Consortium    Solutions    Middleware    Forge    MyObjectWeb 
ObjectWeb Consortium
Print

Advanced - Powered by Google






Apollon

Project Links
· Home
· Download & Install
· Code Generation
· GUI Customizing
· Mailing List
· License

Developers' Corner
· CVS Repository
· ObjectWeb Forge Site

About
· Contact

Usage of Apollon

Apollon provides several code generators, from simple Zeus wrapping to GUI elements. In this documentation we will use the provided ANT file for code generation : apollon_run.xml .

Command Line

The apollon_run.xml file has been setup during Apollon's compilation process. This ensures that classpathes and other properties are correct, but this also means that Apollon has to be re-built when moved from a directory to an other. To use the file, simply do the following :

$ ant -f apollon_run.xml
        

This generates a demonstrator framework based on the provided demo.dtd file, for which a GUI can then be displayed with the gui script.

We will now see how to use your specific DTD file.

The apollon.properties File

This file sets up the ANT properties used during code generation.

The DTD file

apollon.dtd.file = <directory>/dtd/demo.dtd
        

This locates the DTD to be used for code generation.
It is highly recommended to copy your DTD in the same directory, although this is not mandatory.

The root element

apollon.dtd.root.name = demo
        

This indicates to Apollon the root element of your DTD. In some cases, it could be automatically determined, but in the case of redundant DTD structures, it has to be specified. Its definition is then recommended.

The target package

apollon.generated.package = apollon.editor.demo
        

This property defines the target package for the generated code. The specified package will contain 'basic' Zeus classes, and subpackages for enhanced frameworks (i.e. Apollon's bean-based parser, Swing classes, and Browser-based framework).

The target prefix

apollon.generated.prefix = apollon/editor/demo
        

This property will soon be removed. It is only used in ANT for Java compilation of the generated packages. Its content may be the same as apollon.generated.package, replacing . with /.

Displaying the GUI

Once achieved a first code generation, the Apollon GUI can be used for the edition of XML files based on the compiled DTD :

$ gui
        

In this GUI, you can either choose to create a new file, or open an existing one.

File extensions

Default behaviour of the Apollon GUI is to use the DTD root element name as the expected file extension of XML files to be handled by the generated framework. For example, the demo.dtd compilation will setup the Apollon GUI to only open .demo files.

The managed_extensions file must be edited to change this default behaviour. In our demo example, its content is :

demo>apollon.editor.demo,
        

Which means files with the demo extension will be opened using the apollon.editor.demo package. To use XML files with the XML extension, the file has to be modified this way :

XML>apollon.editor.demo,
        

Copyright © 1999-2005, ObjectWeb Consortium | contact | webmaster | Last modified at 2005-06-01 10:51 AM