From eba7fa3afba2fa2847f31fe3626c6e4f8233bd0c Mon Sep 17 00:00:00 2001 From: sb Date: Thu, 31 Jan 2008 17:06:35 +0000 Subject: [PATCH] Parallel track on transform development. Currently 'transforms' work, but not with a version of ADL which is formalisable, documented specified; and 'transforms01' very nearly work on a vocabulary which is very nearly as rich as 'transforms' but which is formalised, specified and documented. --- transforms01/adl2controllerclasses.xslt | 539 +++++++++++ transforms01/adl2entityclass.xslt | 510 ++++++++++ transforms01/adl2hibernate.xslt | 265 +++++ transforms01/adl2mssql.xslt | 451 +++++++++ transforms01/adl2psql.xslt | 339 +++++++ transforms01/adl2views.xslt | 1172 +++++++++++++++++++++++ transforms01/datadescriber.xslt | 426 ++++++++ 7 files changed, 3702 insertions(+) create mode 100755 transforms01/adl2controllerclasses.xslt create mode 100755 transforms01/adl2entityclass.xslt create mode 100755 transforms01/adl2hibernate.xslt create mode 100755 transforms01/adl2mssql.xslt create mode 100755 transforms01/adl2psql.xslt create mode 100755 transforms01/adl2views.xslt create mode 100755 transforms01/datadescriber.xslt diff --git a/transforms01/adl2controllerclasses.xslt b/transforms01/adl2controllerclasses.xslt new file mode 100755 index 0000000..1aecf80 --- /dev/null +++ b/transforms01/adl2controllerclasses.xslt @@ -0,0 +1,539 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +/* ---- [ cut here: next file 'Controller.auto.cs'] ---------------- */ + +//------------------------------------------------------------------ +// +// Application Description Framework +// Controller.auto.cs +// +// (c) 2007 Cygnet Solutions Ltd +// +// Controller for auto-generated forms for editing s +// Automatically generated from application description using +// adl2controllerclass.xsl version +// +// This file is automatically generated; DO NOT EDIT IT. +// +//------------------------------------------------------------------ + +using System; +using System.Data; +using System.Collections.Generic; +using System.Configuration; +using System.Web; +using System.Web.Security; +using System.Web.UI; +using System.Web.UI.WebControls; +using System.Web.UI.WebControls.WebParts; +using System.Web.UI.HtmlControls; +using Castle.MonoRail.Framework.Helpers; +using Cygnet.Web.Helpers; +using Cygnet.Web.Controllers; +using NHibernate; +using NHibernate.Expression; +using Castle.MonoRail.Framework; +using Cygnet.Exceptions; +using Iesi.Collections.Generic; +using SRU.Hospitality.Helpers; +using SRU.Hospitality.Entities; + +namespace { + + /// <summary> + /// Automatically generated partial controller class following 'thin controller' + /// strategy, for entity . Note that part of this + /// class may be defined in a separate file called + /// Controller.manual.cs, q.v. + /// + /// DO NOT EDIT THIS FILE! + /// </summary> + public partial class Controller : BaseController { + + /// <summary> + /// Store the record represented by the parameters passed in an HTTP service + /// Without Id -> it's new, I create a new persistent object; + /// With Id -> it's existing, I update the existing persistent object. + /// NOTE: Should only be called from a handler for method 'POST', never 'GET'. + /// </summary> + private void Store() + { + ISession hibernator = + NHibernateHelper.GetCurrentSession( Session[ NHibernateHelper.USERTOKEN], + Session[NHibernateHelper.PASSTOKEN]); + List<string> messages = new List<string>(); + + . record; + + + + string id = Form[""]; + + if ( String.IsNullOrEmpty( id)) + { + /* it's new, create persistent object */ + record = new .(Form[] + + , + + ); + + /* perform any domain knowledge behaviour on the new record + * after instantiation */ + record.AfterCreationHook( hibernator); + messages.Add( "New record created"); + } + else + { + /* it's existing, retrieve it */ + record = + hibernator.CreateCriteria(typeof()) + .Add(Expression.Eq("", Int32.Parse(id))) + .UniqueResult<.>(); + } + + if ( record != null) + { + try + { + /* actually update the record */ + BindObjectInstance( record, ParamStore.Form, "instance"); + + + /* for properties of type 'entity', it should not be necessary to do anything + * special - BindObjectInstance /should/ do it all. Unfortunately it sometimes + * doesn't, and I haven't yet characterised why not. TODO: Fix this! */ + record. = + hibernator.CreateCriteria(typeof()) + .Add(Expression.Eq(" + + ", Int32.Parse(Form[""]))) + .UniqueResult<.>(); + + + + /* to update a link table which has no other data than the near and far keys, it is + * sufficient to smash the existing values and create new ones. It's also a lot easier! */ + + string[] = Form.GetValues( ""); + + if ( != null) + { + /* update the linking table for my ; first smash the old values */ + if ( != null) + { + .Clear(); + } + else + { + = new HashedSet<>(); + } + + /* then reinstate the values from the indexes passed */ + foreach ( string index in ) + { + + .Add( + hibernator.CreateCriteria(typeof()) + .Add(Expression.Eq("Id", Int32.Parse(index))) + .UniqueResult<.>()); + } + } + + + + /* with a list we cannot just smash the old values! Instead we need to check + * each one and exclude it if no longer required */ + if ( Form.GetValues( "") != null) + { + string[] = Form.GetValues( ""); + + /* updating child records; first remove any not on the submitted list */ + foreach ( item in record.) + { + String itemId = item.Key.ToString(); + bool found = false; + + foreach ( string index in ) + { + + if ( index.Equals( itemId)) + { + found = true; + } + } + + if ( ! found) + { + record..Remove( item); + } + } + + /* then add any on the included list which are not already members */ + foreach ( string index in ) + { + item = + hibernator.CreateCriteria(typeof()) + .Add(Expression.Eq("Id", Int32.Parse(index))) + .UniqueResult<.>(); + + if ( ! record..Contains( item)) + { + record..Add( item); + } + } + } + + + /* perform any domain knowledge behaviour on the record prior to updating */ + record.BeforeUpdateHook( hibernator); + + /* write the record to the database, in order to guarantee we have a valid key */ + hibernator.Save(record); + hibernator.Flush(); + + /* perform any domain knowledge behaviour on the record after updating */ + record.AfterUpdateHook( hibernator); + + messages.Add( "Record saved successfully"); + } + catch ( DataSuitabilityException dse) + { + AddError( dse.Message); + } + catch ( ApplicationException axe) + { + AddError( axe.Message); + } + + PropertyBag["messages"] = messages; + PropertyBag["username"] = Session[ NHibernateHelper.USERTOKEN]; + PropertyBag["instance"] = record; + + + + + RenderViewWithFailover("", ""); + } + else + { + throw new Exception( String.Format( "No record of type with key value {0} found", id)); + } + } + + /// <summary> + /// Actually delete the selected record + /// </summary> + [AccessibleThrough(Verb.Get)] + public void Delete() + { + ISession hibernator = + NHibernateHelper.GetCurrentSession( Session[ NHibernateHelper.USERTOKEN], + Session[NHibernateHelper.PASSTOKEN]); + string id = Params[""]; + string reallydelete = Params["reallydelete"]; + + if ( "true".Equals( reallydelete)) + { + record = + hibernator.CreateCriteria(typeof()) + .Add(Expression.Eq("", Int32.Parse(id))) + .UniqueResult<.>(); + + if ( record != null) + { + record.BeforeDeleteHook( hibernator); + + hibernator.Delete( + hibernator.CreateCriteria(typeof()) + .Add(Expression.Eq("", Int32.Parse(id))) + .UniqueResult<.>()); + + hibernator.Flush(); + } + else + { + throw new ApplicationException( "No such record?"); + } + } + + + InternalShowList(); + + + Redirect( FormsAuthentication.DefaultUrl); + + + } + + + + + + + /// <summary> + /// list all instances of this entity to allow the user to select one for editing + /// this method invokes the default list view - which is probably what you want unless + /// you've a special reason for doing something different + /// </summary> + public void InternalShowList() + { + InternalShowList( ""); + } + + /// <summary> + /// list all instances of this entity to allow the user to select one for editing + /// </summary> + /// <param name="view">The name of the list view to show</param> + public void InternalShowList( String view) + { + ISession hibernator = + NHibernateHelper.GetCurrentSession( Session[ NHibernateHelper.USERTOKEN], + Session[NHibernateHelper.PASSTOKEN]); + IList<> instances = + hibernator.CreateCriteria(typeof()) + + .List<>(); + + PropertyBag["username"] = Session[ NHibernateHelper.USERTOKEN]; + PropertyBag["instances"] = + PaginationHelper.CreatePagination( this, instances, 25); + + RenderViewWithFailover(view + ".vm", view + ".auto.vm"); + } + + } +} + + + + if ( Form[ "" ] == null) + { + AddError( + + + + "You must supply a value for " + ); + } + + + + + + + + "" + + + + + + + + + + + + + + /// <summary> + /// Handle the submission of the form named + /// </summary> + [AccessibleThrough(Verb.Post)] + public void ( ) + { + string command = Form[ "command"]; + + if ( command == null) + { + throw new Exception( "No command?"); + } + else + + if ( command.Equals( "")) + { + /* NOTE: You must write an implementation of this verb in a + manually maintained partial class file for this class */ + (); + } + else + + if ( command.Equals( "delete")) + { + ISession hibernator = + NHibernateHelper.GetCurrentSession( Session[ NHibernateHelper.USERTOKEN], + Session[NHibernateHelper.PASSTOKEN]); + string id = Form[""]; + + PropertyBag["username"] = Session[ NHibernateHelper.USERTOKEN]; + PropertyBag["instance"] = + hibernator.CreateCriteria(typeof()) + .Add(Expression.Eq("", Int32.Parse(id))) + .UniqueResult<.>(); + + RenderViewWithFailover( "maybedelete.vm", "maybedelete.auto.vm"); + } + else if ( command.Equals( "store")) + { + Store(); + } + else + { + throw new Exception( String.Format("Unrecognised command '{0}'", command)); + } + } + + /// <summary> + /// Show the form named , with no content + /// </summary> + [AccessibleThrough(Verb.Get)] + public void ( ) + { + ISession hibernator = + NHibernateHelper.GetCurrentSession( Session[ NHibernateHelper.USERTOKEN], + Session[NHibernateHelper.PASSTOKEN]); + + + + + PropertyBag["username"] = Session[ NHibernateHelper.USERTOKEN]; + RenderViewWithFailover("", ""); + } + + /// <summary> + /// Show the form named , containing the indicated record + /// </summary> + /// <param name="">the key value of the record to show</param> + [AccessibleThrough(Verb.Get)] + public void ( Int32 ) + { + ISession hibernator = + NHibernateHelper.GetCurrentSession( Session[ NHibernateHelper.USERTOKEN], + Session[NHibernateHelper.PASSTOKEN]); + . record = + hibernator.CreateCriteria(typeof()) + .Add(Expression.Eq("", Id)) + .UniqueResult<.>(); + + PropertyBag["username"] = Session[ NHibernateHelper.USERTOKEN]; + PropertyBag["instance"] = record; + + + + + RenderViewWithFailover("", ""); + } + + + + + /// <summary> + /// list all instances of this entity to allow the user to select one + /// this method invokes the named view. + /// </summary> + public void () + { + InternalShowList( ""); + } + + + + + + + /* produce a list of to populate the menu for */ + + + + + + + /* produce a list of to populate the LHS of the shuffle for */ + + + + + + /* produce a list of to populate the multi-select for */ + + + + + + + + + + + + PropertyBag[""] = + hibernator.CreateCriteria(typeof()) + + .List<>(); + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/transforms01/adl2entityclass.xslt b/transforms01/adl2entityclass.xslt new file mode 100755 index 0000000..2be496d --- /dev/null +++ b/transforms01/adl2entityclass.xslt @@ -0,0 +1,510 @@ + + + + + + + + + + + + + + + + + + + + + Matched entity with name + + + + + + + /* ---- [ cut here: next file '.auto.cs'] ---------------- */ + + //------------------------------------------------------------- + // + // Application Description Framework + // .auto.cs + // + // (c)2007 Cygnet Solutions Ltd + // + // Automatically generated from application description using + // adl2entityclass.xsl revision + // + // This file is automatically generated; DO NOT EDIT IT. + // + //------------------------------------------------------------- + namespace + { + using System; + using System.Configuration; + using System.Collections; + using System.Collections.Generic; + using System.Text; + using System.Text.RegularExpressions; + using Cygnet.Exceptions; + using Cygnet.Entities; + using Iesi.Collections.Generic; + + /// <summary> + /// + /// </summary> + /// <remarks> + /// Automatically generated from description of entity + /// using adl2entityclass.xsl revision . + /// Note that manually maintained parts of this class may be defined in + /// a separate file called .manual.cs, q.v. + /// + /// DO NOT EDIT THIS FILE! + /// </remarks> + public partial class : Entity + { + /// <summary> + /// Auto-generated no-args constructor; does nothing (but probably should + /// ensure ID slot is initialised correctly) + /// </summary> + public () : base(){ + + } + + + + + /* natural primary key exists - not generating abstract key */ + + + /* composite promary key exists - not generating abstract key */ + + /// <summary> + /// Auto-generated constructor; initialises each of the slots within + /// the primary key and also all one-to-many and many-to-many slots + /// </summary> + public ( + + + + + + + , + ){ + + + + this. = ; + + } + + + + /// <summary> + /// Auto-generated one-arg constructor; initialises Id slot and also all + /// one-to-many slots + /// </summary> + public ( int key) + { + + + _Id = key; + } + /// <summary> + /// Auto-generated iv for Id (abstract primary key) slot + /// </summary> + private int _Id = -1; + + /// <summary> + /// Auto-generated property for Id (abstract primary key) slot + /// </summary> + public virtual int Id + { + get { return _Id; } + set { _Id = value; } + } + + /// <summary> + /// Auto-generated overridden property for the Key slot, maps onto + /// _Id + /// </summary> + [Obsolete] + public override int Key + { + get { return _Id; } + } + + + + /// <summary> + /// Auto-generated overridden property for the Key slot, maps onto + /// </summary> + public override string KeyString { + get { + + + + + + + + + + + + + + StringBuilder result = new StringBuilder(); + + result.Append(.KeyString); + + result.Append('|'); + + + return result.ToString(); + + + + + + } + } + + /// <summary> + /// A user readable distinct identifying string + /// </summary> + public override string UserIdentifier + { + get { + StringBuilder result = new StringBuilder(); + + + + + + + result.Append( ); + + + + result.Append(.ToString( "d")); + + + + result.Append(.ToString( "t")); + + + result.Append(); + + + + + + result.Append( ", "); + + + + + + result.AppendFormat( "#{0}", KeyString); + + + + return result.ToString(); + } + } + + /// <summary> + /// If I should not be deleted, return a message explaining why I should not be deleted; else null. + /// </summary> + /// <returns>a message explaining why I should not be deleted; else null</returns> + public override string NoDeleteReason { + get { + string result = null; + + StringBuilder bob = new StringBuilder(); + + + + + + + + + + if ( _.Count > 0) { + bob.AppendFormat("Cannot delete this as it has {0} dependent ; ", _.Count); + } + + + + + if (bob.Length > 0) { + result = bob.ToString(); + } + + return result; + } + } + + + } + } + + + + + + + /* NOTE: property '' is marked as being abstract; it must + * be supported by manually maintained code */ + + + + // auto generating iv/property pair for slot with name + + + + + + + + + + + + + + + + + + + + + + + ? + + + + + + + + = "" + + + = + + + + = null + = false + = 0 + = 0.0M + = 0.0 + = null + + + + + + + + + + + + + + + private Regex Validator = new Regex( ""); + + + private _ ; + + /// <summary> + /// + + + + Auto generated property for field + : + /// + /// </summary> + public virtual + { + get { return _; } + set { + + if ( value == null) + { + throw new DataRequiredException( + + + + + "The value for may not be set to null" + + + ); + } + + + + + + + + + + + + + if ( value > ) + { + throw new DataRangeException( "The maximum permitted value for is "); + } + + + if ( value < ) + { + throw new DataRangeException( "The minimum permitted value for is "); + } + + + if ( value != null && ! Validator.IsMatch( value)) + { + throw new DataFormatException( string.Format( "The value supplied ({0}) does not match the format required by ", value)); + } + + + + if ( value != null && value.Length > ) + { + value = value.Substring( 0, ); + } + + _ = value; + } + } + + + + + + + + /* */ + + + + + + "" + + + + + + + + + + _ = new HashedSet<>(); + + + + + + + + _ = new HashedSet<>(); + + + + + + + + + + + + + + + Looking for definition of ''; + Found to be defined as type '' + + + + + + + + + + + + + + + + + + + + ICollection<> + + + ICollection<> + + DateTime + DateTime + String + String + bool + DateTime + int + double + Decimal + + + + [unknown?] + + + + \ No newline at end of file diff --git a/transforms01/adl2hibernate.xslt b/transforms01/adl2hibernate.xslt new file mode 100755 index 0000000..1c9ab08 --- /dev/null +++ b/transforms01/adl2hibernate.xslt @@ -0,0 +1,265 @@ + + + + + + + + SRU.Hospitality.Entities + SRU.Hospitality.DataModel + + + + + + + + + + + *************************************************************************** + * + * C1873: C1873-SUS-Hospitality.auto.hbm.xml + * + * ©2007 Cygnet Solutions Ltd + * + * THIS FILE IS AUTOMATICALLY GENERATED AND SHOULD NOT + * BE MANUALLY EDITED. + * + * Generated using adl2hibernate-mapping.xsl revision + * + *************************************************************************** + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + false + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + DateTime + DateTime + String + String + Boolean + TimeStamp + Int32 + Double + Decimal + [unknown?] + + + + + + + + + + + + 0 + + + + + + + + -1 + + + 1 + + + + + + + + + \ No newline at end of file diff --git a/transforms01/adl2mssql.xslt b/transforms01/adl2mssql.xslt new file mode 100755 index 0000000..64c1fd2 --- /dev/null +++ b/transforms01/adl2mssql.xslt @@ -0,0 +1,451 @@ + + + + + + + + ------------------------------------------------------------------------------------------------- + -- + -- Database for application version + -- Generated for MS-SQL 2000+ using adl2mssql.xsl $Revision: 1.1 $ + -- + -- Code generator (c) 2007 Cygnet Solutions Ltd + -- + ------------------------------------------------------------------------------------------------- + + ------------------------------------------------------------------------------------------------- + -- authentication roles + ------------------------------------------------------------------------------------------------- + + + ------------------------------------------------------------------------------------------------- + -- tables, views and permissions + ------------------------------------------------------------------------------------------------- + + + ------------------------------------------------------------------------------------------------- + -- referential integrity constraints + ------------------------------------------------------------------------------------------------- + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + CASCADE + CASCADE + CASCADE + NO ACTION + + + + + + + ------------------------------------------------------------------------------------------------- + -- end of file + ------------------------------------------------------------------------------------------------- + + + + execute sp_addrole @rolename = '' + + GO + + + + + + + + + + ALTER TABLE "" + ADD FOREIGN KEY ( "") + REFERENCES "" ON DELETE + + GO + + + + + + + ------------------------------------------------------------------------------------------------- + -- primary table + ------------------------------------------------------------------------------------------------- + CREATE TABLE "" + ( + + Id INT IDENTITY( 1, 1) PRIMARY KEY + ) + + GO + + ---- permissions ------------------------------------------------------------------------------ + + + + + + + + ---- link tables ------------------------------------------------------------------------------ + + + + + + + + + + + + + + + + + + + + + + + + ""."" + ' ' + + + + + + + + + + + + + + GRANT SELECT ON "" TO + + GO + + + GRANT INSERT ON "" TO + + GO + + + GRANT SELECT, INSERT ON "" TO + + GO + + + GRANT SELECT, INSERT, UPDATE ON "" TO + + GO + + + GRANT SELECT, INSERT, UPDATE, DELETE ON "" TO + + GO + + + REVOKE ALL ON "" FROM + + GO + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + + true + + + + + false + true + + + false + + + + + + + + + + + + + -- Responsibility = '' + + + + + ------------------------------------------------------------------------------------------------- + -- link table joining with + ------------------------------------------------------------------------------------------------- + CREATE TABLE "" + ( + "Id" INT NOT NULL, + "Id" INT NOT NULL, + ) + + GO + + + + ---- permissions ------------------------------------------------------------------------------ + + + + + + + + + ---- referential integrity -------------------------------------------------------------------- + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -- Suppressing generation of , as it is not my responsibility + + + + + + + + -- Suppressing output of property , + -- as it is the 'one' end of a one-to-many relationship + + + + "" INT DEFAULT NOT NULL, + + + + + + + "" + VARCHAR( ) + INT + DOUBLE PRECISION + + DEFAULT NOT NULL, + + + + + + -- SQL Server doesn't have proper booleans! + "" BIT + DEFAULT 1 + DEFAULT 0 + NOT NULL, + + + + + + "" VARCHAR( ) DEFAULT '' NOT NULL, + + + + + "" DATETIME DEFAULT + NOT NULL, + + + + + + "" INT DEFAULT NOT NULL, + + + + + "" DOUBLE PRECISION DEFAULT NOT NULL, + + + + + "" DEFAULT NOT NULL, + + + + + + + + + + + 0 + + + + + + + + -1 + + + 1 + + + + + + + + + diff --git a/transforms01/adl2psql.xslt b/transforms01/adl2psql.xslt new file mode 100755 index 0000000..f2ae7df --- /dev/null +++ b/transforms01/adl2psql.xslt @@ -0,0 +1,339 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ------------------------------------------------------------------------------------------------- + -- + -- Database for application version + -- Generated for PostgreSQL [7|8] using adl2psql.xsl $Revision: 1.1 $ + -- + -- Code generator (c) 2006 Simon Brooke [simon@weft.co.uk] + -- http://www.weft.co.uk/library/jacquard/ + -- + ------------------------------------------------------------------------------------------------- + + ------------------------------------------------------------------------------------------------- + -- authentication roles + ------------------------------------------------------------------------------------------------- + + + ------------------------------------------------------------------------------------------------- + -- tables, views and permissions + ------------------------------------------------------------------------------------------------- + + + ------------------------------------------------------------------------------------------------- + -- referential integrity constraints + ------------------------------------------------------------------------------------------------- + + + + + + + + + + + + + + + + ------------------------------------------------------------------------------------------------- + -- end of file + ------------------------------------------------------------------------------------------------- + + + + CREATE GROUP ; + + + + + + + ALTER TABLE ADD CONSTRAINT ri__ + FOREIGN KEY ( ) REFERENCES ON DELETE NO ACTION; + + + + + + + ALTER TABLE ln__ + ADD CONSTRAINT ri____id + FOREIGN KEY ( _id) REFERENCES ON DELETE CASCADE; + + ALTER TABLE ln__ + ADD CONSTRAINT ri____id + FOREIGN KEY ( _id) REFERENCES ON DELETE CASCADE; + + + + + + + + ------------------------------------------------------------------------------------------------- + -- primary table + ------------------------------------------------------------------------------------------------- + CREATE TABLE + ( + + _id SERIAL NOT NULL PRIMARY KEY + ); + + ---- permissions ------------------------------------------------------------------------------ + + + + + + ------------------------------------------------------------------------------------------------- + -- convenience view lv_ for lists + ------------------------------------------------------------------------------------------------- + CREATE VIEW lv_ AS + SELECT + + + + + + AS + + . + + + + , + + + + FROM + , AS + + + + + WHERE + AND + . = ._id + ; + + ---- permissions ------------------------------------------------------------------------------ + + + + + + + + + + + + ---- permissions ------------------------------------------------------------------------------ + + + + ln__ + + + + + + + + + + + + + + + + + + + + + . | ' ' | + + + + + + + + + + + + GRANT SELECT ON TO GROUP ; + GRANT INSERT ON TO GROUP ; + GRANT SELECT, INSERT ON TO GROUP ; + GRANT SELECT, INSERT, UPDATE ON TO GROUP ; + GRANT SELECT, INSERT, UPDATE, DELETE ON TO GROUP ; + REVOKE ALL ON FROM GROUP ; + + + + + + + + + + + REVOKE ALL ON lv_ FROM GROUP ; + REVOKE ALL ON lv_ FROM GROUP ; + GRANT SELECT ON lv_ TO GROUP ; + + + + + + + + + + + + _1 + + + + + + + + ------------------------------------------------------------------------------------------------- + -- link table joining with + ------------------------------------------------------------------------------------------------- + CREATE TABLE ln__ + ( + _id INT NOT NULL, + _id INT NOT NULL, + ); + + + + + + + + + INT DEFAULT NOT NULL, + + + + + + + + VARCHAR( ) + INT + DOUBLE PRECISION + + DEFAULT NOT NULL, + + + + + VARCHAR( ) DEFAULT NOT NULL, + + + + + INT DEFAULT NOT NULL, + + + + + DOUBLE PRECISION DEFAULT NOT NULL, + + + + + DEFAULT NOT NULL, + + + + diff --git a/transforms01/adl2views.xslt b/transforms01/adl2views.xslt new file mode 100755 index 0000000..ddd7f92 --- /dev/null +++ b/transforms01/adl2views.xslt @@ -0,0 +1,1172 @@ + + + + + + + + + + + + + + + + + + + + + + [ cut here: next file 'tail.txt' ] + + + + + + + + + [ cut here: next file '' ] + + + + + #set( $title = " $instance.UserIdentifier") + + + + + Auto generated Velocity maybe-delete form for , + generated from ADL. + + Generated using adl2views.xsl + + ${Ajax.InstallScripts()} + ${FormHelper.InstallScripts()} + ${Validation.InstallScripts()} + ${Scriptaculous.InstallScripts()} + + ${ScriptsHelper.InstallScript( "Behaviour")} + ${ScriptsHelper.InstallScript( "ShuffleWidget")} + ${ScriptsHelper.InstallScript( "Sitewide")} + + + +
+ + + + ${FormHelper.HiddenField( "instance.")} + + + + ${FormHelper.HiddenField( "instance.Id")} + + + + + + + + +
+ Really delete? + + + + +
+
+ + + +
+ + + + + + + + + an + an + an + an + an + a + + + + + [ cut here: next file '.auto.vm' ] + + + + + #if ( $instance) + #set( $title = " $instance.UserIdentifier") + #else + #set( $title = "Add a new ") + #end + + + + + Auto generated Velocity form for , + generated from ADL. + + Generated using adl2views.xsl + + ${ScriptsHelper.InstallScript( "ShuffleWidget")} + + + + ${Ajax.InstallScripts()} + ${FormHelper.InstallScripts()} + ${Validation.InstallScripts()} + ${Scriptaculous.InstallScripts()} + ${DateTime.InstallScripts()} + + ${ScriptsHelper.InstallScript( "Sitewide")} + ${ScriptsHelper.InstallScript( "Behaviour")} + ${ScriptsHelper.InstallScript( "Epoch")} + + ${StylesHelper.InstallStylesheet( "Epoch")} + + + + + + + +
+ #if ( $Flash.errors) +
+

Errors were encountered

+ +
    + #foreach ($error in $Flash.errors) +
  • + $error +
  • + #end +
+
+ #end + #if ( $messages.Count == 0) + + #else +
+ #foreach ( $message in $messages) +

+ $message +

+ #end +
+ #end +
+ + + + + + + + + + + + + + + + + + + + + + ${FormHelper.HiddenField( "instance.")} + + + + + + ${FormHelper.HiddenField( "instance.Id")} + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ To save this record + + +
+ #if ( $instance.NoDeleteReason) + [ $instance.NoDeleteReason ] + #else + To delete this record + #end + + #if ( $instance.NoDeleteReason) + + #else + + #end +
+
+ +
+ + + +
+ + +
+ + + + + + + display: none + + + + + + +

+ + + +

+
+ + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Add a new + + + + + + + + + + + + + + + + + + + - + + + #foreach( $item in $instance.) + #if ( $velocityCount % 2 == 0) + #set( $oddity = "even") + #else + #set( $oddity = "odd") + #end + + + + + + + #if ( $item.) + $item..UserIdentifier + #end + + + + + #if ( $item. == '') + + + + #end + + + + $!item. + + + + + + + + + + Edit! + + + + #end + + + + + + + + + + + + + + + + + - + + #foreach( $instance in $instances) + #if ( $velocityCount % 2 == 0) + #set( $oddity = "even") + #else + #set( $oddity = "odd") + #end + + + + $!instance. + + + + + + + + Edit! + + + + #end + + + + + + + + actionDangerous + actionSafe + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + even + odd + + + + + + + Computed field ()? TODO: Not yet implememented + + + + + + + + + + + + + + + ${FormHelper.LabelFor( "instance.", " + + ")} + + + + + + + + + + + +
+ ${ShuffleWidgetHelper.UnselectedOptions( "", , $instance.)} + + + + + + + + ${ShuffleWidgetHelper.SelectedOptions( "", $instance.)} +
+ + + + + +
+ + + + + + even + odd + + + + + + +
+ + + + + + + + + + + + + You must provide a value for + Enter a value for + + + + + + + + ${FormHelper.LabelFor( "instance.", " + + + + + + + ")} + + + ${FormHelper.TextArea( "instance.", "%{rows='8', cols='60', title=''}")} + + + + + + even + odd + + + + + + + + + + + + + + + + + + + + You must provide a value for + + + The value for must be + + + The value for must be an instance of + + + The value for must be + + + + + + + + + + + + + none + + + + + + + + ${FormHelper.LabelFor( "instance.", " + + ")} + + + + + [You are not authorised to see this data] + + + + + + + + + + + + + + + + + #if ( $instance) + ${FormHelper.Select( "instance.", $instance., , "%{firstoption='[unset]', firstoptionvalue='-1', text='UserIdentifier', value='', title=''}" )} + #else + ${FormHelper.Select( "instance.", $, , "%{firstoption='[unset]', firstoptionvalue='-1', text='UserIdentifier', value='', title=''}" )} + #end + + + + ${FormHelper.Select( "instance.", $instance., , "%{multiple='multiple', size='8', text='UserIdentifier', value='', title=''}" )} + + + + + + + + + + + + + + + + + + + + + + + + required + + validate-digits + validate-number + validate-number + date-field validate-date + + + + + + + + + + + + + + + + + + + + + + + + + + + $!instance. + + + + + +
+ + + +
+ + + +
+
+ + + + +
+
+ +
+ +
+ + + + + + + ${FormHelper.CheckboxField( "instance.")} + + + required date-field validate-date + ${FormHelper.TextField( "instance.", "%{class='', textformat='d', size='10', maxlength='10'}")} + + + + required + validate-digits + validate-number + validate-number + + + + + + + + 8 + 8 + 8 + 60 + + + ${FormHelper.TextField( "instance.", "%{class='', title='', size='', maxlength=''}")} + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + [ cut here: next file '.auto.vm' ] + + + + + + People + + es + + + ies + + + s + + + + + + #set( $title = "") + + + Auto generated Velocity list for , + generated from ADL. + + Generated using adl2listview.xsl + + ${Ajax.InstallScripts()} + ${FormHelper.InstallScripts()} + ${Validation.InstallScripts()} + ${Scriptaculous.InstallScripts()} + ${DateTime.InstallScripts()} + + ${ScriptsHelper.InstallScript( "Behaviour")} + ${ScriptsHelper.InstallScript( "Sitewide")} + + + + +
+ + +
+ + Showing $instances.FirstItem - $instances.LastItem of $instances.TotalItems + + + #if($instances.HasFirst) $PaginationHelper.CreatePageLink( 1, "<<" ) #end + #if(!$instances.HasFirst) << #end + + + #if($instances.HasPrevious) $PaginationHelper.CreatePageLink( $instances.PreviousIndex, "<" ) #end + #if(!$instances.HasPrevious) < #end + + + #if($instances.HasNext) $PaginationHelper.CreatePageLink( $instances.NextIndex, ">" ) #end + #if(!$instances.HasNext) > #end + + + #if($instances.HasLast) $PaginationHelper.CreatePageLink( $instances.LastIndex, ">>" ) #end + #if(!$instances.HasLast) >> #end + + + + + + + + Add a new + + + + +
+
+ + + + + + + + + + #foreach( $instance in $instances) + #if ( $velocityCount % 2 == 0) + #set( $oddity = "even") + #else + #set( $oddity = "odd") + #end + + + + + + + #end + + + + + + + + + #foreach( $instance in $instances) + #if ( $velocityCount % 2 == 0) + #set( $oddity = "even") + #else + #set( $oddity = "odd") + #end + + + + + + + #end + + +
+ + + + + + + + + + + -
+ + + + #if ( $instance.) + $instance..ToString( 'd') + #end + + + $!instance. + + + + + + + + Edit! + +
+ + + + + + + + + -
+ $!instance. + + + + + + Edit! + +
+
+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
\ No newline at end of file diff --git a/transforms01/datadescriber.xslt b/transforms01/datadescriber.xslt new file mode 100755 index 0000000..85f9296 --- /dev/null +++ b/transforms01/datadescriber.xslt @@ -0,0 +1,426 @@ + + + + + + + + + + + + Data definition for the <xsl:value-of select="@name"/> application + version <xsl:value-of select="@version"/> + + + + +

+ Data definition for the application version +

+ + + +

+ +

+ +
+ +
+ Group: + +
+
+ Permissions: + +
+
+
+ + + + + + + + + + + + + + + even + odd + + + + + + + + + + + + + + + + + + + + + +
PropertyTypeReq'dDef'ltSizeDistinctPrompt
+   + + + + of type + + + : + + + + + + + + + String matching + "" + + + < + < + + + + +   + +   + +   + +   + +   + + +   + +
+   +
+   +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + +
+

+ Form +

+ +

Permissions

+
    + +
+
+ + +

Showing the following properties

+ + + + + + + + +
 PropertyPromptDocumentation
+
+ +

Showing all properties

+
+
+
+
+ + +
+

+ Page +

+ +
    + +
+
+ + +

Showing the following properties

+ + + + + + + + +
 PropertyPromptDocumentation
+
+ +

Showing all properties

+
+
+
+
+ + +
+

+ List , on select +

+ +
    + +
+
+ + +

Showing the following properties

+ + + + + + + + +
 PropertyPromptDocumentation
+
+ +

Showing all properties

+
+
+
+
+ + + + + + + + fieldgroup-end + fieldgroup + + + + + auxlist-end + auxlist + + + + + Field + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + fieldgroup-end + fieldgroup + + + + + auxlist-end + auxlist + + + + + Verb + + + [dangerous] + + + + + + + + + + + + + + + + + + + + + + + + + + Auxlist + + + + + + + + + + + + + + + On select: + + + + + + + Showing the following properties + + + Showing all properties + + + + + + + + + + Auxlist + + + + + + + + + + + + + + + On select: + + + + + + + Showing the following properties + + + Showing all properties + + + + + + + + + + +