struts-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hus...@apache.org
Subject svn commit: r491822 [1/2] - in /struts/sandbox/trunk/overdrive/PhoneBook2: ./ projects/ projects/Core/ projects/Core/Commands/ projects/Test/ projects/Test/Commands/ projects/Test/Resources/ projects/Web/ projects/Web/Resources/ projects/src/ projects/...
Date Tue, 02 Jan 2007 15:58:45 GMT
Author: husted
Date: Tue Jan  2 07:58:43 2007
New Revision: 491822

URL: http://svn.apache.org/viewvc?view=rev&rev=491822
Log:
Integrate Spring.net and iBATIS with Jayrocks and Dojo. 

Added:
    struts/sandbox/trunk/overdrive/PhoneBook2/projects/Core/App.cs
    struts/sandbox/trunk/overdrive/PhoneBook2/projects/Core/AppEntry.cs
    struts/sandbox/trunk/overdrive/PhoneBook2/projects/Core/AppEntryList.cs
    struts/sandbox/trunk/overdrive/PhoneBook2/projects/Core/AppEntryListProcessor.cs
    struts/sandbox/trunk/overdrive/PhoneBook2/projects/Core/AppUserProfile.cs
    struts/sandbox/trunk/overdrive/PhoneBook2/projects/Core/Commands/
    struts/sandbox/trunk/overdrive/PhoneBook2/projects/Core/Commands/AppCommand.cs
    struts/sandbox/trunk/overdrive/PhoneBook2/projects/Core/Commands/BaseCommand.cs
    struts/sandbox/trunk/overdrive/PhoneBook2/projects/Core/Commands/BaseCount.cs
    struts/sandbox/trunk/overdrive/PhoneBook2/projects/Core/Commands/BaseEntry.cs
    struts/sandbox/trunk/overdrive/PhoneBook2/projects/Core/Commands/BaseFilterList.cs
    struts/sandbox/trunk/overdrive/PhoneBook2/projects/Core/Commands/BaseList.cs
    struts/sandbox/trunk/overdrive/PhoneBook2/projects/Core/Commands/BaseSave.cs
    struts/sandbox/trunk/overdrive/PhoneBook2/projects/Core/Commands/EntryInitial.cs
    struts/sandbox/trunk/overdrive/PhoneBook2/projects/Core/Messages.resx
    struts/sandbox/trunk/overdrive/PhoneBook2/projects/Core/TelephoneProcessor.cs
    struts/sandbox/trunk/overdrive/PhoneBook2/projects/Test/BaseTest.cs
    struts/sandbox/trunk/overdrive/PhoneBook2/projects/Test/Commands/
    struts/sandbox/trunk/overdrive/PhoneBook2/projects/Test/Commands/DirectoryViewTest.cs
    struts/sandbox/trunk/overdrive/PhoneBook2/projects/Test/Commands/FilterLists.cs
    struts/sandbox/trunk/overdrive/PhoneBook2/projects/Test/Commands/SelectAllTest.cs
    struts/sandbox/trunk/overdrive/PhoneBook2/projects/Test/Objects.xml
    struts/sandbox/trunk/overdrive/PhoneBook2/projects/Test/Resources/
    struts/sandbox/trunk/overdrive/PhoneBook2/projects/Test/Resources/AppBase.xml
    struts/sandbox/trunk/overdrive/PhoneBook2/projects/Test/Resources/AppConfig.xml
    struts/sandbox/trunk/overdrive/PhoneBook2/projects/Test/Resources/AppFields.xml
    struts/sandbox/trunk/overdrive/PhoneBook2/projects/Test/Resources/Catalog.xml
    struts/sandbox/trunk/overdrive/PhoneBook2/projects/Test/Resources/Queries.xml
    struts/sandbox/trunk/overdrive/PhoneBook2/projects/Web/PhoneBook.ashx
    struts/sandbox/trunk/overdrive/PhoneBook2/projects/Web/PhoneBook.html
    struts/sandbox/trunk/overdrive/PhoneBook2/projects/Web/Resources/
    struts/sandbox/trunk/overdrive/PhoneBook2/projects/Web/Resources/AppBase.xml
    struts/sandbox/trunk/overdrive/PhoneBook2/projects/Web/Resources/AppConfig.xml
    struts/sandbox/trunk/overdrive/PhoneBook2/projects/Web/Resources/AppFields.xml
    struts/sandbox/trunk/overdrive/PhoneBook2/projects/Web/Resources/Catalog.xml
    struts/sandbox/trunk/overdrive/PhoneBook2/projects/Web/Resources/Queries.xml
    struts/sandbox/trunk/overdrive/PhoneBook2/projects/Web/providers.config
    struts/sandbox/trunk/overdrive/PhoneBook2/projects/Web/sqlmap.config
    struts/sandbox/trunk/overdrive/PhoneBook2/projects/Web/sqlmap.config.xml
Removed:
    struts/sandbox/trunk/overdrive/PhoneBook2/projects/src/
    struts/sandbox/trunk/overdrive/PhoneBook2/projects/website-compile.cmd
    struts/sandbox/trunk/overdrive/PhoneBook2/projects/website-shell.cmd
    struts/sandbox/trunk/overdrive/PhoneBook2/projects/www/
Modified:
    struts/sandbox/trunk/overdrive/PhoneBook2/PhoneBook2.sln
    struts/sandbox/trunk/overdrive/PhoneBook2/projects/Core/Core.csproj
    struts/sandbox/trunk/overdrive/PhoneBook2/projects/Core/Core.csproj.user
    struts/sandbox/trunk/overdrive/PhoneBook2/projects/Web/Default.aspx
    struts/sandbox/trunk/overdrive/PhoneBook2/projects/Web/DemoDojo.html

Modified: struts/sandbox/trunk/overdrive/PhoneBook2/PhoneBook2.sln
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/overdrive/PhoneBook2/PhoneBook2.sln?view=diff&rev=491822&r1=491821&r2=491822
==============================================================================
--- struts/sandbox/trunk/overdrive/PhoneBook2/PhoneBook2.sln (original)
+++ struts/sandbox/trunk/overdrive/PhoneBook2/PhoneBook2.sln Tue Jan  2 07:58:43 2007
@@ -9,6 +9,7 @@
 EndProject
 Project("{E24C65DC-7377-472B-9ABA-BC803B73C61A}") = "C:\...\Web\", "projects\Web\", "{055ABF30-6F91-48EB-B457-2D9274F0D34F}"
 	ProjectSection(WebsiteProperties) = preProject
+		ProjectReferences = "{F65FCC91-C9CB-40CE-87A6-C0CB00F73592}|PhoneBook.Core.dll;"
 		Debug.AspNetCompiler.VirtualPath = "/Web"
 		Debug.AspNetCompiler.PhysicalPath = "projects\Web\"
 		Debug.AspNetCompiler.TargetPath = "PrecompiledWeb\Web\"

Added: struts/sandbox/trunk/overdrive/PhoneBook2/projects/Core/App.cs
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/overdrive/PhoneBook2/projects/Core/App.cs?view=auto&rev=491822
==============================================================================
--- struts/sandbox/trunk/overdrive/PhoneBook2/projects/Core/App.cs (added)
+++ struts/sandbox/trunk/overdrive/PhoneBook2/projects/Core/App.cs Tue Jan  2 07:58:43 2007
@@ -0,0 +1,193 @@
+/*
+* Copyright 2005 The Apache Software Foundation.
+* 
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+* 
+*      http://www.apache.org/licenses/LICENSE-2.0
+* 
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+namespace PhoneBook.Core
+{
+    /// <summary>
+    /// Tokens representing context keys.
+    /// </summary>
+    /// 
+    public class App
+    {
+        private App()
+        {
+            // No need to construct static helper class
+        }
+
+        #region Properties
+
+        /// <summary>
+        /// Token for entry_key property.
+        /// </summary>
+        /// 
+        public const string ENTRY_KEY = "entry_key";
+
+        /// <summary>
+        /// Token for first_name property.
+        /// </summary>
+        /// 
+        public const string FIRST_NAME = "first_name";
+
+        /// <summary>
+        /// Token for last_name property.
+        /// </summary>
+        /// 
+        public const string LAST_NAME = "last_name";
+
+        /// <summary>
+        /// Token for user_name property.
+        /// </summary>
+        /// 
+        public const string USER_NAME = "user_name";
+
+        /// <summary>
+        /// Token for extension property.
+        /// </summary>
+        /// 
+        public const string EXTENSION = "extension";
+
+        /// <summary>
+        /// Token for hired property.
+        /// </summary>
+        /// 
+        public const string HIRED = "hired";
+
+        /// <summary>
+        /// Token for hours property.
+        /// </summary>
+        /// 
+        public const string HOURS = "hours";
+
+        /// <summary>
+        /// Token for editor property.
+        /// </summary>
+        /// 
+        public const string EDITOR = "editor";
+
+        #endregion
+
+        #region Commands
+
+        public const string FROM_DATE = "from_date";
+
+        public const string THRU_DATE = "thru_date";
+
+        /// <summary>
+        /// Token for SQL LIMIT clause.
+        /// </summary>
+        /// 
+        public const string ITEM_LIMIT = "item_limit";
+
+        /// <summary>
+        /// Token for SQL OFFSET clause.
+        /// </summary>
+        /// 
+        public const string ITEM_OFFSET = "item_offset";
+
+        /// <summary>
+        /// Token for SQL COUNT clause.
+        /// </summary>
+        /// 
+        public const string ITEM_COUNT = "item_count";
+
+        /// <summary>
+        /// Token for select one command.
+        /// </summary>
+        /// 
+        public const string ENTRY = "entry";
+
+        /// <summary>
+        /// Token for list all command.
+        /// </summary>
+        /// 
+        public const string ENTRY_LIST = "entry_list";
+
+        /// <summary>
+        /// Token for Entry Initial command.
+        /// </summary>
+        /// 
+        public const string ENTRY_INITIAL = "entry_initial";
+
+        /// <summary>
+        /// Token for List Last Names command.
+        /// </summary>
+        /// 
+        public const string LAST_NAME_LIST = "last_name_list";
+
+        /// <summary>
+        /// Token for List Last Names command.
+        /// </summary>
+        /// 
+        public const string FIRST_NAME_LIST = "first_name_list";
+
+        /// <summary>
+        /// Token for List Extensions command.
+        /// </summary>
+        /// 
+        public const string EXTENSION_LIST = "extension_list";
+
+        /// <summary>
+        /// Token for List UserNames command.
+        /// </summary>
+        /// 
+        public const string USER_NAME_LIST = "user_name_list";
+
+        /// <summary>
+        /// Token for List Hire Dates command.
+        /// </summary>
+        /// 
+        public const string HIRED_LIST = "hired_list";
+
+        /// <summary>
+        /// Token for List Hours command.
+        /// </summary>
+        /// 
+        public const string HOURS_LIST = "hours_list";
+
+        /// <summary>
+        /// Token for Entry Find command.
+        /// </summary>
+        /// 
+        public const string ENTRY_FIND = "entry_find";
+
+        /// <summary>
+        /// Token for Entry Save command.
+        /// </summary>
+        /// 
+        public const string ENTRY_SAVE = "entry_save";
+
+        #endregion
+
+        #region Messages
+
+        /// <summary>
+        /// Token for Directory page title.
+        /// </summary>
+        public const string DIRECTORY_TITLE = "directory_title";
+
+        /// <summary>
+        /// Token for Directory directory page heading.
+        /// </summary>
+        public const string DIRECTORY_HEADING = "directory_heading";
+
+        /// <summary>
+        /// Token for Directory page prompt.
+        /// </summary>
+        public const string DIRECTORY_PROMPT = "directory_prompt";
+
+        #endregion
+    }
+}
\ No newline at end of file

Added: struts/sandbox/trunk/overdrive/PhoneBook2/projects/Core/AppEntry.cs
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/overdrive/PhoneBook2/projects/Core/AppEntry.cs?view=auto&rev=491822
==============================================================================
--- struts/sandbox/trunk/overdrive/PhoneBook2/projects/Core/AppEntry.cs (added)
+++ struts/sandbox/trunk/overdrive/PhoneBook2/projects/Core/AppEntry.cs Tue Jan  2 07:58:43 2007
@@ -0,0 +1,150 @@
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use _Store file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+using System;
+using System.Collections;
+
+namespace PhoneBook.Core
+{
+    /// <summary>
+    /// Expose field attributes as public properties.
+    /// </summary>
+    /// 
+    [Serializable]
+    public class AppEntry
+    {
+        /// <summary>
+        /// Internal storage.
+        /// </summary>
+        /// 
+        private IDictionary _Value = new Hashtable(5);
+
+        /// <summary>
+        /// Add each source entry to our internal store. 
+        /// </summary>
+        /// <remarks><p>
+        /// Entries with keys that match the property names will be exposed. 
+        /// Other entries may be added, but can only be retrieved via Get.
+        /// </p></remarks>
+        /// <param name="sources">Entries to add</param>
+        /// 
+        public void AddAll(IDictionary sources)
+        {
+            ICollection keys = sources.Keys;
+            foreach (string key in keys)
+            {
+                Add(key, sources[key] as string);
+            }
+        }
+
+        /// <summary>
+        /// Add a single entry to our internal store.
+        /// </summary>
+        /// <remarks><p>
+        /// Entries with keys that match the property names will be exposed. 
+        /// Other entries may be added, but can only be retrieved via Get.
+        /// </p></remarks>
+        /// <param name="key">ID for entry</param>
+        /// <param name="value">Content for entry</param>
+        /// 
+        public void Add(string key, string value)
+        {
+            _Value.Add(key, value);
+        }
+
+        /// <summary>
+        /// Provide the value corresponding to key from the internal store.
+        /// </summary>
+        /// <param name="key">ID for entry</param>
+        /// <returns>Content for entry</returns>
+        /// 
+        public string Get(string key)
+        {
+            return _Value[key] as string;
+        }
+
+        /// <summary>
+        /// Set an entry to the internal store, overwriting any existing entry.
+        /// </summary>
+        /// <remarks><p>
+        /// This is a protected method used by the Properties. 
+        /// Use an existing Property to set values, 
+        /// or extend the class to include other Properties. 
+        /// </p></remarks>
+        /// <param name="key"></param>
+        /// <param name="value"></param>
+        protected void Set(string key, string value)
+        {
+            _Value[key] = value;
+        }
+
+
+        /*
+        public string Property
+        {
+            get { return Get(App.PROPERTY); }
+            set { Set(App.PROPERTY, value); }
+        }
+        */
+
+        public string entry_key
+        {
+            get { return Get(App.ENTRY_KEY); }
+            set { Set(App.ENTRY_KEY, value); }
+        }
+
+        public string first_name
+        {
+            get { return Get(App.FIRST_NAME); }
+            set { Set(App.FIRST_NAME, value); }
+        }
+
+        public string last_name
+        {
+            get { return Get(App.LAST_NAME); }
+            set { Set(App.LAST_NAME, value); }
+        }
+
+        public string extension
+        {
+            get { return Get(App.EXTENSION); }
+            set { Set(App.EXTENSION, value); }
+        }
+
+        public string user_name
+        {
+            get { return Get(App.USER_NAME); }
+            set { Set(App.USER_NAME, value); }
+        }
+
+        public string hired
+        {
+            get { return Get(App.HIRED); }
+            set { Set(App.HIRED, value); }
+        }
+
+        public string hours
+        {
+            get { return Get(App.HOURS); }
+            set { Set(App.HOURS, value); }
+        }
+
+        public string editor
+        {
+            get { return Get(App.EDITOR); }
+            set { Set(App.EDITOR, value); }
+        }
+    }
+}
\ No newline at end of file

Added: struts/sandbox/trunk/overdrive/PhoneBook2/projects/Core/AppEntryList.cs
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/overdrive/PhoneBook2/projects/Core/AppEntryList.cs?view=auto&rev=491822
==============================================================================
--- struts/sandbox/trunk/overdrive/PhoneBook2/projects/Core/AppEntryList.cs (added)
+++ struts/sandbox/trunk/overdrive/PhoneBook2/projects/Core/AppEntryList.cs Tue Jan  2 07:58:43 2007
@@ -0,0 +1,28 @@
+using System.Collections;
+using Nexus.Core;
+
+namespace PhoneBook.Core
+{
+    /// <summary>
+    /// Implement Nexus.Core.IEntryList for AppEntry objects.
+    /// </summary>
+    /// 
+    public class AppEntryList : ArrayList, IEntryList
+    {
+        public object Insert(string key)
+        {
+            AppEntry entry = new AppEntry();
+            entry.entry_key = key;
+            Insert(0, entry);
+            return entry;
+        }
+
+        public void AddEntry(IDictionary row)
+        {
+            AppEntry entry = new AppEntry();
+            foreach (DictionaryEntry col in row)
+                entry.Add(col.Key.ToString(), col.Value.ToString());
+            Add(entry);
+        }
+    }
+}
\ No newline at end of file

Added: struts/sandbox/trunk/overdrive/PhoneBook2/projects/Core/AppEntryListProcessor.cs
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/overdrive/PhoneBook2/projects/Core/AppEntryListProcessor.cs?view=auto&rev=491822
==============================================================================
--- struts/sandbox/trunk/overdrive/PhoneBook2/projects/Core/AppEntryListProcessor.cs (added)
+++ struts/sandbox/trunk/overdrive/PhoneBook2/projects/Core/AppEntryListProcessor.cs Tue Jan  2 07:58:43 2007
@@ -0,0 +1,17 @@
+using Nexus.Core;
+using Nexus.Core.Validators;
+
+namespace PhoneBook.Core
+{
+	/// <summary>
+	/// Implement Nexus.Core.Validators.EntryListProcess for AppEntryList.
+	/// </summary>
+	/// 
+	public class AppEntryListProcessor : EntryListProcessor
+	{
+		public override IEntryList NewEntryList()
+		{
+			return new AppEntryList();
+		}
+	}
+}
\ No newline at end of file

Added: struts/sandbox/trunk/overdrive/PhoneBook2/projects/Core/AppUserProfile.cs
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/overdrive/PhoneBook2/projects/Core/AppUserProfile.cs?view=auto&rev=491822
==============================================================================
--- struts/sandbox/trunk/overdrive/PhoneBook2/projects/Core/AppUserProfile.cs (added)
+++ struts/sandbox/trunk/overdrive/PhoneBook2/projects/Core/AppUserProfile.cs Tue Jan  2 07:58:43 2007
@@ -0,0 +1,84 @@
+using System.Security.Principal;
+using System.Text;
+using Nexus.Core.Profile;
+
+namespace PhoneBook.Core
+{
+	/// <summary>
+	/// Extend UserProfile to include properties specific to this application, 
+	/// such as IsEditor.
+	/// </summary>
+	/// 
+	public class AppUserProfile : UserProfile
+	{
+		/// <summary>
+		/// Provide a field for IsEditor property.
+		/// </summary>
+		private bool _IsEditor = false;
+
+		/// <summary>
+		/// Indicate whether user has editing priveleges. 
+		/// </summary>
+		/// 
+		public bool IsEditor
+		{
+			get { return _IsEditor; }
+			set { _IsEditor = value; }
+		}
+
+		/// <summary>
+		/// Provide a field for Entry property.
+		/// </summary>
+		/// 
+		private AppEntry _Entry;
+
+
+		/// <summary>
+		/// Record directory entry for user.
+		/// </summary>
+		/// 
+		public AppEntry Entry
+		{
+			get { return _Entry; }
+			set
+			{
+				_Entry = value;
+				if (_Entry != null)
+				{
+					StringBuilder sb = new StringBuilder();
+					sb.Append(_Entry.first_name);
+					sb.Append(" ");
+					sb.Append(Entry.last_name);
+					FullName = sb.ToString().Trim();
+				}
+			}
+		}
+
+		/// <summary>
+		/// Provide a field for FullName property.
+		/// </summary>
+		/// 
+		private string _FullName;
+
+		/// <summary>
+		/// Record the user's full name (first and last names).
+		/// </summary>
+		/// 
+		public string FullName
+		{
+			get { return _FullName; }
+			set { _FullName = value; }
+		}
+
+		/// <summary>
+		/// Instantiate from an IIdentity.
+		/// </summary>
+		/// <param name="id">Identity to copy for this profile.</param>
+		/// 
+		public AppUserProfile(IIdentity id)
+		{
+			Principal = new UserPrincipal(id);
+		}
+
+	}
+}
\ No newline at end of file

Added: struts/sandbox/trunk/overdrive/PhoneBook2/projects/Core/Commands/AppCommand.cs
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/overdrive/PhoneBook2/projects/Core/Commands/AppCommand.cs?view=auto&rev=491822
==============================================================================
--- struts/sandbox/trunk/overdrive/PhoneBook2/projects/Core/Commands/AppCommand.cs (added)
+++ struts/sandbox/trunk/overdrive/PhoneBook2/projects/Core/Commands/AppCommand.cs Tue Jan  2 07:58:43 2007
@@ -0,0 +1,84 @@
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+using System;
+using IBatisNet.DataMapper;
+using Nexus.Core;
+
+namespace PhoneBook.Core.Commands
+{
+    /// <summary>
+    /// Extend RequestCommand with data access methods.
+    /// </summary>
+    /// 
+    public abstract class BaseMapper : RequestCommand
+    {
+        /// <summary>
+        /// Provide a field for Mapper property.
+        /// </summary>
+        /// 
+        private SqlMapper _Mapper;
+
+        /// <summary>
+        /// Expose a preconfigured SqlMapper instance that Commands can use to run statements.
+        /// </summary>
+        /// <remarks><p>
+        /// Commands use Mapper to invoke SqlMap statements, such as 
+        /// <code>
+        /// object row = Mapper.QueryForObject (QueryID, context);
+        /// </code>.
+        /// </p><p>
+        /// Any SqlMapper API method may be called. 
+        /// </p><p>
+        /// The default behavior of BAseNexusCommand is to use the 
+        /// command ID if the QueryID is null.
+        /// </p></remarks>
+        /// <returns>Preconfigured Mapper instance</returns>
+        /// 
+        public SqlMapper Mapper
+        {
+            get { return _Mapper; }
+            set { _Mapper = value; }
+
+        }
+
+        /// <summary>
+        /// Indicate whether string is null or zero length.
+        /// </summary>
+        /// <param name="input">Input to validate</param>
+        /// <returns>True if string is nyull or zero length</returns>
+        /// 
+        public bool IsEmpty(string input)
+        {
+            return ((input == null) || (input.Equals(String.Empty)));
+        }
+
+        /// <summary>
+        /// Create new Global Universal Identifer as a formatted string.
+        /// </summary>
+        /// <returns>String representing a new GUID</returns>
+        /// <remarks><p>
+        /// No two calls to this method will ever return duplicate strings.
+        /// </p></remarks>
+        /// 
+        public string GuidString()
+        {
+            Guid guid = Guid.NewGuid();
+            string gs = guid.ToString();
+            return gs;
+        }
+
+    }
+}
\ No newline at end of file

Added: struts/sandbox/trunk/overdrive/PhoneBook2/projects/Core/Commands/BaseCommand.cs
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/overdrive/PhoneBook2/projects/Core/Commands/BaseCommand.cs?view=auto&rev=491822
==============================================================================
--- struts/sandbox/trunk/overdrive/PhoneBook2/projects/Core/Commands/BaseCommand.cs (added)
+++ struts/sandbox/trunk/overdrive/PhoneBook2/projects/Core/Commands/BaseCommand.cs Tue Jan  2 07:58:43 2007
@@ -0,0 +1,163 @@
+using System;
+using System.Text;
+using Agility.Core;
+using IBatisNet.DataMapper;
+using Nexus.Core;
+using Spring.Objects.Factory;
+
+namespace PhoneBook.Core.Commands
+{
+	/// <summary>
+	/// Provide an abtract extension of BaseNexusCommand 
+	/// with shared members for WNE Commands, 
+	/// including a SqlMapper factory method.
+	/// </summary>
+	/// <remarks><p>
+	/// Superclasses must implement a NexusExecute method (inherited from BaseNexusCommand.
+	/// </p><p>
+	/// Concrete subclasses are expected to be created by a IOC Container, like Spring.NET. 
+	/// Most concrete subclasses will be "decorator" classes designed to behave 
+	/// differently based on what properties are set when the class is created. 
+	/// Others may be custom classes with predefined behaviors. 
+	/// </p><p>
+	/// The Spring catalog provides the versatility we need to mix-and-match 
+	/// base commands with custom commands, as needed, 
+	/// and call either from the client in exactly the same way.
+	/// </p><p>
+	/// NOTE that subclasses should NOT use the Outcome property of 
+	/// the Nexus context since they may be subcommands in a Chain. 
+	/// All BaseCommands should use the idiom 
+	/// <code>context[ID] = object</code>
+	/// to store output.
+	/// </p><p>
+	/// NOTE after using the ReShaper code reformatter, 
+	/// the Mapper method needs to be edited. 
+	/// ReSharper removes an absolute reference that we actually need. 
+	/// (Our Mapper method calls the IBatisNet Mapper method.)
+	/// The correct line of code is maintained as a comment, 
+	/// so that it can <b>copied</b> over the reformatted version. 
+	/// </p></remarks>
+	public abstract class BaseCommand : RequestCommand, IObjectNameAware
+	{
+		/// <summary>
+		/// If an ID is not provided, default to the ObjectName.
+		/// </summary>
+		public override string ID
+		{
+			get
+			{
+				string _ID = base.ID;
+				if (null == _ID) return ObjectName;
+				else return _ID;
+			}
+			set { base.ID = value; }
+		}
+
+		private string _ObjectName;
+
+		/// <summary>
+		/// Provide a field for the Spring object name (set by Spring).
+		/// </summary>
+		public string ObjectName
+		{
+			get { return _ObjectName; }
+			set { _ObjectName = value; }
+		}
+
+		/// <summary>
+		/// Provide a field for the Remark property.
+		/// </summary>
+		private string _Remark;
+
+		/// <summary>
+		/// Accept an arbitrary comment about a command 
+		/// -- more for use in the XML document.
+		/// </summary>
+		/// 
+		public string Remark
+		{
+			get { return _Remark; }
+			set { _Remark = value; }
+		}
+
+		/// <summary>
+		/// Provide a field for the Mapper property.
+		/// </summary>
+		/// 
+		private SqlMapper _Mapper;
+
+		/// <summary>
+		/// Expose a preconfigured SqlMapper instance that Commands can use to run statements.
+		/// </summary>
+		/// <remarks><p>
+		/// Commands use Mapper to invoke SqlMap statements, such as 
+		/// <code>
+		/// object row = Mapper ().QueryForObject (QueryID, context);
+		/// </code>.
+		/// </p><p>
+		/// Any SqlMapper API method may be called. 
+		/// </p><p>
+		/// The default behavior of BAseNexusCommand is to use the 
+		/// command ID if the QueryID is null.
+		/// </p></remarks>
+		/// <returns>Preconfigured Mapper</returns>
+		/// 
+		public SqlMapper Mapper
+		{
+			get { return _Mapper; }
+			set { _Mapper = value; }
+		}
+
+		/// <summary>
+		/// Indicate whether string is null or zero length.
+		/// </summary>
+		/// <param name="input">Input to validate</param>
+		/// <returns>True if string is nyull or zero length</returns>
+		/// 
+		protected bool IsEmpty(string input)
+		{
+			return ((input == null) || (input.Equals(String.Empty)));
+		}
+
+		/// <summary>
+		/// Create new Global Universal Identifer as a formatted string.
+		/// </summary>
+		/// <returns>String representing a new GUID</returns>
+		/// <remarks><p>
+		/// No two calls to this method will ever return duplicate strings.
+		/// </p></remarks>
+		/// 
+		protected string GuidString()
+		{
+			Guid guid = Guid.NewGuid();
+			string gs = guid.ToString();
+			return gs;
+		}
+
+		/// <summary>
+		/// Document the wildcard character used by SQL queries.
+		/// </summary>
+		public const string WILDCARD = "%";
+
+		/// <summary>
+		/// Prepare an attribute for use with a SQL wildcard ("LIKE") operation.
+		/// </summary>
+		/// <remarks><p>
+		/// A wildcard is prepended and appended for a full, scan-across match, 
+		/// so that the string will found in any part of the field.
+		/// </p></remarks>
+		/// <param name="context">Context with attribute to escape</param>
+		/// <param name="id">Name of attribute to escape</param>
+		protected void LikeMe(IContext context, string id)
+		{
+			string param = context[id] as string;
+			if (null != param)
+			{
+				StringBuilder sb = new StringBuilder(WILDCARD);
+				sb.Append(param);
+				sb.Append(WILDCARD);
+				context[id] = sb.ToString();
+			}
+		}
+	}
+}
\ No newline at end of file

Added: struts/sandbox/trunk/overdrive/PhoneBook2/projects/Core/Commands/BaseCount.cs
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/overdrive/PhoneBook2/projects/Core/Commands/BaseCount.cs?view=auto&rev=491822
==============================================================================
--- struts/sandbox/trunk/overdrive/PhoneBook2/projects/Core/Commands/BaseCount.cs (added)
+++ struts/sandbox/trunk/overdrive/PhoneBook2/projects/Core/Commands/BaseCount.cs Tue Jan  2 07:58:43 2007
@@ -0,0 +1,17 @@
+using Nexus.Core;
+
+namespace PhoneBook.Core.Commands
+{
+	/// <summary>
+	/// Invoke a query that returns the count of a result set.
+	/// </summary>
+	public class BaseCount : BaseMapper
+	{
+		public override bool RequestExecute(IRequestContext context)
+		{
+			object result = Mapper.QueryForObject(QueryID, context);
+			context[App.ITEM_COUNT] = result;
+			return CONTINUE;
+		}
+	}
+}
\ No newline at end of file

Added: struts/sandbox/trunk/overdrive/PhoneBook2/projects/Core/Commands/BaseEntry.cs
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/overdrive/PhoneBook2/projects/Core/Commands/BaseEntry.cs?view=auto&rev=491822
==============================================================================
--- struts/sandbox/trunk/overdrive/PhoneBook2/projects/Core/Commands/BaseEntry.cs (added)
+++ struts/sandbox/trunk/overdrive/PhoneBook2/projects/Core/Commands/BaseEntry.cs Tue Jan  2 07:58:43 2007
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+using System.Collections;
+using Nexus.Core;
+
+namespace PhoneBook.Core.Commands
+{
+	/// <summary>
+	/// Execute database statement indicated by QueryID 
+	/// for a single object, 
+	/// returning each attribute in the main context.
+	/// </summary>
+	/// 
+	public class BaseEntry : BaseMapper
+	{
+		public override bool RequestExecute(IRequestContext context)
+		{
+			object o = Mapper.QueryForObject(QueryID, context);
+			context[ID] = o;
+			IDictionary entry = o as IDictionary;
+			foreach (DictionaryEntry e in entry)
+			{
+				context[e.Key] = e.Value;
+			}
+			return CONTINUE;
+		}
+	}
+}
\ No newline at end of file

Added: struts/sandbox/trunk/overdrive/PhoneBook2/projects/Core/Commands/BaseFilterList.cs
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/overdrive/PhoneBook2/projects/Core/Commands/BaseFilterList.cs?view=auto&rev=491822
==============================================================================
--- struts/sandbox/trunk/overdrive/PhoneBook2/projects/Core/Commands/BaseFilterList.cs (added)
+++ struts/sandbox/trunk/overdrive/PhoneBook2/projects/Core/Commands/BaseFilterList.cs Tue Jan  2 07:58:43 2007
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+using System.Collections;
+using Nexus.Core;
+
+namespace PhoneBook.Core.Commands
+{
+	/// <summary>
+	/// Execute database statement indicated by QueryID 
+	/// and wrap result in KeyValue objects 
+	/// so that lists can be displayed by standard methods.
+	/// </summary>
+	/// 
+	public class BaseFilterList : BaseMapper
+	{
+		public override bool RequestExecute(IRequestContext context)
+		{
+			IList rows = Mapper.QueryForList(QueryID, null);
+			IKeyValueList list = new KeyValueList();
+			foreach (object key in rows)
+			{
+				list.Add(new KeyValue(key.ToString(), key));
+			}
+			context[ID] = list;
+			return CONTINUE;
+		}
+	}
+}
\ No newline at end of file

Added: struts/sandbox/trunk/overdrive/PhoneBook2/projects/Core/Commands/BaseList.cs
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/overdrive/PhoneBook2/projects/Core/Commands/BaseList.cs?view=auto&rev=491822
==============================================================================
--- struts/sandbox/trunk/overdrive/PhoneBook2/projects/Core/Commands/BaseList.cs (added)
+++ struts/sandbox/trunk/overdrive/PhoneBook2/projects/Core/Commands/BaseList.cs Tue Jan  2 07:58:43 2007
@@ -0,0 +1,122 @@
+using System;
+using System.Collections;
+using Nexus.Core;
+using PhoneBook.Core;
+
+namespace PhoneBook.Core.Commands
+{
+	/// <summary>
+	/// Run the select query indicated by QueryID, 
+	/// first escaping any LikeIDs and extending any date ranges,
+	/// and return the result as an IList, 
+	/// </summary>
+	public class BaseList : BaseCommand
+	{
+		private IList _LikeIDs = null;
+
+		/// <summary>
+		/// Names of key fields to escape for a "like" search.
+		/// </summary>
+		public IList LikeIDs
+		{
+			get { return _LikeIDs; }
+			set { _LikeIDs = value; }
+		}
+
+		/// <summary>
+		/// Generate an array from the IDs.
+		/// </summary>
+		/// <returns>Array of LikeIDs</returns>
+		protected string[] GetArray(string IDs)
+		{
+			string csv = IDs;
+			bool noLike = ((null == csv) || (string.Empty.Equals(csv)));
+			if (noLike)
+				return new string[0];
+			else
+			{
+				string[] _Array = csv.Split(',');
+				return _Array;
+			}
+		}
+
+		/// <summary>
+		/// Document the last second of the day 
+		/// so as to calculate values for concepts like today and tomorrow.
+		/// </summary>
+		private string LAST_TICK = " 23:59";
+
+		/// <summary>
+		/// If ThruDate is set to the minimum time (00:00), 
+		/// set to the maximum time instead (23:59). 
+		/// </summary>
+		/// <param name="context"></param>
+		private void ExtendThruDate(IRequestContext context)
+		{
+			bool have = context.Contains(App.THRU_DATE);
+			if (!have) return;
+			DateTime thruDate = DateTime.MinValue;
+			try
+			{
+				thruDate = (DateTime) context[App.THRU_DATE];
+			}
+			catch (Exception e)
+			{
+				if (e != null) return; // Placate Resharper
+			}
+			bool defaultTime = (thruDate.Hour == 0) && (thruDate.Minute == 0) && (thruDate.Second == 0) &&
+				(thruDate.Millisecond == 0);
+			if (defaultTime)
+			{
+				string strThruDate = thruDate.ToShortDateString() + LAST_TICK;
+				DateTime newThruDate = Convert.ToDateTime(strThruDate);
+				context.Remove(App.THRU_DATE);
+				context.Add(App.THRU_DATE, newThruDate);
+			}
+		}
+
+		/// <summary>
+		/// Prepare special attributes for the query.
+		/// </summary>
+		/// <param name="context">The context we are processing</param>
+		protected void PreProcess(IRequestContext context)
+		{
+			// Escape any "like" fields
+			IList likes = LikeIDs;
+			if (likes != null)
+			{
+				IEnumerator e = likes.GetEnumerator();
+				while (e.MoveNext())
+					LikeMe(context, e.Current as string);
+			}
+
+			// Extend any "thru_date" to midnight
+			ExtendThruDate(context);
+
+			// Ensure that list_item and list_offset are numeric
+			object limit = context[App.ITEM_LIMIT];
+			if (limit != null)
+			{
+				context[App.ITEM_LIMIT] = Convert.ToInt32(limit);
+				object offset = context[App.ITEM_OFFSET];
+				context[App.ITEM_OFFSET] = Convert.ToInt32(offset);
+			}
+		}
+
+		/// <summary>
+		/// Provide a default, convenience implementation that will run a "QueryForList" 
+		/// using a data mapping statement of the same ID as the Command; 
+		/// override as needed.
+		/// </summary>
+		/// <param name="context">The INexusContext we are processing.</param>
+		/// <returns>CONTINUE, if an Exception is not thrown.</returns>
+		public override bool RequestExecute(IRequestContext context)
+		{
+			PreProcess(context);
+
+			IList rows = Mapper.QueryForList(QueryID, context);
+			context[ID] = rows;
+			return CONTINUE;
+		}
+	}
+}
\ No newline at end of file

Added: struts/sandbox/trunk/overdrive/PhoneBook2/projects/Core/Commands/BaseSave.cs
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/overdrive/PhoneBook2/projects/Core/Commands/BaseSave.cs?view=auto&rev=491822
==============================================================================
--- struts/sandbox/trunk/overdrive/PhoneBook2/projects/Core/Commands/BaseSave.cs (added)
+++ struts/sandbox/trunk/overdrive/PhoneBook2/projects/Core/Commands/BaseSave.cs Tue Jan  2 07:58:43 2007
@@ -0,0 +1,92 @@
+using Nexus.Core;
+
+namespace PhoneBook.Core.Commands
+{
+	/// <summary>
+	/// Store an entity for future reference.
+	/// </summary>
+	/// 
+	public class BaseSave : BaseMapper
+	{
+		/// <summary>
+		/// Provide a field for KeyID property.
+		/// </summary>
+		/// 
+		private string _KeyID = null;
+
+		/// <summary>
+		/// Record the unique identifier for the entity.
+		/// </summary>
+		/// 
+		public string KeyID
+		{
+			get { return _KeyID; }
+			set { _KeyID = value; }
+		}
+
+		/// <summary>
+		/// Provide a field for InsertID property.
+		/// </summary>
+		private string _InsertID = null;
+
+		/// <summary>
+		/// Record the name of the "insert" mapping for the entity.
+		/// </summary>
+		/// 
+		public string InsertID
+		{
+			get { return _InsertID; }
+			set { _InsertID = value; }
+		}
+
+		/// <summary>
+		/// Provide a field for UpdateID property.
+		/// </summary>
+		/// 
+		private string _UpdateID = null;
+
+		/// <summary>
+		/// Record the name of the "update" mapping for the entity.
+		/// </summary>
+		/// 
+		public string UpdateID
+		{
+			get { return _UpdateID; }
+			set { _UpdateID = value; }
+		}
+
+		/// <summary>
+		/// Insert or update an entity to the persistent store. 
+		/// </summary>
+		/// <remark><p>
+		/// If the "fieldID" is empty, use the insertID statement, 
+		/// otherwise, use the updateID statement.
+		/// </p></remark>
+		/// <param name="context">The INexusContext we are processing.</param>
+		/// <param name="fieldID">The name of the key field.</param>
+		/// <param name="insertID">The name of the "insert" mapping for the Entity.</param>
+		/// <param name="updateID">The name of the "update" mapping for the Entity.</param>
+		/// <returns>False</returns>
+		/// 
+		protected bool Save(IRequestContext context, string fieldID, string insertID, string updateID)
+		{
+			bool insert = IsEmpty(context[fieldID] as string);
+
+			if (insert)
+			{
+				context[fieldID] = GuidString();
+				Mapper.Insert(insertID, context);
+			}
+			else
+				Mapper.Update(updateID, context);
+
+			return CONTINUE;
+		}
+
+		public override bool RequestExecute(IRequestContext context)
+		{
+			return Save(context, KeyID, InsertID, UpdateID);
+		}
+
+	}
+}
\ No newline at end of file

Added: struts/sandbox/trunk/overdrive/PhoneBook2/projects/Core/Commands/EntryInitial.cs
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/overdrive/PhoneBook2/projects/Core/Commands/EntryInitial.cs?view=auto&rev=491822
==============================================================================
--- struts/sandbox/trunk/overdrive/PhoneBook2/projects/Core/Commands/EntryInitial.cs (added)
+++ struts/sandbox/trunk/overdrive/PhoneBook2/projects/Core/Commands/EntryInitial.cs Tue Jan  2 07:58:43 2007
@@ -0,0 +1,46 @@
+using System.Collections;
+using Nexus.Core;
+
+namespace PhoneBook.Core.Commands
+{
+	/// <summary>
+	/// Create list of initial letters for Facility Names.
+	/// </summary>
+	public class EntryInitial : BaseMapper
+	{
+		/// <summary>
+		/// Document token representing match all entries.
+		/// </summary>
+		public const string ALL = "[*]";
+
+		/// <summary>
+		/// Document the wildcard character used by SQL queries.
+		/// </summary>
+		public const string WILDCARD = "%";
+
+		public override bool RequestExecute(IRequestContext context)
+		{
+			const string ZERO = "0";
+
+			string[] input = {
+				"A", "B", "C", "D", "E", "F", "G", "H", "I", "J",
+				"K", "L", "M", "N", "O", "P", "Q", "R", "S", "T",
+				"U", "V", "W", "X", "Y", "Z"
+			};
+
+			IList output = new ArrayList(26);
+
+			foreach (string letter in input)
+			{
+				string initial = letter + WILDCARD;
+				object result = Mapper.QueryForObject(QueryID, initial);
+				if (ZERO.Equals(result)) continue;
+				output.Add(letter);
+			}
+
+			output.Add(ALL);
+			context.Outcome = output;
+			return CONTINUE;
+		}
+	}
+}
\ No newline at end of file

Modified: struts/sandbox/trunk/overdrive/PhoneBook2/projects/Core/Core.csproj
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/overdrive/PhoneBook2/projects/Core/Core.csproj?view=diff&rev=491822&r1=491821&r2=491822
==============================================================================
--- struts/sandbox/trunk/overdrive/PhoneBook2/projects/Core/Core.csproj (original)
+++ struts/sandbox/trunk/overdrive/PhoneBook2/projects/Core/Core.csproj Tue Jan  2 07:58:43 2007
@@ -7,8 +7,8 @@
     <ProjectGuid>{F65FCC91-C9CB-40CE-87A6-C0CB00F73592}</ProjectGuid>
     <OutputType>Library</OutputType>
     <AppDesignerFolder>Properties</AppDesignerFolder>
-    <RootNamespace>PhoneBook2.Core</RootNamespace>
-    <AssemblyName>PhoneBook2.Core</AssemblyName>
+    <RootNamespace>PhoneBook.Core</RootNamespace>
+    <AssemblyName>PhoneBook.Core</AssemblyName>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
     <DebugSymbols>true</DebugSymbols>
@@ -28,13 +28,46 @@
     <WarningLevel>4</WarningLevel>
   </PropertyGroup>
   <ItemGroup>
+    <Reference Include="Agility.Core, Version=1.0.2355.25640, Culture=neutral">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\local-cache\Agility\Agility.Core.dll</HintPath>
+    </Reference>
+    <Reference Include="IBatisNet.DataMapper, Version=1.5.1.0, Culture=neutral, PublicKeyToken=ed781d9fc396c6ca, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\local-cache\iBatisNet\IBatisNet.DataMapper.dll</HintPath>
+    </Reference>
+    <Reference Include="Nexus.Core, Version=1.0.2539.22197, Culture=neutral">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\local-cache\Nexus\Nexus.Core.dll</HintPath>
+    </Reference>
+    <Reference Include="Spring.Core, Version=1.1.0.2, Culture=neutral, PublicKeyToken=65e474d141e25e07, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\local-cache\SpringNet\Spring.Core.dll</HintPath>
+    </Reference>
     <Reference Include="System" />
     <Reference Include="System.Data" />
     <Reference Include="System.Xml" />
   </ItemGroup>
   <ItemGroup>
-    <Compile Include="Class1.cs" />
+    <Compile Include="App.cs" />
+    <Compile Include="AppEntry.cs" />
+    <Compile Include="AppEntryList.cs" />
+    <Compile Include="AppEntryListProcessor.cs" />
+    <Compile Include="Commands\AppCommand.cs" />
+    <Compile Include="Commands\BaseCommand.cs" />
+    <Compile Include="Commands\BaseCount.cs" />
+    <Compile Include="Commands\BaseEntry.cs" />
+    <Compile Include="Commands\BaseFilterList.cs" />
+    <Compile Include="Commands\BaseList.cs" />
+    <Compile Include="Commands\BaseSave.cs" />
+    <Compile Include="Commands\EntryInitial.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />
+    <Compile Include="TelephoneProcessor.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <EmbeddedResource Include="Messages.resx">
+      <SubType>Designer</SubType>
+    </EmbeddedResource>
   </ItemGroup>
   <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
   <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 

Modified: struts/sandbox/trunk/overdrive/PhoneBook2/projects/Core/Core.csproj.user
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/overdrive/PhoneBook2/projects/Core/Core.csproj.user?view=diff&rev=491822&r1=491821&r2=491822
==============================================================================
--- struts/sandbox/trunk/overdrive/PhoneBook2/projects/Core/Core.csproj.user (original)
+++ struts/sandbox/trunk/overdrive/PhoneBook2/projects/Core/Core.csproj.user Tue Jan  2 07:58:43 2007
@@ -1,5 +1,5 @@
 <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
   <PropertyGroup>
-    <ProjectView>ShowAllFiles</ProjectView>
+    <ProjectView>ProjectFiles</ProjectView>
   </PropertyGroup>
 </Project>

Added: struts/sandbox/trunk/overdrive/PhoneBook2/projects/Core/Messages.resx
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/overdrive/PhoneBook2/projects/Core/Messages.resx?view=auto&rev=491822
==============================================================================
--- struts/sandbox/trunk/overdrive/PhoneBook2/projects/Core/Messages.resx (added)
+++ struts/sandbox/trunk/overdrive/PhoneBook2/projects/Core/Messages.resx Tue Jan  2 07:58:43 2007
@@ -0,0 +1,129 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<root>
+	<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+		<xsd:element name="root" msdata:IsDataSet="true">
+			<xsd:complexType>
+				<xsd:choice maxOccurs="unbounded">
+					<xsd:element name="data">
+						<xsd:complexType>
+							<xsd:sequence>
+								<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+								<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+							</xsd:sequence>
+							<xsd:attribute name="name" type="xsd:string" />
+							<xsd:attribute name="type" type="xsd:string" />
+							<xsd:attribute name="mimetype" type="xsd:string" />
+						</xsd:complexType>
+					</xsd:element>
+					<xsd:element name="resheader">
+						<xsd:complexType>
+							<xsd:sequence>
+								<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+							</xsd:sequence>
+							<xsd:attribute name="name" type="xsd:string" use="required" />
+						</xsd:complexType>
+					</xsd:element>
+				</xsd:choice>
+			</xsd:complexType>
+		</xsd:element>
+	</xsd:schema>
+	<resheader name="ResMimeType">
+		<value>text/microsoft-resx</value>
+	</resheader>
+	<resheader name="Version">
+		<value>1.0.0.0</value>
+	</resheader>
+	<resheader name="Reader">
+		<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+	</resheader>
+	<resheader name="Writer">
+		<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+	</resheader>
+	
+	<data name="page_index_hint">
+		<value>Viewing {0}-{1} of {2}.</value>
+	</data>	
+
+    <!-- command labels -->
+
+    <data name="find">
+      <value>LIST ALL</value>
+    </data>
+
+    <data name="add">
+      <value>ADD</value>
+    </data>
+
+    <!-- field alerts -->
+
+    <data name="_alert">
+		<value>{0} is invalid.</value>
+	</data>
+
+    <data name="_required">
+		<value>{0} is required.</value>
+	</data>
+    
+	<data name="DateTimeProcessor_alert">
+		<value>{0} must be a valid date.</value>
+	</data>
+	
+	<data name="TelephoneProcessor_alert">
+		<value>{0} must be a telephone extension.</value>
+	</data>
+		
+
+	<!-- field labels -->    
+        
+    <data name="last_name_label">
+      <value>Last Name</value>
+    </data>
+    
+    <data name="first_name_label">
+      <value>First Name</value>
+    </data>
+
+    <data name="extension_label">
+      <value>Extension</value>
+    </data>
+
+    <data name="user_name_label">
+      <value>User Name</value>
+    </data>
+
+    <data name="hired_label">
+      <value>Hired</value>
+    </data>
+	
+    <data name="hours_label">
+      <value>Hours</value>
+    </data>
+	
+    <data name="editor_label">
+      <value>Editor?</value>
+    </data>
+    
+
+	<!-- prompts -->
+	
+	<data name="greeting">
+		<value>Welcome, </value>
+	</data>
+
+    <data name="directory_title">
+      <value>Directory (2)</value>
+    </data>
+    
+    <data name="directory_heading">
+     <value>Directory</value>
+    </data>
+        
+    <data name="directory_prompt">
+	  <value>Select a filter to display fewer entries</value>
+    </data>
+    
+	<data name="not_found_hint">
+		<value>No matching entries found.</value>
+	</data>
+
+</root>

Added: struts/sandbox/trunk/overdrive/PhoneBook2/projects/Core/TelephoneProcessor.cs
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/overdrive/PhoneBook2/projects/Core/TelephoneProcessor.cs?view=auto&rev=491822
==============================================================================
--- struts/sandbox/trunk/overdrive/PhoneBook2/projects/Core/TelephoneProcessor.cs (added)
+++ struts/sandbox/trunk/overdrive/PhoneBook2/projects/Core/TelephoneProcessor.cs Tue Jan  2 07:58:43 2007
@@ -0,0 +1,65 @@
+using System.Text;
+using Nexus.Core.Validators;
+
+namespace PhoneBook.Core
+{
+	/// <summary>
+	/// Remove punctuation on input and insert punctuation on output.
+	/// </summary>
+	/// <remarks><p>
+	/// Null input or output is passed thorugh as null. 
+	/// Non-null input or output must be strings.
+	/// Output is formatted for local or long distane US telephone numbers. 
+	/// Output strings that are too short or too long are passed through.
+	/// </p></remarks>
+	public class TelephoneProcessor : Processor
+	{
+		public override bool ConvertInput(IProcessorContext incoming)
+		{
+			object source = incoming.Source;
+			if (source == null) return true;
+
+			string input = source as string;
+			if (input == null) return false;
+
+			char[] marks = {'-'};
+			string[] splits = input.Split(marks);
+			StringBuilder sb = new StringBuilder(input.Length);
+			foreach (string s in splits)
+			{
+				sb.Append(s);
+			}
+			incoming.Target = sb.ToString();
+			return true;
+		}
+
+		public override bool FormatOutput(IProcessorContext outgoing)
+		{
+			object source = outgoing.Source;
+			if (source == null) return true;
+
+			string output = source as string;
+			if (output == null) return false;
+
+			string mark = "-";
+			if (output == null) return false;
+			string buffer = null;
+
+			if (output.Length == 10)
+			{
+				// 012-345-6789
+				string buffer1 = output.Insert(6, mark);
+				buffer = buffer1.Insert(3, mark);
+			}
+			else if (output.Length == 7)
+			{
+				// 012-3456
+				buffer = output.Insert(3, mark);
+			}
+			else buffer = output;
+
+			outgoing.Target = buffer;
+			return true;
+		}
+	}
+}
\ No newline at end of file

Added: struts/sandbox/trunk/overdrive/PhoneBook2/projects/Test/BaseTest.cs
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/overdrive/PhoneBook2/projects/Test/BaseTest.cs?view=auto&rev=491822
==============================================================================
--- struts/sandbox/trunk/overdrive/PhoneBook2/projects/Test/BaseTest.cs (added)
+++ struts/sandbox/trunk/overdrive/PhoneBook2/projects/Test/BaseTest.cs Tue Jan  2 07:58:43 2007
@@ -0,0 +1,73 @@
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+using System;
+using System.Collections;
+using Nexus.Core;
+using NUnit.Framework;
+
+namespace PhoneBook.Core
+{
+	/// <summary>
+	/// Provide base class so unit tests can share utility.
+	/// </summary>
+	/// 
+	[TestFixture]
+	public class BaseTest : CatalogBaseTest
+	{
+		/// <summary>
+		/// Confirm that the outcome is a non-null, non-empty list.
+		/// </summary>
+		/// <param name="context">Context to confirm</param>
+		/// <returns>The non-null, non-empty list</returns>
+		/// 
+		protected IList AssertListOutcome(IRequestContext context)
+		{
+			AssertNominal(context);
+			Assert.IsTrue(context.HasOutcome, "Expected command to set an Outcome.");
+			IList list = context.Outcome as IList;
+			bool notEmpty = ((list != null) && (list.Count > 0));
+			Assert.IsTrue(notEmpty, "Expected outcome to be a not-empty list");
+			return list;
+		}
+
+		/// <summary>
+		/// Exercise the testing infrastructure.
+		/// </summary>
+		/// 
+		[Test]
+		public void Pass()
+		{
+		}
+
+		/// <summary>
+		/// Exercise GUID creation, 
+		/// and provide a device for generating GUIDs if needed.
+		/// </summary>
+		/// 
+		[Test]
+		public void GuidString()
+		{
+			IDictionary test = new Hashtable();
+			for (int i = 0; i < 10; i++)
+			{
+				string key = Guid.NewGuid().ToString();
+				Assert.IsNotNull(key);
+				Assert.IsTrue(36 == key.Length);
+				test.Add(key, key); // Add throws an exception on duplicate keys
+			}
+		}
+	}
+}
\ No newline at end of file

Added: struts/sandbox/trunk/overdrive/PhoneBook2/projects/Test/Commands/DirectoryViewTest.cs
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/overdrive/PhoneBook2/projects/Test/Commands/DirectoryViewTest.cs?view=auto&rev=491822
==============================================================================
--- struts/sandbox/trunk/overdrive/PhoneBook2/projects/Test/Commands/DirectoryViewTest.cs (added)
+++ struts/sandbox/trunk/overdrive/PhoneBook2/projects/Test/Commands/DirectoryViewTest.cs Tue Jan  2 07:58:43 2007
@@ -0,0 +1,43 @@
+using Nexus.Core;
+using Nexus.Core.Helpers;
+using NUnit.Framework;
+
+namespace PhoneBook.Core.Commands
+{
+	/// <summary>
+	/// Exercise Directory View Command.
+	/// </summary>
+	/// 
+	[TestFixture]
+	public class EntryFindTest : BaseTest
+	{
+		/// <summary>
+		/// Confirm that Context contains the expected attributes for the list filter-0ps.
+		/// </summary>
+		/// 
+		[Test]
+		public void ContainsFilters()
+		{
+			IRequestContext context = catalog.ExecuteRequest(App.ENTRY_FIND);
+			this.AssertNominal(context);
+			string[] FILTERS = {App.LAST_NAME_LIST, App.FIRST_NAME_LIST, App.EXTENSION_LIST, App.USER_NAME_LIST, App.HIRED_LIST, App.HOURS_LIST};
+			foreach (string filter in FILTERS)
+			{
+				Assert.IsTrue(context.Contains(filter), filter + ": Expected context to contain key.");
+			}
+		}
+
+		/// <summary>
+		/// Confirm that Helper contains the expected command.
+		/// </summary>
+		/// 
+		[Test]
+		public void HelperContains()
+		{
+			IViewHelper helper = catalog.GetHelperFor(App.ENTRY_FIND);
+			IRequestCommand command = helper.Command;
+			Assert.IsNotNull(command, "Expected Helper to have a Command");
+			Assert.AreEqual(App.ENTRY_FIND, command.ID, "Expected Helper to have View Command.");
+		}
+	}
+}
\ No newline at end of file

Added: struts/sandbox/trunk/overdrive/PhoneBook2/projects/Test/Commands/FilterLists.cs
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/overdrive/PhoneBook2/projects/Test/Commands/FilterLists.cs?view=auto&rev=491822
==============================================================================
--- struts/sandbox/trunk/overdrive/PhoneBook2/projects/Test/Commands/FilterLists.cs (added)
+++ struts/sandbox/trunk/overdrive/PhoneBook2/projects/Test/Commands/FilterLists.cs Tue Jan  2 07:58:43 2007
@@ -0,0 +1,150 @@
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+using System;
+using System.Collections;
+using Nexus.Core;
+using Nexus.Core.Helpers;
+using NUnit.Framework;
+
+namespace PhoneBook.Core.Commands
+{
+	/// <summary>
+	/// Exercise the various lists of distinct values 
+	/// that are used to filter the directory.
+	/// </summary>
+	/// 
+	[TestFixture]
+	public class FilterListsTest : BaseTest
+	{
+		/// <summary>
+		/// Confirm that a list is returned as the outcome, 
+		/// and that each item on the list is not-empty and unique.
+		/// </summary>
+		/// <param name="context">Context returned by command</param>
+		/// 
+		private void FilterList_Result(IRequestContext context)
+		{
+			IList list = AssertListOutcome(context);
+			foreach (IKeyValue item in list)
+			{
+				Assert.IsNotNull(item, "Expected each item to be non-null");
+				object key = item.Value;
+				Assert.IsNotNull(key, "Expected each key to be non-null");
+				string keystring = key.ToString();
+				Assert.IsTrue(keystring.Length > 0, "Expected each key to be non-empty");
+			}
+			IDictionary keys = new Hashtable(list.Count);
+			foreach (IKeyValue item in list)
+			{
+				string key = item.Value.ToString();
+				if (keys.Contains(key)) Assert.Fail(key + ": Expected each item to be unique");
+				keys.Add(key, key);
+			}
+		}
+
+		/// <summary>
+		/// Exercise the filter commands.
+		/// </summary>
+		/// 
+		[Test]
+		public void TestFilterLists()
+		{
+			string[] FILTERS = {App.LAST_NAME_LIST, App.FIRST_NAME_LIST, App.EXTENSION_LIST, App.USER_NAME_LIST, App.HIRED_LIST, App.HOURS_LIST};
+			foreach (string filter in FILTERS)
+			{
+				IRequestContext context = catalog.ExecuteRequest(filter);
+				FilterList_Result(context);
+			}
+		}
+
+		/// <summary>
+		/// Excercise entry file and validate key value list.
+		/// </summary>
+		/// <param name="key">ID for list</param>
+		/// <returns>The validated list</returns>
+		/// 
+		private IKeyValueList FilterList(string key)
+		{
+			IViewHelper helper = catalog.GetHelperFor(App.ENTRY_FIND);
+			helper.Execute();
+			IKeyValueList list = helper.Criteria[key] as IKeyValueList;
+			Assert.IsNotNull(list, "Expected KeyValueList");
+			return list;
+		}
+
+		/// <summary>
+		/// Exercise Extension List filter.
+		/// </summary>
+		/// 
+		[Test]
+		public void TestFilterFormat_extension()
+		{
+			IKeyValueList list = FilterList(App.EXTENSION_LIST);
+			foreach (IKeyValue item in list)
+			{
+				string key = item.Value as string;
+				Assert.IsTrue(key.Length > "1234567890".Length, "Expected formatted extension, not: " + key);
+			}
+		}
+
+		/// <summary>
+		/// Exercise Hired filter.
+		/// </summary>
+		/// 
+		[Test]
+		public void TestFilterFormat_hired()
+		{
+			IKeyValueList list = FilterList(App.HIRED_LIST);
+			foreach (IKeyValue item in list)
+			{
+				string key = item.Value as string;
+				bool okay = (key.Length > 0) && (key.Length < "##/##/#### ".Length);
+				Assert.IsTrue(okay, "Expected short date format, not: " + key);
+			}
+		}
+
+		[Test]
+		public void Initial()
+		{
+			IViewHelper helper = catalog.GetHelperFor(App.ENTRY_LIST);
+			helper.Criteria["initial"] = "C%";
+			helper.Execute();
+			Assert.IsTrue(helper.IsNominal, helper.AlertsText);
+			IList list = helper.Outcome;
+			Assert.IsTrue(list.Count > 0, "Expected one or more entries");
+			foreach (AppEntry entry in list)
+			{
+				Assert.IsTrue("C".Equals(entry.last_name.Substring(0, 1)), "Expected all to be C*");
+			}
+			int count = Convert.ToInt32(helper.Criteria["item_count"]);
+			Assert.IsTrue(count == list.Count, "Expected counts to match");
+		}
+
+		[Test]
+		public void InitialDistinct()
+		{
+			IViewHelper helper = catalog.GetHelperFor(App.ENTRY_INITIAL);
+			helper.Execute();
+			Assert.IsTrue(helper.IsNominal, helper.AlertsText);
+			IList list = helper.Outcome;
+			Assert.IsTrue(list.Count > 0, "Expected one or more entries");
+			string a = list[0] as string;
+			Assert.IsNotNull(a, "Expected letter");
+			Assert.IsTrue("C".Equals(a), "Expected C");
+		}
+
+	}
+}
\ No newline at end of file

Added: struts/sandbox/trunk/overdrive/PhoneBook2/projects/Test/Commands/SelectAllTest.cs
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/overdrive/PhoneBook2/projects/Test/Commands/SelectAllTest.cs?view=auto&rev=491822
==============================================================================
--- struts/sandbox/trunk/overdrive/PhoneBook2/projects/Test/Commands/SelectAllTest.cs (added)
+++ struts/sandbox/trunk/overdrive/PhoneBook2/projects/Test/Commands/SelectAllTest.cs Tue Jan  2 07:58:43 2007
@@ -0,0 +1,113 @@
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+using System;
+using System.Collections;
+using Nexus.Core;
+using Nexus.Core.Helpers;
+using NUnit.Framework;
+
+namespace PhoneBook.Core.Commands
+{
+	/// <summary>
+	/// Exercise SelectAll Command per [OVR-5].
+	/// </summary>
+	/// 
+	[TestFixture]
+	public class SelectAllTest : BaseTest
+	{
+		/// <summary>
+		/// Assert result of SelectAll, after another method runs the command.
+		/// </summary>
+		/// <param name="context">Context with result to assert.</param>	
+		/// 	
+		private void SelectAll_Result(IRequestContext context)
+		{
+			IList list = AssertListOutcome(context);
+			IDictionary row = list[0] as IDictionary;
+			Assert.IsNotNull(row, "Expected list entry to be an IDictionary.");
+			string[] KEYS = {App.FIRST_NAME, App.LAST_NAME, App.USER_NAME, App.EXTENSION, App.HIRED, App.HOURS, App.EDITOR};
+			bool valid = true;
+			foreach (string key in KEYS)
+			{
+				valid = valid && row.Contains(key);
+			}
+			Assert.IsTrue(valid, "Expected row to contain all keys.");
+		}
+
+
+		/// <summary>
+		/// Filter all and succeed, using catalog.
+		/// </summary>
+		/// 
+		[Test]
+		public void SelectAll_Pass()
+		{
+			IRequestContext context = catalog.ExecuteRequest(App.ENTRY_LIST);
+			SelectAll_Result(context);
+		}
+
+		/// <summary>
+		/// Exercise Entry List and validate hired and extension string formatting.
+		/// </summary>
+		/// 
+		[Test]
+		public void FilterHelper_Format()
+		{
+			IViewHelper helper = catalog.GetHelperFor(App.ENTRY_LIST);
+			helper.Execute();
+			AssertNominal(helper);
+			AppEntryList list = helper.Outcome as AppEntryList;
+			Assert.IsNotNull(list, "Expected list to be AppEntryList");
+			AppEntry row = list[0] as AppEntry;
+			Assert.IsNotNull(row, "Expected rows to be AppEntries");
+
+			string hired = row.hired;
+			Assert.IsNotNull(hired, "Expected each row to have a hired date.");
+			Assert.IsTrue(hired.Length < "##/##/#### ".Length, hired + ": Expected short date format.");
+
+			string extension = row.extension;
+			Assert.IsNotNull(extension, "Expected each row to have an extension.");
+			Assert.IsTrue(extension.Length > "1234567890".Length, extension + ": Expected formatted extension.");
+		}
+
+		/// <summary>
+		/// Exercise custom paging 
+		/// (retrieve only visible section of the result se).
+		/// </summary>
+		/// 
+		[Test]
+		public void SelectAll_Limit()
+		{
+			IViewHelper helper = catalog.GetHelperFor(App.ENTRY_LIST);
+			helper.Criteria[App.ITEM_LIMIT] = 2;
+			helper.Criteria[App.ITEM_OFFSET] = 0;
+			helper.Execute();
+			if (!helper.IsNominal) Assert.Fail(helper.AlertsText);
+			IList list = helper.Outcome;
+			Assert.IsTrue(list.Count == 2, "Expected result set to be limited to two entries.");
+			AppEntry entry = list[0] as AppEntry;
+			helper.Criteria[App.ITEM_LIMIT] = 2;
+			helper.Criteria[App.ITEM_OFFSET] = 3;
+			helper.Execute();
+			IList list2 = helper.Outcome;
+			AppEntry entry2 = list2[0] as AppEntry;
+			Assert.IsFalse(entry.entry_key.Equals(entry2.entry_key), "Expected result sets to be different");
+			int count = Convert.ToInt32(helper.Criteria[App.ITEM_COUNT]);
+			Assert.IsTrue(count > 2, "Expected the overall count to be higher");
+		}
+
+	}
+}
\ No newline at end of file

Added: struts/sandbox/trunk/overdrive/PhoneBook2/projects/Test/Objects.xml
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/overdrive/PhoneBook2/projects/Test/Objects.xml?view=auto&rev=491822
==============================================================================
--- struts/sandbox/trunk/overdrive/PhoneBook2/projects/Test/Objects.xml (added)
+++ struts/sandbox/trunk/overdrive/PhoneBook2/projects/Test/Objects.xml Tue Jan  2 07:58:43 2007
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="utf-8" ?> 
+<objects xmlns="http://www.springframework.net" 
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
+	xsi:schemaLocation="http://www.springframework.net http://www.springframework.net/xsd/spring-objects.xsd">
+
+  <import resource="web://~/Resources/AppBase.xml"/>
+  <import resource="web://~/Resources/AppConfig.xml"/>
+  <import resource="web://~/Resources/AppFields.xml"/>
+  <import resource="web://~/Resources/Catalog.xml"/>
+
+</objects>

Added: struts/sandbox/trunk/overdrive/PhoneBook2/projects/Test/Resources/AppBase.xml
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/overdrive/PhoneBook2/projects/Test/Resources/AppBase.xml?view=auto&rev=491822
==============================================================================
--- struts/sandbox/trunk/overdrive/PhoneBook2/projects/Test/Resources/AppBase.xml (added)
+++ struts/sandbox/trunk/overdrive/PhoneBook2/projects/Test/Resources/AppBase.xml Tue Jan  2 07:58:43 2007
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="utf-8" ?> 
+<objects xmlns="http://www.springframework.net" 
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
+	xsi:schemaLocation="http://www.springframework.net http://www.springframework.net/xsd/spring-objects.xsd">
+
+ <!-- Base element (super parent)-->
+ 
+ <object id="BaseMapper" abstract="true">
+     <property name="Mapper"><ref object="Mapper"/></property>
+ </object>
+ 
+ <!-- Base class parents --> 
+
+	<object id="BaseChain" type="Nexus.Core.RequestChain, Nexus.Core"/>
+	
+	<object id="BaseCount" type="PhoneBook.Core.Commands.BaseCount, PhoneBook.Core" parent="BaseMapper"/>
+
+	<object id="BaseEntry" type="PhoneBook.Core.Commands.BaseEntry, PhoneBook.Core" parent="BaseMapper"/>
+	
+	<object id="BaseFilterList" type="PhoneBook.Core.Commands.BaseFilterList, PhoneBook.Core" parent="BaseMapper"/>
+	
+	<object id="BaseFieldContext" type="Nexus.Extras.Spring.FieldContext">
+		<property name="MessageSource">
+			<ref object="messageSource" />
+		</property>		
+	</object>
+	
+	<object id="BaseKeyValueProcessor" type="Nexus.Core.Validators.KeyValueProcessor"/>
+
+	<object id="BaseList" type="PhoneBook.Core.Commands.BaseList, PhoneBook.Core" parent="BaseMapper"/>
+
+	<object id="BaseSave" type="PhoneBook.Core.Commands.BaseSave, PhoneBook.Core" parent="BaseMapper"/>
+
+    <object id="EntryInitial" type="PhoneBook.Core.Commands.EntryInitial, PhoneBook.Core" parent="BaseMapper"/>
+
+</objects>
\ No newline at end of file

Added: struts/sandbox/trunk/overdrive/PhoneBook2/projects/Test/Resources/AppConfig.xml
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/overdrive/PhoneBook2/projects/Test/Resources/AppConfig.xml?view=auto&rev=491822
==============================================================================
--- struts/sandbox/trunk/overdrive/PhoneBook2/projects/Test/Resources/AppConfig.xml (added)
+++ struts/sandbox/trunk/overdrive/PhoneBook2/projects/Test/Resources/AppConfig.xml Tue Jan  2 07:58:43 2007
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="utf-8" ?> 
+<objects xmlns="http://www.springframework.net" 
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
+	xsi:schemaLocation="http://www.springframework.net http://www.springframework.net/xsd/spring-objects.xsd">
+
+ <!-- Message Source -->
+
+	<object id="messageSource" type="Spring.Context.Support.ResourceSetMessageSource, Spring.Core">
+        <property name="ResourceManagers">
+            <list>
+                <value>PhoneBook.Core.Messages, PhoneBook.Core</value>
+                <value>Nexus.Web.Messages, Nexus.Web</value>
+            </list>
+        </property>    
+    </object>
+
+
+ <!-- Request Processors -->
+	
+  <object id="convert_input" type="Nexus.Core.Validators.ConvertInput">
+    <property name="ID"><value>convert_input</value></property>
+  </object>
+
+  <object id="format_output" type="Nexus.Core.Validators.FormatOutput">
+    <property name="ID"><value>format_output</value></property>    
+  </object>
+  
+  <object id="clear_context" type="Nexus.Core.Validators.ClearContext">
+    <property name="ID"><value>clear_context</value></property>    
+  </object>
+
+ <!-- pre-op -->
+
+  <object id="pre-op" parent="BaseChain">
+	<property name="AddCommands">
+		<list>
+			<ref object="convert_input"/>
+		</list>   
+    </property>           
+  </object>  
+  
+ <!-- post-op -->
+
+  <object id="post-op" parent="BaseChain">
+	<property name="AddCommands">
+		<list>
+			<ref object="format_output"/>
+		</list>   
+    </property>           
+  </object>
+    		
+ <!-- Catalog -->
+ 
+  <object id="Catalog" type="Nexus.Extras.Spring.Catalog">
+	  <property name="FieldTable"><ref object="FieldTable"/></property>
+	  <property name="PreOp"><ref object="pre-op"/></property>
+	  <property name="PostOp"><ref object="post-op"/></property>
+	  <property name="ViewHelper"><object type="Nexus.Web.WebHelper, Nexus.Web" singleton="false"/></property>
+ </object>
+ 
+<!-- iBATIS Mapper -->
+  
+  <object id="Mapper" type="IBatisNet.DataMapper.Mapper, IBatisNet.DataMapper" 
+		factory-method="Instance"/> 
+      
+</objects>
\ No newline at end of file

Added: struts/sandbox/trunk/overdrive/PhoneBook2/projects/Test/Resources/AppFields.xml
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/overdrive/PhoneBook2/projects/Test/Resources/AppFields.xml?view=auto&rev=491822
==============================================================================
--- struts/sandbox/trunk/overdrive/PhoneBook2/projects/Test/Resources/AppFields.xml (added)
+++ struts/sandbox/trunk/overdrive/PhoneBook2/projects/Test/Resources/AppFields.xml Tue Jan  2 07:58:43 2007
@@ -0,0 +1,115 @@
+<?xml version="1.0" encoding="utf-8" ?> 
+<objects xmlns="http://www.springframework.net" 
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
+	xsi:schemaLocation="http://www.springframework.net http://www.springframework.net/xsd/spring-objects.xsd">
+
+	 <!-- FieldTable -->
+
+	<object id="FieldTable" type="Nexus.Core.Tables.FieldTable">
+		<property name="AddFieldContexts">
+			<list>
+				<ref object="last_name"/> 
+				<ref object="first_name"/> 
+				<ref object="extension"/> 
+				<ref object="user_name"/> 
+				<ref object="hired"/> 
+				<ref object="hours"/> 				
+				<ref object="_entry_list"/> 
+				<ref object="_entry_list_count"/> 
+				<ref object="_extension_list"/>
+				<ref object="_hired_list"/>
+			</list>
+		</property>
+		<property name="AddProcessors">
+			<list>
+				<ref object="DateTimeProcessor"/> 
+				<ref object="TelephoneProcessor"/> 
+				<ref object="EntryListProcessor"/> 
+				<ref object="ExtensionListProcessor"/>
+				<ref object="HiredListProcessor"/>
+			</list>
+		</property>
+	</object>
+
+	<object id="last_name" parent="BaseFieldContext">
+		<property name="ID"><value>last_name</value></property>	
+	</object>
+
+	<object id="first_name" parent="BaseFieldContext">
+		<property name="ID"><value>first_name</value></property>	
+	</object>
+
+	<object id="user_name" parent="BaseFieldContext">
+		<property name="ID"><value>user_name</value></property>	
+	</object>
+	
+	<object id="extension" parent="BaseFieldContext">
+		<property name="ID"><value>extension</value></property>		
+		<property name="Processor"><ref object="TelephoneProcessor"/></property>
+	</object>
+
+	<object id="hired" parent="BaseFieldContext">
+		<property name="ID"><value>hired</value></property>	
+		<property name="Processor"><ref object="DateTimeProcessor"/></property>
+	</object>
+	
+	<object id="hours" parent="BaseFieldContext">
+		<property name="ID"><value>hours</value></property>	
+	</object>
+	
+	<object id="editor" parent="BaseFieldContext">
+		<property name="ID"><value>editor</value></property>	
+	</object>
+
+	<!-- property name="ControlTypeName"><value>CheckBox</value></property -->	
+
+	<!-- We need to "hash" the name with "_" to avoid conflict with the filter Command -->
+	<object id="_entry_list" parent="BaseFieldContext">
+		<property name="ID"><value>entry_list</value></property>
+		<property name="Processor"><ref object="EntryListProcessor"/></property>
+	</object>
+		
+	<object id="_entry_list_count" parent="BaseFieldContext">
+		<property name="ID"><value>entry_list_count</value></property>
+		<property name="Processor"><ref object="CollectionProcessor"/></property>
+	</object>
+
+	<object id="_extension_list" parent="BaseFieldContext">
+		<property name="ID"><value>extension_list</value></property>
+		<property name="Processor"><ref object="ExtensionListProcessor"/></property>
+	</object>
+
+	<object id="_hired_list" parent="BaseFieldContext">
+		<property name="ID"><value>hired_list</value></property>
+		<property name="Processor"><ref object="HiredListProcessor"/></property>
+	</object>
+
+	<object id="CollectionProcessor" type="Nexus.Core.Validators.CollectionProcessor, Nexus.Core">
+		<property name="ID"><value>EntryCountProcessor</value></property>
+	</object>
+	
+ 		<!-- "d" is .NET for "short date" --> 
+	<object id="DateTimeProcessor" type="Nexus.Core.Validators.DateTimeProcessor">
+		<property name="ID"><value>DateTimeProcessor</value></property>
+		<property name="DataFormat"><value>d</value></property>
+	</object>
+	
+	<object id="TelephoneProcessor" type="PhoneBook.Core.TelephoneProcessor">
+		<property name="ID"><value>TelephoneProcessor</value></property>
+	</object>
+
+	<object id="EntryListProcessor" type="PhoneBook.Core.AppEntryListProcessor">
+		<property name="ID"><value>EntryListProcessor</value></property>
+	</object>
+	
+	<object id="ExtensionListProcessor" parent="BaseKeyValueProcessor">
+		<property name="ID"><value>ExtensionListProcessor</value></property>
+		<property name="Key"><value>extension</value></property>
+	</object>
+	
+	<object id="HiredListProcessor" parent="BaseKeyValueProcessor">
+		<property name="ID"><value>HiredListProcessor</value></property>
+		<property name="Key"><value>hired</value></property>
+	</object>
+
+</objects>
\ No newline at end of file

Added: struts/sandbox/trunk/overdrive/PhoneBook2/projects/Test/Resources/Catalog.xml
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/overdrive/PhoneBook2/projects/Test/Resources/Catalog.xml?view=auto&rev=491822
==============================================================================
--- struts/sandbox/trunk/overdrive/PhoneBook2/projects/Test/Resources/Catalog.xml (added)
+++ struts/sandbox/trunk/overdrive/PhoneBook2/projects/Test/Resources/Catalog.xml Tue Jan  2 07:58:43 2007
@@ -0,0 +1,174 @@
+<?xml version="1.0" encoding="utf-8" ?> 
+<objects xmlns="http://www.springframework.net" 
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
+	xsi:schemaLocation="http://www.springframework.net http://www.springframework.net/xsd/spring-objects.xsd">
+
+	<!-- entry commands -->
+
+  <object id="entry_list_rows" parent="BaseList">
+		<property name="ID"><value>entry_list</value></property>
+		<property name="QueryID"><value>entry</value></property>
+		<property name="RelatedIDs">
+			<list>
+				<value>entry_list</value>
+				<value>entry_key</value>
+				<value>last_name</value>
+				<value>first_name</value>
+				<value>extension</value>
+				<value>user_name</value>
+				<value>hired</value>
+				<value>hours</value>
+				<value>editor</value>
+				<value>initial</value>
+				<value>item_count</value>
+				<value>item_offset</value>
+				<value>item_limit</value>
+			</list>
+		</property>
+  </object>
+  
+  <object id="entry_list_count" parent="BaseCount">
+		<property name="ID"><value>entry_list_count</value></property>
+		<property name="QueryID"><value>entry_count</value></property>
+		<property name="RelatedIDs">
+			<list>
+				<value>entry_list</value>
+				<value>entry_key</value>
+				<value>last_name</value>
+				<value>first_name</value>
+				<value>extension</value>
+				<value>user_name</value>
+				<value>hired</value>
+				<value>hours</value>
+				<value>editor</value>
+				<value>initial</value>
+				<value>item_count</value>
+				<value>item_offset</value>
+				<value>item_limit</value>
+			</list>
+		</property>
+  </object>
+
+  <object id="entry" parent="BaseEntry">
+		<property name="ID"><value>entry</value></property>
+		<property name="RelatedIDs">
+			<list>
+				<value>entry</value>
+				<value>entry_key</value>
+				<value>last_name</value>
+				<value>first_name</value>
+				<value>extension</value>
+				<value>user_name</value>
+				<value>hired</value>
+				<value>hours</value>
+				<value>editor</value>
+			</list>
+		</property>
+  </object>
+  
+	
+	<!-- filter list commands -->
+		
+  <object id="last_name_list" parent="BaseFilterList">
+	<property name="ID"><value>last_name_list</value></property>
+	<property name="RelatedIDs"><list><value>last_name_list</value></list></property>
+  </object>
+
+  <object id="first_name_list" parent="BaseFilterList">
+	<property name="ID"><value>first_name_list</value></property>
+	<property name="RelatedIDs"><list><value>first_name_list</value></list></property>
+  </object>
+  
+  <object id="extension_list" parent="BaseFilterList">
+	<property name="ID"><value>extension_list</value></property>
+	<property name="RelatedIDs"><list><value>extension_list</value></list></property>	
+  </object>
+
+  <object id="user_name_list" parent="BaseFilterList">
+	<property name="ID"><value>user_name_list</value></property>
+	<property name="RelatedIDs"><list><value>user_name_list</value></list></property>	
+  </object>
+
+  <object id="hired_list" parent="BaseFilterList">
+	<property name="ID"><value>hired_list</value></property>
+	<property name="RelatedIDs"><list><value>hired_list</value></list></property>	
+  </object>
+
+  <object id="hours_list" parent="BaseFilterList">
+	<property name="ID"><value>hours_list</value></property>
+	<property name="RelatedIDs"><list><value>hours_list</value></list></property>	
+  </object>
+  
+	<object id="entry_initial" parent="EntryInitial">
+		<property name="ID">
+			<value>entry_initial</value>
+		</property>
+		<property name="RelatedIDs">
+			<list>
+				<value>entry_initial</value>
+			</list>		
+		</property>
+	</object>
+  
+	<!-- chains -->
+    
+    <object id="entry_list" parent="BaseChain">
+		<property name="ID">
+			<value>entry_list</value>
+		</property>
+		<property name="AddCommands">
+			<list>
+				<ref object="entry_list_count" />
+				<ref object="entry_list_rows" />
+			</list>
+		</property>
+	</object>
+    
+    <object id="entry_find" parent="BaseChain">
+		<property name="ID">
+			<value>entry_find</value>
+		</property>
+		<property name="AddCommands">
+			<list>
+				<ref object="last_name_list" />
+				<ref object="first_name_list" />
+				<ref object="extension_list" />
+				<ref object="user_name_list" />
+				<ref object="hired_list" />
+				<ref object="hours_list" />
+			</list>
+		</property>
+	</object>
+			
+  <object id="entry_save" parent="BaseSave">
+		<property name="ID">
+			<value>entry_save</value>
+		</property>
+		<property name="KeyID">
+			<value>entry_key</value>
+		</property>
+		<property name="InsertID">
+			<value>entry_insert</value>
+		</property>
+		<property name="UpdateID">
+			<value>entry_update</value>
+		</property>
+		<property name="RelatedIDs">
+			<list>
+				<value>entry_key</value>
+			</list>
+		</property>
+		<property name="RequiredIDs">
+			<list>
+				<value>first_name</value>
+				<value>last_name</value>
+				<value>extension</value>
+				<value>user_name</value>
+				<value>hours</value>
+				<value>hired</value>
+				<value>editor</value>
+			</list>
+		</property>
+	</object>
+
+</objects>

Added: struts/sandbox/trunk/overdrive/PhoneBook2/projects/Test/Resources/Queries.xml
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/overdrive/PhoneBook2/projects/Test/Resources/Queries.xml?view=auto&rev=491822
==============================================================================
--- struts/sandbox/trunk/overdrive/PhoneBook2/projects/Test/Resources/Queries.xml (added)
+++ struts/sandbox/trunk/overdrive/PhoneBook2/projects/Test/Resources/Queries.xml Tue Jan  2 07:58:43 2007
@@ -0,0 +1,180 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<sqlMap 
+	namespace="phonebook" 
+	xmlns="http://ibatis.apache.org/mapping" 
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >
+
+   <parameterMaps>
+		
+   		<parameterMap id="entry_save_param">
+			<parameter property="last_name"/>
+			<parameter property="first_name"/>
+			<parameter property="extension"/>
+			<parameter property="user_name"/>
+			<parameter property="hired"/>
+			<parameter property="hours"/>
+			<parameter property="editor"/>
+   			<parameter property="entry_key"/>   		
+        </parameterMap>    		
+  	
+  	</parameterMaps>
+		
+	<statements>
+	
+		<select id="last_name_list" resultClass="string">
+			SELECT DISTINCT 
+				last_name
+			FROM entry
+			ORDER BY last_name			
+		</select>
+		
+		<select id="first_name_list" resultClass="string">
+			SELECT DISTINCT 
+				first_name
+			FROM entry
+			ORDER BY first_name
+		</select>
+		
+		<select id="extension_list" resultClass="string">
+			SELECT DISTINCT 
+				extension
+			FROM entry
+			ORDER BY extension
+		</select>
+
+		<select id="user_name_list" resultClass="string">
+			SELECT DISTINCT 
+				user_name
+			FROM entry
+			ORDER BY user_name
+		</select>
+
+		<select id="hired_list"  resultClass="date">
+			SELECT DISTINCT 
+				hired
+			FROM entry
+			ORDER BY hired
+		</select>
+
+		<select id="hours_list"  resultClass="string">
+			SELECT DISTINCT 
+				hours
+			FROM entry
+			ORDER BY hours
+		</select>
+
+		<select id="entry" paramClass="Hashtable" resultClass="Hashtable">
+			SELECT 
+				last_name,
+				first_name,
+				extension,
+				user_name,
+				hired,
+				hours,
+				editor,
+				pk_entry AS entry_key				
+			FROM entry
+			<dynamic prepend="WHERE">			
+				<isNotNull property="initial" prepend="AND">
+					last_name LIKE #initial#
+				</isNotNull>
+				<isNotNull property="last_name" prepend="AND">
+					last_name=#last_name#
+				</isNotNull>
+				<isNotNull property="first_name" prepend="AND">
+					first_name=#first_name#
+				</isNotNull>
+				<isNotNull property="extension" prepend="AND">
+					extension=#extension#
+				</isNotNull>
+				<isNotNull property="user_name" prepend="AND">
+					user_name=#user_name#
+				</isNotNull>
+				<isNotNull property="hired" prepend="AND">
+					hired=#hired#
+				</isNotNull>
+				<isNotNull property="hours" prepend="AND">
+					hours=#hours#
+				</isNotNull>
+				<isNotNull property="editor" prepend="AND">
+					hours=#editor#
+				</isNotNull>
+				<isNotNull property="entry_key" prepend="AND">
+					pk_entry=#entry_key#
+				</isNotNull>
+			</dynamic>			
+			<dynamic>
+			   <isNotNull property="item_limit">
+					LIMIT #item_limit# OFFSET #item_offset# 
+			   </isNotNull>			
+			</dynamic>;
+		</select>
+
+		<select id="entry_count" paramClass="Hashtable" resultClass="string">
+			SELECT COUNT(*) FROM entry
+			<dynamic prepend="WHERE">			
+				<isNotNull property="initial" prepend="AND">
+					last_name LIKE #initial#
+				</isNotNull>
+				<isNotNull property="last_name" prepend="AND">
+					last_name=#last_name#
+				</isNotNull>
+				<isNotNull property="first_name" prepend="AND">
+					first_name=#first_name#
+				</isNotNull>
+				<isNotNull property="extension" prepend="AND">
+					extension=#extension#
+				</isNotNull>
+				<isNotNull property="user_name" prepend="AND">
+					user_name=#user_name#
+				</isNotNull>
+				<isNotNull property="hired" prepend="AND">
+					hired=#hired#
+				</isNotNull>
+				<isNotNull property="hours" prepend="AND">
+					hours=#hours#
+				</isNotNull>
+				<isNotNull property="editor" prepend="AND">
+					hours=#editor#
+				</isNotNull>
+				<isNotNull property="entry_key" prepend="AND">
+					pk_entry=#entry_key#
+				</isNotNull>
+			</dynamic>			
+		</select>
+		
+		<select id="entry_initial" paramClass="string" resultClass="string">		
+			SELECT COUNT(*) 
+			FROM entry
+			WHERE last_name LIKE #value#
+		</select>									
+		
+		<insert id="entry_insert" parameterMap="entry_save_param">
+    		INSERT INTO entry (    			
+				last_name,
+				first_name,
+				extension,
+				user_name,
+				hired,
+				hours,
+				editor,
+				pk_entry
+				)
+			VALUES (?,?,?,?, ?,?,?,?)
+		</insert>		
+
+		<update id="entry_update" parameterMap="entry_save_param">
+			UPDATE entry SET
+				last_name=?,
+				first_name=?,
+				extension=?,
+				user_name=?,
+				hired=?,
+				hours=?,
+				editor=?
+			WHERE 
+				pk_entry=?
+		</update>
+						
+	</statements>
+</sqlMap>



Mime
View raw message