A number of very minor fixes:

(1) when generating constructors, generate a reverence for the StylesHelper, as it is used in views we generate.
(2) when generating lists, don't layout columns whose contents are themselves lists.
This commit is contained in:
sb 2009-01-28 12:10:02 +00:00
parent 6ff5d773fa
commit ee4ae42fc4
2 changed files with 101 additions and 79 deletions

View file

@ -9,8 +9,8 @@
Transform ADL into (partial) controller classes Transform ADL into (partial) controller classes
$Author: sb $ $Author: sb $
$Revision: 1.22 $ $Revision: 1.23 $
$Date: 2008-10-31 13:10:22 $ $Date: 2009-01-28 12:10:02 $
--> -->
<!-- WARNING WARNING WARNING: Do NOT reformat this file! <!-- WARNING WARNING WARNING: Do NOT reformat this file!
@ -67,7 +67,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.22 $', 10)"/> // adl2controllerclasses.xslt version <xsl:value-of select="substring( '$Revision: 1.23 $', 10)"/>
// //
// <xsl:value-of select="/adl:application/@revision"/> // <xsl:value-of select="/adl:application/@revision"/>
// //
@ -135,7 +135,7 @@
// //
// 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.22 $', 10)"/> // adl2controllerclasses.xslt version <xsl:value-of select="substring( '$Revision: 1.23 $', 10)"/>
// //
// This file is automatically generated; DO NOT EDIT IT. // This file is automatically generated; DO NOT EDIT IT.
// //
@ -180,6 +180,7 @@
Rescue("<xsl:value-of select="$rescue-name"/>"), Rescue("<xsl:value-of select="$rescue-name"/>"),
</xsl:if> </xsl:if>
ControllerDetails("<xsl:value-of select="@name"/>", Area = "<xsl:value-of select="$area-name"/>"), ControllerDetails("<xsl:value-of select="@name"/>", Area = "<xsl:value-of select="$area-name"/>"),
Helper(typeof(StylesHelper), "StylesHelper"),
Helper(typeof(<xsl:value-of select="concat( @name, 'FieldHelper')"/>), "<xsl:value-of select="concat( @name, 'FieldHelper')"/>") Helper(typeof(<xsl:value-of select="concat( @name, 'FieldHelper')"/>), "<xsl:value-of select="concat( @name, 'FieldHelper')"/>")
] ]
public partial class <xsl:value-of select="concat( @name, 'Controller')"/> : <xsl:value-of select="concat( 'Abstract', /adl:application/@name, 'Controller')"/> { public partial class <xsl:value-of select="concat( @name, 'Controller')"/> : <xsl:value-of select="concat( 'Abstract', /adl:application/@name, 'Controller')"/> {

View file

@ -13,8 +13,8 @@
Transform ADL into velocity view templates Transform ADL into velocity view templates
$Author: sb $ $Author: sb $
$Revision: 1.16 $ $Revision: 1.17 $
$Date: 2008-10-31 14:35:06 $ $Date: 2009-01-28 12:10:02 $
--> -->
<!-- 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.16 $', 10)"/> Generated using adl2views.xslt <xsl:value-of select="substring( '$Revision: 1.17 $', 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="."/>
@ -161,7 +161,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.16 $', 10)"/> Generated using adl2views.xslt <xsl:value-of select="substring( '$Revision: 1.17 $', 10)"/>
<xsl:value-of select="/adl:application/@revision"/> <xsl:value-of select="/adl:application/@revision"/>
</xsl:comment> </xsl:comment>
@ -244,7 +244,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.16 $', 10)"/> Generated using adl2views.xslt <xsl:value-of select="substring( '$Revision: 1.17 $', 10)"/>
<xsl:value-of select="/adl:application/@revision"/> <xsl:value-of select="/adl:application/@revision"/>
</xsl:comment> </xsl:comment>
@ -366,7 +366,7 @@
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.16 $', 10)"/> Generated using adl2views.xsl <xsl:value-of select="substring( '$Revision: 1.17 $', 10)"/>
<xsl:value-of select="/adl:application/@revision"/> <xsl:value-of select="/adl:application/@revision"/>
</xsl:comment> </xsl:comment>
@ -972,7 +972,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.16 $', 10)"/> Generated using adl2views.xslt <xsl:value-of select="substring( '$Revision: 1.17 $', 10)"/>
</xsl:comment> </xsl:comment>
#capturefor( title) #capturefor( title)
@ -1010,7 +1010,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.16 $', 10)"/> Generated using adl2listview.xsl <xsl:value-of select="substring( '$Revision: 1.17 $', 10)"/>
</xsl:comment> </xsl:comment>
<xsl:call-template name="install-scripts"/> <xsl:call-template name="install-scripts"/>
</head> </head>
@ -1093,6 +1093,11 @@
<table> <table>
<tr> <tr>
<xsl:for-each select="$fields"> <xsl:for-each select="$fields">
<xsl:choose>
<xsl:when test="@type='list'">
<!-- suppress layout of columns which are themselves lists -->
</xsl:when>
<xsl:otherwise>
<th> <th>
<xsl:call-template name="showprompt"> <xsl:call-template name="showprompt">
<xsl:with-param name="node" select="."/> <xsl:with-param name="node" select="."/>
@ -1101,6 +1106,8 @@
<xsl:with-param name="locale" select="$locale"/> <xsl:with-param name="locale" select="$locale"/>
</xsl:call-template> </xsl:call-template>
</th> </th>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each> </xsl:for-each>
<xsl:for-each select="$entity/adl:form"> <xsl:for-each select="$entity/adl:form">
<th>-</th> <th>-</th>
@ -1109,6 +1116,11 @@
<xsl:if test="$can-search = 'true'"> <xsl:if test="$can-search = 'true'">
<tr class="search"> <tr class="search">
<xsl:for-each select="$fields"> <xsl:for-each select="$fields">
<xsl:choose>
<xsl:when test="@type='list'">
<!-- suppress layout of columns which are themselves lists -->
</xsl:when>
<xsl:otherwise>
<td class="search"> <td class="search">
<xsl:variable name="pname" select="@property"/> <xsl:variable name="pname" select="@property"/>
<xsl:variable name="property" select="$entity//adl:property[@name=$pname]"/> <xsl:variable name="property" select="$entity//adl:property[@name=$pname]"/>
@ -1145,6 +1157,8 @@
</input> </input>
</xsl:if> </xsl:if>
</td> </td>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each> </xsl:for-each>
</tr> </tr>
</xsl:if> </xsl:if>
@ -1158,6 +1172,11 @@
<xsl:for-each select="$fields"> <xsl:for-each select="$fields">
<xsl:variable name="pname" select="@property"/> <xsl:variable name="pname" select="@property"/>
<xsl:variable name="property" select="$entity//adl:property[@name=$pname]"/> <xsl:variable name="property" select="$entity//adl:property[@name=$pname]"/>
<xsl:choose>
<xsl:when test="@type='list'">
<!-- suppress layout of columns which are themselves lists -->
</xsl:when>
<xsl:otherwise>
<td> <td>
<xsl:choose> <xsl:choose>
<xsl:when test="not( $property/@name)"> <xsl:when test="not( $property/@name)">
@ -1183,6 +1202,8 @@
</xsl:otherwise> </xsl:otherwise>
</xsl:choose> </xsl:choose>
</td> </td>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each> </xsl:for-each>
<xsl:variable name="keys"> <xsl:variable name="keys">
<!-- assemble keys in a Velocity-friendly format, then splice it into <!-- assemble keys in a Velocity-friendly format, then splice it into