How AppML
This section will be the following four simple steps demonstrate how to create a <AppML> application.
The next chapter describes how to download <AppML>, and began developing Web applications on your own computer.
1. Create a model (Model)
Create a file with the following content
<datasource>
<database>
<connection>Demo</connection>
<sql>SELECT CustomerName,ContactName,City,Country FROM Customers</sql>
<orderby>CustomerName</orderby>
</database>
</datasource>
<filters>
<query>
<field>CustomerName</field>
</query>
</filters>
</appml>
In the subdirectory Models (we recommend) save the file as Customers.xml.
Model Analysis
<Appml> tag defines the model.
<Datasource> tag defines the data source model.
<Database> tag definition database.
<Connection> tag defines a database link.
<Sql> tag defines data query
<Orderby> tag defines the default sort.
<Query> tag defines a legitimate query filters.
2. Create WEB page
In the first <AppML> app, create an HTML page:
Examples
<html>
<body>
<h1>My First Web Application</h1>
<table>
<tr>
<th>Customer</th>
<th>City</th>
<th>Country</th>
</tr>
<tr>
<td>Alfreds Futterkiste</td>
<td>Berlin</td>
<td>Germany</td>
</tr>
</table>
</body>
</html>
try it"
3. Add style
Adding Cascading Style in your web page, in the implementation of e <AppML> app:
Examples
<html>
<head>
<link rel="stylesheet" href="appml.css">
</head>
<body>
<h1>My First Web Application</h1>
<table class="appmltable" >
<tr>
<th>Customer</th>
<th>City</th>
<th>Country</th>
</tr>
<tr>
<td>Alfreds Futterkiste</td>
<td>Berlin</td>
<td>Germany</td>
</tr>
</table>
</body>
</html>
try it"
4. Add the script, and then execute the application
Add the script to your web pages to run <AppML> app:
Examples
<html>
<head>
<link rel="stylesheet" href="appml.css">
</head>
<body>
<h1>My First Web Application</h1>
<div id="Place01">
<table id="Template01" class="appmltable">
<tr>
<th>Customer</th>
<th>City</th>
<th>Country</th>
</tr>
<tr id="appml_row" >
<td> #CustomerName# </td>
<td> #City# </td>
<td> #Country# </td>
</tr>
</table>
</div>
<script src="appml.js"></script>
<script>
app=new AppML("appml.htmlx","Models/Customers.xml");
app.run("Place01","Template01");
</script>
</body>
</html>
try it"
Examples of analytical
<AppML> library contains a number of functions. These functions can then call your web page.
<script src = "appml.js"> loaded <AppML> library.
JavaScript statement: app = new AppML ( "appml.htmlx ", "Models / Customers.xml"); AppML create application objects, and then perform web server-side scripting "appml.htmlx" to load data "Customers.xml" file.
JavaScript statement app.run ( "Place01", "Template01 "); insert data into the id = "Place01" HTML element, use id = "Template01" attribute of the element as a template.
Property id = "appml_row" defines each data into HTML elements.
Data # tag data will be used to replace the model.
All of the above, you can imagine a faster prototype it?
How does it work?
- When the web page is loaded, you can then load the page <AppML> controller.
- Use <AppML> controller, you can then create a page <AppML> object.
- When you run <AppML> objects on the page, it requests the server data controller.
- <AppML> object receives data (data model) from the server.
- <AppML> Object (or your code) to display data on the page.
- (Optional) web user can change the data.
- (Optional) <AppML> server can send data in the background.
- (Optional) Controller server can store data on the server side.
Typical Web files and folders:
Data folders: Data Image Folder: Images Model folder: Models Applications: Demo.htm Style: Demo.css <AppML> Profile: appml_config.php (or .htmlx) <AppML> Style File: appml.css <AppML> Browser Controller: appml.js <AppML> Server Controller: appml.php (or .htmlx) |
unlimited
<AppML> object can be placed in HTML pages. <AppML> does not affect the rest of the page.
<AppML> default to the standard display page when the page program does not exist. This is perfect for rapid prototyping.
But <AppML> main function is not used to display the page. <AppML> mainly read application data. It brings data can be free to use HTML, CSS, and JavaScript to design their display. You can:
- I have written HTML, let AppML processing data.
- Call model and handles all of the display.
- AppML properties and methods, and create other combinations.
You will soon discover <AppML> with powerful features, it can provide data and models for your web application. You can:
- For users or groups of users to define data security
- Connect all types of databases, such as Access, MySQL, SQL, and Oracle
- Connection XML files and Text files
- Defined data types, data formats, data limits.
- Add any new elements to the model.