More work on i18n and caching; also, work on the views generator.

This commit is contained in:
sb 2008-03-03 17:35:28 +00:00
parent 698c014b0d
commit 22567139f3
4 changed files with 73 additions and 29 deletions

View file

@ -13,13 +13,21 @@
<!-- :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -->
<!--
$Revision: 1.11 $
$Revision: 1.12 $
-->
<!-- :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -->
<!-- Before we start: some useful definitions -->
<!-- :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -->
<!-- some basic character entities inherited from HTML. Actually we probably ought to
import all the HTML4 character entity files, and possibly the HTML4 Strict DTD (so
that we can allow HTML block level entities within content elements -->
<!ENTITY nbsp "&#160;">
<!ENTITY pound "&#163;">
<!ENTITY copy "&#169;">
<!-- boolean means true or false -->
<!ENTITY % Boolean "(true|false)" >

View file

@ -9,8 +9,8 @@
Transform ADL into (partial) controller classes
$Author: sb $
$Revision: 1.10 $
$Date: 2008-02-27 17:38:41 $
$Revision: 1.11 $
$Date: 2008-03-03 17:35:28 $
-->
<!-- WARNING WARNING WARNING: Do NOT reformat this file!
@ -61,7 +61,7 @@
with the revision number of the generated file if the generated file is
stored to CVS -->
<xsl:variable name="transform-rev1"
select="substring( '$Revision: 1.10 $', 11)"/>
select="substring( '$Revision: 1.11 $', 11)"/>
<xsl:variable name="transform-revision"
select="substring( $transform-rev1, 0, string-length( $transform-rev1) - 1)"/>
@ -129,7 +129,8 @@ namespace <xsl:value-of select="$controllerns"/> {
///
/// DO NOT EDIT THIS FILE!
/// &lt;/summary&gt;
[ControllerDetails("<xsl:value-of select="@name"/>", Area = "auto")]
[ Layout("empty"), Rescue("generalerror"),
ControllerDetails("<xsl:value-of select="@name"/>", Area = "auto")]
public partial class <xsl:value-of select="@name"/>Controller : BaseController {
<xsl:if test="adl:form">

View file

@ -8,8 +8,8 @@
Transform ADL into entity classes
$Author: sb $
$Revision: 1.8 $
$Date: 2008-02-29 16:28:51 $
$Revision: 1.9 $
$Date: 2008-03-03 17:35:28 $
-->
<!-- WARNING WARNING WARNING: Do NOT reformat this file!
@ -61,7 +61,7 @@
stored to CVS -->
<xsl:variable name="transform-rev1"
select="substring( '$Revision: 1.8 $', 11)"/>
select="substring( '$Revision: 1.9 $', 11)"/>
<xsl:variable name="transform-revision"
select="substring( $transform-rev1, 0, string-length( $transform-rev1) - 1)"/>
@ -242,22 +242,27 @@
<xsl:for-each select="adl:property[@distinct='user']">
<xsl:choose>
<xsl:when test="@type='message'">
if ( <xsl:value-of select="@name"/> != null)
result.Append( <xsl:value-of select="concat( @name, '.LocalText')"/>);
</xsl:when>
<xsl:when test="@type='entity'">
<!-- TODO: this is dangerous and could potentially give rise to
infinite loops; find a way of stopping it running away! -->
if ( <xsl:value-of select="@name"/> != null)
result.Append( <xsl:value-of select="concat( @name, '.UserIdentifier')"/>);
</xsl:when>
<xsl:when test="@type='date'">
<!-- if what we've got is just a date, we only want to see the date part of it -->
if ( <xsl:value-of select="@name"/> != null)
result.Append(<xsl:value-of select="@name"/>.ToString( "d"));
</xsl:when>
<xsl:when test="@type='time'">
<!-- if what we've got is just a time, we only want to see the time part of it -->
if ( <xsl:value-of select="@name"/> != null)
result.Append(<xsl:value-of select="@name"/>.ToString( "t"));
</xsl:when>
<xsl:otherwise>
if ( <xsl:value-of select="@name"/> != null)
result.Append(<xsl:value-of select="@name"/>);
</xsl:otherwise>
</xsl:choose>

View file

@ -12,8 +12,8 @@
Transform ADL into velocity view templates
$Author: sb $
$Revision: 1.6 $
$Date: 2008-02-29 16:28:51 $
$Revision: 1.7 $
$Date: 2008-03-03 17:35:28 $
-->
<!-- WARNING WARNING WARNING: Do NOT reformat this file!
Whitespace (or lack of it) is significant! -->
@ -36,6 +36,8 @@
-->
<xsl:param name="abstract-key-name-convention" select="Id"/>
<xsl:param name="generate-site-navigation"/>
<!-- what's all this about? the objective is to get the revision number of the
transform into the output, /without/ getting that revision number overwritten
@ -43,7 +45,7 @@
stored to CVS -->
<xsl:variable name="transform-rev1"
select="substring( '$Revision: 1.6 $', 11)"/>
select="substring( '$Revision: 1.7 $', 11)"/>
<xsl:variable name="transform-revision"
select="substring( $transform-rev1, 0, string-length( $transform-rev1) - 1)"/>
@ -86,10 +88,9 @@
<xsl:text>
</xsl:text>
<html>
<xsl:comment>
#set( $title = "<xsl:value-of select="concat( 'Really delete ', @name)"/> $instance.UserIdentifier")
</xsl:comment>
<head>
<title>$!title</title>
<xsl:call-template name="head"/>
<xsl:comment>
Auto generated Velocity maybe-delete form for <xsl:value-of select="@name"/>,
@ -171,6 +172,7 @@
#end
</xsl:comment>
<head>
<title>$!title</title>
<xsl:call-template name="head"/>
<xsl:comment>
Application Description Language framework
@ -182,7 +184,6 @@
</xsl:comment>
${ScriptsHelper.InstallScript( "ShuffleWidget")}
${Ajax.InstallScripts()}
${FormHelper.InstallScripts()}
${Validation.InstallScripts()}
@ -1048,6 +1049,7 @@
<html>
<head>
#set( $title = "<xsl:value-of select="normalize-space( concat( 'List ', $withpluralsuffix))"/>")
<title>$!title</title>
<xsl:call-template name="head"/>
<xsl:comment>
Auto generated Velocity list for <xsl:value-of select="ancestor::adl:entity/@name"/>,
@ -1271,13 +1273,19 @@
<!-- overall page layout -->
<xsl:template match="adl:content"/>
<xsl:template name="head">
<xsl:choose>
<xsl:when test="adl:head">
<xsl:apply-templates select="adl:head/*"/>
<xsl:for-each select="adl:head/*">
<xsl:copy-of select="."/>
</xsl:for-each>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="//adl:content/adl:head/*"/>
<xsl:for-each select="//adl:content/adl:head/*">
<xsl:copy-of select="."/>
</xsl:for-each>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
@ -1285,21 +1293,43 @@
<xsl:template name="top">
<xsl:choose>
<xsl:when test="adl:top">
<xsl:apply-templates select="adl:top/*"/>
<xsl:for-each select="adl:top/*">
<xsl:copy-of select="."/>
</xsl:for-each>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="//adl:content/adl:top/*"/>
<xsl:for-each select="//adl:content/adl:top/*">
<xsl:copy-of select="."/>
</xsl:for-each>
</xsl:otherwise>
</xsl:choose>
<xsl:if test="$generate-site-navigation">
<ul class="generatednav">
<xsl:for-each select="//adl:entity[adl:list[@name='list']]">
<li>
<a>
<xsl:attribute name="href">
<xsl:value-of select="concat( '$siteRoot', '/auto/', @name, '/', adl:list[position()=1]/@name, '.rails')"/>
</xsl:attribute>
<xsl:value-of select="@name"/>
</a>
</li>
</xsl:for-each>
</ul>
</xsl:if>
</xsl:template>
<xsl:template name="foot">
<xsl:choose>
<xsl:when test="adl:foot">
<xsl:apply-templates select="adl:foot/*"/>
<xsl:for-each select="adl:foot/*">
<xsl:copy-of select="."/>
</xsl:for-each>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="//adl:content/adl:foot/*"/>
<xsl:for-each select="//adl:content/adl:foot/*">
<xsl:copy-of select="."/>
</xsl:for-each>
</xsl:otherwise>
</xsl:choose>
</xsl:template>