Now generating good group security code.

This commit is contained in:
sb 2009-02-02 10:49:12 +00:00
parent bb332d34ad
commit b7caa8281a
4 changed files with 30 additions and 21 deletions

View file

@ -43,20 +43,19 @@
<ItemGroup>
<Content Include="transforms\adl2canonical.xslt" />
<Content Include="transforms\adl2controllerclasses.xslt" />
<Content Include="transforms\adl2entityclass.xslt" />
<Content Include="transforms\adl2documentation.xslt" />
<Content Include="transforms\adl2entityclasses.xslt" />
<Content Include="transforms\adl2hibernate.xslt" />
<Content Include="transforms\adl2mssql.xslt" />
<Content Include="transforms\adl2psql.xslt" />
<Content Include="transforms\adl2views.xslt" />
<Content Include="transforms\base-type-include.xslt" />
<Content Include="transforms\csharp-type-include.xslt" />
<Content Include="transforms\datadescriber.xslt" />
<Content Include="transforms\i18n-en-GB-include.xslt" />
<Content Include="transforms\localise-transform.xslt" />
</ItemGroup>
<ItemGroup>
<None Include="schemas\adl-0.dtd" />
<None Include="schemas\adl-0.xsd" />
<None Include="schemas\adl-1.1.dtd" />
<None Include="test.build" />
</ItemGroup>
</Project>

View file

@ -69,7 +69,6 @@
<Compile Include="Auto\address.auto.cs" />
<Compile Include="Auto\person.auto.cs" />
<Compile Include="Default.aspx.cs">
<SubType>ASPXCodeBehind</SubType>
<DependentUpon>Default.aspx</DependentUpon>
</Compile>
<Compile Include="Default.aspx.designer.cs">

View file

@ -9,8 +9,8 @@
Transform ADL into (partial) controller classes
$Author: sb $
$Revision: 1.24 $
$Date: 2009-01-29 16:39:32 $
$Revision: 1.25 $
$Date: 2009-02-02 10:49:13 $
-->
<!-- WARNING WARNING WARNING: Do NOT reformat this file!
@ -67,7 +67,7 @@
//
// Automatically generated abstract super class for controllers for the
// <xsl:value-of select="/adl:application/@name"/> application; generated using
// adl2controllerclasses.xslt version <xsl:value-of select="substring( '$Revision: 1.24 $', 10)"/>
// adl2controllerclasses.xslt version <xsl:value-of select="substring( '$Revision: 1.25 $', 10)"/>
//
// <xsl:value-of select="/adl:application/@revision"/>
//
@ -81,6 +81,8 @@
using NHibernate;
using NHibernate.Expression;
using Cygnet.Web.Controllers;
using Cygnet.Web.Helpers;
using Castle.MonoRail.Framework;
using <xsl:value-of select="$entityns"/>;
namespace <xsl:value-of select="$controllerns"/> {
@ -91,6 +93,11 @@
///
/// DO NOT EDIT THIS FILE!
/// &lt;/summary&gt;
[ <!-- in the longer term, all the helpers which a given
project needs which not every project needs should be listed here,
with appropriate 'xsl:if' wrappers. -->
Helper(typeof(SecurityHelper), "SecurityHelper")
]
public abstract partial class <xsl:value-of select="concat( 'Abstract', /adl:application/@name, 'Controller')"/> : BaseController {
<xsl:for-each select="//adl:entity">
/// &lt;summary&gt;
@ -135,7 +142,7 @@
//
// Controller for auto-generated forms for editing <xsl:value-of select="@name"/>s
// Automatically generated from application description using
// adl2controllerclasses.xslt version <xsl:value-of select="substring( '$Revision: 1.24 $', 10)"/>
// adl2controllerclasses.xslt version <xsl:value-of select="substring( '$Revision: 1.25 $', 10)"/>
//
// This file is automatically generated; DO NOT EDIT IT.
//

View file

@ -15,8 +15,8 @@
Transform ADL into velocity view templates
$Author: sb $
$Revision: 1.20 $
$Date: 2009-01-30 15:08:26 $
$Revision: 1.21 $
$Date: 2009-02-02 10:49:13 $
-->
<!-- WARNING WARNING WARNING: Do NOT reformat this file!
Whitespace (or lack of it) is significant! -->
@ -126,7 +126,7 @@
Auto generated Velocity maybe-delete form for <xsl:value-of select="@name"/>,
generated from ADL.
Generated using adl2views.xslt <xsl:value-of select="substring( '$Revision: 1.20 $', 10)"/>
Generated using adl2views.xslt <xsl:value-of select="substring( '$Revision: 1.21 $', 10)"/>
</xsl:comment>
<xsl:call-template name="maybe-delete">
<xsl:with-param name="entity" select="."/>
@ -163,7 +163,7 @@
Auto generated Velocity maybe-delete form for <xsl:value-of select="@name"/>,
generated from ADL.
Generated using adl2views.xslt <xsl:value-of select="substring( '$Revision: 1.20 $', 10)"/>
Generated using adl2views.xslt <xsl:value-of select="substring( '$Revision: 1.21 $', 10)"/>
<xsl:value-of select="/adl:application/@revision"/>
</xsl:comment>
@ -246,7 +246,7 @@
Auto generated Velocity <xsl:value-of select="@name"/> form for <xsl:value-of select="ancestor::adl:entity/@name"/>,
generated from ADL.
Generated using adl2views.xslt <xsl:value-of select="substring( '$Revision: 1.20 $', 10)"/>
Generated using adl2views.xslt <xsl:value-of select="substring( '$Revision: 1.21 $', 10)"/>
<xsl:value-of select="/adl:application/@revision"/>
</xsl:comment>
@ -368,7 +368,7 @@
Auto generated Velocity form for <xsl:value-of select="ancestor::adl:entity/@name"/>,
generated from ADL.
Generated using adl2views.xsl <xsl:value-of select="substring( '$Revision: 1.20 $', 10)"/>
Generated using adl2views.xsl <xsl:value-of select="substring( '$Revision: 1.21 $', 10)"/>
<xsl:value-of select="/adl:application/@revision"/>
</xsl:comment>
@ -949,18 +949,22 @@
<xsl:if test="exsl:node-set( $editgroups)/*">
<!-- NOTE! NOTE! NOTE! Whitespace is significant - any linefeeds inside the #if ( ) clause
cause the Velocity parser to break! -->
#if ( <xsl:for-each select="exsl:node-set( $editgroups)/*">${FormHelper.InGroup( "<xsl:value-of select="./@name"/>")}<xsl:if test="not( position() = last())"> || </xsl:if></xsl:for-each>)
#if ( <xsl:for-each select="exsl:node-set( $editgroups)/*">${SecurityHelper.InGroup( "<xsl:value-of select="./@name"/>")}<xsl:if test="not( position() = last())"> || </xsl:if></xsl:for-each>)
${<xsl:value-of select="concat( ancestor::adl:entity/@name, 'FieldHelper')"/>.Editable( "<xsl:value-of select="concat( 'instance.', @name)"/>", "%{rendermode='<xsl:value-of select="normalize-space($render-mode)"/>',class='<xsl:value-of select="normalize-space($cssclass)"/>',title='<xsl:value-of select="normalize-space($if-missing)"/>',size='<xsl:value-of select="normalize-space($size)"/>',maxlength='<xsl:value-of select="normalize-space($maxlength)"/>',rows='<xsl:value-of select="normalize-space($rows)"/>'}")}
#else
</xsl:if>
<xsl:if test="exsl:node-set( $insertgroups)/*">
#if ( <xsl:for-each select="exsl:node-set( $insertgroups)/*">${FormHelper.InGroup( "<xsl:value-of select="./@name"/>")}<xsl:if test="not( position() = last())"> || </xsl:if></xsl:for-each>)
#if ( <xsl:for-each select="exsl:node-set( $insertgroups)/*">${SecurityHelper.InGroup( "<xsl:value-of select="./@name"/>")}<xsl:if test="not( position() = last())"> || </xsl:if></xsl:for-each>)
${<xsl:value-of select="concat( '$', ancestor::adl:entity/@name, 'FieldHelper')"/>.Immutable( "<xsl:value-of select="concat( 'instance.', @name)"/>", "%{rendermode='<xsl:value-of select="normalize-space($render-mode)"/>',class='<xsl:value-of select="normalize-space($cssclass)"/>',title='<xsl:value-of select="normalize-space($if-missing)"/>',size='<xsl:value-of select="normalize-space($size)"/>',maxlength='<xsl:value-of select="normalize-space($maxlength)"/>',rows='<xsl:value-of select="normalize-space($rows)"/>'}")}
#else
</xsl:if>
<xsl:if test="exsl:node-set( $readgroups)/*">
#if ( <xsl:for-each select="exsl:node-set( $readgroups)/*">${FormHelper.InGroup( "<xsl:value-of select="./@name"/>")}<xsl:if test="not( position() = last())"> || </xsl:if></xsl:for-each>)
#if ( <xsl:for-each select="exsl:node-set( $readgroups)/*">${SecurityHelper.InGroup( "<xsl:value-of select="./@name"/>")}<xsl:if test="not( position() = last())"> || </xsl:if></xsl:for-each>)
${<xsl:value-of select="concat( ancestor::adl:entity/@name, 'FieldHelper')"/>.DisplayAndHidden( "<xsl:value-of select="concat( 'instance.', @name)"/>", "%{rendermode='<xsl:value-of select="normalize-space($render-mode)"/>',class='<xsl:value-of select="normalize-space($cssclass)"/>',title='<xsl:value-of select="normalize-space($if-missing)"/>',size='<xsl:value-of select="normalize-space($size)"/>',maxlength='<xsl:value-of select="normalize-space($maxlength)"/>',rows='<xsl:value-of select="normalize-space($rows)"/>'}")}
#else
</xsl:if>
[You are not authorised to view this value]
<xsl:if test="exsl:node-set( $readgroups)/*">
#end
</xsl:if>
<xsl:if test="exsl:node-set( $insertgroups)/*">
@ -996,7 +1000,7 @@
Auto generated Velocity list for <xsl:value-of select="@name"/>,
generated from ADL.
Generated using adl2views.xslt <xsl:value-of select="substring( '$Revision: 1.20 $', 10)"/>
Generated using adl2views.xslt <xsl:value-of select="substring( '$Revision: 1.21 $', 10)"/>
</xsl:comment>
#capturefor( title)
@ -1034,7 +1038,7 @@
Auto generated Velocity list for <xsl:value-of select="ancestor::adl:entity/@name"/>,
generated from ADL.
Generated using adl2listview.xsl <xsl:value-of select="substring( '$Revision: 1.20 $', 10)"/>
Generated using adl2listview.xsl <xsl:value-of select="substring( '$Revision: 1.21 $', 10)"/>
</xsl:comment>
<xsl:call-template name="install-scripts"/>
</head>