struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hus...@apache.org
Subject svn commit: r202033 - in /struts/sandbox/trunk/overdrive/PhoneBook: Core/ Test/Resources/Command/ Test/Resources/Query/ Web/ Web/Forms/ Web/Resources/ Web/Resources/Command/
Date Mon, 27 Jun 2005 19:16:42 GMT
Author: husted
Date: Mon Jun 27 12:16:40 2005
New Revision: 202033

URL: http://svn.apache.org/viewcvs?rev=202033&view=rev
Log:
OVR-5
* Rename "filer" to "entry_list"
* Tweak token names
* Move text constants to message resource.

Added:
    struts/sandbox/trunk/overdrive/PhoneBook/Web/Resources/Messages.resx
Modified:
    struts/sandbox/trunk/overdrive/PhoneBook/Core/App.cs
    struts/sandbox/trunk/overdrive/PhoneBook/Test/Resources/Command/AppConfig.xml
    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/Web/AppGridHelper.cs
    struts/sandbox/trunk/overdrive/PhoneBook/Web/Forms/Directory2.aspx.cs
    struts/sandbox/trunk/overdrive/PhoneBook/Web/Resources/Command/AppConfig.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=202033&r1=202032&r2=202033&view=diff
==============================================================================
--- struts/sandbox/trunk/overdrive/PhoneBook/Core/App.cs (original)
+++ struts/sandbox/trunk/overdrive/PhoneBook/Core/App.cs Mon Jun 27 12:16:40 2005
@@ -27,6 +27,8 @@
 			// No need to construct static helper class
 		}
 
+		#region Properties
+
 		/// <summary>
 		/// Token for entry_key property.
 		/// </summary>
@@ -75,6 +77,10 @@
 		/// 
 		public const string EDITOR = "editor";
 
+		#endregion 
+
+		#region Commands
+
 		/// <summary>
 		/// Token for select all command.
 		/// </summary>
@@ -123,6 +129,10 @@
 		/// 
 		public const string DIRECTORY_VIEW = "directory_view";
 
+		#endregion
+
+		#region Helpers
+
 		/// <summary>
 		/// Token for Directory Find helper.
 		/// </summary>
@@ -134,5 +144,13 @@
 		/// </summary>
 		/// 
 		public const string DIRECTORY_LIST_HELPER = "directory_list_helper";
+
+		#endregion
+
+		#region Messages
+
+		public const string PAGE_PROMPT_TEXT = "PagePrompt.Text";
+
+		#endregion 
 	}
 }

Modified: struts/sandbox/trunk/overdrive/PhoneBook/Test/Resources/Command/AppConfig.xml
URL: http://svn.apache.org/viewcvs/struts/sandbox/trunk/overdrive/PhoneBook/Test/Resources/Command/AppConfig.xml?rev=202033&r1=202032&r2=202033&view=diff
==============================================================================
--- struts/sandbox/trunk/overdrive/PhoneBook/Test/Resources/Command/AppConfig.xml (original)
+++ struts/sandbox/trunk/overdrive/PhoneBook/Test/Resources/Command/AppConfig.xml Mon Jun
27 12:16:40 2005
@@ -14,7 +14,7 @@
 				<ref object="user_name"/> 
 				<ref object="hired"/> 
 				<ref object="hours"/> 				
-				<ref object="_filter"/> 
+				<ref object="_entry_list"/> 
 				<ref object="_extension_list"/>
 				<ref object="_hired_list"/>
 			</list>
@@ -63,10 +63,14 @@
 		<property name="Label"><value>Hours</value></property>	
 	</object>
 	
+	<object id="editor" parent="BaseFieldContext">
+		<property name="ID"><value>editor</value></property>	
+		<property name="Label"><value>Editor?</value></property>	
+	</object>
 
 	<!-- We need to "hash" the name with "_" to avoid conflict with the filter Command -->
-	<object id="_filter" parent="BaseFieldContext">
-		<property name="ID"><value>filter</value></property>
+	<object id="_entry_list" parent="BaseFieldContext">
+		<property name="ID"><value>entry_list</value></property>
 		<property name="ProcessorID"><value>EntryListProcessor</value></property>
 	</object>
 		

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=202033&r1=202032&r2=202033&view=diff
==============================================================================
--- struts/sandbox/trunk/overdrive/PhoneBook/Test/Resources/Command/Catalog.xml (original)
+++ struts/sandbox/trunk/overdrive/PhoneBook/Test/Resources/Command/Catalog.xml Mon Jun 27
12:16:40 2005
@@ -3,12 +3,14 @@
   "http://www.springframework.net/dtd/spring-objects.dtd">
 <objects>
 
-	<!-- filter command -->
+	<!-- entry commands -->
 
-  <object id="filter" type="PhoneBook.Core.Commands.BaseList, PhoneBook.Core">
+  <object id="entry_list" type="PhoneBook.Core.Commands.BaseList, PhoneBook.Core">
+		<property name="ID"><value>entry_list</value></property>
+		<property name="QueryID"><value>entry</value></property>
 		<property name="RelatedIDs">
 			<list>
-				<value>filter</value>
+				<value>entry_list</value>
 				<value>entry_key</value>
 				<value>last_name</value>
 				<value>first_name</value>
@@ -16,10 +18,28 @@
 				<value>user_name</value>
 				<value>hired</value>
 				<value>hours</value>
+				<value>editor</value>
 			</list>
 		</property>
-		<property name="ID"><value>filter</value></property>
   </object>
+  
+  <object id="entry" type="PhoneBook.Core.Commands.BaseEntry, PhoneBook.Core">
+		<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 -->
 		
@@ -73,7 +93,7 @@
 	</object>
 	
 		
-  <!-- directory-1 helpers -->
+  <!-- directory1 helpers -->
 
   <object id="directory_find_helper" parent="BaseHelper" singleton="false">
 		<property name="Command">
@@ -83,11 +103,11 @@
 
   <object id="directory_list_helper" parent="BaseHelper" singleton="false">
 		<property name="Command">
-			<ref object="filter" />
+			<ref object="entry_list" />
 		</property>
   </object>
   
-  <!-- directory-2 helpers -->
+  <!-- directory2 helpers -->
   
   	<object id="BaseGridHelper" type="PhoneBook.Web.AppGridHelper, PhoneBook.Web" singleton="false">
 		<property name="Catalog">
@@ -119,6 +139,7 @@
 				<ref object="user_name"/>
 				<ref object="hired"/> 
 				<ref object="hours"/>
+				<ref object="editor"/>
 			</list>
 		</property>
 	</object>  
@@ -155,8 +176,15 @@
 				<value>user_name</value>
 				<value>hours</value>
 				<value>hired</value>
+				<value>editor</value>
 			</list>
 		</property>
 	</object>
-  
+
+  <object id="directory_entry_helper" parent="BaseHelper" singleton="false">
+		<property name="Command">
+			<ref object="entry" />
+		</property>
+  </object>
+	  
 </objects>

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=202033&r1=202032&r2=202033&view=diff
==============================================================================
--- struts/sandbox/trunk/overdrive/PhoneBook/Test/Resources/Query/SelectAll.xml (original)
+++ struts/sandbox/trunk/overdrive/PhoneBook/Test/Resources/Query/SelectAll.xml Mon Jun 27
12:16:40 2005
@@ -21,7 +21,7 @@
   	</parameterMaps>
 		
 	<statements>
-		<select id="filter" paramClass="Hashtable" resultClass="Hashtable">
+		<select id="entry" paramClass="Hashtable" resultClass="Hashtable">
 			SELECT 
 				last_name,
 				first_name,
@@ -68,9 +68,10 @@
 				user_name,
 				hired,
 				hours,
+				editor
 				pk_entry
 				)
-			VALUES (?,?,?,?, ?,?,?)
+			VALUES (?,?,?,?, ?,?,?,?)
 		</insert>		
 
 		<update id="entry_update" parameterMap="entry_save_param">
@@ -80,7 +81,8 @@
 				extension=?,
 				user_name=?,
 				hired=?,
-				hours=?
+				hours=?,
+				editor=?
 			WHERE 
 				pk_entry=?
 		</update>

Modified: struts/sandbox/trunk/overdrive/PhoneBook/Web/AppGridHelper.cs
URL: http://svn.apache.org/viewcvs/struts/sandbox/trunk/overdrive/PhoneBook/Web/AppGridHelper.cs?rev=202033&r1=202032&r2=202033&view=diff
==============================================================================
--- struts/sandbox/trunk/overdrive/PhoneBook/Web/AppGridHelper.cs (original)
+++ struts/sandbox/trunk/overdrive/PhoneBook/Web/AppGridHelper.cs Mon Jun 27 12:16:40 2005
@@ -1,3 +1,5 @@
+using System.Web.UI;
+using System.Web.UI.WebControls;
 using Nexus;
 using Nexus.Core;
 using PhoneBook.Core;
@@ -18,5 +20,25 @@
 			set { _HasEditColumn = value; }
 		}
 
+		public virtual int BindEditorColumn (DataGrid grid, int i)
+		{
+			TemplateColumn master = new TemplateColumn();
+			ColumnTemplate column = new ColumnTemplate();
+			master.ItemTemplate = column; 
+			grid.Columns.AddAt (i, master);
+			return ++i;
+		}
+	}
+
+	public class ColumnTemplate : ITemplate 
+	{ 
+		public void InstantiateIn(Control container) 
+		{ 
+			Label myLabel = new Label();
+			myLabel.Text="Check to delete";
+			CheckBox mycheckbox = new CheckBox();
+			container.Controls.Add(myLabel); 
+			container.Controls.Add(mycheckbox); 
+		} 
 	}
 }

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=202033&r1=202032&r2=202033&view=diff
==============================================================================
--- struts/sandbox/trunk/overdrive/PhoneBook/Web/Forms/Directory2.aspx.cs (original)
+++ struts/sandbox/trunk/overdrive/PhoneBook/Web/Forms/Directory2.aspx.cs Mon Jun 27 12:16:40
2005
@@ -14,12 +14,6 @@
 	/// 
 	public class Directory2 : BaseGridPage
 	{
-		#region Messages
-
-		private const string msg_FILTER = "Select a filter to display fewer entries";
-		private const string msg_LIST_ALL_CMD = "SHOW ALL";
-
-		#endregion
 
 		#region Helpers 
 
@@ -128,8 +122,8 @@
 
 		protected override void Find_Init ()
 		{
-			cmdListAll.Text = msg_LIST_ALL_CMD;
 			cmdListAll.Click += new EventHandler (ListAll_Click);
+			// cmdListAll.Text = msg_LIST_ALL_CMD;
 
 			foreach (DropDownList filter in FilterList ())
 			{
@@ -149,7 +143,7 @@
 			if (except != null) except.SelectedIndex = exceptIndex;
 			// Update other members
 			List_ResetIndex ();
-			Page_Prompt = msg_FILTER;
+			Page_Prompt = GetMessage(App.PAGE_PROMPT_TEXT);
 		}
 
 		protected override void Find_Submit (object sender, EventArgs e)
@@ -187,11 +181,19 @@
 			GridHelper.HasEditColumn = Profile.IsEditor;
 			if (!IsPostBack)
 			{
-				Page_Prompt = msg_FILTER;
+				Page_Prompt = GetMessage("PagePrompt.Text");
 				lblUser.Text = Profile.UserId;
+				// UserLocale = Profile.Locale;
 			}
 		}
 
+		protected override void Page_PreRender(object sender, EventArgs e)
+		{
+			base.Page_PreRender(sender,e);
+			cmdListAll.Text = GetMessage("cmdListAll.Text");
+		}
+
 		#endregion
+
 	}
 }

Modified: struts/sandbox/trunk/overdrive/PhoneBook/Web/Resources/Command/AppConfig.xml
URL: http://svn.apache.org/viewcvs/struts/sandbox/trunk/overdrive/PhoneBook/Web/Resources/Command/AppConfig.xml?rev=202033&r1=202032&r2=202033&view=diff
==============================================================================
--- struts/sandbox/trunk/overdrive/PhoneBook/Web/Resources/Command/AppConfig.xml (original)
+++ struts/sandbox/trunk/overdrive/PhoneBook/Web/Resources/Command/AppConfig.xml Mon Jun 27
12:16:40 2005
@@ -3,6 +3,17 @@
   "http://www.springframework.net/dtd/spring-objects.dtd">
 <objects>
 
+ <!-- Message Source -->
+
+	<object id="messageSource" type="Spring.Context.Support.ResourceSetMessageSource, Spring.Core">
+        <property name="ResourceManagers">
+            <list>
+                <value>Nexus.Web.Messages, Nexus.Web</value>
+                <value>PhoneBook.Web.Resources.Messages, PhoneBook.Web</value>
+            </list>
+        </property>    
+    </object>
+
  <!-- FieldTable -->
  				
 	<object id="FieldTable" type="Nexus.Core.Tables.FieldTable">

Added: struts/sandbox/trunk/overdrive/PhoneBook/Web/Resources/Messages.resx
URL: http://svn.apache.org/viewcvs/struts/sandbox/trunk/overdrive/PhoneBook/Web/Resources/Messages.resx?rev=202033&view=auto
==============================================================================
--- struts/sandbox/trunk/overdrive/PhoneBook/Web/Resources/Messages.resx (added)
+++ struts/sandbox/trunk/overdrive/PhoneBook/Web/Resources/Messages.resx Mon Jun 27 12:16:40
2005
@@ -0,0 +1,51 @@
+<?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="cmdListAll.Text">
+      <value>SHOW ALL</value>
+    </data>
+  
+    <data name="PagePrompt.Text">
+	  <value>Select a filter to display fewer entries</value>
+    </data>
+	
+</root>

Modified: struts/sandbox/trunk/overdrive/PhoneBook/Web/Web.csproj
URL: http://svn.apache.org/viewcvs/struts/sandbox/trunk/overdrive/PhoneBook/Web/Web.csproj?rev=202033&r1=202032&r2=202033&view=diff
==============================================================================
--- struts/sandbox/trunk/overdrive/PhoneBook/Web/Web.csproj (original)
+++ struts/sandbox/trunk/overdrive/PhoneBook/Web/Web.csproj Mon Jun 27 12:16:40 2005
@@ -234,6 +234,10 @@
                     BuildAction = "Content"
                 />
                 <File
+                    RelPath = "Resources\Messages.resx"
+                    BuildAction = "EmbeddedResource"
+                />
+                <File
                     RelPath = "Resources\Command\AppBase.xml"
                     BuildAction = "Content"
                 />



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


Mime
View raw message