Developer Guide
[ 3 ] - Objects
< Back Next >The core of a Meta Extension is its Objects. Think of these objects as building blocks that are connected together like lego bricks to create the extension. There are three categories of Objects. View Objects which describes what your extension looks like. Data Objects which specify properties, values and the structure of the data used by your extension. Finally Function Objects which describes what your extensions does. You don't code these Objects instead you describe them using an XML mark up declarative language called the Appxweb Meta Language (AML).
So what do you have to know to be able to to delcare a Meta Object used by your extension? In two words Copy Paste. Go to the Meta Object reference information under the Reference section of the developer resource. Find the object you are interested in. Say a toolbar. Click on it in the object chart. Copy the declaration and paste it into your text file. Change the values to suit your extension and delete the optional parameters your not interested in.
As an example the complete declaration of the application objects used by Hello World is below.
Hello World - Meta Object Declarations
| extension.xml |
Let's examine this declaration. The first thing to notice is the overall structure with the respective data, view and funciton object declartion under an application object. The package object is described in Section 8 - Packaging and Deployment of this guide. This structure is shown below.
Starting with the first data object with an identifier of "did_message". This data object is a scalar, ie it holds only one value, compared to say an array which hold many values. This data object "did_message" is used to store the Hello World message text.
| Data Object - did_message |
The value of this data object is able to be edited within the message input dialog. The declaration of the message input dialog is reproduced below. This is a view object and its identifier is "vid_dlg_message".
| View Object - vid_dlg_message |
The dialog has the title of "Message", is 400 pixels wide and 190 pixels high and uses HTML resource "dlg_message.html" shown below. The data object "did_message" is bound to the input element within the HTML resource "dlg_message.html". Binding is discussed in detail in [ 3] Binding.

To display this dialog a render function object is used. In our case the render function object has an identifier of "fid_dlg_message" and is called when the "Message" button of the main toolbar is clicked. The declaration of this render function object is presented below along with the partial declaration of the "Message" button which is part of a toolbar view object.
| Render Function Object - fid_dlg_message |
| Toolbar View Object - vid_tb_hello_world |
When examining these declarations the important thing to note is how relationships between objects are created simply by referencing the object's identifier as highlighted in the figure below.

As a final example the declaration of the Hello World main window is shown below.
| Window Object - vid_wnd_hello_world |
The identifier of this window object is "vid_wnd_hello_world". The object's user interface is created by referencing a toolbar object "vid_tb_hello_world" and a context menu object "vid_menu_format." The window also uses the HTML resource "wnd_hello_world.html".
