From ff9008d390b5475eaf83e0fdfbf83f7eda7c1c8b Mon Sep 17 00:00:00 2001 From: bbaia Date: Sun, 12 Dec 2010 02:26:44 +0000 Subject: [PATCH] Added VS2010 solution to Spring.Web.Extensions example. --- .../Spring.Web.Extensions.Example.2008.sln | 16 ++-- .../Spring.Web.Extensions.Example.2010.sln | 49 ++++++++++ .../Web.config | 44 --------- .../App_Code/ContactService.cs | 77 ++++++++++++++++ .../App_Code/IContactService.cs | 40 ++++++++ .../App_Code/StringArrayFilterAdvice.cs | 86 ++++++++++++++++++ .../Bin/Common.Logging.dll.refresh | Bin 0 -> 104 bytes .../Bin/Spring.Aop.dll.refresh | Bin 0 -> 96 bytes .../Bin/Spring.Core.dll.refresh | Bin 0 -> 98 bytes .../Bin/Spring.Web.Extensions.dll.refresh | Bin 0 -> 118 bytes .../Bin/Spring.Web.dll.refresh | Bin 0 -> 96 bytes .../ContactWebServiceMethods.js | 23 +++++ .../Default.aspx | 46 ++++++++++ .../Spring.config | 65 +++++++++++++ .../Web.config | 55 +++++++++++ .../App_Code/ContactService.cs | 77 ++++++++++++++++ .../App_Code/IContactService.cs | 40 ++++++++ .../App_Code/StringArrayFilterAdvice.cs | 86 ++++++++++++++++++ .../Bin/Common.Logging.dll.refresh | Bin 0 -> 104 bytes .../Bin/Spring.Aop.dll.refresh | Bin 0 -> 96 bytes .../Bin/Spring.Core.dll.refresh | Bin 0 -> 98 bytes .../Bin/Spring.Web.Extensions.dll.refresh | Bin 0 -> 118 bytes .../Bin/Spring.Web.dll.refresh | Bin 0 -> 96 bytes .../ContactWebServiceMethods.js | 23 +++++ .../Default.aspx | 46 ++++++++++ .../Spring.config | 65 +++++++++++++ .../Web.config | 29 ++++++ 27 files changed, 815 insertions(+), 52 deletions(-) create mode 100644 examples/Spring/Spring.Web.Extensions.Example/Spring.Web.Extensions.Example.2010.sln create mode 100644 examples/Spring/Spring.Web.Extensions.Example/src/Spring.Web.Extensions.Example.2008/App_Code/ContactService.cs create mode 100644 examples/Spring/Spring.Web.Extensions.Example/src/Spring.Web.Extensions.Example.2008/App_Code/IContactService.cs create mode 100644 examples/Spring/Spring.Web.Extensions.Example/src/Spring.Web.Extensions.Example.2008/App_Code/StringArrayFilterAdvice.cs create mode 100644 examples/Spring/Spring.Web.Extensions.Example/src/Spring.Web.Extensions.Example.2008/Bin/Common.Logging.dll.refresh create mode 100644 examples/Spring/Spring.Web.Extensions.Example/src/Spring.Web.Extensions.Example.2008/Bin/Spring.Aop.dll.refresh create mode 100644 examples/Spring/Spring.Web.Extensions.Example/src/Spring.Web.Extensions.Example.2008/Bin/Spring.Core.dll.refresh create mode 100644 examples/Spring/Spring.Web.Extensions.Example/src/Spring.Web.Extensions.Example.2008/Bin/Spring.Web.Extensions.dll.refresh create mode 100644 examples/Spring/Spring.Web.Extensions.Example/src/Spring.Web.Extensions.Example.2008/Bin/Spring.Web.dll.refresh create mode 100644 examples/Spring/Spring.Web.Extensions.Example/src/Spring.Web.Extensions.Example.2008/ContactWebServiceMethods.js create mode 100644 examples/Spring/Spring.Web.Extensions.Example/src/Spring.Web.Extensions.Example.2008/Default.aspx create mode 100644 examples/Spring/Spring.Web.Extensions.Example/src/Spring.Web.Extensions.Example.2008/Spring.config create mode 100644 examples/Spring/Spring.Web.Extensions.Example/src/Spring.Web.Extensions.Example.2008/Web.config create mode 100644 examples/Spring/Spring.Web.Extensions.Example/src/Spring.Web.Extensions.Example.2010/App_Code/ContactService.cs create mode 100644 examples/Spring/Spring.Web.Extensions.Example/src/Spring.Web.Extensions.Example.2010/App_Code/IContactService.cs create mode 100644 examples/Spring/Spring.Web.Extensions.Example/src/Spring.Web.Extensions.Example.2010/App_Code/StringArrayFilterAdvice.cs create mode 100644 examples/Spring/Spring.Web.Extensions.Example/src/Spring.Web.Extensions.Example.2010/Bin/Common.Logging.dll.refresh create mode 100644 examples/Spring/Spring.Web.Extensions.Example/src/Spring.Web.Extensions.Example.2010/Bin/Spring.Aop.dll.refresh create mode 100644 examples/Spring/Spring.Web.Extensions.Example/src/Spring.Web.Extensions.Example.2010/Bin/Spring.Core.dll.refresh create mode 100644 examples/Spring/Spring.Web.Extensions.Example/src/Spring.Web.Extensions.Example.2010/Bin/Spring.Web.Extensions.dll.refresh create mode 100644 examples/Spring/Spring.Web.Extensions.Example/src/Spring.Web.Extensions.Example.2010/Bin/Spring.Web.dll.refresh create mode 100644 examples/Spring/Spring.Web.Extensions.Example/src/Spring.Web.Extensions.Example.2010/ContactWebServiceMethods.js create mode 100644 examples/Spring/Spring.Web.Extensions.Example/src/Spring.Web.Extensions.Example.2010/Default.aspx create mode 100644 examples/Spring/Spring.Web.Extensions.Example/src/Spring.Web.Extensions.Example.2010/Spring.config create mode 100644 examples/Spring/Spring.Web.Extensions.Example/src/Spring.Web.Extensions.Example.2010/Web.config 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 0000000000000000000000000000000000000000..7ae4334d7a3e44bf17fb4f7da2c6075a14226e49 GIT binary patch literal 104 zcmezWPme*5AqI%ClSvGj40%BLJcd+;5+H2^RA&IBQ-J&=hEj%fAlsQCpCK0r^MR`L U7<_j72d03iTgeGy0i literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..d6773450bbc79ec8b16b4cc905f1c9dd25ff20e8 GIT binary patch literal 98 zcmezWPme*5AqI%ClSvGj40%BLJcd+;5+H2^RA&IBQ-J&=hEj%fAUl|$fT0MiE*&WA Q%#aV{r2<(g3^_mu0D@x?u>b%7 literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..0840ea461890c5ef058669cd9b4531ce9b914805 GIT binary patch literal 118 zcmezWPme*5AqI%ClSvGj40%BLJcd+;5+H31RA&mLQ-J&=hEj%fAUl|$fT0MiE*&Tv c4wlhlaAl|f>PQ9ZEC$NugK0gWz8oL~01)RDssI20 literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..b31d8accaa1e5760c2af7d03bfa8bca1d7417337 GIT binary patch literal 96 zcmezWPme*5AqI%ClSvGj40%BLJcd+;5+H2^RA&IBQ-J&=hEj%fAUl|$fT0MiE*&Tv M4wlgas>lIC0A8&TMgRZ+ literal 0 HcmV?d00001 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 : + + + (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 0000000000000000000000000000000000000000..7ae4334d7a3e44bf17fb4f7da2c6075a14226e49 GIT binary patch literal 104 zcmezWPme*5AqI%ClSvGj40%BLJcd+;5+H2^RA&IBQ-J&=hEj%fAlsQCpCK0r^MR`L U7<_j72d03iTgeGy0i literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..d6773450bbc79ec8b16b4cc905f1c9dd25ff20e8 GIT binary patch literal 98 zcmezWPme*5AqI%ClSvGj40%BLJcd+;5+H2^RA&IBQ-J&=hEj%fAUl|$fT0MiE*&WA Q%#aV{r2<(g3^_mu0D@x?u>b%7 literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..f0151820f568564dc214ab36a87cdd728a0bbffd GIT binary patch literal 118 zcmezWPme*5AqI%ClSvGj40%BLJcd+;5+H2^RA&IBQ-J&=hEj%fAUl|$fT0MiE*&Tv c4wlhlaAl|f>PQ9ZEC$NugK0gWz8oL~01sCcqyPW_ literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..b31d8accaa1e5760c2af7d03bfa8bca1d7417337 GIT binary patch literal 96 zcmezWPme*5AqI%ClSvGj40%BLJcd+;5+H2^RA&IBQ-J&=hEj%fAUl|$fT0MiE*&Tv M4wlgas>lIC0A8&TMgRZ+ literal 0 HcmV?d00001 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 : + + + (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 @@ + + + + +
+ + + + + + + + + + + + + + + + + + +