4.5.1. < 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>
4.5.2. < AppML > Security ¶
< AppML > Security is set through the security attribute in the < AppML > tag.
<appml security="artists">
The above application begins with security definition attributes, and only artists users are allowed to log in.
In this case, the user name logged in must be a member of the “artists” group.
4.5.3. < datasource > element ¶
The < datasource > element applied by < AppML > defines four different data types: element Description < database > Define data types < xmlfile > Define XML source files < csvfile > Define a comma-delimited text fileChild element (only one can be applied) ¶
4.5.4. < database > element ¶
The < database > element defines the database element Description < connection > Link database name < execute > SQL statement executed before data retrieval (optional) < sql > SQL statements for retrieving data < maintable > Master table of the application (optional) < keyfield > Key field of the main table (optional)Child element ¶
4.5.5. Data stored in the SQL database ¶
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 above model can select three data options (Artist, Title, Country) from the “CD_Catalog” table of the “CDDataBase” database.
The number of rows returned as a result is unknown.
4.5.6. Data stored in XML files ¶
< AppML > can read data from a XML file: This method stores data in a XML file on the server.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>
4.5.7. Data is stored in a text (Text) file ¶
< AppML > can read data from a text file: This method can store data in a text file on the server.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>
4.5.8. You can create a database if you want. ¶
< AppML > you can create a database if necessary:
<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 the rapid prototyping model!