diff --git a/Spring.Net.2010.sln b/Spring.Net.2010.sln index 15e4d62b..42b41f3f 100644 --- a/Spring.Net.2010.sln +++ b/Spring.Net.2010.sln @@ -1,6 +1,6 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 2013 -VisualStudioVersion = 12.0.30723.0 +VisualStudioVersion = 12.0.31101.0 MinimumVisualStudioVersion = 10.0.40219.1 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{F04753EF-7A1B-4837-AB63-8C0821E8155D}" ProjectSection(SolutionItems) = preProject @@ -105,6 +105,9 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Spring.Data.NHibernate4.Tes EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Spring.Data.NHibernate4.Integration.Tests.2010", "test\Spring\Spring.Data.NHibernate4.Integration.Tests\Spring.Data.NHibernate4.Integration.Tests.2010.csproj", "{46F8B5E9-ABCF-4306-BC05-FF05B0FAC151}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Spring.Template.Velocity.Castle.2010", "src\Spring\Spring.Template.Velocity.Castle\Spring.Template.Velocity.Castle.2010.csproj", "{250601C0-A4AC-41FE-B484-51A9B0D5473D}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Spring.Template.Velocity.Castle.Tests.2010", "test\Spring\Spring.Template.Velocity.Castle.Tests\Spring.Template.Velocity.Castle.Tests.2010.csproj", "{8D6ED392-8A1F-41C0-A765-22CF384EDEA1}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Spring.Data.NHibernate4.NestedTxSuspension.Integration.Tests", "test\Spring\Spring.Data.NHibernate4.NestedTxSuspension.Integration.Tests\Spring.Data.NHibernate4.NestedTxSuspension.Integration.Tests.csproj", "{DE276F7C-4564-49EC-AABC-B964EC3D1626}" EndProject Global @@ -557,6 +560,26 @@ Global {46F8B5E9-ABCF-4306-BC05-FF05B0FAC151}.Release|Any CPU.Build.0 = Release|Any CPU {46F8B5E9-ABCF-4306-BC05-FF05B0FAC151}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU {46F8B5E9-ABCF-4306-BC05-FF05B0FAC151}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {250601C0-A4AC-41FE-B484-51A9B0D5473D}.Debug|.NET.ActiveCfg = Debug|Any CPU + {250601C0-A4AC-41FE-B484-51A9B0D5473D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {250601C0-A4AC-41FE-B484-51A9B0D5473D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {250601C0-A4AC-41FE-B484-51A9B0D5473D}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {250601C0-A4AC-41FE-B484-51A9B0D5473D}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {250601C0-A4AC-41FE-B484-51A9B0D5473D}.Release|.NET.ActiveCfg = Release|Any CPU + {250601C0-A4AC-41FE-B484-51A9B0D5473D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {250601C0-A4AC-41FE-B484-51A9B0D5473D}.Release|Any CPU.Build.0 = Release|Any CPU + {250601C0-A4AC-41FE-B484-51A9B0D5473D}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {250601C0-A4AC-41FE-B484-51A9B0D5473D}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {8D6ED392-8A1F-41C0-A765-22CF384EDEA1}.Debug|.NET.ActiveCfg = Debug|Any CPU + {8D6ED392-8A1F-41C0-A765-22CF384EDEA1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8D6ED392-8A1F-41C0-A765-22CF384EDEA1}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8D6ED392-8A1F-41C0-A765-22CF384EDEA1}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {8D6ED392-8A1F-41C0-A765-22CF384EDEA1}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {8D6ED392-8A1F-41C0-A765-22CF384EDEA1}.Release|.NET.ActiveCfg = Release|Any CPU + {8D6ED392-8A1F-41C0-A765-22CF384EDEA1}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8D6ED392-8A1F-41C0-A765-22CF384EDEA1}.Release|Any CPU.Build.0 = Release|Any CPU + {8D6ED392-8A1F-41C0-A765-22CF384EDEA1}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {8D6ED392-8A1F-41C0-A765-22CF384EDEA1}.Release|Mixed Platforms.Build.0 = Release|Any CPU {DE276F7C-4564-49EC-AABC-B964EC3D1626}.Debug|.NET.ActiveCfg = Debug|Any CPU {DE276F7C-4564-49EC-AABC-B964EC3D1626}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {DE276F7C-4564-49EC-AABC-B964EC3D1626}.Debug|Any CPU.Build.0 = Debug|Any CPU diff --git a/src/Spring/Spring.Template.Velocity.Castle/AssemblyInfo.cs b/src/Spring/Spring.Template.Velocity.Castle/AssemblyInfo.cs new file mode 100644 index 00000000..81db3173 --- /dev/null +++ b/src/Spring/Spring.Template.Velocity.Castle/AssemblyInfo.cs @@ -0,0 +1,42 @@ +#region License + +/* + * Copyright © 2002-2011 the original author or authors. + * + * 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. + */ + +#endregion + +using System.Reflection; +using System.Runtime.InteropServices; +using System.Security; + +[assembly: ComVisible(false)] +[assembly: AssemblyTitle("Spring.Template.Velocity.Castle")] +[assembly: AssemblyDescription("Castle NVelocity template engine integration for Spring.NET")] + +// +// Security Permissions +// +// we need full, unrestricted access to reflection metadata... +//[assembly: ReflectionPermission(SecurityAction.RequestMinimum, Unrestricted = true)] +//[assembly: AssemblyKeyFile(@"C:\users\aseovic\projects\OpenSource\Spring.Net\Spring.Net.PrivateKey.keys")] +//[assembly: AssemblyKeyFile(@"C:\projects\Spring.Net\Spring.Net.snk")] + +#if !NET_4_0 +[assembly: AllowPartiallyTrustedCallers] + +[assembly: SecurityCritical] + +#endif diff --git a/src/Spring/Spring.Template.Velocity.Castle/Spring.Template.Velocity.Castle.2010.csproj b/src/Spring/Spring.Template.Velocity.Castle/Spring.Template.Velocity.Castle.2010.csproj new file mode 100644 index 00000000..1706c6e7 --- /dev/null +++ b/src/Spring/Spring.Template.Velocity.Castle/Spring.Template.Velocity.Castle.2010.csproj @@ -0,0 +1,126 @@ + + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {250601C0-A4AC-41FE-B484-51A9B0D5473D} + Library + Properties + Spring + Spring.Template.Velocity.Castle + + + + + http://localhost/Spring.Template.Velocity.Castle/ + true + Web + true + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + true + false + true + v4.0 + 3.5 + ..\..\..\ + true + + + true + full + false + ..\..\..\build\VS.NET.2010\Spring.Template.Velocity.Castle\Debug\ + TRACE;DEBUG;NET_4_0 + prompt + 4 + ..\..\..\build\VS.NET.2010\Spring.Template.Velocity.Castle\Debug\Spring.Template.Velocity.xml + true + + + pdbonly + true + ..\..\..\build\VS.NET.2010\Spring.Template.Velocity.Castle\Release\ + TRACE;NET_4_0 + prompt + 4 + true + ..\..\..\build\VS.NET.2010\Spring.Template.Velocity.Castle\Release\Spring.Template.Velocity.XML + + + + ..\..\..\packages\Common.Logging.3.0.0\lib\net40\Common.Logging.dll + + + ..\..\..\packages\Common.Logging.Core.3.0.0\lib\net40\Common.Logging.Core.dll + + + ..\..\..\packages\Castle.NVelocity.1.1.1\lib\net40\NVelocity.dll + + + + + + + CommonAssemblyInfo.cs + + + Template\Velocity\CommonsLoggingLogSystem.cs + + + Template\Velocity\VelocityConstants.cs + + + Template\Velocity\VelocityEngineFactory.cs + + + Template\Velocity\VelocityEngineFactoryObject.cs + + + Template\Velocity\VelocityEngineUtils.cs + + + + + + + + Template\Velocity\Config\spring-nvelocity-1.3.xsd + Designer + + + + + + + + + {710961a3-0df4-49e4-a26e-f5b9c044ac84} + Spring.Core.2010 + + + + + + + Questo progetto fa riferimento a uno o più pacchetti NuGet che non sono presenti sul computer in uso. Abilitare il ripristino dei pacchetti NuGet per scaricarli. Per ulteriori informazioni, visitare http://go.microsoft.com/fwlink/?LinkID=322105. Il file mancante è {0}. + + + + + \ No newline at end of file diff --git a/src/Spring/Spring.Template.Velocity.Castle/Template/Velocity/Config/TemplateNamespaceParser.cs b/src/Spring/Spring.Template.Velocity.Castle/Template/Velocity/Config/TemplateNamespaceParser.cs new file mode 100644 index 00000000..394ccdfa --- /dev/null +++ b/src/Spring/Spring.Template.Velocity.Castle/Template/Velocity/Config/TemplateNamespaceParser.cs @@ -0,0 +1,473 @@ +#region License + +/* + * Copyright 2002-2010 the original author or authors. + * + * 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. + */ + +#endregion + +#region Imports + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Xml; + +using NVelocity.Runtime; + +using Spring.Core.TypeResolution; +using Spring.Objects; +using Spring.Objects.Factory.Config; +using Spring.Objects.Factory.Support; +using Spring.Objects.Factory.Xml; +using Spring.Util; + +#endregion + +namespace Spring.Template.Velocity.Config { + /// + /// Implementation of the custom configuration parser for template configurations + /// based on + /// + /// + /// Erez Mazor + /// + [ + NamespaceParser( + Namespace = "http://www.springframework.net/nvelocity", + SchemaLocationAssemblyHint = typeof(TemplateNamespaceParser), + SchemaLocation = "/Spring.Template.Velocity.Config/spring-nvelocity-1.3.xsd") + ] + public class TemplateNamespaceParser : ObjectsNamespaceParser { + private const string TemplateTypePrefix = "template: "; + + static TemplateNamespaceParser() { + TypeRegistry.RegisterType(TemplateTypePrefix + TemplateDefinitionConstants.NVelocityElement, typeof(VelocityEngineFactoryObject)); + } + + /// + /// Initializes a new instance of the class. + /// + public TemplateNamespaceParser() { + } + + /// + public override IObjectDefinition ParseElement(XmlElement element, ParserContext parserContext) { + string name = element.GetAttribute(ObjectDefinitionConstants.IdAttribute); + IConfigurableObjectDefinition templateDefinition = ParseTemplateDefinition(element, parserContext); + if (!StringUtils.HasText(name)) { + name = ObjectDefinitionReaderUtils.GenerateObjectName(templateDefinition, parserContext.Registry); + } + parserContext.Registry.RegisterObjectDefinition(name, templateDefinition); + return null; + } + + /// + /// Parse a template definition from the templating namespace + /// + /// the root element defining the templating object + /// the parser context + /// + private IConfigurableObjectDefinition ParseTemplateDefinition(XmlElement element, ParserContext parserContext) { + switch (element.LocalName) { + case TemplateDefinitionConstants.NVelocityElement: + return ParseNVelocityEngine(element, parserContext); + default: + throw new ArgumentException(string.Format("undefined element for templating namespace: {0}", element.LocalName)); + } + } + + /// + /// Parses the object definition for the engine object, configures a single NVelocity template engine based + /// on the element definitions. + /// + /// the root element defining the velocity engine + /// the parser context + private IConfigurableObjectDefinition ParseNVelocityEngine(XmlElement element, ParserContext parserContext) { + string typeName = GetTypeName(element); + IConfigurableObjectDefinition configurableObjectDefinition = parserContext.ReaderContext.ObjectDefinitionFactory.CreateObjectDefinition( + typeName, null, parserContext.ReaderContext.Reader.Domain); + + string preferFileSystemAccess = GetAttributeValue(element, TemplateDefinitionConstants.AttributePreferFileSystemAccess); + string overrideLogging = GetAttributeValue(element, TemplateDefinitionConstants.AttributeOverrideLogging); + string configFile = GetAttributeValue(element, TemplateDefinitionConstants.AttributeConfigFile); + + MutablePropertyValues objectDefinitionProperties = new MutablePropertyValues(); + if (StringUtils.HasText(preferFileSystemAccess)) { + objectDefinitionProperties.Add(TemplateDefinitionConstants.PropertyPreferFileSystemAccess, preferFileSystemAccess); + } + + if (StringUtils.HasText(overrideLogging)) { + objectDefinitionProperties.Add(TemplateDefinitionConstants.PropertyOverrideLogging, overrideLogging); + } + + if (StringUtils.HasText(configFile)) { + objectDefinitionProperties.Add(TemplateDefinitionConstants.PropertyConfigFile, configFile); + } + + XmlNodeList childElements = element.ChildNodes; + if (childElements.Count > 0) { + ParseChildDefinitions(childElements, parserContext, objectDefinitionProperties); + } + configurableObjectDefinition.PropertyValues = objectDefinitionProperties; + return configurableObjectDefinition; + } + + /// + /// Parses child element definitions for the NVelocity engine. Typically resource loaders and locally defined properties are parsed here + /// + /// the XmlNodeList representing the child configuration of the root NVelocity engine element + /// the parser context + /// the MutablePropertyValues used to configure this object + private void ParseChildDefinitions(XmlNodeList childElements, ParserContext parserContext, MutablePropertyValues objectDefinitionProperties) { + IDictionary properties = new Dictionary(); + + foreach (XmlElement element in childElements) { + switch (element.LocalName) { + case TemplateDefinitionConstants.ElementResourceLoader: + ParseResourceLoader(element, objectDefinitionProperties, properties); + break; + case TemplateDefinitionConstants.ElementNVelocityProperties: + ParseNVelocityProperties(element, parserContext, properties); + break; + } + } + + if (properties.Count > 0) { + objectDefinitionProperties.Add(TemplateDefinitionConstants.PropertyVelocityProperties, properties); + } + } + + /// + /// Configures the NVelocity resource loader definitions from the xml definition + /// + /// the root resource loader element + /// the MutablePropertyValues used to configure this object + /// the properties used to initialize the velocity engine + private void ParseResourceLoader(XmlElement element, MutablePropertyValues objectDefinitionProperties, IDictionary properties) { + string caching = GetAttributeValue(element, TemplateDefinitionConstants.AttributeTemplateCaching); + string defaultCacheSize = GetAttributeValue(element, TemplateDefinitionConstants.AttributeDefaultCacheSize); + string modificationCheckInterval = GetAttributeValue(element, TemplateDefinitionConstants.AttributeModificationCheckInterval); + + if (!string.IsNullOrEmpty(defaultCacheSize)) { + properties.Add(RuntimeConstants.RESOURCE_MANAGER_DEFAULTCACHE_SIZE, defaultCacheSize); + } + + XmlNodeList loaderElements = element.ChildNodes; + switch (loaderElements[0].LocalName) { + case VelocityConstants.File: + AppendFileLoaderProperties(loaderElements, properties); + AppendResourceLoaderGlobalProperties(properties, VelocityConstants.File, caching, + modificationCheckInterval); + break; + case VelocityConstants.Assembly: + AppendAssemblyLoaderProperties(loaderElements, properties); + AppendResourceLoaderGlobalProperties(properties, VelocityConstants.Assembly, caching, null); + break; + case TemplateDefinitionConstants.Spring: + AppendResourceLoaderPaths(loaderElements, objectDefinitionProperties); + AppendResourceLoaderGlobalProperties(properties, TemplateDefinitionConstants.Spring, caching, null); + break; + case TemplateDefinitionConstants.Custom: + XmlElement firstElement = (XmlElement)loaderElements.Item(0); + AppendCustomLoaderProperties(firstElement, properties); + AppendResourceLoaderGlobalProperties(properties, firstElement.LocalName, caching, modificationCheckInterval); + break; + default: + throw new ArgumentException(string.Format("undefined element for resource loadre type: {0}", element.LocalName)); + } + } + + + /// + /// Set the caching and modification interval checking properties of a resource loader of a given type + /// + /// the properties used to initialize the velocity engine + /// type of the resource loader + /// caching flag + /// modification interval value + private void AppendResourceLoaderGlobalProperties(IDictionary properties, string type, string caching, string modificationInterval) { + AppendResourceLoaderGlobalProperty(properties, type, + TemplateDefinitionConstants.PropertyResourceLoaderCaching, + Convert.ToBoolean(caching)); + AppendResourceLoaderGlobalProperty + (properties, type, TemplateDefinitionConstants.PropertyResourceLoaderModificationCheckInterval, Convert.ToInt64(modificationInterval)); + } + + /// + /// Set global velocity resource loader properties (caching, modification interval etc.) + /// + /// the properties used to initialize the velocity engine + /// the type of resource loader + /// the suffix property + /// the value of the property + private void AppendResourceLoaderGlobalProperty(IDictionary properties, string type, string property, object value) { + if (null != value) { + properties.Add(type + VelocityConstants.Separator + property, value); + } + } + + /// + /// Creates a nvelocity file based resource loader by setting the required properties + /// + /// a list of nv:file elements defining the paths to template files + /// the properties used to initialize the velocity engine + private void AppendFileLoaderProperties(XmlNodeList elements, IDictionary properties) { + IList paths = new List(elements.Count); + foreach (XmlElement element in elements) + { + paths.Add(GetAttributeValue(element, VelocityConstants.Path)); + } + properties.Add(RuntimeConstants.RESOURCE_LOADER, VelocityConstants.File); + properties.Add(getResourceLoaderProperty(VelocityConstants.File, VelocityConstants.Class), TemplateDefinitionConstants.FileResourceLoaderClass); + properties.Add(getResourceLoaderProperty(VelocityConstants.File, VelocityConstants.Path), StringUtils.CollectionToCommaDelimitedString(paths)); + } + + /// + /// Creates a nvelocity assembly based resource loader by setting the required properties + /// + /// a list of nv:assembly elements defining the assemblies + /// the properties used to initialize the velocity engine + private void AppendAssemblyLoaderProperties(XmlNodeList elements, IDictionary properties) { + IList assemblies = new List(elements.Count); + foreach (XmlElement element in elements) { + assemblies.Add(GetAttributeValue(element, VelocityConstants.Name)); + } + properties.Add(RuntimeConstants.RESOURCE_LOADER, VelocityConstants.Assembly); + properties.Add(getResourceLoaderProperty(VelocityConstants.Assembly, VelocityConstants.Class), TemplateDefinitionConstants.AssemblyResourceLoaderClass); + properties.Add(getResourceLoaderProperty(VelocityConstants.Assembly, VelocityConstants.Assembly), StringUtils.CollectionToCommaDelimitedString(assemblies)); + } + + /// + /// Creates a spring resource loader by setting the ResourceLoaderPaths of the + /// engine factory (the resource loader itself will be created internally either as + /// spring or as file resource loader based on the value of prefer-file-system-access + /// attribute). + /// + /// list of resource loader path elements + /// the MutablePropertyValues to set the property for the engine factory + private void AppendResourceLoaderPaths(XmlNodeList elements, MutablePropertyValues objectDefinitionProperties) { + IList paths = new List(); + foreach (XmlElement element in elements) { + string path = GetAttributeValue(element, TemplateDefinitionConstants.AttributeUri); + paths.Add(path); + } + objectDefinitionProperties.Add(TemplateDefinitionConstants.PropertyResourceLoaderPaths, paths); + } + + /// + /// Create a custom resource loader from an nv:custom element + /// generates the 4 required nvelocity props for a resource loader (name, description, class and path). + /// + /// the nv:custom xml definition element + /// the properties used to initialize the velocity engine + private void AppendCustomLoaderProperties(XmlElement element, IDictionary properties) { + string name = GetAttributeValue(element, VelocityConstants.Name); + string description = GetAttributeValue(element, VelocityConstants.Description); + string type = GetAttributeValue(element, VelocityConstants.Type); + string path = GetAttributeValue(element, VelocityConstants.Path); + properties.Add(RuntimeConstants.RESOURCE_LOADER, name); + properties.Add(getResourceLoaderProperty(name, VelocityConstants.Description), description); + properties.Add(getResourceLoaderProperty(name, VelocityConstants.Class), type.Replace(',', ';')); + properties.Add(getResourceLoaderProperty(name, VelocityConstants.Path), path); + } + + /// + /// Parses the nvelocity properties map using ObjectNamespaceParserHelper + /// and appends it to the properties dictionary + /// + /// root element of the map element + /// the parser context + /// the properties used to initialize the velocity engine + private void ParseNVelocityProperties(XmlElement element, ParserContext parserContext, IDictionary properties) { + IDictionary parsedProperties = ParseDictionaryElement(element, + TemplateDefinitionConstants.ElementNVelocityProperties, parserContext); + foreach (DictionaryEntry entry in parsedProperties) { + properties.Add(Convert.ToString(entry.Key), entry.Value); + } + } + + /// + /// Gets the name of the object type for the specified element. + /// + /// The element. + /// The name of the object type. + private string GetTypeName(XmlElement element) { + string typeName = element.GetAttribute(ObjectDefinitionConstants.TypeAttribute); + if (StringUtils.IsNullOrEmpty(typeName)) { + return TemplateTypePrefix + element.LocalName; + } + return typeName; + } + + /// + /// constructs an nvelocity style resource loader property in the format: + /// prefix.resource.loader.suffix + /// + /// the prefix + /// the suffix + /// a concatenated string like: prefix.resource.loader.suffix + public static string getResourceLoaderProperty(string type, string suffix) { + return type + VelocityConstants.Separator + RuntimeConstants.RESOURCE_LOADER + VelocityConstants.Separator + + suffix; + } + + /// + /// This method is overriden from ObjectsNamespaceParser since when invoked on + /// sub-elements from the objets namespace (e.g., objects:objectMap for nvelocity + /// property map) the element.SelectNodes fails because it is in + /// the nvelocity custom namespace and not the object's namespace (http://www.springframwork.net) + /// to amend this the object's namespace is added to the provided XmlNamespaceManager + /// + /// The element to be searched in. + /// The name of the child nodes to look for. + /// + /// The child s of the supplied + /// with the supplied . + /// + /// + [Obsolete("not used anymore - ObjectsNamespaceParser will be dropped with 2.x, use ObjectDefinitionParserHelper instead")] + protected override XmlNodeList SelectNodes(XmlElement element, string childElementName) { + XmlNamespaceManager nsManager = new XmlNamespaceManager(new NameTable()); + nsManager.AddNamespace(GetNamespacePrefix(element), element.NamespaceURI); + nsManager.AddNamespace(GetNamespacePrefix(element), Namespace); + return element.SelectNodes(GetNamespacePrefix(element) + ":" + childElementName, nsManager); + } + + private string GetNamespacePrefix(XmlElement element) { + return StringUtils.HasText(element.Prefix) ? element.Prefix : "spring"; + } + } + + + + #region Element & Attribute Name Constants + + /// + /// Template definition constants + /// + public class TemplateDefinitionConstants { + /// + /// Engine element definition + /// + public const string NVelocityElement = "engine"; + + /// + /// Spring resource loader element definition + /// + public const string Spring = "spring"; + + /// + /// Custom resource loader element definition + /// + public const string Custom = "custom"; + + /// + /// uri attribute of the spring element + /// + public const string AttributeUri = "uri"; + + /// + /// prefer-file-system-access attribute of the engine factory + /// + public const string AttributePreferFileSystemAccess = "prefer-file-system-access"; + + /// + /// config-file attribute of the engine factory + /// + public const string AttributeConfigFile = "config-file"; + + /// + /// override-logging attribute of the engine factory + /// + public const string AttributeOverrideLogging = "override-logging"; + + /// + /// template-caching attribute of the nvelocity engine + /// + public const string AttributeTemplateCaching = "template-caching"; + + /// + /// default-cache-size attribute of the nvelocity engine resource manager + /// + public const string AttributeDefaultCacheSize = "default-cache-size"; + + /// + /// modification-check-interval attribute of the nvelocity engine resource loader + /// + public const string AttributeModificationCheckInterval = "modification-check-interval"; + + /// + /// resource loader element + /// + public const string ElementResourceLoader = "resource-loader"; + + /// + /// nvelocity propeties element (map) + /// + public const string ElementNVelocityProperties = "nvelocity-properties"; + + /// + /// PreferFileSystemAccess property of the engine factory + /// + public const string PropertyPreferFileSystemAccess = "PreferFileSystemAccess"; + + /// + /// OverrideLogging property of the engine factory + /// + public const string PropertyOverrideLogging = "OverrideLogging"; + + /// + /// ConfigLocation property of the engine factory + /// + public const string PropertyConfigFile = "ConfigLocation"; + + /// + /// ResourceLoaderPaths property of the engine factory + /// + public const string PropertyResourceLoaderPaths = "ResourceLoaderPaths"; + + /// + /// VelocityProperties property of the engine factory + /// + public const string PropertyVelocityProperties = "VelocityProperties"; + + /// + /// resource.loader.cache property of the resource loader configuration + /// + public const string PropertyResourceLoaderCaching = "resource.loader.cache"; + + /// + /// resource.loader.modificationCheckInterval property of the resource loader configuration + /// + public const string PropertyResourceLoaderModificationCheckInterval = "resource.loader.modificationCheckInterval"; + + /// + /// the type used for file resource loader + /// + public const string FileResourceLoaderClass = "NVelocity.Runtime.Resource.Loader.FileResourceLoader; NVelocity"; + + /// + /// the type used for assembly resource loader + /// + public const string AssemblyResourceLoaderClass = "NVelocity.Runtime.Resource.Loader.AssemblyResourceLoader; NVelocity"; + + /// + /// the type used for spring resource loader + /// + public const string SpringResourceLoaderClass = "Spring.Template.Velocity.SpringResourceLoader; Spring.Template.Velocity.Castle"; + } + #endregion +} \ No newline at end of file diff --git a/src/Spring/Spring.Template.Velocity.Castle/Template/Velocity/SpringResourceLoader.cs b/src/Spring/Spring.Template.Velocity.Castle/Template/Velocity/SpringResourceLoader.cs new file mode 100644 index 00000000..68cbd38d --- /dev/null +++ b/src/Spring/Spring.Template.Velocity.Castle/Template/Velocity/SpringResourceLoader.cs @@ -0,0 +1,178 @@ +#region License + +/* + * Copyright 2002-2010 the original author or authors. + * + * 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. + */ + +#endregion + +using System; +using System.IO; +using Common.Logging; +using Commons.Collections; +using NVelocity.Runtime.Resource; +using NVelocity.Runtime.Resource.Loader; +using Spring.Core.IO; + +namespace Spring.Template.Velocity +{ + /// + /// NVelocity's abstract ResourceLoader extension which serves + /// as an adapter that loads templates via a Spring IResourceLoader. + /// + ///
+ /// Used by VelocityEngineFactory for any resource loader path that + /// cannot be resolved to a File or an Assembly or for + /// implementations which rely on spring's IResourceLoader + /// mechanism. + /// + ///
+ /// Important: this loader does not allow for modification detection. + ///
+ /// Expects "spring.resource.loader" (IResourceLoader implementations) + /// and "spring.resource.loader.path" application attributes in the + /// NVelocity runtime. + ///
+ /// + /// + /// + /// + /// + /// Erez Mazor (.NET) + [CLSCompliant(false)] + public class SpringResourceLoader : ResourceLoader + { + /// + /// Prefix used for the NVelocity Configuration + /// + public const string NAME = "spring"; + + /// + /// The IResourceLoader implementation type + /// + public const string SPRING_RESOURCE_LOADER_CLASS = "spring.resource.loader.class"; + + /// + /// A flag indicating weather a template cache is used + /// + public const string SPRING_RESOURCE_LOADER_CACHE = "spring.resource.loader.cache"; + + /// + /// Fully qualified name of the IResourceLoader implementation class + /// + public const string SPRING_RESOURCE_LOADER = "spring.resource.loader"; + + /// + /// A comma delimited list of paths used by the spring IResourceLoader implementation + /// + public const string SPRING_RESOURCE_LOADER_PATH = "spring.resource.loader.path"; + + /// + /// Shared logger instance. + /// + protected static readonly ILog log = LogManager.GetLogger(typeof(SpringResourceLoader)); + + private IResourceLoader resourceLoader; + + private string[] resourceLoaderPaths; + + + /// + /// Initialize the template loader with a resources class. + /// + /// The ExtendedProperties representing the Velocity configuration. + public override void Init(ExtendedProperties configuration) + { + resourceLoader = (IResourceLoader)runtimeServices.GetApplicationAttribute(SPRING_RESOURCE_LOADER); + string resourceLoaderPath = (string)runtimeServices.GetApplicationAttribute(SPRING_RESOURCE_LOADER_PATH); + if (resourceLoader == null) + { + throw new ArgumentException("'resourceLoader' application attribute must be present for SpringResourceLoader"); + } + if (null == resourceLoaderPath) + { + throw new ArgumentException("'resourceLoaderPath' application attribute must be present for SpringResourceLoader"); + } + resourceLoaderPaths = resourceLoaderPath.Split(','); + for (int i = 0; i < resourceLoaderPaths.Length; i++) + { + string path = resourceLoaderPaths[i]; + if (!path.EndsWith("/")) + { + resourceLoaderPaths[i] = path + "/"; + } + } + if (log.IsInfoEnabled) + { + log.Info(string.Format("SpringResourceLoader for Velocity: using resource loader [{0}] and resource loader paths {1}", resourceLoader, resourceLoaderPaths)); + } + } + + /// + /// Get the System.IO.Stream that the Runtime will parse to create a template. + /// + /// the source template name + /// a System.IO.Stream representation of the resource + public override Stream GetResourceStream(string source) + { + if (log.IsDebugEnabled) + { + log.Debug(string.Format("Looking for Velocity resource with name [{0}]", source)); + } + + foreach (string resourceLoaderPath in resourceLoaderPaths) + { + IResource resource = resourceLoader.GetResource(resourceLoaderPath + source); + try + { + return resource.InputStream; + } + catch (IOException ex) + { + if (log.IsErrorEnabled) + { + log.Error(string.Format("Could not find Velocity resource: {0}", resource), ex); + } + } + } + throw new ArgumentException(string.Format("Could not find resource [{0}] in Spring resource loader path", source)); + } + + /// + /// Given a template, check to see if the source of InputStream has been modified. + /// + /// The resource. + /// + /// true if the source of the InputStream has been modified; otherwise, false. + /// + public override bool IsSourceModified(Resource resource) + { + return false; + } + + /// + /// Get the last modified time of the InputStream source + /// that was used to create the template. We need the template + /// here because we have to extract the name of the template + /// in order to locate the InputStream source. + /// + /// The resource. + /// + public override long GetLastModified(Resource resource) + { + return 0; + } + } +} \ No newline at end of file diff --git a/src/Spring/Spring.Template.Velocity.Castle/packages.config b/src/Spring/Spring.Template.Velocity.Castle/packages.config new file mode 100644 index 00000000..2bfbe020 --- /dev/null +++ b/src/Spring/Spring.Template.Velocity.Castle/packages.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/src/Spring/Spring.Web.Conversation.NHibernate3/Spring.Web.Conversation.NHibernate33.XML b/src/Spring/Spring.Web.Conversation.NHibernate3/Spring.Web.Conversation.NHibernate33.XML index 4e9087fd..c6378bc2 100644 --- a/src/Spring/Spring.Web.Conversation.NHibernate3/Spring.Web.Conversation.NHibernate33.XML +++ b/src/Spring/Spring.Web.Conversation.NHibernate3/Spring.Web.Conversation.NHibernate33.XML @@ -1,953 +1,953 @@ - - - - Spring.Web.Conversation.NHibernate33 - - - - - Based on - for support of 'session-per-conversation' pattern. - - Hailton de Castro - - - - The logging instance. - - - - - Initializes a new instance of the class. - Uses default values for - - - - - Initializes a new instance of the class. - - Specify the to be set on each session provided by this instance. - Specify the flushmode to be applied on each session provided by this instance. - - - - - Initializes a new instance of the class. - - An instance holding the scope configuration - - - - Sets a flag, whether this scope is in "open" state on the current logical thread. - - - - - - NOOP. - - - - - Open a new session or reconect the - in . - Participating in an existing session registed with - is not alowed. - - - - - - If there is another conversation with a with opened - . - If attempting to participate in an existing NHibernate - managed by . - - - - - - - Close the current view's session and unregisters - from . - - The session factory that on use - A list of conversations which the session can be closed or disconnected - - - If start/resume a conversation from a - when exists a different - with open registered on - - If the holder on , is not a . - - - - - - Gets the flushmode to be applied on each newly created session. - - - This property defaults to to ensure that modifying objects outside the boundaries - of a transaction will not be persisted. It is recommended to not change this value but wrap any modifying operation - within a transaction. - - - - - Get the configured EntityInterceptor - - - - - Id for conversation that open the Session. - - - - - Gets a flag, whether this scope is in "open" state on the current logical thread. - - - - - This sessionHolder creates a session for the active conversation only if it is - needed (). - - - Although a NHibernateSession defers creation of db-connections until they are really - needed, instantiation a session is still more expensive than using LazySessionHolder. - - - - - Initialize a new instance. - - - - - Create a new session on demand - - - - - Setting for - - Hailton de Castro - - - - Default value for property. - - - - - Initialize a new instance of with default values. - - - Calling this constructor from your derived class leaves - uninitialized. See for more. - - - - - Initialize a new instance of with the given values and references. - - - Specify the to be set on each session provided by the instance. - - - Specify the flushmode to be applied on each session provided by the instance. - - - Calling this constructor marks all properties initialized. - - - - - Override this method to resolve an instance according to your chosen strategy. - - - - - Gets the configured instance to be used. - - - - - - - Gets or Sets the flushmode to be applied on each newly created session. - - - This property defaults to to ensure that modifying objects outside the boundaries - of a transaction will not be persisted. It is recommended to not change this value but wrap any modifying operation - within a transaction. - - - - - HttpModule for ending Conversations with Timeout exceeded. - - Hailton de Castro - - - - Add PostRequestHandlerExecute event to clear conversations with timeout exceeded. - - - - - - Disposes of the resources (other than memory) used by the module that implements . - - - - - Handles the Unload event of the page control. - - The source of the event. - The instance containing the event data. - - Necessary for Redirect or Abort for any reason. - - - - - The Names of the s in the - - - - - Sets the that this - object runs in. - - - -

- Used to obtain the instances of -

-

- Invoked after population of normal object properties but before an - init callback such as - 's - - or a custom init-method. Invoked after the setting of any - 's - - property. -

-
- - In the case of application context initialization errors. - - - If thrown by any application context methods. - - -
- - - manager for Conversations. - - Hailton de Castro - - - - Returns the conversation if it is still alive, otherwise it returns null. - - - - - - - Ends all conversations with the timeout exceeded. - - - - - Close IDbConnections for that - use 'session-per-conversation'. It calls - in all conversations. - - - - - Release the ended conversations And removes them. - If the conversation supports 'session-per-conversation', also close the session. - - - - - Add conversation. If is null - it resolves to 'this'. - - - - If already has another manager. - - - - - Makes the 'root conversation' of - the current active conversation and open/reopen the - if - the conversation supports 'session-per-conversation'. Close all - the connection for all session before. - If is true will end all - paused conversations. - - - - - Returns the active conversation if exists, otherwise returns null. - It depends on - - - - - - If this is non-null run pattern 'session-per-conversation'. - Must be the same SessionFactory of the managed conversations. - - - - - - Ends the "paused conversations" in call to . - Important: Unexpected behavior may occur if there are nested conversations, - as in only the current conversation and its parents - are started, the 'conversations children' remain paused, so these will be ended. - Defaul value: false. - - - When it is true, "start/resume a conversation" will cause the other to be - ended and cleaned up. - - This is useful to avoid memory leak where there are many conversations. - This leak can be very considerable, as the conversation may keep a "NHibernate session" - that can contain many objects in its cache from the database queries. - - - - - - Port to conversation. If the object is not found in the current - conversation, will be tried on the parent if the parent is - not null. - - - If is different from spring name for this instance. - - Hailton de Castro - - - - Starts or resumes the conversation and the . - If is not null, so - is called to - Raise SessionHolder for make the reconnection. - - Make return false. - - Update the . - - - - - If this conversation is ended. - - If is not null and - different from - - - - - - - - Ends the conversation. End each of the 'inner conversations' in - . Returns false if the - conversation and all of - has already been ended. - - - - - If . - Session["spring.objects"] - is null. - - The 'spring session scopes' are not located in the key - 'spring.objects' of HttpSessionState. - - - - - - - Starts or resumes the conversation and each 'inner conversation' in - . - It is not about 'Session-per-conversation' because it is done by - . - - - - - Conversation id. - - - - - Return true until is called. - - - - - Return true if this conversation is ended. - - - - - Inner conversation. After added if the - is null it will resolve to 'this'. - - at - , - , - - if Circular Dependency is detected. - - - - Conversation parent. - - - - If this conversation already has a different parent. - - If this Conversation is not new. - - If Circular Dependency is detected. - - The Parent conversation is not new. - - - - - - - TimeOut for the conversation in milliseconds. - If 0 TimeOut will be ignored. - - - - - Last acces for a value into this Conversation or Inner Conversation. - Reset to DateTime.Now each time - is called. - - - - - Conversation Manager. When this is setted if - - returns null so AddConversation is called. - - - - - that is stored in the root conversation. - - - must support 'session-per-conversation'. - - - - - - If this is non-null run pattern 'session-per-conversation'. - It also depends on and . - must support ConversationManager. - - - - - - If this is non-null run pattern 'session-per-conversation'. - It also depends on and . - must support ConversationManager. - - - - - - Indicates that the conversation is paused. - - - - - List that make validation for Circular Dependency for - - Hailton de Castro - - - - Contructor. - - The that owns this . - - - - Common Helper to be run before insert. - - - - - - Common Helper to be run after insert. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - This was made to stay under session scope. - - Hailton de Castro - - - - Semaphore to synchronize writes to the dictionary. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Ends all conversations and Closes all their Session. - - - - - Remove conversation. - - - - - - - - - - - "SessionFactory" name in the current context. - This approach is required to support serialization. - - - - - - - - - - - - - - - Returns the current context. Supports serialization and deserialization. - - - - - Implementation of conversation in the infrastructure of Spring. - It avoid Circular Dependencies. - - Hailton de Castro - - - - Default message for "CONVERSATION ALREADY HAS A PARENT" error. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - A String representation from conversation. - - - - - - - - - - - - - - - - Default 180000. - - - - - - - - - - - - - - - . - - - - - - - - - - - - - - - "SessionFactory" name in the current context. - This approach is required to support serialization. - - - - - - - - - - "DbProvider" name in the current context. - This approach is required to support serialization. - - - - - - - - - - - - - - - - - - - - . It is used to valddate - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Returns the current context. Supports serialization and deserialization. - - -
-
+ + + + Spring.Web.Conversation.NHibernate33 + + + + + Based on + for support of 'session-per-conversation' pattern. + + Hailton de Castro + + + + The logging instance. + + + + + Initializes a new instance of the class. + Uses default values for + + + + + Initializes a new instance of the class. + + Specify the to be set on each session provided by this instance. + Specify the flushmode to be applied on each session provided by this instance. + + + + + Initializes a new instance of the class. + + An instance holding the scope configuration + + + + Sets a flag, whether this scope is in "open" state on the current logical thread. + + + + + + NOOP. + + + + + Open a new session or reconect the + in . + Participating in an existing session registed with + is not alowed. + + + + + + If there is another conversation with a with opened + . + If attempting to participate in an existing NHibernate + managed by . + + + + + + + Close the current view's session and unregisters + from . + + The session factory that on use + A list of conversations which the session can be closed or disconnected + + + If start/resume a conversation from a + when exists a different + with open registered on + + If the holder on , is not a . + + + + + + Gets the flushmode to be applied on each newly created session. + + + This property defaults to to ensure that modifying objects outside the boundaries + of a transaction will not be persisted. It is recommended to not change this value but wrap any modifying operation + within a transaction. + + + + + Get the configured EntityInterceptor + + + + + Id for conversation that open the Session. + + + + + Gets a flag, whether this scope is in "open" state on the current logical thread. + + + + + This sessionHolder creates a session for the active conversation only if it is + needed (). + + + Although a NHibernateSession defers creation of db-connections until they are really + needed, instantiation a session is still more expensive than using LazySessionHolder. + + + + + Initialize a new instance. + + + + + Create a new session on demand + + + + + Setting for + + Hailton de Castro + + + + Default value for property. + + + + + Initialize a new instance of with default values. + + + Calling this constructor from your derived class leaves + uninitialized. See for more. + + + + + Initialize a new instance of with the given values and references. + + + Specify the to be set on each session provided by the instance. + + + Specify the flushmode to be applied on each session provided by the instance. + + + Calling this constructor marks all properties initialized. + + + + + Override this method to resolve an instance according to your chosen strategy. + + + + + Gets the configured instance to be used. + + + + + + + Gets or Sets the flushmode to be applied on each newly created session. + + + This property defaults to to ensure that modifying objects outside the boundaries + of a transaction will not be persisted. It is recommended to not change this value but wrap any modifying operation + within a transaction. + + + + + HttpModule for ending Conversations with Timeout exceeded. + + Hailton de Castro + + + + Add PostRequestHandlerExecute event to clear conversations with timeout exceeded. + + + + + + Disposes of the resources (other than memory) used by the module that implements . + + + + + Handles the Unload event of the page control. + + The source of the event. + The instance containing the event data. + + Necessary for Redirect or Abort for any reason. + + + + + The Names of the s in the + + + + + Sets the that this + object runs in. + + + +

+ Used to obtain the instances of +

+

+ Invoked after population of normal object properties but before an + init callback such as + 's + + or a custom init-method. Invoked after the setting of any + 's + + property. +

+
+ + In the case of application context initialization errors. + + + If thrown by any application context methods. + + +
+ + + manager for Conversations. + + Hailton de Castro + + + + Returns the conversation if it is still alive, otherwise it returns null. + + + + + + + Ends all conversations with the timeout exceeded. + + + + + Close IDbConnections for that + use 'session-per-conversation'. It calls + in all conversations. + + + + + Release the ended conversations And removes them. + If the conversation supports 'session-per-conversation', also close the session. + + + + + Add conversation. If is null + it resolves to 'this'. + + + + If already has another manager. + + + + + Makes the 'root conversation' of + the current active conversation and open/reopen the + if + the conversation supports 'session-per-conversation'. Close all + the connection for all session before. + If is true will end all + paused conversations. + + + + + Returns the active conversation if exists, otherwise returns null. + It depends on + + + + + + If this is non-null run pattern 'session-per-conversation'. + Must be the same SessionFactory of the managed conversations. + + + + + + Ends the "paused conversations" in call to . + Important: Unexpected behavior may occur if there are nested conversations, + as in only the current conversation and its parents + are started, the 'conversations children' remain paused, so these will be ended. + Defaul value: false. + + + When it is true, "start/resume a conversation" will cause the other to be + ended and cleaned up. + + This is useful to avoid memory leak where there are many conversations. + This leak can be very considerable, as the conversation may keep a "NHibernate session" + that can contain many objects in its cache from the database queries. + + + + + + Port to conversation. If the object is not found in the current + conversation, will be tried on the parent if the parent is + not null. + + + If is different from spring name for this instance. + + Hailton de Castro + + + + Starts or resumes the conversation and the . + If is not null, so + is called to + Raise SessionHolder for make the reconnection. + + Make return false. + + Update the . + + + + + If this conversation is ended. + + If is not null and + different from + + + + + + + + Ends the conversation. End each of the 'inner conversations' in + . Returns false if the + conversation and all of + has already been ended. + + + + + If . + Session["spring.objects"] + is null. + + The 'spring session scopes' are not located in the key + 'spring.objects' of HttpSessionState. + + + + + + + Starts or resumes the conversation and each 'inner conversation' in + . + It is not about 'Session-per-conversation' because it is done by + . + + + + + Conversation id. + + + + + Return true until is called. + + + + + Return true if this conversation is ended. + + + + + Inner conversation. After added if the + is null it will resolve to 'this'. + + at + , + , + + if Circular Dependency is detected. + + + + Conversation parent. + + + + If this conversation already has a different parent. + + If this Conversation is not new. + + If Circular Dependency is detected. + + The Parent conversation is not new. + + + + + + + TimeOut for the conversation in milliseconds. + If 0 TimeOut will be ignored. + + + + + Last acces for a value into this Conversation or Inner Conversation. + Reset to DateTime.Now each time + is called. + + + + + Conversation Manager. When this is setted if + + returns null so AddConversation is called. + + + + + that is stored in the root conversation. + + + must support 'session-per-conversation'. + + + + + + If this is non-null run pattern 'session-per-conversation'. + It also depends on and . + must support ConversationManager. + + + + + + If this is non-null run pattern 'session-per-conversation'. + It also depends on and . + must support ConversationManager. + + + + + + Indicates that the conversation is paused. + + + + + List that make validation for Circular Dependency for + + Hailton de Castro + + + + Contructor. + + The that owns this . + + + + Common Helper to be run before insert. + + + + + + Common Helper to be run after insert. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + This was made to stay under session scope. + + Hailton de Castro + + + + Semaphore to synchronize writes to the dictionary. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Ends all conversations and Closes all their Session. + + + + + Remove conversation. + + + + + + + + + + + "SessionFactory" name in the current context. + This approach is required to support serialization. + + + + + + + + + + + + + + + Returns the current context. Supports serialization and deserialization. + + + + + Implementation of conversation in the infrastructure of Spring. + It avoid Circular Dependencies. + + Hailton de Castro + + + + Default message for "CONVERSATION ALREADY HAS A PARENT" error. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + A String representation from conversation. + + + + + + + + + + + + + + + + Default 180000. + + + + + + + + + + + + + + + . + + + + + + + + + + + + + + + "SessionFactory" name in the current context. + This approach is required to support serialization. + + + + + + + + + + "DbProvider" name in the current context. + This approach is required to support serialization. + + + + + + + + + + + + + + + + + + + + . It is used to valddate + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Returns the current context. Supports serialization and deserialization. + + +
+
diff --git a/test/Spring/Spring.Aop.Tests/Spring.Aop.Tests.2010.csproj b/test/Spring/Spring.Aop.Tests/Spring.Aop.Tests.2010.csproj index 8a8ec856..7906ee8e 100644 --- a/test/Spring/Spring.Aop.Tests/Spring.Aop.Tests.2010.csproj +++ b/test/Spring/Spring.Aop.Tests/Spring.Aop.Tests.2010.csproj @@ -316,6 +316,9 @@ Spring.Core.Tests.2010 + + + diff --git a/test/Spring/Spring.Core.Tests/Spring.Core.Tests.2010.csproj b/test/Spring/Spring.Core.Tests/Spring.Core.Tests.2010.csproj index d77cb524..c9f8b9c7 100644 --- a/test/Spring/Spring.Core.Tests/Spring.Core.Tests.2010.csproj +++ b/test/Spring/Spring.Core.Tests/Spring.Core.Tests.2010.csproj @@ -1023,6 +1023,9 @@ Spring.Template.Velocity.2010 + + + diff --git a/test/Spring/Spring.Data.Integration.Tests/Spring.Data.Integration.Tests.2010.csproj b/test/Spring/Spring.Data.Integration.Tests/Spring.Data.Integration.Tests.2010.csproj index 34bec8aa..c4466cc0 100644 --- a/test/Spring/Spring.Data.Integration.Tests/Spring.Data.Integration.Tests.2010.csproj +++ b/test/Spring/Spring.Data.Integration.Tests/Spring.Data.Integration.Tests.2010.csproj @@ -127,6 +127,7 @@ + diff --git a/test/Spring/Spring.Data.NHibernate3.Integration.Tests/Spring.Data.NHibernate3.Integration.Tests.2010.csproj b/test/Spring/Spring.Data.NHibernate3.Integration.Tests/Spring.Data.NHibernate3.Integration.Tests.2010.csproj index d05fc4b3..86320d8d 100644 --- a/test/Spring/Spring.Data.NHibernate3.Integration.Tests/Spring.Data.NHibernate3.Integration.Tests.2010.csproj +++ b/test/Spring/Spring.Data.NHibernate3.Integration.Tests/Spring.Data.NHibernate3.Integration.Tests.2010.csproj @@ -235,6 +235,9 @@ Spring.Data.2010 + + + + \ No newline at end of file diff --git a/test/Spring/Spring.Template.Velocity.Castle.Tests/Spring.Template.Velocity.Castle.Tests.build b/test/Spring/Spring.Template.Velocity.Castle.Tests/Spring.Template.Velocity.Castle.Tests.build new file mode 100644 index 00000000..320b89a7 --- /dev/null +++ b/test/Spring/Spring.Template.Velocity.Castle.Tests/Spring.Template.Velocity.Castle.Tests.build @@ -0,0 +1,85 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/Spring/Spring.Template.Velocity.Castle.Tests/Spring.Template.Velocity.Castle.Tests.csproj b/test/Spring/Spring.Template.Velocity.Castle.Tests/Spring.Template.Velocity.Castle.Tests.csproj new file mode 100644 index 00000000..13761b7f --- /dev/null +++ b/test/Spring/Spring.Template.Velocity.Castle.Tests/Spring.Template.Velocity.Castle.Tests.csproj @@ -0,0 +1,98 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {8D6ED392-8A1F-41C0-A765-22CF384EDEA1} + Library + Properties + Spring + Spring.Template.Velocity.Castle.Tests + v3.5 + 512 + + + + + true + full + false + ..\..\..\build\VS.NET.2008\Spring.Template.Velocity.Castle.Tests\Debug\ + TRACE;DEBUG;NET_2_0 + prompt + 4 + true + + + + + pdbonly + true + ..\..\..\build\VS.NET.2008\Spring.Template.Velocity.Castle.Tests\Release\ + TRACE;NET_2_0 + prompt + 4 + true + + + + False + ..\..\..\lib\Net\2.0\nunit.framework.dll + + + False + ..\..\..\lib\Net\2.0\NVelocity.dll + + + + + + + + + + + + + + {710961A3-0DF4-49E4-A26E-F5B9C044AC84} + Spring.Core.2008 + + + {BF3AB954-8375-407C-9E98-4C51D8072784} + Spring.Template.Velocity.2008 + + + {44B16BAA-6DF8-447C-9D7F-3AD3D854D904} + Spring.Core.Tests.2008 + + + + + + + + Always + + + + + Always + + + + + + + + + + \ No newline at end of file diff --git a/test/Spring/Spring.Template.Velocity.Castle.Tests/Template/Velocity/VelocityEngineFactoryObjectTests.xml b/test/Spring/Spring.Template.Velocity.Castle.Tests/Template/Velocity/VelocityEngineFactoryObjectTests.xml new file mode 100644 index 00000000..d961fc76 --- /dev/null +++ b/test/Spring/Spring.Template.Velocity.Castle.Tests/Template/Velocity/VelocityEngineFactoryObjectTests.xml @@ -0,0 +1,86 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/test/Spring/Spring.Template.Velocity.Castle.Tests/Template/Velocity/config.properties b/test/Spring/Spring.Template.Velocity.Castle.Tests/Template/Velocity/config.properties new file mode 100644 index 00000000..941f577b --- /dev/null +++ b/test/Spring/Spring.Template.Velocity.Castle.Tests/Template/Velocity/config.properties @@ -0,0 +1,4 @@ +resource.loader=assembly +assembly.resource.loader.class=NVelocity.Runtime.Resource.Loader.AssemblyResourceLoader +assembly.resource.loader.assembly=Spring.Template.Velocity.Castle.Tests +assembly.resource.loader.description=TestDescription \ No newline at end of file diff --git a/test/Spring/Spring.Template.Velocity.Castle.Tests/packages.config b/test/Spring/Spring.Template.Velocity.Castle.Tests/packages.config new file mode 100644 index 00000000..1bcc5dbd --- /dev/null +++ b/test/Spring/Spring.Template.Velocity.Castle.Tests/packages.config @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/test/Spring/Spring.Template.Velocity.Tests/Spring.Template.Velocity.Tests.2010.csproj b/test/Spring/Spring.Template.Velocity.Tests/Spring.Template.Velocity.Tests.2010.csproj index 63249017..b0d59e6e 100644 --- a/test/Spring/Spring.Template.Velocity.Tests/Spring.Template.Velocity.Tests.2010.csproj +++ b/test/Spring/Spring.Template.Velocity.Tests/Spring.Template.Velocity.Tests.2010.csproj @@ -98,6 +98,9 @@ + + +