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/22 13:45:25 UTC

svn commit: r191805 - in /struts/sandbox/trunk/overdrive/Nexus/Core: Helpers/IViewHelper.cs Helpers/ViewHelper.cs IKeyValue.cs

Author: husted
Date: Wed Jun 22 04:45:24 2005
New Revision: 191805

URL: http://svn.apache.org/viewcvs?rev=191805&view=rev
Log:
OVR-11
* Add Outcome property to IViewHelper.

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/IKeyValue.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=191805&r1=191804&r2=191805&view=diff
==============================================================================
--- struts/sandbox/trunk/overdrive/Nexus/Core/Helpers/IViewHelper.cs (original)
+++ struts/sandbox/trunk/overdrive/Nexus/Core/Helpers/IViewHelper.cs Wed Jun 22 04:45:24 2005
@@ -85,6 +85,25 @@
 		/// 
 		void Read (ICollection controls);
 
+		
+		/// <summary>
+		/// Store input and output values.
+		/// </summary>
+		/// 
+		IRequestContext Context {get;}
+
+		
+		/// <summary>
+		/// Access result of operation as an IList.
+		/// </summary>
+		/// <remarks>
+		/// If the Helper is designed to return a List result, 
+		/// this method saves casting the outcome.
+		/// If the Helper is not designed to return the result as a IList, 
+		/// this method returns a single-value result as a one-entry list.
+		/// </remarks>
+		/// 
+		IList Outcome {get;}
 
 		// ----
 

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=191805&r1=191804&r2=191805&view=diff
==============================================================================
--- struts/sandbox/trunk/overdrive/Nexus/Core/Helpers/ViewHelper.cs (original)
+++ struts/sandbox/trunk/overdrive/Nexus/Core/Helpers/ViewHelper.cs Wed Jun 22 04:45:24 2005
@@ -71,6 +71,52 @@
 
 		#endregion
 
+		#region Read and Bind 
+
+		private IRequestContext _Context;
+		/// <remarks>
+		/// The Context is obtained through reference to the Catalog and Command.
+		/// All other properties and methods of the Helper refer to the Context, 
+		/// making Context the cornerstone property.
+		/// </remarks>
+		/// 
+		public IRequestContext Context
+		{
+			get
+			{
+				if (_Context == null)
+					_Context = Catalog.GetRequest (Command);
+				return _Context;
+			}
+		}
+
+
+		public IList Outcome
+		{
+			get
+			{
+				IList result = null;
+				object o = Context.Outcome;
+				if (o==null)
+				{
+					result = new ArrayList(1);
+					result.Add (Context.Criteria);
+				}
+				else
+				{
+					result = o as IList;
+					if (result==null)
+					{
+						result = new ArrayList(1);
+						result.Add (o);
+					}
+				}
+				return result;
+			}
+		}
+
+		#endregion
+
 		#region Messages
 
 		public IDictionary Alerts
@@ -197,25 +243,6 @@
 			set { _Command  = value; }
 		}
 
-		private IRequestContext _Context;
-		/// <summary>
-		/// Provide the runtime context for this Helper.
-		/// </summary>
-		/// <remarks>
-		/// The Context is obtained through reference to the Catalog and Command.
-		/// All other properties and methods of the Helper refer to the Context, 
-		/// making Context the cornerstone property.
-		/// </remarks>
-		/// 
-		public IRequestContext Context
-		{
-			get
-			{
-				if (_Context == null)
-					_Context = Catalog.GetRequest (Command);
-				return _Context;
-			}
-		}
 		#endregion 
 	}
 }

Modified: struts/sandbox/trunk/overdrive/Nexus/Core/IKeyValue.cs
URL: http://svn.apache.org/viewcvs/struts/sandbox/trunk/overdrive/Nexus/Core/IKeyValue.cs?rev=191805&r1=191804&r2=191805&view=diff
==============================================================================
--- struts/sandbox/trunk/overdrive/Nexus/Core/IKeyValue.cs (original)
+++ struts/sandbox/trunk/overdrive/Nexus/Core/IKeyValue.cs Wed Jun 22 04:45:24 2005
@@ -17,7 +17,7 @@
 namespace Nexus.Core
 {
 	/// <summary>
-	/// Generic object to represent a key/value pair, 
+	/// Represent a key/value pair, 
 	/// as stored in an IDictionary or displayed 
 	/// by a list in a user interface.
 	/// </summary>



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