struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hus...@apache.org
Subject svn commit: r307214 - in /struts/sandbox/trunk/overdrive/Nexus: Core/Tables/ Extras/ Extras/Spring/ Test/bin/Debug/ Web/
Date Fri, 07 Oct 2005 23:03:32 GMT
Author: husted
Date: Fri Oct  7 16:03:16 2005
New Revision: 307214

URL: http://svn.apache.org/viewcvs?rev=307214&view=rev
Log:
OVR-12
OVR-21
* Add FieldContext factory method, so that Tables can add a "lazy" context entry when strict
is false. 
* Loosen protection on list_criteria so a composite control can access. 
* Add InitView method to ViewControl so that composite controls can wire contained controls.

Added:
    struts/sandbox/trunk/overdrive/Nexus/Extras/Spring/FieldTable.cs
Modified:
    struts/sandbox/trunk/overdrive/Nexus/Core/Tables/FieldTable.cs
    struts/sandbox/trunk/overdrive/Nexus/Core/Tables/IFieldTable.cs
    struts/sandbox/trunk/overdrive/Nexus/Extras/Extras.csproj
    struts/sandbox/trunk/overdrive/Nexus/Test/bin/Debug/Nexus.Core.dll
    struts/sandbox/trunk/overdrive/Nexus/Test/bin/Debug/Nexus.Core.pdb
    struts/sandbox/trunk/overdrive/Nexus/Test/bin/Debug/Nexus.Core.xml
    struts/sandbox/trunk/overdrive/Nexus/Test/bin/Debug/Nexus.Extras.dll
    struts/sandbox/trunk/overdrive/Nexus/Test/bin/Debug/Nexus.Extras.pdb
    struts/sandbox/trunk/overdrive/Nexus/Test/bin/Debug/Nexus.Extras.xml
    struts/sandbox/trunk/overdrive/Nexus/Test/bin/Debug/Nexus.Test.dll
    struts/sandbox/trunk/overdrive/Nexus/Test/bin/Debug/Nexus.Test.pdb
    struts/sandbox/trunk/overdrive/Nexus/Web/FindControl.ascx.cs
    struts/sandbox/trunk/overdrive/Nexus/Web/GridControl.ascx.cs
    struts/sandbox/trunk/overdrive/Nexus/Web/ViewControl.ascx.cs

Modified: struts/sandbox/trunk/overdrive/Nexus/Core/Tables/FieldTable.cs
URL: http://svn.apache.org/viewcvs/struts/sandbox/trunk/overdrive/Nexus/Core/Tables/FieldTable.cs?rev=307214&r1=307213&r2=307214&view=diff
==============================================================================
--- struts/sandbox/trunk/overdrive/Nexus/Core/Tables/FieldTable.cs (original)
+++ struts/sandbox/trunk/overdrive/Nexus/Core/Tables/FieldTable.cs Fri Oct  7 16:03:16 2005
@@ -33,6 +33,13 @@
 			set { _Strict = value; }
 		}
 
+		public virtual IFieldContext NewFieldContext(string id)
+		{
+			IFieldContext field = new FieldContext();
+			field.ID = id;
+			return field;
+		}
+		
 		public virtual IFieldContext AddFieldContext
 		{
 			set
@@ -58,9 +65,19 @@
 		{
 			if (id == null) throw new ArgumentNullException("id==null", "Nexus.Core.Tables.FieldTable.GetFieldContext");
 			IFieldContext fieldContext = Field[id] as IFieldContext;
-			bool problem = ((fieldContext == null) && (Strict));
-			if (problem)
-				throw new ArgumentNullException(id, "Nexus.Core.Tables.FieldTable.GetFieldContext");
+			bool missing = (fieldContext == null);
+			if (missing) 
+				if (Strict)
+					throw new ArgumentNullException(id, "Nexus.Core.Tables.FieldTable.GetFieldContext");
+				else 
+				{ 
+					System.Object lockThis = new System.Object();
+					lock(lockThis)
+					{
+						fieldContext = NewFieldContext(id);
+						AddFieldContext = fieldContext;
+					}
+				}
 			return fieldContext;
 		}
 

Modified: struts/sandbox/trunk/overdrive/Nexus/Core/Tables/IFieldTable.cs
URL: http://svn.apache.org/viewcvs/struts/sandbox/trunk/overdrive/Nexus/Core/Tables/IFieldTable.cs?rev=307214&r1=307213&r2=307214&view=diff
==============================================================================
--- struts/sandbox/trunk/overdrive/Nexus/Core/Tables/IFieldTable.cs (original)
+++ struts/sandbox/trunk/overdrive/Nexus/Core/Tables/IFieldTable.cs Fri Oct  7 16:03:16 2005
@@ -19,6 +19,17 @@
 		bool Strict { set; get; }
 
 		/// <summary>
+		/// Factory method to create a stub context 
+		/// when field is required and Strict is false.
+		/// </summary>
+		/// <remarks><p>
+		/// The IFieldContext instance should provide a default for Required.
+		/// </p></remarks>
+		/// <param name="id">The fieldname</param>
+		/// <returns>New default context for ID</returns>
+		IFieldContext NewFieldContext(string id);
+
+		/// <summary>
 		/// Add a field to the set. 
 		/// </summary>
 		/// 

Modified: struts/sandbox/trunk/overdrive/Nexus/Extras/Extras.csproj
URL: http://svn.apache.org/viewcvs/struts/sandbox/trunk/overdrive/Nexus/Extras/Extras.csproj?rev=307214&r1=307213&r2=307214&view=diff
==============================================================================
--- struts/sandbox/trunk/overdrive/Nexus/Extras/Extras.csproj (original)
+++ struts/sandbox/trunk/overdrive/Nexus/Extras/Extras.csproj Fri Oct  7 16:03:16 2005
@@ -114,6 +114,11 @@
                     BuildAction = "Compile"
                 />
                 <File
+                    RelPath = "Spring\FieldTable.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
                     RelPath = "Spring\Objects.cs"
                     SubType = "Code"
                     BuildAction = "Compile"

Added: struts/sandbox/trunk/overdrive/Nexus/Extras/Spring/FieldTable.cs
URL: http://svn.apache.org/viewcvs/struts/sandbox/trunk/overdrive/Nexus/Extras/Spring/FieldTable.cs?rev=307214&view=auto
==============================================================================
--- struts/sandbox/trunk/overdrive/Nexus/Extras/Spring/FieldTable.cs (added)
+++ struts/sandbox/trunk/overdrive/Nexus/Extras/Spring/FieldTable.cs Fri Oct  7 16:03:16 2005
@@ -0,0 +1,35 @@
+using Nexus.Core.Tables;
+using Spring.Context;
+
+namespace Nexus.Extras.Spring
+{
+	/// <summary>
+	/// Companion to Nexus.Extras.Spring.FieldContext.
+	/// </summary>
+	public class FieldTable : Nexus.Core.Tables.FieldTable
+	{
+
+		private IMessageSource _MessageSource;
+
+		/// <summary>
+		/// Identify the message source for this FieldTable.
+		/// </summary>
+		/// <exception cref="System.InvalidOperationException">
+		/// If the context has not been initialized yet.
+		/// </exception>
+		public IMessageSource MessageSource
+		{
+			get { return _MessageSource; }
+			set { _MessageSource = value; }
+		}
+
+		public override IFieldContext NewFieldContext(string id)
+		{
+			FieldContext field = new FieldContext();
+			field.ID = id;
+			field.MessageSource = this.MessageSource;
+			return field;
+		}
+		
+	}
+}

Modified: struts/sandbox/trunk/overdrive/Nexus/Test/bin/Debug/Nexus.Core.dll
URL: http://svn.apache.org/viewcvs/struts/sandbox/trunk/overdrive/Nexus/Test/bin/Debug/Nexus.Core.dll?rev=307214&r1=307213&r2=307214&view=diff
==============================================================================
Binary files - no diff available.

Modified: struts/sandbox/trunk/overdrive/Nexus/Test/bin/Debug/Nexus.Core.pdb
URL: http://svn.apache.org/viewcvs/struts/sandbox/trunk/overdrive/Nexus/Test/bin/Debug/Nexus.Core.pdb?rev=307214&r1=307213&r2=307214&view=diff
==============================================================================
Binary files - no diff available.

Modified: struts/sandbox/trunk/overdrive/Nexus/Test/bin/Debug/Nexus.Core.xml
URL: http://svn.apache.org/viewcvs/struts/sandbox/trunk/overdrive/Nexus/Test/bin/Debug/Nexus.Core.xml?rev=307214&r1=307213&r2=307214&view=diff
==============================================================================
--- struts/sandbox/trunk/overdrive/Nexus/Test/bin/Debug/Nexus.Core.xml (original)
+++ struts/sandbox/trunk/overdrive/Nexus/Test/bin/Debug/Nexus.Core.xml Fri Oct  7 16:03:16
2005
@@ -551,6 +551,17 @@
             </summary>
             
         </member>
+        <member name="M:Nexus.Core.Tables.IFieldTable.NewFieldContext(System.String)">
+            <summary>
+            Factory method to create a stub context 
+            when field is required and Strict is false.
+            </summary>
+            <remarks><p>
+            The IFieldContext instance should provide a default for Required.
+            </p></remarks>
+            <param name="id">The fieldname</param>
+            <returns>New default context for ID</returns>
+        </member>
         <member name="M:Nexus.Core.Tables.IFieldTable.GetFieldContext(System.String)">
             <summary>
             Obtain the FieldContext for the given ID, observing Strict setting.

Modified: struts/sandbox/trunk/overdrive/Nexus/Test/bin/Debug/Nexus.Extras.dll
URL: http://svn.apache.org/viewcvs/struts/sandbox/trunk/overdrive/Nexus/Test/bin/Debug/Nexus.Extras.dll?rev=307214&r1=307213&r2=307214&view=diff
==============================================================================
Binary files - no diff available.

Modified: struts/sandbox/trunk/overdrive/Nexus/Test/bin/Debug/Nexus.Extras.pdb
URL: http://svn.apache.org/viewcvs/struts/sandbox/trunk/overdrive/Nexus/Test/bin/Debug/Nexus.Extras.pdb?rev=307214&r1=307213&r2=307214&view=diff
==============================================================================
Binary files - no diff available.

Modified: struts/sandbox/trunk/overdrive/Nexus/Test/bin/Debug/Nexus.Extras.xml
URL: http://svn.apache.org/viewcvs/struts/sandbox/trunk/overdrive/Nexus/Test/bin/Debug/Nexus.Extras.xml?rev=307214&r1=307213&r2=307214&view=diff
==============================================================================
--- struts/sandbox/trunk/overdrive/Nexus/Test/bin/Debug/Nexus.Extras.xml (original)
+++ struts/sandbox/trunk/overdrive/Nexus/Test/bin/Debug/Nexus.Extras.xml Fri Oct  7 16:03:16
2005
@@ -112,6 +112,19 @@
             If the context has not been initialized yet.
             </exception>
         </member>
+        <member name="T:Nexus.Extras.Spring.FieldTable">
+            <summary>
+            Companion to Nexus.Extras.Spring.FieldContext.
+            </summary>
+        </member>
+        <member name="P:Nexus.Extras.Spring.FieldTable.MessageSource">
+            <summary>
+            Identify the message source for this FieldTable.
+            </summary>
+            <exception cref="T:System.InvalidOperationException">
+            If the context has not been initialized yet.
+            </exception>
+        </member>
         <member name="T:Agility.Extras.Spring.Objects">
             <summary>
             A singleton implementation of the IHelper protocol, 

Modified: struts/sandbox/trunk/overdrive/Nexus/Test/bin/Debug/Nexus.Test.dll
URL: http://svn.apache.org/viewcvs/struts/sandbox/trunk/overdrive/Nexus/Test/bin/Debug/Nexus.Test.dll?rev=307214&r1=307213&r2=307214&view=diff
==============================================================================
Binary files - no diff available.

Modified: struts/sandbox/trunk/overdrive/Nexus/Test/bin/Debug/Nexus.Test.pdb
URL: http://svn.apache.org/viewcvs/struts/sandbox/trunk/overdrive/Nexus/Test/bin/Debug/Nexus.Test.pdb?rev=307214&r1=307213&r2=307214&view=diff
==============================================================================
Binary files - no diff available.

Modified: struts/sandbox/trunk/overdrive/Nexus/Web/FindControl.ascx.cs
URL: http://svn.apache.org/viewcvs/struts/sandbox/trunk/overdrive/Nexus/Web/FindControl.ascx.cs?rev=307214&r1=307213&r2=307214&view=diff
==============================================================================
--- struts/sandbox/trunk/overdrive/Nexus/Web/FindControl.ascx.cs (original)
+++ struts/sandbox/trunk/overdrive/Nexus/Web/FindControl.ascx.cs Fri Oct  7 16:03:16 2005
@@ -65,7 +65,7 @@
 			if (View_Find != null)
 			{
 				FindArgs a = new FindArgs(e, Criteria);
-				View_Find(sender, a);
+				View_Find(sender, a); 
 			}
 		}
 

Modified: struts/sandbox/trunk/overdrive/Nexus/Web/GridControl.ascx.cs
URL: http://svn.apache.org/viewcvs/struts/sandbox/trunk/overdrive/Nexus/Web/GridControl.ascx.cs?rev=307214&r1=307213&r2=307214&view=diff
==============================================================================
--- struts/sandbox/trunk/overdrive/Nexus/Web/GridControl.ascx.cs (original)
+++ struts/sandbox/trunk/overdrive/Nexus/Web/GridControl.ascx.cs Fri Oct  7 16:03:16 2005
@@ -4,6 +4,7 @@
 using System.Web.UI.WebControls;
 using Nexus.Core;
 using Nexus.Core.Helpers;
+using WQD.Core.Controls;
 
 namespace Nexus.Web
 {
@@ -19,7 +20,7 @@
 		/// <summary>
 		/// Values to use with a query statement.
 		/// </summary>
-		private IDictionary list_Criteria
+		protected IDictionary list_Criteria
 		{
 			get
 			{
@@ -653,7 +654,11 @@
 
 		protected void add_Click(object sender, EventArgs e)
 		{
-			list_Add(sender,e);
+			if (View_Add!=null)
+			{
+				FindArgs f = new FindArgs(e,list_Criteria);
+				View_Add(sender,f);
+			}
 		}
 
 		protected virtual void list_Item_Click(int index)

Modified: struts/sandbox/trunk/overdrive/Nexus/Web/ViewControl.ascx.cs
URL: http://svn.apache.org/viewcvs/struts/sandbox/trunk/overdrive/Nexus/Web/ViewControl.ascx.cs?rev=307214&r1=307213&r2=307214&view=diff
==============================================================================
--- struts/sandbox/trunk/overdrive/Nexus/Web/ViewControl.ascx.cs (original)
+++ struts/sandbox/trunk/overdrive/Nexus/Web/ViewControl.ascx.cs Fri Oct  7 16:03:16 2005
@@ -36,7 +36,7 @@
 		/// </summary>
 		protected IViewHelper Page_Error
 		{
-			set { View_Error_Send(this, new ViewArgs(value)); }
+			set { View_Error_Handler(this, new ViewArgs(value)); }
 		}
 
 		#region String utilities 
@@ -301,6 +301,7 @@
 		{
 			IViewHelper helper = Catalog.GetHelperFor(command);
 			helper.Profile = Profile;
+			// helper;
 			return helper;
 		}
 
@@ -646,12 +647,23 @@
 		/// </summary>
 		/// <param name="sender">This object</param>
 		/// <param name="e">A ViewArgs instance with the IViewHelper containing the error
messages(s).</param>
-		private void View_Error_Send(object sender, ViewArgs e)
+		private void View_Error_Handler(object sender, EventArgs e)
 		{
 			if (View_Error != null)
 			{
 				View_Error(sender, e);
 			}
+		}
+
+		/// <summary>
+		/// Initialize the control to use the stanard View_Error event handerl.
+		/// </summary>
+		/// <param name="c">Control to register</param>
+		/// 
+		protected void InitView(ViewControl c)
+		{
+			c.View_Error += new EventHandler(View_Error_Handler);
+			c.Profile = Profile;
 		}
 
 		/// <summary>



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


Mime
View raw message