diff --git a/examples/Spring/Spring.Web.Extensions.Example/Spring.Web.Extensions.Example.2008.sln b/examples/Spring/Spring.Web.Extensions.Example/Spring.Web.Extensions.Example.2008.sln index 4a6e4204..669ac7e1 100644 --- a/examples/Spring/Spring.Web.Extensions.Example/Spring.Web.Extensions.Example.2008.sln +++ b/examples/Spring/Spring.Web.Extensions.Example/Spring.Web.Extensions.Example.2008.sln @@ -1,20 +1,20 @@  Microsoft Visual Studio Solution File, Format Version 10.00 # Visual Studio 2008 -Project("{E24C65DC-7377-472B-9ABA-BC803B73C61A}") = "Spring.Web.Extensions.Example.2005", "src\Spring.Web.Extensions.Example.2005\", "{DE2A587C-01A4-49E2-A3CD-664B293A8A6F}" +Project("{E24C65DC-7377-472B-9ABA-BC803B73C61A}") = "Spring.Web.Extensions.Example.2008", "src\Spring.Web.Extensions.Example.2008\", "{DE2A587C-01A4-49E2-A3CD-664B293A8A6F}" ProjectSection(WebsiteProperties) = preProject - TargetFramework = "2.0" + TargetFramework = "3.5" ProjectReferences = "" - Debug.AspNetCompiler.VirtualPath = "/Spring.Web.Extensions.Example.2005" - Debug.AspNetCompiler.PhysicalPath = "src\Spring.Web.Extensions.Example.2005\" - Debug.AspNetCompiler.TargetPath = "PrecompiledWeb\Spring.Web.Extensions.Example.2005\" + Debug.AspNetCompiler.VirtualPath = "/Spring.Web.Extensions.Example.2008" + Debug.AspNetCompiler.PhysicalPath = "src\Spring.Web.Extensions.Example.2008\" + Debug.AspNetCompiler.TargetPath = "PrecompiledWeb\Spring.Web.Extensions.Example.2008\" Debug.AspNetCompiler.Updateable = "true" Debug.AspNetCompiler.ForceOverwrite = "true" Debug.AspNetCompiler.FixedNames = "false" Debug.AspNetCompiler.Debug = "True" - Release.AspNetCompiler.VirtualPath = "/Spring.Web.Extensions.Example.2005" - Release.AspNetCompiler.PhysicalPath = "src\Spring.Web.Extensions.Example.2005\" - Release.AspNetCompiler.TargetPath = "PrecompiledWeb\Spring.Web.Extensions.Example.2005\" + Release.AspNetCompiler.VirtualPath = "/Spring.Web.Extensions.Example.2008" + Release.AspNetCompiler.PhysicalPath = "src\Spring.Web.Extensions.Example.2008\" + Release.AspNetCompiler.TargetPath = "PrecompiledWeb\Spring.Web.Extensions.Example.2008\" Release.AspNetCompiler.Updateable = "true" Release.AspNetCompiler.ForceOverwrite = "true" Release.AspNetCompiler.FixedNames = "false" diff --git a/examples/Spring/Spring.Web.Extensions.Example/Spring.Web.Extensions.Example.2010.sln b/examples/Spring/Spring.Web.Extensions.Example/Spring.Web.Extensions.Example.2010.sln new file mode 100644 index 00000000..b7b7ef8b --- /dev/null +++ b/examples/Spring/Spring.Web.Extensions.Example/Spring.Web.Extensions.Example.2010.sln @@ -0,0 +1,49 @@ + +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 +Project("{E24C65DC-7377-472B-9ABA-BC803B73C61A}") = "Spring.Web.Extensions.Example.2010", "src\Spring.Web.Extensions.Example.2010\", "{DE2A587C-01A4-49E2-A3CD-664B293A8A6F}" + ProjectSection(WebsiteProperties) = preProject + TargetFrameworkMoniker = ".NETFramework,Version%3Dv4.0" + ProjectReferences = "" + Debug.AspNetCompiler.VirtualPath = "/Spring.Web.Extensions.Example.2010" + Debug.AspNetCompiler.PhysicalPath = "src\Spring.Web.Extensions.Example.2010\" + Debug.AspNetCompiler.TargetPath = "PrecompiledWeb\Spring.Web.Extensions.Example.2010\" + Debug.AspNetCompiler.Updateable = "true" + Debug.AspNetCompiler.ForceOverwrite = "true" + Debug.AspNetCompiler.FixedNames = "false" + Debug.AspNetCompiler.Debug = "True" + Release.AspNetCompiler.VirtualPath = "/Spring.Web.Extensions.Example.2010" + Release.AspNetCompiler.PhysicalPath = "src\Spring.Web.Extensions.Example.2010\" + Release.AspNetCompiler.TargetPath = "PrecompiledWeb\Spring.Web.Extensions.Example.2010\" + Release.AspNetCompiler.Updateable = "true" + Release.AspNetCompiler.ForceOverwrite = "true" + Release.AspNetCompiler.FixedNames = "false" + Release.AspNetCompiler.Debug = "False" + VWDPort = "3792" + EndProjectSection +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|.NET = Debug|.NET + Debug|Any CPU = Debug|Any CPU + Debug|Mixed Platforms = Debug|Mixed Platforms + Release|.NET = Release|.NET + Release|Any CPU = Release|Any CPU + Release|Mixed Platforms = Release|Mixed Platforms + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {DE2A587C-01A4-49E2-A3CD-664B293A8A6F}.Debug|.NET.ActiveCfg = Debug|.NET + {DE2A587C-01A4-49E2-A3CD-664B293A8A6F}.Debug|.NET.Build.0 = Debug|.NET + {DE2A587C-01A4-49E2-A3CD-664B293A8A6F}.Debug|Any CPU.ActiveCfg = Debug|.NET + {DE2A587C-01A4-49E2-A3CD-664B293A8A6F}.Debug|Mixed Platforms.ActiveCfg = Debug|.NET + {DE2A587C-01A4-49E2-A3CD-664B293A8A6F}.Debug|Mixed Platforms.Build.0 = Debug|.NET + {DE2A587C-01A4-49E2-A3CD-664B293A8A6F}.Release|.NET.ActiveCfg = Debug|.NET + {DE2A587C-01A4-49E2-A3CD-664B293A8A6F}.Release|.NET.Build.0 = Debug|.NET + {DE2A587C-01A4-49E2-A3CD-664B293A8A6F}.Release|Any CPU.ActiveCfg = Debug|.NET + {DE2A587C-01A4-49E2-A3CD-664B293A8A6F}.Release|Mixed Platforms.ActiveCfg = Debug|.NET + {DE2A587C-01A4-49E2-A3CD-664B293A8A6F}.Release|Mixed Platforms.Build.0 = Debug|.NET + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/examples/Spring/Spring.Web.Extensions.Example/src/Spring.Web.Extensions.Example.2005/Web.config b/examples/Spring/Spring.Web.Extensions.Example/src/Spring.Web.Extensions.Example.2005/Web.config index ffbbeaf0..5c255cbd 100644 --- a/examples/Spring/Spring.Web.Extensions.Example/src/Spring.Web.Extensions.Example.2005/Web.config +++ b/examples/Spring/Spring.Web.Extensions.Example/src/Spring.Web.Extensions.Example.2005/Web.config @@ -46,48 +46,4 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/Spring/Spring.Web.Extensions.Example/src/Spring.Web.Extensions.Example.2008/App_Code/ContactService.cs b/examples/Spring/Spring.Web.Extensions.Example/src/Spring.Web.Extensions.Example.2008/App_Code/ContactService.cs new file mode 100644 index 00000000..a0687b33 --- /dev/null +++ b/examples/Spring/Spring.Web.Extensions.Example/src/Spring.Web.Extensions.Example.2008/App_Code/ContactService.cs @@ -0,0 +1,77 @@ +#region License + +/* + * Copyright © 2002-2006 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.Generic; + +#endregion + +/// +/// Default implementation of the +/// service interface. +/// +/// Bruno Baia +/// $Id: ContactService.cs,v 1.1 2007/05/31 18:34:54 markpollack Exp $ +public class ContactService : IContactService +{ + private List _emails; + + /// + /// List of emails addresses for all contacts. + /// + public List Emails + { + get { return _emails; } + set { _emails = value; } + } + + /// + /// Creates a new instance of the class. + /// + public ContactService() + { + } + + /// + /// Returns an array of emails, with a maximum of + /// values, that complete the given . + /// + /// Text entered by the user. + /// Maximum number of possible values. + /// The array of emails for completing the text. + public string[] GetEmails(string prefixText, int count) + { + List emails = new List(); + int i = 0; + foreach (string email in _emails) + { + if (email.ToLower().StartsWith(prefixText.ToLower())) + { + emails.Add(email); + if (++i == count) break; + } + } + + return emails.ToArray(); + } +} diff --git a/examples/Spring/Spring.Web.Extensions.Example/src/Spring.Web.Extensions.Example.2008/App_Code/IContactService.cs b/examples/Spring/Spring.Web.Extensions.Example/src/Spring.Web.Extensions.Example.2008/App_Code/IContactService.cs new file mode 100644 index 00000000..7c83f77d --- /dev/null +++ b/examples/Spring/Spring.Web.Extensions.Example/src/Spring.Web.Extensions.Example.2008/App_Code/IContactService.cs @@ -0,0 +1,40 @@ +#region License + +/* + * Copyright © 2002-2006 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 + +/// +/// Service interface for contact management. +/// +/// Bruno Baia +/// $Id: IContactService.cs,v 1.1 2007/05/31 18:34:54 markpollack Exp $ +public interface IContactService +{ + /// + /// Returns an array of emails, with a maximum of + /// values, that complete the given . + /// + /// + /// This signature method is required + /// to apply the auto-completion behavior. + /// + /// Text entered by the user. + /// Maximum number of possible values. + /// The array of emails for completing the text. + string[] GetEmails(string prefixText, int count); +} diff --git a/examples/Spring/Spring.Web.Extensions.Example/src/Spring.Web.Extensions.Example.2008/App_Code/StringArrayFilterAdvice.cs b/examples/Spring/Spring.Web.Extensions.Example/src/Spring.Web.Extensions.Example.2008/App_Code/StringArrayFilterAdvice.cs new file mode 100644 index 00000000..4f925150 --- /dev/null +++ b/examples/Spring/Spring.Web.Extensions.Example/src/Spring.Web.Extensions.Example.2008/App_Code/StringArrayFilterAdvice.cs @@ -0,0 +1,86 @@ +#region License + +/* + * Copyright © 2002-2006 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.Generic; + +using AopAlliance.Intercept; +using Spring.Util; + +#endregion + +/// +/// A simple interception around advice that filters +/// a string array matching a given pattern. +/// +/// Bruno Baia +/// $Id: StringArrayFilterAdvice.cs,v 1.1 2007/05/31 18:34:54 markpollack Exp $ +public class StringArrayFilterAdvice : IMethodInterceptor +{ + private string _pattern = string.Empty; + + /// + /// A pattern to be used for filtering a string array. + /// + public string Pattern + { + get { return _pattern; } + set { _pattern = value; } + } + + /// + /// Creates a new instance of the class. + /// + public StringArrayFilterAdvice() + { + } + + #region IMethodInterceptor Members + + public object Invoke(IMethodInvocation invocation) + { + if (invocation.Method.ReturnType != typeof(string[])) + throw new NotSupportedException( + "StringArrayFilterAdvice must be applied on methods " + + "that return an array of string."); + + string[] stringArray = (string[])invocation.Proceed(); + + if (_pattern.Length > 0) + { + List strings = new List(); + foreach (string item in stringArray) + { + if (PatternMatchUtils.SimpleMatch(_pattern, item)) + { + strings.Add(item); + } + } + + return strings.ToArray(); + } + + return stringArray; + } + + #endregion +} \ No newline at end of file diff --git a/examples/Spring/Spring.Web.Extensions.Example/src/Spring.Web.Extensions.Example.2008/Bin/Common.Logging.dll.refresh b/examples/Spring/Spring.Web.Extensions.Example/src/Spring.Web.Extensions.Example.2008/Bin/Common.Logging.dll.refresh new file mode 100644 index 00000000..7ae4334d Binary files /dev/null and b/examples/Spring/Spring.Web.Extensions.Example/src/Spring.Web.Extensions.Example.2008/Bin/Common.Logging.dll.refresh differ diff --git a/examples/Spring/Spring.Web.Extensions.Example/src/Spring.Web.Extensions.Example.2008/Bin/Spring.Aop.dll.refresh b/examples/Spring/Spring.Web.Extensions.Example/src/Spring.Web.Extensions.Example.2008/Bin/Spring.Aop.dll.refresh new file mode 100644 index 00000000..cc858ae7 Binary files /dev/null and b/examples/Spring/Spring.Web.Extensions.Example/src/Spring.Web.Extensions.Example.2008/Bin/Spring.Aop.dll.refresh differ diff --git a/examples/Spring/Spring.Web.Extensions.Example/src/Spring.Web.Extensions.Example.2008/Bin/Spring.Core.dll.refresh b/examples/Spring/Spring.Web.Extensions.Example/src/Spring.Web.Extensions.Example.2008/Bin/Spring.Core.dll.refresh new file mode 100644 index 00000000..d6773450 Binary files /dev/null and b/examples/Spring/Spring.Web.Extensions.Example/src/Spring.Web.Extensions.Example.2008/Bin/Spring.Core.dll.refresh differ diff --git a/examples/Spring/Spring.Web.Extensions.Example/src/Spring.Web.Extensions.Example.2008/Bin/Spring.Web.Extensions.dll.refresh b/examples/Spring/Spring.Web.Extensions.Example/src/Spring.Web.Extensions.Example.2008/Bin/Spring.Web.Extensions.dll.refresh new file mode 100644 index 00000000..0840ea46 Binary files /dev/null and b/examples/Spring/Spring.Web.Extensions.Example/src/Spring.Web.Extensions.Example.2008/Bin/Spring.Web.Extensions.dll.refresh differ diff --git a/examples/Spring/Spring.Web.Extensions.Example/src/Spring.Web.Extensions.Example.2008/Bin/Spring.Web.dll.refresh b/examples/Spring/Spring.Web.Extensions.Example/src/Spring.Web.Extensions.Example.2008/Bin/Spring.Web.dll.refresh new file mode 100644 index 00000000..b31d8acc Binary files /dev/null and b/examples/Spring/Spring.Web.Extensions.Example/src/Spring.Web.Extensions.Example.2008/Bin/Spring.Web.dll.refresh differ diff --git a/examples/Spring/Spring.Web.Extensions.Example/src/Spring.Web.Extensions.Example.2008/ContactWebServiceMethods.js b/examples/Spring/Spring.Web.Extensions.Example/src/Spring.Web.Extensions.Example.2008/ContactWebServiceMethods.js new file mode 100644 index 00000000..8029c670 --- /dev/null +++ b/examples/Spring/Spring.Web.Extensions.Example/src/Spring.Web.Extensions.Example.2008/ContactWebServiceMethods.js @@ -0,0 +1,23 @@ +// JScript File + +// This function calls the Contact Web service method +// passing simple type parameters and the callback function +function GetEmails(prefix, count) +{ + ContactWebService.GetEmails(prefix, count, GetEmailsOnSucceeded); +} + +// This is the callback function invoked if the Web service succeeded. +// It accepts the result object as a parameter. +function GetEmailsOnSucceeded(result, eventArgs) +{ + // Page element to display feedback. + var ResultSpan = document.getElementById("ResultSpan"); + ResultSpan.innerHTML = ''; + var i = 0; + for(email in result) + { + ResultSpan.innerHTML += (result[i] + ''); + i++; + } +} \ No newline at end of file diff --git a/examples/Spring/Spring.Web.Extensions.Example/src/Spring.Web.Extensions.Example.2008/Default.aspx b/examples/Spring/Spring.Web.Extensions.Example/src/Spring.Web.Extensions.Example.2008/Default.aspx new file mode 100644 index 00000000..598134d9 --- /dev/null +++ b/examples/Spring/Spring.Web.Extensions.Example/src/Spring.Web.Extensions.Example.2008/Default.aspx @@ -0,0 +1,46 @@ +<%@ Page Language="C#" %> + + + + + ASP.NET AJAX 1.0 integration with Spring.NET + + + + + + + + + + + + + + Web Service available at this url : ContactWebService.asmx + + + Client scripts generated at this url : ContactWebService.asmx/js + & ContactWebService.asmx/jsdebug + + + + This sample demonstrates the use of client script with a web service created by + Spring.NET's WebServiceExporter. + + + Email : + + + Search + (Hint : type the letter 'b' or 'm') + + + Results : + + + + + + + diff --git a/examples/Spring/Spring.Web.Extensions.Example/src/Spring.Web.Extensions.Example.2008/Spring.config b/examples/Spring/Spring.Web.Extensions.Example/src/Spring.Web.Extensions.Example.2008/Spring.config new file mode 100644 index 00000000..95c90614 --- /dev/null +++ b/examples/Spring/Spring.Web.Extensions.Example/src/Spring.Web.Extensions.Example.2008/Spring.config @@ -0,0 +1,65 @@ + + + Object definitions. + + + + + + + + + + + GetEmails + + + + + + + + + manuel@spring.pt + bruno@spring.net + marie@spring.net + brice@spring.net + bertrand@spring.net + marcel@spring.net + bernadette@spring.net + bruno@spring.pt + baptiste@spring.net + brad@spring.net + marc@spring.net + barbie@spring.net + bernie@spring.net + betty@spring.net + maria@spring.pt + + + + + + + + + + StringArrayFilterAspect + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/examples/Spring/Spring.Web.Extensions.Example/src/Spring.Web.Extensions.Example.2008/Web.config b/examples/Spring/Spring.Web.Extensions.Example/src/Spring.Web.Extensions.Example.2008/Web.config new file mode 100644 index 00000000..28c91597 --- /dev/null +++ b/examples/Spring/Spring.Web.Extensions.Example/src/Spring.Web.Extensions.Example.2008/Web.config @@ -0,0 +1,55 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/examples/Spring/Spring.Web.Extensions.Example/src/Spring.Web.Extensions.Example.2010/App_Code/ContactService.cs b/examples/Spring/Spring.Web.Extensions.Example/src/Spring.Web.Extensions.Example.2010/App_Code/ContactService.cs new file mode 100644 index 00000000..a0687b33 --- /dev/null +++ b/examples/Spring/Spring.Web.Extensions.Example/src/Spring.Web.Extensions.Example.2010/App_Code/ContactService.cs @@ -0,0 +1,77 @@ +#region License + +/* + * Copyright © 2002-2006 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.Generic; + +#endregion + +/// +/// Default implementation of the +/// service interface. +/// +/// Bruno Baia +/// $Id: ContactService.cs,v 1.1 2007/05/31 18:34:54 markpollack Exp $ +public class ContactService : IContactService +{ + private List _emails; + + /// + /// List of emails addresses for all contacts. + /// + public List Emails + { + get { return _emails; } + set { _emails = value; } + } + + /// + /// Creates a new instance of the class. + /// + public ContactService() + { + } + + /// + /// Returns an array of emails, with a maximum of + /// values, that complete the given . + /// + /// Text entered by the user. + /// Maximum number of possible values. + /// The array of emails for completing the text. + public string[] GetEmails(string prefixText, int count) + { + List emails = new List(); + int i = 0; + foreach (string email in _emails) + { + if (email.ToLower().StartsWith(prefixText.ToLower())) + { + emails.Add(email); + if (++i == count) break; + } + } + + return emails.ToArray(); + } +} diff --git a/examples/Spring/Spring.Web.Extensions.Example/src/Spring.Web.Extensions.Example.2010/App_Code/IContactService.cs b/examples/Spring/Spring.Web.Extensions.Example/src/Spring.Web.Extensions.Example.2010/App_Code/IContactService.cs new file mode 100644 index 00000000..7c83f77d --- /dev/null +++ b/examples/Spring/Spring.Web.Extensions.Example/src/Spring.Web.Extensions.Example.2010/App_Code/IContactService.cs @@ -0,0 +1,40 @@ +#region License + +/* + * Copyright © 2002-2006 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 + +/// +/// Service interface for contact management. +/// +/// Bruno Baia +/// $Id: IContactService.cs,v 1.1 2007/05/31 18:34:54 markpollack Exp $ +public interface IContactService +{ + /// + /// Returns an array of emails, with a maximum of + /// values, that complete the given . + /// + /// + /// This signature method is required + /// to apply the auto-completion behavior. + /// + /// Text entered by the user. + /// Maximum number of possible values. + /// The array of emails for completing the text. + string[] GetEmails(string prefixText, int count); +} diff --git a/examples/Spring/Spring.Web.Extensions.Example/src/Spring.Web.Extensions.Example.2010/App_Code/StringArrayFilterAdvice.cs b/examples/Spring/Spring.Web.Extensions.Example/src/Spring.Web.Extensions.Example.2010/App_Code/StringArrayFilterAdvice.cs new file mode 100644 index 00000000..4f925150 --- /dev/null +++ b/examples/Spring/Spring.Web.Extensions.Example/src/Spring.Web.Extensions.Example.2010/App_Code/StringArrayFilterAdvice.cs @@ -0,0 +1,86 @@ +#region License + +/* + * Copyright © 2002-2006 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.Generic; + +using AopAlliance.Intercept; +using Spring.Util; + +#endregion + +/// +/// A simple interception around advice that filters +/// a string array matching a given pattern. +/// +/// Bruno Baia +/// $Id: StringArrayFilterAdvice.cs,v 1.1 2007/05/31 18:34:54 markpollack Exp $ +public class StringArrayFilterAdvice : IMethodInterceptor +{ + private string _pattern = string.Empty; + + /// + /// A pattern to be used for filtering a string array. + /// + public string Pattern + { + get { return _pattern; } + set { _pattern = value; } + } + + /// + /// Creates a new instance of the class. + /// + public StringArrayFilterAdvice() + { + } + + #region IMethodInterceptor Members + + public object Invoke(IMethodInvocation invocation) + { + if (invocation.Method.ReturnType != typeof(string[])) + throw new NotSupportedException( + "StringArrayFilterAdvice must be applied on methods " + + "that return an array of string."); + + string[] stringArray = (string[])invocation.Proceed(); + + if (_pattern.Length > 0) + { + List strings = new List(); + foreach (string item in stringArray) + { + if (PatternMatchUtils.SimpleMatch(_pattern, item)) + { + strings.Add(item); + } + } + + return strings.ToArray(); + } + + return stringArray; + } + + #endregion +} \ No newline at end of file diff --git a/examples/Spring/Spring.Web.Extensions.Example/src/Spring.Web.Extensions.Example.2010/Bin/Common.Logging.dll.refresh b/examples/Spring/Spring.Web.Extensions.Example/src/Spring.Web.Extensions.Example.2010/Bin/Common.Logging.dll.refresh new file mode 100644 index 00000000..7ae4334d Binary files /dev/null and b/examples/Spring/Spring.Web.Extensions.Example/src/Spring.Web.Extensions.Example.2010/Bin/Common.Logging.dll.refresh differ diff --git a/examples/Spring/Spring.Web.Extensions.Example/src/Spring.Web.Extensions.Example.2010/Bin/Spring.Aop.dll.refresh b/examples/Spring/Spring.Web.Extensions.Example/src/Spring.Web.Extensions.Example.2010/Bin/Spring.Aop.dll.refresh new file mode 100644 index 00000000..cc858ae7 Binary files /dev/null and b/examples/Spring/Spring.Web.Extensions.Example/src/Spring.Web.Extensions.Example.2010/Bin/Spring.Aop.dll.refresh differ diff --git a/examples/Spring/Spring.Web.Extensions.Example/src/Spring.Web.Extensions.Example.2010/Bin/Spring.Core.dll.refresh b/examples/Spring/Spring.Web.Extensions.Example/src/Spring.Web.Extensions.Example.2010/Bin/Spring.Core.dll.refresh new file mode 100644 index 00000000..d6773450 Binary files /dev/null and b/examples/Spring/Spring.Web.Extensions.Example/src/Spring.Web.Extensions.Example.2010/Bin/Spring.Core.dll.refresh differ diff --git a/examples/Spring/Spring.Web.Extensions.Example/src/Spring.Web.Extensions.Example.2010/Bin/Spring.Web.Extensions.dll.refresh b/examples/Spring/Spring.Web.Extensions.Example/src/Spring.Web.Extensions.Example.2010/Bin/Spring.Web.Extensions.dll.refresh new file mode 100644 index 00000000..f0151820 Binary files /dev/null and b/examples/Spring/Spring.Web.Extensions.Example/src/Spring.Web.Extensions.Example.2010/Bin/Spring.Web.Extensions.dll.refresh differ diff --git a/examples/Spring/Spring.Web.Extensions.Example/src/Spring.Web.Extensions.Example.2010/Bin/Spring.Web.dll.refresh b/examples/Spring/Spring.Web.Extensions.Example/src/Spring.Web.Extensions.Example.2010/Bin/Spring.Web.dll.refresh new file mode 100644 index 00000000..b31d8acc Binary files /dev/null and b/examples/Spring/Spring.Web.Extensions.Example/src/Spring.Web.Extensions.Example.2010/Bin/Spring.Web.dll.refresh differ diff --git a/examples/Spring/Spring.Web.Extensions.Example/src/Spring.Web.Extensions.Example.2010/ContactWebServiceMethods.js b/examples/Spring/Spring.Web.Extensions.Example/src/Spring.Web.Extensions.Example.2010/ContactWebServiceMethods.js new file mode 100644 index 00000000..8029c670 --- /dev/null +++ b/examples/Spring/Spring.Web.Extensions.Example/src/Spring.Web.Extensions.Example.2010/ContactWebServiceMethods.js @@ -0,0 +1,23 @@ +// JScript File + +// This function calls the Contact Web service method +// passing simple type parameters and the callback function +function GetEmails(prefix, count) +{ + ContactWebService.GetEmails(prefix, count, GetEmailsOnSucceeded); +} + +// This is the callback function invoked if the Web service succeeded. +// It accepts the result object as a parameter. +function GetEmailsOnSucceeded(result, eventArgs) +{ + // Page element to display feedback. + var ResultSpan = document.getElementById("ResultSpan"); + ResultSpan.innerHTML = ''; + var i = 0; + for(email in result) + { + ResultSpan.innerHTML += (result[i] + ''); + i++; + } +} \ No newline at end of file diff --git a/examples/Spring/Spring.Web.Extensions.Example/src/Spring.Web.Extensions.Example.2010/Default.aspx b/examples/Spring/Spring.Web.Extensions.Example/src/Spring.Web.Extensions.Example.2010/Default.aspx new file mode 100644 index 00000000..598134d9 --- /dev/null +++ b/examples/Spring/Spring.Web.Extensions.Example/src/Spring.Web.Extensions.Example.2010/Default.aspx @@ -0,0 +1,46 @@ +<%@ Page Language="C#" %> + + + + + ASP.NET AJAX 1.0 integration with Spring.NET + + + + + + + + + + + + + + Web Service available at this url : ContactWebService.asmx + + + Client scripts generated at this url : ContactWebService.asmx/js + & ContactWebService.asmx/jsdebug + + + + This sample demonstrates the use of client script with a web service created by + Spring.NET's WebServiceExporter. + + + Email : + + + Search + (Hint : type the letter 'b' or 'm') + + + Results : + + + + + + + diff --git a/examples/Spring/Spring.Web.Extensions.Example/src/Spring.Web.Extensions.Example.2010/Spring.config b/examples/Spring/Spring.Web.Extensions.Example/src/Spring.Web.Extensions.Example.2010/Spring.config new file mode 100644 index 00000000..95c90614 --- /dev/null +++ b/examples/Spring/Spring.Web.Extensions.Example/src/Spring.Web.Extensions.Example.2010/Spring.config @@ -0,0 +1,65 @@ + + + Object definitions. + + + + + + + + + + + GetEmails + + + + + + + + + manuel@spring.pt + bruno@spring.net + marie@spring.net + brice@spring.net + bertrand@spring.net + marcel@spring.net + bernadette@spring.net + bruno@spring.pt + baptiste@spring.net + brad@spring.net + marc@spring.net + barbie@spring.net + bernie@spring.net + betty@spring.net + maria@spring.pt + + + + + + + + + + StringArrayFilterAspect + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/examples/Spring/Spring.Web.Extensions.Example/src/Spring.Web.Extensions.Example.2010/Web.config b/examples/Spring/Spring.Web.Extensions.Example/src/Spring.Web.Extensions.Example.2010/Web.config new file mode 100644 index 00000000..0d7745d3 --- /dev/null +++ b/examples/Spring/Spring.Web.Extensions.Example/src/Spring.Web.Extensions.Example.2010/Web.config @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + +
+ Web Service available at this url : ContactWebService.asmx + + + Client scripts generated at this url : ContactWebService.asmx/js + & ContactWebService.asmx/jsdebug +
+ This sample demonstrates the use of client script with a web service created by + Spring.NET's WebServiceExporter. +
+ Email : + + + Search + (Hint : type the letter 'b' or 'm') +
+ Results : + + +