A number of minor engineering fixes, plus Andrew's revised Panes mechanism.

This commit is contained in:
sb 2008-06-03 14:38:14 +00:00
parent c0a52bfbe6
commit a393b3b0e7
4 changed files with 96 additions and 116 deletions

View file

@ -53,6 +53,8 @@
<Content Include="transforms\localise-transform.xslt" /> <Content Include="transforms\localise-transform.xslt" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<None Include="schemas\adl-0.dtd" />
<None Include="schemas\adl-0.xsd" />
<None Include="test.build" /> <None Include="test.build" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

View file

@ -9,8 +9,8 @@
Transform ADL into (partial) controller classes Transform ADL into (partial) controller classes
$Author: sb $ $Author: sb $
$Revision: 1.6 $ $Revision: 1.7 $
$Date: 2008-05-29 16:39:08 $ $Date: 2008-06-03 14:38:15 $
--> -->
<!-- WARNING WARNING WARNING: Do NOT reformat this file! <!-- WARNING WARNING WARNING: Do NOT reformat this file!
@ -72,7 +72,7 @@
// //
// Automatically generated abstract super class for controllers for the // Automatically generated abstract super class for controllers for the
// <xsl:value-of select="/adl:application/@name"/> application; generated using // <xsl:value-of select="/adl:application/@name"/> application; generated using
// adl2controllerclasses.xslt version <xsl:value-of select="substring( '$Revision: 1.6 $', 10)"/> // adl2controllerclasses.xslt version <xsl:value-of select="substring( '$Revision: 1.7 $', 10)"/>
// //
// This file is automatically generated; DO NOT EDIT IT. // This file is automatically generated; DO NOT EDIT IT.
// //
@ -135,7 +135,7 @@ namespace <xsl:value-of select="$controllerns"/> {
// //
// Controller for auto-generated forms for editing <xsl:value-of select="@name"/>s // Controller for auto-generated forms for editing <xsl:value-of select="@name"/>s
// Automatically generated from application description using // Automatically generated from application description using
// adl2controllerclasses.xslt version <xsl:value-of select="substring( '$Revision: 1.6 $', 10)"/> // adl2controllerclasses.xslt version <xsl:value-of select="substring( '$Revision: 1.7 $', 10)"/>
// //
// This file is automatically generated; DO NOT EDIT IT. // This file is automatically generated; DO NOT EDIT IT.
// //
@ -204,10 +204,15 @@ namespace <xsl:value-of select="$controllerns"/> {
</xsl:otherwise> </xsl:otherwise>
</xsl:choose> </xsl:choose>
</xsl:for-each> </xsl:for-each>
<xsl:for-each select="descendant::adl:property[@type='list']">
<xsl:variable name="entityname" select="@entity"/>
Register&lt;<xsl:value-of select="concat( $entityns, '.', $entityname)"/>&gt;( "", EntityShuffleControl&lt;<xsl:value-of select="concat( $entityns, '.', $entityname)"/>&gt;.Instance);
</xsl:for-each>
} }
} }
<xsl:if test="adl:property[@type='message']"> <xsl:if test="adl:property[@type='message']">
/// &lt;summary&gt; /// &lt;summary&gt;
/// Temporary hack to sort a problem with uninitialised messages /// Temporary hack to sort a problem with uninitialised messages
/// &lt;/summary&gt; /// &lt;/summary&gt;

View file

@ -13,8 +13,8 @@
Transform ADL into velocity view templates Transform ADL into velocity view templates
$Author: sb $ $Author: sb $
$Revision: 1.3 $ $Revision: 1.4 $
$Date: 2008-05-29 16:39:38 $ $Date: 2008-06-03 14:38:15 $
--> -->
<!-- WARNING WARNING WARNING: Do NOT reformat this file! <!-- WARNING WARNING WARNING: Do NOT reformat this file!
Whitespace (or lack of it) is significant! --> Whitespace (or lack of it) is significant! -->
@ -124,7 +124,7 @@
Auto generated Velocity maybe-delete form for <xsl:value-of select="@name"/>, Auto generated Velocity maybe-delete form for <xsl:value-of select="@name"/>,
generated from ADL. generated from ADL.
Generated using adl2views.xslt <xsl:value-of select="substring( '$Revision: 1.3 $', 10)"/> Generated using adl2views.xslt <xsl:value-of select="substring( '$Revision: 1.4 $', 10)"/>
</xsl:comment> </xsl:comment>
<xsl:call-template name="maybe-delete"> <xsl:call-template name="maybe-delete">
<xsl:with-param name="entity" select="."/> <xsl:with-param name="entity" select="."/>
@ -162,7 +162,7 @@
Auto generated Velocity maybe-delete form for <xsl:value-of select="@name"/>, Auto generated Velocity maybe-delete form for <xsl:value-of select="@name"/>,
generated from ADL. generated from ADL.
Generated using adl2views.xslt <xsl:value-of select="substring( '$Revision: 1.3 $', 10)"/> Generated using adl2views.xslt <xsl:value-of select="substring( '$Revision: 1.4 $', 10)"/>
</xsl:comment> </xsl:comment>
<xsl:call-template name="install-scripts"/> <xsl:call-template name="install-scripts"/>
</head> </head>
@ -243,7 +243,7 @@
Auto generated Velocity <xsl:value-of select="@name"/> form for <xsl:value-of select="ancestor::adl:entity/@name"/>, Auto generated Velocity <xsl:value-of select="@name"/> form for <xsl:value-of select="ancestor::adl:entity/@name"/>,
generated from ADL. generated from ADL.
Generated using adl2views.xslt <xsl:value-of select="substring( '$Revision: 1.3 $', 10)"/> Generated using adl2views.xslt <xsl:value-of select="substring( '$Revision: 1.4 $', 10)"/>
</xsl:comment> </xsl:comment>
#capturefor( title) #capturefor( title)
#if ( $instance) #if ( $instance)
@ -257,13 +257,6 @@
#capturefor( headextras) #capturefor( headextras)
<xsl:call-template name="head"/> <xsl:call-template name="head"/>
<script type='text/javascript' language='JavaScript1.2'> <script type='text/javascript' language='JavaScript1.2'>
var panes = new Array( <xsl:for-each select='adl:fieldgroup'>
"<xsl:value-of select='@name'/>"<xsl:choose>
<xsl:when test="position() = last()"/>
<xsl:otherwise>,</xsl:otherwise>
</xsl:choose>
</xsl:for-each> );
var siteRoot = '$siteRoot'; var siteRoot = '$siteRoot';
function performInitialisation() function performInitialisation()
@ -314,8 +307,6 @@
${StylesHelper.InstallStylesheet( "Epoch")} ${StylesHelper.InstallStylesheet( "Epoch")}
<script type="text/javascript" language='JavaScript1.2' src="../script/panes.js"></script>
<style type="text/css"> <style type="text/css">
<xsl:for-each select="ancestor::adl:entity//adl:property[@required='true']"> <xsl:for-each select="ancestor::adl:entity//adl:property[@required='true']">
#<xsl:value-of select="concat( 'advice-required-instance_', @name)"/> #<xsl:value-of select="concat( 'advice-required-instance_', @name)"/>
@ -363,16 +354,10 @@
Auto generated Velocity form for <xsl:value-of select="ancestor::adl:entity/@name"/>, Auto generated Velocity form for <xsl:value-of select="ancestor::adl:entity/@name"/>,
generated from ADL. generated from ADL.
Generated using adl2views.xsl <xsl:value-of select="substring( '$Revision: 1.3 $', 10)"/> Generated using adl2views.xsl <xsl:value-of select="substring( '$Revision: 1.4 $', 10)"/>
</xsl:comment> </xsl:comment>
<xsl:call-template name="install-scripts"/> <xsl:call-template name="install-scripts"/>
<script type='text/javascript' language='JavaScript1.2'> <script type='text/javascript' language='JavaScript1.2'>
var panes = new Array( <xsl:for-each select='adl:fieldgroup'>
"<xsl:value-of select='@name'/>"<xsl:choose>
<xsl:when test="position() = last()"/>
<xsl:otherwise>,</xsl:otherwise>
</xsl:choose>
</xsl:for-each> );
var siteRoot = '$siteRoot'; var siteRoot = '$siteRoot';
@ -423,8 +408,6 @@
${StylesHelper.InstallStylesheet( "Epoch")} ${StylesHelper.InstallStylesheet( "Epoch")}
<script type="text/javascript" language='JavaScript1.2' src="../script/panes.js"></script>
<style type="text/css"> <style type="text/css">
<xsl:for-each select="ancestor::adl:entity//adl:property[@required='true']"> <xsl:for-each select="ancestor::adl:entity//adl:property[@required='true']">
#<xsl:value-of select="concat( 'advice-required-instance_', @name)"/> #<xsl:value-of select="concat( 'advice-required-instance_', @name)"/>
@ -478,7 +461,8 @@
#end #end
#end #end
</xsl:if> </xsl:if>
<form method="post" onsubmit="invokeSubmitHandlers( this)"> <form method="post" onsubmit="invokeSubmitHandlers( this)" class="tabbed">
<input type="hidden" name="currentpane" value="$!currentpane" />
<xsl:attribute name="action"> <xsl:attribute name="action">
<xsl:value-of select="concat( $formname, 'SubmitHandler.rails')"/> <xsl:value-of select="concat( $formname, 'SubmitHandler.rails')"/>
</xsl:attribute> </xsl:attribute>
@ -503,7 +487,7 @@
</xsl:choose> </xsl:choose>
</xsl:for-each> </xsl:for-each>
<xsl:if test="$form/adl:fieldgroup"> <xsl:if test="$form/adl:fieldgroup">
<div id="tabbar"> <!-- div id="tabbar">
<xsl:for-each select="$form/adl:fieldgroup"> <xsl:for-each select="$form/adl:fieldgroup">
<span class="tab"> <span class="tab">
<xsl:attribute name="id"> <xsl:attribute name="id">
@ -525,10 +509,10 @@
</a> </a>
</span> </span>
</xsl:for-each> </xsl:for-each>
</div> </div -->
</xsl:if> </xsl:if>
<xsl:apply-templates select="$form/adl:fieldgroup"/> <xsl:apply-templates select="$form/adl:fieldgroup"/>
<div class="pane"> <div class="non-pane">
<table> <table>
<xsl:choose> <xsl:choose>
<xsl:when test="@properties='listed'"> <xsl:when test="@properties='listed'">
@ -574,7 +558,7 @@
</xsl:template> </xsl:template>
<xsl:template match="adl:fieldgroup"> <xsl:template match="adl:fieldgroup">
<div class="pane"> <div class="tab-pane">
<xsl:attribute name="id"> <xsl:attribute name="id">
<xsl:value-of select="concat( @name, 'pane')"/> <xsl:value-of select="concat( @name, 'pane')"/>
</xsl:attribute> </xsl:attribute>
@ -584,19 +568,14 @@
<xsl:otherwise>display: none</xsl:otherwise> <xsl:otherwise>display: none</xsl:otherwise>
</xsl:choose> </xsl:choose>
</xsl:attribute> </xsl:attribute>
<a> <h3 class="title">
<xsl:attribute name="name"> <xsl:call-template name="showprompt">
<xsl:value-of select="concat( @name, 'anchor')"/> <xsl:with-param name="node" select="."/>
</xsl:attribute> <xsl:with-param name="fallback" select="@name"/>
<h3> <xsl:with-param name="entity" select="ancestor::adl:entity"/>
<xsl:call-template name="showprompt"> <xsl:with-param name="locale" select="$locale"/>
<xsl:with-param name="node" select="."/> </xsl:call-template>
<xsl:with-param name="fallback" select="@name"/> </h3>
<xsl:with-param name="entity" select="ancestor::adl:entity"/>
<xsl:with-param name="locale" select="$locale"/>
</xsl:call-template>
</h3>
</a>
<table> <table>
<xsl:apply-templates select="adl:field|adl:verb|adl:auxlist"/> <xsl:apply-templates select="adl:field|adl:verb|adl:auxlist"/>
</table> </table>
@ -987,7 +966,7 @@
Auto generated Velocity list for <xsl:value-of select="@name"/>, Auto generated Velocity list for <xsl:value-of select="@name"/>,
generated from ADL. generated from ADL.
Generated using adl2views.xslt <xsl:value-of select="substring( '$Revision: 1.3 $', 10)"/> Generated using adl2views.xslt <xsl:value-of select="substring( '$Revision: 1.4 $', 10)"/>
</xsl:comment> </xsl:comment>
#capturefor( title) #capturefor( title)
@ -1026,7 +1005,7 @@
Auto generated Velocity list for <xsl:value-of select="ancestor::adl:entity/@name"/>, Auto generated Velocity list for <xsl:value-of select="ancestor::adl:entity/@name"/>,
generated from ADL. generated from ADL.
Generated using adl2listview.xsl <xsl:value-of select="substring( '$Revision: 1.3 $', 10)"/> Generated using adl2listview.xsl <xsl:value-of select="substring( '$Revision: 1.4 $', 10)"/>
</xsl:comment> </xsl:comment>
<xsl:call-template name="install-scripts"/> <xsl:call-template name="install-scripts"/>
</head> </head>
@ -1379,75 +1358,71 @@
<!-- overall page layout --> <!-- overall page layout -->
<xsl:template match="adl:content"/> <xsl:template match="adl:content"/>
<!-- assuming an empty layout, install all the standard scripts <!-- assuming an empty layout, install all the standard scripts
which an ADL page may need --> which an ADL page may need -->
<xsl:template name="install-scripts"> <xsl:template name="install-scripts">
${ScriptsHelper.InstallScript( "ShuffleWidget")} ${ScriptsHelper.InstallScript( "ShuffleWidget")}
${Ajax.InstallScripts()} ${Ajax.InstallScripts()}
${FormHelper.InstallScripts()} ${FormHelper.InstallScripts()}
${Validation.InstallScripts()} ${Validation.InstallScripts()}
${Scriptaculous.InstallScripts()} ${Scriptaculous.InstallScripts()}
${DateTimeHelper.InstallScripts()} ${DateTimeHelper.InstallScripts()}
${ScriptsHelper.InstallScript( "Sitewide")} ${ScriptsHelper.InstallScript( "Sitewide")}
${ScriptsHelper.InstallScript( "Behaviour")} ${ScriptsHelper.InstallScript( "Behaviour")}
${ScriptsHelper.InstallScript( "Epoch")} ${ScriptsHelper.InstallScript( "Epoch")}
${ScriptsHelper.InstallScript( "Panes")} ${ScriptsHelper.InstallScript( "Panes")}
</xsl:template> </xsl:template>
<xsl:template match="navigation"> <xsl:template match="adl:navigation">
foobar! <xsl:variable name="pagename" select="@name"/>
</xsl:template> <ul class="generatednav">
<xsl:choose>
<xsl:template match="adl:navigation"> <xsl:when test="@include='list'">
<xsl:variable name="pagename" select="@name"/> <xsl:for-each select="//adl:entity[adl:list[@name=$pagename]]">
<ul class="generatednav"> <li>
<xsl:choose> <a>
<xsl:when test="@include='list'"> <xsl:attribute name="href">
<xsl:for-each select="//adl:entity[adl:list[@name=$pagename]]"> <xsl:value-of select="concat( '$siteRoot', '/', $area-name, '/', @name, '/', adl:list[position()=1]/@name, '.rails')"/>
<li> </xsl:attribute>
<a> <xsl:value-of select="@name"/>
<xsl:attribute name="href"> </a>
<xsl:value-of select="concat( '$siteRoot', '/', $area-name, '/', @name, '/', adl:list[position()=1]/@name, '.rails')"/> </li>
</xsl:attribute> </xsl:for-each>
<xsl:value-of select="@name"/> </xsl:when>
</a> <xsl:when test="@include='form'">
</li> <xsl:for-each select="//adl:entity[adl:form[@name=$pagename]]">
</xsl:for-each> <li>
</xsl:when> <a>
<xsl:when test="@include='form'"> <xsl:attribute name="href">
<xsl:for-each select="//adl:entity[adl:form[@name=$pagename]]"> <xsl:value-of select="concat( '$siteRoot', '/', $area-name, '/', @name, '/', adl:list[position()=1]/@name, '.rails')"/>
<li> </xsl:attribute>
<a> <xsl:value-of select="@name"/>
<xsl:attribute name="href"> </a>
<xsl:value-of select="concat( '$siteRoot', '/', $area-name, '/', @name, '/', adl:list[position()=1]/@name, '.rails')"/> </li>
</xsl:attribute> </xsl:for-each>
<xsl:value-of select="@name"/> </xsl:when>
</a> <xsl:when test="@include='page'">
</li> <xsl:for-each select="//adl:entity[adl:page[@name=$pagename]]">
</xsl:for-each> <li>
</xsl:when> <a>
<xsl:when test="@include='page'"> <xsl:attribute name="href">
<xsl:for-each select="//adl:entity[adl:page[@name=$pagename]]"> <xsl:value-of select="concat( '$siteRoot', '/', $area-name, '/', @name, '/', adl:list[position()=1]/@name, '.rails')"/>
<li> </xsl:attribute>
<a> <xsl:value-of select="@name"/>
<xsl:attribute name="href"> </a>
<xsl:value-of select="concat( '$siteRoot', '/', $area-name, '/', @name, '/', adl:list[position()=1]/@name, '.rails')"/> </li>
</xsl:attribute> </xsl:for-each>
<xsl:value-of select="@name"/> </xsl:when>
</a> </xsl:choose>
</li> </ul>
</xsl:for-each> </xsl:template>
</xsl:when>
</xsl:choose>
</ul>
</xsl:template>
<xsl:template name="head"> <xsl:template name="head">
<xsl:choose> <xsl:choose>
<xsl:when test="adl:head"> <xsl:when test="adl:head">
<xsl:for-each select="adl:head/*"> <xsl:for-each select="adl:head/*">

View file

@ -22,12 +22,10 @@
Templates are listed in alphabetical order. Templates are listed in alphabetical order.
$Author: sb $ $Author: sb $
$Revision: 1.1 $ $Revision: 1.2 $
$Date: 2008-05-29 16:40:09 $ $Date: 2008-06-03 14:38:15 $
--> -->
<xsl:output method="xml" indent="yes"/>
<xsl:template name="i18n-add-a-new"> <xsl:template name="i18n-add-a-new">
<!-- a string, presumed to be the name of a domain entity --> <!-- a string, presumed to be the name of a domain entity -->
<xsl:param name="entity-name"/> <xsl:param name="entity-name"/>