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/14 19:02:40 UTC
svn commit: r190626 - in /struts/sandbox/trunk/overdrive/Nexus:
Core/Helpers/IViewHelper.cs Core/Helpers/ViewHelper.cs
Core/RequestContext.cs Core/Tokens.cs Extras/Spring/Catalog.cs
Author: husted
Date: Tue Jun 14 10:02:39 2005
New Revision: 190626
URL: http://svn.apache.org/viewcvs?rev=190626&view=rev
Log:
OVR-10
* Implement remaining non-abstract members.
* Modify conventions for Tokens to make properties easier to register.
Modified:
struts/sandbox/trunk/overdrive/Nexus/Core/Helpers/IViewHelper.cs
struts/sandbox/trunk/overdrive/Nexus/Core/Helpers/ViewHelper.cs
struts/sandbox/trunk/overdrive/Nexus/Core/RequestContext.cs
struts/sandbox/trunk/overdrive/Nexus/Core/Tokens.cs
struts/sandbox/trunk/overdrive/Nexus/Extras/Spring/Catalog.cs
Modified: struts/sandbox/trunk/overdrive/Nexus/Core/Helpers/IViewHelper.cs
URL: http://svn.apache.org/viewcvs/struts/sandbox/trunk/overdrive/Nexus/Core/Helpers/IViewHelper.cs?rev=190626&r1=190625&r2=190626&view=diff
==============================================================================
--- struts/sandbox/trunk/overdrive/Nexus/Core/Helpers/IViewHelper.cs (original)
+++ struts/sandbox/trunk/overdrive/Nexus/Core/Helpers/IViewHelper.cs Tue Jun 14 10:02:39 2005
@@ -169,7 +169,7 @@
/// FieldDefinitions
/// </p></remarks>
///
- IList FieldSet { get; }
+ IList FieldSet { get; set; }
/*
// TODO: Messengers
Modified: struts/sandbox/trunk/overdrive/Nexus/Core/Helpers/ViewHelper.cs
URL: http://svn.apache.org/viewcvs/struts/sandbox/trunk/overdrive/Nexus/Core/Helpers/ViewHelper.cs?rev=190626&r1=190625&r2=190626&view=diff
==============================================================================
--- struts/sandbox/trunk/overdrive/Nexus/Core/Helpers/ViewHelper.cs (original)
+++ struts/sandbox/trunk/overdrive/Nexus/Core/Helpers/ViewHelper.cs Tue Jun 14 10:02:39 2005
@@ -57,7 +57,7 @@
#endregion
- #region Messages ...
+ #region Messages
public IDictionary Alerts
{
@@ -103,21 +103,23 @@
get { return Context.FieldTable; }
}
+ private IList _FieldSet;
public IList FieldSet
{
- get { throw new NotImplementedException (); }
+ get { return _FieldSet; }
+ set { _FieldSet = value; }
}
public string Prefix
{
- get { throw new NotImplementedException (); }
- set { throw new NotImplementedException (); }
+ get { return Context[Tokens.Prefix] as string; }
+ set { Context[Tokens.Prefix] = value; }
}
public string ListSuffix
{
- get { throw new NotImplementedException (); }
- set { throw new NotImplementedException (); }
+ get { return Context[Tokens.ListSuffix] as string; }
+ set { Context[Tokens.ListSuffix] = value; }
}
#endregion
@@ -126,24 +128,34 @@
public bool NullIfEmpty
{
- get { throw new NotImplementedException (); }
- set { throw new NotImplementedException (); }
+ get
+ {
+ bool v = (Boolean) Context[Tokens.NullIfEmpty];
+ return v;
+ }
+ set
+ { Boolean b = new Boolean();
+ bool v = b.Equals (true) ? true : false ;
+ Context[Tokens.NullIfEmpty] = v;
+ }
}
+
public string SelectItemPrompt
{
- get { throw new NotImplementedException (); }
- set { throw new NotImplementedException (); }
+ get { return Context[Tokens.SelectItemPrompt] as string; }
+ set { Context[Tokens.SelectItemPrompt] = value; }
}
+
public IRequestCatalog Catalog
{
- get { throw new NotImplementedException (); }
- set { throw new NotImplementedException (); }
+ get { return Context[Tokens.Catalog] as IRequestCatalog; }
+ set { Context[Tokens.Catalog] = value; }
}
+
public IRequestCommand Command
{
- get { throw new NotImplementedException (); }
- set { throw new NotImplementedException (); }
-
+ get { return Context[Tokens.Command] as IRequestCommand; }
+ set { Context[Tokens.Command] = value; }
}
#endregion
Modified: struts/sandbox/trunk/overdrive/Nexus/Core/RequestContext.cs
URL: http://svn.apache.org/viewcvs/struts/sandbox/trunk/overdrive/Nexus/Core/RequestContext.cs?rev=190626&r1=190625&r2=190626&view=diff
==============================================================================
--- struts/sandbox/trunk/overdrive/Nexus/Core/RequestContext.cs (original)
+++ struts/sandbox/trunk/overdrive/Nexus/Core/RequestContext.cs Tue Jun 14 10:02:39 2005
@@ -46,26 +46,26 @@
public string Command
{
- get { return this [Tokens.COMMAND] as string; }
- set { this [Tokens.COMMAND] = value; }
+ get { return this [Tokens.Command] as string; }
+ set { this [Tokens.Command] = value; }
}
public IRequestCommand CommandBin
{
- get { return this [Tokens.COMMAND_BIN] as IRequestCommand; }
- set { this [Tokens.COMMAND_BIN] = value; }
+ get { return this [Tokens.CommandBin] as IRequestCommand; }
+ set { this [Tokens.CommandBin] = value; }
}
public IFieldTable FieldTable
{
- get { return this [Tokens.FIELD_TABLE] as IFieldTable; }
- set { this [Tokens.FIELD_TABLE] = value; }
+ get { return this [Tokens.FieldTable] as IFieldTable; }
+ set { this [Tokens.FieldTable] = value; }
}
public IList FieldSet
{
- get { return this [Tokens.FIELD_SET] as IList; }
- set { this [Tokens.FIELD_SET] = value; }
+ get { return this [Tokens.FieldSet] as IList; }
+ set { this [Tokens.FieldSet] = value; }
}
public bool HasOutcome
@@ -108,34 +108,34 @@
public IDictionary Alerts
{
- get { return this [Tokens.ALERTS] as IDictionary; }
- set { this [Tokens.ALERTS] = value; }
+ get { return this [Tokens.Alerts] as IDictionary; }
+ set { this [Tokens.Alerts] = value; }
}
public void AddAlert (string template)
{
- AddStore (template, Tokens.GENERIC_MESSAGE, Tokens.ALERTS);
+ AddStore (template, Tokens.GenericMessage, Tokens.Alerts);
}
public bool HasAlerts
{
- get { return this.ContainsKey (Tokens.ALERTS); }
+ get { return this.ContainsKey (Tokens.Alerts); }
}
public Exception Fault
{
- get { return this [Tokens.FAULT] as Exception; }
+ get { return this [Tokens.Fault] as Exception; }
set
{
Exception e = value as Exception;
- this [Tokens.FAULT] = e;
+ this [Tokens.Fault] = e;
AddAlert (e.Message);
}
}
public bool HasFault
{
- get { return this.ContainsKey (Tokens.FAULT); }
+ get { return this.ContainsKey (Tokens.Fault); }
}
public bool IsNominal
@@ -145,23 +145,23 @@
public IDictionary Hints
{
- get { return this [Tokens.HINTS] as IDictionary; }
- set { this [Tokens.HINTS] = value; }
+ get { return this [Tokens.Hints] as IDictionary; }
+ set { this [Tokens.Hints] = value; }
}
public void AddHint (string template)
{
- AddStore (template, Tokens.GENERIC_MESSAGE, Tokens.HINTS);
+ AddStore (template, Tokens.GenericMessage, Tokens.Hints);
}
public void AddHint (string template, string queue)
{
- AddStore (template, queue, Tokens.HINTS);
+ AddStore (template, queue, Tokens.Hints);
}
public bool HasHints
{
- get { return this.ContainsKey (Tokens.HINTS); }
+ get { return this.ContainsKey (Tokens.Hints); }
}
}
Modified: struts/sandbox/trunk/overdrive/Nexus/Core/Tokens.cs
URL: http://svn.apache.org/viewcvs/struts/sandbox/trunk/overdrive/Nexus/Core/Tokens.cs?rev=190626&r1=190625&r2=190626&view=diff
==============================================================================
--- struts/sandbox/trunk/overdrive/Nexus/Core/Tokens.cs (original)
+++ struts/sandbox/trunk/overdrive/Nexus/Core/Tokens.cs Tue Jun 14 10:02:39 2005
@@ -19,6 +19,12 @@
/// <summary>
/// Tokens representing context keys.
/// </summary>
+ /// <remarks><p>
+ /// The common convention of using CAPITALS for constants
+ /// is not followed for properties because using the same
+ /// case as the Property simplifies the use of a simple
+ /// template to create new members.
+ /// </p></remarks>
///
public class Tokens
{
@@ -27,69 +33,119 @@
// No need to construct static helper class
}
+ #region Properties
+
+ /*
+ get { return Context[Tokens.Property] as string; }
+ set { Context[Tokens.Property] = value; }
+
+ /// <summary>
+ /// Token for Property property.
+ /// </summary>
+ ///
+ public const string Property = "_Property";
+ */
+
+ /// <summary>
+ /// Token for a generic message property.
+ /// </summary>
+ /// <remarks><p>
+ /// A dot is used to communicate the idea
+ /// that the message catagory has no name
+ /// and to avoid using a language constant
+ /// in a language-neutral content.
+ /// </p></remarks>
+ ///
+ public const string GenericMessage = ".";
+
/// <summary>
/// Token for Command property.
/// </summary>
///
- public const string COMMAND = "__COMMAND";
+ public const string Command = "_Command";
/// <summary>
/// Token for CommandBin property.
/// </summary>
///
- public const string COMMAND_BIN = "__COMMAND_BIN";
+ public const string CommandBin = "_CommandBin";
/// <summary>
/// Token for Alerts property.
/// </summary>
///
- public const string ALERTS = "__ALERTS";
+ public const string Alerts = "_Alerts";
/// <summary>
/// Token for Hints property.
/// </summary>
- public const string HINTS = "__HINTS";
+ public const string Hints = "_Hints";
/// <summary>
/// Token for FieldTable property.
/// </summary>
///
- public const string FIELD_TABLE = "__FIELD_TABLE";
+ public const string FieldTable = "_FieldTable";
/// <summary>
- /// Token for IFieldTable object.
+ /// Token for FieldSet property.
/// </summary>
- public const string FIELD_ID = "FieldTable";
+ ///
+ public const string FieldSet = "_FieldSet";
/// <summary>
- /// Token for FieldSet property.
+ /// Token for Fault property.
/// </summary>
///
- public const string FIELD_SET = "__FIELD_SET";
+ public const string Fault = "_Fault";
/// <summary>
- /// Token for a generic message.
+ /// Token for Prefix property.
/// </summary>
///
- public const string GENERIC_MESSAGE = "__GENERIC_MESSAGE";
+ public const string Prefix = "_Prefix";
/// <summary>
- /// Token for Fault property.
+ /// Token for ListSuffix property.
/// </summary>
///
- public const string FAULT = "__FAULT";
+ public const string ListSuffix = "_ListSuffix";
/// <summary>
- /// Token for pre-op command.
+ /// Token for NullIfEmpty property.
+ /// </summary>
+ ///
+ public const string NullIfEmpty = "_NullIfEmpty";
+
+ /// <summary>
+ /// Token for SelectItemPrompt property.
+ /// </summary>
+ ///
+ public const string SelectItemPrompt = "_SelectItemPrompt";
+
+ /// <summary>
+ /// Token for Catalog property.
+ /// </summary>
+ ///
+ public const string Catalog = "_Catalog";
+
+ #endregion
+
+ #region Command elements
+
+ /// <summary>
+ /// Token for the pre-op command element.
/// </summary>
///
public const string PRE_OP = "pre-op";
/// <summary>
- /// Token for post-op command.
+ /// Token for the post-op command element.
/// </summary>
///
public const string POST_OP = "post-op";
+
+ #endregion
}
}
Modified: struts/sandbox/trunk/overdrive/Nexus/Extras/Spring/Catalog.cs
URL: http://svn.apache.org/viewcvs/struts/sandbox/trunk/overdrive/Nexus/Extras/Spring/Catalog.cs?rev=190626&r1=190625&r2=190626&view=diff
==============================================================================
--- struts/sandbox/trunk/overdrive/Nexus/Extras/Spring/Catalog.cs (original)
+++ struts/sandbox/trunk/overdrive/Nexus/Extras/Spring/Catalog.cs Tue Jun 14 10:02:39 2005
@@ -101,8 +101,8 @@
try
{
context = command.NewContext ();
- context [Tokens.COMMAND_BIN] = command;
- context [Tokens.FIELD_TABLE] = GetFieldTable ();
+ context [Tokens.CommandBin] = command;
+ context [Tokens.FieldTable] = GetFieldTable ();
}
catch (Exception e)
{
@@ -122,7 +122,7 @@
{
IRequestCommand command = GetCommand (name) as IRequestCommand;
context = command.NewContext ();
- context [Tokens.COMMAND_BIN] = command;
+ context [Tokens.CommandBin] = command;
}
catch (Exception e)
{
@@ -148,7 +148,7 @@
public IFieldTable GetFieldTable ()
{
if (_FieldTable == null)
- _FieldTable = GetObject (Tokens.FIELD_ID) as IFieldTable;
+ _FieldTable = GetObject (Tokens.FieldTable) as IFieldTable;
return _FieldTable;
}
@@ -160,7 +160,7 @@
// ISSUE: Add a message about null context
}
- IRequestCommand command = context [Tokens.COMMAND_BIN] as IRequestCommand;
+ IRequestCommand command = context [Tokens.CommandBin] as IRequestCommand;
if (null == command)
{
@@ -191,7 +191,7 @@
public void ExecuteView (IRequestContext context)
{
- IRequestCommand command = context [Tokens.COMMAND_BIN] as IRequestCommand;
+ IRequestCommand command = context [Tokens.CommandBin] as IRequestCommand;
IChain chain = new Chain ();
chain.AddCommand (GetCommand (Tokens.PRE_OP));
chain.AddCommand (command);
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org