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/05/29 13:28:20 UTC

svn commit: r178941 - in /struts/sandbox/trunk/overdrive/PhoneBook: Test/Commands/SelectAllTest.cs Test/Test.csproj Web/Forms/Directory.aspx.cs Web/Forms/Web.config Web/Web.config

Author: husted
Date: Sun May 29 04:28:15 2005
New Revision: 178941

URL: http://svn.apache.org/viewcvs?rev=178941&view=rev
Log:
OVR-5
* Rollback back helper API draft code
* Add NUnitASP dependency (tests are next)

Modified:
    struts/sandbox/trunk/overdrive/PhoneBook/Test/Commands/SelectAllTest.cs
    struts/sandbox/trunk/overdrive/PhoneBook/Test/Test.csproj
    struts/sandbox/trunk/overdrive/PhoneBook/Web/Forms/Directory.aspx.cs
    struts/sandbox/trunk/overdrive/PhoneBook/Web/Forms/Web.config
    struts/sandbox/trunk/overdrive/PhoneBook/Web/Web.config

Modified: struts/sandbox/trunk/overdrive/PhoneBook/Test/Commands/SelectAllTest.cs
URL: http://svn.apache.org/viewcvs/struts/sandbox/trunk/overdrive/PhoneBook/Test/Commands/SelectAllTest.cs?rev=178941&r1=178940&r2=178941&view=diff
==============================================================================
--- struts/sandbox/trunk/overdrive/PhoneBook/Test/Commands/SelectAllTest.cs (original)
+++ struts/sandbox/trunk/overdrive/PhoneBook/Test/Commands/SelectAllTest.cs Sun May 29 04:28:15 2005
@@ -30,7 +30,7 @@
 		/// Assert result of SelectAll, after another method runs the command.
 		/// </summary>
 		/// <param name="context">Context with result to assert.</param>		
-		public void SelectAll_Result(IRequestContext context)
+		private void SelectAll_Result(IRequestContext context)
 		{
 			AssertNominal(context);
 			Assert.IsTrue (context.HasOutcome,"Expected command to set an Outcome.");

Modified: struts/sandbox/trunk/overdrive/PhoneBook/Test/Test.csproj
URL: http://svn.apache.org/viewcvs/struts/sandbox/trunk/overdrive/PhoneBook/Test/Test.csproj?rev=178941&r1=178940&r2=178941&view=diff
==============================================================================
--- struts/sandbox/trunk/overdrive/PhoneBook/Test/Test.csproj (original)
+++ struts/sandbox/trunk/overdrive/PhoneBook/Test/Test.csproj Sun May 29 04:28:15 2005
@@ -110,6 +110,16 @@
                     Project = "{3150F3E8-9A04-4FED-B16F-CEA57756E934}"
                     Package = "{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}"
                 />
+                <Reference
+                    Name = "NUnitAspTest"
+                    AssemblyName = "NUnitAspTest"
+                    HintPath = "..\..\NUnitAsp.bin\NUnitAspTest.dll"
+                />
+                <Reference
+                    Name = "NUnitAsp"
+                    AssemblyName = "NUnitAsp"
+                    HintPath = "..\..\NUnitAsp.bin\NUnitAsp.dll"
+                />
             </References>
         </Build>
         <Files>

Modified: struts/sandbox/trunk/overdrive/PhoneBook/Web/Forms/Directory.aspx.cs
URL: http://svn.apache.org/viewcvs/struts/sandbox/trunk/overdrive/PhoneBook/Web/Forms/Directory.aspx.cs?rev=178941&r1=178940&r2=178941&view=diff
==============================================================================
--- struts/sandbox/trunk/overdrive/PhoneBook/Web/Forms/Directory.aspx.cs (original)
+++ struts/sandbox/trunk/overdrive/PhoneBook/Web/Forms/Directory.aspx.cs Sun May 29 04:28:15 2005
@@ -1,8 +1,6 @@
 using System;
 using System.Web.UI;
 using System.Web.UI.WebControls;
-using Nexus.Core;
-using Nexus.Core.Helpers;
 
 namespace PhoneBook.Web
 {
@@ -15,36 +13,15 @@
 	
 		#region Page Properties
 
-		private IController _Controller;
-		/// <summary>
-		/// Instance of our application controller (injected by Spring).
-		/// </summary>
-		public IController Controller
-		{
-			get { return _Controller; }
-			set { _Controller = value; }
-		}
-
 		protected Panel pnlError;
 		protected Label lblError;
 
-		protected IViewHelper Page_Error 
-		{
-			set
-			{
-				lblError.Text = ViewHelper.HtmlErrorBuilder (value);
-				pnlError.Visible = true;
-			}
-		}
-
 		#endregion
 
 		#region Messages
 
 		private const string msg_FIND_CMD = "FIND";
 		private const string msg_ADD_CMD = "ADD NEW";
-		private const string msg_FIND_HELPER_NULL = "Directory.aspx.cs.View_Load: myFindHelper failed. Is it serializable?";
-		private const string msg_LIST_HELPER_NULL = "Directory.aspx.cs.View_Load: myListHelper failed. Is it serializable?";
 
 		#endregion
 
@@ -54,7 +31,6 @@
 		protected DropDownList lstSelect;
 		protected TextBox txtFind;
 		protected Button cmdFind;
-		protected IViewHelper myFindHelper;
 
 		// pageload events - These methods populate controls to display
 
@@ -68,11 +44,6 @@
 
 		private void Find_Load ()
 		{
-			// TODO: myFindHelper.Execute(pnlFind.Controls);
-			if (true) // TODO: (!myFindHelper.IsNominal )
-			{
-				// TODO: Page_Error = myFindHelper;
-			} 
 			pnlFind.Visible = true;
 		}
 
@@ -80,7 +51,6 @@
 
 		protected void Find_Submit (object sender, EventArgs e)
 		{
-			// TODO: myListHelper.Execute(pnlFind.Controls);
 			List_Load ();
 		}
 
@@ -91,7 +61,6 @@
 		protected Panel pnlList;
 		protected DataGrid repList;
 		protected Button cmdAdd;
-		protected IListHelper myListHelper;
 		
 		// pageload events
 
@@ -102,15 +71,14 @@
 
 		private bool List_Load ()
 		{
-			bool okay = true ; // TODO: myListHelper.IsNominal;
+			bool okay = true ; // TODO: ...
 			if (okay)
 			{
-				// TODO: repList.DataSource = myListHelper.List;
+				// TODO: repList.DataSource = ... ;
 				repList.DataBind ();
 				pnlList.Visible = true;
 			}
-			else
-				Page_Error = myListHelper;
+			// TODO: else ...
 			return okay;
 		}
 
@@ -133,56 +101,24 @@
 
 		protected void List_PageIndexChanged (object sender, DataGridPageChangedEventArgs e)
 		{
-			Find_Submit(null,null); // ISSUE: Is this a kludge?
+			Find_Submit(null,null); 
 			repList.CurrentPageIndex = e.NewPageIndex;
-			repList.DataBind (); // ISSUE:  myListHelper.DataBind (repList);
+			repList.DataBind (); 
 		}
 
 		protected void Add_Submit (object sender, EventArgs e)
 		{
-			// call business logic
-			// TODO: myListHelper.DataInsert (repList);
-			// act on outcome
-			if (true) // TODO: (myListHelper.IsNominal)
-			{
-				// TODO: myListHelper.ItemIndex = 0;
-				// TODO: myListHelper.DataBind (repList);
-				// TODO: myListHelper.Insert = true;
-				pnlList.Visible = true;
-			}
-			else Page_Error = myListHelper;
+			// TODO: ...
 		}
 
 
 		#endregion
 
-		private void View_Init()
-		{
-			// TODO: myFindHelper = Controller.GetFindHelper(App.FIND_HELPER);
-			// TODO: ViewState[App.FIND_HELPER] = myFindHelper;
-			// TODO: myListHelper = Controller.GetListHelper(App.LIST_HELPER);
-			// TODO: ViewState[App.LIST_HELPER] = myListHelper;
-		}
-
-		private void View_Load()
-		{
-			// TODO: myFindHelper = ViewState[App.FIND_HELPER] as IFindHelper;
-			// if (null==myFindHelper) throw new ApplicationException(msg_FIND_HELPER_NULL);			
-			// TODO: myListHelper = ViewState[App.LIST_HELPER] as IListHelper;
-			// if (null==myListHelper) throw new ApplicationException(msg_LIST_HELPER_NULL);			
-		}
-
 		private void Page_Load(object sender, System.EventArgs e)
 		{
 			Find_Init();
 			List_Init();
-			bool isFirstView = (!IsPostBack);
-			if  (isFirstView)
-			{	
-				View_Init();
-				Find_Load();
-			} 
-			View_Load();
+			if  (!IsPostBack) Find_Load();
 		}
 
 		#region Web Form Designer generated code
@@ -203,35 +139,6 @@
 		{    
 			this.Load += new System.EventHandler(this.Page_Load);
 		}
-		#endregion
-
-		#region Draft APIs
-
-		/*
-
-draft APIs
-
-IFindHelper 
-
-static void HtmlErrorBuilder (IViewHelper);
-bool Execute(pnlFind.Controls);
-bool IsNominal;
-
-IListHelper 
-
-IList myListHelper.List();
-void DataInsert (repList);
-int ItemIndex;
-DataBind (DataGrid);
-bool Insert;
-
-IViewController
-
-IFindHelper GetFindHelper(string);
-IListHelper GetListHelper(string);
-				
-		*/
-
 		#endregion
 
 	}

Modified: struts/sandbox/trunk/overdrive/PhoneBook/Web/Forms/Web.config
URL: http://svn.apache.org/viewcvs/struts/sandbox/trunk/overdrive/PhoneBook/Web/Forms/Web.config?rev=178941&r1=178940&r2=178941&view=diff
==============================================================================
--- struts/sandbox/trunk/overdrive/PhoneBook/Web/Forms/Web.config (original)
+++ struts/sandbox/trunk/overdrive/PhoneBook/Web/Forms/Web.config Sun May 29 04:28:15 2005
@@ -16,9 +16,6 @@
     <objects xmlns="http://www.springframework.net">
     
 		<object id="Directory" type="Directory.aspx">
-			<property name="Controller">
-               <ref object="Controller"/>
-			</property>        
 		</object>
               
    </objects>

Modified: struts/sandbox/trunk/overdrive/PhoneBook/Web/Web.config
URL: http://svn.apache.org/viewcvs/struts/sandbox/trunk/overdrive/PhoneBook/Web/Web.config?rev=178941&r1=178940&r2=178941&view=diff
==============================================================================
--- struts/sandbox/trunk/overdrive/PhoneBook/Web/Web.config (original)
+++ struts/sandbox/trunk/overdrive/PhoneBook/Web/Web.config Sun May 29 04:28:15 2005
@@ -9,8 +9,6 @@
 
     <spring>
         <context type="Spring.Context.Support.WebApplicationContext, Spring.Web">
-            <resource uri="~/Resources/Command/AppConfig.xml"/>
-            <resource uri="~/Resources/Command/Catalog.xml"/>
         </context>
     </spring>  
     



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