<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE application PUBLIC "-//JOURNEYMAN//DTD ADL 1.4//EN"
                             "http://bowyer.journeyman.cc/adl/stable/adl/schemas/adl-1.4.dtd">
<!--  
	Application Description Language framework
	testapp.adl.xml
	
	the object of this file is to exercise as many aspects of ADL as possible;
	in the first instance, this is an attempt to recreate PRES in ADL
	
	$Author: simon $
	$Revision: 1.3 $
	$Date: 2010-07-20 19:53:40 $
 -->
<application name="pres" xmlns="http://bowyer.journeyman.cc/adl/stable/">
    <specification abbr="regexplib" name="RegexpLib.com" url="http://regexlib.com/"/>
    <content>
        <head/>
        <top/>
        <foot/>
    </content>
    <typedef name="postcode"
        pattern="^([A-PR-UWYZ0-9][A-HK-Y0-9][AEHMNPRTVXY0-9]?[ABEHMNPRVWXY0-9]? {1,2}[0-9][ABD-HJLN-UW-Z]{2}|GIR 0AA)$"
        size="10" type="string">
        <documentation>
            <reference abbr="regexplib" section="REDetails.aspx?regexp_id=260"/>
			a postcode follows arcane rules.
		</documentation>
    </typedef>
    <typedef maximum="120" minimum="0" name="age" type="integer">
        <documentation>
			We don't believe people who claim to be over 120.
		</documentation>
    </typedef>
    <typedef name="email"
        pattern="^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$" size="128">
        <documentation>
            <reference abbr="regexplib" section="REDetails.aspx?regexp_id=26"/>
        </documentation>
    </typedef>
    <group name="public"/>
    <group name="admin" parent="public"/>
    <entity name="Actor">
        <documentation>
		A real (administrative) user of this system with a first-class, database layer login, 
		as opposed to a Subscriber with a second-class, application layer login.
	</documentation>
        <property name="Name" size="64" type="string"/>
        <property name="EMail" type="defined" typedef="email"/>
        <property name="Approved" type="boolean"/>
    </entity>
    <entity name="Article">
        <property name="Created" type="date"/>
        <property name="Embargo" type="date"/>
        <property entity="Category" name="Category" type="entity"/>
        <property name="Title" size="128" type="string"/>
        <property entity="Actor" name="Author" type="entity"/>
	<property name="Location" type="entity" entity="Location"/>
    </entity>
    <entity name="Author">
        <property name="CanonicalName" size="128" type="string"/>
        <property entity="NomDePlume" name="NomsDePlume" type="list"/>
        <property name="Disambiguation" size="256" type="string">
            <documentation>
		If the canonical name is a common one, or there are known to be two or more authors 
		with the same canonical name, some brief text about the author to disambiguate.
	</documentation>
        </property>
    </entity>
    <entity name="Book">
        <property entity="Article" name="Article" type="entity"/>
        <property name="AuthorAsEntered" size="128" type="string">
            <documentation>The name of the author as entered by the original user, prior to being resolved against known authors</documentation>
        </property>
        <property entity="Author" name="Authors" type="link"/>
        <property name="Title" size="128" type="string"/>
    </entity>
    <entity name="NomDePlume">
        <property name="Name" size="128" type="string"/>
        <property entity="Author" name="Author" type="entity"/>
    </entity>
</application>