home -> developer -> SQL -> tutorial -> price list -> schema

back next

Making a schema

<http://waterken.com/coffeebreak/Coffee> is a new type; therefore we must provide a <http://waterken.com/doc/schema/Schema> that defines it. A <Schema> describes the structure of a resource.

The schema editor

Navigate to your schemas folder. In a browser, go to the root folder of your WaterkenTM installation. Click "www". On the next page, click "en-US" and then "waterken.com". Finally, click "coffeebreak". This directory is the Coffeebreak schema folder. The folder contains schemas defined for the Coffeebreak application. You may want to bookmark it. Whenever I ask you to open your schemas folder, I am referring to this directory.

Note that all of the schema files have human-readable names. Because schemas are defining types, their names should be informative. Open Coffee.xml in your schemas folder.

Comment

The textarea at the top of the form contains a comment describing the schema. The first sentence of the comment is useful for navigation, so it should summarize this type.

Order

A schema is a list of named branches. Each branch points to a component of the composite datatype. Two radio buttons, labelled "ordered" and "unordered," allow you to determine whether or not the ordering of this list is significant. If the order of the branches matters, check "ordered". Usually, order should not be significant, so "unordered" is the default.

Branches

This schema has two branches: 'name' and 'price'. Each branch has a description textarea and two attributes: 'arity' and 'implicit'.

Arity

Arity determines how often a branch can occur. Arity choices are:

Both a name and price should only appear once, so the arity of the branches is <Once>. You will see an example of using <Implied> arity later.

Implicit type

The implicit field controls the type of the branch's value. The 'name' branch refers to a <http://waterken.com/adt/string/String> and the 'price' refers to a <http://waterken.com/Double>.

Note the "add" link at the top of the table and the "remove" link in each row. These links add and remove branches. Note that you must always submit the form when making changes, including deletions!

Run it

As you build schemas, the WaterkenTM server generates application documentation for you. As soon as you submit a schema, you can view it in the API. Click here to view the Coffee documentation on your machine.

The next page describes creating the prototype and using it in the price list resource.

top

Copyright 2002 - 2003 Waterken Inc. All rights reserved.

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