You can subscribe to this list here.
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(6) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
(178) |
Feb
(169) |
Mar
(286) |
Apr
(117) |
May
(98) |
Jun
(68) |
Jul
(63) |
Aug
(121) |
Sep
(88) |
Oct
(124) |
Nov
(2) |
Dec
(111) |
2007 |
Jan
(224) |
Feb
(69) |
Mar
(10) |
Apr
(72) |
May
(7) |
Jun
(21) |
Jul
(33) |
Aug
(35) |
Sep
(12) |
Oct
(22) |
Nov
(5) |
Dec
(6) |
2008 |
Jan
(2) |
Feb
(10) |
Mar
(39) |
Apr
(58) |
May
(34) |
Jun
(9) |
Jul
(27) |
Aug
(10) |
Sep
(3) |
Oct
|
Nov
|
Dec
|
From: Chris M. <cm...@us...> - 2006-09-28 17:23:11
|
User: cmicali Date: 06/09/28 10:23:10 Modified: etc/andromda-dotnet/AndroMDA.NHibernateSupport AndroMDA.NHibernateSupport.VS2005.csproj AssemblyInfo.cs etc/andromda-dotnet/AndroMDA.NHibernateSupport/src DbSupport.cs etc/andromda-dotnet/Lib/AndroMDA.NHibernateSupport AndroMDA.NHibernateSupport.dll etc/andromda-dotnet/Lib DLL Versions.txt Removed: etc/andromda-dotnet/AndroMDA.NHibernateSupport AndroMDA.NHibernateSupport.csproj AndroMDA.NHibernateSupport.sln VS2005Build.bat VS2005Readme.txt Log: - Added patch to DbSupport.cs of NHibernateSupport.dll to fix issue when drop script exists - Updated version of dll to 1.0.6.0 Revision Changes Path 1.2 +1 -2 plugins/etc/andromda-dotnet/AndroMDA.NHibernateSupport/AndroMDA.NHibernateSupport.VS2005.csproj Index: AndroMDA.NHibernateSupport.VS2005.csproj =================================================================== RCS file: /cvsroot/andromdaplugins/plugins/etc/andromda-dotnet/AndroMDA.NHibernateSupport/AndroMDA.NHibernateSupport.VS2005.csproj,v retrieving revision 1.1 retrieving revision 1.2 diff -u -w -r1.1 -r1.2 --- AndroMDA.NHibernateSupport.VS2005.csproj 17 Aug 2006 03:51:49 -0000 1.1 +++ AndroMDA.NHibernateSupport.VS2005.csproj 28 Sep 2006 17:23:09 -0000 1.2 @@ -1,4 +1,4 @@ -<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> +<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <PropertyGroup> <ProjectType>Local</ProjectType> <ProductVersion>8.0.50727</ProductVersion> @@ -122,7 +122,6 @@ </Compile> </ItemGroup> <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> - <Import Project="$(MSBuildExtensionsPath)\MSBee\MSBuildExtras.FX1_1.CSharp.targets" Condition=" '$(BuildingInsideVisualStudio)' == '' AND '$(TargetFX1_1)'=='true'" /> <PropertyGroup> <PreBuildEvent> </PreBuildEvent> 1.3 +2 -2 plugins/etc/andromda-dotnet/AndroMDA.NHibernateSupport/AssemblyInfo.cs Index: AssemblyInfo.cs =================================================================== RCS file: /cvsroot/andromdaplugins/plugins/etc/andromda-dotnet/AndroMDA.NHibernateSupport/AssemblyInfo.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -u -w -r1.2 -r1.3 --- AssemblyInfo.cs 17 Aug 2006 03:51:49 -0000 1.2 +++ AssemblyInfo.cs 28 Sep 2006 17:23:09 -0000 1.3 @@ -11,7 +11,7 @@ [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("The AndroMDA Project")] [assembly: AssemblyProduct("AndroMDA")] -[assembly: AssemblyCopyright("Copyright (c) 2002 - 2005, The AndroMDA Team")] +[assembly: AssemblyCopyright("Copyright (c) 2002 - 2006, The AndroMDA Team")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] @@ -26,7 +26,7 @@ // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("1.0.5.0")] +[assembly: AssemblyVersion("1.0.6.0")] // // In order to sign your assembly you must specify a key to use. Refer to the 1.3 +203 -244 plugins/etc/andromda-dotnet/AndroMDA.NHibernateSupport/src/DbSupport.cs Index: DbSupport.cs =================================================================== RCS file: /cvsroot/andromdaplugins/plugins/etc/andromda-dotnet/AndroMDA.NHibernateSupport/src/DbSupport.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -u -w -r1.2 -r1.3 --- DbSupport.cs 27 Jul 2006 02:08:19 -0000 1.2 +++ DbSupport.cs 28 Sep 2006 17:23:09 -0000 1.3 @@ -32,6 +32,43 @@ #endregion + #region Private static methods + /// <summary> + /// Executes the given array of sql commands. + /// </summary> + /// <param name="sqlCmds">Array of sql commands.</param> + /// <returns>Flag whether transaction was successful.</returns> + private static bool ExecuteSqlCommands(string[] sqlCmds) + { + // create command for this transaction: + ISession session = SessionManagerFactory.SessionManager.Session; + IDbCommand command = session.Connection.CreateCommand(); + + SessionManagerFactory.SessionManager.BeginTransaction(); + try + { + foreach (string sql in sqlCmds) + { + command.CommandText = sql; + command.CommandType = CommandType.Text; + session.Transaction.Enlist(command); + command.ExecuteNonQuery(); + } + + // all worked well: + SessionManagerFactory.SessionManager.CommitTransaction(); + return true; + } + catch (Exception ex) + { + SessionManagerFactory.SessionManager.RollbackTransaction(); + log.Error("An error occured while running SQL script.", ex); + return false; + } + } + + #endregion + #region Public instance methods /// <summary> /// Generates DDL for the target database to create the tables. @@ -79,10 +116,6 @@ /// <returns>The DDL used to create the tables.</returns> public string RegenerateDatabase(System.IO.FileInfo createFile, System.IO.FileInfo dropFile) { - string dropScriptFileName = null; - string dropSQL = null; - bool errorWhileExporting = false; - if (createFile == null) throw new ArgumentNullException("createFile", "The create FileInfo object can't be null."); @@ -96,14 +129,10 @@ string oldFile = Path.GetFileNameWithoutExtension(dropFile.Name) + "-old" + dropFile.Extension; File.Copy(dropFile.FullName, oldFile, true); - // Next, read the contents of the file + // read and execute drop script: try { - using (System.IO.TextReader reader = dropFile.OpenText()) - { - dropSQL = reader.ReadToEnd(); - reader.Close(); - } + ExecuteSqlCommands(File.ReadAllLines(dropFile.FullName)); } catch (Exception ex) { @@ -120,108 +149,39 @@ fs = null; } - IDbConnection conn = SessionManagerFactory.SessionManager.Session.Connection; - string[] dropSQLArray; - string[] createDBArray; - - using (IDbCommand command = conn.CreateCommand()) - { - // Execute the SQL script to drop the current schema - if (dropSQL != null && dropSQL.Trim().Length > 0) - { - command.CommandText = dropSQL; - command.CommandType = CommandType.Text; - - try - { - command.ExecuteNonQuery(); - - if (log.IsInfoEnabled) - log.Info("Dropped the current schema using the following SQL:" + Environment.NewLine + dropSQL); - } - catch (Exception ex) - { - log.Error("An error occured while trying to drop the existing database schema.", ex); - throw; - } - } - - // Now generate the 'drop sql' script for the new database schema - dropSQLArray = GenerateDropSQL(); - - // Now generate the 'create sql' script for the new database schema - createDBArray = GenerateCreateSQL(); - - // Run the create SQL code - SessionManagerFactory.SessionManager.BeginTransaction(); - foreach (string sql in createDBArray) - { - command.CommandText = sql; - command.CommandType = CommandType.Text; - SessionManagerFactory.SessionManager.Session.Transaction.Enlist(command); - try - { - command.ExecuteNonQuery(); - } - catch (Exception ex) - { - errorWhileExporting = true; - log.Error("An error occured while running the create script.", ex); - } - } - - if (errorWhileExporting) - SessionManagerFactory.SessionManager.RollbackTransaction(); - else - SessionManagerFactory.SessionManager.CommitTransaction(); - - } + // get new create and drop scripts: + string[] dropSQLArray = GenerateDropSQL(); + string[] createDBArray = GenerateCreateSQL(); - // Save the create script + // create new database and save ddl: + bool errorWhileExporting = false; try { - if (createFile.Exists) - { - createFile.Delete(); - createFile.Refresh(); - } - using (StreamWriter sw = createFile.CreateText()) - { - foreach (string sql in createDBArray) - { - sw.WriteLine(sql); - } - sw.Close(); - } + errorWhileExporting = !ExecuteSqlCommands(createDBArray); + File.WriteAllLines(createFile.FullName, createDBArray); } catch (Exception ex) { - log.Error(String.Format("A problem occurred while creating the {0} file containing the CREATE DDL.", createFile.FullName), ex); + log.Error(String.Format("A problem occurred while creating the CREATE DDL file '{0}'.", createFile.FullName), ex); } // Save the delete script so we can use it the next time + string dropScriptFileName = dropFile.FullName; try { - //If we had errors while creating the - //schema, then save the new 'drop schema' sql script to a new file + // if we had errors while creating the schema, then save the new + // 'drop schema' sql script to a new file: if (errorWhileExporting && dropFile != null) { //otherwise, save the old 'Delete' script and create the delete script with a new name. dropScriptFileName = System.IO.Path.GetFileNameWithoutExtension(dropFile.FullName) + ".failure" + dropFile.Extension; } - else - dropScriptFileName = dropFile.FullName; - // Remove the reference to the dropFile + // don't need this any longer: dropFile = null; - using (System.IO.StreamWriter writer = File.CreateText(dropScriptFileName)) - { - foreach (string sqlLine in dropSQLArray) - { - writer.WriteLine(sqlLine); - } - } + // store drop commands: + File.WriteAllLines(dropScriptFileName, dropSQLArray); log.Info(String.Format("The delete DDL was written to {0}", dropScriptFileName)); if (errorWhileExporting) @@ -240,7 +200,6 @@ } return String.Join(Environment.NewLine, createDBArray); - } #endregion 1.4 +198 -226 plugins/etc/andromda-dotnet/Lib/AndroMDA.NHibernateSupport/AndroMDA.NHibernateSupport.dll <<Binary file>> No revision No revision |
From: Eric C. <ecr...@us...> - 2006-09-28 05:36:08
|
User: ecrutchfield Date: 06/09/27 22:36:08 Modified: andromda-aspdotnet/src/test/expected cartridge-output.zip Log: fix bug with calendar parameters Revision Changes Path 1.3 +130 -68 cartridges/andromda-aspdotnet/src/test/expected/cartridge-output.zip <<Binary file>> |
From: Eric C. <ecr...@us...> - 2006-09-28 05:35:31
|
User: ecrutchfield Date: 06/09/27 22:35:30 Modified: andromda-aspdotnet/src/main/resources/templates/aspdotnet/web2005 webform.aspx.vsl Default.master.vsl renderFormInput.vm webformBase.cs.vsl andromda-aspdotnet/src/main/resources/META-INF/andromda cartridge.xml Added: andromda-aspdotnet/src/main/resources/calendar CalendarControl.js CalendarControlHead.js CalendarControl.css Removed: andromda-aspdotnet/src/main/resources/calendar style.css oboutCalendar.js Log: fix bug with calendar parameters Revision Changes Path 1.3 +3 -3 cartridges/andromda-aspdotnet/src/main/resources/templates/aspdotnet/web2005/webform.aspx.vsl Index: webform.aspx.vsl =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-aspdotnet/src/main/resources/templates/aspdotnet/web2005/webform.aspx.vsl,v retrieving revision 1.2 retrieving revision 1.3 diff -u -w -r1.2 -r1.3 --- webform.aspx.vsl 25 Sep 2006 19:14:29 -0000 1.2 +++ webform.aspx.vsl 28 Sep 2006 05:35:30 -0000 1.3 @@ -29,15 +29,15 @@ <asp:FileUpload ID="${parameter.name}FileSelector" runat="server" /></td> #else <asp:$type id="$stringUtils.lowerCamelCaseName(${action.name})_${parameter.name}$type" ToolTip="<%$ Resources:GeneratedResources, ${key}_${parameter.name}_${type}_Help %>" - #if(${parameter.isCalendar()})ReadOnly="True" #end#if(${parameter.isReadOnly()})ReadOnly="True" #end #if(${parameter.inputTextarea})TextMode="MultiLine" #if($parameter.fieldColumnCount)Columns=${parameter.fieldColumnCount} #end #if($parameter.fieldRowCount)Rows=${parameter.fieldRowCount} #end#end #if(${parameter.inputPassword})TextMode="Password" #end + #if(${parameter.readOnly})ReadOnly="True" #end #if(${parameter.inputTextarea})TextMode="MultiLine" #if($parameter.fieldColumnCount)Columns=${parameter.fieldColumnCount} #end #if($parameter.fieldRowCount)Rows=${parameter.fieldRowCount} #end#end #if(${parameter.inputPassword})TextMode="Password" #end #if($type.equalsIgnoreCase('ListBox'))SelectionMode=Multiple #end#if($type.equals('RadioButton')) GroupName="${parameter.getRadioButtonGroup()}" #end runat="server"></asp:$type> #if(${parameter.required}) #if(!$type.equalsIgnoreCase("checkbox")) <asp:RequiredFieldValidator id="${parameter.name}RF" runat="server" ErrorMessage="You must specify a value for this field." ControlToValidate="$stringUtils.lowerCamelCaseName(${action.name})_${parameter.name}TextBox"></asp:RequiredFieldValidator> #end #end -#if(${parameter.isCalendar()}) - <asp:Calendar ID="${parameter.name}Calendar" runat="server" ></asp:Calendar> +#if(${parameter.calendar}) + <IMG id="$stringUtils.lowerCamelCaseName(${action.name})_${parameter.name}${parameter.viewType}Calendar" src="~/calendar/calendar.gif" runat="server"> #end #end #if ($parameter.validationRequired) 1.2 +3 -1 cartridges/andromda-aspdotnet/src/main/resources/templates/aspdotnet/web2005/Default.master.vsl Index: Default.master.vsl =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-aspdotnet/src/main/resources/templates/aspdotnet/web2005/Default.master.vsl,v retrieving revision 1.1 retrieving revision 1.2 diff -u -w -r1.1 -r1.2 --- Default.master.vsl 17 Sep 2006 17:30:41 -0000 1.1 +++ Default.master.vsl 28 Sep 2006 05:35:30 -0000 1.2 @@ -4,9 +4,11 @@ <html xmlns="http://www.w3.org/1999/xhtml" > <head runat="server"> <link href="~/layout/default.css" rel="stylesheet" type="text/css" /> - + <link href="~/calendar/CalendarControl.css" rel="stylesheet" type="text/css" /> + <SCRIPT language="javascript" src="<% Response.Write(ResolveClientUrl("~/calendar/CalendarControlHead.js")); %>"></SCRIPT> </head> <body > + <SCRIPT language="javascript" src="<% Response.Write(ResolveClientUrl("~/calendar/CalendarControl.js"));%>"></SCRIPT> <form id="form1" runat="server"> <div id="menu"> <asp:contentplaceholder id="MenuPlaceHolder" runat="server"> 1.2 +3 -0 cartridges/andromda-aspdotnet/src/main/resources/templates/aspdotnet/web2005/renderFormInput.vm Index: renderFormInput.vm =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-aspdotnet/src/main/resources/templates/aspdotnet/web2005/renderFormInput.vm,v retrieving revision 1.1 retrieving revision 1.2 diff -u -w -r1.1 -r1.2 --- renderFormInput.vm 25 Sep 2006 19:12:43 -0000 1.1 +++ renderFormInput.vm 28 Sep 2006 05:35:30 -0000 1.2 @@ -15,6 +15,9 @@ protected System.Web.UI.WebControls.HiddenField $stringUtils.lowerCamelCaseName(${action.name})_${parameter.name}Hidden; #else protected System.Web.UI.WebControls.$aspType $stringUtils.lowerCamelCaseName(${action.name})_${parameter.name}$aspType; +#if($parameter.calendar) + protected System.Web.UI.HtmlControls.HtmlImage $stringUtils.lowerCamelCaseName(${action.name})_${parameter.name}${aspType}Calendar; +#end #end #end protected System.Web.UI.WebControls.Button ${action.actionMethodName}Button; 1.4 +3 -0 cartridges/andromda-aspdotnet/src/main/resources/templates/aspdotnet/web2005/webformBase.cs.vsl Index: webformBase.cs.vsl =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-aspdotnet/src/main/resources/templates/aspdotnet/web2005/webformBase.cs.vsl,v retrieving revision 1.3 retrieving revision 1.4 diff -u -w -r1.3 -r1.4 --- webformBase.cs.vsl 28 Sep 2006 01:12:54 -0000 1.3 +++ webformBase.cs.vsl 28 Sep 2006 05:35:30 -0000 1.4 @@ -53,6 +53,9 @@ this.$stringUtils.lowerCamelCaseName(${action.name})_${parameter.name}${parameter.viewType}.DataSource = base.Controller.${action.formImplementationPropertyName}.Get$stringUtils.capitalize(${parameter.backingListName})(); this.$stringUtils.lowerCamelCaseName(${action.name})_${parameter.name}${parameter.viewType}.DataBind(); #end +#if ($parameter.calendar) + this.$stringUtils.lowerCamelCaseName(${action.name})_${parameter.name}${parameter.viewType}Calendar.Attributes.Add("onclick", "javascript:showCalendarControl(" + $stringUtils.lowerCamelCaseName(${action.name})_${parameter.name}${parameter.viewType}.ClientID + "); "); +#end ## Now render any error messages for the validation controls. This is done ## here because we need to do some string manipulation on the value we pull from ## the resource. 1.1 cartridges/andromda-aspdotnet/src/main/resources/calendar/CalendarControl.js Index: CalendarControl.js =================================================================== document.write("<iframe id='CalendarControlIFrame' src='javascript:false;' frameBorder='0' scrolling='no'></iframe>"); document.write("<div id='CalendarControl'></div>"); 1.1 cartridges/andromda-aspdotnet/src/main/resources/calendar/CalendarControlHead.js Index: CalendarControlHead.js =================================================================== //Script provided courtesy of Purdue University Engineering Computer Network. web...@ec... function positionInfo(object) { var p_elm = object; this.getElementLeft = getElementLeft; function getElementLeft() { var x = 0; var elm; if(typeof(p_elm) == "object"){ elm = p_elm; } else { elm = document.getElementById(p_elm); } while (elm != null) { x+= elm.offsetLeft; elm = elm.offsetParent; } return parseInt(x); } this.getElementWidth = getElementWidth; function getElementWidth(){ var elm; if(typeof(p_elm) == "object"){ elm = p_elm; } else { elm = document.getElementById(p_elm); } return parseInt(elm.offsetWidth); } this.getElementRight = getElementRight; function getElementRight(){ return getElementLeft(p_elm) + getElementWidth(p_elm); } this.getElementTop = getElementTop; function getElementTop() { var y = 0; var elm; if(typeof(p_elm) == "object"){ elm = p_elm; } else { elm = document.getElementById(p_elm); } while (elm != null) { y+= elm.offsetTop; elm = elm.offsetParent; } return parseInt(y); } this.getElementHeight = getElementHeight; function getElementHeight(){ var elm; if(typeof(p_elm) == "object"){ elm = p_elm; } else { elm = document.getElementById(p_elm); } return parseInt(elm.offsetHeight); } this.getElementBottom = getElementBottom; function getElementBottom(){ return getElementTop(p_elm) + getElementHeight(p_elm); } } function CalendarControl() { var calendarId = 'CalendarControl'; var currentYear = 0; var currentMonth = 0; var currentDay = 0; var selectedYear = 0; var selectedMonth = 0; var selectedDay = 0; var months = ['January','February','March','April','May','June','July','August','September','October','November','December']; var dateField = null; function getProperty(p_property){ var p_elm = calendarId; var elm = null; if(typeof(p_elm) == "object"){ elm = p_elm; } else { elm = document.getElementById(p_elm); } if (elm != null){ if(elm.style){ elm = elm.style; if(elm[p_property]){ return elm[p_property]; } else { return null; } } else { return null; } } } function setElementProperty(p_property, p_value, p_elmId){ var p_elm = p_elmId; var elm = null; if(typeof(p_elm) == "object"){ elm = p_elm; } else { elm = document.getElementById(p_elm); } if((elm != null) && (elm.style != null)){ elm = elm.style; elm[ p_property ] = p_value; } } function setProperty(p_property, p_value) { setElementProperty(p_property, p_value, calendarId); } function getDaysInMonth(year, month) { return [31,((!(year % 4 ) && ( (year % 100 ) || !( year % 400 ) ))?29:28),31,30,31,30,31,31,30,31,30,31][month-1]; } function getDayOfWeek(year, month, day) { var date = new Date(year,month-1,day) return date.getDay(); } this.setDate = setDate; function setDate(year, month, day) { if (dateField) { if (month < 10) {month = "0" + month;} if (day < 10) {day = "0" + day;} var dateString = month+"/"+day+"/"+year; dateField.value = dateString; hide(); } return; } this.changeMonth = changeMonth; function changeMonth(change) { currentMonth += change; currentDay = 0; if(currentMonth > 12) { currentMonth = 1; currentYear++; } else if(currentMonth < 1) { currentMonth = 12; currentYear--; } calendar = document.getElementById(calendarId); calendar.innerHTML = calendarDrawTable(); } this.changeYear = changeYear; function changeYear(change) { currentYear += change; currentDay = 0; calendar = document.getElementById(calendarId); calendar.innerHTML = calendarDrawTable(); } function getCurrentYear() { var year = new Date().getYear(); if(year < 1900) year += 1900; return year; } function getCurrentMonth() { return new Date().getMonth() + 1; } function getCurrentDay() { return new Date().getDate(); } function calendarDrawTable() { var dayOfMonth = 1; var validDay = 0; var startDayOfWeek = getDayOfWeek(currentYear, currentMonth, dayOfMonth); var daysInMonth = getDaysInMonth(currentYear, currentMonth); var css_class = null; //CSS class for each day var table = "<table cellspacing='0' cellpadding='0' border='0'>"; table = table + "<tr class='header'>"; table = table + " <td colspan='2' class='previous'><a href='javascript:changeCalendarControlMonth(-1);'><</a> <a href='javascript:changeCalendarControlYear(-1);'>«</a></td>"; table = table + " <td colspan='3' class='title'>" + months[currentMonth-1] + "<br>" + currentYear + "</td>"; table = table + " <td colspan='2' class='next'><a href='javascript:changeCalendarControlYear(1);'>»</a> <a href='javascript:changeCalendarControlMonth(1);'>></a></td>"; table = table + "</tr>"; table = table + "<tr><th>S</th><th>M</th><th>T</th><th>W</th><th>T</th><th>F</th><th>S</th></tr>"; for(var week=0; week < 6; week++) { table = table + "<tr>"; for(var dayOfWeek=0; dayOfWeek < 7; dayOfWeek++) { if(week == 0 && startDayOfWeek == dayOfWeek) { validDay = 1; } else if (validDay == 1 && dayOfMonth > daysInMonth) { validDay = 0; } if(validDay) { if (dayOfMonth == selectedDay && currentYear == selectedYear && currentMonth == selectedMonth) { css_class = 'current'; } else if (dayOfWeek == 0 || dayOfWeek == 6) { css_class = 'weekend'; } else { css_class = 'weekday'; } table = table + "<td><a class='"+css_class+"' href=\"javascript:setCalendarControlDate("+currentYear+","+currentMonth+","+dayOfMonth+")\">"+dayOfMonth+"</a></td>"; dayOfMonth++; } else { table = table + "<td class='empty'> </td>"; } } table = table + "</tr>"; } table = table + "<tr class='header'><th colspan='7' style='padding: 3px;'><a href='javascript:hideCalendarControl();'>Close</a></td></tr>"; table = table + "</table>"; return table; } this.show = show; function show(field) { // If the calendar is visible and associated with // this field do not do anything. if (dateField == field) { return; } else { dateField = field; } if(dateField) { try { var dateString = new String(dateField.value); var dateParts = dateString.split("-"); selectedMonth = parseInt(dateParts[0],10); selectedDay = parseInt(dateParts[1],10); selectedYear = parseInt(dateParts[2],10); } catch(e) {} } if (!(selectedYear && selectedMonth && selectedDay)) { selectedMonth = getCurrentMonth(); selectedDay = getCurrentDay(); selectedYear = getCurrentYear(); } currentMonth = selectedMonth; currentDay = selectedDay; currentYear = selectedYear; if(document.getElementById){ calendar = document.getElementById(calendarId); calendar.innerHTML = calendarDrawTable(currentYear, currentMonth); setElementProperty('display', 'block', 'CalendarControlIFrame'); setProperty('display', 'block'); var fieldPos = new positionInfo(dateField); var calendarPos = new positionInfo(calendarId); var x = fieldPos.getElementLeft(); var y = fieldPos.getElementBottom(); setProperty('left', x + "px"); setProperty('top', y + "px"); setElementProperty('left', x + "px", 'CalendarControlIFrame'); setElementProperty('top', y + "px", 'CalendarControlIFrame'); setElementProperty('width', calendarPos.getElementWidth() + "px", 'CalendarControlIFrame'); setElementProperty('height', calendarPos.getElementHeight() + "px", 'CalendarControlIFrame'); } } this.hide = hide; function hide() { if(dateField) { setProperty('display', 'none'); setElementProperty('display', 'none', 'CalendarControlIFrame'); dateField = null; } } } var calendarControl = new CalendarControl(); function showCalendarControl(textField) { calendarControl.show(textField); } function hideCalendarControl() { calendarControl.hide(); } function setCalendarControlDate(year, month, day) { calendarControl.setDate(year, month, day); } function changeCalendarControlYear(change) { calendarControl.changeYear(change); } function changeCalendarControlMonth(change) { calendarControl.changeMonth(change); } 1.1 cartridges/andromda-aspdotnet/src/main/resources/calendar/CalendarControl.css Index: CalendarControl.css =================================================================== #CalendarControlIFrame { display: none; left: 0px; position: absolute; top: 0px; height: 250px; width: 250px; z-index: 99; } #CalendarControl { position:absolute; background-color:#FFF; margin:0; padding:0; display:none; z-index: 100; } #CalendarControl table { font-family: arial, verdana, helvetica, sans-serif; font-size: 8pt; border-left: 1px solid #336; border-right: 1px solid #336; } #CalendarControl th { font-weight: normal; } #CalendarControl th a { font-weight: normal; text-decoration: none; color: #FFF; padding: 1px; } #CalendarControl td { text-align: center; } #CalendarControl .header { background-color: #336; } #CalendarControl .weekday { background-color: #DDD; color: #000; } #CalendarControl .weekend { background-color: #FFC; color: #000; } #CalendarControl .current { border: 1px solid #339; background-color: #336; color: #FFF; } #CalendarControl .weekday, #CalendarControl .weekend, #CalendarControl .current { display: block; text-decoration: none; border: 1px solid #FFF; width: 2em; } #CalendarControl .weekday:hover, #CalendarControl .weekend:hover, #CalendarControl .current:hover { color: #FFF; background-color: #336; border: 1px solid #999; } #CalendarControl .previous { text-align: left; } #CalendarControl .next { text-align: right; } #CalendarControl .previous, #CalendarControl .next { padding: 1px 3px 1px 3px; font-size: 1.4em; } #CalendarControl .previous a, #CalendarControl .next a { color: #FFF; text-decoration: none; font-weight: bold; } #CalendarControl .title { text-align: center; font-weight: bold; color: #FFF; } #CalendarControl .empty { background-color: #CCC; border: 1px solid #FFF; } 1.4 +0 -1 cartridges/andromda-aspdotnet/src/main/resources/META-INF/andromda/cartridge.xml Index: cartridge.xml =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-aspdotnet/src/main/resources/META-INF/andromda/cartridge.xml,v retrieving revision 1.3 retrieving revision 1.4 diff -u -w -r1.3 -r1.4 --- cartridge.xml 28 Sep 2006 01:07:22 -0000 1.3 +++ cartridge.xml 28 Sep 2006 05:35:30 -0000 1.4 @@ -54,7 +54,6 @@ path="calendar/*.*" outputPattern="calendar/{0}" outlet="web" - outputCondition="is2003Solution" overwrite="false"/> <resource path="layout/*.*" |
From: Eric C. <ecr...@us...> - 2006-09-28 01:12:55
|
User: ecrutchfield Date: 06/09/27 18:12:54 Modified: andromda-aspdotnet/src/main/resources/META-INF/andromda namespace.xml metafacades.xml andromda-aspdotnet/src/main/java/org/andromda/cartridges/aspdotnet/metafacades AspActionLogicImpl.java andromda-aspdotnet/src/main/resources/templates/aspdotnet/uicontrollers UIPController.cs.vsl Controller.cs.vm andromda-aspdotnet/src/test/expected cartridge-output.zip andromda-aspdotnet/src/main/uml AspDotNetMetafacadeModelv4.xml.zip andromda-aspdotnet/src/main/resources/templates/aspdotnet/web2005 webformBase.cs.vsl andromda-aspdotnet/src/test/uml AspCartridgeTestModel1.xml.zip andromda-aspdotnet/src/main/java/org/andromda/cartridges/aspdotnet CommonProperties.java Added: andromda-aspdotnet/src/main/java/org/andromda/cartridges/aspdotnet/metafacades AspBackendServiceLogicImpl.java Log: fix bug with final state transitions and add support in the controller for session objects and services Revision Changes Path 1.3 +16 -0 cartridges/andromda-aspdotnet/src/main/resources/META-INF/andromda/namespace.xml Index: namespace.xml =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-aspdotnet/src/main/resources/META-INF/andromda/namespace.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -u -w -r1.2 -r1.3 --- namespace.xml 25 Sep 2006 19:25:00 -0000 1.2 +++ namespace.xml 28 Sep 2006 01:12:53 -0000 1.3 @@ -237,6 +237,22 @@ refer to the documentation of that class for more information. This format is case-sensitive. </documentation> </property> + <property name="servicePackageNamePattern"> + <default>{0}</default> + <documentation> + The name of the package in which to create the service files. <code>{0}</code> + can be used to denote the package in which the service has been modeled. + </documentation> + </property> + <property name="serviceAccessorPattern" required="false"> + <documentation> + The pattern to use when calling the backend code for <![CDATA[<<Service>>]]> lookups. + For calling services you would use following pattern: + <ul> + <li><strong>NSpring</strong>: <code>${application.package}.ServiceLocator.Get{1}()</code></li> + </ul> + </documentation> + </property> </propertyGroup> </properties> 1.3 +7 -0 cartridges/andromda-aspdotnet/src/main/resources/META-INF/andromda/metafacades.xml Index: metafacades.xml =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-aspdotnet/src/main/resources/META-INF/andromda/metafacades.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -u -w -r1.2 -r1.3 --- metafacades.xml 25 Sep 2006 19:25:00 -0000 1.2 +++ metafacades.xml 28 Sep 2006 01:12:53 -0000 1.3 @@ -110,4 +110,11 @@ </mapping> <!-- property reference="actionFormKey"/ --> </metafacade> + <metafacade class="org.andromda.cartridges.aspdotnet.metafacades.AspBackendServiceLogicImpl"> + <mapping> + <stereotype>SERVICE</stereotype> + </mapping> + <property reference="serviceAccessorPattern"/> + <property reference="servicePackageNamePattern"/> + </metafacade> </metafacades> \ No newline at end of file 1.3 +9 -1 cartridges/andromda-aspdotnet/src/main/java/org/andromda/cartridges/aspdotnet/metafacades/AspActionLogicImpl.java Index: AspActionLogicImpl.java =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-aspdotnet/src/main/java/org/andromda/cartridges/aspdotnet/metafacades/AspActionLogicImpl.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -w -r1.2 -r1.3 --- AspActionLogicImpl.java 25 Sep 2006 19:24:05 -0000 1.2 +++ AspActionLogicImpl.java 28 Sep 2006 01:12:54 -0000 1.3 @@ -1,7 +1,7 @@ package org.andromda.cartridges.aspdotnet.metafacades; -import java.util.ArrayList; import java.util.Collection; +import java.util.ArrayList; import java.util.Iterator; import java.util.List; import org.andromda.cartridges.aspdotnet.AspProfile; @@ -27,6 +27,14 @@ } /** + * @see org.andromda.cartridges.aspdotnet.metafacades.AspAction#isFinalStateTarget() + */ + protected boolean handleIsFinalStateTarget() + { + return this.getTarget() instanceof AspFinalState; + } + + /** * @see org.andromda.cartridges.aspdotnet.metafacades.AspAction#isHyperlink() */ protected boolean handleIsHyperlink() 1.1 cartridges/andromda-aspdotnet/src/main/java/org/andromda/cartridges/aspdotnet/metafacades/AspBackendServiceLogicImpl.java Index: AspBackendServiceLogicImpl.java =================================================================== package org.andromda.cartridges.aspdotnet.metafacades; import org.andromda.cartridges.aspdotnet.CommonProperties; /** * MetafacadeLogic implementation for org.andromda.cartridges.aspdotnet.metafacades.AspBackendService. * * @see org.andromda.cartridges.aspdotnet.metafacades.AspBackendService */ public class AspBackendServiceLogicImpl extends AspBackendServiceLogic { public AspBackendServiceLogicImpl (Object metaObject, String context) { super (metaObject, context); } /** * @see org.andromda.cartridges.aspdotnet.metafacades.AspBackendService#getAccessorImplementation() */ protected java.lang.String handleGetAccessorImplementation() { String accessorImplementation = String.valueOf( getConfiguredProperty(CommonProperties.SERVICE_ACCESSOR_PATTERN)); return accessorImplementation.replaceAll("\\{0\\}", getPackageName()).replaceAll("\\{1\\}", getName()); } /** * @see org.andromda.metafacades.uml.ModelElementFacade#getFullyQualifiedName() */ public java.lang.String getFullyQualifiedName() { String packageName = String.valueOf( getConfiguredProperty(CommonProperties.SERVICE_PACKAGE_NAME_PATTERN)); return packageName.replaceAll("\\{0\\}", super.getPackageName()) + "." + this.getName(); } } 1.3 +51 -10 cartridges/andromda-aspdotnet/src/main/resources/templates/aspdotnet/uicontrollers/UIPController.cs.vsl Index: UIPController.cs.vsl =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-aspdotnet/src/main/resources/templates/aspdotnet/uicontrollers/UIPController.cs.vsl,v retrieving revision 1.2 retrieving revision 1.3 diff -u -w -r1.2 -r1.3 --- UIPController.cs.vsl 25 Sep 2006 19:08:22 -0000 1.2 +++ UIPController.cs.vsl 28 Sep 2006 01:12:54 -0000 1.3 @@ -40,7 +40,7 @@ /// </summary> public void StartUseCase() { - HttpContext.Current.Response.Redirect(this.${stringUtils.capitalize(${controller.useCase.normalizedName})}()); + this.${stringUtils.capitalize(${controller.useCase.normalizedName})}(); } ## @@ -87,19 +87,13 @@ /// <summary> $action.getDocumentation(" /// ", 80, false) /// </summary> - public virtual string ${stringUtils.capitalize(${action.triggerName})}() + public virtual void ${stringUtils.capitalize(${action.triggerName})}() { -#if ($action.finalStateTarget) -#set ($targetUseCase = $action.target.targetUseCase) - $targetUseCase.controller.fullyQualifiedName nextController = new ${targetUseCase.controller.fullyQualifiedName}(); - return nextController.StartUseCase(); -#else string forward = String.Empty; ${action.fullyQualifiedFormImplementationName} form = this.${action.formImplementationPropertyName}; forward = #processTransition($action) this.${action.formImplementationPropertyName} = form; - return forward; -#end + HttpContext.Current.Response.Redirect(forward); } #foreach ($actionState in $action.actionStates) @@ -131,5 +125,52 @@ #end #endregion +#if (!$controller.serviceReferences.isEmpty()) + #region Service references +#foreach ($serviceRef in $controller.serviceReferences) +#if ($stringUtils.isNotBlank($serviceRef.targetElement.accessorImplementation)) + /// <summary> + /// Returns a reference to the $serviceRef.name back-end service. + /// </summary> + protected $serviceRef.targetElement.fullyQualifiedName ${serviceRef.getterName}() + { + try + { + return $serviceRef.targetElement.accessorImplementation; + } + catch (Exception ex) + { + throw new InvalidOperationException(ex); + } + } + +#end +#end + #endregion +#end + +#if(!$controller.sessionObjects.isEmpty()) + #region Session Object references +#foreach ($sessionObject in $controller.sessionObjects) +#set ($targetElement = $sessionObject.targetElement) + /// <summary> +$sessionObject.getDocumentation(" /// ", 80, false) + /// </summary> + public $targetElement.fullyQualifiedName ${stringUtils.capitalize($sessionObject.name)} + { + get + { + return HttpContext.Current.Session["${sessionObject.fullyQualifiedName}"] as $targetElement.fullyQualifiedName; + } + + set + { + HttpContext.Current.Session["${sessionObject.fullyQualifiedName}"] = value; + } + } + +#end + #endregion +#end } } \ No newline at end of file 1.3 +1 -1 cartridges/andromda-aspdotnet/src/main/resources/templates/aspdotnet/uicontrollers/Controller.cs.vm Index: Controller.cs.vm =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-aspdotnet/src/main/resources/templates/aspdotnet/uicontrollers/Controller.cs.vm,v retrieving revision 1.2 retrieving revision 1.3 diff -u -w -r1.2 -r1.3 --- Controller.cs.vm 25 Sep 2006 19:05:18 -0000 1.2 +++ Controller.cs.vm 28 Sep 2006 01:12:54 -0000 1.3 @@ -6,7 +6,7 @@ null; #elseif ($transition.enteringFinalState) #set ($targetUseCase = $transition.target.targetUseCase) -this.${targetUseCase.normalizedName}(); +"~/target/src/${targetUseCase.fullyQualifiedPath}/${targetUseCase.normalizedName}UC.aspx"; #elseif ($transition.enteringView) "~/target/src/${transition.target.fullyQualifiedPath}/${transition.target.normalizedName}.aspx"; #elseif ($transition.enteringDecisionPoint) 1.2 +122 -122 cartridges/andromda-aspdotnet/src/test/expected/cartridge-output.zip <<Binary file>> 1.3 +127 -132 cartridges/andromda-aspdotnet/src/main/uml/AspDotNetMetafacadeModelv4.xml.zip <<Binary file>> 1.3 +1 -1 cartridges/andromda-aspdotnet/src/main/resources/templates/aspdotnet/web2005/webformBase.cs.vsl Index: webformBase.cs.vsl =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-aspdotnet/src/main/resources/templates/aspdotnet/web2005/webformBase.cs.vsl,v retrieving revision 1.2 retrieving revision 1.3 diff -u -w -r1.2 -r1.3 --- webformBase.cs.vsl 25 Sep 2006 19:11:21 -0000 1.2 +++ webformBase.cs.vsl 28 Sep 2006 01:12:54 -0000 1.3 @@ -113,7 +113,7 @@ //we need to take the parameters for the given action and persist them across views #populateFormProperties() - Response.Redirect(this.Controller.${webform.normalizedName}$stringUtils.capitalize(${action.actionMethodName})()); + this.Controller.${webform.normalizedName}$stringUtils.capitalize(${action.actionMethodName})(); } #end 1.2 +164 -167 cartridges/andromda-aspdotnet/src/test/uml/AspCartridgeTestModel1.xml.zip <<Binary file>> 1.3 +11 -0 cartridges/andromda-aspdotnet/src/main/java/org/andromda/cartridges/aspdotnet/CommonProperties.java Index: CommonProperties.java =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-aspdotnet/src/main/java/org/andromda/cartridges/aspdotnet/CommonProperties.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -w -r1.2 -r1.3 --- CommonProperties.java 25 Sep 2006 19:25:03 -0000 1.2 +++ CommonProperties.java 28 Sep 2006 01:12:54 -0000 1.3 @@ -105,4 +105,15 @@ public static final String INPUT_TABLE = "table"; public static final String WEB_MENU_GROUP = "@andromda.presentation.web.menu.group"; + + /** + * The namespace property used to identify the pattern used to construct the backend service's accessor. + */ + public static final String SERVICE_ACCESSOR_PATTERN = "serviceAccessorPattern"; + + /** + * The namespace property used to identify the pattern used to construct the backend service's package name. + */ + public static final String SERVICE_PACKAGE_NAME_PATTERN = "servicePackageNamePattern"; + } |
From: Eric C. <ecr...@us...> - 2006-09-28 01:07:24
|
User: ecrutchfield Date: 06/09/27 18:07:22 Modified: andromda-aspdotnet/src/main/resources/templates/aspdotnet sessionObject.cs.vsl andromda-aspdotnet/src/main/resources/META-INF/andromda cartridge.xml Log: generate session objects in app_code if vs2005 solution Revision Changes Path 1.4 +6 -1 cartridges/andromda-aspdotnet/src/main/resources/templates/aspdotnet/sessionObject.cs.vsl Index: sessionObject.cs.vsl =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-aspdotnet/src/main/resources/templates/aspdotnet/sessionObject.cs.vsl,v retrieving revision 1.3 retrieving revision 1.4 diff -u -w -r1.3 -r1.4 --- sessionObject.cs.vsl 25 Sep 2006 19:09:49 -0000 1.3 +++ sessionObject.cs.vsl 28 Sep 2006 01:07:22 -0000 1.4 @@ -1,4 +1,9 @@ -#set($generatedFile = "Common/${sessionObject.name}.cs") +#if($is2005Solution) +#set($folder = "App_Code/target/src/") +#else +#set($folder = "target/src/") +#end +#set($generatedFile = "${folder}${sessionObject.fullyQualifiedPath}/${sessionObject.name}.cs") using System; namespace ${sessionObject.packageName} 1.3 +1 -1 cartridges/andromda-aspdotnet/src/main/resources/META-INF/andromda/cartridge.xml Index: cartridge.xml =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-aspdotnet/src/main/resources/META-INF/andromda/cartridge.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -u -w -r1.2 -r1.3 --- cartridge.xml 25 Sep 2006 19:25:00 -0000 1.2 +++ cartridge.xml 28 Sep 2006 01:07:22 -0000 1.3 @@ -285,7 +285,7 @@ <template path="templates/aspdotnet/sessionObject.cs.vsl" outputPattern="$generatedFile" - outlet="web_generated" + outlet="web" overwrite="true"> <modelElements variable="sessionObject"> <modelElement> |
From: Chris M. <cm...@us...> - 2006-09-27 13:32:24
|
User: cmicali Date: 06/09/27 06:32:23 Modified: andromda-cs pom.xml andromda-nspring pom.xml Log: Revision Changes Path 1.8 +7 -1 cartridges/andromda-cs/pom.xml Index: pom.xml =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-cs/pom.xml,v retrieving revision 1.7 retrieving revision 1.8 diff -u -w -r1.7 -r1.8 --- pom.xml 21 Sep 2006 02:33:08 -0000 1.7 +++ pom.xml 27 Sep 2006 13:32:20 -0000 1.8 @@ -10,8 +10,14 @@ <artifactId>andromda-cs-cartridge</artifactId> <packaging>andromda-cartridge</packaging> <name>AndroMDA C# Cartridge</name> - <description>Produces C# objects from a model.</description> <version>1.0</version> + <description> + Produces C# objects from a model. + </description> + <issueManagement> + <system>jira</system> + <url>http://galaxy.andromda.org/jira/browse/NETCART</url> + </issueManagement> <developers> <developer> <name>Naresh Bhatia</name> 1.5 +7 -1 cartridges/andromda-nspring/pom.xml Index: pom.xml =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-nspring/pom.xml,v retrieving revision 1.4 retrieving revision 1.5 diff -u -w -r1.4 -r1.5 --- pom.xml 21 Sep 2006 02:33:08 -0000 1.4 +++ pom.xml 27 Sep 2006 13:32:20 -0000 1.5 @@ -10,8 +10,14 @@ <artifactId>andromda-nspring-cartridge</artifactId> <packaging>andromda-cartridge</packaging> <name>AndroMDA NSpring Cartridge</name> - <description>Generates NSpring with NHibernate support</description> <version>1.0</version> + <description> + Generates NSpring with NHibernate support + </description> + <issueManagement> + <system>jira</system> + <url>http://galaxy.andromda.org/jira/browse/NETCART</url> + </issueManagement> <developers> <developer> <name>Naresh Bhatia</name> |
From: Eric C. <ecr...@us...> - 2006-09-25 19:54:08
|
User: ecrutchfield Date: 06/09/25 12:54:01 Modified: . pom.xml Log: build the ASP.NET cartridge Revision Changes Path 1.6 +1 -1 cartridges/pom.xml Index: pom.xml =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/pom.xml,v retrieving revision 1.5 retrieving revision 1.6 diff -u -w -r1.5 -r1.6 --- pom.xml 17 Mar 2006 03:39:38 -0000 1.5 +++ pom.xml 25 Sep 2006 19:54:01 -0000 1.6 @@ -72,7 +72,7 @@ <module>andromda-cs</module> <module>andromda-nhibernate</module> <module>andromda-nspring</module> - <!--module>andromda-aspdotnet</module--> + <module>andromda-aspdotnet</module> </modules> <properties> <build.src>${pom.basedir}/target/src</build.src> |
From: Eric C. <ecr...@us...> - 2006-09-25 19:37:00
|
User: ecrutchfield Date: 06/09/25 12:37:00 Modified: andromda-aspdotnet pom.xml Log: turn on testing Revision Changes Path 1.2 +2 -2 cartridges/andromda-aspdotnet/pom.xml Index: pom.xml =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-aspdotnet/pom.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -u -w -r1.1 -r1.2 --- pom.xml 17 Sep 2006 17:32:24 -0000 1.1 +++ pom.xml 25 Sep 2006 19:37:00 -0000 1.2 @@ -170,8 +170,8 @@ </plugins> </reporting> <properties> - <maven.test.skip>true</maven.test.skip> + <maven.test.skip>false</maven.test.skip> <model.uri>jar:file:${pom.basedir}/src/main/uml/AspDotNetMetafacadeModelv4.xml.zip!/AspDotNetMetafacadeModelv4.xml</model.uri> - <!--test.model.uri>jar:file:${pom.basedir}/src/test/uml/AspDotNetMetafacadeTestModel.xml.zip!/AspDotNetMetafacadeTestModel.xml</test.model.uri--> + <test.model.uri>jar:file:${pom.basedir}/src/test/uml/AspCartridgeTestModel1.xml.zip!/AspCartridgeTestModel1.xml</test.model.uri> </properties> </project> \ No newline at end of file |
From: Eric C. <ecr...@us...> - 2006-09-25 19:33:12
|
User: ecrutchfield Date: 06/09/25 12:33:12 Removed: andromda-aspdotnet/src/test/uml ASPCartridgeTestModel.xml.zip Log: remove wrong test |
From: Eric C. <ecr...@us...> - 2006-09-25 19:32:25
|
User: ecrutchfield Date: 06/09/25 12:32:24 Added: andromda-aspdotnet/src/test/uml AspCartridgeTestModel1.xml.zip Log: test cartridge Revision Changes Path 1.1 cartridges/andromda-aspdotnet/src/test/uml/AspCartridgeTestModel1.xml.zip <<Binary file>> |
From: Eric C. <ecr...@us...> - 2006-09-25 19:25:04
|
User: ecrutchfield Date: 06/09/25 12:25:04 Modified: andromda-aspdotnet/src/main/resources/META-INF/andromda namespace.xml metafacades.xml profile.xml cartridge.xml andromda-aspdotnet/src/main/uml AspDotNetMetafacadeModelv4.xml.zip andromda-aspdotnet/src/main/java/org/andromda/cartridges/aspdotnet CommonProperties.java andromda-aspdotnet/src/main/java/org/andromda/cartridges/aspdotnet/metafacades AspParameterLogicImpl.java Added: andromda-aspdotnet/src/main/java/org/andromda/cartridges/aspdotnet AspUtils.java andromda-aspdotnet/src/main/java/org/andromda/cartridges/aspdotnet/metafacades AspAttributeLogicImpl.java Log: add support for parameter validation Revision Changes Path 1.2 +69 -0 cartridges/andromda-aspdotnet/src/main/resources/META-INF/andromda/namespace.xml Index: namespace.xml =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-aspdotnet/src/main/resources/META-INF/andromda/namespace.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -u -w -r1.1 -r1.2 --- namespace.xml 17 Sep 2006 17:30:42 -0000 1.1 +++ namespace.xml 25 Sep 2006 19:25:00 -0000 1.2 @@ -126,6 +126,20 @@ </property> </propertyGroup> <propertyGroup name="Other"> + <!-- property name="formClassPattern"> + <default>{0}{1}Form</default> + <documentation> + The pattern for constructing the name of the class under which the form (a.k.a the model) is stored, + where <em>{0}</em> is the name of the use case and <em>{1}</em> is the name of the trigger. + </documentation> + </property --> + <property name="controllerImplementationPattern"> + <default>{0}Impl</default> + <documentation> + The pattern for constructing the name of the controller implementation class name (where <em>{0}</em> + represents the modeled name of the controller). + </documentation> + </property> <property name="backingListPattern"> <default>{0}BackingList</default> <documentation> @@ -156,6 +170,13 @@ possible parameter values when selecting from a list). </documentation> </property> + <property name="fileTypeName"> + <default>System.IO.File</default> + <documentation> + The fully qualified type name to use when file types are modeled for parameters (used for + for file uploads). + </documentation> + </property> <property name="dummyData"> <default>false</default> <documentation> @@ -168,6 +189,54 @@ The text to render for 'todo' items in source code. </documentation> </property> + <property name="defaultInputColumnCount" required="false"> + <default>40</default> + <documentation> + If specified denotes the default length of text input fields, + the value specifies the <code>size</code> attribute of the corresponding + <code>input</code> or <code>textarea</code> element. + Not speciying any valid value will make the cartridge ignore it and resort + to the default browser value by not rendering any <code>size</code> attribute. + </documentation> + </property> + <property name="defaultInputRowCount" required="false"> + <default>5</default> + <documentation> + If specified denotes the default number of rows of <code>textarea</code> elements. + Not speciying any valid value will make the cartridge ignore it and resort + to the default browser value by not rendering any <code>size</code> attribute. + </documentation> + </property> + <property name="defaultDateFormat"> + <default>MM/dd/yyyy</default> + <documentation> + The default date format to use in case it has not been explicitely + specified, for event parameters. + The format is specified by the + <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemglobalizationdatetimeformatinfoclasstopic.asp">System.Globalization.DateTimeFormatInfo</a> + class from the .Net Framework. Please + refer to the documentation of that class for more information. This format is case-sensitive. + </documentation> + </property> + <property name="strictDateTimeFormat"> + <default>false</default> + <documentation> + Specifies whether or not date and time formats are to be strictly matched. + This property takes either true or false as values. If set to true all dates and times + entered by the end-user will fail validation if they do not strictly adhere to their given format. + </documentation> + </property> + <property name="defaultTimeFormat"> + <default>HH:mm</default> + <documentation> + The default time format to use when it has not been explicitely + specified for event parameters. + The format is specified by the + <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemglobalizationdatetimeformatinfoclasstopic.asp">System.Globalization.DateTimeFormatInfo</a> + class from the .Net Framework. Please + refer to the documentation of that class for more information. This format is case-sensitive. + </documentation> + </property> </propertyGroup> </properties> 1.2 +14 -1 cartridges/andromda-aspdotnet/src/main/resources/META-INF/andromda/metafacades.xml Index: metafacades.xml =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-aspdotnet/src/main/resources/META-INF/andromda/metafacades.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -u -w -r1.1 -r1.2 --- metafacades.xml 17 Sep 2006 17:30:43 -0000 1.1 +++ metafacades.xml 25 Sep 2006 19:25:00 -0000 1.2 @@ -17,7 +17,7 @@ <mapping> <property name="useCase"/> </mapping> - <!-- property reference="controllerImplementationPattern"/ --> + <property reference="controllerImplementationPattern"/> </metafacade> <metafacade class="org.andromda.cartridges.aspdotnet.metafacades.AspSessionObjectLogicImpl"> @@ -48,6 +48,19 @@ <property reference="backingValuePattern"/> <property reference="labelListPattern"/> <property reference="valueListPattern"/> + <property reference="defaultDateFormat"/> + <property reference="defaultTimeFormat"/> + <property reference="defaultInputColumnCount"/> + <property reference="defaultInputRowCount"/> + </metafacade> + <metafacade class="org.andromda.cartridges.aspdotnet.metafacades.AspAttributeLogicImpl"> + <mapping/> + <property reference="defaultDateFormat"/> + <property reference="defaultTimeFormat"/> + <property reference="backingListPattern"/> + <property reference="backingValuePattern"/> + <property reference="labelListPattern"/> + <property reference="valueListPattern"/> </metafacade> <!-- metafacade class="org.andromda.cartridges.aspdotnet.metafacades.AspTransitionLogicImpl"> 1.2 +74 -43 cartridges/andromda-aspdotnet/src/main/resources/META-INF/andromda/profile.xml Index: profile.xml =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-aspdotnet/src/main/resources/META-INF/andromda/profile.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -u -w -r1.1 -r1.2 --- profile.xml 17 Sep 2006 17:30:43 -0000 1.1 +++ profile.xml 25 Sep 2006 19:25:00 -0000 1.2 @@ -187,6 +187,7 @@ <value>checkbox</value> <value>radio</value> <value>multibox</value> + <value>file</value> </allowedValues> </element> <element name="INPUT_RESET"> @@ -202,52 +203,32 @@ <value>true</value> </allowedValues> </element> - <element name="INPUT_VALIDWHEN"> + <element name="INPUT_RADIO"> <documentation> - Additional validation to be performed, specify a - commons-validator condition here, see - <a href="http://struts.apache.org/userGuide/dev_validator.html" - target="_blank">Struts-Validator</a> and go to the section labeled - <code>http://struts.apache.org/userGuide/dev_validator.html</code>. The required - parentheses will automatically be placed around your condition. + Can be used in combination with the <code>@andromda.presentation.web.view.field.type=radio</code> + tagged value. Use it to specify the number of options to render, the values of these + options will always be the same, alternatively + you can specify a comma-separated list of runtime properties if you prefer the values + to be updateable at runtime. If this tagged value is not specified the cartridge will + assume it to have value '3'. </documentation> - <value>@andromda.presentation.web.view.field.validwhen</value> + <value>@andromda.presentation.view.field.radio</value> <appliedOnElement>Parameter coming out of an action state carrying the <![CDATA[<<FrontEndView>>]]> stereotype</appliedOnElement> <allowedValues> - <value>a Struts 'validwhen' condition</value> + <value>a strictly positive integer</value> + <value default="true">3</value> </allowedValues> </element> - <element name="INPUT_EQUAL"> + <element name="INPUT_CALENDAR"> <documentation> - Allows the comparison between 2 fields, this allows you to specify the - other field that a parameter must equal in order to be valid (like when - comparing two passwords) + Denotes the parameter of type <code>datatype::Date</code> is to be rendered with a calendar + popup next to it. </documentation> - <value>@andromda.presentation.web.view.field.equal</value> + <value>@andromda.presentation.web.view.field.calendar</value> <appliedOnElement>Parameter coming out of an action state carrying the <![CDATA[<<FrontEndView>>]]> stereotype</appliedOnElement> <allowedValues> - <value>a Struts 'validwhen' condition</value> - </allowedValues> - </element> - <element name="INPUT_VALIDATORS"> - <documentation> - Custom validation to be performed, you can add one or more of your own validators here. - Make sure you add your validator definitions in <code>validator-rules.xml</code>, - there is a <a href="../andromda-cartridges/index.html#mergeMappingsUri">merge point</a> - that can be used to have them automatically inserted. - Validator values look like this: <code>myValidator</code>, - <code>myValidator(myVar=myArg)</code>, - <code>myValidator(myVar=myArg,myVar2=myArg2)</code>, etc... - Specify each validator using a new value, don't specify all of them in a single value. - Be careful when using multiple validators with the same 'var' name, the last one - found will be used! Normally speaking this should not happen, so try to avoid it - (I recommend against using names used by known validators: minlength, - test, datePattern, ...) - </documentation> - <value>@andromda.presentation.web.view.field.validators</value> - <appliedOnElement>Parameter coming out of an action state carrying the <![CDATA[<<FrontEndView>>]]> stereotype</appliedOnElement> - <allowedValues> - <value>a call to one of your custom validators</value> + <value default="true">false</value> + <value>true</value> </allowedValues> </element> <element name="INPUT_TABLELINK"> @@ -322,6 +303,56 @@ <value>Comma-separated list of column names</value> </allowedValues> </element> + <element name="INPUT_VALIDWHEN"> + <documentation><![CDATA[ + Additional validation to be performed using a + <a href="http://msdn2.microsoft.com/en-us/library/system.web.ui.webcontrols.comparevalidator.aspx">CompareValidator</a> control. + The comparison can be to either a value (string, number, date) or to another parameter on the form. + ]]> + </documentation> + <value>@andromda.presentation.web.view.field.validwhen</value> + <appliedOnElement>Parameter coming out of an action state carrying the <![CDATA[<<FrontEndView>>]]> stereotype</appliedOnElement> + <allowedValues> + <value><![CDATA[A comparison in the following form: <Operator><ControlToCompare|ValueToCompare> + where Operator is either an <a href="http://msdn2.microsoft.com/en-us/library/system.web.ui.webcontrols.validationcompareoperator.aspx">ValidationCompareOperator Enumeration</a> + or an equivalent operator such as ==, <, >, etc.]]> + </value> + </allowedValues> + </element> + <element name="INPUT_EQUAL"> + <documentation> + Allows the comparison between 2 fields. This allows you to specify the + other field that a parameter must equal in order to be valid (like when + comparing two passwords) + </documentation> + <value>@andromda.presentation.web.view.field.equal</value> + <appliedOnElement>Parameter coming out of an action state carrying the <![CDATA[<<FrontEndView>>]]> stereotype</appliedOnElement> + <allowedValues> + <value>the name of the parameter to validate against</value> + </allowedValues> + </element> + <element name="INPUT_VALIDATORS"> + <documentation> + <font color="red">[Not yet implemented]</font> + Custom validation to be performed, you can add one or more of your own validators here. + Make sure you add your validator definitions in <code>validator-rules.xml</code>, + there is a <a href="../andromda-cartridges/index.html#mergeMappingsUri">merge point</a> + that can be used to have them automatically inserted. + Validator values look like this: <code>myValidator</code>, + <code>myValidator(myVar=myArg)</code>, + <code>myValidator(myVar=myArg,myVar2=myArg2)</code>, etc... + Specify each validator using a new value, don't specify all of them in a single value. + Be careful when using multiple validators with the same 'var' name, the last one + found will be used! Normally speaking this should not happen, so try to avoid it + (I recommend against using names used by known validators: minlength, + test, datePattern, ...) + </documentation> + <value>@andromda.presentation.web.view.field.validators</value> + <appliedOnElement>Parameter coming out of an action state carrying the <![CDATA[<<FrontEndView>>]]> stereotype</appliedOnElement> + <allowedValues> + <value>a call to one of your custom validators</value> + </allowedValues> + </element> <element name="INPUT_REQUIRED"> <documentation> Denotes whether or not this is a required field. If a field is required its type will always be @@ -395,14 +426,14 @@ </tr> <tr> <td>System.String</td> - <td>creditcard</td> + <td><font color="red">[Not yet implemented]</font> creditcard</td> <td>N/A</td> <td>creditcard</td> <td>Validates the value to be a creditcard number, according to what is known as the Luhn check</td> </tr> <tr> <td>System.String</td> - <td>email</td> + <td><font color="red">[Not yet implemented]</font> email</td> <td>N/A</td> <td>email</td> <td>Checks if the specified value is a possible email address, IP addresses are also taken into account</td> @@ -410,10 +441,10 @@ </table> </p> <p> - (*) The format is specified by the System.Globalization.DateTimeFormatInfo class from the .Net Framework, please - refer to the documentation of that class for more information. This format is case-sensitive - <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemglobalizationdatetimeformatinfoclasstopic.asp"> - DateTimeFormatInfo Class</a> + (*) The format is specified by the + <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemglobalizationdatetimeformatinfoclasstopic.asp">System.Globalization.DateTimeFormatInfo</a> + class from the .Net Framework. Please refer to the documentation of that class for more + information. This format is case-sensitive. <br/> (**) The pattern expression is a Perl regular expression as you would you use in Javascript, by convention it requires the ^ and $ to denote respectively the beginning and ending of the pattern @@ -421,7 +452,7 @@ Netscape's guide to regular expressions in Javascript</a> </p> </documentation> - <value>@andromda.presentation.web.view.field.format</value> + <value>@andromda.presentation.view.field.format</value> <appliedOnElement>Parameter coming out of an action state carrying the <![CDATA[<<FrontEndView>>]]> stereotype</appliedOnElement> <allowedValues> <value>Any of the formats listed above</value> 1.2 +10 -19 cartridges/andromda-aspdotnet/src/main/resources/META-INF/andromda/cartridge.xml Index: cartridge.xml =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-aspdotnet/src/main/resources/META-INF/andromda/cartridge.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -u -w -r1.1 -r1.2 --- cartridge.xml 17 Sep 2006 17:30:43 -0000 1.1 +++ cartridge.xml 25 Sep 2006 19:25:00 -0000 1.2 @@ -1,10 +1,13 @@ <cartridge> <templateEngine className="org.andromda.templateengines.velocity.VelocityTemplateEngine"> <macrolibrary name="templates/aspdotnet/web2003/renderFormInput.vm"/> + <macrolibrary name="templates/aspdotnet/web2005/renderFormInput.vm"/> + <macrolibrary name="templates/aspdotnet/web2003/tables.vm"/> + <macrolibrary name="templates/aspdotnet/web2005/tables.vm"/> + <macrolibrary name="templates/aspdotnet/validation.vm"/> <macrolibrary name="templates/aspdotnet/uicontrollers/formImplMacros.vm"/> <macrolibrary name="templates/aspdotnet/uicontrollers/formMacros.vm"/> <macrolibrary name="templates/aspdotnet/uicontrollers/Controller.cs.vm"/> - <!--macrolibrary name="templates/aspdotnet/web2005/renderActionCommandLinkParameter.vm"/--> <!-- cartridge-macrolibrary merge-point--> </templateEngine> @@ -38,13 +41,15 @@ <property reference="valueListPattern"/> <property reference="backingListPattern"/> <property reference="backingValuePattern"/> - + <property reference="fileTypeName"/> + <property reference="defaultDateFormat"/> + <property reference="defaultTimeFormat"/> <!-- cartridge-property merge-point --> + <condition name="is2003Solution">$dotNetVersion.equalsIgnoreCase("1.1")</condition> <condition name="is2005Solution">$dotNetVersion.equalsIgnoreCase("2.0")</condition> <!-- condition merge-point--> - <!-- cartridge-resource merge-point --> <resource path="calendar/*.*" outputPattern="calendar/{0}" @@ -68,6 +73,7 @@ outlet="web" outputCondition="is2005Solution" overwrite="false"/> + <!-- cartridge-resource merge-point --> <!-- .NET 1.1 templates --> <!-- this will generate the default page of the application--> @@ -393,22 +399,6 @@ </modelElements> </template --> - <!-- template - path="templates/aspdotnet/web2005/table.ascx.vsl" - outputPattern="${table.view.path}-${table.name}.ascx" - outlet="web_generated" - outputCondition="is2005Solution" - overwrite="true"> - <modelElements variable="table"> - <modelElement> - <type name="org.andromda.metafacades.uml.FrontEndParameter"> - <property name="table"/> - <property name="view"/> - </type> - </modelElement> - </modelElements> - </template --> - <template path="templates/aspdotnet/web2005/global.asax.vsl" outputPattern="global.asax" @@ -608,5 +598,6 @@ </modelElement> </modelElements> </template> + <!-- cartridge-template merge-point--> </cartridge> \ No newline at end of file 1.2 +132 -94 cartridges/andromda-aspdotnet/src/main/uml/AspDotNetMetafacadeModelv4.xml.zip <<Binary file>> 1.2 +44 -4 cartridges/andromda-aspdotnet/src/main/java/org/andromda/cartridges/aspdotnet/CommonProperties.java Index: CommonProperties.java =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-aspdotnet/src/main/java/org/andromda/cartridges/aspdotnet/CommonProperties.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -w -r1.1 -r1.2 --- CommonProperties.java 17 Sep 2006 17:30:10 -0000 1.1 +++ CommonProperties.java 25 Sep 2006 19:25:03 -0000 1.2 @@ -11,6 +11,30 @@ public static final String FIELD_TYPE_TEXT = "textbox"; public static final String FIELD_TYPE_HIDDEN = "hidden"; public static final String FIELD_TYPE_LABEL = "plaintext"; + public static final String FIELD_TYPE_FILE = "file"; + public static final String FIELD_TYPE_PLAINTEXT = "plaintext"; + + public static final String VALID_WHEN_EQUAL = "=="; + public static final String VALID_WHEN_NOTEQUAL = "!="; + public static final String VALID_WHEN_GREATERTHAN = ">"; + public static final String VALID_WHEN_GREATERTHANEQUAL = ">="; + public static final String VALID_WHEN_LESSTHAN = "<"; + public static final String VALID_WHEN_LESSTHANEQUAL = "<="; + + public static final String VALID_WHEN_FIELD_NUMBER = "Integer"; + public static final String VALID_WHEN_FIELD_PARAMETER = "param"; + public static final String VALID_WHEN_FIELD_DATE = "Date"; + public static final String VALID_WHEN_FIELD_STRING = "String"; + + /** + * The pattern for constructing the class name under which the form is stored. + */ + public static final String FORM_CLASS_PATTERN = "formClassPattern"; + + /** + * Stores the pattern used for constructing the controller implementation name. + */ + public static final String CONTROLLER_IMPLEMENTATION_PATTERN = "controllerImplementationPattern"; /** * The pattern used for constructing a parameter's backing list name. A backing list @@ -38,8 +62,26 @@ */ public static final String BACKING_VALUE_PATTERN = "backingValuePattern"; - public static final String FIELD_CALENDAR = "@andromda.presentation.web.view.field.calendar"; - public static final String FIELD_VALIDATOR = "@andromda.presentation.view.field.validator"; + /** + * The default number of columns to render for TextBox fields. + */ + public static final String PROPERTY_DEFAULT_INPUT_COLUMN_COUNT = "defaultInputColumnCount"; + + /** + * The default number of rows to render for TextBox fields. + */ + public static final String PROPERTY_DEFAULT_INPUT_ROW_COUNT = "defaultInputRowCount"; + + /** + * Stores the default date format when dates are formatted. + */ + public static final String PROPERTY_DEFAULT_DATEFORMAT = "defaultDateFormat"; + + /** + * Stores the default time format when times are formatted. + */ + public static final String PROPERTY_DEFAULT_TIMEFORMAT = "defaultTimeFormat"; + public static final String WEB_ACTION_HYPERLINK = "hyperlink"; /** @@ -62,7 +104,5 @@ */ public static final String INPUT_TABLE = "table"; - public static final String WEB_TABLE_COLUMNS = "@andromda.presentation.view.table.columns"; - public static final String RADIO_BUTTON_GROUP = "@andromda.presentation.view.field.radio"; public static final String WEB_MENU_GROUP = "@andromda.presentation.web.menu.group"; } 1.1 cartridges/andromda-aspdotnet/src/main/java/org/andromda/cartridges/aspdotnet/AspUtils.java Index: AspUtils.java =================================================================== package org.andromda.cartridges.aspdotnet; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.Iterator; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import java.util.regex.Pattern; import org.andromda.cartridges.aspdotnet.metafacades.*; import org.andromda.metafacades.uml.*; import org.apache.commons.lang.ObjectUtils; import org.apache.commons.lang.StringUtils; import org.apache.log4j.Logger; /** * Utilties for use within the ASP.NET cartridge. * * @author Most of this code was originally written by Chad Brandon * @author Eric Crutchfield */ public class AspUtils { /** * The logger instance that can be used by all decendant classes. */ protected static Logger logger = Logger.getLogger(AspUtils.class); private static final Pattern VALIDATOR_TAGGEDVALUE_PATTERN = Pattern.compile("\\w+(\\(\\w+=[^,)]*(,\\w+=[^,)]*)*\\))?"); /** * Reads the validator arguments from the the given tagged value. * * @return returns a list of String instances or an empty list * @throws IllegalArgumentException when the input string does not match the required pattern */ public static List parseValidatorArgs(String validatorTaggedValue) { if (validatorTaggedValue == null) { throw new IllegalArgumentException("Validator tagged value cannot be null"); } // check if the input tagged value matches the required pattern if (!VALIDATOR_TAGGEDVALUE_PATTERN.matcher(validatorTaggedValue).matches()) { throw new IllegalArgumentException( "Illegal validator tagged value (this tag is used to specify custom validators " + "and might look like myValidator(myVar=myArg,myVar2=myArg2), perhaps you wanted to use " + "@andromda.presentation.view.field.format?): " + validatorTaggedValue); } final List validatorArgs = new ArrayList(); // only keep what is between parentheses (if any) int left = validatorTaggedValue.indexOf('('); if (left > -1) { final int right = validatorTaggedValue.indexOf(')'); validatorTaggedValue = validatorTaggedValue.substring( left + 1, right); final String[] pairs = validatorTaggedValue.split(","); for (int i = 0; i < pairs.length; i++) { final String pair = pairs[i]; final int equalsIndex = pair.indexOf('='); // it's possible the argument is the empty string if (equalsIndex < pair.length() - 1) { validatorArgs.add(pair.substring(equalsIndex + 1)); } else { validatorArgs.add(""); } } } return validatorArgs; } /** * Reads the validator variable names from the the given tagged value. * * @return never null, returns a list of String instances * @throws IllegalArgumentException when the input string does not match the required pattern */ public static List parseValidatorVars(String validatorTaggedValue) { if (validatorTaggedValue == null) { throw new IllegalArgumentException("Validator tagged value cannot be null"); } // check if the input tagged value matches the required pattern if (!VALIDATOR_TAGGEDVALUE_PATTERN.matcher(validatorTaggedValue).matches()) { throw new IllegalArgumentException("Illegal validator tagged value: " + validatorTaggedValue); } final List validatorVars = new ArrayList(); // only keep what is between parentheses (if any) int left = validatorTaggedValue.indexOf('('); if (left > -1) { int right = validatorTaggedValue.indexOf(')'); validatorTaggedValue = validatorTaggedValue.substring( left + 1, right); final String[] pairs = validatorTaggedValue.split(","); for (int i = 0; i < pairs.length; i++) { final String pair = pairs[i]; final int equalsIndex = pair.indexOf('='); validatorVars.add(pair.substring( 0, equalsIndex)); } } return validatorVars; } /** * Parses the validator name for a tagged value. * * @throws IllegalArgumentException when the input string does not match the required pattern */ public static String parseValidatorName(final String validatorTaggedValue) { if (validatorTaggedValue == null) { throw new IllegalArgumentException("Validator tagged value cannot be null"); } // check if the input tagged value matches the required pattern if (!VALIDATOR_TAGGEDVALUE_PATTERN.matcher(validatorTaggedValue).matches()) { throw new IllegalArgumentException("Illegal validator tagged value: " + validatorTaggedValue); } final int leftParen = validatorTaggedValue.indexOf('('); return (leftParen == -1) ? validatorTaggedValue : validatorTaggedValue.substring( 0, leftParen); } /** * @return this field's date format */ public static String getDateFormat(String format) { format = StringUtils.trimToEmpty(format); return format.endsWith(STRICT) ? getToken( format, 1, 2) : getToken( format, 0, 1); } private static final String STRICT = "strict"; /** * @return <code>true</code> if this field's value needs to conform to a strict date format, <code>false</code> otherwise */ public static boolean isStrictDateFormat(String format) { return strictDateTimeFormat ? strictDateTimeFormat : STRICT.equalsIgnoreCase(getToken( format, 0, 2)); } /** * Indicates if the given <code>format</code> is an email format. * * @return <code>true</code> if this field is to be formatted as an email address, <code>false</code> otherwise */ public static boolean isEmailFormat(String format) { return "email".equalsIgnoreCase(AspUtils.getToken( format, 0, 2)); } /** * Indicates if the given <code>format</code> is an equal format. * * @return <code>true</code> if this field is to be formatted as an email address, <code>false</code> otherwise */ public static boolean isEqualFormat(String format) { return "equal".equalsIgnoreCase(AspUtils.getToken( format, 0, 2)); } /** * Indicates if the given <code>format</code> is a creditcard format. * * @return <code>true</code> if this field is to be formatted as a credit card, <code>false</code> otherwise */ public static boolean isCreditCardFormat(final String format) { return "creditcard".equalsIgnoreCase(AspUtils.getToken( format, 0, 2)); } /** * Indicates if the given <code>format</code> is a pattern format. * * @return <code>true</code> if this field's value needs to respect a certain pattern, <code>false</code> otherwise */ public static boolean isPatternFormat(final String format) { return "pattern".equalsIgnoreCase(AspUtils.getToken( format, 0, 2)); } /** * Indicates if the given <code>format</code> is a minlength format. * * @return <code>true</code> if this field's value needs to consist of at least a certain * number of characters, <code>false</code> otherwise */ public static boolean isMinLengthFormat(final String format) { return "minlength".equalsIgnoreCase(AspUtils.getToken( format, 0, 2)); } /** * Indicates if the given <code>format</code> is a maxlength format. * * @return <code>true</code> if this field's value needs to consist of at maximum a certain * number of characters, <code>false</code> otherwise */ public static boolean isMaxLengthFormat(String format) { return "maxlength".equalsIgnoreCase(AspUtils.getToken( format, 0, 2)); } /** * @return the i-th space delimited token read from the argument String, where i does not exceed the specified limit */ public static String getToken( String string, int index, int limit) { String token = null; if (string != null && string.length() > 0) { final String[] tokens = string.split( "[\\s]+", limit); token = index >= tokens.length ? null : tokens[index]; } return token; } /** * Retrieves the input format (if one is defined), for the given * <code>element</code>. * @param element the model element for which to retrieve the input format. * @return the input format. */ public static String getInputFormat(final ModelElementFacade element) { final Object value = element.findTaggedValue(AspProfile.TAGGEDVALUE_INPUT_FORMAT); final String format = value == null ? null : String.valueOf(value); return format == null ? null : format.trim(); } /** * Indicates if the given <code>format</code> is a range format. * * @return <code>true</code> if this field's value needs to be in a specific range, <code>false</code> otherwise */ public static boolean isRangeFormat(final String format) { return "range".equalsIgnoreCase(AspUtils.getToken( format, 0, 2)); } /** * @return <code>true</code> if the type of this field is a byte, <code>false</code> otherwise */ public static boolean isByte(final ClassifierFacade type) { return UMLMetafacadeUtils.isType( type, AspProfile.BYTE_TYPE_NAME); } /** * @return <code>true</code> if the type of this field is a short, <code>false</code> otherwise */ public static boolean isShort(final ClassifierFacade type) { return UMLMetafacadeUtils.isType( type, AspProfile.SHORT_TYPE_NAME); } /** * @return <code>true</code> if the type of this field is an integer, <code>false</code> otherwise */ public static boolean isInteger(final ClassifierFacade type) { return UMLMetafacadeUtils.isType( type, AspProfile.INTEGER_TYPE_NAME); } /** * @return <code>true</code> if the type of this field is a long integer, <code>false</code> otherwise */ public static boolean isLong(final ClassifierFacade type) { return UMLMetafacadeUtils.isType( type, AspProfile.LONG_TYPE_NAME); } /** * @return <code>true</code> if the type of this field is a floating point, <code>false</code> otherwise */ public static boolean isFloat(final ClassifierFacade type) { return UMLMetafacadeUtils.isType( type, AspProfile.FLOAT_TYPE_NAME); } /** * @return <code>true</code> if the type of this field is a double precision floating point, <code>false</code> otherwise */ public static boolean isDouble(final ClassifierFacade type) { return UMLMetafacadeUtils.isType( type, AspProfile.DOUBLE_TYPE_NAME); } /** * @return <code>true</code> if the type of this field is a date, <code>false</code> otherwise */ public static boolean isDate(final ClassifierFacade type) { return type != null && type.isDateType(); } /** * @return <code>true</code> if the type of this field is a time, <code>false</code> otherwise */ public static boolean isTime(final ClassifierFacade type) { return UMLMetafacadeUtils.isType( type, AspProfile.TIME_TYPE_NAME); } /** * @return <code>true</code> if the type of this field is a URL, <code>false</code> otherwise */ public static boolean isUrl(final ClassifierFacade type) { return UMLMetafacadeUtils.isType( type, AspProfile.URL_TYPE_NAME); } /** * @return <code>true</code> if the type of this field is a String, <code>false</code> otherwise */ public static boolean isString(final ClassifierFacade type) { return type != null && type.isStringType(); } /** * Indicates if the given element is read-only or not. * * @param element the element to check. * @return true/false */ public static boolean isReadOnly(final ModelElementFacade element) { boolean readOnly = false; if (element != null) { final Object value = element.findTaggedValue(AspProfile.TAGGEDVALUE_INPUT_READONLY); readOnly = Boolean.valueOf(ObjectUtils.toString(value)).booleanValue(); } return readOnly; } /** * Retrieves the "equal" value from the given element (if one is present). * * @param element the element from which to retrieve the equal value. * @return the "equal" value. */ public static java.lang.String getEqual(final ModelElementFacade element) { String equal = null; if (element != null) { final Object value = element.findTaggedValue(AspProfile.TAGGEDVALUE_INPUT_EQUAL); equal = value == null ? null : value.toString(); } return equal; } /** * Retrieves the "validwhen" value from the given element (if one is present). * * @param element the element from which to retrieve the validwhen value. * @return an array with 3 values: comparison, value/field to compare, and the * comparison type (i.e. field, value). */ public static java.lang.Object[] getValidWhen(final ModelElementFacade element) { Object[] validWhen = null; if (element != null) { //logger.info("Processing validWhen"); final Object value = element.findTaggedValue(AspProfile.TAGGEDVALUE_INPUT_VALIDWHEN); final String val1 = value == null ? null : value.toString(); if (val1 != null) { //ignore the first parameter if it's 'text' int startPos = 0; final String firstToken = AspUtils.getToken(val1, startPos, 2); //logger.info("Processing validWhen for string " + val1.toString()); if (firstToken != null && firstToken.trim().equalsIgnoreCase("text")) startPos = 1; final String operator = AspUtils.getToken(val1, startPos, 3).trim(); if (operator != null) logger.debug("Found an operator for the validWhen TV: " + operator.toString()); String field = AspUtils.getToken(val1, startPos + 1, 3).trim(); if (field != null) logger.debug("Found a field for the validWhen TV: " + field.toString()); if (operator != null && (operator.equals(CommonProperties.VALID_WHEN_EQUAL) || operator.equals(CommonProperties.VALID_WHEN_NOTEQUAL) || operator.equals(CommonProperties.VALID_WHEN_GREATERTHAN) || operator.equals(CommonProperties.VALID_WHEN_GREATERTHANEQUAL) || operator.equals(CommonProperties.VALID_WHEN_LESSTHAN) || operator.equals(CommonProperties.VALID_WHEN_LESSTHANEQUAL))) { String fieldType = null; try { if (field != null) { long number = java.lang.Long.parseLong(field); fieldType = CommonProperties.VALID_WHEN_FIELD_NUMBER; } } catch (NumberFormatException ex) { //do nothing } if (fieldType == null) { try { if (field != null) { java.util.Date date = java.text.DateFormat.getDateInstance().parse(field); fieldType = CommonProperties.VALID_WHEN_FIELD_DATE; } } catch (java.text.ParseException ex) { //do nothing } } if (fieldType == null) { if (field != null && field.equalsIgnoreCase("null")) { fieldType = CommonProperties.VALID_WHEN_FIELD_STRING; field = ""; } } if (fieldType == null) { fieldType = CommonProperties.VALID_WHEN_FIELD_PARAMETER; } logger.debug("The validWhen expression has been parsed as follows: operator = " + operator.toString() + " field = " + field.toString() + "fieldType = " + fieldType.toString()); validWhen = new Object[] {operator, field, fieldType}; } else { logger.error("The validWhen expression ('" + val1 + "') used on " + element.getName() + " is invalid."); } } } //logger.info("Finished processing validWhen. "); return validWhen; } /** * @return the lower limit for this field's value's range */ public static String getRangeStart(final String format) { return AspUtils.getToken( format, 1, 3); } /** * @return the upper limit for this field's value's range */ public static String getRangeEnd(final String format) { return AspUtils.getToken( format, 2, 3); } /** * @return the minimum number of characters this field's value must consist of */ public static String getMinLengthValue(final String format) { return AspUtils.getToken( format, 1, 2); } /** * @return the maximum number of characters this field's value must consist of */ public static String getMaxLengthValue(final String format) { return AspUtils.getToken( format, 1, 2); } /** * @return the pattern this field's value must respect */ public static String getPatternValue(final String format) { return '^' + AspUtils.getToken( format, 1, 2) + '$'; } /** * Retrieves the validator types as a collection from the given * <code>element</code> (if any can be retrieved). * * @param element the element from which to retrieve the types. * @param type the type of the element. * @return the collection of validator types. */ public static java.util.Collection getValidatorTypes( final ModelElementFacade element, final ClassifierFacade type) { final Collection validatorTypesList = new ArrayList(); if (element != null && type != null) { final String format = AspUtils.getInputFormat(element); final boolean isRangeFormat = format != null && isRangeFormat(format); if (element instanceof AspParameter) { if (((AspParameter)element).isRequired()) { validatorTypesList.add("required"); } } if (AspUtils.isByte(type)) { validatorTypesList.add("byte"); } else if (AspUtils.isShort(type)) { validatorTypesList.add("short"); } else if (AspUtils.isInteger(type)) { validatorTypesList.add("integer"); } else if (AspUtils.isLong(type)) { validatorTypesList.add("long"); } else if (AspUtils.isFloat(type)) { validatorTypesList.add("float"); } else if (AspUtils.isDouble(type)) { validatorTypesList.add("double"); } else if (AspUtils.isDate(type)) { validatorTypesList.add("date"); } else if (AspUtils.isTime(type)) { validatorTypesList.add("time"); } else if (AspUtils.isUrl(type)) { validatorTypesList.add("url"); } if (isRangeFormat) { if (AspUtils.isInteger(type) || AspUtils.isShort(type) || AspUtils.isLong(type)) { validatorTypesList.add("intRange"); } if (AspUtils.isFloat(type)) { validatorTypesList.add("floatRange"); } if (AspUtils.isDouble(type)) { validatorTypesList.add("doubleRange"); } } if (format != null) { if (AspUtils.isString(type) && AspUtils.isEmailFormat(format)) { validatorTypesList.add("email"); } else if (AspUtils.isString(type) && AspUtils.isCreditCardFormat(format)) { validatorTypesList.add("creditCard"); } else { Collection formats = element.findTaggedValues(AspProfile.TAGGEDVALUE_INPUT_FORMAT); for (final Iterator formatIterator = formats.iterator(); formatIterator.hasNext();) { String additionalFormat = String.valueOf(formatIterator.next()); if (AspUtils.isMinLengthFormat(additionalFormat)) { validatorTypesList.add("minlength"); } else if (AspUtils.isMaxLengthFormat(additionalFormat)) { validatorTypesList.add("maxlength"); } else if (AspUtils.isPatternFormat(additionalFormat)) { validatorTypesList.add("mask"); } } } } if (AspUtils.getValidWhen(element) != null) { validatorTypesList.add("validwhen"); } if (AspUtils.getEqual(element) != null) { validatorTypesList.add("equal"); } } // - custom (paramterized) validators are allowed here final Collection taggedValues = element.findTaggedValues(AspProfile.TAGGEDVALUE_INPUT_VALIDATORS); for (final Iterator iterator = taggedValues.iterator(); iterator.hasNext();) { String validator = String.valueOf(iterator.next()); validatorTypesList.add(AspUtils.parseValidatorName(validator)); } return validatorTypesList; } /** * Gets the validator variables for the given <code>element</code> (if they can * be retrieved). * * @param element the element from which to retrieve the variables * @param type the type of the element. * @return the collection of validator variables. */ public static java.util.Collection getValidatorVars( final ModelElementFacade element, final ClassifierFacade type) { final Map vars = new LinkedHashMap(); if (element != null && type != null) { final String format = AspUtils.getInputFormat(element); if (format != null) { final boolean isRangeFormat = AspUtils.isRangeFormat(format); if (isRangeFormat) { final String min = "min"; final String max = "max"; vars.put( min, Arrays.asList(new Object[] {min, AspUtils.getRangeStart(format)})); vars.put( max, Arrays.asList(new Object[] {max, AspUtils.getRangeEnd(format)})); } else { final Collection formats = element.findTaggedValues(AspProfile.TAGGEDVALUE_INPUT_FORMAT); for (final Iterator formatIterator = formats.iterator(); formatIterator.hasNext();) { final String additionalFormat = String.valueOf(formatIterator.next()); final String minlength = "minlength"; final String maxlength = "maxlength"; final String mask = "mask"; if (AspUtils.isMinLengthFormat(additionalFormat)) { vars.put( minlength, Arrays.asList(new Object[] {minlength, AspUtils.getMinLengthValue(additionalFormat)})); } else if (AspUtils.isMaxLengthFormat(additionalFormat)) { vars.put( maxlength, Arrays.asList(new Object[] {maxlength, AspUtils.getMaxLengthValue(additionalFormat)})); } else if (AspUtils.isPatternFormat(additionalFormat)) { vars.put( mask, Arrays.asList(new Object[] {mask, AspUtils.getPatternValue(additionalFormat)})); } } } } String inputFormat; if (element instanceof AspParameter) { inputFormat = ((AspParameter)element).getFormat(); } else { throw new RuntimeException("'element' is an invalid type, it must be an instance of '" + AspParameter.class.getName() + "'"); } if (AspUtils.isDate(type)) { final String datePatternStrict = "datePatternStrict"; if (format != null && AspUtils.isStrictDateFormat(format)) { vars.put( datePatternStrict, Arrays.asList(new Object[] {datePatternStrict, inputFormat})); } else { final String datePattern = "datePattern"; vars.put( datePattern, Arrays.asList(new Object[] {datePattern, inputFormat})); } } if (AspUtils.isTime(type)) { final String timePattern = "timePattern"; vars.put( timePattern, Arrays.asList(new Object[] {timePattern, inputFormat})); } final Object[] validWhen = AspUtils.getValidWhen(element); if (validWhen != null) { final String test = "test"; vars.put( test, Arrays.asList(validWhen)); } final String equal = AspUtils.getEqual(element); if (equal != null) { final String fieldName = "fieldName"; vars.put( fieldName, Arrays.asList(new Object[] {fieldName, equal})); } } // - custom (parameterized) validators are allowed here // in this case we will reuse the validator arg values final Collection taggedValues = element.findTaggedValues(AspProfile.TAGGEDVALUE_INPUT_VALIDATORS); for (final Iterator iterator = taggedValues.iterator(); iterator.hasNext();) { final String validator = String.valueOf(iterator.next()); // - guaranteed to be of the same length final List validatorVars = AspUtils.parseValidatorVars(validator); final List validatorArgs = AspUtils.parseValidatorArgs(validator); for (int ctr = 0; ctr < validatorVars.size(); ctr++) { final String validatorVar = (String)validatorVars.get(ctr); final String validatorArg = (String)validatorArgs.get(ctr); vars.put( validatorVar, Arrays.asList(new Object[] {validatorVar, validatorArg})); } } return vars.values(); } /** * Gets the validator args for the <code>element</code> and the given <code>validatorType</code>. * * @param element the element for which to retrieve the arguments. * @param validatorType the validator type name. * @return the validator args as a collection. */ public static java.util.Collection getValidatorArgs( final ModelElementFacade element, final java.lang.String validatorType) { final Collection args = new ArrayList(); if ("intRange".equals(validatorType) || "floatRange".equals(validatorType) || "doubleRange".equals(validatorType)) { args.add("${var:min}"); args.add("${var:max}"); } else if ("minlength".equals(validatorType)) { args.add("${var:minlength}"); } else if ("maxlength".equals(... [truncated message content] |
From: Eric C. <ecr...@us...> - 2006-09-25 19:24:06
|
User: ecrutchfield Date: 06/09/25 12:24:05 Modified: andromda-aspdotnet/src/main/java/org/andromda/cartridges/aspdotnet/metafacades AspActionLogicImpl.java Log: add isValidationRequired() Revision Changes Path 1.2 +25 -1 cartridges/andromda-aspdotnet/src/main/java/org/andromda/cartridges/aspdotnet/metafacades/AspActionLogicImpl.java Index: AspActionLogicImpl.java =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-aspdotnet/src/main/java/org/andromda/cartridges/aspdotnet/metafacades/AspActionLogicImpl.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -w -r1.1 -r1.2 --- AspActionLogicImpl.java 17 Sep 2006 17:30:03 -0000 1.1 +++ AspActionLogicImpl.java 25 Sep 2006 19:24:05 -0000 1.2 @@ -1,6 +1,7 @@ package org.andromda.cartridges.aspdotnet.metafacades; import java.util.ArrayList; +import java.util.Collection; import java.util.Iterator; import java.util.List; import org.andromda.cartridges.aspdotnet.AspProfile; @@ -51,6 +52,29 @@ } /** + * @see org.andromda.cartridges.aspdotnet.metafacades.AspAction#handleGetHiddenParameters() + */ + protected boolean handleIsValidationRequired() + { + boolean required = false; + final Collection actionParameters = this.getParameters(); + for (final Iterator iterator = actionParameters.iterator(); iterator.hasNext();) + { + final Object object = iterator.next(); + if (object instanceof AspParameter) + { + final AspParameter parameter = (AspParameter)object; + if (parameter.isValidationRequired()) + { + required = true; + break; + } + } + } + return required; + } + + /** * @see org.andromda.cartridges.aspdotnet.metafacades.AspAction#getFormImplementationName() */ protected java.lang.String handleGetFormImplementationName() @@ -103,7 +127,7 @@ if (object instanceof AspParameter) { final AspParameter parameter = (AspParameter)object; - valid = parameter.isHidden(); + valid = parameter.isInputHidden(); } return valid; } |
From: Eric C. <ecr...@us...> - 2006-09-25 19:23:39
|
User: ecrutchfield Date: 06/09/25 12:23:35 Modified: andromda-aspdotnet/src/main/java/org/andromda/cartridges/aspdotnet/metafacades AspTransitionLogicImpl.java Log: refactor isHidden Revision Changes Path 1.2 +1 -1 cartridges/andromda-aspdotnet/src/main/java/org/andromda/cartridges/aspdotnet/metafacades/AspTransitionLogicImpl.java Index: AspTransitionLogicImpl.java =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-aspdotnet/src/main/java/org/andromda/cartridges/aspdotnet/metafacades/AspTransitionLogicImpl.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -w -r1.1 -r1.2 --- AspTransitionLogicImpl.java 17 Sep 2006 17:30:04 -0000 1.1 +++ AspTransitionLogicImpl.java 25 Sep 2006 19:23:35 -0000 1.2 @@ -265,7 +265,7 @@ for (Iterator iterator = parameters.iterator(); iterator.hasNext();) { AspParameter parameter = (AspParameter) iterator.next(); - if (parameter.isHidden()) { + if (parameter.isInputHidden()) { hiddenFields.add(parameter); } } |
From: Eric C. <ecr...@us...> - 2006-09-25 19:23:12
|
User: ecrutchfield Date: 06/09/25 12:23:12 Modified: andromda-aspdotnet/src/main/java/org/andromda/cartridges/aspdotnet/metafacades AspFinalStateLogicImpl.java Log: add getPath() Revision Changes Path 1.2 +35 -0 cartridges/andromda-aspdotnet/src/main/java/org/andromda/cartridges/aspdotnet/metafacades/AspFinalStateLogicImpl.java Index: AspFinalStateLogicImpl.java =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-aspdotnet/src/main/java/org/andromda/cartridges/aspdotnet/metafacades/AspFinalStateLogicImpl.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -w -r1.1 -r1.2 --- AspFinalStateLogicImpl.java 17 Sep 2006 17:30:03 -0000 1.1 +++ AspFinalStateLogicImpl.java 25 Sep 2006 19:23:12 -0000 1.2 @@ -1,5 +1,7 @@ package org.andromda.cartridges.aspdotnet.metafacades; +import org.andromda.metafacades.uml.UMLProfile; +import org.andromda.metafacades.uml.FrontEndUseCase; /** * MetafacadeLogic implementation for org.andromda.cartridges.aspdotnet.metafacades.AspFinalState. @@ -10,4 +12,37 @@ public AspFinalStateLogicImpl(Object metaObject, String context) { super(metaObject, context); } + + /** + * @see org.andromda.cartridges.aspdotnet.metafacades.AspFinalState#getPath() + */ + protected java.lang.String handleGetPath() + { + String fullPath = null; + + FrontEndUseCase useCase = this.getTargetUseCase(); + if (useCase == null) + { + // - perhaps this final state links outside of the UML model + final Object taggedValue = this.findTaggedValue(UMLProfile.TAGGEDVALUE_EXTERNAL_HYPERLINK); + if (taggedValue == null) + { + String name = getName(); + if (name != null && (name.startsWith("/") || name.startsWith("http://") || name.startsWith("file:"))) + { + fullPath = name; + } + } + else + { + fullPath = String.valueOf(taggedValue); + } + } + else if (useCase instanceof AspUseCase) + { + fullPath = ((AspUseCase)useCase).getFullyQualifiedNamePath(); + } + + return fullPath; + } } |
From: Eric C. <ecr...@us...> - 2006-09-25 19:22:42
|
User: ecrutchfield Date: 06/09/25 12:22:42 Modified: andromda-aspdotnet/src/main/java/org/andromda/cartridges/aspdotnet/metafacades AspControllerLogicImpl.java Log: get implementation name from namespace property Revision Changes Path 1.2 +3 -4 cartridges/andromda-aspdotnet/src/main/java/org/andromda/cartridges/aspdotnet/metafacades/AspControllerLogicImpl.java Index: AspControllerLogicImpl.java =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-aspdotnet/src/main/java/org/andromda/cartridges/aspdotnet/metafacades/AspControllerLogicImpl.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -w -r1.1 -r1.2 --- AspControllerLogicImpl.java 17 Sep 2006 17:30:02 -0000 1.1 +++ AspControllerLogicImpl.java 25 Sep 2006 19:22:42 -0000 1.2 @@ -1,7 +1,8 @@ package org.andromda.cartridges.aspdotnet.metafacades; -import org.andromda.metafacades.uml.DependencyFacade; import org.andromda.metafacades.uml.ModelElementFacade; +import org.andromda.metafacades.uml.DependencyFacade; +import org.andromda.cartridges.aspdotnet.CommonProperties; import org.apache.commons.lang.ObjectUtils; import org.apache.commons.lang.StringUtils; @@ -46,9 +47,7 @@ */ protected java.lang.String handleGetImplementationName() { - //final String pattern = ObjectUtils.toString(this.getConfiguredProperty(CommonProperties.CONTROLLER_IMPLEMENTATION_PATTERN)); - // @todo add CONTROLLER_IMPLEMENTATION_PATTERN to namespace and profile, then use here - final String pattern = "{0}Impl"; + final String pattern = ObjectUtils.toString(this.getConfiguredProperty(CommonProperties.CONTROLLER_IMPLEMENTATION_PATTERN)); return pattern.replaceFirst("\\{0\\}", StringUtils.capitalize(this.getName())); } |
From: Eric C. <ecr...@us...> - 2006-09-25 19:21:30
|
User: ecrutchfield Date: 06/09/25 12:21:26 Added: andromda-aspdotnet/src/test/expected cartridge-output.zip andromda-aspdotnet/conf/test andromda.xml andromda-aspdotnet/src/test/uml ASPCartridgeTestModel.xml.zip Log: added some tests Revision Changes Path 1.1 cartridges/andromda-aspdotnet/src/test/expected/cartridge-output.zip <<Binary file>> 1.1 cartridges/andromda-aspdotnet/conf/test/andromda.xml Index: andromda.xml =================================================================== <andromda> <properties> <property name="cartridgeFilter">aspdotnet</property> <property name="failOnValidationErrors">false</property> </properties> <repositories> <repository name="netBeansMDR"> <models> <model> <uri>${test.model.uri}</uri> <moduleSearchLocations> <location patterns="**/*.xml.zip">${settings.localRepository}/org/andromda/profiles</location> </moduleSearchLocations> <modelPackages> <modelPackage process="false">org::andromda::metafacades::uml</modelPackage> </modelPackages> </model> </models> </repository> </repositories> <namespaces> <namespace name="default"> <properties> <property name="dotNetVersion">2.0</property> <property name="visualStudioVersion">2005</property> <property name="toDoTag">TODO:</property> <property name="commonAssemblyName">test.common</property> <property name="coreAssemblyName">test.core</property> <property name="languageMappingsUri">Cs</property> <property name="wrapperMappingsUri">CsWrapper</property> <property name="classifierNameMask">none</property> <property name="operationNameMask">none</property> <property name="roleNameMask">none</property> <property name="enumerationNameMask">none</property> <property name="enumerationLiteralNameMask">uppercamelcase</property> <property name="entityNameMask">none</property> <property name="entityPropertyNameMask">none</property> <property name="parameterNameMask">none</property> </properties> </namespace> <namespace name="aspdotnet"> <properties> <property name="web">${test.output.dir}</property> <property name="web_generated">${test.output.dir}/target/src</property> <property name="web_manual">${test.output.dir}/src/main</property> <property name="webAssemblyName">test</property> <property name="AssemblyTitle">test</property> <property name="AssemblyDescription"></property> <property name="AssemblyConfiguration"></property> <property name="AssemblyCompany"></property> <property name="AssemblyProduct"></property> <property name="AssemblyCopyright"></property> <property name="AssemblyTrademark"></property> <property name="AssemblyCulture"></property> <property name="AssemblyVersion">1.0.*</property> <property name="AssemblyDelaySign">true</property> <property name="AssemblyKeyFile"></property> <property name="AssemblyKeyName"></property> </properties> </namespace> </namespaces> </andromda> 1.1 cartridges/andromda-aspdotnet/src/test/uml/ASPCartridgeTestModel.xml.zip <<Binary file>> |
From: Eric C. <ecr...@us...> - 2006-09-25 19:21:20
|
User: ecrutchfield Date: 06/09/25 12:21:16 cartridges/andromda-aspdotnet/conf - New directory |
From: Eric C. <ecr...@us...> - 2006-09-25 19:21:20
|
User: ecrutchfield Date: 06/09/25 12:21:19 cartridges/andromda-aspdotnet/src/test/expected - New directory |
From: Eric C. <ecr...@us...> - 2006-09-25 19:21:19
|
User: ecrutchfield Date: 06/09/25 12:21:19 cartridges/andromda-aspdotnet/conf/test - New directory |
From: Eric C. <ecr...@us...> - 2006-09-25 19:17:20
|
User: ecrutchfield Date: 06/09/25 12:17:18 Modified: andromda-aspdotnet/src/site/axdoc howto11.xml Log: updated to reflect current Validation implementation Revision Changes Path 1.2 +23 -20 cartridges/andromda-aspdotnet/src/site/axdoc/howto11.xml Index: howto11.xml =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-aspdotnet/src/site/axdoc/howto11.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -u -w -r1.1 -r1.2 --- howto11.xml 17 Sep 2006 17:31:53 -0000 1.1 +++ howto11.xml 25 Sep 2006 19:17:18 -0000 1.2 @@ -10,36 +10,39 @@ <body> <section name="Input Validation"> <p> - By default the cartridge generates client-side and server-side validation code. On the - client side this is implemented using Javascript, rendered dynamically into the JSP - pages by the <![CDATA[<html:javascript ... />]]> struts tag. + The aspdotnet cartridge generates Validator controls when validation is specified in your model. + Different types of validation exist and, depending on how you model your application, + different validation routines will be activated. For example, fields on a form can be marked as + required, numeric input fields can be checked to make sure they are valid numbers, numbers can + be checked to make sure they fall within a certain range, and regular expressions can be matched. + <em>Please note that more than one validator tagged value can be added to an event parameter.</em> </p> <p> - The server-side code is perfectly equivalent to the validation on the client-side. Client-side - validation is interesting because it can warn the user of errors without having to go to the server - (which can take time and resources), server-side validation is a safety net that will guarantee - input fields are present or properly formatted. + For required fields, you'll mark parameters coming out of a <![CDATA[<<FrontEndView>>]]> + with the <a href="profile.html#@andromda.presentation.view.field.required">@andromda.presentation.view.field.required</a> + tagged-value. </p> <p> - Client-side and/or server-side validation can be enabled or disabled using the - <code>clientValidation</code> and <code>serverValidation</code> - <a href="namespace.html">namespace properties</a> respectively. + To check the format of a parameter, you can apply the + <a href="profile.html#@andromda.presentation.view.field.required">@andromda.presentation.view.field.format</a> + tagged-value. Check the table at the bottom of the <a href="profile.html">Profile</a> page to learn + what's possible. </p> <p> - Different types of validation exist and depending on how you model your application - different validation routines will be activated. For example, numeric input fields - will be checked, email addresses will be checked for valid format, URLs must be well-formed, - input needs to be in a certain range, creditcard numbers must pass the - <a href="http://www.beachnet.com/~hstiles/cardtype.html">Luhn</a> check, .. even regular expressions - can be matched. + You can compare the value of one parameter to another using the + <a href="profile.html#@andromda.presentation.web.view.field.validwhen">@andromda.presentation.web.view.field.validwhen</a> + tagged-value. Placing this tagged-value on a parameter will render a CompareValidator and + set the ControlToCompare property based on the value you provide. For example, to check that + the password and confirmPassword fields match, you could add a <em>validWhen</em> tagged-value to + the password field and set it's value to '== confirmPassword'. </p> <p> - Check the table at the bottom of the <a href="profile.html">Profile</a> page to learn - what's possible. <em>Please note that more than one validator tagged value can be added to an - event parameter.</em> + Note: The <a href="profile.html#@andromda.presentation.web.view.field.validwhen">@andromda.presentation.web.view.field.validwhen</a> + tagged-value can also be used to compare a parameter to a value. For example, you could specify that + the age field must be greater than or equal to 18 (>= 18). </p> <p> - Adding your own validator is simple, you can specify the validator's name so it will be checked + <font color="red">[Not yet implemented]</font> Adding your own validator is simple, you can specify the validator's name so it will be checked if you just make sure your validator has been added to the <code>validator-rules.xml</code> file. To do this make use of the <![CDATA[<!-- validator-rules merge-point -->]]> <a href="../andromda-cartridges/index.html#mergeMappingsUri">merge point</a>. |
From: Eric C. <ecr...@us...> - 2006-09-25 19:16:55
|
User: ecrutchfield Date: 06/09/25 12:16:52 Modified: andromda-aspdotnet/src/site/axdoc index.xml Log: minor wording changes Revision Changes Path 1.2 +5 -5 cartridges/andromda-aspdotnet/src/site/axdoc/index.xml Index: index.xml =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-aspdotnet/src/site/axdoc/index.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -u -w -r1.1 -r1.2 --- index.xml 17 Sep 2006 17:31:53 -0000 1.1 +++ index.xml 25 Sep 2006 19:16:52 -0000 1.2 @@ -27,13 +27,13 @@ </p> <p> The generated code should be consistent and in-line with the most common best-practices in web development. - It must also help the user adding the final pieces of code in order to finish the implementation. Except - for the business logic that will need to be implemented manually, the user should not need to have knowledge + The cartridge must make it easy for the user to add the final pieces of code in order to finish the implementation. + Except for the business logic that will need to be implemented manually, the user should not need to have knowledge of the rest of the generated application, although it can never hurt. </p> <p> Regeneration of code from UML should not overwrite manually written code. Classes can attain this - goal by using a construction such as inheritance. We use MasterPages and WebControls to isolage + goal by using a construction such as inheritance. We use Code-Behind classes, MasterPages, and WebControls to isolate those pieces of the ASPX page that need regeneration. </p> <p> @@ -183,7 +183,7 @@ </p> <h3>View</h3> <p> - In an ASP.NET application you will use ASPX pages to represent the view components. In the + In the ASP.NET application ASPX pages will be used to represent the view components. In the application's activity graphs views are tagged with the <![CDATA[<<FrontEndView>>]]> stereotype. </p> <h3>Controller</h3> @@ -193,7 +193,7 @@ by an action that will defer any business operation to the controller. Typically in an ASP.NET application this is handled by the code-behind class for a given page. To better support the regeneration capabilities that are a key component of AndroMDA, we create a seperate controller class for each use case. The code-behind - class still exists, though, as is used to insert manual implementations as required (more about this later). + class still exists, though, and is used to insert manual implementations as required (more about this later). </p> </section> |
From: Eric C. <ecr...@us...> - 2006-09-25 19:14:32
|
User: ecrutchfield Date: 06/09/25 12:14:29 Modified: andromda-aspdotnet/src/main/resources/templates/aspdotnet/web2005 webform.aspx.vsl andromda-aspdotnet/src/main/resources/templates/aspdotnet/web2003 webform.aspx.vsl Log: add support for validator controls Revision Changes Path 1.2 +28 -29 cartridges/andromda-aspdotnet/src/main/resources/templates/aspdotnet/web2005/webform.aspx.vsl Index: webform.aspx.vsl =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-aspdotnet/src/main/resources/templates/aspdotnet/web2005/webform.aspx.vsl,v retrieving revision 1.1 retrieving revision 1.2 diff -u -w -r1.1 -r1.2 --- webform.aspx.vsl 17 Sep 2006 17:30:41 -0000 1.1 +++ webform.aspx.vsl 25 Sep 2006 19:14:29 -0000 1.2 @@ -1,11 +1,3 @@ -## -## This macro renders the CommandArgument parameter for a command link -## -#macro ( renderTableCommandArgumentParameters ) -#foreach( $parameter in $action.parameters )#if($velocityCount>1) + #end DataBinder.Eval("DataItem.${parameter.name}","#if($velocityCount>1),#end${parameter.name}={0}")#end -#end -## -## #set($generatedFile = "${webform.fullyQualifiedPath}/${webform.normalizedName}.aspx") #set($key = "${webform.useCase.normalizedName}_${webform.normalizedName}") <%@ Page Language="C#" AutoEventWireup="true" CodeFile="~/src/main/${webform.fullyQualifiedPath}/${webform.normalizedName}.cs" CodeFileBaseClass="${webform.packageName}.${webform.normalizedName}Base" Inherits="${webform.packageName}.${webform.normalizedName}" MasterPageFile="~/Default.master" Title="${webform.name}"%> @@ -17,47 +9,54 @@ <asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder" Runat="Server"> <div id="content"> #foreach($action in ${webform.outgoing}) +#foreach($parameter in ${action.parameters}) +#if(${parameter.inputHidden}) + <asp:HiddenField ID="$stringUtils.lowerCamelCaseName(${action.name})_${parameter.name}Hidden" runat="server" /> +#end +#end #if(!$action.hyperlink) <div class="action"> <table id="${action.name}Table" cellspacing="0" cellpadding="1" width="100%" border="0"> #foreach($parameter in ${action.parameters}) -#if(!${parameter.isHidden()}) +#if(!${parameter.inputHidden}) #set($type = ${parameter.getViewType()}) <tr> <td> - <asp:label id="$stringUtils.lowerCamelCaseName(${action.name})_${parameter.name}lbl" runat="server" Text="<%$ Resources:GeneratedResources, ${key}_${parameter.name}lbl %>"></asp:label></td> + <asp:label id="$stringUtils.lowerCamelCaseName(${action.name})_${parameter.name}lbl" runat="server" Text="<%$ Resources:GeneratedResources, ${key}_${parameter.name}lbl %>"></asp:label>#if(${parameter.required})<span style="color:Red"> *</span>#end + </td> <td> #if($type.equals('file')) <asp:FileUpload ID="${parameter.name}FileSelector" runat="server" /></td> #else - <asp:$type id="$stringUtils.lowerCamelCaseName(${action.name})_${parameter.name}$type" ToolTip="<%$ Resources:GeneratedResources, ${key}_${parameter.name}_${parameter.getViewType()}_Help %>" - #if(${parameter.isCalendar()})ReadOnly="True" #end#if(${parameter.isReadOnly()})ReadOnly="True" #end #if(${parameter.isTextarea()})TextMode="MultiLine" #end #if(${parameter.isPassword()})TextMode="Password" #end + <asp:$type id="$stringUtils.lowerCamelCaseName(${action.name})_${parameter.name}$type" ToolTip="<%$ Resources:GeneratedResources, ${key}_${parameter.name}_${type}_Help %>" + #if(${parameter.isCalendar()})ReadOnly="True" #end#if(${parameter.isReadOnly()})ReadOnly="True" #end #if(${parameter.inputTextarea})TextMode="MultiLine" #if($parameter.fieldColumnCount)Columns=${parameter.fieldColumnCount} #end #if($parameter.fieldRowCount)Rows=${parameter.fieldRowCount} #end#end #if(${parameter.inputPassword})TextMode="Password" #end #if($type.equalsIgnoreCase('ListBox'))SelectionMode=Multiple #end#if($type.equals('RadioButton')) GroupName="${parameter.getRadioButtonGroup()}" #end runat="server"></asp:$type> -#if(${parameter.isMandatoryField()}) +#if(${parameter.required}) #if(!$type.equalsIgnoreCase("checkbox")) - <asp:RequiredFieldValidator id="${parameter.name}RF" runat="server" ErrorMessage="*" ControlToValidate="$stringUtils.lowerCamelCaseName(${action.name})_${parameter.name}TextBox"></asp:RequiredFieldValidator> + <asp:RequiredFieldValidator id="${parameter.name}RF" runat="server" ErrorMessage="You must specify a value for this field." ControlToValidate="$stringUtils.lowerCamelCaseName(${action.name})_${parameter.name}TextBox"></asp:RequiredFieldValidator> #end #end #if(${parameter.isCalendar()}) <asp:Calendar ID="${parameter.name}Calendar" runat="server" ></asp:Calendar> #end - </td> -#if($type.equals('TextBox')) -#if(!${parameter.isCalendar()}) -#if(${parameter.isValidator()}) - <asp:RegularExpressionValidator id="${parameter.name}REV" runat="server" ErrorMessage="Warning: type of the field ''${parameter.name}'' is not ${parameter.getComparatorType()}!" ValidationExpression="${parameter.getValidator()}"></asp:RegularExpressionValidator> +#end +#if ($parameter.validationRequired) +#if (!$parameter.complex) +#renderValidationControl($parameter "") #else - <asp:CompareValidator id="${parameter.name}CV" runat="server" ErrorMessage="Warning: type of the field ''${parameter.name}'' is not ${parameter.getComparatorType()}!" Operator="DataTypeCheck" Type="${parameter.getComparatorType()}" Display="Dynamic" ControlToValidate="$stringUtils.lowerCamelCaseName(${action.name})_${parameter.name}TextBox"></asp:CompareValidator> +#foreach ($attribute in $parameter.attributes) +#if ($attribute.validationRequired) +#renderValidationControl($attribute $parameter) #end #end #end #end + </td> </tr> #end #end <tr> <td> -##@todo Add resource assignment to this button <asp:button CssClass="body1" OnClick="${action.actionMethodName}Button_Click" id="${action.actionMethodName}Button" runat="server" Text="<%$ Resources:GeneratedResources, ${key}_${action.actionMethodName}Button%>" #if(${action.parameters.empty}) CausesValidation="False"#end ForeColor=MidnightBlue Style="background: url(${webform.getLayoutPath()}button.JPG) repeat;"></asp:button></td> <td></td> </tr> @@ -72,7 +71,7 @@ <tr> <td> <asp:GridView id="${table.name}DG" runat="server" AutoGenerateColumns="False" AllowPaging="True" AllowSorting="True" - OnPageIndexChanging="$stringUtils.capitalize(${table.name})DG_Page" + OnPageIndexChanging="$stringUtils.capitalize(${table.name})DG_Page" OnRowCommand="$stringUtils.capitalize(${table.name})_RowCommand" OnSelectedIndexChanged="$stringUtils.capitalize(${table.name})DG_SelectedIndexChanged" OnSorting="$stringUtils.capitalize(${table.name})DG_SortCommand"> <AlternatingRowStyle BackColor="Lavender"></AlternatingRowStyle> <HeaderStyle Font-Bold="True" HorizontalAlign="Center" VerticalAlign="Middle" BackColor="#e8e2b6"></HeaderStyle> @@ -93,13 +92,13 @@ <HeaderTemplate><asp:Literal runat="server" Text="<%$ Resources:GeneratedResources, ${key}_${table.name}DG_$columnName %>"></asp:Literal></HeaderTemplate> <ItemTemplate> <asp:LinkButton ID="${action.tableLinkColumnName}Link" Runat="server" - CommandArgument='<%# #renderTableCommandArgumentParameters() %>' CommandName="${action.triggerName}" Text='<%# Eval("DataItem.${action.tableLinkColumnName}")%>'></asp:LinkButton></ItemTemplate> + CommandArgument='<%# #render2005TableCommandArgumentParameters() %>' CommandName="${action.triggerName}" Text='<%# Eval("${action.tableLinkColumnName}")%>'></asp:LinkButton></ItemTemplate> </asp:TemplateField> #end #end #end #foreach ($action in $table.tableFormActions) - <asp:ButtonField ButtonType=Link Text="<%$ Resources:GeneratedResources, ${key}_${table.name}DG_$columnName %>" SortExpression="${stringUtils.capitalise($action.triggerName)}" /> + <asp:TemplateField><ItemTemplate><asp:Button ID="${stringUtils.capitalise($action.triggerName)}" Text="<%$ Resources:GeneratedResources, ${key}_${stringUtils.capitalise($action.actionMethodName)}Button %>" CommandName="${action.triggerName}" CommandArgument='<%# #render2005TableCommandArgumentParameters() %>' runat="server" /></ItemTemplate></asp:TemplateField> #end </Columns> <PagerSettings Mode=NumericFirstLast /> 1.2 +19 -20 cartridges/andromda-aspdotnet/src/main/resources/templates/aspdotnet/web2003/webform.aspx.vsl Index: webform.aspx.vsl =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-aspdotnet/src/main/resources/templates/aspdotnet/web2003/webform.aspx.vsl,v retrieving revision 1.1 retrieving revision 1.2 diff -u -w -r1.1 -r1.2 --- webform.aspx.vsl 17 Sep 2006 17:30:45 -0000 1.1 +++ webform.aspx.vsl 25 Sep 2006 19:14:29 -0000 1.2 @@ -1,11 +1,3 @@ -## -## This macro renders the CommandArgument parameter for a command link -## -#macro ( renderTableCommandArgumentParameters ) -#foreach( $parameter in $action.parameters )#if($velocityCount>1) + #end DataBinder.Eval(Container,"DataItem.${parameter.name}","#if($velocityCount>1),#end${parameter.name}={0}")#end -#end -## -## #set($generatedFile = "${webform.fullyQualifiedPath}/${webform.normalizedName}.aspx") <%@ Page language="c#" AutoEventWireup="false" Inherits="${webform.packageName}.${webform.normalizedName}"%> <%@ Register TagPrefix="menuUserControl" TagName="menu" Src="~/target/src/Common/Menu.ascx" %> @@ -34,23 +26,28 @@ <asp:Literal ID="${webform.normalizedName}Page" runat="server">${webform.name}</asp:Literal> </h4> #foreach($action in ${webform.outgoing}) +#foreach($parameter in ${action.parameters}) +#if(${parameter.inputHidden}) + <INPUT type="hidden" runat="server" id="$stringUtils.lowerCamelCaseName(${action.name})_${parameter.name}Hidden" /> +#end +#end #if(!$action.hyperlink) <div class="action"> <table id="${action.name}Table" cellspacing="0" cellpadding="1" width="100%" border="0"> #foreach($parameter in ${action.parameters}) -#if(!${parameter.isHidden()}) +#if(!${parameter.inputHidden}) #set($viewType = ${parameter.getViewType()}) <tr> <td> - <asp:label id="$stringUtils.lowerCamelCaseName(${action.name})_${parameter.name}lbl" runat="server">${parameter.name}</asp:label></td> + <asp:label id="$stringUtils.lowerCamelCaseName(${action.name})_${parameter.name}lbl" runat="server">${parameter.name}</asp:label>#if(${parameter.required})<span style="color:Red"> *</span>#end</td> <td> #if(${viewType.equals('file')}) <INPUT id="${parameter.name}FileSelector" type="file" name="${parameter.name}FileSelector" RUNAT="server"></td> #else <asp:${viewType} id="$stringUtils.lowerCamelCaseName(${action.name})_${parameter.name}${viewType}" - #if(${parameter.isCalendar()})ReadOnly="True"#end #if(${parameter.isReadOnly()})ReadOnly="True"#end #if(${parameter.isTextarea()})TextMode="MultiLine"#end #if(${parameter.isPassword()})TextMode="Password" #end + #if(${parameter.isCalendar()})ReadOnly="True"#end #if(${parameter.isReadOnly()})ReadOnly="True"#end #if(${parameter.inputTextarea})TextMode="MultiLine"#if($parameter.fieldColumnCount)Columns=${parameter.fieldColumnCount} #end #if($parameter.fieldRowCount)Rows=${parameter.fieldRowCount} #end#end #if(${parameter.inputPassword})TextMode="Password" #end #if(${viewType.equals('ListBox')})SelectionMode=Multiple #end#if(${viewType.equals('RadioButton')}) GroupName="${parameter.getRadioButtonGroup()}" #end runat="server"></asp:${viewType}> -#if(${parameter.isMandatoryField()}) +#if(${parameter.required}) #if(!$viewType.equalsIgnoreCase("checkbox")) <asp:RequiredFieldValidator id="${parameter.name}RF" runat="server" ErrorMessage="*" ControlToValidate="$stringUtils.lowerCamelCaseName(${action.name})_${parameter.name}TextBox"></asp:RequiredFieldValidator> #end @@ -59,20 +56,22 @@ <obout:Calendar runat="server" ScriptPath="/${webAssemblyName}/calendar" StyleFolder="/${webAssemblyName}/calendar" DatePickerMode="true" TextBoxId="${parameter.name}${viewType}" DateFormat="DD/MM/yyyy" id="${parameter.name}Calendar" DoubleCalendarMode = "false" DatePickerButtonText="<img src='/${webAssemblyName}/calendar/calendar.gif'>"/> #end - </td> -#if(${viewType.equals('TextBox')}) -#if(!${parameter.isCalendar()}) -#if(${parameter.isValidator()}) - <asp:RegularExpressionValidator id="${parameter.name}REV" runat="server" ErrorMessage="Warning: type of the field ''${parameter.name}'' is not ${parameter.getComparatorType()}!" ValidationExpression="${parameter.getValidator()}"></asp:RegularExpressionValidator> +#if ($parameter.validationRequired) +#if (!$parameter.complex) +#renderValidationControl($parameter "") #else - <asp:CompareValidator id="${parameter.name}CV" runat="server" ErrorMessage="Warning: type of the field ''${parameter.name}'' is not ${parameter.getComparatorType()}!" Operator="DataTypeCheck" Type="${parameter.getComparatorType()}" Display="Dynamic" ControlToValidate="$stringUtils.lowerCamelCaseName(${action.name})_${parameter.name}TextBox"></asp:CompareValidator> +#foreach ($attribute in $parameter.attributes) +#if ($attribute.validationRequired) +#renderValidationControl($attribute $parameter) #end #end #end #end + </td> </tr> #end #end +#end <tr> <td> <asp:button CssClass="body1" id="${action.actionMethodName}Button" runat="server" @@ -111,13 +110,13 @@ <HeaderTemplate>$stringUtils.capitalize(${action.tableLinkColumnName})</HeaderTemplate> <ItemTemplate> <asp:LinkButton ID="${action.tableLinkColumnName}Link" Runat="server" - CommandArgument='<%# #renderTableCommandArgumentParameters() %>' CommandName="${action.triggerName}"><%# DataBinder.Eval(Container,"DataItem.${action.tableLinkColumnName}")%></asp:LinkButton></ItemTemplate> + CommandArgument='<%# #render2003TableCommandArgumentParameters() %>' CommandName="${action.triggerName}"><%# DataBinder.Eval(Container,"DataItem.${action.tableLinkColumnName}")%></asp:LinkButton></ItemTemplate> </asp:TemplateColumn> #end #end #end #foreach ($action in $table.tableFormActions) - <asp:TemplateColumn><ItemTemplate><asp:Button CommandName="${action.triggerName}" CommandArgument='<%# #renderTableCommandArgumentParameters() %>' Runat="server" ID="${action.triggerName}Btn" Text="$stringUtils.capitalise(${action.name})"></asp:Button></ItemTemplate></asp:TemplateColumn> + <asp:TemplateColumn><ItemTemplate><asp:Button CommandName="${action.triggerName}" CommandArgument='<%# #render2003TableCommandArgumentParameters() %>' Runat="server" ID="${action.triggerName}Btn" Text="$stringUtils.capitalise(${action.name})"></asp:Button></ItemTemplate></asp:TemplateColumn> #end </Columns> <PagerStyle Mode="NumericPages"></PagerStyle> |
From: Eric C. <ecr...@us...> - 2006-09-25 19:14:18
|
User: ecrutchfield Date: 06/09/25 12:14:16 Added: andromda-aspdotnet/src/main/resources/templates/aspdotnet/web2005 tables.vm andromda-aspdotnet/src/main/resources/templates/aspdotnet/web2003 tables.vm Log: refactor commandLink rendering Revision Changes Path 1.1 cartridges/andromda-aspdotnet/src/main/resources/templates/aspdotnet/web2005/tables.vm Index: tables.vm =================================================================== ## ## This macro renders the CommandArgument parameter for a command link ## #macro ( render2005TableCommandArgumentParameters ) #foreach( $parameter in $action.parameters )#if($velocityCount>1) + #end Eval("${parameter.name}","#if($velocityCount>1),#end${parameter.name}={0}")#end #end 1.1 cartridges/andromda-aspdotnet/src/main/resources/templates/aspdotnet/web2003/tables.vm Index: tables.vm =================================================================== ## ## This macro renders the CommandArgument parameter for a command link ## #macro ( render2003TableCommandArgumentParameters ) #foreach( $parameter in $action.parameters )#if($velocityCount>1) + #end DataBinder.Eval(Container,"DataItem.${parameter.name}","#if($velocityCount>1),#end${parameter.name}={0}")#end #end |
From: Eric C. <ecr...@us...> - 2006-09-25 19:14:01
|
User: ecrutchfield Date: 06/09/25 12:13:52 Modified: andromda-aspdotnet/src/main/resources/templates/aspdotnet/web2003 resources.resx.vsl andromda-aspdotnet/src/main/resources/templates/aspdotnet/web2005 resources.resx.vsl Log: add validation error messages Revision Changes Path 1.2 +59 -7 cartridges/andromda-aspdotnet/src/main/resources/templates/aspdotnet/web2003/resources.resx.vsl Index: resources.resx.vsl =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-aspdotnet/src/main/resources/templates/aspdotnet/web2003/resources.resx.vsl,v retrieving revision 1.1 retrieving revision 1.2 diff -u -w -r1.1 -r1.2 --- resources.resx.vsl 17 Sep 2006 17:30:45 -0000 1.1 +++ resources.resx.vsl 25 Sep 2006 19:13:52 -0000 1.2 @@ -51,13 +51,14 @@ #foreach($action in ${webform.outgoing}) #if(!$action.isHyperlink()) #foreach($parameter in ${action.parameters}) -#if(!${parameter.hidden}) +#set ($aspType = ${parameter.getViewType()}) +#if(!${parameter.inputHidden}) <data name="@${key}.${parameter.name}lbl"> <value><![CDATA[$stringUtils.toPhrase(${parameter.name})]]></value> </data> -#if(!${parameter.getViewType().equals('file')}) - <data name="@${key}.${parameter.name}${parameter.viewType}.Help"> - <value><![CDATA[${parameter.getDocumentation("")}]]></value> +#if(!${aspType.equals('file')}) + <data name="@${key}.${parameter.name}${aspType}.Help"> + <value><![CDATA[${parameter.getDocumentation("", -1, false)}]]></value> </data> #end #end @@ -100,4 +101,55 @@ <data name="@error.errorMessage"> <value>An exception occured, if the problem persist contact your system administrator.</value> </data> + <data name="@errors.required"> + <value>{0} is required.</value> + </data> + <data name="@errors.minlength"> + <value>{0} can not be less than {1} characters.</value> + </data> + <data name="@errors.maxlength"> + <value>{0} can not be greater than {1} characters.</value> + </data> + <data name="@errors.invalid"> + <value>{0} is invalid.</value> + </data> + <data name="@errors.byte"> + <value>{0} must be a byte.</value> + </data> + <data name="@errors.short"> + <value>{0} must be a short.</value> + </data> + <data name="@errors.integer"> + <value>{0} must be an integer.</value> + </data> + <data name="@errors.long"> + <value>{0} must be a long.</value> + </data> + <data name="@errors.float"> + <value>{0} must be a float.</value> + </data> + <data name="@errors.double"> + <value>{0} must be a double.</value> + </data> + <data name="@errors.date"> + <value>{0} is not a valid date or does not respect the '{1}' format.</value> + </data> + <data name="@errors.time"> + <value>{0} is not a valid time or does not respect the '{1}' format.</value> + </data> + <data name="@errors.range"> + <value>{0} is not in the range {1} through {2}.</value> + </data> + <data name="@errors.creditcard"> + <value>{0} is an invalid credit card number.</value> + </data> + <data name="@errors.email"> + <value>{0} is an invalid e-mail address.</value> + </data> + <data name="@errors.url"> + <value>{0} is an invalid URL.</value> + </data> + <data name="@errors.equal"> + <value>{0} must equal {1}.</value> + </data> </root> \ No newline at end of file 1.2 +57 -5 cartridges/andromda-aspdotnet/src/main/resources/templates/aspdotnet/web2005/resources.resx.vsl Index: resources.resx.vsl =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-aspdotnet/src/main/resources/templates/aspdotnet/web2005/resources.resx.vsl,v retrieving revision 1.1 retrieving revision 1.2 diff -u -w -r1.1 -r1.2 --- resources.resx.vsl 17 Sep 2006 17:30:42 -0000 1.1 +++ resources.resx.vsl 25 Sep 2006 19:13:52 -0000 1.2 @@ -129,13 +129,14 @@ #foreach($action in ${webform.outgoing}) #if(!$action.isHyperlink()) #foreach($parameter in ${action.parameters}) -#if(!${parameter.hidden}) +#set ($aspType = ${parameter.getViewType()}) +#if(!${parameter.inputHidden}) <data name="${key}_${parameter.name}lbl" xml:space="preserve"> <value><![CDATA[$stringUtils.toPhrase(${parameter.name})]]></value> </data> -#if(!${parameter.getViewType().equals('file')}) - <data name="${key}_${parameter.name}_${parameter.getViewType()}_Help" xml:space="preserve"> - <value><![CDATA[${parameter.getDocumentation("")}]]></value> +#if(!${aspType.equals('file')}) + <data name="${key}_${parameter.name}_${aspType}_Help" xml:space="preserve"> + <value><![CDATA[${parameter.getDocumentation("", -1, false)}]]></value> </data> #end #end @@ -176,9 +177,60 @@ #end #end <!-- *************************************************************************--> -<!-- Error page --> +<!-- Error messages --> <!-- *************************************************************************--> <data name="error_errorMessage"> <value>An exception occured, if the problem persists contact your system administrator.</value> </data> + <data name="errors_required"> + <value>{0} is required.</value> + </data> + <data name="errors_minlength"> + <value>{0} can not be less than {1} characters.</value> + </data> + <data name="errors_maxlength"> + <value>{0} can not be greater than {1} characters.</value> + </data> + <data name="errors_invalid"> + <value>{0} is invalid.</value> + </data> + <data name="errors_byte"> + <value>{0} must be a byte.</value> + </data> + <data name="errors_short"> + <value>{0} must be a short.</value> + </data> + <data name="errors_integer"> + <value>{0} must be an integer.</value> + </data> + <data name="errors_long"> + <value>{0} must be a long.</value> + </data> + <data name="errors_float"> + <value>{0} must be a float.</value> + </data> + <data name="errors_double"> + <value>{0} must be a double.</value> + </data> + <data name="errors_date"> + <value>{0} is not a valid date or does not respect the '{1}' format.</value> + </data> + <data name="errors_time"> + <value>{0} is not a valid time or does not respect the '{1}' format.</value> + </data> + <data name="errors_range"> + <value>{0} is not in the range {1} through {2}.</value> + </data> + <data name="errors_creditcard"> + <value>{0} is an invalid credit card number.</value> + </data> + <data name="errors_email"> + <value>{0} is an invalid e-mail address.</value> + </data> + <data name="errors_url"> + <value>{0} is an invalid URL.</value> + </data> + <data name="errors_equal"> + <value>{0} must equal {1}.</value> + </data> </root> |
From: Eric C. <ecr...@us...> - 2006-09-25 19:13:04
|
User: ecrutchfield Date: 06/09/25 12:13:04 Removed: andromda-aspdotnet/src/main/resources/templates/aspdotnet/web2005 table.ascx.vsl Log: remove unused template |