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 17:41:25 UTC

svn commit: r190618 - in /struts/sandbox/trunk/overdrive/Nexus: Core/Helpers/IViewHelper.cs Core/Helpers/ViewHelper.cs Core/IController.cs Extras/Spring/Controller.cs Test/BaseNexusTest.cs Test/ControllerTest.cs Test/Resources/Command/AppConfig.xml

Author: husted
Date: Tue Jun 14 08:41:25 2005
New Revision: 190618

URL: http://svn.apache.org/viewcvs?rev=190618&view=rev
Log:
OVR-8
* Rename "controller" member as "catalog" member, and realign member with Agility.ICatalog.

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/IController.cs
    struts/sandbox/trunk/overdrive/Nexus/Extras/Spring/Controller.cs
    struts/sandbox/trunk/overdrive/Nexus/Test/BaseNexusTest.cs
    struts/sandbox/trunk/overdrive/Nexus/Test/ControllerTest.cs
    struts/sandbox/trunk/overdrive/Nexus/Test/Resources/Command/AppConfig.xml

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=190618&r1=190617&r2=190618&view=diff
==============================================================================
--- struts/sandbox/trunk/overdrive/Nexus/Core/Helpers/IViewHelper.cs (original)
+++ struts/sandbox/trunk/overdrive/Nexus/Core/Helpers/IViewHelper.cs Tue Jun 14 08:41:25 2005
@@ -24,8 +24,8 @@
 	/// IRequestContext and IRequestCommand. 
 	/// </summary>
 	/// <remarks><p>
-	/// The controller for a helper may also act as a "front controller" 
-	/// to ensure routine tasks are carried out.
+	/// The helper may also work with the catalog to act as a 
+	/// "front controller" by ensuring routine tasks are carried out.
 	/// These tasks can include input validation, data conversion, 
 	/// text formatting, command logging, and so forth.
 	/// </p></remarks>
@@ -138,6 +138,7 @@
 		/// Return true if Messages are queued.
 		/// </summary>
 		/// <returns>True if Messages are queued.</returns>
+		/// 
 		bool HasMessages { get; }
 
 
@@ -145,7 +146,7 @@
 
 		/// <summary>
 		/// Set of IFieldContext definitions available to the application, 
-		/// usually set by the controller.
+		/// usually set by the catalog.
 		/// </summary>
 		/// <remarks><p>
 		/// The FieldTable can be used to convert display strings to native 
@@ -236,11 +237,11 @@
 		// ----
 
 		/// <summary>
-		/// The controller for this helper, usually set by dependency 
-		/// injection.
+		/// The catalog for this helper, 
+		/// usually set by dependency injection.
 		/// </summary>
 		/// 
-		IController Controller { get; set; }
+		IRequestCatalog RequestCatalog { 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=190618&r1=190617&r2=190618&view=diff
==============================================================================
--- struts/sandbox/trunk/overdrive/Nexus/Core/Helpers/ViewHelper.cs (original)
+++ struts/sandbox/trunk/overdrive/Nexus/Core/Helpers/ViewHelper.cs Tue Jun 14 08:41:25 2005
@@ -33,7 +33,7 @@
 			get
 			{
 				if (_Context == null)
-					_Context = Controller.GetContext (Command);
+					_Context = RequestCatalog.GetContext (Command);
 				return _Context;
 			}
 		}
@@ -52,7 +52,7 @@
 
 		public void Execute ()
 		{
-			Controller.ExecuteView (Context);
+			RequestCatalog.ExecuteView (Context);
 		}
 
 		#endregion
@@ -134,7 +134,7 @@
 			get { throw new NotImplementedException (); }
 			set { throw new NotImplementedException (); }
 		}
-		public IController Controller
+		public IRequestCatalog RequestCatalog
 		{
 			get { throw new NotImplementedException (); }
 			set { throw new NotImplementedException (); }

Modified: struts/sandbox/trunk/overdrive/Nexus/Core/IController.cs
URL: http://svn.apache.org/viewcvs/struts/sandbox/trunk/overdrive/Nexus/Core/IController.cs?rev=190618&r1=190617&r2=190618&view=diff
==============================================================================
--- struts/sandbox/trunk/overdrive/Nexus/Core/IController.cs (original)
+++ struts/sandbox/trunk/overdrive/Nexus/Core/IController.cs Tue Jun 14 08:41:25 2005
@@ -1,4 +1,5 @@
- /*
+using Agility.Core;
+/*
  * Copyright 2005 The Apache Software Foundation.
  * 
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -17,16 +18,11 @@
 namespace Nexus.Core
 {
 	/// <summary>
-	/// Interact with the caller, controlling and managing 
-	/// the processing of a request [OVR-8]. 
+	///  Extend ICatalog to automatically set IFieldTable, 
+	///  IMessageTable and provide convenience methods [OVR-8]. 
 	/// </summary>
-	/// <remarks><p>
-	/// The caller should only need to know the name of a Command 
-	/// to be able to acquire the appropriate Context, 
-	/// and then execute the request. 
-	/// </p></remarks>
 	/// 
-	public interface IController
+	public interface IRequestCatalog : ICatalog
 	{
 		/// <summary>
 		/// Obtain object instance for name.

Modified: struts/sandbox/trunk/overdrive/Nexus/Extras/Spring/Controller.cs
URL: http://svn.apache.org/viewcvs/struts/sandbox/trunk/overdrive/Nexus/Extras/Spring/Controller.cs?rev=190618&r1=190617&r2=190618&view=diff
==============================================================================
--- struts/sandbox/trunk/overdrive/Nexus/Extras/Spring/Controller.cs (original)
+++ struts/sandbox/trunk/overdrive/Nexus/Extras/Spring/Controller.cs Tue Jun 14 08:41:25 2005
@@ -14,6 +14,7 @@
  * limitations under the License.
  */
 using System;
+using System.Collections;
 using Agility.Core;
 using Nexus.Core;
 using Nexus.Core.Tables;
@@ -22,11 +23,11 @@
 namespace Nexus.Extras.Spring
 {
 	/// <summary>
-	/// Concrete IController implementation using Spring as an IOC 
-	/// container [OVR-8].
+	/// Concrete IRequestCatalog implementation 
+	/// using Spring as an IOC container [OVR-8].
 	/// </summary>
 	/// 
-	public class Controller : IController, IApplicationContextAware
+	public class Catalog : IRequestCatalog, IApplicationContextAware
 	{
 		private IApplicationContext _Factory = null;
 
@@ -36,11 +37,11 @@
 			set { _Factory = value; }
 		}
 
-		public Controller ()
+		public Catalog ()
 		{
 		}
 
-		public Controller (IApplicationContext value)
+		public Catalog (IApplicationContext value)
 		{
 			ApplicationContext = value;
 		}
@@ -58,11 +59,16 @@
 		public object GetObject (string name)
 		{
 			if (null == name)
-				throw new ArgumentNullException (msg_NAME, "IController.GetObject");
+				throw new ArgumentNullException (msg_NAME, "ICatalog.GetObject");
 			return Factory ().GetObject (name);
 		}
 
-		public IRequestCommand GetCommand (string name)
+		public void AddCommand (string name, ICommand command)
+		{
+			throw new NotImplementedException ();
+		}
+
+		public ICommand GetCommand (string name)
 		{
 			if (null == name)
 			{
@@ -84,6 +90,11 @@
 			return command;
 		}
 
+		public IEnumerator GetNames ()
+		{
+			throw new NotImplementedException ();
+		}
+
 		public IRequestContext GetContext (IRequestCommand command)
 		{
 			IRequestContext context = null;
@@ -109,7 +120,7 @@
 			IRequestContext context = null;
 			try
 			{
-				IRequestCommand command = GetCommand (name);
+				IRequestCommand command = GetCommand (name) as IRequestCommand;
 				context = command.NewContext ();
 				context [Tokens.COMMAND_BIN] = command;
 			}
@@ -130,9 +141,9 @@
 		private IFieldTable _FieldTable = null;
 
 		/// <summary>
-		/// Access method for the Controller's FieldTable.
+		/// Access method for the Catalog's FieldTable.
 		/// </summary>
-		/// <returns>FieldTable for this Controller</returns></returns>
+		/// <returns>FieldTable for this Catalog</returns></returns>
 		/// 
 		public IFieldTable GetFieldTable ()
 		{

Modified: struts/sandbox/trunk/overdrive/Nexus/Test/BaseNexusTest.cs
URL: http://svn.apache.org/viewcvs/struts/sandbox/trunk/overdrive/Nexus/Test/BaseNexusTest.cs?rev=190618&r1=190617&r2=190618&view=diff
==============================================================================
--- struts/sandbox/trunk/overdrive/Nexus/Test/BaseNexusTest.cs (original)
+++ struts/sandbox/trunk/overdrive/Nexus/Test/BaseNexusTest.cs Tue Jun 14 08:41:25 2005
@@ -29,10 +29,10 @@
 	[TestFixture]
 	public class BaseNexusTest
 	{
-		protected IController controller;
+		protected IRequestCatalog catalog;
 
 		/// <summary>
-		/// Setup controller between tests.
+		/// Setup catalog between tests.
 		/// </summary>
 		/// 
 		[SetUp]
@@ -40,7 +40,7 @@
 		{
 			// TODO: Implement Objects.Factory [OVR-8]
 			IApplicationContext factory = Objects.Factory ();
-			controller = new Controller (factory); // sic
+			catalog = new Catalog (factory); // sic
 		}
 
 		/// <summary>
@@ -50,7 +50,7 @@
 		[Test]
 		public void AssertSetUp ()
 		{
-			Assert.IsTrue (controller != null, "Expected non-null controller.");
+			Assert.IsTrue (catalog != null, "Expected non-null catalog.");
 		}
 
 		/// <summary>

Modified: struts/sandbox/trunk/overdrive/Nexus/Test/ControllerTest.cs
URL: http://svn.apache.org/viewcvs/struts/sandbox/trunk/overdrive/Nexus/Test/ControllerTest.cs?rev=190618&r1=190617&r2=190618&view=diff
==============================================================================
--- struts/sandbox/trunk/overdrive/Nexus/Test/ControllerTest.cs (original)
+++ struts/sandbox/trunk/overdrive/Nexus/Test/ControllerTest.cs Tue Jun 14 08:41:25 2005
@@ -19,11 +19,11 @@
 namespace Nexus.Core
 {
 	/// <summary>
-	/// Exercise IController per [OVR-8].
+	/// Exercise IRequestCatalog per [OVR-8].
 	/// </summary>
 	/// 
 	[TestFixture]
-	public class ControllerTest : BaseNexusTest
+	public class CatalogTest : BaseNexusTest
 	{
 		/// <summary>
 		/// A simple "list all" command should return nominal with an outcome. 
@@ -32,7 +32,7 @@
 		[Test]
 		public void ExecuteContext ()
 		{
-			IRequestContext context = controller.ExecuteContext (ListAll.LIST_ALL);
+			IRequestContext context = catalog.ExecuteContext (ListAll.LIST_ALL);
 			AssertNominal (context);
 			Assert.IsTrue (context.IsNominal, "Expected nominal result.");
 			Assert.IsTrue (context.HasOutcome, "Expected outcome from command.");

Modified: struts/sandbox/trunk/overdrive/Nexus/Test/Resources/Command/AppConfig.xml
URL: http://svn.apache.org/viewcvs/struts/sandbox/trunk/overdrive/Nexus/Test/Resources/Command/AppConfig.xml?rev=190618&r1=190617&r2=190618&view=diff
==============================================================================
--- struts/sandbox/trunk/overdrive/Nexus/Test/Resources/Command/AppConfig.xml (original)
+++ struts/sandbox/trunk/overdrive/Nexus/Test/Resources/Command/AppConfig.xml Tue Jun 14 08:41:25 2005
@@ -3,7 +3,7 @@
 	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
 	xsi:schemaLocation="http://www.springframework.net http://www.springframework.net/xsd/spring-objects.xsd">
 	
-<!-- controller commands 
+<!-- catalog commands 
 	
   <object id="convert_input" type="Nexus.Validators.ConvertInput">
     <property name="ID"><value>ConvertInput</value></property>
@@ -37,9 +37,9 @@
   </object>
 -->
     		
- <!-- Nexus Controller -->
+ <!-- Nexus Catalog -->
 
-  <object id="Controller" type="Nexus.Extras.Spring.Controller"/>
+  <object id="Catalog" type="Nexus.Extras.Spring.Catalog"/>
   
 <!-- iBATIS Mapper -->
   



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