Allow tablename prefix to be specified when generating ADL
This commit is contained in:
parent
0cac7bfba9
commit
9ecbfb2f91
|
@ -20,8 +20,8 @@
|
||||||
explicitly state the permission, even if it is 'none'.
|
explicitly state the permission, even if it is 'none'.
|
||||||
|
|
||||||
$Author: sb $
|
$Author: sb $
|
||||||
$Revision: 1.7 $
|
$Revision: 1.8 $
|
||||||
$Date: 2008-02-20 12:09:53 $
|
$Date: 2008-02-28 14:52:08 $
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<xsl:stylesheet version="1.0"
|
<xsl:stylesheet version="1.0"
|
||||||
|
@ -41,6 +41,9 @@
|
||||||
-->
|
-->
|
||||||
<xsl:param name="abstract-key-name-convention" select="Id"/>
|
<xsl:param name="abstract-key-name-convention" select="Id"/>
|
||||||
|
|
||||||
|
<!-- a prefix to prepend to all tablenames -->
|
||||||
|
<xsl:param name="tablename-prefix"/>
|
||||||
|
|
||||||
<xsl:template match="adl:application">
|
<xsl:template match="adl:application">
|
||||||
<xsl:copy>
|
<xsl:copy>
|
||||||
<xsl:attribute name="name">
|
<xsl:attribute name="name">
|
||||||
|
@ -61,7 +64,7 @@
|
||||||
* THIS FILE IS AUTOMATICALLY GENERATED AND SHOULD NOT
|
* THIS FILE IS AUTOMATICALLY GENERATED AND SHOULD NOT
|
||||||
* BE MANUALLY EDITED.
|
* BE MANUALLY EDITED.
|
||||||
*
|
*
|
||||||
* Generated using adl2canonical.xslt <xsl:value-of select="substring('$Revision: 1.7 $', 12)"/>
|
* Generated using adl2canonical.xslt <xsl:value-of select="substring('$Revision: 1.8 $', 12)"/>
|
||||||
*
|
*
|
||||||
***************************************************************************
|
***************************************************************************
|
||||||
</xsl:comment>
|
</xsl:comment>
|
||||||
|
@ -71,6 +74,11 @@
|
||||||
|
|
||||||
<!-- an entity which already has a key tag - just copy it through -->
|
<!-- an entity which already has a key tag - just copy it through -->
|
||||||
<xsl:template match="adl:entity[adl:key]">
|
<xsl:template match="adl:entity[adl:key]">
|
||||||
|
<xsl:if test="not( @table)">
|
||||||
|
<xsl:attribute name="table">
|
||||||
|
<xsl:value-of select="concat( $tablename-prefix, @name)"/>
|
||||||
|
</xsl:attribute>
|
||||||
|
</xsl:if>
|
||||||
<xsl:comment>
|
<xsl:comment>
|
||||||
entity <xsl:value-of select="@name"/> already has a key - not generating one
|
entity <xsl:value-of select="@name"/> already has a key - not generating one
|
||||||
</xsl:comment>
|
</xsl:comment>
|
||||||
|
@ -82,6 +90,11 @@
|
||||||
<!-- 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 -->
|
Since we've got the key tag, I think this should be disallowed -->
|
||||||
<xsl:template match="adl:entity[@natural-key]">
|
<xsl:template match="adl:entity[@natural-key]">
|
||||||
|
<xsl:if test="not( @table)">
|
||||||
|
<xsl:attribute name="table">
|
||||||
|
<xsl:value-of select="concat( $tablename-prefix, @name)"/>
|
||||||
|
</xsl:attribute>
|
||||||
|
</xsl:if>
|
||||||
<xsl:message terminate="no">
|
<xsl:message terminate="no">
|
||||||
ADL WARNING: [In entity '<xsl:value-of select="@name"/>']: '@natural-key' is deprecated - use the 'key' sub element instead</xsl:message>
|
ADL WARNING: [In entity '<xsl:value-of select="@name"/>']: '@natural-key' is deprecated - use the 'key' sub element instead</xsl:message>
|
||||||
<entity>
|
<entity>
|
||||||
|
@ -118,6 +131,11 @@
|
||||||
<entity>
|
<entity>
|
||||||
<!-- copy attributes through -->
|
<!-- copy attributes through -->
|
||||||
<xsl:apply-templates select="@*"/>
|
<xsl:apply-templates select="@*"/>
|
||||||
|
<xsl:if test="not( @table)">
|
||||||
|
<xsl:attribute name="table">
|
||||||
|
<xsl:value-of select="concat( $tablename-prefix, @name)"/>
|
||||||
|
</xsl:attribute>
|
||||||
|
</xsl:if>
|
||||||
<!-- children copied through in legal order, to ensure the document remains valid -->
|
<!-- children copied through in legal order, to ensure the document remains valid -->
|
||||||
<xsl:apply-templates select="adl:documentation"/>
|
<xsl:apply-templates select="adl:documentation"/>
|
||||||
<xsl:apply-templates select="adl:content"/>
|
<xsl:apply-templates select="adl:content"/>
|
||||||
|
@ -178,6 +196,12 @@
|
||||||
</entity>
|
</entity>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
|
||||||
|
<xsl:template match="@table">
|
||||||
|
<xsl:attribute name="table">
|
||||||
|
<xsl:value-of select="concat( $tablename-prefix, .)"/>
|
||||||
|
</xsl:attribute>
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
<!-- If properties='all', unroll them into a properties='listed' form.
|
<!-- 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
|
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 -->
|
way of doing it all in a oner, but I don't know what that is -->
|
||||||
|
|
Loading…
Reference in a new issue