<apppML> Reference


The <AppML> Data Model:

<appml security="security">

<datasource>
Datasource definition goes here
</datasource>

<filters>
Filter definitions goes here (if any)
</filters>

<update>
Update definitions goes here (if any)
</update>

<anything>
Anything you want to add to the model
</anything>

</appml>


<AppML>Security

<AppML> security is taken care of by the security attribute in the <AppML> tag.

<appml security="artists">

An application starting with the security defined above, can only be run by a user logged as an artist.

In this context, the user must be logged in with a username defined as a member of the group "artists".


The <datasource> Element

The <datasource> element defines the 4 different types of data sources an <AppML> application can have:

Sub Elements (only one can apply)

Element Description
<database> Defines a database source
<xmlfile> Defines an XML source file
<csvfile> Defines a comma separated text file


The <database> Element

The <database> element defines a database source.

Sub Elements

Element Description
<connection> The name of a database connection
<execute> SQL to be executed before data retrieval (optional)
<sql> The SQL statement for retrieving data
<maintable> The main table for this application (optional)
<keyfield> The key field for the main table (optional)


Data Stored in SQL Databases

This is the most common solution for data oriented applications.

<datasource>
<database>
<connection>CDDataBase</connection>
<sql>SELECT Artist, Title, Country FROM CD_Catalog</sql>
</database>
</datasource>

The model above selects three data items (Artist, Title, Country) from a table called "CD_Catalog", in an SQL database called "CDDataBase".

The number of rows returned is unknown.


Data Stored in XML Files

<AppML> can read data from XML files:

Example

<appml>

<datasource>
<xmlfile src="cd_catalog.xml">

<record>CD</record>

<item>
<name>Title</name>
<nodename>TITLE</nodename>
</item>

<item>
<name>Artist</name>
<nodename>ARTIST</nodename>
</item>
<item>

<name>Country</name>
<nodename>COUNTRY</nodename>
</item>

</xmlfile>
</datasource>

</appml>

Try it yourself »

This method makes it possible to store data in XML files on the server.


Data Stored in Text Files

<AppML> can read data from text files:

Example

<appml>

<datasource>
<csvfile src="cd_catalog.txt">

<item>
<name>Title</name>
<index>1</index>
</item>

<item>
<name>Artist</name>
<index>2</index>
</item>

<item>
<name>Price</name>
<index>5</index>
</item>

</csvfile>
</datasource>

</appml>

Try it yourself »

This method makes it possible to store data in Text files on the server.


Create a Database if Needed

With <AppML> you can also create a database if needed:

<database>
<connection>CDDataBase</connection>

<execute>
CREATE TABLE CD_catalog (
CD_Id INT IDENTITY,
Title NVARCHAR(255),
Artist NVARCHAR(255),
Country NVARCHAR(255),
Company NVARCHAR(255),
Price NUMBER,Published INT)
</execute>

</database>

Perfect for rapid prototyping!



Color Picker

colorpicker