You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by hu...@apache.org on 2005/06/25 01:04:14 UTC
svn commit: r201689 - in /struts/sandbox/trunk/overdrive/PhoneBook: Core/
Core/Commands/ Test/ Test/Commands/ Test/Resources/Command/
Test/Resources/Query/ Web/ Web/Forms/ Web/Resources/Command/
Web/Resources/Query/
Author: husted
Date: Fri Jun 24 16:04:12 2005
New Revision: 201689
URL: http://svn.apache.org/viewcvs?rev=201689&view=rev
Log:
OVR-5
* Remove cruft; conform tests; reformat code.
Removed:
struts/sandbox/trunk/overdrive/PhoneBook/Test/Resources/Query/properties.xml
struts/sandbox/trunk/overdrive/PhoneBook/Web/AppHelper.cs
struts/sandbox/trunk/overdrive/PhoneBook/Web/Resources/Query/properties.xml
Modified:
struts/sandbox/trunk/overdrive/PhoneBook/Core/App.cs
struts/sandbox/trunk/overdrive/PhoneBook/Core/AppContext.cs
struts/sandbox/trunk/overdrive/PhoneBook/Core/AppContextList.cs
struts/sandbox/trunk/overdrive/PhoneBook/Core/AppProcessor.cs
struts/sandbox/trunk/overdrive/PhoneBook/Core/Commands/BaseSave.cs
struts/sandbox/trunk/overdrive/PhoneBook/Test/Commands/DirectoryViewTest.cs
struts/sandbox/trunk/overdrive/PhoneBook/Test/Commands/FilterLists.cs
struts/sandbox/trunk/overdrive/PhoneBook/Test/Commands/SelectAllTest.cs
struts/sandbox/trunk/overdrive/PhoneBook/Test/Resources/Command/Catalog.xml
struts/sandbox/trunk/overdrive/PhoneBook/Test/Resources/Query/SelectAll.xml
struts/sandbox/trunk/overdrive/PhoneBook/Test/Test.csproj
struts/sandbox/trunk/overdrive/PhoneBook/Web/AppGridHelper.cs
struts/sandbox/trunk/overdrive/PhoneBook/Web/Forms/Directory.aspx.cs
struts/sandbox/trunk/overdrive/PhoneBook/Web/Forms/Directory2.aspx.cs
struts/sandbox/trunk/overdrive/PhoneBook/Web/Resources/Command/AppBase.xml
struts/sandbox/trunk/overdrive/PhoneBook/Web/Web.csproj
Modified: struts/sandbox/trunk/overdrive/PhoneBook/Core/App.cs
URL: http://svn.apache.org/viewcvs/struts/sandbox/trunk/overdrive/PhoneBook/Core/App.cs?rev=201689&r1=201688&r2=201689&view=diff
==============================================================================
--- struts/sandbox/trunk/overdrive/PhoneBook/Core/App.cs (original)
+++ struts/sandbox/trunk/overdrive/PhoneBook/Core/App.cs Fri Jun 24 16:04:12 2005
@@ -124,9 +124,15 @@
public const string DIRECTORY_VIEW = "directory_view";
/// <summary>
- /// Token for Directory View helpere.
+ /// Token for Directory Find helper.
/// </summary>
///
- public const string DIRECTORY_VIEW_HELPER = "directory_view_helper";
+ public const string DIRECTORY_FIND_HELPER = "directory_find_helper";
+
+ /// <summary>
+ /// Token for Directory list helper.
+ /// </summary>
+ ///
+ public const string DIRECTORY_LIST_HELPER = "directory_list_helper";
}
}
Modified: struts/sandbox/trunk/overdrive/PhoneBook/Core/AppContext.cs
URL: http://svn.apache.org/viewcvs/struts/sandbox/trunk/overdrive/PhoneBook/Core/AppContext.cs?rev=201689&r1=201688&r2=201689&view=diff
==============================================================================
--- struts/sandbox/trunk/overdrive/PhoneBook/Core/AppContext.cs (original)
+++ struts/sandbox/trunk/overdrive/PhoneBook/Core/AppContext.cs Fri Jun 24 16:04:12 2005
@@ -23,22 +23,21 @@
///
public class AppEntry
{
-
- public void Add(string key, string value)
+ public void Add (string key, string value)
{
- _Value.Add (key,value);
+ _Value.Add (key, value);
}
- private IDictionary _Value = new Hashtable(5);
+ private IDictionary _Value = new Hashtable (5);
- private string Get(string key)
+ private string Get (string key)
{
- return _Value[key] as string;
+ return _Value [key] as string;
}
- private void Set(string key, string value)
+ private void Set (string key, string value)
{
- _Value[key] = value;
+ _Value [key] = value;
}
@@ -52,44 +51,44 @@
public string entry_key
{
- get { return Get(App.ENTRY_KEY); }
- set { Set(App.ENTRY_KEY, value); }
+ 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); }
+ 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); }
+ 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); }
+ 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); }
+ 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); }
+ get { return Get (App.HIRED); }
+ set { Set (App.HIRED, value); }
}
public string hours
{
- get { return Get(App.HOURS); }
- set { Set(App.HOURS, value); }
+ get { return Get (App.HOURS); }
+ set { Set (App.HOURS, value); }
}
}
Modified: struts/sandbox/trunk/overdrive/PhoneBook/Core/AppContextList.cs
URL: http://svn.apache.org/viewcvs/struts/sandbox/trunk/overdrive/PhoneBook/Core/AppContextList.cs?rev=201689&r1=201688&r2=201689&view=diff
==============================================================================
--- struts/sandbox/trunk/overdrive/PhoneBook/Core/AppContextList.cs (original)
+++ struts/sandbox/trunk/overdrive/PhoneBook/Core/AppContextList.cs Fri Jun 24 16:04:12 2005
@@ -9,21 +9,20 @@
///
public class AppEntryList : ArrayList, IEntryList
{
-
public object Insert (string key)
{
- AppEntry entry = new AppEntry();
+ AppEntry entry = new AppEntry ();
entry.entry_key = key;
- this.Insert (0,entry);
+ this.Insert (0, entry);
return entry;
}
- public void AddEntry(IDictionary row)
+ public void AddEntry (IDictionary row)
{
- AppEntry entry = new AppEntry();
- foreach (DictionaryEntry col in row)
- entry.Add (col.Key.ToString (),col.Value.ToString ());
- Add(entry);
+ AppEntry entry = new AppEntry ();
+ foreach (DictionaryEntry col in row)
+ entry.Add (col.Key.ToString (), col.Value.ToString ());
+ Add (entry);
}
}
}
Modified: struts/sandbox/trunk/overdrive/PhoneBook/Core/AppProcessor.cs
URL: http://svn.apache.org/viewcvs/struts/sandbox/trunk/overdrive/PhoneBook/Core/AppProcessor.cs?rev=201689&r1=201688&r2=201689&view=diff
==============================================================================
--- struts/sandbox/trunk/overdrive/PhoneBook/Core/AppProcessor.cs (original)
+++ struts/sandbox/trunk/overdrive/PhoneBook/Core/AppProcessor.cs Fri Jun 24 16:04:12 2005
@@ -3,12 +3,11 @@
namespace PhoneBook.Core
{
-
public class AppEntryListProcessor : EntryListProcessor
{
- public override IEntryList NewEntryList()
+ public override IEntryList NewEntryList ()
{
- return new AppEntryList();
+ return new AppEntryList ();
}
}
}
Modified: struts/sandbox/trunk/overdrive/PhoneBook/Core/Commands/BaseSave.cs
URL: http://svn.apache.org/viewcvs/struts/sandbox/trunk/overdrive/PhoneBook/Core/Commands/BaseSave.cs?rev=201689&r1=201688&r2=201689&view=diff
==============================================================================
--- struts/sandbox/trunk/overdrive/PhoneBook/Core/Commands/BaseSave.cs (original)
+++ struts/sandbox/trunk/overdrive/PhoneBook/Core/Commands/BaseSave.cs Fri Jun 24 16:04:12 2005
@@ -53,10 +53,10 @@
if (insert)
{
context [fieldID] = GuidString ();
- Mapper().Insert (insertID, context);
+ Mapper ().Insert (insertID, context);
}
else
- Mapper().Update (updateID, context);
+ Mapper ().Update (updateID, context);
return CONTINUE;
}
@@ -67,4 +67,4 @@
}
}
-}
+}
\ No newline at end of file
Modified: struts/sandbox/trunk/overdrive/PhoneBook/Test/Commands/DirectoryViewTest.cs
URL: http://svn.apache.org/viewcvs/struts/sandbox/trunk/overdrive/PhoneBook/Test/Commands/DirectoryViewTest.cs?rev=201689&r1=201688&r2=201689&view=diff
==============================================================================
--- struts/sandbox/trunk/overdrive/PhoneBook/Test/Commands/DirectoryViewTest.cs (original)
+++ struts/sandbox/trunk/overdrive/PhoneBook/Test/Commands/DirectoryViewTest.cs Fri Jun 24 16:04:12 2005
@@ -32,7 +32,7 @@
[Test]
public void HelperContains ()
{
- IViewHelper helper = catalog.GetHelper (App.DIRECTORY_VIEW_HELPER);
+ IViewHelper helper = catalog.GetHelper (App.DIRECTORY_FIND_HELPER);
IRequestCommand command = helper.Command;
Assert.IsNotNull (command, "Expected Helper to have a Command");
Assert.AreEqual (App.DIRECTORY_VIEW, command.ID, "Expected Helper to have View Command.");
Modified: struts/sandbox/trunk/overdrive/PhoneBook/Test/Commands/FilterLists.cs
URL: http://svn.apache.org/viewcvs/struts/sandbox/trunk/overdrive/PhoneBook/Test/Commands/FilterLists.cs?rev=201689&r1=201688&r2=201689&view=diff
==============================================================================
--- struts/sandbox/trunk/overdrive/PhoneBook/Test/Commands/FilterLists.cs (original)
+++ struts/sandbox/trunk/overdrive/PhoneBook/Test/Commands/FilterLists.cs Fri Jun 24 16:04:12 2005
@@ -71,7 +71,7 @@
private IKeyValueList FilterList (string key)
{
- IViewHelper helper = catalog.GetHelper ("directory_view_helper");
+ IViewHelper helper = catalog.GetHelper (App.DIRECTORY_FIND_HELPER);
helper.Execute ();
IKeyValueList list = helper.Criteria [key] as IKeyValueList;
Assert.IsNotNull (list, "Expected KeyValueList");
Modified: struts/sandbox/trunk/overdrive/PhoneBook/Test/Commands/SelectAllTest.cs
URL: http://svn.apache.org/viewcvs/struts/sandbox/trunk/overdrive/PhoneBook/Test/Commands/SelectAllTest.cs?rev=201689&r1=201688&r2=201689&view=diff
==============================================================================
--- struts/sandbox/trunk/overdrive/PhoneBook/Test/Commands/SelectAllTest.cs (original)
+++ struts/sandbox/trunk/overdrive/PhoneBook/Test/Commands/SelectAllTest.cs Fri Jun 24 16:04:12 2005
@@ -61,13 +61,12 @@
[Test]
public void FilterHelper_Format ()
{
- IViewHelper helper = catalog.GetHelper ("directory_find_helper");
+ IViewHelper helper = catalog.GetHelper (App.DIRECTORY_LIST_HELPER);
helper.Execute ();
AppEntryList list = helper.Outcome as AppEntryList;
- // AppContextList list = helper.Context.Criteria["filter"] as AppContextList;
- Assert.IsNotNull (list, "Expected list to be AppContextList");
+ Assert.IsNotNull (list, "Expected list to be AppEntryList");
AppEntry row = list [0] as AppEntry;
- Assert.IsNotNull (row, "Expected rows to be AppContexts");
+ Assert.IsNotNull (row, "Expected rows to be AppEntries");
string hired = row.hired;
Assert.IsNotNull (hired, "Expected each row to have a hired date.");
Modified: struts/sandbox/trunk/overdrive/PhoneBook/Test/Resources/Command/Catalog.xml
URL: http://svn.apache.org/viewcvs/struts/sandbox/trunk/overdrive/PhoneBook/Test/Resources/Command/Catalog.xml?rev=201689&r1=201688&r2=201689&view=diff
==============================================================================
--- struts/sandbox/trunk/overdrive/PhoneBook/Test/Resources/Command/Catalog.xml (original)
+++ struts/sandbox/trunk/overdrive/PhoneBook/Test/Resources/Command/Catalog.xml Fri Jun 24 16:04:12 2005
@@ -73,21 +73,21 @@
</object>
- <!-- directory1 helpers -->
+ <!-- directory-1 helpers -->
- <object id="directory_view_helper" parent="BaseHelper" singleton="false">
+ <object id="directory_find_helper" parent="BaseHelper" singleton="false">
<property name="Command">
<ref object="directory_view" />
</property>
</object>
- <object id="directory_find_helper" parent="BaseHelper" singleton="false">
+ <object id="directory_list_helper" parent="BaseHelper" singleton="false">
<property name="Command">
<ref object="filter" />
</property>
</object>
- <!-- directory2 helpers -->
+ <!-- directory-2 helpers -->
<object id="BaseGridHelper" type="PhoneBook.Web.AppGridHelper, PhoneBook.Web" singleton="false">
<property name="Catalog">
@@ -96,8 +96,11 @@
</object>
<object id="directory_grid_helper" parent="BaseGridHelper" singleton="false">
+ <property name="FindHelper">
+ <ref object="directory_find_helper"/>
+ </property>
<property name="ListHelper">
- <ref object="directory_find_helper" />
+ <ref object="directory_list_helper" />
</property>
<property name="SaveHelper">
<ref object="entry_save_helper" />
@@ -152,7 +155,6 @@
<value>user_name</value>
<value>hours</value>
<value>hired</value>
- <value>editor</value>
</list>
</property>
</object>
Modified: struts/sandbox/trunk/overdrive/PhoneBook/Test/Resources/Query/SelectAll.xml
URL: http://svn.apache.org/viewcvs/struts/sandbox/trunk/overdrive/PhoneBook/Test/Resources/Query/SelectAll.xml?rev=201689&r1=201688&r2=201689&view=diff
==============================================================================
--- struts/sandbox/trunk/overdrive/PhoneBook/Test/Resources/Query/SelectAll.xml (original)
+++ struts/sandbox/trunk/overdrive/PhoneBook/Test/Resources/Query/SelectAll.xml Fri Jun 24 16:04:12 2005
@@ -23,14 +23,14 @@
<statements>
<select id="filter" paramClass="Hashtable" resultClass="Hashtable">
SELECT
- pk_entry AS entry_key,
last_name,
first_name,
extension,
user_name,
hired,
hours,
- editor
+ editor,
+ pk_entry AS entry_key
FROM entry
<dynamic prepend="WHERE">
<isNotNull property="last_name" prepend="AND">
@@ -51,6 +51,12 @@
<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>
@@ -62,10 +68,9 @@
user_name,
hired,
hours,
- editor,
pk_entry
)
- VALUES (?,?,?,?, ?,?,?,?)
+ VALUES (?,?,?,?, ?,?,?)
</insert>
<update id="entry_update" parameterMap="entry_save_param">
@@ -75,8 +80,7 @@
extension=?,
user_name=?,
hired=?,
- hours=?,
- editor=?
+ hours=?
WHERE
pk_entry=?
</update>
Modified: struts/sandbox/trunk/overdrive/PhoneBook/Test/Test.csproj
URL: http://svn.apache.org/viewcvs/struts/sandbox/trunk/overdrive/PhoneBook/Test/Test.csproj?rev=201689&r1=201688&r2=201689&view=diff
==============================================================================
--- struts/sandbox/trunk/overdrive/PhoneBook/Test/Test.csproj (original)
+++ struts/sandbox/trunk/overdrive/PhoneBook/Test/Test.csproj Fri Jun 24 16:04:12 2005
@@ -196,10 +196,6 @@
BuildAction = "Content"
/>
<File
- RelPath = "Resources\Query\properties.xml"
- BuildAction = "Content"
- />
- <File
RelPath = "Resources\Query\SelectAll.xml"
BuildAction = "Content"
/>
Modified: struts/sandbox/trunk/overdrive/PhoneBook/Web/AppGridHelper.cs
URL: http://svn.apache.org/viewcvs/struts/sandbox/trunk/overdrive/PhoneBook/Web/AppGridHelper.cs?rev=201689&r1=201688&r2=201689&view=diff
==============================================================================
--- struts/sandbox/trunk/overdrive/PhoneBook/Web/AppGridHelper.cs (original)
+++ struts/sandbox/trunk/overdrive/PhoneBook/Web/AppGridHelper.cs Fri Jun 24 16:04:12 2005
@@ -4,12 +4,11 @@
namespace PhoneBook.Web
{
-
public class AppGridHelper : GridViewHelper
{
public override IEntryList NewEntryList ()
{
- return new AppEntryList();
+ return new AppEntryList ();
}
}
-}
+}
\ No newline at end of file
Modified: struts/sandbox/trunk/overdrive/PhoneBook/Web/Forms/Directory.aspx.cs
URL: http://svn.apache.org/viewcvs/struts/sandbox/trunk/overdrive/PhoneBook/Web/Forms/Directory.aspx.cs?rev=201689&r1=201688&r2=201689&view=diff
==============================================================================
--- struts/sandbox/trunk/overdrive/PhoneBook/Web/Forms/Directory.aspx.cs (original)
+++ struts/sandbox/trunk/overdrive/PhoneBook/Web/Forms/Directory.aspx.cs Fri Jun 24 16:04:12 2005
@@ -1,8 +1,8 @@
using System;
using System.Collections;
+using System.Web.UI;
using System.Web.UI.WebControls;
using Nexus.Core.Helpers;
-using System.Web.UI;
namespace PhoneBook.Web.Forms
{
@@ -12,7 +12,6 @@
///
public class Directory : Page
{
-
#region Messages
private const string msg_LIST_ALL_CMD = "SHOW ALL";
Modified: struts/sandbox/trunk/overdrive/PhoneBook/Web/Forms/Directory2.aspx.cs
URL: http://svn.apache.org/viewcvs/struts/sandbox/trunk/overdrive/PhoneBook/Web/Forms/Directory2.aspx.cs?rev=201689&r1=201688&r2=201689&view=diff
==============================================================================
--- struts/sandbox/trunk/overdrive/PhoneBook/Web/Forms/Directory2.aspx.cs (original)
+++ struts/sandbox/trunk/overdrive/PhoneBook/Web/Forms/Directory2.aspx.cs Fri Jun 24 16:04:12 2005
@@ -11,7 +11,6 @@
///
public class Directory2 : BaseGridPage
{
-
#region Messages
private const string msg_FILTER = "Select a filter to display fewer entries";
@@ -44,11 +43,9 @@
/// </summary>
protected override string Page_Prompt
{
- set
- {
- lblPrompt.Text = value;
- }
+ set { lblPrompt.Text = value; }
}
+
#endregion
#region Find -- Display Find controls
@@ -99,7 +96,7 @@
}
if (except != null) except.SelectedIndex = exceptIndex;
// Update other members
- List_ResetIndex();
+ List_ResetIndex ();
Page_Prompt = msg_FILTER;
}
@@ -133,12 +130,9 @@
pnlList.Visible = true;
pnlError.Visible = false;
if (!IsPostBack)
- {
Page_Prompt = msg_FILTER;
- }
}
#endregion
-
}
}
Modified: struts/sandbox/trunk/overdrive/PhoneBook/Web/Resources/Command/AppBase.xml
URL: http://svn.apache.org/viewcvs/struts/sandbox/trunk/overdrive/PhoneBook/Web/Resources/Command/AppBase.xml?rev=201689&r1=201688&r2=201689&view=diff
==============================================================================
--- struts/sandbox/trunk/overdrive/PhoneBook/Web/Resources/Command/AppBase.xml (original)
+++ struts/sandbox/trunk/overdrive/PhoneBook/Web/Resources/Command/AppBase.xml Fri Jun 24 16:04:12 2005
@@ -12,7 +12,7 @@
<object id="BaseKeyValueProcessor" type="Nexus.Core.Validators.KeyValueProcessor"/>
<!-- All child helpers must also specify singleton=false; otherwise, Context is shared. -->
- <object id="BaseHelper" type="PhoneBook.Web.AppHelper, PhoneBook.Web" singleton="false">
+ <object id="BaseHelper" type="Nexus.Web.Helpers.WebViewHelper, Nexus.Web" singleton="false">
<property name="Catalog">
<ref object="Catalog" />
</property>
Modified: struts/sandbox/trunk/overdrive/PhoneBook/Web/Web.csproj
URL: http://svn.apache.org/viewcvs/struts/sandbox/trunk/overdrive/PhoneBook/Web/Web.csproj?rev=201689&r1=201688&r2=201689&view=diff
==============================================================================
--- struts/sandbox/trunk/overdrive/PhoneBook/Web/Web.csproj (original)
+++ struts/sandbox/trunk/overdrive/PhoneBook/Web/Web.csproj Fri Jun 24 16:04:12 2005
@@ -149,11 +149,6 @@
BuildAction = "Compile"
/>
<File
- RelPath = "AppHelper.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
RelPath = "AssemblyInfo.cs"
SubType = "Code"
BuildAction = "Compile"
@@ -256,10 +251,6 @@
/>
<File
RelPath = "Resources\Query\FilterLists.xml"
- BuildAction = "Content"
- />
- <File
- RelPath = "Resources\Query\properties.xml"
BuildAction = "Content"
/>
<File
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org