You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@struts.apache.org by hu...@apache.org on 2007/01/09 17:04:20 UTC

svn commit: r494445 [1/2] - in /struts/sandbox/trunk/overdrive/PhoneBook: Core/App.cs Core/AppEntry.cs Core/AppEntryList.cs Core/Core.csproj Core/PhoneBook.Core.xml Web/Objects.xml Web/Resources/AppBase.xml Web/Resources/Catalog.xml Web/Web.csproj

Author: husted
Date: Tue Jan  9 08:04:19 2007
New Revision: 494445

URL: http://svn.apache.org/viewvc?view=rev&rev=494445
Log:
Phonebook - Back port Jayrock/Dojo implementation. 

Added:
    struts/sandbox/trunk/overdrive/PhoneBook/Web/Objects.xml
Modified:
    struts/sandbox/trunk/overdrive/PhoneBook/Core/App.cs
    struts/sandbox/trunk/overdrive/PhoneBook/Core/AppEntry.cs
    struts/sandbox/trunk/overdrive/PhoneBook/Core/AppEntryList.cs
    struts/sandbox/trunk/overdrive/PhoneBook/Core/Core.csproj
    struts/sandbox/trunk/overdrive/PhoneBook/Core/PhoneBook.Core.xml
    struts/sandbox/trunk/overdrive/PhoneBook/Web/Resources/AppBase.xml
    struts/sandbox/trunk/overdrive/PhoneBook/Web/Resources/Catalog.xml
    struts/sandbox/trunk/overdrive/PhoneBook/Web/Web.csproj

Modified: struts/sandbox/trunk/overdrive/PhoneBook/Core/App.cs
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/overdrive/PhoneBook/Core/App.cs?view=diff&rev=494445&r1=494444&r2=494445
==============================================================================
--- struts/sandbox/trunk/overdrive/PhoneBook/Core/App.cs (original)
+++ struts/sandbox/trunk/overdrive/PhoneBook/Core/App.cs Tue Jan  9 08:04:19 2007
@@ -1,18 +1,18 @@
- /*
- * 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.
- */
+/*
+* 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
 {
@@ -30,6 +30,12 @@
 		#region Properties
 
 		/// <summary>
+		/// Token for Catalog property.
+		/// </summary>
+		/// 
+		public const string CATALOG_KEY = "Catalog";
+
+		/// <summary>
 		/// Token for entry_key property.
 		/// </summary>
 		/// 
@@ -77,12 +83,12 @@
 		/// 
 		public const string EDITOR = "editor";
 
-		#endregion 
+		#endregion
 
 		#region Commands
 
 		public const string FROM_DATE = "from_date";
-		
+
 		public const string THRU_DATE = "thru_date";
 
 		/// <summary>
@@ -169,6 +175,12 @@
 		/// 
 		public const string ENTRY_SAVE = "entry_save";
 
+		/// <summary>
+		/// Token for Entry Delete command.
+		/// </summary>
+		/// 
+		public const string ENTRY_DELETE = "entry_delete";
+
 		#endregion
 
 		#region Messages
@@ -188,6 +200,6 @@
 		/// </summary>
 		public const string DIRECTORY_PROMPT = "directory_prompt";
 
-		#endregion 
+		#endregion
 	}
 }

Modified: struts/sandbox/trunk/overdrive/PhoneBook/Core/AppEntry.cs
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/overdrive/PhoneBook/Core/AppEntry.cs?view=diff&rev=494445&r1=494444&r2=494445
==============================================================================
--- struts/sandbox/trunk/overdrive/PhoneBook/Core/AppEntry.cs (original)
+++ struts/sandbox/trunk/overdrive/PhoneBook/Core/AppEntry.cs Tue Jan  9 08:04:19 2007
@@ -15,6 +15,7 @@
  */
 using System;
 using System.Collections;
+using Nexus.Core;
 
 namespace PhoneBook.Core
 {
@@ -23,73 +24,41 @@
 	/// </summary>
 	/// 
 	[Serializable]
-	public class AppEntry
+	public class AppEntry : EntryDictionary
 	{
-		/// <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)
+		public AppEntry()
 		{
-			ICollection keys = sources.Keys;
-			foreach (string key in keys)
-			{
-				Add(key, sources[key] as string);
-			}
+			// Default contstructor	
 		}
 
-		/// <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)
+		public AppEntry(IDictionary sources)
 		{
-			_Value.Add(key, value);
+			AddAll(sources);
 		}
 
-		/// <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)
+		public AppEntry(AppEntry row)
 		{
-			return _Value[key] as string;
+			AddAll(row);
 		}
 
 		/// <summary>
-		/// Set an entry to the internal store, overwriting any existing entry.
+		/// Add each source entry to our internal store. 
 		/// </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. 
+		/// 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"></param>
-		/// <param name="value"></param>
-		protected void Set(string key, string value)
+		/// <param name="row">Entries to add</param>
+		/// 
+		public void AddAll(AppEntry row)
 		{
-			_Value[key] = value;
+			ICollection keys = row.Keys;
+			foreach (string key in keys)
+			{
+				Add(key, row.Get(key));
+			}
 		}
-
 
 		/*
 		public string Property

Modified: struts/sandbox/trunk/overdrive/PhoneBook/Core/AppEntryList.cs
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/overdrive/PhoneBook/Core/AppEntryList.cs?view=diff&rev=494445&r1=494444&r2=494445
==============================================================================
--- struts/sandbox/trunk/overdrive/PhoneBook/Core/AppEntryList.cs (original)
+++ struts/sandbox/trunk/overdrive/PhoneBook/Core/AppEntryList.cs Tue Jan  9 08:04:19 2007
@@ -1,3 +1,4 @@
+using System;
 using System.Collections;
 using Nexus.Core;
 
@@ -13,7 +14,7 @@
 		{
 			AppEntry entry = new AppEntry();
 			entry.entry_key = key;
-			this.Insert(0, entry);
+			Insert(0, entry);
 			return entry;
 		}
 
@@ -21,8 +22,17 @@
 		{
 			AppEntry entry = new AppEntry();
 			foreach (DictionaryEntry col in row)
-				entry.Add(col.Key.ToString(), col.Value.ToString());
+			{
+				string key = Convert.ToString(col.Key);
+				string value = Convert.ToString(col.Value);
+				entry.Add(key, value);
+			}
 			Add(entry);
 		}
+        
+		public AppEntry[] ToAppEntryArray()
+		{
+			return (AppEntry[])ToArray(typeof(AppEntry));
+		}
 	}
-}
\ No newline at end of file
+}

Modified: struts/sandbox/trunk/overdrive/PhoneBook/Core/Core.csproj
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/overdrive/PhoneBook/Core/Core.csproj?view=diff&rev=494445&r1=494444&r2=494445
==============================================================================
--- struts/sandbox/trunk/overdrive/PhoneBook/Core/Core.csproj (original)
+++ struts/sandbox/trunk/overdrive/PhoneBook/Core/Core.csproj Tue Jan  9 08:04:19 2007
@@ -159,6 +159,11 @@
                     BuildAction = "Compile"
                 />
                 <File
+                    RelPath = "Commands\BaseDelete.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
                     RelPath = "Commands\BaseEntry.cs"
                     SubType = "Code"
                     BuildAction = "Compile"

Modified: struts/sandbox/trunk/overdrive/PhoneBook/Core/PhoneBook.Core.xml
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/overdrive/PhoneBook/Core/PhoneBook.Core.xml?view=diff&rev=494445&r1=494444&r2=494445
==============================================================================
--- struts/sandbox/trunk/overdrive/PhoneBook/Core/PhoneBook.Core.xml (original)
+++ struts/sandbox/trunk/overdrive/PhoneBook/Core/PhoneBook.Core.xml Tue Jan  9 08:04:19 2007
@@ -169,6 +169,13 @@
             Invoke a query that returns the count of a result set.
             </summary>
         </member>
+        <member name="T:PhoneBook.Core.Commands.BaseDelete">
+            <summary>
+            Execute delete statement indicated by QueryID 
+            for a single entity.
+            </summary>
+            
+        </member>
         <member name="T:PhoneBook.Core.Commands.BaseEntry">
             <summary>
             Execute database statement indicated by QueryID 
@@ -308,6 +315,12 @@
             </summary>
             
         </member>
+        <member name="F:PhoneBook.Core.App.CATALOG_KEY">
+            <summary>
+            Token for Catalog property.
+            </summary>
+            
+        </member>
         <member name="F:PhoneBook.Core.App.ENTRY_KEY">
             <summary>
             Token for entry_key property.
@@ -440,6 +453,12 @@
             </summary>
             
         </member>
+        <member name="F:PhoneBook.Core.App.ENTRY_DELETE">
+            <summary>
+            Token for Entry Delete command.
+            </summary>
+            
+        </member>
         <member name="F:PhoneBook.Core.App.DIRECTORY_TITLE">
             <summary>
             Token for Directory page title.
@@ -461,13 +480,7 @@
             </summary>
             
         </member>
-        <member name="F:PhoneBook.Core.AppEntry._Value">
-            <summary>
-            Internal storage.
-            </summary>
-            
-        </member>
-        <member name="M:PhoneBook.Core.AppEntry.AddAll(System.Collections.IDictionary)">
+        <member name="M:PhoneBook.Core.AppEntry.AddAll(PhoneBook.Core.AppEntry)">
             <summary>
             Add each source entry to our internal store. 
             </summary>
@@ -475,40 +488,8 @@
             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>
+            <param name="row">Entries to add</param>
             
-        </member>
-        <member name="M:PhoneBook.Core.AppEntry.Add(System.String,System.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>
-            
-        </member>
-        <member name="M:PhoneBook.Core.AppEntry.Get(System.String)">
-            <summary>
-            Provide the value corresponding to key from the internal store.
-            </summary>
-            <param name="key">ID for entry</param>
-            <returns>Content for entry</returns>
-            
-        </member>
-        <member name="M:PhoneBook.Core.AppEntry.Set(System.String,System.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>
         </member>
         <member name="T:PhoneBook.Core.AppEntryList">
             <summary>

Added: struts/sandbox/trunk/overdrive/PhoneBook/Web/Objects.xml
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/overdrive/PhoneBook/Web/Objects.xml?view=auto&rev=494445
==============================================================================
--- struts/sandbox/trunk/overdrive/PhoneBook/Web/Objects.xml (added)
+++ struts/sandbox/trunk/overdrive/PhoneBook/Web/Objects.xml Tue Jan  9 08:04:19 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>

Modified: struts/sandbox/trunk/overdrive/PhoneBook/Web/Resources/AppBase.xml
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/overdrive/PhoneBook/Web/Resources/AppBase.xml?view=diff&rev=494445&r1=494444&r2=494445
==============================================================================
--- struts/sandbox/trunk/overdrive/PhoneBook/Web/Resources/AppBase.xml (original)
+++ struts/sandbox/trunk/overdrive/PhoneBook/Web/Resources/AppBase.xml Tue Jan  9 08:04:19 2007
@@ -15,6 +15,8 @@
 	
 	<object id="BaseCount" type="PhoneBook.Core.Commands.BaseCount, PhoneBook.Core" parent="BaseMapper"/>
 
+	<object id="BaseDelete" type="PhoneBook.Core.Commands.BaseDelete, 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"/>

Modified: struts/sandbox/trunk/overdrive/PhoneBook/Web/Resources/Catalog.xml
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/overdrive/PhoneBook/Web/Resources/Catalog.xml?view=diff&rev=494445&r1=494444&r2=494445
==============================================================================
--- struts/sandbox/trunk/overdrive/PhoneBook/Web/Resources/Catalog.xml (original)
+++ struts/sandbox/trunk/overdrive/PhoneBook/Web/Resources/Catalog.xml Tue Jan  9 08:04:19 2007
@@ -65,9 +65,19 @@
 			</list>
 		</property>
   </object>
-  
-	
-	<!-- filter list commands -->
+
+  <object id="entry_delete" parent="BaseDelete">
+    <property name="ID">
+      <value>entry_delete</value>
+    </property>
+    <property name="RequiredIDs">
+      <list>
+        <value>entry_key</value>
+      </list>
+    </property>
+  </object>
+
+  <!-- filter list commands -->
 		
   <object id="last_name_list" parent="BaseFilterList">
 	<property name="ID"><value>last_name_list</value></property>