You are hereAria User Guide / Section III: In Depth / Visualization
Visualization
The data model which is built into Aria is a very powerful and versatile data storage mechanism, however, it can become quite difficult to navigate its multi layered hierarchy from a debugger. This is where the visualizer comes into its own.
The data visualization built into Aria is meant to be used as part of your development, debugging and testing but is not meant to be deployed as part of the final release application.
Using the Visualizer within the Aria Editor
Start the Aria editor in NetBeans and click the
Aria|Visualization|Show the data visualizer
menu.
The visualizer will appear docked in the NetBeans IDE and will reflect the data which is contained in the files referenced from the
datasets.xml file. As you reference parts of the model from the components will build itself and you can use the visualizer to simplify the binding of components
- The left pane contains a tree which allows you to navigate all of the paths in the data model.
- When you click a node in the tree its attributes are displayed in the structure table on the top right of the window. This table will always include the `value' and `id' attributes regardless of whether they contain data or not.
- The refresh button below the model tree needs to be clicked whenever a change to the model has taken place if you want a true reflection of the current state of the data model.
- The toolbars above the data model and attributes tables offer a number of extra options for manipulation of the model. Some of these options are also available on the node's popup context menu.
|
Icon/Tool |
Purpose |
|---|---|
|
|
Refresh the model |
|
|
Adds a new node to the model |
|
|
Deletes the current node from the model |
|
|
Edit the model node |
|
|
Rename the model node |
|
|
Add a new attribute to the model node. This method does not prevent duplicates |
|
|
Delete the selected attribute from the model node. The standard attributes (id and value) cannot be deleted |
|
|
Copy to the model path to the clipboard. The full path of the selected node is placed on the clipboard. This value can then be pasted as text. |
The right pane of the Visualizer contains two tabs: structure and visualizer.
The structure tab contains a table displaying the selected model's attributes and its values. The third
runtime
column indicates whether the attribute is also available in the runtime mode (some attributes are used only to configure the datasource in the Visualizer and thus are not visible in the runtime mode, the example of that is POJOs getter attribute).
The
visualizer
tab is used for rendering data model nodes in a way that is specific to the selected data type. For instance, with the database table node selected in the visualizer's tree, the tab will contain a JTable component reflecting the data from the selected table
The visualizer tab can be used also for setting some specific model nodes configuration. The example of that is a panel that allows the user to specify values of the POJOs property parameters (in other words: to specify parameters of the getters which define POJO properties).
If you wish you can pre-define your model in one of the dataset files then you can start binding your screen components more easily. For example you can define the following nodes in the model
Predifined model
<datasets> <dataset id="${getCustomerID()}"> <data value="" id="surname"/> <data value="" id="dob"/> <data value="" id="firstname"/> <data id="gender"/> <data value="" id="title"/> <data value="" id="address1"/> <data value="" id="address2"/> <data value="" id="address3"/> <data value="" id="postcode"/>
Now, open the customer details page and click on the
customer surname
edit field. Expand the data model in the visualizer and double click on the node
${getCustomerID()}/surname
. You will see the data property for the component change to this value and any time you click on this component the visualizer will automatically select this node.
Setting up database table binding using the Visualizer
|
Step |
Action |
|---|---|
|
1 |
Open the runtime view from the window menu, expand the Databases node and establish a connection to the database containing a table which you want to bind. The available database tables will appear under the Tables node in the Runtime Tab. |
|
2 |
Drag and drop the selected table from the runtime|database node to the Data node displayed in the Visualizer. The table will appear in the data model hierarchy and will configured and registered in the data model so it can can used in a standalone application. |
|
3 |
Once the table is registered its data can be viewed under the Visualizer tab. |
|
4 |
Drag and drop the table node from the Visualizer to a component that you wish to bind it to. |
|
5 |
As the table node is dropped you will be asked to configure some properties of the bindings in the popup dialog (in most cases the default values will suffice). |
|
6 |
Once the dialog is closed (by pressing OK button) the binding will be set and configured. The Data property of the component will get the specified value. |
Debugging with the Visualizer
The visualizer makes it easier to debug your Aria applications as it provides you with an up to date representation of the datamodel at any given time. When you start a debugging session for a Aria application from netBeans the visuaslizer will automatically update with the state of the model. It will start from the root of the project's model and create the entire model hierarchy.
- Printer-friendly version
- Login or register to post comments