Some new work on Postgres, but not yet working and maybe a false start; apart

from that, stuff brought over from Cygnets, getting file upload working on
Monorail.
This commit is contained in:
simon 2010-07-20 19:53:39 +00:00
parent 9b4c13178e
commit 8a3daa78d9
19 changed files with 5376 additions and 5754 deletions

View file

@ -19,14 +19,14 @@
every entity, form, page, list or field, the canonical form should
explicitly state the permission, even if it is 'none'.
$Author: sb $
$Revision: 1.9 $
$Date: 2010-01-12 17:20:17 $
$Author: simon $
$Revision: 1.10 $
$Date: 2010-07-20 19:53:40 $
-->
<xsl:stylesheet version="1.0"
xmlns="http://libs.cygnets.co.uk/adl/1.4/"
xmlns:adl="http://libs.cygnets.co.uk/adl/1.4/"
xmlns="http://bowyer.journeyman.cc/adl/1.4/"
xmlns:adl="http://bowyer.journeyman.cc/adl/1.4/"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
exclude-result-prefixes="adl">
@ -74,7 +74,7 @@
* THIS FILE IS AUTOMATICALLY GENERATED AND SHOULD NOT
* BE MANUALLY EDITED.
*
* Generated using adl2canonical.xslt <xsl:value-of select="substring('$Revision: 1.9 $', 12)"/>
* Generated using adl2canonical.xslt <xsl:value-of select="substring('$Revision: 1.10 $', 12)"/>
*
***************************************************************************
</xsl:comment>

File diff suppressed because it is too large Load diff

View file

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet version="1.0"
xmlns="http://libs.cygnets.co.uk/adl/1.4/"
xmlns:adl="http://libs.cygnets.co.uk/adl/1.4/"
xmlns="http://bowyer.journeyman.cc/adl/1.4/"
xmlns:adl="http://bowyer.journeyman.cc/adl/1.4/"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output encoding="UTF-8" method="xml" indent="yes" />

View file

@ -7,17 +7,17 @@
Transform ADL into C# entity classes
$Author: sb $
$Revision: 1.28 $
$Date: 2010-06-01 17:29:02 $
$Author: simon $
$Revision: 1.29 $
$Date: 2010-07-20 19:53:40 $
-->
<!-- WARNING WARNING WARNING: Do NOT reformat this file!
Whitespace (or lack of it) is significant! -->
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xsl="http://bowyer.journeyman.cc/adl/1.4/"
xmlns:exsl="http://exslt.org/common"
xmlns:adl="http://libs.cygnets.co.uk/adl/1.4/"
xmlns:adl="http://bowyer.journeyman.cc/adl/1.4/"
xmlns:msxsl="urn:schemas-microsoft-com:xslt">
<xsl:include href="csharp-type-include.xslt"/>
@ -70,7 +70,7 @@
// (c)2007 Cygnet Solutions Ltd
//
// Automatically generated from application description using
// adl2entityclass.xsl revision <xsl:value-of select="substring( '$Revision: 1.28 $', 10)"/>
// adl2entityclass.xsl revision <xsl:value-of select="substring( '$Revision: 1.29 $', 10)"/>
//
// <xsl:value-of select="/adl:application/@revision"/>
//
@ -97,7 +97,7 @@
/// &lt;/summary&gt;
/// &lt;remarks&gt;
/// Automatically generated from description of group <xsl:value-of select="@name"/>
/// using adl2entityclass.xsl revision <xsl:value-of select="substring( '$Revision: 1.28 $', 10)"/>.
/// using adl2entityclass.xsl revision <xsl:value-of select="substring( '$Revision: 1.29 $', 10)"/>.
///
/// DO NOT EDIT THIS FILE!
/// &lt;/remarks&gt;
@ -123,7 +123,7 @@
// (c)2007 Cygnet Solutions Ltd
//
// Automatically generated from application description using
// adl2entityclass.xsl revision <xsl:value-of select="substring( '$Revision: 1.28 $', 10)"/>
// adl2entityclass.xsl revision <xsl:value-of select="substring( '$Revision: 1.29 $', 10)"/>
//
// <xsl:value-of select="/adl:application/@revision"/>
//
@ -159,7 +159,7 @@
/// &lt;/summary&gt;
/// &lt;remarks&gt;
/// Automatically generated from description of entity <xsl:value-of select="@name"/>
/// using adl2entityclass.xsl revision <xsl:value-of select="substring( '$Revision: 1.28 $', 10)"/>.
/// using adl2entityclass.xsl revision <xsl:value-of select="substring( '$Revision: 1.29 $', 10)"/>.
/// Note that manually maintained parts of this class may be defined in
/// a separate file called <xsl:value-of select="@name"/>.manual.cs, q.v.
///

View file

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet version="1.0"
xmlns="urn:nhibernate-mapping-2.2"
xmlns:adl="http://libs.cygnets.co.uk/adl/1.4/"
xmlns:adl="http://bowyer.journeyman.cc/adl/1.4/"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<!--
Application Description Framework
@ -11,8 +11,8 @@
Transform ADL to Hibernate
$Author: sb $
$Revision: 1.10 $
$Author: simon $
$Revision: 1.11 $
-->
<xsl:param name="namespace"/>
@ -138,7 +138,7 @@
*
* <xsl:value-of select="@revision"/>
*
* Generated using adl2hibernate.xslt revision <xsl:value-of select="substring('$Revision: 1.10 $', 12)"/>
* Generated using adl2hibernate.xslt revision <xsl:value-of select="substring('$Revision: 1.11 $', 12)"/>
*
***************************************************************************
</xsl:comment>

File diff suppressed because it is too large Load diff

View file

@ -1,5 +1,8 @@
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:stylesheet version="1.0"
xmlns="http://bowyer.journeyman.cc/adl/1.4/"
xmlns:adl="http://bowyer.journeyman.cc/adl/1.4/"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<!-- :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -->
<!-- -->
<!-- adl2psql.xsl -->
@ -18,7 +21,7 @@
<!--
JACQUARD 2 APPLICATION DESCRIPTION LANGUAGE FRAMEWORK
$Revision: 1.2 $
$Revision: 1.3 $
NOTES:
@ -35,41 +38,137 @@
two removes (i.e. the 'distinguish' mechanism in ADL
-->
<xsl:output indent="no" encoding="UTF-8" method="text"/>
<xsl:template match="application">
<xsl:include href="base-type-include.xslt"/>
<!--
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'
-->
<xsl:param name="abstract-key-name-convention" select="Id"/>
<!-- the convention to use for fieldnames in link tables:
Name - the name of the foreign key is the same as the name of the table linked to
NameId - the name of the foreign key is the same as the name of the table linked to, followed by 'Id'
Name_Id - the name of the foreign key is the same as the name of the table linked to, followed by '_Id'
Name_Link - the name of the foreign key is the same as the name of the table linked to, followed by '_Link'
-->
<xsl:param name="linktable-field-name-convention" select="Name"/>
<xsl:param name="database"/>
<!-- the name and version of the product being built -->
<xsl:param name="product-version" select="'Application Description Language Framework'"/>
<!-- define upper and lower case letters to enable case conversion -->
<xsl:variable name="ucase">ABCDEFGHIJKLMNOPQRSTUVWXYZ</xsl:variable>
<xsl:variable name="lcase">abcdefghijklmnopqrstuvwxyz</xsl:variable>
<!-- define SQL keywords to police these out of field names -->
<xsl:variable name="sqlkeywords-multiline">
ADD EXCEPT PERCENT
ALL EXEC PLAN
ALTER EXECUTE PRECISION
AND EXISTS PRIMARY
ANY EXIT PRINT
AS FETCH PROC
ASC FILE PROCEDURE
AUTHORIZATION FILLFACTOR PUBLIC
BACKUP FOR RAISERROR
BEGIN FOREIGN READ
BETWEEN FREETEXT READTEXT
BREAK FREETEXTTABLE RECONFIGURE
BROWSE FROM REFERENCES
BULK FULL REPLICATION
BY FUNCTION RESTORE
CASCADE GOTO RESTRICT
CASE GRANT RETURN
CHECK GROUP REVOKE
CHECKPOINT HAVING RIGHT
CLOSE HOLDLOCK ROLLBACK
CLUSTERED IDENTITY ROWCOUNT
COALESCE IDENTITY_INSERT ROWGUIDCOL
COLLATE IDENTITYCOL RULE
COLUMN IF SAVE
COMMIT IN SCHEMA
COMPUTE INDEX SELECT
CONSTRAINT INNER SESSION_USER
CONTAINS INSERT SET
CONTAINSTABLE INTERSECT SETUSER
CONTINUE INTO SHUTDOWN
CONVERT IS SOME
CREATE JOIN STATISTICS
CROSS KEY SYSTEM_USER
CURRENT KILL TABLE
CURRENT_DATE LEFT TEXTSIZE
CURRENT_TIME LIKE THEN
CURRENT_TIMESTAMP LINENO TO
CURRENT_USER LOAD TOP
CURSOR NATIONAL TRAN
DATABASE NOCHECK TRANSACTION
DBCC NONCLUSTERED TRIGGER
DEALLOCATE NOT TRUNCATE
DECLARE NULL TSEQUAL
DEFAULT NULLIF UNION
DELETE OF UNIQUE
DENY OFF UPDATE
DESC OFFSETS UPDATETEXT
DISK ON USE
DISTINCT OPEN USER
DISTRIBUTED OPENDATASOURCE VALUES
DOUBLE OPENQUERY VARYING
DROP OPENROWSET VIEW
DUMMY OPENXML WAITFOR
DUMP OPTION WHEN
ELSE OR WHERE
END ORDER WHILE
ERRLVL OUTER WITH
ESCAPE OVER WRITETEXT
</xsl:variable>
<xsl:variable name="sqlkeywords" select="concat(' ', normalize-space($sqlkeywords-multiline), ' ')"/>
<xsl:template match="adl:application">
-------------------------------------------------------------------------------------------------
--
-- Database for application <xsl:value-of select="@name"/> version <xsl:value-of select="@version"/>
-- Generated for PostgreSQL [7|8] using adl2psql.xsl $Revision: 1.2 $
-- <xsl:value-of select="$product-version"/>
--
-- Database for application <xsl:value-of select="@name"/> version <xsl:value-of select="@version"/>
-- Generated for PostgreSQL [7|8] using adl2psql.xsl $Revision: 1.3 $
--
-- <xsl:value-of select="@revision"/>
--
-- Code generator (c) 2006 Simon Brooke [simon@weft.co.uk]
-- http://www.weft.co.uk/library/jacquard/
--
-------------------------------------------------------------------------------------------------
<xsl:if test="string-length( $database) &gt; 0">
use "<xsl:value-of select="$database"/>";
</xsl:if>
-------------------------------------------------------------------------------------------------
-- authentication roles
-------------------------------------------------------------------------------------------------
<xsl:apply-templates select="group"/>
<xsl:apply-templates select="adl:group"/>
-------------------------------------------------------------------------------------------------
-- tables, views and permissions
-------------------------------------------------------------------------------------------------
<xsl:apply-templates select="entity"/>
<xsl:apply-templates select="adl:entity"/>
-------------------------------------------------------------------------------------------------
-- referential integrity constraints
-------------------------------------------------------------------------------------------------
<xsl:for-each select="entity">
<xsl:for-each select="adl:entity">
<xsl:variable name="nearside" select="@name"/>
<xsl:for-each select="property[@type='entity']">
<xsl:for-each select="adl:property[@type='entity']">
<xsl:call-template name="referentialintegrity">
<xsl:with-param name="nearside" select="$nearside"/>
</xsl:call-template>
</xsl:for-each>
<xsl:for-each select="property[@type='link']">
<xsl:for-each select="adl:property[@type='link']">
<xsl:call-template name="linkintegrity">
<xsl:with-param name="nearside" select="$nearside"/>
</xsl:call-template>
@ -81,7 +180,15 @@
-------------------------------------------------------------------------------------------------
</xsl:template>
<xsl:template match="group">
<xsl:template match="adl:documentation">
/* <xsl:apply-templates/> */
</xsl:template>
<xsl:template match="adl:group">
-------------------------------------------------------------------------------------------------
-- security group <xsl:value-of select="@name"/>
-------------------------------------------------------------------------------------------------
<xsl:apply-templates select="adl:documentation"/>
CREATE GROUP <xsl:value-of select="@name"/>;
</xsl:template>
@ -108,7 +215,7 @@
</xsl:template>
<xsl:template match="entity">
<xsl:template match="adl:entity">
<xsl:variable name="table" select="@name"/>
-------------------------------------------------------------------------------------------------
@ -116,12 +223,17 @@
-------------------------------------------------------------------------------------------------
CREATE TABLE <xsl:value-of select="@name"/>
(
<xsl:apply-templates select="property[@type!='link']"/>
<xsl:value-of select="@name"/>_id SERIAL NOT NULL PRIMARY KEY
<xsl:for-each select="descendant::adl:property[@type!='link']">
<xsl:apply-templates select="."/><xsl:choose>
<xsl:when test="position() = last()"/>
<xsl:otherwise>,<xsl:text>
</xsl:text></xsl:otherwise>
</xsl:choose>
</xsl:for-each>
);
---- permissions ------------------------------------------------------------------------------
<xsl:for-each select="permission">
<xsl:for-each select="adl:permission">
<xsl:call-template name="permission">
<xsl:with-param name="table" select="$table"/>
</xsl:call-template>
@ -130,7 +242,7 @@
-- convenience view lv<xsl:value-of select="concat( '_', @name)"/> for lists
-------------------------------------------------------------------------------------------------
CREATE VIEW lv<xsl:value-of select="concat( '_', @name)"/> AS
SELECT <xsl:for-each select="property[@type!='link']">
SELECT <xsl:for-each select="adl:property[@type!='link']">
<xsl:choose>
<xsl:when test="@type='entity'">
<xsl:call-template name="distinctfield">
@ -147,10 +259,10 @@
</xsl:choose>
</xsl:for-each>
FROM <xsl:value-of select="@name"/>
<xsl:for-each select="property[@type='entity']">, <xsl:value-of select="@entity"/> AS <xsl:value-of select="@name"/></xsl:for-each>
<xsl:for-each select="adl:property[@type='entity']">, <xsl:value-of select="@entity"/> AS <xsl:value-of select="@name"/></xsl:for-each>
<xsl:text>
</xsl:text>
<xsl:for-each select="property[@type='entity']">
<xsl:for-each select="adl:property[@type='entity']">
<xsl:choose>
<xsl:when test="position() = 1">WHERE </xsl:when>
<xsl:otherwise>AND </xsl:otherwise>
@ -159,14 +271,14 @@
</xsl:for-each>;
---- permissions ------------------------------------------------------------------------------
<xsl:for-each select="permission">
<xsl:for-each select="adl:permission">
<xsl:call-template name="viewpermission">
<xsl:with-param name="table" select="$table"/>
</xsl:call-template>
</xsl:for-each>
<!-- link tables -->
<xsl:for-each select="property[@type='link']">
<xsl:for-each select="adl:property[@type='link']">
<xsl:call-template name="linktable">
<xsl:with-param name="nearside" select="$table"/>
</xsl:call-template>
@ -273,14 +385,13 @@
</xsl:template>
<xsl:template match="property[@type='entity']">
<xsl:template match="adl:property[@type='entity']">
<xsl:value-of select="@name"/> INT<xsl:if
test="string(@default)"> DEFAULT <xsl:value-of select="@default"/></xsl:if><xsl:if
test="@required='true'"> NOT NULL</xsl:if>,<xsl:text>
</xsl:text>
test="@required='true'"> NOT NULL</xsl:if>
</xsl:template>
<xsl:template match="property[@type='defined']">
<xsl:template match="adl:property[@type='defined']">
<xsl:variable name="name"><xsl:value-of select="@definition"/></xsl:variable>
<xsl:variable name="definitiontype"><xsl:value-of select="/application/definition[@name=$name]/@type"/></xsl:variable>
<xsl:value-of select="@name"/><xsl:text> </xsl:text><xsl:choose>
@ -290,37 +401,40 @@
<xsl:when test="$definitiontype='real'">DOUBLE PRECISION</xsl:when>
<xsl:otherwise><xsl:value-of select="$definitiontype"/></xsl:otherwise>
</xsl:choose><xsl:if
test="string(@default)"> DEFAULT <xsl:value-of select="@default"/></xsl:if><xsl:if
test="@required='true'"> NOT NULL</xsl:if>,<xsl:text>
</xsl:text>
test="string(@default)"> DEFAULT <xsl:value-of select="@default"/></xsl:if><xsl:choose>
<xsl:when test="parent::adl:key"> NOT NULL PRIMARY KEY</xsl:when>
<xsl:when test="@required='true'"> NOT NULL</xsl:when>
</xsl:choose>
</xsl:template>
<xsl:template match="property[@type='string']">
<xsl:template match="adl:property[@type='string']">
<xsl:value-of select="@name"/> VARCHAR( <xsl:value-of select="@size"/>)<xsl:if
test="string(@default)"> DEFAULT <xsl:value-of select="@default"/></xsl:if><xsl:if
test="@required='true'"> NOT NULL</xsl:if>,<xsl:text>
</xsl:text>
test="string(@default)"> DEFAULT <xsl:value-of select="@default"/></xsl:if><xsl:choose>
<xsl:when test="parent::adl:key"> NOT NULL PRIMARY KEY</xsl:when>
<xsl:when test="@required='true'"> NOT NULL</xsl:when>
</xsl:choose>
</xsl:template>
<xsl:template match="property[@type='integer']">
<xsl:template match="adl:property[@type='integer']">
<xsl:value-of select="@name"/> INT<xsl:if
test="string(@default)"> DEFAULT <xsl:value-of select="@default"/></xsl:if><xsl:if
test="@required='true'"> NOT NULL</xsl:if>,<xsl:text>
</xsl:text>
test="string(@default)"> DEFAULT <xsl:value-of select="@default"/></xsl:if><xsl:choose>
<xsl:when test="parent::adl:key"> NOT NULL PRIMARY KEY</xsl:when>
<xsl:when test="@required='true'"> NOT NULL</xsl:when>
</xsl:choose>
</xsl:template>
<xsl:template match="property[@type='real']">
<xsl:template match="adl:property[@type='real']">
<xsl:value-of select="@name"/> DOUBLE PRECISION<xsl:if
test="string(@default)"> DEFAULT <xsl:value-of select="@default"/></xsl:if><xsl:if
test="@required='true'"> NOT NULL</xsl:if>,<xsl:text>
</xsl:text>
test="@required='true'"> NOT NULL</xsl:if>
</xsl:template>
<xsl:template match="property">
<xsl:template match="adl:property">
<xsl:value-of select="@name"/> <xsl:text> </xsl:text><xsl:value-of select="@type"/><xsl:if
test="string(@default)"> DEFAULT <xsl:value-of select="@default"/></xsl:if><xsl:if
test="@required='true'"> NOT NULL</xsl:if>,<xsl:text>
</xsl:text>
test="string(@default)"> DEFAULT <xsl:value-of select="@default"/></xsl:if><xsl:choose>
<xsl:when test="parent::adl:key"> NOT NULL PRIMARY KEY</xsl:when>
<xsl:when test="@required='true'"> NOT NULL</xsl:when>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>

File diff suppressed because it is too large Load diff

View file

@ -1,75 +1,75 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!--
Application Description Language framework
base-type-include.xslt
(c) 2007 Cygnet Solutions Ltd
An xsl transform intended to be included into other XSL stylesheets,
intended to keep lookup of the ADL base type from ADL properties in
one place for ease of maintenance
$Author: sb $
$Revision: 1.4 $
$Date: 2010-01-12 17:20:17 $
-->
<xsl:stylesheet version="1.0"
xmlns="http://libs.cygnets.co.uk/adl/1.4/"
xmlns:adl="http://libs.cygnets.co.uk/adl/1.4/"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
exclude-result-prefixes="adl">
<!-- return the base ADL type of the property which is passed as a parameter -->
<xsl:template name="base-type">
<xsl:param name="property"/>
<xsl:choose>
<xsl:when test="$property/@type='defined'">
<xsl:variable name="definition">
<xsl:value-of select="$property/@typedef"/>
</xsl:variable>
<xsl:value-of select="/adl:application/adl:typedef[@name=$definition]/@type"/>
</xsl:when>
<xsl:when test="$property/@type='serial'">integer</xsl:when>
<xsl:when test="$property/@type='message'">integer</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$property/@type"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!-- return the size of the type of the property which is passed as a parameter -->
<xsl:template name="base-size">
<xsl:param name="property"/>
<xsl:variable name="base-type">
<xsl:call-template name="base-type">
<xsl:with-param name="property" select="$property"/>
</xsl:call-template>
</xsl:variable>
<xsl:choose>
<xsl:when test="$property/@type='defined'">
<xsl:variable name="definition">
<xsl:value-of select="$property/@typedef"/>
</xsl:variable>
<xsl:value-of select="/adl:application/adl:typedef[@name=$definition]/@size"/>
</xsl:when>
<!-- type='text' should really be unlimited, but in the real world it isn't.
Furthermore, setting null values may currently break the smart form components
parser -->
<xsl:when test="$base-type='text'">4294967296</xsl:when>
<xsl:when test="$base-type='integer'">8</xsl:when>
<xsl:when test="$base-type='real'">8</xsl:when>
<xsl:when test="$base-type='money'">10</xsl:when>
<xsl:when test="$base-type='date'">10</xsl:when>
<xsl:when test="$base-type='time'">8</xsl:when>
<xsl:when test="$property/@size &gt; 0">
<xsl:value-of select="$property/@size"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$base-type"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>
<?xml version="1.0" encoding="UTF-8" ?>
<!--
Application Description Language framework
base-type-include.xslt
(c) 2007 Cygnet Solutions Ltd
An xsl transform intended to be included into other XSL stylesheets,
intended to keep lookup of the ADL base type from ADL properties in
one place for ease of maintenance
$Author: simon $
$Revision: 1.5 $
$Date: 2010-07-20 19:53:40 $
-->
<xsl:stylesheet version="1.0"
xmlns="http://libs.cygnets.co.uk/adl/1.4/"
xmlns:adl="http://libs.cygnets.co.uk/adl/1.4/"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
exclude-result-prefixes="adl">
<!-- return the base ADL type of the property which is passed as a parameter -->
<xsl:template name="base-type">
<xsl:param name="property"/>
<xsl:choose>
<xsl:when test="$property/@type='defined'">
<xsl:variable name="definition">
<xsl:value-of select="$property/@typedef"/>
</xsl:variable>
<xsl:value-of select="/adl:application/adl:typedef[@name=$definition]/@type"/>
</xsl:when>
<xsl:when test="$property/@type='serial'">integer</xsl:when>
<xsl:when test="$property/@type='message'">integer</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$property/@type"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!-- return the size of the type of the property which is passed as a parameter -->
<xsl:template name="base-size">
<xsl:param name="property"/>
<xsl:variable name="base-type">
<xsl:call-template name="base-type">
<xsl:with-param name="property" select="$property"/>
</xsl:call-template>
</xsl:variable>
<xsl:choose>
<xsl:when test="$property/@type='defined'">
<xsl:variable name="definition">
<xsl:value-of select="$property/@typedef"/>
</xsl:variable>
<xsl:value-of select="/adl:application/adl:typedef[@name=$definition]/@size"/>
</xsl:when>
<!-- type='text' should really be unlimited, but in the real world it isn't.
Furthermore, setting null values may currently break the smart form components
parser -->
<xsl:when test="$base-type='text'">4294967296</xsl:when>
<xsl:when test="$base-type='integer'">8</xsl:when>
<xsl:when test="$base-type='real'">8</xsl:when>
<xsl:when test="$base-type='money'">10</xsl:when>
<xsl:when test="$base-type='date'">10</xsl:when>
<xsl:when test="$base-type='time'">8</xsl:when>
<xsl:when test="$property/@size &gt; 0">
<xsl:value-of select="$property/@size"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$base-type"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>

View file

@ -1,99 +1,100 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!--
Application Description Language framework
csharp-type-include.xslt
(c) 2007 Cygnet Solutions Ltd
An XSL transform intended to be included into other XSL stylesheets,
intended to keep lookup of the C# type from ADL properties in
one place for ease of maintenance
$Author: sb $
$Revision: 1.4 $
$Date: 2010-01-12 17:20:17 $
-->
<xsl:stylesheet version="1.0"
xmlns="http://libs.cygnets.co.uk/adl/1.4/"
xmlns:adl="http://libs.cygnets.co.uk/adl/1.4/"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
exclude-result-prefixes="adl">
<xsl:include href="base-type-include.xslt"/>
<!-- return the primitive C# type of the property which is passed as
a parameter - i.e. if csharp-type is an entity, then the csharp-type
of the keyfield of that entity, and so on. -->
<xsl:template name="csharp-base-type">
<xsl:param name="property"/>
<xsl:param name="entityns"/>
<xsl:choose>
<xsl:when test="$property/@type = 'entity'">
<xsl:variable name="entityname" select="$property/@entity"/>
<xsl:choose>
<xsl:when test="//adl:entity[@name=$entityname]/adl:key/adl:property">
<!-- recurse... -->
<xsl:call-template name="csharp-base-type">
<xsl:with-param name="property"
select="//adl:entity[@name=$entityname]/adl:key/adl:property[position()=1]"/>
<xsl:with-param name="entityns" select="$entityns"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:message terminate="yes">
ADL: ERROR: could not find C# base type of property <xsl:value-of select="$property/@name"/>
</xsl:message>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="csharp-type">
<xsl:with-param name="property" select="$property"/>
<xsl:with-param name="entityns" select="$entityns"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!-- return the C# type of the property which is passed as a parameter -->
<xsl:template name="csharp-type">
<xsl:param name="property"/>
<xsl:param name="entityns"/>
<xsl:variable name="base-type">
<xsl:call-template name="base-type">
<xsl:with-param name="property" select="$property"/>
</xsl:call-template>
</xsl:variable>
<xsl:choose>
<xsl:when test="$property/@type = 'message'">Message</xsl:when>
<xsl:when test="$base-type = 'link'">
ICollection&lt;<xsl:value-of select="@entity"/>&gt;
</xsl:when>
<xsl:when test="$base-type = 'list'">
ICollection&lt;<xsl:value-of select="@entity"/>&gt;
</xsl:when>
<xsl:when test="$base-type = 'date'">DateTime</xsl:when>
<xsl:when test="$base-type = 'time'">DateTime</xsl:when>
<xsl:when test="$base-type = 'string'">String</xsl:when>
<xsl:when test="$base-type = 'text'">String</xsl:when>
<xsl:when test="$base-type = 'boolean'">Boolean</xsl:when>
<xsl:when test="$base-type = 'timestamp'">DateTime</xsl:when>
<xsl:when test="$base-type = 'integer'">int</xsl:when>
<xsl:when test="$base-type = 'real'">double</xsl:when>
<xsl:when test="$base-type = 'money'">Decimal</xsl:when>
<xsl:when test="$base-type = 'entity'">
<xsl:choose>
<xsl:when test="$entityns">
<xsl:value-of select="concat( $entityns, '.', $property/@entity)"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$property/@entity"/>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>[unknown?]</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>
<?xml version="1.0" encoding="UTF-8" ?>
<!--
Application Description Language framework
csharp-type-include.xslt
(c) 2007 Cygnet Solutions Ltd
An XSL transform intended to be included into other XSL stylesheets,
intended to keep lookup of the C# type from ADL properties in
one place for ease of maintenance
$Author: simon $
$Revision: 1.5 $
$Date: 2010-07-20 19:53:40 $
-->
<xsl:stylesheet version="1.0"
xmlns="http://libs.cygnets.co.uk/adl/1.4/"
xmlns:adl="http://libs.cygnets.co.uk/adl/1.4/"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
exclude-result-prefixes="adl">
<xsl:include href="base-type-include.xslt"/>
<!-- return the primitive C# type of the property which is passed as
a parameter - i.e. if csharp-type is an entity, then the csharp-type
of the keyfield of that entity, and so on. -->
<xsl:template name="csharp-base-type">
<xsl:param name="property"/>
<xsl:param name="entityns"/>
<xsl:choose>
<xsl:when test="$property/@type = 'entity'">
<xsl:variable name="entityname" select="$property/@entity"/>
<xsl:choose>
<xsl:when test="//adl:entity[@name=$entityname]/adl:key/adl:property">
<!-- recurse... -->
<xsl:call-template name="csharp-base-type">
<xsl:with-param name="property"
select="//adl:entity[@name=$entityname]/adl:key/adl:property[position()=1]"/>
<xsl:with-param name="entityns" select="$entityns"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:message terminate="yes">
ADL: ERROR: could not find C# base type of property <xsl:value-of select="$property/@name"/>
</xsl:message>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="csharp-type">
<xsl:with-param name="property" select="$property"/>
<xsl:with-param name="entityns" select="$entityns"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!-- return the C# type of the property which is passed as a parameter -->
<xsl:template name="csharp-type">
<xsl:param name="property"/>
<xsl:param name="entityns"/>
<xsl:variable name="base-type">
<xsl:call-template name="base-type">
<xsl:with-param name="property" select="$property"/>
</xsl:call-template>
</xsl:variable>
<xsl:choose>
<xsl:when test="$property/@type = 'message'">Message</xsl:when>
<xsl:when test="$base-type = 'link'">
ICollection&lt;<xsl:value-of select="@entity"/>&gt;
</xsl:when>
<xsl:when test="$base-type = 'list'">
ICollection&lt;<xsl:value-of select="@entity"/>&gt;
</xsl:when>
<xsl:when test="$base-type = 'date'">DateTime</xsl:when>
<xsl:when test="$base-type = 'time'">DateTime</xsl:when>
<xsl:when test="$base-type = 'string'">String</xsl:when>
<xsl:when test="$base-type = 'text'">String</xsl:when>
<xsl:when test="$base-type = 'image'">String</xsl:when>
<xsl:when test="$base-type = 'boolean'">Boolean</xsl:when>
<xsl:when test="$base-type = 'timestamp'">DateTime</xsl:when>
<xsl:when test="$base-type = 'integer'">int</xsl:when>
<xsl:when test="$base-type = 'real'">double</xsl:when>
<xsl:when test="$base-type = 'money'">Decimal</xsl:when>
<xsl:when test="$base-type = 'entity'">
<xsl:choose>
<xsl:when test="$entityns">
<xsl:value-of select="concat( $entityns, '.', $property/@entity)"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$property/@entity"/>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>[unknown?]</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>

View file

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0"
xmlns="http://libs.cygnets.co.uk/adl/1.4/"
xmlns:adl="http://libs.cygnets.co.uk/adl/1.4/"
xmlns="http://bowyer.journeyman.cc/adl/1.4/"
xmlns:adl="http://bowyer.journeyman.cc/adl/1.4/"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:msxsl="urn:schemas-microsoft-com:xslt">
@ -21,9 +21,9 @@
(iii) take arguments which are strings only, not nodesets.
Templates are listed in alphabetical order.
$Author: sb $
$Revision: 1.7 $
$Date: 2010-01-12 17:20:17 $
$Author: simon $
$Revision: 1.8 $
$Date: 2010-07-20 19:53:40 $
-->
<xsl:template name="i18n-add-a-new">

View file

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet version="1.0"
xmlns="http://libs.cygnets.co.uk/adl/1.4/"
xmlns:adl="http://libs.cygnets.co.uk/adl/1.4/"
xmlns="http://bowyer.journeyman.cc/adl/1.4/"
xmlns:adl="http://bowyer.journeyman.cc/adl/1.4/"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:msxsl="urn:schemas-microsoft-com:xslt"
xmlns:exsl="urn:schemas-microsoft-com:xslt"
@ -14,9 +14,9 @@
Utility templates to find permissions on various things
$Author: sb $
$Revision: 1.6 $
$Date: 2010-01-12 17:20:17 $
$Author: simon $
$Revision: 1.7 $
$Date: 2010-07-20 19:53:40 $
-->
<!-- collect all groups which can edit the specified property -->