diff --git a/transforms/adl2controllerclasses.xslt b/transforms/adl2controllerclasses.xslt index c0068c2..f17738c 100755 --- a/transforms/adl2controllerclasses.xslt +++ b/transforms/adl2controllerclasses.xslt @@ -9,8 +9,8 @@ Transform ADL into (partial) controller classes $Author: sb $ - $Revision: 1.25 $ - $Date: 2009-02-02 10:49:13 $ + $Revision: 1.26 $ + $Date: 2009-02-06 12:08:28 $ --> + Helper(typeof(FormatterHelper), "t"), Helper(typeof(SecurityHelper), "SecurityHelper") ] public abstract partial class : BaseController { + + + + + public (){ + dbSessionProvider = new DBLayerSessionProvider(); + } + + + + ADL: ERROR: invalid value () provided for authentication-layer + + + + /// <summary> /// Return a list of all instances of for use in menus, etc; /// </summary> - protected IList<> ( ISession hibernator) { - return hibernator.CreateCriteria(typeof()) + protected IList<> ( ) { + IList<> result = new List<>(); + + + + + + + + if ( + + InGroup( "")|| + + ){ + + result = GetDBSession().CreateCriteria(typeof()) .AddOrder( ) .SetCacheable( true) .SetCacheRegion( "") .List<>(); + + } + + return result; } @@ -142,7 +181,7 @@ // // Controller for auto-generated forms for editing s // Automatically generated from application description using - // adl2controllerclasses.xslt version + // adl2controllerclasses.xslt version // // This file is automatically generated; DO NOT EDIT IT. // @@ -235,11 +274,7 @@ /// Temporary hack to sort a problem with uninitialised messages /// </summary> public void fixupMessages() { - ISession hibernator = - NHibernateHelper.GetCurrentSession( - Session[ NHibernateHelper.USERTOKEN], - Session[NHibernateHelper.PASSTOKEN] - ); + ISession hibernator = GetDBSession(); ICollection<> instances = hibernator.CreateCriteria( typeof( )) .List<>(); @@ -270,11 +305,7 @@ /// </summary> private void Store() { - ISession hibernator = - NHibernateHelper.GetCurrentSession( - Session[ NHibernateHelper.USERTOKEN], - Session[NHibernateHelper.PASSTOKEN] - ); + ISession hibernator = GetDBSession(); List<string> messages = new List<string>(); /* A 'newborn' instance can be updated even if the current user doesn't have * update permissions, seeing that we use an update operation to set the @@ -571,11 +602,8 @@ if ( ! HasNoErrors()) { /* the session may be polluted; create a new session */ - NHibernateHelper.CloseSession(); - hibernator = NHibernateHelper.GetCurrentSession( - Session[ NHibernateHelper.USERTOKEN], - Session[NHibernateHelper.PASSTOKEN] - ); + CloseDBSession(); + hibernator = GetDBSession(); record = FetchRecord( hibernator); } /* if ( ! HasNoErrors()) */ @@ -592,11 +620,7 @@ public void Delete() { AssertUserCanDelete(); - ISession hibernator = - NHibernateHelper.GetCurrentSession( - Session[ NHibernateHelper.USERTOKEN], - Session[NHibernateHelper.PASSTOKEN] - ); + ISession hibernator = GetDBSession(); if ( "true".Equals( Params["reallydelete"])) { @@ -644,11 +668,7 @@ public void InternalShowList( String view) { AssertUserCanRead(); - ISession hibernator = - NHibernateHelper.GetCurrentSession( - Session[ NHibernateHelper.USERTOKEN], - Session[NHibernateHelper.PASSTOKEN] - ); + ISession hibernator = GetDBSession(); ICriteria search = hibernator.CreateCriteria(typeof()); @@ -679,9 +699,6 @@ IList<> instances = search.List<>(); - - PropertyBag["username"] = Session[ NHibernateHelper.USERTOKEN]; - PropertyBag["instances"] = PaginationHelper.CreatePagination( this, instances, 25); @@ -736,7 +753,11 @@ - if ( String.IsNullOrEmpty( Form[ "" ])) + if ( + + (record == null || == null) && + + String.IsNullOrEmpty( Form[ "" ])) { AddError( @@ -748,7 +769,7 @@ " ); - } + } @@ -784,18 +805,11 @@ if ( command.Equals( "delete")) { - ISession hibernator = - NHibernateHelper.GetCurrentSession( - Session[ NHibernateHelper.USERTOKEN], - Session[NHibernateHelper.PASSTOKEN] - ); + ISession hibernator = GetDBSession(); record = FetchRecord( hibernator); TypedPropertyBag = new { - - username = Session[ NHibernateHelper.USERTOKEN], - instance = record }; RenderViewWithFailover( "maybedelete.vm", "maybedelete.auto.vm"); @@ -834,11 +848,7 @@ public void ( string ) { AssertUserCanRead(); - ISession hibernator = - NHibernateHelper.GetCurrentSession( - Session[ NHibernateHelper.USERTOKEN], - Session[NHibernateHelper.PASSTOKEN] - ); + ISession hibernator = GetDBSession(); record = new (); record. = @@ -870,11 +880,7 @@ string , ) { - ISession hibernator = - NHibernateHelper.GetCurrentSession( - Session[ NHibernateHelper.USERTOKEN], - Session[NHibernateHelper.PASSTOKEN] - ); + ISession hibernator = GetDBSession(); ( hibernator.CreateCriteria( typeof()) @@ -892,11 +898,7 @@ /// <param name="record">the record to show</param> protected void ( record) { - ISession hibernator = - NHibernateHelper.GetCurrentSession( - Session[ NHibernateHelper.USERTOKEN], - Session[NHibernateHelper.PASSTOKEN] - ); + ISession hibernator = GetDBSession(); if ( record == null ){ record = new (); @@ -905,9 +907,6 @@ } TypedPropertyBag = new { - - username = Session[ NHibernateHelper.USERTOKEN], - @@ -1070,7 +1069,7 @@ = - ( NHibernateHelper.GetCurrentSession()), + ( ), diff --git a/transforms/adl2entityclasses.xslt b/transforms/adl2entityclasses.xslt index 3c21835..6a3ac03 100755 --- a/transforms/adl2entityclasses.xslt +++ b/transforms/adl2entityclasses.xslt @@ -8,8 +8,8 @@ Transform ADL into C# entity classes $Author: sb $ - $Revision: 1.16 $ - $Date: 2009-02-02 18:13:39 $ + $Revision: 1.17 $ + $Date: 2009-02-06 12:08:28 $ --> - + + + + @@ -66,7 +70,7 @@ // (c)2007 Cygnet Solutions Ltd // // Automatically generated from application description using - // adl2entityclass.xsl revision + // adl2entityclass.xsl revision // // // @@ -93,7 +97,7 @@ /// </summary> /// <remarks> /// Automatically generated from description of group - /// using adl2entityclass.xsl revision . + /// using adl2entityclass.xsl revision . /// /// DO NOT EDIT THIS FILE! /// </remarks> @@ -119,7 +123,7 @@ // (c)2007 Cygnet Solutions Ltd // // Automatically generated from application description using - // adl2entityclass.xsl revision + // adl2entityclass.xsl revision // // // @@ -145,7 +149,7 @@ /// </summary> /// <remarks> /// Automatically generated from description of entity - /// using adl2entityclass.xsl revision . + /// using adl2entityclass.xsl revision . /// Note that manually maintained parts of this class may be defined in /// a separate file called .manual.cs, q.v. /// @@ -288,13 +292,13 @@ if ( != null){ - result.Append(.ToString( "d")); + result.Append(((DateTime)).ToShortDateString()); } if ( != null){ - result.Append(.ToString( "t")); + result.Append(((DateTime)).ToShortTimeString()); } @@ -331,29 +335,37 @@ public override string NoDeleteReason { get { string result = null; - - StringBuilder bob = new StringBuilder(); - + + + + StringBuilder bob = new StringBuilder(); + - - - - - - - - - if ( != null && .Count > 0) { - bob.AppendFormat("Cannot delete this as it has {0} dependent ; ", .Count); - } + + + + + + + + + if ( != null && .Count > 0) { + bob.AppendFormat("Cannot delete this as it has {0} dependent ; ", .Count); + } - - - - if (bob.Length > 0) { - result = bob.ToString(); - } - + + + + if (bob.Length > 0) { + result = bob.ToString(); + } + + + + /* unfortunately it's not currently possible to compute no-delete reasons + * on 'Database' authenticated applications */ + + return result; } } diff --git a/transforms/adl2views.xslt b/transforms/adl2views.xslt index 9a76a44..19a984c 100755 --- a/transforms/adl2views.xslt +++ b/transforms/adl2views.xslt @@ -15,13 +15,14 @@ Transform ADL into velocity view templates $Author: sb $ - $Revision: 1.24 $ - $Date: 2009-02-04 11:32:27 $ + $Revision: 1.25 $ + $Date: 2009-02-06 12:08:28 $ --> + @@ -62,6 +63,9 @@ + + @@ -120,7 +124,7 @@ Auto generated Velocity maybe-delete form for , generated from ADL. - Generated using adl2views.xslt + Generated using adl2views.xslt @@ -157,7 +161,7 @@ Auto generated Velocity maybe-delete form for , generated from ADL. - Generated using adl2views.xslt + Generated using adl2views.xslt @@ -228,7 +232,7 @@ - + [ cut here: next file '.auto.vm' ] @@ -240,7 +244,7 @@ Auto generated Velocity form for , generated from ADL. - Generated using adl2views.xslt + Generated using adl2views.xslt Generation parameters were: locale: generate-site-navigation: @@ -264,64 +268,9 @@ #end #capturefor( headextras) - + + + ${StylesHelper.InstallStylesheet( "Epoch")} @@ -347,7 +296,7 @@ - + [ cut here: next file '.auto.vm' ] @@ -371,7 +320,7 @@ Auto generated Velocity form for , generated from ADL. - Generated using adl2views.xsl + Generated using adl2views.xsl Generation parameters were: locale: generate-site-navigation: @@ -384,54 +333,9 @@ - + + + ${StylesHelper.InstallStylesheet( "Epoch")} @@ -460,7 +364,6 @@ -
#if ( $errors) @@ -490,13 +393,13 @@
- + - + - + @@ -534,33 +437,52 @@ - - - - #if ( $instance) - #if ( $instance.NoDeleteReason) - [ $instance.NoDeleteReason ] - #else - - #end + + + + + + + + + #if ( ${SecurityHelper.InGroup( "")} || ) + #end - - - #if ( $instance) - #if ( $instance.NoDeleteReason) - - #else - - #end - #end - - + + + + +
+ + + + #if ( $instance) + #if ( $instance.NoDeleteReason) + [ $instance.NoDeleteReason ] + #else + + #end + #end + + + #if ( $instance) + #if ( $instance.NoDeleteReason) + + #else + + #end + #end + + + +
@@ -639,7 +561,7 @@ - auxlist for with listed fields: + auxlist with listed fields: @@ -756,7 +678,6 @@ - @@ -769,6 +690,15 @@ ")} + + + + + + + + #if ( ${SecurityHelper.InGroup( "")} || )
@@ -807,6 +737,9 @@
+ #else + [Not authrised] + #end @@ -826,24 +759,12 @@ - - - - - - - - - - - - + + + + + @@ -864,141 +785,62 @@ ")} - - - edit - edit - $maybe-edit - $maybe-edit - noneditable - none - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - required - - - - - - - - - - - - validate-digits - validate-number - validate-number - date-field validate-date - - - - - - - - - - - - - - - - - - - - 8 - 1 - - - - - - - - - - - - - - - - - - - #if ( ${SecurityHelper.InGroup( "")} || ) - - ${.Immutable( "", "%{class='',title='',size='',maxlength='',rows='',href=''}")} + + + + + - ${.Editable( "", "%{class='',title='',size='',maxlength='',rows=''}")} + + + #if ( ${SecurityHelper.InGroup( "")} || ) + + + + + + + + + + + + + + + #else + + + #if ( ${SecurityHelper.InGroup( "")} || ) + + + + + #else + + + #if ( ${SecurityHelper.InGroup( "")} || ) + + + + + #else + + [Not authorised] + + #end + + + #end + + + #end + - #else - - - #if ( ${SecurityHelper.InGroup( "")} || ) - ${.Immutable( "", "%{class='',title='',size='',maxlength='',rows='',href=''}")} - #else - - - #if ( ${SecurityHelper.InGroup( "")} || ) - ${.DisplayAndHidden( "", "%{class='',title='',size='',maxlength='',rows='',href=''}")} - #else - - [Not authorised] - - #end - - - #end - - - #end - @@ -1026,7 +868,7 @@ Auto generated Velocity list for , generated from ADL. - Generated using adl2views.xslt + Generated using adl2views.xslt Generation parameters were: locale: generate-site-navigation: @@ -1051,6 +893,22 @@ + + + + + + @@ -1073,7 +931,7 @@ Auto generated Velocity list for , generated from ADL. - Generated using adl2listview.xsl + Generated using adl2listview.xsl Generation parameters were: locale: generate-site-navigation: @@ -1225,43 +1083,77 @@ Unknown entity whilst trying to generate list - #foreach( in ) - #if ( $velocityCount % 2 == 0) - #set( $oddity = "even") - #else - #set( $oddity = "odd") - #end - - - - + + + + + + + + + - - + - - - - - - - - - - - - - - ! - - - - - #end +
+ + + #if ( ${SecurityHelper.InGroup( "")} || ) + + + + + + #else + + [You are not authorised to view this data] + + #end + +
+ + + + + #foreach( in ) + #if ( $velocityCount % 2 == 0) + #set( $oddity = "even") + #else + #set( $oddity = "odd") + #end + + + + + + + + + + + + + + + + + + + + + + ! + + + + + #end + + @@ -1395,35 +1287,299 @@ - - #if ( ${SecurityHelper.InGroup( "")} || ) + + + + + + + + + + + #if ( ${SecurityHelper.InGroup( "")} || ) + + + + + + #else + [Not authorised] + #end + + + + + + + + + + + + #if ( ) + .ToString( 'd') + #end + + + #if ( ) + $t.Msg( ) + #end + + + #if( ) + + #end + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + required + + + + + + + + + + + + validate-digits + validate-number + validate-number + date-field validate-date + + + + + + + + + + + + + + + + + + + + 8 + 1 + + + + + + + + + + + + + + + + + ${ "", "%{class='',title='',size='',maxlength='',rows='',href=''}")} + + + + + + + + ${ "", "%{class='',title='',size='',maxlength='',rows='',href=''}")} - + ${ "", "%{class='',title='',size='',maxlength='',rows='',href=''}")} - #else - - [Not authorised] - - #end - - + + + ${ "", "%{class='',title='',size='',maxlength='',rows='',href=''}")} + + + + + + + + + +
+ + + +
+ + + +
+
+ + + + +
+
+ +
@@ -1505,7 +1661,9 @@ - #if ( ${SecurityHelper.InGroup( "")} || ) + + #if ( ${SecurityHelper.InGroup( "")} || ) + - #end + + #end + @@ -1551,7 +1711,7 @@

- + ; built with -layer authentication.

@@ -1591,189 +1751,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - none - - - - - - - - - - - - - - - - - - - - - none - - - - - - - - - - - - - - - - - - - - diff --git a/transforms/i18n-en-GB-include.xslt b/transforms/i18n-en-GB-include.xslt index 1650433..299eed5 100755 --- a/transforms/i18n-en-GB-include.xslt +++ b/transforms/i18n-en-GB-include.xslt @@ -22,8 +22,8 @@ Templates are listed in alphabetical order. $Author: sb $ - $Revision: 1.4 $ - $Date: 2009-02-04 18:39:11 $ + $Revision: 1.5 $ + $Date: 2009-02-06 12:08:28 $ --> @@ -102,7 +102,7 @@ - + diff --git a/transforms/permissions-include.xslt b/transforms/permissions-include.xslt new file mode 100755 index 0000000..c0a032a --- /dev/null +++ b/transforms/permissions-include.xslt @@ -0,0 +1,261 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + none + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + none + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + none + + + + + + + + + + + + + + + + + + + + + none + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file