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/09 20:05:14 UTC

svn commit: r189783 - in /struts/sandbox/trunk/overdrive/Nexus: Extras/Spring/Objects.cs Test/BaseNexusTest.cs Test/Objects.xml Test/Resources/Command/AppBase.xml Test/Resources/Command/AppConfig.xml Test/Resources/Command/AppFields.xml Test/bin/ Web/Web.csproj

Author: husted
Date: Thu Jun  9 11:05:13 2005
New Revision: 189783

URL: http://svn.apache.org/viewcvs?rev=189783&view=rev
Log:
OVR-8
* Update controller to use bootstrap Objects.xml

Added:
    struts/sandbox/trunk/overdrive/Nexus/Test/Objects.xml
    struts/sandbox/trunk/overdrive/Nexus/Test/Resources/Command/AppBase.xml
    struts/sandbox/trunk/overdrive/Nexus/Test/Resources/Command/AppFields.xml
    struts/sandbox/trunk/overdrive/Nexus/Test/bin/
Removed:
    struts/sandbox/trunk/overdrive/Nexus/Test/Resources/Command/AppConfig.xml
Modified:
    struts/sandbox/trunk/overdrive/Nexus/Extras/Spring/Objects.cs
    struts/sandbox/trunk/overdrive/Nexus/Test/BaseNexusTest.cs
    struts/sandbox/trunk/overdrive/Nexus/Web/Web.csproj

Modified: struts/sandbox/trunk/overdrive/Nexus/Extras/Spring/Objects.cs
URL: http://svn.apache.org/viewcvs/struts/sandbox/trunk/overdrive/Nexus/Extras/Spring/Objects.cs?rev=189783&r1=189782&r2=189783&view=diff
==============================================================================
--- struts/sandbox/trunk/overdrive/Nexus/Extras/Spring/Objects.cs (original)
+++ struts/sandbox/trunk/overdrive/Nexus/Extras/Spring/Objects.cs Thu Jun  9 11:05:13 2005
@@ -1,36 +1,30 @@
-/*
- * 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 Spring.Context;
 using Spring.Context.Support;
 using Spring.Objects.Factory.Xml;
 
-namespace Nexus.Extras.Spring
+namespace Agility.Extras.Spring
 {
 	/// <summary>
-	/// A singleton configuration loader for Spring. 
+	/// A singleton implementation of the IHelper protocol, 
+	/// using static methods and the Spring object factory.
 	/// </summary>
+	/// <remarks>
+	/// <p>
+	/// Since static methods are used here, as a convenience, 
+	/// it is not possible to implement IHelper. 
+	/// However, the same method signatures are otherwise used.
+	/// </p>
+	/// <p>
+	/// Of course, an alternative is to provide the Factory
+	/// method a singlton, and then obtain the Helpers 
+	/// class from the Factory, but implementing the 
+	/// IHelpers interface as a singleton seems simpler.
+	/// </p>
+	/// </remarks>
 	public class Objects
 	{
-		// Controller: Obviously, this should be configurable, like iBATIS. 
-
-		private static string[] files = {
-			"/Resources/Command/AppConfig.xml",
-			"/Resources/Command/Catalog.xml"
-		};
+		private static string FILE = "/Objects.xml";
 
 		private Objects ()
 		{
@@ -48,19 +42,12 @@
 			{
 				lock (typeof (XmlObjectFactory))
 				{
-					int i = 0;
-					string[] foo = new string[files.Length];
-					foreach (string f in files)
-					{
-						foo [i] = "file://" + _rootDirectory + f;
-						i++;
-					}
+					string foo = "file://" + _rootDirectory + FILE;
 					if (_Factory == null) // double-check 
 						_Factory = new XmlApplicationContext (foo);
 				}
 			}
 			return _Factory;
 		}
-
 	}
 }

Modified: struts/sandbox/trunk/overdrive/Nexus/Test/BaseNexusTest.cs
URL: http://svn.apache.org/viewcvs/struts/sandbox/trunk/overdrive/Nexus/Test/BaseNexusTest.cs?rev=189783&r1=189782&r2=189783&view=diff
==============================================================================
--- struts/sandbox/trunk/overdrive/Nexus/Test/BaseNexusTest.cs (original)
+++ struts/sandbox/trunk/overdrive/Nexus/Test/BaseNexusTest.cs Thu Jun  9 11:05:13 2005
@@ -16,6 +16,7 @@
 using System.Collections;
 using System.Text;
 using Agility.Core;
+using Agility.Extras.Spring;
 using Nexus.Extras.Spring;
 using NUnit.Framework;
 using Spring.Context;

Added: struts/sandbox/trunk/overdrive/Nexus/Test/Objects.xml
URL: http://svn.apache.org/viewcvs/struts/sandbox/trunk/overdrive/Nexus/Test/Objects.xml?rev=189783&view=auto
==============================================================================
--- struts/sandbox/trunk/overdrive/Nexus/Test/Objects.xml (added)
+++ struts/sandbox/trunk/overdrive/Nexus/Test/Objects.xml Thu Jun  9 11:05:13 2005
@@ -0,0 +1,10 @@
+<?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">
+
+	<object id="Base" />
+	
+	<import resource="Resources/Command/Catalog.xml"/>
+	
+</objects>

Added: struts/sandbox/trunk/overdrive/Nexus/Test/Resources/Command/AppBase.xml
URL: http://svn.apache.org/viewcvs/struts/sandbox/trunk/overdrive/Nexus/Test/Resources/Command/AppBase.xml?rev=189783&view=auto
==============================================================================
--- struts/sandbox/trunk/overdrive/Nexus/Test/Resources/Command/AppBase.xml (added)
+++ struts/sandbox/trunk/overdrive/Nexus/Test/Resources/Command/AppBase.xml Thu Jun  9 11:05:13 2005
@@ -0,0 +1,29 @@
+<?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 Elements (parents)-->
+ 
+ <object id="BaseLogic" >
+ </object>
+ 
+ <object id="BaseMapper" >
+     <property name="Mapper"><ref object="Mapper"/></property>
+ </object>
+ 
+ <object id="BaseController" >
+     <property name="Controller"><ref object="Controller" /></property>
+ </object>
+
+ <object id="BaseChain" />
+ 
+ <!-- ISSUE: We should have a parent for each of the standard base commands. -->
+ 
+ <object id="BaseHelper" singleton="false" scope="request" >
+	<property name="Controller">
+		<ref object="Controller" />
+	</property>
+</object>
+			
+</objects>
\ No newline at end of file

Added: struts/sandbox/trunk/overdrive/Nexus/Test/Resources/Command/AppFields.xml
URL: http://svn.apache.org/viewcvs/struts/sandbox/trunk/overdrive/Nexus/Test/Resources/Command/AppFields.xml?rev=189783&view=auto
==============================================================================
--- struts/sandbox/trunk/overdrive/Nexus/Test/Resources/Command/AppFields.xml (added)
+++ struts/sandbox/trunk/overdrive/Nexus/Test/Resources/Command/AppFields.xml Thu Jun  9 11:05:13 2005
@@ -0,0 +1,38 @@
+<?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">
+
+ <!-- FIELD TABLE -->
+ 
+	<object id="FieldTable" type="Agility.Nexus.FieldTable">
+		<property name="AddFields">
+			<list>
+			</list>
+		</property>
+	</object>
+		
+<!-- FIELDS -->
+	
+	 <!-- parent fields -->
+
+ 		<!-- "d" is .NET for "short date" --> 
+	<object id="date" type="Agility.Nexus.FieldContext">
+		<property name="Alert"><value>{0} must be a valid date</value></property>
+		<property name="DataFormat"><value>d</value></property>
+		<property name="DataTypeName"><value>System.DateTime</value></property>
+	</object>
+	
+	<object id="list" type="Agility.Nexus.FieldContext">
+		<property name="ControlTypeName"><value>select</value></property>
+	</object>
+		
+
+	<object id="" type="Agility.Nexus.FieldContext">
+		<property name="ID"><value></value></property>
+	</object>
+
+	 <!-- instance fields (dates and lists) -->	
+	 
+			 
+</objects>
\ No newline at end of file

Modified: struts/sandbox/trunk/overdrive/Nexus/Web/Web.csproj
URL: http://svn.apache.org/viewcvs/struts/sandbox/trunk/overdrive/Nexus/Web/Web.csproj?rev=189783&r1=189782&r2=189783&view=diff
==============================================================================
--- struts/sandbox/trunk/overdrive/Nexus/Web/Web.csproj (original)
+++ struts/sandbox/trunk/overdrive/Nexus/Web/Web.csproj Thu Jun  9 11:05:13 2005
@@ -86,7 +86,7 @@
                 />
                 <Reference
                     Name = "System.XML"
-                    AssemblyName = "System.XML"
+                    AssemblyName = "System.Xml"
                     HintPath = "..\..\..\..\..\..\..\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.XML.dll"
                 />
             </References>
@@ -95,6 +95,7 @@
             <Include>
                 <File
                     RelPath = "AssemblyInfo.cs"
+                    SubType = "Code"
                     BuildAction = "Compile"
                 />
                 <File



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