You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by hu...@apache.org on 2005/06/14 18:08:13 UTC

svn commit: r190623 - in /struts/sandbox/trunk/overdrive/Nexus: Core/Helpers/IViewHelper.cs Core/Helpers/ViewHelper.cs Core/IRequestContext.cs Core/RequestContext.cs Core/Tokens.cs Test/BaseNexusTest.cs Test/RequestContextTest.cs Web/WebViewHelper.cs

Author: husted
Date: Tue Jun 14 09:08:13 2005
New Revision: 190623

URL: http://svn.apache.org/viewcvs?rev=190623&view=rev
Log:
OVR-7
* Rename Errors to Alerts and Messages to Hints, both to make room for a "MessageTable" and also to bring members in line with XForms conventions.

Modified:
    struts/sandbox/trunk/overdrive/Nexus/Core/Helpers/IViewHelper.cs
    struts/sandbox/trunk/overdrive/Nexus/Core/Helpers/ViewHelper.cs
    struts/sandbox/trunk/overdrive/Nexus/Core/IRequestContext.cs
    struts/sandbox/trunk/overdrive/Nexus/Core/RequestContext.cs
    struts/sandbox/trunk/overdrive/Nexus/Core/Tokens.cs
    struts/sandbox/trunk/overdrive/Nexus/Test/BaseNexusTest.cs
    struts/sandbox/trunk/overdrive/Nexus/Test/RequestContextTest.cs
    struts/sandbox/trunk/overdrive/Nexus/Web/WebViewHelper.cs

Modified: struts/sandbox/trunk/overdrive/Nexus/Core/Helpers/IViewHelper.cs
URL: http://svn.apache.org/viewcvs/struts/sandbox/trunk/overdrive/Nexus/Core/Helpers/IViewHelper.cs?rev=190623&r1=190622&r2=190623&view=diff
==============================================================================
--- struts/sandbox/trunk/overdrive/Nexus/Core/Helpers/IViewHelper.cs (original)
+++ struts/sandbox/trunk/overdrive/Nexus/Core/Helpers/IViewHelper.cs Tue Jun 14 09:08:13 2005
@@ -89,19 +89,20 @@
 		// ----
 
 		/// <summary>
-		/// A list of error messages, keyed by the field causing the 
-		/// error, or to a magic global key.
+		/// A list of alert (or error) messages, 
+		/// keyed by the field causing the message, 
+		/// or to a magic global key.
 		/// </summary>
 		/// 
-		IDictionary Errors { get; }
+		IDictionary Alerts { get; }
 
 
 		/// <summary>
-		/// Return true if errors are queued.
+		/// Return true if alerts are queued.
 		/// </summary>
-		/// <returns>True if errors are queued.</returns>
+		/// <returns>True if alerts are queued.</returns>
 		/// 
-		bool HasErrors { get; }
+		bool HasAlerts { get; }
 
 
 		/// <summary>
@@ -119,7 +120,7 @@
 
 
 		/// <summary>
-		/// Return true if there are no errors or exception pending.
+		/// Return true if there are no alerts or fault pending.
 		/// </summary>
 		/// <returns>True if all is well.</returns>
 		/// 
@@ -127,19 +128,20 @@
 
 
 		/// <summary>
-		/// A list of text messages, keyed by a field or other 
-		/// identifier, or to a magic global key.
+		/// A list of hint (or advisory) messages, 
+		/// keyed by a field or other identifier, 
+		/// or to a magic global key.
 		/// </summary>
 		/// 
-		IDictionary Messages { get; }
+		IDictionary Hints { get; }
 
 
 		/// <summary>
-		/// Return true if Messages are queued.
+		/// Return true if Hints are queued.
 		/// </summary>
-		/// <returns>True if Messages are queued.</returns>
+		/// <returns>True if Hints are queued.</returns>
 		/// 
-		bool HasMessages { get; }
+		bool HasHints { get; }
 
 
 		// ----
@@ -171,12 +173,11 @@
 
 		/* 
 			// TODO: Messengers
-			string Text(string key); 
-			string TextIndex {get;}
-			ITextTable TextTable {get;}
+			string Message(string key); 
+			string MessageIndex {get;}
+			IMessageTable MessageTable {get;}
 		*/
 
-
 		// ----
 
 		/// <summary>
@@ -241,7 +242,7 @@
 		/// usually set by dependency injection.
 		/// </summary>
 		/// 
-		IRequestCatalog RequestCatalog { get; set; }
+		IRequestCatalog Catalog { get; set; }
 
 
 		/// <summary>

Modified: struts/sandbox/trunk/overdrive/Nexus/Core/Helpers/ViewHelper.cs
URL: http://svn.apache.org/viewcvs/struts/sandbox/trunk/overdrive/Nexus/Core/Helpers/ViewHelper.cs?rev=190623&r1=190622&r2=190623&view=diff
==============================================================================
--- struts/sandbox/trunk/overdrive/Nexus/Core/Helpers/ViewHelper.cs (original)
+++ struts/sandbox/trunk/overdrive/Nexus/Core/Helpers/ViewHelper.cs Tue Jun 14 09:08:13 2005
@@ -33,7 +33,7 @@
 			get
 			{
 				if (_Context == null)
-					_Context = RequestCatalog.GetContext (Command);
+					_Context = Catalog.GetContext (Command);
 				return _Context;
 			}
 		}
@@ -52,21 +52,21 @@
 
 		public void Execute ()
 		{
-			RequestCatalog.ExecuteView (Context);
+			Catalog.ExecuteView (Context);
 		}
 
 		#endregion
 
-		#region Errors ... 
+		#region Messages ... 
 
-		public IDictionary Errors
+		public IDictionary Alerts
 		{
-			get { return Context.Errors; }
+			get { return Context.Alerts; }
 		}
 
-		public bool HasErrors
+		public bool HasAlerts
 		{
-			get { return Context.HasErrors; }
+			get { return Context.HasAlerts; }
 		}
 
 		public Exception Fault
@@ -81,17 +81,17 @@
 
 		public bool IsNominal
 		{
-			get { return (!HasErrors && !HasFault); }
+			get { return (!HasAlerts && !HasFault); }
 		}
 
-		public IDictionary Messages
+		public IDictionary Hints
 		{
-			get { return Context.Messages; }
+			get { return Context.Hints; }
 		}
 
-		public bool HasMessages
+		public bool HasHints
 		{
-			get { return Context.HasMessages; }
+			get { return Context.HasHints; }
 		}
 
 		#endregion 
@@ -134,7 +134,7 @@
 			get { throw new NotImplementedException (); }
 			set { throw new NotImplementedException (); }
 		}
-		public IRequestCatalog RequestCatalog
+		public IRequestCatalog Catalog
 		{
 			get { throw new NotImplementedException (); }
 			set { throw new NotImplementedException (); }

Modified: struts/sandbox/trunk/overdrive/Nexus/Core/IRequestContext.cs
URL: http://svn.apache.org/viewcvs/struts/sandbox/trunk/overdrive/Nexus/Core/IRequestContext.cs?rev=190623&r1=190622&r2=190623&view=diff
==============================================================================
--- struts/sandbox/trunk/overdrive/Nexus/Core/IRequestContext.cs (original)
+++ struts/sandbox/trunk/overdrive/Nexus/Core/IRequestContext.cs Tue Jun 14 09:08:13 2005
@@ -111,29 +111,29 @@
 		object Outcome { get; set; }
 
 		/// <summary>
-		/// A list of error messages, 
-		/// keyed by the field causing the error, 
+		/// A list of alert (or error) messages, 
+		/// keyed by the field causing the message, 
 		/// or to a magic global key.
 		/// </summary>
 		/// <remark><p>
 		/// TODO: Refactor as NameValueCollection ?
 		/// </p></remark>
 		/// 
-		IDictionary Errors { get; set; }
+		IDictionary Alerts { get; set; }
 
 		/// <summary>
-		/// Add an error message under the "global" key.
+		/// Add an alert message under the "global" key.
 		/// </summary>
 		/// <param name="template">Message template.</param>
 		/// 
-		void AddError (string template);
+		void AddAlert (string template);
 
 		/// <summary>
-		/// Indicate whether errors exist.
+		/// Indicate whether alerts exist.
 		/// </summary>
-		/// <returns>True if there are errors.</returns>
+		/// <returns>True if there are alerts.</returns>
 		/// 
-		bool HasErrors { get; }
+		bool HasAlerts { get; }
 
 		/// <summary>
 		/// An Exception, if thrown.
@@ -154,45 +154,45 @@
 		bool HasFault { get; }
 
 		/// <summary>
-		/// Indicate whether context is free of fault and errors.
+		/// Indicate whether context is free of fault and alerts.
 		/// </summary>
-		/// <returns>True if there are no fault or errors.</returns>
+		/// <returns>True if there are no fault or alerts.</returns>
 		/// 
 		bool IsNominal { get; }
 
 		/// <summary>
-		/// A list of advisory or warning messages (!errors), 
+		/// A list of hint (advisory or warning) messages (!errors), 
 		/// keyed by the field causing the message, 
 		/// or to a magic global key.
 		/// </summary>
 		/// 
-		IDictionary Messages { get; set; }
+		IDictionary Hints { get; set; }
 
 		/// <summary>
-		/// Add a message, creating the context if needed.
+		/// Add a hint, creating the context if needed.
 		/// </summary>
 		/// <remarks><p>
-		/// Multiple messages can be added for a key and 
+		/// Multiple hints can be added for a key and 
 		/// retrieved as a List.
 		/// </p></remarks>
 		/// <param name="template">Message template.</param>
 		/// <param name="message">Message key.</param>
 		/// 
-		void AddMessage (string template, string message);
+		void AddHint (string template, string message);
 
 		/// <summary>
-		/// Add a message under the "global" key.
+		/// Add a hint under the "global" key.
 		/// </summary>
 		/// <param name="template">Message template.</param>
 		/// 
-		void AddMessage (string template);
+		void AddHint (string template);
 
 		/// <summary>
-		/// Indicate whether messages exist.
+		/// Indicate whether hints exist.
 		/// </summary>
-		/// <returns>True if there are messages.</returns>
+		/// <returns>True if there are hints.</returns>
 		/// 
-		bool HasMessages { get; }
+		bool HasHints { get; }
 
 	}
 }

Modified: struts/sandbox/trunk/overdrive/Nexus/Core/RequestContext.cs
URL: http://svn.apache.org/viewcvs/struts/sandbox/trunk/overdrive/Nexus/Core/RequestContext.cs?rev=190623&r1=190622&r2=190623&view=diff
==============================================================================
--- struts/sandbox/trunk/overdrive/Nexus/Core/RequestContext.cs (original)
+++ struts/sandbox/trunk/overdrive/Nexus/Core/RequestContext.cs Tue Jun 14 09:08:13 2005
@@ -106,20 +106,20 @@
 			list.Add (template);
 		}
 
-		public IDictionary Errors
+		public IDictionary Alerts
 		{
-			get { return this [Tokens.ERRORS] as IDictionary; }
-			set { this [Tokens.ERRORS] = value; }
+			get { return this [Tokens.ALERTS] as IDictionary; }
+			set { this [Tokens.ALERTS] = value; }
 		}
 
-		public void AddError (string template)
+		public void AddAlert (string template)
 		{
-			AddStore (template, Tokens.GENERIC_MESSAGE, Tokens.ERRORS);
+			AddStore (template, Tokens.GENERIC_MESSAGE, Tokens.ALERTS);
 		}
 
-		public bool HasErrors
+		public bool HasAlerts
 		{
-			get { return this.ContainsKey (Tokens.ERRORS); }
+			get { return this.ContainsKey (Tokens.ALERTS); }
 		}
 
 		public Exception Fault
@@ -129,7 +129,7 @@
 			{
 				Exception e = value as Exception;
 				this [Tokens.FAULT] = e;
-				AddError (e.Message);
+				AddAlert (e.Message);
 			}
 		}
 
@@ -140,28 +140,28 @@
 
 		public bool IsNominal
 		{
-			get { return (!HasErrors && !HasFault); }
+			get { return (!HasAlerts && !HasFault); }
 		}
 
-		public IDictionary Messages
+		public IDictionary Hints
 		{
-			get { return this [Tokens.MESSAGES] as IDictionary; }
-			set { this [Tokens.MESSAGES] = value; }
+			get { return this [Tokens.HINTS] as IDictionary; }
+			set { this [Tokens.HINTS] = value; }
 		}
 
-		public void AddMessage (string template)
+		public void AddHint (string template)
 		{
-			AddStore (template, Tokens.GENERIC_MESSAGE, Tokens.MESSAGES);
+			AddStore (template, Tokens.GENERIC_MESSAGE, Tokens.HINTS);
 		}
 
-		public void AddMessage (string template, string queue)
+		public void AddHint (string template, string queue)
 		{
-			AddStore (template, queue, Tokens.MESSAGES);
+			AddStore (template, queue, Tokens.HINTS);
 		}
 
-		public bool HasMessages
+		public bool HasHints
 		{
-			get { return this.ContainsKey (Tokens.MESSAGES); }
+			get { return this.ContainsKey (Tokens.HINTS); }
 		}
 
 	}

Modified: struts/sandbox/trunk/overdrive/Nexus/Core/Tokens.cs
URL: http://svn.apache.org/viewcvs/struts/sandbox/trunk/overdrive/Nexus/Core/Tokens.cs?rev=190623&r1=190622&r2=190623&view=diff
==============================================================================
--- struts/sandbox/trunk/overdrive/Nexus/Core/Tokens.cs (original)
+++ struts/sandbox/trunk/overdrive/Nexus/Core/Tokens.cs Tue Jun 14 09:08:13 2005
@@ -40,15 +40,15 @@
 		public const string COMMAND_BIN = "__COMMAND_BIN";
 
 		/// <summary>
-		/// Token for Errors property.
+		/// Token for Alerts property.
 		/// </summary>
 		/// 
-		public const string ERRORS = "__ERRORS";
+		public const string ALERTS = "__ALERTS";
 
 		/// <summary>
-		/// Token for Messages property.
+		/// Token for Hints property.
 		/// </summary>
-		public const string MESSAGES = "__MESSAGES";
+		public const string HINTS = "__HINTS";
 
 		/// <summary>
 		/// Token for FieldTable property.

Modified: struts/sandbox/trunk/overdrive/Nexus/Test/BaseNexusTest.cs
URL: http://svn.apache.org/viewcvs/struts/sandbox/trunk/overdrive/Nexus/Test/BaseNexusTest.cs?rev=190623&r1=190622&r2=190623&view=diff
==============================================================================
--- struts/sandbox/trunk/overdrive/Nexus/Test/BaseNexusTest.cs (original)
+++ struts/sandbox/trunk/overdrive/Nexus/Test/BaseNexusTest.cs Tue Jun 14 09:08:13 2005
@@ -67,19 +67,19 @@
 
 		/// <summary>
 		/// Convenience method to confirm 
-		/// that there are no errors or Exception.
+		/// that there are no alerts or fault.
 		/// </summary>
 		/// <param name="context">Context under test</param>
 		/// 
 		public void AssertNominal (IRequestContext context)
 		{
 			AssertNoFault (context);
-			bool hasErrors = context.HasErrors;
-			if (hasErrors)
+			bool hasAlerts = context.HasAlerts;
+			if (hasAlerts)
 			{
 				// TODO: Use new TextOnly method here.
 				StringBuilder outer = new StringBuilder ();
-				IDictionary store = context.Errors;
+				IDictionary store = context.Alerts;
 				ICollection keys = store.Keys;
 				foreach (string key in keys)
 				{

Modified: struts/sandbox/trunk/overdrive/Nexus/Test/RequestContextTest.cs
URL: http://svn.apache.org/viewcvs/struts/sandbox/trunk/overdrive/Nexus/Test/RequestContextTest.cs?rev=190623&r1=190622&r2=190623&view=diff
==============================================================================
--- struts/sandbox/trunk/overdrive/Nexus/Test/RequestContextTest.cs (original)
+++ struts/sandbox/trunk/overdrive/Nexus/Test/RequestContextTest.cs Tue Jun 14 09:08:13 2005
@@ -50,18 +50,18 @@
 		}
 
 		/// <summary>
-		/// A IRequestContext is not nominal if an error is added. 
+		/// A IRequestContext is not nominal if an alert is added. 
 		/// </summary>
 		/// 
 		[Test]
-		public void IsNominal_Error ()
+		public void IsNominal_Alert ()
 		{
-			context.AddError ("Business logic error");
-			Assert.IsFalse (context.IsNominal, "Expected non-nominal state after adding error message.");
+			context.AddAlert ("Business logic alert");
+			Assert.IsFalse (context.IsNominal, "Expected non-nominal state after adding alert message.");
 		}
 
 		/// <summary>
-		/// A IRequestContext is not nominal is an Exception is set.
+		/// A IRequestContext is not nominal if an Exception is set.
 		/// </summary>
 		/// 
 		[Test]
@@ -80,8 +80,8 @@
 		[Test]
 		public void IsNominal_Errors_and_Fault ()
 		{
-			context.AddError ("Business logic error");
-			context.AddError ("Business logic error 2");
+			context.AddAlert ("Business logic error");
+			context.AddAlert ("Business logic error 2");
 			context.Fault = fault;
 			Assert.IsFalse (context.IsNominal,
 			                "Expected non-nominal state after adding errors and Exception.");

Modified: struts/sandbox/trunk/overdrive/Nexus/Web/WebViewHelper.cs
URL: http://svn.apache.org/viewcvs/struts/sandbox/trunk/overdrive/Nexus/Web/WebViewHelper.cs?rev=190623&r1=190622&r2=190623&view=diff
==============================================================================
--- struts/sandbox/trunk/overdrive/Nexus/Web/WebViewHelper.cs (original)
+++ struts/sandbox/trunk/overdrive/Nexus/Web/WebViewHelper.cs Tue Jun 14 09:08:13 2005
@@ -65,7 +65,7 @@
 
 		public string HtmlErrorBuilder ()
 		{
-			return HtmlErrorBuilder (Fault, Errors);
+			return HtmlErrorBuilder (Fault, Alerts);
 		}
 
 		#endregion 



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org