当前位置: 首页 > 网络学院 > 客户端脚本教程 > APPML > 案例研究:目录

APPML
AppML HTML 报告
AppML 过滤函数
AppML HTML 列表
AppML HTML 表单
AppML XML 报告

APPML 中的 案例研究:目录


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-03-01   浏览: 901 ::
收藏到网摘: n/a

This chapter demonstrates AppML on the Categories table in the Northwind database.
这章将介绍基于Northwind 数据库目录表单的AppML。


The Categories XML File
目录XML文件

The "Categories" AppML description:
“目录”AppML描述:

<?xml version="1.0" encoding="ISO-8859-1" ?>
<appml>
<title>CATEGORIES</title>
<database>
<connection>northwind</connection>
<maintable>categories</maintable>
<keyfield>Categoryid</keyfield>
<sql>SELECT Categoryname, Description FROM Categories</sql>
</database>
<htmllist edit="true" />
<htmlreport />
<htmlform />
</appml>

View XML source: northwind/categories.xml
查看XML源文件:northwind/categories.xml


AppML HTML Report
AppML HTML 报告

HTML Report: appml.asp?appname=northwind/categories&displaytype=report
HTML 报告:appml.asp?appname=northwind/categories&displaytype=report

The link above runs the AppML HTML report service. To be able to run an AppML HTML report, the AppML description must contain an <htmlreport> tag.
上述链接运行了AppML HTML报告服务,为了能够运行AppML HTML 报告,AppML描述必须包含一个<htmlreport>标签。

We see that the report contains a header ("Categories"), a table listing the different categories along with a description, and the number of records in the report. The title and sql selection shown in the report, is taken from the <title> tag and the <sql> tag inside <database>. The number of records are automatically added by AppML.
我们都看到,这份报告包含了一个页眉(“目录”),一个根据描述列举不同目录的表格,以及报告中记录的数量。报告中展示的标题和SQL选集是从<database>内部的<title>标签和<sql>标签提取出来的。


AppML HTML Form
AppML HTML 表单

HTML Form: appml.asp?appname=northwind/categories&displaytype=form
HTML 表单:appml.asp?appname=northwind/categories&displaytype=form

The link above runs the AppML form service. To be able to run AppML form, the AppML description must contain an <htmlform> tag. The AppML description must also contain a <maintable> tag and a <keyfield> tag (inside the <database> tag).
上述链接运行了AppML表单服务。为了能够运行AppML表单,AppML描述必须包含<htmlform>标签。AppML描述同样必须包含一个<maintable>标签和一个<keyfield>标签(位于<database>标签内部)。

The link above takes you to a page with a blank form. Here you can add a new record. AppML automatically adds New, Submit, and Delete buttons.
上述链接可以使你重新打开一个全新的空白页面。你可以在里面添加全新的记录。AppML会自动添加新记录按钮、提交按钮和删除按钮。


AppML HTML List
AppML HTML 列表地址

HTML List: appml.asp?appname=northwind/categories&displaytype=list
HTML 列表:appml.asp?appname=northwind/categories&displaytype=list

The link above runs the AppML list service. To be able to run AppML list, the AppML description must contain an <htmllist> tag.
上述链接运行了AppML列表服务。为了能够运行AppML列表,AppML描述必须嵌套在一个<htmllist>标签内。

We see that the list contains a header ("Categories"), the number of records in the list, a New button, a Save button, a Report button, and a table listing the different categories along with a description.
我们看到,列表中包含了一个页眉(“目录”),列表中记录的数量,一个 新 按钮,储存 按钮,报告 按钮很根据描述来显示不同目录的表格列表。

The title and sql selection shown in the report, is taken from the <title> tag and the <sql> tag inside <database>. The number of records and the buttons are automatically added by AppML.
报告中展示的标题和SQL选集是从<database>内部的<title>标签和<sql>标签提取出来的。记录的数量和按钮是自动添加到AppML中的。

The New button is automatically added because the AppML description contains an <htmlform> tag.
新 按钮是自动添加的,因为AppML描述包含了一个<htmlreport>标签。

The Report button is automatically added because the AppML description contains an <htmlreport> tag.
报告按钮是自动添加的,因为AppML描述包含了一个<htmlreport>标签。

The Folder image to the left of each records is automatically added because the AppML description contains an <htmlform> tag. If you click on the Folder image, you will be taken to the AppML form.
每条记录左边的文件夹图像是自动添加的,因为AppML描述包含了一个<htmlform>标签。如果你点击了文件夹图像,你将会进入AppML表单。

Notice the edit="true" attribute inside the <htmllist> tag. This attribute automatically makes the list editable. You can modify the data directly in the list. After modifying the data, you can save the changes by clicking on the floppy disk image to the left of each record, or you can click on the Save button on the top of the list (this button saves all changes).
特别注意<htmllist>标签内部的 edit="true" 属性。这个属性可以使列表呈现自动可编辑状态。你可以直接修改列表中的数据。修改完数据之后,你可以点击记录左边的软驱图像来保存你已经更改的记录,或者点击列表顶端的 保存 按钮来储存(这个按钮将保存所有的更改信息)。

You can also delete records by clicking on the trashcan to the right of each record.
你同样可以点击每条记录的右边的垃圾桶来删除记录。


AppML XML Report
AppML XML 报告

XML Report:
XML 报告:
appml.asp?appname=northwind/categories&displaytype=report&type=xml

The link above runs the AppML XML service.
上述链接运行了AppML XML 服务。

The AppML XML report service will generate an XML report based on the sql defined in the <database> element. The XML report's root element is <table>. The first element after <table> is <sql>, which lists the sql used in the description. Then there will be one <row> element for each record in the sql. The <row> element contains one element for each field in the sql.
AppML XML报告服务将会产生一个基于在<database>元素中定义的sql来产生一个XML报告。XML报告的根元素是<table>。在<table>之后的第一个元素是<sql>,它罗列了在描述中使用的sql。对于sql中每一条记录而言,都会包含一个<row>元素。<row>元素为sql中的每条字段包含了一个元素。


All AppML Services in One
所有的AppML服务

To run all the AppML services above (except XML report) in one, use the following link: appml.asp?appname=northwind/categories
希望运行上面的AppML服务(除了XML报告),可以点击下面的链接:appml.asp?appname=northwind/categories


评论 (0) All

登陆 | 还没注册?