4.8. < AppML > case study-Application Model

发布时间 : 2025-10-25 13:33:39 UTC      

Page Views: 9 views

This case study demonstrates how to build a complete < AppML > Internet application with the ability to enumerate, edit, and search for information against several tables in the database.

4.8.1. Application model

In this chapter, we will build a complete application model for the Customers table in the database.

4.8.2. < AppML > filter

To allow filtering of < AppML > data, simply add a < filters > element to the model:

Example:

<filters> <query> <field label="Customer">CustomerNamefield> <field>Cityfield> <field>Countryfield> query> <order> <field label="Customer">CustomerNamefield> <field>Cityfield> <field>Countryfield> order> filters>    

For a comprehensive understanding, see < AppML > 参考手册 .

4.8.3. < AppML > Update

To allow < AppML > data to be updated, simply add a < update > element to the model:

Example:

<update> <item><name>LastNamename>item> <item><name>FirstNamename>item> <item><name>BirthDatename>item> <item><name>Photoname>item> <item><name>Notesname>item> update>    

And add a < maintable > and < keyfield > element to the < database > element:

Example:

<maintable>Customersmaintable> <keyfield>CustomerIDkeyfield>    

For a comprehensive understanding, see < AppML > 参考手册 .

4.8.4. < AppML > Security

You can easily add security to the < AppML > model by adding a security attribute to the < AppML > tag.

Example:

<appml **security="admin"**> 

In the above example, the model can be accessed only if the user logs in to become a member of the user group “admin”.

To set security for the < update > element, simply add a security attribute to the < update > element:

Example:

<update **security="admin"**> <item><name>LastNamename>item> <item><name>FirstNamename>item> <item><name>BirthDatename>item> <item><name>Photoname>item> <item><name>Notesname>item> update>      

4.8.5. Complete Customers model

In this chapter, we will set up an application model for each table in the database.

Create a new folder called Models. In the Models folder, create a model for each application.

模型:Customers.xml

<appml security=""> <datasource> <database> <connection>Democonnection> <maintable>Customersmaintable> <keyfield>CustomerIDkeyfield> <sql>SELECT \* FROM Customerssql> <orderby>CustomerName,City,Countryorderby> database> datasource> <filters> <query> <field label="Customer">CustomerNamefield> <field>Cityfield> <field>Countryfield> query> <order> <field label="Customer">CustomerNamefield> <field>Cityfield> <field>Countryfield> order> filters> <update security="admin"> <item><name>CustomerNamename>item> <item><name>ContactNamename>item> <item><name>Addressname>item> <item><name>PostalCodename>item> <item><name>Cityname>item> <item><name>Countryname>item> update> appml>      

4.8.6. Model view

Create a model view, save it as Demo_Model.html, and give it a try:

视图:Demo_Model.htm

<h1>Customersh1> <div id="List01">div> <script src="appml.js">script> <script> customers=new AppML("appml.htmlx","Models/Customers"); customers.run("List01"); script>    

尝试一下 »

4.8.7. Now put it all together.

Then, with a small amount of JavaScript coding, create a test page for all models:

Demo_Model_Views.htm

      

Demo Applications



显示结果 »

《地理信息系统原理、技术与方法》  97

最近几年来,地理信息系统无论是在理论上还是应用上都处在一个飞速发展的阶段。 GIS被应用于多个领域的建模和决策支持,如城市管理、区划、环境整治等等,地理信息成为信息时代重要的组成部分之一; “数字地球”概念的提出,更进一步推动了作为其技术支撑的GIS的发展。 与此同时,一些学者致力于相关的理论研究,如空间感知、空间数据误差、空间关系的形式化等等。 这恰好说明了地理信息系统作为应用技术和学科的两个方面,并且这两个方面构成了相互促进的发展过程。