home -> developer -> SQL -> tutorial -> ACoffeeEditor

back next

A higher-level resource: ACoffeeEditor

Higher-level resources combine two or more resources. They are a way of aggregating authority, making it easier to use and manage. In this example, we combine a <Coffee> record and a <SetAPrice> into one resource: <http://waterken.com/coffeebreak/ACoffeeEditor>.

Definition

A higher-level resource is defined in the same way as any other resource, by creating a schema.

In your schemas folder, open ACoffeeEditor.xml. The schema has two branches: 'viewer' and 'updater'. The 'viewer' branch links to a <Coffee>. The 'updater' branch links to a <SetAPrice>.

Structure

There is an <ACoffeeEditor> for each coffee in the Coffeebreak database. It links to the <Record> for getting the coffee and the <Lambda> for setting its price.

Open the Colombian <ACoffeeEditor>, <rvkhyb6ainm4vzhwpwbew5dupq.xml>, in your xdb directory.

The resource links to the Colombian coffee resource and to the Colombian <SetAPrice> resource, both created in the previous section.

Run it

Click here to view the representation on your machine.

Using the <ACoffeeEditor> resource, we see the name of the coffee and a form for changing its price, with the current price already filled in.

Accountant

For another example of a higher-level resource, see the <Accountant> resource in your xdb folder at: <6gjz7l6fnoxlbikw7akqgxhrsy.xml>. The <Accountant> resource provides links to both the price list and weekly sales resources.

Run it

Click here to view the representation on your machine.

The weekly sales and price list records are particularly good candidates to be part of a higher-level resource. Notice the URLs in the links to each of these. The URL contains the "stylesheet" parameter. By providing weekly sales and price list as component resources, we can make sure the custom stylesheets are used.

By now, you have seen all the kinds of resources that you will need to webize your own database. The next section gives you a few more details about creating stylesheets for higher-level resources like <ACoffeeEditor>.

top

Copyright 2002 - 2003 Waterken Inc. All rights reserved.

Powered by Waterken Server! Valid XHTML 1.0! Valid CSS!