Aria can be installed in a number of ways depending on the intended usage. At its simplest Aria can be downloaded and used as is. At the other end of the scale Aria requires a number of installations to access all features.
Aria can be downloaded from the SourceForge website at http://www.sourceforge.org/projects/aria . To download you need to register using a valid e-mail address. Once you have successfully registered you will be sent an e-mail with directions to the download site where you can download the version of Aria that you need.
As a registered user you will be able to subscribe to updates, newsletters and technical tips
Aria is a Java platform and therefore requires a recent Java development kit. You need to have a recent JDK (1.5) to run all the features, notably the NetBeans plug-ins. Otherwise, if you do not plan to use the editors you can use just about any JDK you like.
|
Component |
Usage |
|---|---|
|
Aria |
Aria can be used with just about any Java development environment. All you need do to begin working with Aria is add the AriaRuntimeCommon.jar module to your project's classpath. To use Aria in this way simple download the jar file and installed it somewhere that can be accessed by your development environment. |
|
NetBeans plug-in module |
The Aria editor is based on the NetBeans platform and is delivered as plug-in for the NetBeans IDE. Installation of this module is described in detail below. |
|
Eclipse plug-in module |
An Eclipse plug-in provides wizards for creation of projects and pages and supports editing and debugging of Aria projects. |
On the files release system you can obtain a number of variants of the Aria platform and these are described below. The files are delivered in two variants, one containing non-debug version of the class files and the second compiled with full debug information and include all logging and diagnostic features switched on:
|
Component |
Usage |
|---|---|
|
AriaRuntimeCommon.jar |
This Jar contains all the class files needed for core Aria development using the AWT widget set. |
The Aria Jars are compiled for a number of JDKs and accordingly have slightly different feature sets. The fullest feature set is for the most recent JDK.
For mobile and embedded devices the above packaging may not match a platforms capabilities so you may want to compile the source code for the platform that suits your needs. All the source and the build files are available, so you can tweak the feature set to suit your needs. For example, some mobile platforms include Swing and JDBC connectivity while others don't, depending upon the level of compatibility provided. Therefore to avoid proliforation of the number of versions compiled we have stuck to the core JDK when building pre-packaged versions of Aria.
The Aria jars are not signed, since you may need to sign the jars with a single certificate to distribute via Java Web Start. Therefore you need not stick to the packaging provided by the pre-built jars. For a minimal footprint you may even want to strip down the jars so that you only include thoses classes that you absolutely need. However, please ensure that you observe the licensing requirements in this regard if you change or alter the distribution.
Aria includes a NetBeans plug-in for rapid development. Most of the features of Aria are used and accessed via this plug-in and it is therefore most likely that you will also require a version of NetBeans. At the time of writing the target version of NetBeans is version 5.5. Java version 1.5 (JDK 1.5) is also required to run this version of Aria
NetBeans can be downloaded from http://www.netbeans.org.
The NetBeans site also contains extensive documentation of installing and using the IDE.
Once Aria has been downloaded. The NetBeans plug-in is delivered as a NetBeans module file with the .nbm extension. To load the module you must first start NetBeans. Once started go to the Update Center on the tools menu.
Then choose the ` Install Manually Downloaded Modules (.nbm files)' option. Select the four NetBeans modules: javax-jnlp.nbm, net-aria.nbm. The first of these are the module for the open source Aria module and the third is the module for Aria's add-on features.
When the NetBeans module has been successfully installed the Aria menu item will appear on the main menu.
If you are just installing Aria and AriaEditor, then you can check that the installation has succeeded by check that the New Aria Project wizard is available from the File | New | Project menu option.
A number of samples are available on the Formaria website. The samples files are simple zip archives of complete projects. To begin working with the samples you can simple download the archive and unzip the archive and open the project using the NetBeans File | Open command. The samples provided with Aria are listed below:
|
Sample |
Description |
|---|---|
|
Hello World |
The classic introduction. |
|
Navigation |
A simple example showing how to navigate within an application. |
|
Translation |
An example showing how translations can be setup and used. |
|
Counter |
A very basic calculator showing how to link in Java code to add custom logic to an application. |
|
Address Forms |
Some simple forms showing the key concepts of data binding and validation. |
|
Mortgages |
A more complete example showing how to build a working example. This example is also used as a tutorial on how to use Aria. |
In addition to the samples listed above the source code for the case studies included in this guide can also be downloaded. New samples are occasionally added to the website and it is probably worth checking for updates (http://www.formaria.org). The Formaria website also features numerous technical articles describing new and key features.
Like the NetBeans plug-in the Eclipse plug-in provides interactive editing of Aria and Aria applications. The plug-in is easy to install, just unpack the zip archice and drop the enclosed jar into Eclipse's plugin folder and restart the IDE.
When Eclipse restarts you should see the Aria project wizard under the File | New | Other dialog. At present there is no Eclipse version of the Aria plugin.
Building Aria from the source code is possible within both the NetBeans and the Eclipse IDEs. All of the source is available from the SourceForge repository. The project's SourceForge.net Subversion repository can be checked out through SVN with the following instruction set:
|
svn co https://aria.svn.sourceforge.net/svnroot/aria aria |
(Warning: This is a generic Subversion checkout command which will pull all modules, tags and/or branches of the project).
The source code is laid out in a number of packages, as follows:
|
Folder/Package |
Role |
|---|---|
|
AriaRuntimeCommon |
Contains all the source code, resources and build files for the runtime libraries. |
|
AriaEditorCommon |
Source common to both the NetBeans and Eclipse projects |
|
AriaEditorEclipse |
An Eclipse specific project for building the Eclipse plugin |
|
AriaEditorNetBeansSuite |
A collection of projects for building the NetBeans plugin. Most of the sub-projects are merely wrappers for the plugin's dependancies. |
|
AriaMobileMidp |
A version of Aria for MIDP. This project is developed in parallel to AriaRuntimeCommon and has diverging source. |
|
lib |
A collection of libraries needed for the Aria projects. |
|
other |
Contains non Java code for `other' clients stubs. |
|
samples |
A collection of sample projects and utilities |
|
docs |
The source FrameMaker documents that go to making up this manual. |
The runtime libraries are built using the latest version of NetBeans (6.1 at the time of writing), using the AriaRuntimeCommon project. The project also uses JDK 1.6, although it compiles for earlier JDKs.
To build the runtime you will need to download the main project plus the following libraries or packages from the lib folder described above in See Top level projects.:
|
Library |
Description |
|---|---|
|
beanshell |
Libraries for BeanShell scripting support |
|
commons |
Apache Common libraries. including commons-codec . |
|
|
The Google translation service API |
|
hsqldb |
The hsqldb library which is used in some samples for off-line or lightweight database access. Aria includes some support for packaging hsqldb databases in the jars distributed with Java Web Start |
|
itext |
The iText library for PDF generation (export functionality) |
|
jakarta |
The Jakarta regular expression library, plus the BCEL library for byte code manipulation (used for DTO class generation). |
|
jdic |
SwingLab's JDIC project used for system tray and browser integration. |
|
jmf |
The Java Media Framework used for video and audio support. |
|
netscape |
Netscape's JavaScript integration support |
|
jxl |
Excel export |
|
jgoodies |
JGoodies look and feel support libraries |
|
multisplit |
SwingLab's MultiSplit layout manager (incidentally maintained by Aria contributors). |
|
swt |
Eclipse SWT libraries |
|
tomcat |
The servlet API |
|
svgSalamander |
SVG widget and rendering support |
|
tablelayout |
An advanced layout manager |
|
timingframework |
SwingLab's animation and timing library |
|
xalan |
XML support |
In addition to these libraries, some libraries from the Java runtime and JDK are employed. All of these libraries are referenced from relative paths, so if you download the libraries, preserving the directory structure the project should build without modification.
The default build target will generate the runtime libraries in a number of forms:
|
Library |
Contents |
|---|---|
|
AriaRuntimeCommon.jar |
The complete runtime library include all versions of the widgets. |
|
AriaRuntimeCore_<version>.jar |
The core library minus any widgets |
|
AriaRuntimeAwt_<version>.jar |
The AWT specific widgets |
|
AriaRuntimeSwing_<version>.jar |
The Swing specific widgets |
|
AriaRuntimeSwt_<version>.jar |
The SWT specific widgets |
The version number is appended to the library name in the form version_date, for example AriaRuntimeCommon_1.0.0.v20080726.jar . At present the build produces a Java 6 version , but this will be extended to include support for earlier JDKs and when this is done the JDK version will also be appended to the jar name.
The default build will also copy the AriaRuntimeCommon.jar file to the libs/aria folder which is references by many of the sample projects and applications, so that these applications are always using the latest build. Periodically this library is also commited to SVN (when any significant change is made).
Once you have built the runtime environment as described above you can begin to build the NetBeans plugin. The plugin relies on the runtime, running on the same code as the end user applications, but for distribution as part of a plugin the runtime must first be bundled as an installable module for NetBeans.
Indeed, this process of wrapping the runtime libraries or dependancies is used for all the extrenal jars needed by the plugin and for wrapping the code shared with the Eclipse plugin. A suite of modules is therefore used to create the plugin, and this is called the AriaNetBeansSuite .
The source and project files for all plugin modules is again available from the SourceForge SVN repository (see See Subversion access.). To build the project first open the AriaNetBeansSuite project, when this is opened you will be prompted to open all the module projects within the suite. Most of these modules are merely static wrappers for the plugin's libraries, apart from the following:
|
Folder/Package |
Role |
|---|---|
|
AriaRuntimeCommonModule |
Contains all the source code, resources and build files for the runtime libraries. |
|
AriaRuntimeCommonModule |
A wrapper for the runtime library, the library wrapped by this module is updated dynamically when the module builds, so it wraps the latest runtime library. |
|
AriaEditorCommon |
Source common to both the NetBeans and Eclipse projects |
|
AriaEditorCommonModule |
A wrapper for AriaEditorCommon project, operating in the same way as the runtime module so that the wrapper uses the latest build of the common module |
|
AriaEditorNetBeansSuite |
A collection of projects for building the NetBeans plugin. Most of the sub-projects are merely wrappers for the plugin's dependancies. |
All the projects have dependancies on the required modules so doing a clean and build on the suite will build everything, including the runtime environment.
The project can be built within NetBeans project view by right clicking on the AriaEditorNetBeansSuite project and choosing Build NBMs . The result of the build is a set of NBM files in the AriaNetBeansSuite/build/updates folder together with the updates.xml file.
Once the modules have been build you can either deploy the contents of the directory or launch the editor in a hosted version of NetBeans by clicking either Run or Debug
The process for building the Eclipse plugin is pretty much just a case of downloading the sourec from SVN, opening the project and building. The Eclipse plugin is a single project contained in the AriaEditorEclipse folder.
One possible complication is that the ARIA_PROJECT_ROOT variable needs to be set. Within the Eclipse Window | Preferences | Java | Build Path | Classpath Variables dialog the variable can be added or configured to suit your environment's setup.
t present the sample applications are only setup within NetBeans. Most of the applications are self contained and refer to libraries within the Aria SVN hierarchy (within the libs folder). One exception to this is the MetroBank example that contains a web server application which relies on the Spring framework.
Since the Spring framrwork is a large and complex environment it is not included with the Aria SVN repository and is instead referenced by the project via some private settings. Within the nbproject/private/private.properties folder there are some settings that will need to be adjusted to match your setup before the build will success. These settings are:
|
Setting |
Role |
|---|---|
|
spring.libraries=C:\\Tools\\spring-framework-2.5.4\\lib |
Points to the root folder of the Spring distribution. Use Spring 2.5.x. See http://www.springframework.org/ |
|
spring.modules=C:\\Tools\\spring-modules-0.9-with-dependencies |
References the root of the Spring Modules installation. (see https://springmodules.dev.java.net/) |
|
spring.security=C:\\Tools\\spring-security-2.0.2 |
References the root of the Spring Security installation (formerly Acegi, see http://static.springframework.org/spring-security/site/). |
The Metrobank sample is split into two parts, the client and the server parts. More info about this example can be found later in this manual
This chapter provides a quick tour of the Aria editor within NetBeans. The main features of the editor and the main steps involved in creating an application are described. The chapter is intended only as an introduction so that you can begin exploring the features built into the editor. Later chapters will cover each of the topics in more detail.
NetBeans includes a range of templates for creating various pieces of applications. The Aria templates are unsurprisingly listed under the Aria heading.
To access the templates choose File | New from the main menu.
The templates included in Aria are as follows:
![]() |
To create a new project choose the New Project template. The template is shown below.
![]() |
To complete the template you must choose a directory into which the new project will be generated. To get started quickly you can just choose the default settings once you have set the target directory.
For the most part the options for creation of the new project are simple.
![]() |
The settings page also gives options for the project name, which is the name that will be used to identify the project within NetBeans. The application title is the text that appears in the application title bar, this is also the text that some operating systems used to identify the running application. The remaining settings affect the way the application is presented and behaves.
When the application first appears it can be centred on screen or it can appear in the top left of the desktop, the ` Center on screen ' checkbox controls this behavior. The application may also be embedded in an HTML page as an applet or it may be run as a standalone application. In either case it is possible to show the applet/application in a popup window. This window does not have the usual sizeable window border. The ` Popup Window ' checkbox controls this option.
The ` Window Size ' section is straightforward and simply lists some standard window sizes for the new application.
Optionally a Splash Screen can be include. The splash screen is simple an image that is presented as the application loads, the screen typically times out after a few seconds, or it can be dismissed with a user click.
By default the first page displayed is called ` welcome.xml ', but you can choose to display a different page at startup by entering the name of the first page. There is no need to specify the ` .XML ' suffix as this will be assumed, if there is no Java class called by the name of the startup page.
One option you should take care to set correctly is the package name. This can often be confused with a path and instead it is the Java Language package name. For anyone not familiar with package names the appendix gives a brief overview of this language feature
The ` Log level ' controls the amount of information that is displayed in the console while running the application. This applies only when running the application with debug versions of the libraries (the default in Aria).
The Frameset Configuration optionally allows you to configure your application as multiple pages within a single frame or as a single page. Sometimes a frameset is used when common elements repeat across multiple screens, say for example a navigational control panel or a banner headline.
![]() |
The project is configured with multiple files to help separate the various forms of content. The most important of these are listed in the ` File name configuration ' page.
![]() |
The final page of the new project wizard provides a place to configure some add-ons for Aria. These options are intended for more experienced users but essentially they allow you to extend the types of components, data bindings and validations that can be used in an application. The parameters are all class names. More details about these options will be given in later chapters.
![]() |
![]() |
Once the new project has been created the various folders and configuration files are setup. Some page stubs will also be created ready for you to start building content.
If you have any doubts about the options when creating the project there is no need to worry as all the options available in the new project wizard are also available on the project page. This page is opened once the initial generation of the project is finished.
Once the project is created it is shown in the Project view, which shows all the classes and packages within the project. The Files view shows all the files and resources that are used in the project.
The build.xml file is listed in this view and can be used to trigger actions such as the compiling, building and testing of the application.
A number of directories are created under the project's main directory or folder. The directories are as follows:
|
Folder |
Usage |
|---|---|
|
Pages |
Stores the XML page declarations. |
|
Lang |
Stores the language files used for translation of the application. |
|
Resources |
Holds various resources used in the project including graphics, configuration files and so on. |
|
Src |
The source code for the Java classes is held in this folder. Another folder (classes) may also be created depending on the configuration. The classes folder is a temporary folder and may be deleted at any time. |
Once a new project has been created the project is automatically opened. The project editor contains much of the information that was in the New Project template and allows you change the project settings at any time during the project lifecycle.
![]() |
At the top of the project view there is a set of buttons for access to additional parts of the project configuration. The options available in these windows affect all parts of the application, such as the page size and the frameset layout. Some of the options also affect the runtime behavior by adding extensions and modifying the classpath.
|
Note: Pages can be opened from either the Fi le View , but while they are visible in the Project View , they will not open and instead a message is issued requesting that you open the files from the File View instead. On non English versions of NetBeans this check will fail and you make experience problems. This is a known issue that we will attempt to fix. |
Creating a new page in Aria is again achieved by choosing File|New. A template is also used to create the page, but this time all you need to do is choose a name for the page and its location. The page should be placed in the `pages' subdirectory of the project.
![]() |
Later we will see how to add rules and Java code to the page and your will learn that the page name is used as the basis for a Java file. As Java is particular about class names it is best to conform to Java's naming conventions when choosing a page name. Thus the name should be a single word, starting with a capital letter.
Once a new page is created it is opened for editing in the editor. Here's an example of a simple page.
![]() |
At this point it is worth noting some of the overall features of the editor.
|
Section |
Description |
|---|---|
|
A |
On the left is a hierarchical view of the project and the filesystems used by the project. The filesystem corresponds to the Java classpath used by the project. Underneath the project folder are various folders into which the different categories of files and resources are saved. Notice the pages folder which naturally enough contains the pages belonging to the project. Below the navigator, you will find the Inspector window which shows the structure of the page being edited. Sometimes the Inspector can be useful for selecting components particularly if components overlap or obscure one another. The Inspector also provides access to features such as locking and unlcoking of the components. |
|
B |
In the centre is the editor area. The screenshot above shows the page designer. The page designer is docked in this area and other editors can be selected via a set of tabs along the top edge of the editor. As the editors are activated or deactivated they may cause other windows to appear or disappear according to the context. While the page designer is active several other windows are shown and docked into the right hand side of the main window. |
|
C |
On the right hand side are three windows. The component palette, the component inspector and the styles properties window. Also visible but not active is the component properties window which shares screen space with the style properties window. |
Pages can be opened on their own or within a frameset. To open a page with a frameset right click the page within the Files View and choose Open in frameset .
NetBeans also provides many features that will be of use to you as a developer from time to time. For example the Runtime view (not shown above, but accessible from the Window menu) provides access to runtime resources such as databases and servers. Using this view you can for instance drag a database table to a component on your page to establish a data binding, but we will cover this in more detail later in this manual.
At the top right of the editor, when the page designer is active you will see the component palette. The content of the component palette will depend on the type of application being developed and whether or not any extensions have been added to Aria.
As a minimum there will be several core components shown. These are:
|
Icon |
Component description |
|
|---|---|---|
|
|
A button object, usually used to initiate some event or action. |
|
|
|
A check box, indicating an option selectable by the user. Where options are mutually exclusive a set of radio buttons should be used. |
|
|
|
A drop down list or combo box, representing a list of choices. A drop down list is usually used where there is a small number of options or where the number of options is too great for a set of radio buttons. |
|
|
|
An edit field, an input field where the user can enter a simple value. An edit field is a key input mechanism and Aria provides support for validation of input data using edit fields. |
|
|
|
An image component. Used to display images stored in the resources folder. Can be used with a MouseHandler to interact with the user. |
|
|
|
A hotspot, a clickable area that can be placed over another object so that when the user click on the hotspot some action occurs. |
|
|
|
An imagemap, like a hotspot except that an irregular/polygonal area can be specified as the clickable area. Like a hotspot the user can click to invoke an action. |
|
|
|
A Label, a simple piece of text. The label text does not normally cause any interaction with the user |
|
|
|
A Panel, a container into which other components can be placed. The panel can optionally be made to display a frame or border. |
|
|
|
A password edit field, a special case of an edit field used for entering a password. As the user types the value of the password the field displays a mask character for each letter or character typed. |
|
|
|
A scroll panel, a special form of a panel that supports scrolling. The pane can optionally be scrolled horizontally or vertically. The scroll pane automatically adjusts itself to the size of its content. |
|
|
|
A table, a simple table component that can display data directly from the model. Headers and alternate row shading are just two of many features that the table control supports. |
|
|
|
A text field, a simple text field. This component supports multiple lines of text. |
The user can add any of these components to the page by first selecting a component from the component palette and then placing it by clicking at the desired location on the page.
Components can be nested by placing panels on the page and then placing additional components on the new panel. The panel is then considered to own the new components or children. When the panel is moved so too are the children.
As each component is selected the properties of that component are displayed in the properties palette, the style palette and the component inspector. Properties can be changed by choosing options within the properties palettes or by double clicking on styles. The component inspector is primarily a mechanism for showing the hierarchical relationship between components.
Multiple components can be inspected at once but only the common subset of the properties will be available in the various palettes and you may not always be able to interact with all properties.
When fully configured Aria may include several sets of components or widgets. The components belonging to these widget sets are displayed on separate tabs within the component palette. The availability of some of these widget sets may depend on the project configuration, for example if an AWT application has been chosen then the Swing widgets will not be available.
Styles in Aria comprise sets of colors and fonts that can be applied to just about any component. The style palette provides a simple way to interact with the styles, by simply selecting a component and double clicking a style value.
![]() |
Styles can also be changed by simply changing the style file or by changing individual styles (by right clicking on the style palette). Aria even includes a color scheme picker (which again can be accessed by right clicking on the style palette).
The color scheme picker is designed to allow you to quickly choose and experiment with styles that will produce a visually attractive application.
An application generally isn't a lot of use unless it can do something. Aria is designed to make it easy to build applications and therefore adding custom functionality and business logic is simple.
When you select a component you will see its properties in the property sheet. Depending upon the component type this property sheet may display some event properties. For example a push button will have an ActionHandler property. By typing in the name of the source code method you can edit the Java source code for that method, and if no such method exists the stub of a new method of that name will be inserted into you Java source code file.
Later we will see how such an event handler is actually connected up to the user interface. However it is worth noting that Aria declares such links in the page's XML. You can switch back and forth to this XML by clicking the ( Design and XML ) buttons at the top of the page designer.
Of course you can also find the Java code in the Files view and open the file directly. The file is just a normal Java file and there are no hidden or special sections to worry about.
For example to add a piece of application logic simple choose the component that will initiate the action and within the properties palette find the appropriate response and just enter the name of the response method. Upon pressing Enter the source editor is opened and you can edit the Java code belonging to the event. At any stage you can switch back to the page designer by clicking on the tabs above the source editor or by closing the source editor.
![]() |
The pageDesigner also allows you to selecting existing functions and attach then to a component. A list of available functions is displayed in the drop when you click on the event handler in the proeprty sheet, so if you do not want to enter the name of new event just choose one of the predefined functions if appropriate.
Once you have added a function and wish to jump to the source code, just hold the CTRL key while you click on the event handler and this will open the source code editor instead of editing the handler name.
In later chapters we will see just how to begin coding custom business logic.
As a technology Aria makes extensive use of XML. XML is used to describe a wide variety of things in Aria, including the user interface. The XML for a UI can be displayed by choosing the XML tab for that page. Furthermore Aria allows two-way editing of the XML whereby any edits to the XML will be reflected in the page and any changes to the page within the page designer will be displayed in the XML. The updates occur as the display is modified by choosing the tabs along the top of the editor.
Later chapters will explain Aria's use of XML in greater depth.
Writing code for an application is the first step in making working code. Java is a compiled language and therefore the source code needs to be compiled. The quickest and easiest way to do this is to right click on the project node in the Aria view. The context menu then shows a compile all option and choosing the Compile or Execute option will compile all classes within the project.
NetBeans also includes many options to control compilation, building and testing of an application and you should refer to the NetBeans documentation for more information on the available options.
Once the project has been successfully compiled you should test it prior to distribution. Aria and the underlying NetBeans platform provide a powerful testing and debugging environment. To test an application simply choose the Debug Project option from the popup menu on the tree icon for the project in build.xml file in the Files View.
Finally to make widespread use of your application you need to package and deploy the application. There are wide variety of deployment scenarios and these will be covered in detail in later chapters.
Again NetBeans provides additional plug-ins to help manage the deployment of application, including Java Web Start deployments, and you may wish to download some of these extra plug-ins. Aria generates a stub of a JNLP file that can be used by such plug-ins.