Documentation works, and templates are being generated.

This commit is contained in:
Simon Brooke 2018-05-12 14:15:02 +01:00
parent fd9e65b7c7
commit 18f9e67033
7 changed files with 208 additions and 140 deletions

View file

@ -2,23 +2,23 @@
<!--
Application Description Language framework
adl2canonical.xsl
(c) 2007 Cygnet Solutions Ltd
Transform ADL into a canonical form, expanding and making explicit
Transform ADL into a canonical form, expanding and making explicit
things left implicit in the manually maintained form. Specifically,
in the canonicalised form
(i) every entity element has a key subelement. If it did not have one
in the supplied ADL, then a formal primary key is auto generated
(ii) every form, page or list has properties='listed'; where the supplied
ADL had properties='all' or properties='user-distinct' the correct fields
ADL had properties='all' or properties='user-distinct' the correct fields
are generated.
(iii) TODO: all permissions are fully specified down to field level, by
(iii) TODO: all permissions are fully specified down to field level, by
inheriting where necessary. For every group specified in the ADL, for
every entity, form, page, list or field, the canonical form should
explicitly state the permission, even if it is 'none'.
$Author: simon $
$Revision: 1.10 $
$Date: 2010-07-20 19:53:40 $
@ -32,12 +32,12 @@
<xsl:output encoding="UTF-8" indent="yes" method="xml" />
<!--
<!--
The convention to use for naming auto-generated abstract primary keys. Known values are
Id - the autogenerated primary key, if any, is called just 'Id'
Name - the autogenerated primary key has the same name as the entity
NameId - the name of the auto generated primary key is the name of the entity followed by 'Id'
Name_Id - the name of the auto generated primary key is the name of the entity followed by '_Id'
Name_Id - the name of the auto generated primary key is the name of the entity followed by '_Id'
-->
<xsl:param name="abstract-key-name-convention" select="Id"/>
@ -75,8 +75,8 @@
* BE MANUALLY EDITED.
*
* Generated using adl2canonical.xslt <xsl:value-of select="substring('$Revision: 1.10 $', 12)"/>
*
***************************************************************************
*
***************************************************************************
</xsl:comment>
<xsl:apply-templates select="*"/>
</xsl:copy>
@ -84,10 +84,10 @@
<!-- an entity which already has a key tag - just copy it through -->
<xsl:template match="adl:entity[adl:key]">
<xsl:if test="not( @table)">
<!-- xsl:if test="not( @table)">
<xsl:attribute name="table">
<xsl:value-of select="concat( $tablename-prefix, @name)"/>
</xsl:attribute>
</xsl:attribute -->
</xsl:if>
<xsl:comment>
entity <xsl:value-of select="@name"/> already has a key - not generating one
@ -97,7 +97,7 @@
</entity>
</xsl:template>
<!-- an entity which has a '@natural-key' attribute.
<!-- an entity which has a '@natural-key' attribute.
Since we've got the key tag, I think this should be disallowed -->
<xsl:template match="adl:entity[@natural-key]">
<xsl:if test="not( @table)">
@ -139,7 +139,7 @@
<xsl:comment>
entity <xsl:value-of select="@name"/> has no key - generating one
</xsl:comment>
<entity>
<!-- copy attributes through -->
<xsl:apply-templates select="@*"/>
@ -214,8 +214,8 @@
</xsl:attribute>
</xsl:template>
<!-- If properties='all', unroll them into a properties='listed' form.
We need to do this for lists, pages and forms; there's probably some clever
<!-- If properties='all', unroll them into a properties='listed' form.
We need to do this for lists, pages and forms; there's probably some clever
way of doing it all in a oner, but I don't know what that is -->
<xsl:template match="adl:form[ @properties='all']">
<form properties='listed'>
@ -231,8 +231,8 @@
</form>
</xsl:template>
<!-- If properties='all', unroll them into a properties='listed' form.
We need to do this for lists, pages and forms; there's probably some clever
<!-- If properties='all', unroll them into a properties='listed' form.
We need to do this for lists, pages and forms; there's probably some clever
way of doing it all in a oner, but I don't know what that is -->
<xsl:template match="adl:page[ @properties='all']">
<page properties='listed'>
@ -248,8 +248,8 @@
</page>
</xsl:template>
<!-- If properties='all', unroll them into a properties='listed' form.
We need to do this for lists, pages and forms; there's probably some clever
<!-- If properties='all', unroll them into a properties='listed' form.
We need to do this for lists, pages and forms; there's probably some clever
way of doing it all in a oner, but I don't know what that is -->
<xsl:template match="adl:list[ @properties='all']">
<list properties='listed'>
@ -265,7 +265,7 @@
</list>
</xsl:template>
<!-- In practice it's likely only to be lists which have properties='user-distinct',
<!-- In practice it's likely only to be lists which have properties='user-distinct',
but the grammar allows this for pages and forms as well so we'll deal with it -->
<xsl:template match="adl:form[ @properties='user-distinct']">
<form properties='listed'>
@ -281,7 +281,7 @@
</form>
</xsl:template>
<!-- In practice it's likely only to be lists which have properties='user-distinct',
<!-- In practice it's likely only to be lists which have properties='user-distinct',
but the grammar allows this for pages and forms as well so we'll deal with it -->
<xsl:template match="adl:page[ @properties='user-distinct']">
<page properties='listed'>
@ -298,7 +298,7 @@
</xsl:template>
<!-- In practice it's likely only to be lists which have properties='user-distinct',
<!-- In practice it's likely only to be lists which have properties='user-distinct',
but the grammar allows this for pages and forms as well so we'll deal with it -->
<xsl:template match="adl:list[ @properties='user-distinct']">
<list properties='listed'>
@ -399,7 +399,7 @@
</xsl:choose>
</xsl:template>
<!-- unroll all the explicit properties in the ancestor entity of
<!-- unroll all the explicit properties in the ancestor entity of
the context (assumed to be form, page or list) into a list of fields -->
<xsl:template name="unroll-properties">
<xsl:for-each select="ancestor::adl:entity/descendant::adl:property |
@ -414,7 +414,7 @@
</xsl:for-each>
</xsl:template>
<!-- unroll all the explicit properties in the ancestor entity of
<!-- unroll all the explicit properties in the ancestor entity of
the context (assumed to be form, page or list) into a list of fields, ommitting
those properties which are inherently lists -->
<xsl:template name="unroll-properties-no-lists">
@ -434,7 +434,7 @@
</xsl:template>
<!-- unroll all the user-distinct properties in the ancestor entity of
<!-- unroll all the user-distinct properties in the ancestor entity of
the context (assumed to be form, page or list) into a list of fields.
NOTE that n-to-n properties cannot currently be user-distinct and are
therefore not inspected -->
@ -450,4 +450,4 @@
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
</xsl:stylesheet>