How to Use <AppML>
This chapter will demonstrate how to create an <AppML>
application through the following 4 simple steps.
The next chapter will introduce how to download <AppML>
and start developing web applications on your own computer.
1. Create a Model
Create a file with the following content.
Save the file as Customers.xml in the Models subdirectory (we recommend).
Model Parsing
The <appml>
tag defines the model.
The <datasource>
tag defines the model's data source.
The <database>
tag defines the database.
The <connection>
tag defines the database connection.
The <sql>
tag defines the data query.
The <orderby>
tag defines the default sorting.
The <query>
tag defines valid query filters.
2. Create a Web Page
In your first <AppML>
app, create an HTML page:
Example
3. Add Styles
Add cascading styles to your web page when executing the <AppML>
app:
Example
4. Add Scripts, Then Run the Application
Add scripts to your web page to run the <AppML>
app:
Example
Example Parsing
The <AppML>
library contains a multitude of functions. These functions can be called in your web page.
<script src="appml.js">
loads the <AppML>
library.
JavaScript statement: app=new AppML("appml.htmlx","Models/Customers.xml");
creates an AppML application object, then executes the server-side script "appml.htmlx" to load data from the "Customers.xml" file.
JavaScript statement app.run("Place01","Template01");
inserts data into the HTML element with id="Place01", using the element with id="Template01" as the template.
The attribute id="appml_row"
defines where each data entry is inserted into the HTML element.
Data in the markup will be replaced with data from the model.
Can you imagine a faster prototyping process?
How It Works
When the web page loads, you can load the
<AppML>
controller in the page.Using the
<AppML>
controller, you can create<AppML>
objects in the page.When you run the
<AppML>
object in the page, it requests the server data controller.The
<AppML>
object receives data from the server (using the data model).The
<AppML>
object (or your code) displays the data in the page.(Optional) Web users can modify the data.
(Optional)
<AppML>
can send data in the background to the server.(Optional) The server controller can store data on the server.
Typical Web Files and Folders
| | | Web Folder: Demo Data Folder: Data Image Folder: Images Model Folder: Models Application: Demo.htm Styles: Demo.css <AppML>
Configuration File: appml_config.php (or .htmlx) <AppML>
Style File: appml.css <AppML>
Browser Controller: appml.js <AppML>
Server Controller: appml.php (or .htmlx) |
No Restrictions
You can place <AppML>
objects in an HTML page. <AppML>
does not affect other parts of the page.
<AppML>
defaults to a standard display page when no specific layout is present. This is perfect for rapid prototyping.
However, the primary function of <AppML>
is not for page display. <AppML>
is mainly for reading application data. The data it brings can be freely styled using HTML, CSS, and JavaScript. You can:
Write your own HTML and let AppML handle the data.
Call the model and handle all display.
Use AppML properties and methods to create other combinations.
You will quickly discover that <AppML>
has powerful capabilities, providing data and data models for your web applications. You can:
Define data security for users or user groups.
Connect to all types of databases, such as Access, MySQL, SQL, and Oracle.
Connect to XML files and Text files.
Define data types, formats, and restrictions.
Add any new elements to the model.