Author: husted
Date: Wed Jun 29 15:04:51 2005
New Revision: 202442

URL: http://svn.apache.org/viewcvs?rev=202442&view=rev
Log:
OVR-8
* Oops, make FieldContext a property too, so that it doesn't have to hide 
behind a magic value.

Modified:
    struts/sandbox/trunk/overdrive/Nexus/Core/IRequestCatalog.cs
    struts/sandbox/trunk/overdrive/Nexus/Extras/Spring/Catalog.cs
    struts/sandbox/trunk/overdrive/Nexus/Test/Resources/Command/AppConfig.xml

Modified: struts/sandbox/trunk/overdrive/Nexus/Core/IRequestCatalog.cs
URL: 
http://svn.apache.org/viewcvs/struts/sandbox/trunk/overdrive/Nexus/Core/IRequestCatalog.cs?rev=202442&r1=202441&r2=202442&view=diff
==============================================================================
--- struts/sandbox/trunk/overdrive/Nexus/Core/IRequestCatalog.cs (original)
+++ struts/sandbox/trunk/overdrive/Nexus/Core/IRequestCatalog.cs Wed Jun 29 
15:04:51 2005
@@ -16,6 +16,7 @@
 using System.Collections;
 using Agility.Core;
 using Nexus.Core.Helpers;
+using Nexus.Core.Tables;
 
 namespace Nexus.Core
 {
@@ -26,6 +27,36 @@
        /// 
        public interface IRequestCatalog : ICatalog
        {
+
+               /// <summary>
+               /// Provide the FieldTable for this Catalog.
+               /// </summary>
+               /// <remarks><p>
+               /// The GetRequest methods "stamp" the Context 
+               /// with a reference to the FieldTable, 
+               /// among other things.
+               /// </p></remarks>
+               IFieldTable FieldTable {get;set;}
+               
+               /// <summary>
+               /// Execute before a Command called via ExecuteView. 
+               /// </summary>
+               /// <remarks><p>
+               /// Of course, a IRequestChain may be used here too.
+               /// </p></remarks>
+               /// 
+               IRequestCommand PreOp {get;set;}
+                       
+               /// <summary>
+               /// Execute after a Command called via ExecuteView. 
+               /// </summary>
+               /// <remarks><p>
+               /// Of course, a IRequestChain may be used here too.
+               /// </p></remarks>
+               /// 
+               IRequestCommand PostOp {get;set;}
+
+
                /// <summary>
                /// Obtains an object for ID.
                /// </summary>
@@ -42,7 +73,7 @@
 
                /// <summary>
                /// Obtain a IRequestContext for command ID, 
-               /// including embedded resources.
+               /// including embedded resources like the FieldTable,
                /// </summary>
                /// <param name="name">Our command ID</param>
                /// <returns>IRequestContext with embedded resources.</returns>
@@ -51,7 +82,7 @@
 
                /// <summary>
                /// Obtain a IRequestContext for command ID, 
-               /// including embedded resources, 
+               /// including embedded resources like the FieldTable,
                /// and process string-based input. 
                /// </summary>
                /// <param name="name">Our command ID</param>
@@ -102,24 +133,6 @@
                /// <param name="context">Context to execute</param>
                /// 
                void ExecuteView (IRequestContext context);
-
-               /// <summary>
-               /// Execute before a Command called via ExecuteView. 
-               /// </summary>
-               /// <remarks><p>
-               /// Of course, a IRequestChain may be used here too.
-               /// </p></remarks>
-               /// 
-               IRequestCommand PreOp {get;set;}
-                       
-               /// <summary>
-               /// Execute after a Command called via ExecuteView. 
-               /// </summary>
-               /// <remarks><p>
-               /// Of course, a IRequestChain may be used here too.
-               /// </p></remarks>
-               /// 
-               IRequestCommand PostOp {get;set;}
 
        }
 }

Modified: struts/sandbox/trunk/overdrive/Nexus/Extras/Spring/Catalog.cs
URL: 
http://svn.apache.org/viewcvs/struts/sandbox/trunk/overdrive/Nexus/Extras/Spring/Catalog.cs?rev=202442&r1=202441&r2=202442&view=diff
==============================================================================
--- struts/sandbox/trunk/overdrive/Nexus/Extras/Spring/Catalog.cs (original)
+++ struts/sandbox/trunk/overdrive/Nexus/Extras/Spring/Catalog.cs Wed Jun 29 
15:04:51 2005
@@ -141,18 +141,25 @@
                        return _Factory;
                }
 
+               private IFieldTable _FieldTable;
+               public IFieldTable FieldTable
+               {
+                       get { return _FieldTable; }
+                       set { _FieldTable = value; }
+               }
 
-               private IFieldTable _FieldTable = null;
-               /// <summary>
-               /// Access method for the Catalog's FieldTable.
-               /// </summary>
-               /// <returns>FieldTable for this Catalog</returns></returns>
-               /// 
-               private IFieldTable GetFieldTable ()
-               {
-                       if (_FieldTable == null)
-                               _FieldTable = GetObject (Tokens.ID_FIELD_TABLE) 
as IFieldTable;
-                       return _FieldTable;
+               private IRequestCommand _PreOp;
+               public IRequestCommand PreOp
+               {
+                       get { return _PreOp; }
+                       set { _PreOp = value; }
+               }
+
+               private IRequestCommand _PostOp;
+               public IRequestCommand PostOp
+               {
+                       get { return _PostOp; }
+                       set { _PostOp = value; }
                }
 
                public IViewHelper GetHelper (string name)
@@ -181,7 +188,7 @@
                        {
                                context = command.NewContext ();
                                context [Tokens.CommandBin] = command;
-                               context [Tokens.FieldTable] = GetFieldTable ();
+                               context [Tokens.FieldTable] = FieldTable;
                                // TODO: MessageTable
                        }
                        catch (Exception e)
@@ -267,20 +274,6 @@
                                        context.Fault = e;
                                }
                        }
-               }
-
-               private IRequestCommand _PreOp;
-               public IRequestCommand PreOp
-               {
-                       get { return _PreOp; }
-                       set { _PreOp = value; }
-               }
-
-               private IRequestCommand _PostOp;
-               public IRequestCommand PostOp
-               {
-                       get { return _PostOp; }
-                       set { _PostOp = value; }
                }
 
                #endregion

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=202442&r1=202441&r2=202442&view=diff
==============================================================================
--- struts/sandbox/trunk/overdrive/Nexus/Test/Resources/Command/AppConfig.xml 
(original)
+++ struts/sandbox/trunk/overdrive/Nexus/Test/Resources/Command/AppConfig.xml 
Wed Jun 29 15:04:51 2005
@@ -3,6 +3,14 @@
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
        xsi:schemaLocation="http://www.springframework.net 
http://www.springframework.net/xsd/spring-objects.xsd";>
        
+<!-- Catalog -->               
+  
+  <object id="Catalog" type="Nexus.Extras.Spring.Catalog">
+         <property name="FieldTable"><ref object="FieldTable"/></property>
+         <property name="PreOp"><ref object="PreOp"/></property>
+         <property name="PostOp"><ref object="PostOp"/></property>
+  </object>
+  
 <!-- Request Processors -->
        
   <object id="ConvertInput" type="Nexus.Core.Validators.ConvertInput">
@@ -31,13 +39,6 @@
     </property>           
   </object>
        
-<!-- Catalog -->               
-  
-  <object id="Catalog" type="Nexus.Extras.Spring.Catalog">
-         <property name="PreOp"><ref object="PreOp"/></property>
-         <property name="PostOp"><ref object="PostOp"/></property>
-  </object>
-  
  <!-- FieldTable -->
  
        <object id="FieldTable" type="Nexus.Core.Tables.FieldTable">



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to