springnet-commits Mailing List for Spring Framework .NET (Page 9)
Brought to you by:
aseovic,
markpollack
You can subscribe to this list here.
2004 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(33) |
Aug
(163) |
Sep
(491) |
Oct
(289) |
Nov
(336) |
Dec
(84) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
(227) |
Feb
(413) |
Mar
(128) |
Apr
(232) |
May
(92) |
Jun
(299) |
Jul
(386) |
Aug
(228) |
Sep
(237) |
Oct
(426) |
Nov
(325) |
Dec
(405) |
2006 |
Jan
(315) |
Feb
(311) |
Mar
(152) |
Apr
(177) |
May
(443) |
Jun
(92) |
Jul
(88) |
Aug
(80) |
Sep
(288) |
Oct
(515) |
Nov
(1049) |
Dec
(440) |
2007 |
Jan
(179) |
Feb
(406) |
Mar
(294) |
Apr
(80) |
May
(432) |
Jun
(242) |
Jul
(452) |
Aug
(710) |
Sep
(206) |
Oct
(240) |
Nov
(65) |
Dec
(227) |
2008 |
Jan
(80) |
Feb
(90) |
Mar
(98) |
Apr
(136) |
May
(101) |
Jun
(12) |
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Mark P. <mar...@us...> - 2008-04-03 05:33:18
|
Update of /cvsroot/springnet/Spring.Net/src/Spring/Spring.Core/Objects/Factory/Support In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv7595 Modified Files: AbstractObjectFactory.cs Log Message: misc comment update Index: AbstractObjectFactory.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Core/Objects/Factory/Support/AbstractObjectFactory.cs,v retrieving revision 1.74 retrieving revision 1.75 diff -C2 -d -r1.74 -r1.75 *** AbstractObjectFactory.cs 22 Feb 2008 15:28:36 -0000 1.74 --- AbstractObjectFactory.cs 3 Apr 2008 05:33:14 -0000 1.75 *************** *** 1381,1386 **** --- 1381,1391 ---- private IObjectFactory parentObjectFactory; + /// <summary> + /// Dependency types to ignore on dependency check and autowire, as Set of + /// Type objects: for example, string. Default is none. + /// </summary> private ISet ignoreDependencyTypes = new HybridSet(); + /// <summary> /// ObjectPostProcessors to apply in CreateObject |
From: Mark P. <mar...@us...> - 2008-04-03 05:31:29
|
Update of /cvsroot/springnet/Spring.Net/src/Spring/Spring.Web/Web/UI In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv6768 Modified Files: UserControl.cs Log Message: SPRNET-913 - Add convenience method in Spring.Web.UI.Page/UserControl to navigate to a Result using a user provided object for result expression evaluation SPRNET-914 : Add convenience method to get the Spring.Web.UI.Page Result as a url Index: UserControl.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Web/Web/UI/UserControl.cs,v retrieving revision 1.53 retrieving revision 1.54 diff -C2 -d -r1.53 -r1.54 *** UserControl.cs 3 Apr 2008 04:32:29 -0000 1.53 --- UserControl.cs 3 Apr 2008 05:31:25 -0000 1.54 *************** *** 547,550 **** --- 547,555 ---- } + /// <summary> + /// Redirects user to a URL mapped to specified result name. + /// </summary> + /// <param name="resultName">Result name.</param> + /// <param name="context">The context to use for evaluating the SpEL expression in the Result.</param> protected void SetResult(string resultName, object context) { |
From: Mark P. <mar...@us...> - 2008-04-03 05:24:42
|
Update of /cvsroot/springnet/Spring.Net/src/Spring/Spring.Data/Data/Common In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv3863 Modified Files: dbproviders.xml Log Message: move things around for easier diff w/ java error code file. Index: dbproviders.xml =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Data/Data/Common/dbproviders.xml,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** dbproviders.xml 3 Apr 2008 05:06:35 -0000 1.35 --- dbproviders.xml 3 Apr 2008 05:24:38 -0000 1.36 *************** *** 317,326 **** <value>54</value> </property> - <property name="ErrorCodes.DeadlockLoserCodes"> - <value>60</value> - </property> <property name="ErrorCodes.CannotSerializeTransactionCodes"> <value>8177</value> </property> </object> </constructor-arg> --- 317,326 ---- <value>54</value> </property> <property name="ErrorCodes.CannotSerializeTransactionCodes"> <value>8177</value> </property> + <property name="ErrorCodes.DeadlockLoserCodes"> + <value>60</value> + </property> </object> </constructor-arg> |
From: Mark P. <mar...@us...> - 2008-04-03 05:06:39
|
Update of /cvsroot/springnet/Spring.Net/src/Spring/Spring.Data/Data/Common In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv29146 Modified Files: dbproviders.xml Log Message: Add additonal db error codes for exception translation for Oracle and MySql providers Index: dbproviders.xml =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Data/Data/Common/dbproviders.xml,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** dbproviders.xml 3 Apr 2008 04:55:21 -0000 1.34 --- dbproviders.xml 3 Apr 2008 05:06:35 -0000 1.35 *************** *** 262,276 **** </property> <property name="ErrorCodes.DataIntegrityViolationCodes"> ! <value>1,1400,1722,2291</value> </property> <property name="ErrorCodes.CannotAcquireLockCodes"> <value>54</value> </property> - <property name="ErrorCodes.DeadlockLoserCodes"> - <value>60</value> - </property> <property name="ErrorCodes.CannotSerializeTransactionCodes"> <value>8177</value> </property> </object> </constructor-arg> --- 262,276 ---- </property> <property name="ErrorCodes.DataIntegrityViolationCodes"> ! <value>1,1400,1722,2291,2292</value> </property> <property name="ErrorCodes.CannotAcquireLockCodes"> <value>54</value> </property> <property name="ErrorCodes.CannotSerializeTransactionCodes"> <value>8177</value> </property> + <property name="ErrorCodes.DeadlockLoserCodes"> + <value>60</value> + </property> </object> </constructor-arg> *************** *** 364,368 **** </property> <property name="ErrorCodes.DataIntegrityViolationCodes"> ! <value>1062,1169,1215,1216,1217,1451,1452,1557</value> </property> <property name="ErrorCodes.CannotAcquireLockCodes"> --- 364,368 ---- </property> <property name="ErrorCodes.DataIntegrityViolationCodes"> ! <value>630,839,840,893,1062,1169,1215,1216,1217,1451,1452,1557</value> </property> <property name="ErrorCodes.CannotAcquireLockCodes"> *************** *** 406,410 **** </property> <property name="ErrorCodes.DataIntegrityViolationCodes"> ! <value>1062,1169,1215,1216,1217,1451,1452,1557</value> </property> <property name="ErrorCodes.CannotAcquireLockCodes"> --- 406,410 ---- </property> <property name="ErrorCodes.DataIntegrityViolationCodes"> ! <value>630,839,840,893,1062,1169,1215,1216,1217,1451,1452,1557</value> </property> <property name="ErrorCodes.CannotAcquireLockCodes"> *************** *** 452,456 **** </property> <property name="ErrorCodes.DataIntegrityViolationCodes"> ! <value>1062,1169,1215,1216,1217,1451,1452</value> </property> <property name="ErrorCodes.CannotAcquireLockCodes"> --- 452,456 ---- </property> <property name="ErrorCodes.DataIntegrityViolationCodes"> ! <value>630,839,840,893,1062,1169,1215,1216,1217,1451,1452,1557</value> </property> <property name="ErrorCodes.CannotAcquireLockCodes"> *************** *** 494,498 **** </property> <property name="ErrorCodes.DataIntegrityViolationCodes"> ! <value>1062,1169,1215,1216,1217,1451,1452</value> </property> <property name="ErrorCodes.CannotAcquireLockCodes"> --- 494,498 ---- </property> <property name="ErrorCodes.DataIntegrityViolationCodes"> ! <value>630,839,840,893,1062,1169,1215,1216,1217,1451,1452,1557</value> </property> <property name="ErrorCodes.CannotAcquireLockCodes"> *************** *** 539,543 **** </property> <property name="ErrorCodes.DataIntegrityViolationCodes"> ! <value>1062,1169,1215,1216,1217,1451,1452,1557</value> </property> <property name="ErrorCodes.CannotAcquireLockCodes"> --- 539,543 ---- </property> <property name="ErrorCodes.DataIntegrityViolationCodes"> ! <value>630,839,840,893,1062,1169,1215,1216,1217,1451,1452,1557</value> </property> <property name="ErrorCodes.CannotAcquireLockCodes"> *************** *** 581,585 **** </property> <property name="ErrorCodes.DataIntegrityViolationCodes"> ! <value>1062,1169,1215,1216,1217,1451,1452,1557</value> </property> <property name="ErrorCodes.CannotAcquireLockCodes"> --- 581,585 ---- </property> <property name="ErrorCodes.DataIntegrityViolationCodes"> ! <value>630,839,840,893,1062,1169,1215,1216,1217,1451,1452,1557</value> </property> <property name="ErrorCodes.CannotAcquireLockCodes"> |
From: Mark P. <mar...@us...> - 2008-04-03 04:55:25
|
Update of /cvsroot/springnet/Spring.Net/src/Spring/Spring.Data/Data/Common In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv24497 Modified Files: dbproviders.xml Log Message: SPRNET-916 - Add additional BadSqlGrammarCode for Postgres Index: dbproviders.xml =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Data/Data/Common/dbproviders.xml,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** dbproviders.xml 3 Apr 2008 04:48:47 -0000 1.33 --- dbproviders.xml 3 Apr 2008 04:55:21 -0000 1.34 *************** *** 620,624 **** <!-- error codes taken from http://www.postgresql.org/docs/8.1/static/errcodes-appendix.html --> <property name="ErrorCodes.badSqlGrammarCodes"> ! <value>03000,42000,42601,42602,42622,42804</value> </property> <property name="ErrorCodes.DataAccessResourceFailureCodes"> --- 620,624 ---- <!-- error codes taken from http://www.postgresql.org/docs/8.1/static/errcodes-appendix.html --> <property name="ErrorCodes.badSqlGrammarCodes"> ! <value>03000,42000,42601,42602,42622,42804,42P01</value> </property> <property name="ErrorCodes.DataAccessResourceFailureCodes"> *************** *** 665,669 **** <!-- error codes taken from http://www.postgresql.org/docs/8.1/static/errcodes-appendix.html --> <property name="ErrorCodes.badSqlGrammarCodes"> ! <value>03000,42000,42601,42602,42622,42804</value> </property> <property name="ErrorCodes.DataAccessResourceFailureCodes"> --- 665,669 ---- <!-- error codes taken from http://www.postgresql.org/docs/8.1/static/errcodes-appendix.html --> <property name="ErrorCodes.badSqlGrammarCodes"> ! <value>03000,42000,42601,42602,42622,42804,42P01</value> </property> <property name="ErrorCodes.DataAccessResourceFailureCodes"> |
From: Mark P. <mar...@us...> - 2008-04-03 04:48:57
|
Update of /cvsroot/springnet/Spring.Net/src/Spring/Spring.Data/Transaction/Interceptor In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv21658 Modified Files: MethodMapTransactionAttributeSource.cs Log Message: SPRNET-915 - Add additional CannotSerializeTransactionCodes for Oracle providers remove old comment in MethodMapTxAttribSrc Index: MethodMapTransactionAttributeSource.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Data/Transaction/Interceptor/MethodMapTransactionAttributeSource.cs,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** MethodMapTransactionAttributeSource.cs 29 Dec 2007 00:28:53 -0000 1.12 --- MethodMapTransactionAttributeSource.cs 3 Apr 2008 04:48:53 -0000 1.13 *************** *** 81,85 **** public IDictionary MethodMap { - //TODO investigate why can't be of type IDictionary... set { --- 81,84 ---- |
From: Mark P. <mar...@us...> - 2008-04-03 04:48:51
|
Update of /cvsroot/springnet/Spring.Net/src/Spring/Spring.Data/Data/Common In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv21645 Modified Files: dbproviders.xml Log Message: SPRNET-915 - Add additional CannotSerializeTransactionCodes for Oracle providers remove old comment in MethodMapTxAttribSrc Index: dbproviders.xml =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Data/Data/Common/dbproviders.xml,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** dbproviders.xml 2 Apr 2008 19:37:11 -0000 1.32 --- dbproviders.xml 3 Apr 2008 04:48:47 -0000 1.33 *************** *** 270,273 **** --- 270,276 ---- <value>60</value> </property> + <property name="ErrorCodes.CannotSerializeTransactionCodes"> + <value>8177</value> + </property> </object> </constructor-arg> *************** *** 317,320 **** --- 320,326 ---- <value>60</value> </property> + <property name="ErrorCodes.CannotSerializeTransactionCodes"> + <value>8177</value> + </property> </object> </constructor-arg> *************** *** 710,714 **** </property> <property name="ErrorCodes.DataAccessResourceFailureCodes"> ! <value>-904</value> </property> <property name="ErrorCodes.DataIntegrityViolationCodes"> --- 716,720 ---- </property> <property name="ErrorCodes.DataAccessResourceFailureCodes"> ! <value>-904,-971</value> </property> <property name="ErrorCodes.DataIntegrityViolationCodes"> *************** *** 752,756 **** </property> <property name="ErrorCodes.DataAccessResourceFailureCodes"> ! <value>-904</value> </property> <property name="ErrorCodes.DataIntegrityViolationCodes"> --- 758,762 ---- </property> <property name="ErrorCodes.DataAccessResourceFailureCodes"> ! <value>-904,-971</value> </property> <property name="ErrorCodes.DataIntegrityViolationCodes"> *************** *** 796,800 **** </property> <property name="ErrorCodes.DataAccessResourceFailureCodes"> ! <value>-904</value> </property> <property name="ErrorCodes.DataIntegrityViolationCodes"> --- 802,806 ---- </property> <property name="ErrorCodes.DataAccessResourceFailureCodes"> ! <value>-904,-971</value> </property> <property name="ErrorCodes.DataIntegrityViolationCodes"> *************** *** 838,842 **** </property> <property name="ErrorCodes.DataAccessResourceFailureCodes"> ! <value>-904</value> </property> <property name="ErrorCodes.DataIntegrityViolationCodes"> --- 844,848 ---- </property> <property name="ErrorCodes.DataAccessResourceFailureCodes"> ! <value>-904,-971</value> </property> <property name="ErrorCodes.DataIntegrityViolationCodes"> *************** *** 883,887 **** </property> <property name="ErrorCodes.DataAccessResourceFailureCodes"> ! <value>-904</value> </property> <property name="ErrorCodes.DataIntegrityViolationCodes"> --- 889,893 ---- </property> <property name="ErrorCodes.DataAccessResourceFailureCodes"> ! <value>-904,-971</value> </property> <property name="ErrorCodes.DataIntegrityViolationCodes"> |
From: Mark P. <mar...@us...> - 2008-04-03 04:32:34
|
Update of /cvsroot/springnet/Spring.Net/src/Spring/Spring.Web/Web/UI In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv15243 Modified Files: Page.cs UserControl.cs Log Message: SPRNET-913 - Add convenience method in Spring.Web.UI.Page/UserControl to navigate to a Result using a user provided object for result expression evaluation SPRNET-914 : Add convenience method to get the Spring.Web.UI.Page Result as a url Index: Page.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Web/Web/UI/Page.cs,v retrieving revision 1.88 retrieving revision 1.89 diff -C2 -d -r1.88 -r1.89 *** Page.cs 19 Mar 2008 12:07:15 -0000 1.88 --- Page.cs 3 Apr 2008 04:32:29 -0000 1.89 *************** *** 1092,1096 **** protected internal void SetResult(string resultName) { ! Result result = (Result) Results[resultName]; if (result == null) { --- 1092,1141 ---- protected internal void SetResult(string resultName) { ! GetResult(resultName).Navigate(this); ! } ! ! ! /// <summary> ! /// Redirects user to a URL mapped to specified result name. ! /// </summary> ! /// <param name="resultName">Name of the result.</param> ! /// <param name="context">The context to use for evaluating the SpEL expression in the Result.</param> ! protected internal void SetResult(string resultName, object context) ! { ! GetResult(resultName).Navigate(context); ! } ! ! ! /// <summary> ! /// Returns a redirect url string that points to the ! /// <see cref="Spring.Web.Support.Result.TargetPage"/> defined by this ! /// result evaluated using this Page for expression ! /// </summary> ! /// <param name="resultName">Name of the result.</param> ! /// <returns>A redirect url string.</returns> ! protected internal string GetResultUrl(string resultName) ! { ! Result result = GetResult(resultName); ! return ResolveUrl(result.GetRedirectUri(this)); ! } ! ! /// <summary> ! /// Returns a redirect url string that points to the ! /// <see cref="Spring.Web.Support.Result.TargetPage"/> defined by this ! /// result evaluated using this Page for expression ! /// </summary> ! /// <param name="resultName">Name of the result.</param> ! /// <param name="context">The context to use for evaluating the SpEL expression in the Result</param> ! /// <returns>A redirect url string.</returns> ! protected internal string GetResultUrl(string resultName, object context) ! { ! Result result = GetResult(resultName); ! return ResolveUrl(result.GetRedirectUri(context)); ! } ! ! ! private Result GetResult(string resultName) ! { ! Result result = (Result)Results[resultName]; if (result == null) { *************** *** 1098,1105 **** string.Format("No URL mapping found for the specified result '{0}'.", resultName), "resultName"); } ! ! result.Navigate(this); } #endregion --- 1143,1151 ---- string.Format("No URL mapping found for the specified result '{0}'.", resultName), "resultName"); } ! return result; } + + #endregion *************** *** 1617,1620 **** --- 1663,1667 ---- #endregion Dependency Injection Support + } } \ No newline at end of file Index: UserControl.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Web/Web/UI/UserControl.cs,v retrieving revision 1.52 retrieving revision 1.53 diff -C2 -d -r1.52 -r1.53 *** UserControl.cs 19 Mar 2008 12:07:15 -0000 1.52 --- UserControl.cs 3 Apr 2008 04:32:29 -0000 1.53 *************** *** 547,550 **** --- 547,577 ---- } + protected void SetResult(string resultName, object context) + { + Result result = (Result)Results[resultName]; + if (result == null) + { + // bubble up result in the hierarchy + Control parent = this.Parent; + while (parent != null) + { + if (parent is UserControl) + { + ((UserControl)parent).SetResult(resultName, context); + return; + } + else if (parent is Page) + { + ((Page)parent).SetResult(resultName, context); + return; + } + parent = parent.Parent; + } + throw new ArgumentException(string.Format("No URL mapping found for the specified result '{0}'.", resultName), "resultName"); + } + + result.Navigate(context); + } + #endregion |
From: Mark P. <mar...@us...> - 2008-04-03 02:45:51
|
Update of /cvsroot/springnet/Spring.Net/doc/reference/src In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv3520 Modified Files: validation.xml Log Message: SPRNET-587 - Add example of validation usage in middle tier services Index: validation.xml =================================================================== RCS file: /cvsroot/springnet/Spring.Net/doc/reference/src/validation.xml,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** validation.xml 2 Apr 2008 22:59:54 -0000 1.21 --- validation.xml 3 Apr 2008 02:45:45 -0000 1.22 *************** *** 583,586 **** --- 583,614 ---- </section> + <section> + <title>Progammatic usage</title> + + <para>You can also create Validators programmatically using the API. An + example is shown below</para> + + <programlisting>UserInfo userInfo = new UserInfo(); // has Name and Password props + + ValidatorGroup userInfoValidator = new ValidatorGroup(); + + userInfoValidator.Validators + .Add(new RequiredValidator("Name", null)); + + userInfoValidator.Validators + .Add(new RequiredValidator("Password", null)); + + ValidationErrors errors = new ValidationErrors(); + bool userInfoIsValid = userInfoValidator.Validate(userInfo, errors); + </programlisting> + + <para>No matter if you create your validators programmatically or + declaratively, you can invoke them in service side code via the 'Validate' + method shown above and then handle error conditions. Spring provides AOP + parameter validation advice as part of ithe <link + linkend="aop-aspect-library">aspect library</link> which may also be + useful for performing server-side validation.</para> + </section> + <section id="validation-aspnet-usage"> <title>Usage tips within ASP.NET</title> |
From: Mark P. <mar...@us...> - 2008-04-03 02:36:58
|
Update of /cvsroot/springnet/Spring.Net/doc/reference/src In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv32454 Modified Files: transaction.xml Log Message: SPRNET-689 - Add more documentation describing ITransactionAttributeSource implementations. Index: transaction.xml =================================================================== RCS file: /cvsroot/springnet/Spring.Net/doc/reference/src/transaction.xml,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** transaction.xml 17 Feb 2008 13:19:51 -0000 1.27 --- transaction.xml 3 Apr 2008 02:36:53 -0000 1.28 *************** *** 816,819 **** --- 816,860 ---- <classname>NameMatchTransactionAttributeSource</classname>, or <classname>MethodMapTransactionAttributeSource</classname>.</para> + + <itemizedlist> + <listitem> + <para><classname>MatchAlwaysTransactionAttributeSource</classname> + is configured with a ITransactionAttribute instance that is + applied to all methods. The shorthand string representation, + i.e. PROPAGATION_REQUIRED can be used</para> + </listitem> + + <listitem> + <para><classname>AttributesTransactionAttributeSource</classname> + : Use a standard. .NET attributes to specify the transactional + information. See <literal>TransactionAttribute</literal> class + for more information.</para> + </listitem> + + <listitem> + <para><classname>NameMatchTransactionAttributeSource</classname> + allows ITransactionAttributes to be matched by method name. The + NameMap IDictionary property is used to specify the mapping. For + example</para> + + <programlisting><object name="nameMatchTxAttributeSource" type="Spring.Transaction.Interceptor.NameMatchTransactionAttributeSource, Spring.Data" + <property name="SomeDictionary"> + <dictionary> + <entry key="Execute" value="PROPAGATION_REQUIRES_NEW, -ApplicationException"/> + <entry key="HandleData" value="PROPAGATION_REQUIRES, -DataHandlerException"/> + </dictionary> + </property> + + </object></programlisting> + </listitem> + + <listitem> + <para><classname>MethodMapTransactionAttributeSource</classname> + : Similar to NameMatchTransactionAttributeSource but specifies + fully qualified method names (i.e. type.method, assembly) and + wildcards can be used at the start or end of the method name for + matching multiple methods.</para> + </listitem> + </itemizedlist> </listitem> |
From: Mark P. <mar...@us...> - 2008-04-03 02:17:51
|
Update of /cvsroot/springnet/Spring.Net/doc/reference/src In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv24872 Modified Files: objects.xml Log Message: SPRNET-826 - Add section about manually registering objects with the container ("registersingleton" etc.) SPRNET-775 - Document using a custom IFactoryObject to help with configuring embedded resources Index: objects.xml =================================================================== RCS file: /cvsroot/springnet/Spring.Net/doc/reference/src/objects.xml,v retrieving revision 1.121 retrieving revision 1.122 diff -C2 -d -r1.121 -r1.122 *** objects.xml 3 Apr 2008 01:14:26 -0000 1.121 --- objects.xml 3 Apr 2008 02:17:46 -0000 1.122 *************** *** 3803,3806 **** --- 3803,3827 ---- </itemizedlist></para> + <para>A sub-interface of <classname>IObjectFactory</classname>, + <classname>IConfigurableObjectFactory</classname> adds some convenient + methods such as</para> + + <itemizedlist> + <listitem> + <para><literal>void RegisterSingleton(string name, object + objectInstance)</literal> : Register the given existing object as + singleton in the object factory under the given object name.</para> + </listitem> + + <listitem> + <para><literal>void RegisterAlias(string name, string + theAlias)</literal>; Given an object name, create an alias.</para> + </listitem> + </itemizedlist> + + <para>Check the SDK docs for additional details on + IConfigurableObjectFactory methods and properties and the full + <classname>IObjectFactory</classname> class hierarchy.</para> + <sect2> <title>Obtaining an <classname>IFactoryObject</classname>, not its *************** *** 4649,4653 **** described in <xref linkend="objects-advancedproperty-setting" /> for the <classname>PropertyRetrievingFactoryObject</classname> and ! <classname>FieldRetrievingFactoryObject</classname>.</para> <para>Finally, there is sometimes a need to ask a container for an --- 4670,4679 ---- described in <xref linkend="objects-advancedproperty-setting" /> for the <classname>PropertyRetrievingFactoryObject</classname> and ! <classname>FieldRetrievingFactoryObject</classname>. An additional use ! of creating an custom IFactoryObject implementation is to retrieve an ! object from an embedded resource file and use it to set another objects ! dependency. An example of this is provided <ulink ! url="http://jira.springframework.org/browse/SPRNET-133#action_19743">here</ulink>. ! </para> <para>Finally, there is sometimes a need to ask a container for an |
From: Mark P. <mar...@us...> - 2008-04-03 01:14:33
|
Update of /cvsroot/springnet/Spring.Net/doc/reference/src In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv816 Modified Files: objects.xml Log Message: SPRNET-865 - Add Documention for the expression attribute. Index: objects.xml =================================================================== RCS file: /cvsroot/springnet/Spring.Net/doc/reference/src/objects.xml,v retrieving revision 1.120 retrieving revision 1.121 diff -C2 -d -r1.120 -r1.121 *** objects.xml 2 Apr 2008 18:02:11 -0000 1.120 --- objects.xml 3 Apr 2008 01:14:26 -0000 1.121 *************** *** 1736,1740 **** can also again be any of the elements:</emphasis> ! <programlisting>(object | ref | idref | list | set | dictionary | name-values | value | null)</programlisting> </para> --- 1736,1740 ---- can also again be any of the elements:</emphasis> ! <programlisting>(object | ref | idref | expression | list | set | dictionary | name-values | value | null)</programlisting> </para> *************** *** 2012,2026 **** <sect3 id="objects-referencing-compound-properties"> ! <title>Compound property names</title> </sect3> <para>Note that compound or nested property names are perfectly legal ! when setting object properties, as long as all components of the path ! except the final property name are non-null. For example, in this object ! definition:</para> <programlisting><object id="foo" type="Spring.Foo, Spring.Foo"> <property name="bar.baz.name" value="Bingo"/> </object></programlisting> </sect2> --- 2012,2044 ---- <sect3 id="objects-referencing-compound-properties"> ! <title>Compound property names and Spring expression ! references</title> </sect3> <para>Note that compound or nested property names are perfectly legal ! when setting object properties. Property names are interpreted using the ! <link linkend="expressions">Spring Expression Language</link> (SpEL) and ! therefore can leverage its many features to set property names. For ! example, in this object definition a simple nested property name is ! configured</para> <programlisting><object id="foo" type="Spring.Foo, Spring.Foo"> <property name="bar.baz.name" value="Bingo"/> </object></programlisting> + + <para>As an example of some alternative ways to declare the property + name, you can use SpEL's support for indexers to configure a Dictionary + key value pair as an alternative to the nested + <literal><dictionary></literal> element. More importantly, you can + use the 'expression' element to refer to a Spring expression as the + value of the property. Simple examples of this are shown below</para> + + <programlisting><property name=âminValueâ expression=âint.MinValueâ /> + + <property name=âweekFromTodayâ expression="DateTime.Today + 7"/></programlisting> + + <para>Using SpEL's support for method evaluation, you can easily call + static method on various helper classes in your XML + configuraiton.</para> </sect2> |
From: Mark P. <mar...@us...> - 2008-04-02 23:02:40
|
Update of /cvsroot/springnet/Spring.Net/src/Spring/Spring.Core/Validation In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv15809 Added Files: ValidatedAttribute.cs Removed Files: ValidationAttribute.cs Log Message: SPRNET-911 - Provide ParameterValidationAdvice to use validation framework to validate method arguments. --- NEW FILE: ValidatedAttribute.cs --- (This appears to be a binary file; contents omitted.) --- ValidationAttribute.cs DELETED --- |
From: Mark P. <mar...@us...> - 2008-04-02 23:00:49
|
Update of /cvsroot/springnet/Spring.Net/test/Spring/Spring.Aop.Tests/Aspects/Validation In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv14936 Modified Files: ParameterValidationAdviceTests.cs Log Message: SPRNET-911 - Provide ParameterValidationAdvice to use validation framework to validate method arguments. Index: ParameterValidationAdviceTests.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/test/Spring/Spring.Aop.Tests/Aspects/Validation/ParameterValidationAdviceTests.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ParameterValidationAdviceTests.cs 5 Feb 2008 21:38:49 -0000 1.1 --- ParameterValidationAdviceTests.cs 2 Apr 2008 23:00:46 -0000 1.2 *************** *** 104,108 **** public sealed class ValidationTarget : IValidationTarget { ! public void Save([Validation("required")] Inventor inventor) { inventor.Name = inventor.Name.ToUpper(); --- 104,108 ---- public sealed class ValidationTarget : IValidationTarget { ! public void Save([Validated("required")] Inventor inventor) { inventor.Name = inventor.Name.ToUpper(); |
From: Mark P. <mar...@us...> - 2008-04-02 23:00:46
|
Update of /cvsroot/springnet/Spring.Net/src/Spring/Spring.Core In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv14913 Modified Files: Spring.Core.2005.csproj Log Message: SPRNET-911 - Provide ParameterValidationAdvice to use validation framework to validate method arguments. Index: Spring.Core.2005.csproj =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Core/Spring.Core.2005.csproj,v retrieving revision 1.121 retrieving revision 1.122 diff -C2 -d -r1.121 -r1.122 *** Spring.Core.2005.csproj 2 Apr 2008 18:02:24 -0000 1.121 --- Spring.Core.2005.csproj 2 Apr 2008 23:00:38 -0000 1.122 *************** *** 1008,1012 **** <SubType>Code</SubType> </Compile> ! <Compile Include="Validation\ValidationAttribute.cs" /> <Compile Include="Validation\ValidationException.cs" /> <Compile Include="Validation\IValidationAction.cs" /> --- 1008,1012 ---- <SubType>Code</SubType> </Compile> ! <Compile Include="Validation\ValidatedAttribute.cs" /> <Compile Include="Validation\ValidationException.cs" /> <Compile Include="Validation\IValidationAction.cs" /> |
From: Mark P. <mar...@us...> - 2008-04-02 23:00:33
|
Update of /cvsroot/springnet/Spring.Net/src/Spring/Spring.Aop/Aspects/Validation In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv14890 Modified Files: ParameterValidationAdvice.cs Log Message: SPRNET-911 - Provide ParameterValidationAdvice to use validation framework to validate method arguments. Index: ParameterValidationAdvice.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Aop/Aspects/Validation/ParameterValidationAdvice.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ParameterValidationAdvice.cs 5 Feb 2008 21:38:49 -0000 1.1 --- ParameterValidationAdvice.cs 2 Apr 2008 23:00:28 -0000 1.2 *************** *** 12,16 **** /// <remarks> /// <para>Each argument that should be validated has to be marked with one or more ! /// <see cref="ValidationAttribute"/>s.</para> /// <para>If the validation fails, this advice will throw <see cref="ValidationException"/>, /// thus preventing target method invocation. --- 12,16 ---- /// <remarks> /// <para>Each argument that should be validated has to be marked with one or more ! /// <see cref="ValidatedAttribute"/>s.</para> /// <para>If the validation fails, this advice will throw <see cref="ValidationException"/>, /// thus preventing target method invocation. *************** *** 47,53 **** { ParameterInfo info = parameters[i]; ! ValidationAttribute[] attributes = (ValidationAttribute[]) info.GetCustomAttributes(typeof(ValidationAttribute), true); ! foreach (ValidationAttribute attribute in attributes) { // throws NoSuchObjectDefinitionException if validator cannot be found --- 47,53 ---- { ParameterInfo info = parameters[i]; ! ValidatedAttribute[] attributes = (ValidatedAttribute[]) info.GetCustomAttributes(typeof(ValidatedAttribute), true); ! foreach (ValidatedAttribute attribute in attributes) { // throws NoSuchObjectDefinitionException if validator cannot be found |
From: Mark P. <mar...@us...> - 2008-04-02 23:00:23
|
Update of /cvsroot/springnet/Spring.Net/examples/Spring/SpringAir/src/SpringAir.Web.2005/Web/BookTrip In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv14866 Modified Files: Web.config Log Message: SPRNET-911 - Provide ParameterValidationAdvice to use validation framework to validate method arguments. Index: Web.config =================================================================== RCS file: /cvsroot/springnet/Spring.Net/examples/Spring/SpringAir/src/SpringAir.Web.2005/Web/BookTrip/Web.config,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Web.config 24 Nov 2006 12:26:02 -0000 1.2 --- Web.config 2 Apr 2008 23:00:20 -0000 1.3 *************** *** 31,69 **** <object type="ReservationConfirmationPage.aspx" parent="standardPage" /> - <v:group id="tripValidator"> - - <v:required id="departureAirportValidator" test="StartingFrom.AirportCode"> - <v:message id="error.departureAirport.required" providers="departureAirportErrors, validationSummary"/> - </v:required> - - <v:group id="destinationAirportValidator"> - <v:required test="ReturningFrom.AirportCode"> - <v:message id="error.destinationAirport.required" providers="destinationAirportErrors, validationSummary"/> - </v:required> - <v:condition test="ReturningFrom.AirportCode != StartingFrom.AirportCode" when="ReturningFrom.AirportCode != ''"> - <v:message id="error.destinationAirport.sameAsDeparture" providers="destinationAirportErrors, validationSummary"/> - </v:condition> - </v:group> - - <v:group id="departureDateValidator"> - <v:required test="StartingFrom.Date"> - <v:message id="error.departureDate.required" providers="departureDateErrors, validationSummary"/> - </v:required> - <v:condition test="StartingFrom.Date >= DateTime.Today" when="StartingFrom.Date != DateTime.MinValue"> - <v:message id="error.departureDate.inThePast" providers="departureDateErrors, validationSummary"/> - </v:condition> - </v:group> - - <v:group id="returnDateValidator" when="Mode == 'RoundTrip'"> - <v:required test="ReturningFrom.Date"> - <v:message id="error.returnDate.required" providers="returnDateErrors, validationSummary"/> - </v:required> - <v:condition test="ReturningFrom.Date >= StartingFrom.Date" when="ReturningFrom.Date != DateTime.MinValue"> - <v:message id="error.returnDate.beforeDeparture" providers="returnDateErrors, validationSummary"/> - </v:condition> - </v:group> - - </v:group> - </objects> </spring> --- 31,34 ---- |
From: Mark P. <mar...@us...> - 2008-04-02 23:00:20
|
Update of /cvsroot/springnet/Spring.Net/examples/Spring/SpringAir/src/SpringAir.Web.2005 In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv14774 Modified Files: Web.config Log Message: SPRNET-911 - Provide ParameterValidationAdvice to use validation framework to validate method arguments. Index: Web.config =================================================================== RCS file: /cvsroot/springnet/Spring.Net/examples/Spring/SpringAir/src/SpringAir.Web.2005/Web.config,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Web.config 19 Mar 2008 18:05:06 -0000 1.9 --- Web.config 2 Apr 2008 23:00:14 -0000 1.10 *************** *** 33,36 **** --- 33,37 ---- <resource uri="~/Config/Web.xml"/> <resource uri="~/Config/Services.xml"/> + <resource uri="~/Config/Validation.xml"/> <!-- TEST CONFIGURATION --> <resource uri="~/Config/Test/Services.xml"/> |
From: Mark P. <mar...@us...> - 2008-04-02 23:00:19
|
Update of /cvsroot/springnet/Spring.Net/examples/Spring/SpringAir/src/SpringAir.Web.2005/Config In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv14774/Config Modified Files: Aspects.xml Added Files: Validation.xml Log Message: SPRNET-911 - Provide ParameterValidationAdvice to use validation framework to validate method arguments. Index: Aspects.xml =================================================================== RCS file: /cvsroot/springnet/Spring.Net/examples/Spring/SpringAir/src/SpringAir.Web.2005/Config/Aspects.xml,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Aspects.xml 18 Mar 2007 22:34:00 -0000 1.3 --- Aspects.xml 2 Apr 2008 23:00:10 -0000 1.4 *************** *** 22,24 **** --- 22,39 ---- </object> + <object id="validationAdvice" type="Spring.Aspects.Validation.ParameterValidationAdvice, Spring.Aop"/> + + <object type="Spring.Aop.Framework.AutoProxy.ObjectNameAutoProxyCreator, Spring.Aop"> + <property name="ObjectNames"> + <list> + <value>bookingAgent</value> + </list> + </property> + <property name="InterceptorNames"> + <list> + <value>validationAdvice</value> + </list> + </property> + </object> + </objects> --- NEW FILE: Validation.xml --- (This appears to be a binary file; contents omitted.) |
From: Mark P. <mar...@us...> - 2008-04-02 23:00:05
|
Update of /cvsroot/springnet/Spring.Net/examples/Spring/SpringAir/src/SpringAir.Core/Service In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv14426/Service Modified Files: DefaultBookingAgent.cs Log Message: SPRNET-911 - Provide ParameterValidationAdvice to use validation framework to validate method arguments. Index: DefaultBookingAgent.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/examples/Spring/SpringAir/src/SpringAir.Core/Service/DefaultBookingAgent.cs,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** DefaultBookingAgent.cs 16 Mar 2007 13:14:11 -0000 1.8 --- DefaultBookingAgent.cs 2 Apr 2008 23:00:00 -0000 1.9 *************** *** 22,25 **** --- 22,26 ---- using System; + using Spring.Validation; using SpringAir.Data; using SpringAir.Domain; *************** *** 177,181 **** } ! public FlightSuggestions SuggestFlights(Trip trip) { #region Sanity Check --- 178,182 ---- } ! public FlightSuggestions SuggestFlights([Validated("tripValidator")] Trip trip) { #region Sanity Check |
From: Mark P. <mar...@us...> - 2008-04-02 23:00:05
|
Update of /cvsroot/springnet/Spring.Net/examples/Spring/SpringAir/src/SpringAir.Core In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv14426 Modified Files: SpringAir.Core.2003.csproj SpringAir.Core.2005.csproj Log Message: SPRNET-911 - Provide ParameterValidationAdvice to use validation framework to validate method arguments. Index: SpringAir.Core.2003.csproj =================================================================== RCS file: /cvsroot/springnet/Spring.Net/examples/Spring/SpringAir/src/SpringAir.Core/SpringAir.Core.2003.csproj,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** SpringAir.Core.2003.csproj 1 Nov 2006 01:14:03 -0000 1.1 --- SpringAir.Core.2003.csproj 2 Apr 2008 23:00:00 -0000 1.2 *************** *** 2,6 **** <CSHARP ProjectType = "Local" ! ProductVersion = "7.10.3077" SchemaVersion = "2.0" ProjectGuid = "{5E3427D8-62FC-483F-A86B-B44A79A46BCC}" --- 2,6 ---- <CSHARP ProjectType = "Local" ! ProductVersion = "7.10.6030" SchemaVersion = "2.0" ProjectGuid = "{5E3427D8-62FC-483F-A86B-B44A79A46BCC}" *************** *** 80,83 **** --- 80,88 ---- HintPath = "..\..\..\..\..\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.XML.dll" /> + <Reference + Name = "Spring.Core" + AssemblyName = "Spring.Core" + HintPath = "..\..\..\..\..\bin\net\1.1\debug\Spring.Core.dll" + /> </References> </Build> Index: SpringAir.Core.2005.csproj =================================================================== RCS file: /cvsroot/springnet/Spring.Net/examples/Spring/SpringAir/src/SpringAir.Core/SpringAir.Core.2005.csproj,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** SpringAir.Core.2005.csproj 1 Nov 2006 02:44:31 -0000 1.2 --- SpringAir.Core.2005.csproj 2 Apr 2008 23:00:00 -0000 1.3 *************** *** 75,78 **** --- 75,82 ---- </PropertyGroup> <ItemGroup> + <Reference Include="Spring.Core, Version=1.1.1.20001, Culture=neutral, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\..\..\..\bin\net\2.0\debug\Spring.Core.dll</HintPath> + </Reference> <Reference Include="System"> <Name>System</Name> |
From: Mark P. <mar...@us...> - 2008-04-02 22:59:58
|
Update of /cvsroot/springnet/Spring.Net/doc/reference/src In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv14413 Modified Files: aop-aspect-library.xml validation.xml Log Message: SPRNET-911 - Provide ParameterValidationAdvice to use validation framework to validate method arguments. Index: validation.xml =================================================================== RCS file: /cvsroot/springnet/Spring.Net/doc/reference/src/validation.xml,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** validation.xml 25 Feb 2008 20:35:59 -0000 1.20 --- validation.xml 2 Apr 2008 22:59:54 -0000 1.21 *************** *** 583,587 **** </section> ! <section> <title>Usage tips within ASP.NET</title> --- 583,587 ---- </section> ! <section id="validation-aspnet-usage"> <title>Usage tips within ASP.NET</title> Index: aop-aspect-library.xml =================================================================== RCS file: /cvsroot/springnet/Spring.Net/doc/reference/src/aop-aspect-library.xml,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** aop-aspect-library.xml 16 Jan 2008 17:21:44 -0000 1.11 --- aop-aspect-library.xml 2 Apr 2008 22:59:54 -0000 1.12 *************** *** 10,16 **** module. However, the aspects that are documented in this section are those contained within the Spring.Aop module itself. The aspects in within ! Spring.Aop.dll are Caching, Exception Handling, Logging, and Retry. Other ! traditional advice types such as validation, security, and thread ! management, will be included in a future release.</para> </sect1> --- 10,17 ---- module. However, the aspects that are documented in this section are those contained within the Spring.Aop module itself. The aspects in within ! Spring.Aop.dll are Caching, Exception Handling, Logging, Retry, and ! Parameter Validation. Other traditional advice types such as validation, ! security, and thread management, will be included in a future ! release.</para> </sect1> *************** *** 657,659 **** --- 658,727 ---- <link linkend="transaction">transaction management</link>.</para> </sect1> + + <sect1> + <title>Parameter Validation</title> + + <para>Spring provides a UI-agnostic <link linkend="validation">validation + framework</link> in which you can declare validation rules, both + progammatically and declaratively, and have those rules evaluated against + an arbitrary .NET object. Spring provides additional support for rendering + of validation errors within Spring's ASP.NET framework. (See the section + on <link linkend="validation-aspnet-usage" os="">ASP.NET usage tips</link> + for more information.) However, validation is not confined to the UI tier. + It is a common task that occurs across most, if not all, applications + layers. Validation that is performed in the UI layer is often repeated in + the service layer, in order to be proactive in case non UI-based clients + invoke the service layer. Validation rules completely different from those + used in the UI layer may be used on the server side. </para> + + <para>To address some of the common needs for validation on the server + side, Spring provides parameter validation advice so that applies Spring's + validation rules to the method parameters. The class + <classname>ParameterValidationAdvice</classname> is used in conjunction + with the <classname>Validated</classname> attribute to specify which + validation rules are applied to method parameters. For example, to apply + parameter validation to the method SuggestFlights in the BookingAgent + class used in the <link linkend="springair">SpringAir sample + application</link>, you would apply the <classname>Validated</classname> + attribute to the method parameters as shown below.</para> + + <programlisting>public FlightSuggestions SuggestFlights( [Validated("tripValidator")] Trip trip) + { + // unmodified implementation goes here + }</programlisting> + + <para>The <literal>Validated</literal> attribute takes a string name that + specifies the name of the validation rule, i.e. the name of the IValidator + object in the Spring application context. The + <classname>Validated</classname> attribute is located in the namespace + <literal>Spring.Validation</literal> of the <literal>Spring.Core</literal> + assembly.</para> + + <para>The configuration of the advice is to simply define the an instance + of the <literal>ParameterValidationAdvice</literal> class and apply the + advice, for example based on object names using an + <classname>ObjectNameAutoProxyCreator</classname>, as shown below,</para> + + <programlisting> <object id="<emphasis role="bold">validationAdvice</emphasis>" type="Spring.Aspects.Validation.ParameterValidationAdvice, Spring.Aop"/> + + <object type="Spring.Aop.Framework.AutoProxy.ObjectNameAutoProxyCreator, Spring.Aop"> + <property name="ObjectNames"> + <list> + <value>bookingAgent</value> + </list> + </property> + <property name="InterceptorNames"> + <list> + <value><emphasis role="bold">validationAdvice</emphasis></value> + </list> + </property> + </object></programlisting> + + <para>When the advised method is invoked first the validation of each + method parameter is performed. If all validation succeeds, then the method + body is executed. If validation fails an exception of the type + <classname>ValidationException</classname> is thrown and you can retrieve + errors information from its property <literal>ValidationErrors</literal>. + See the SDK documentation for details. </para> + </sect1> </chapter> \ No newline at end of file |
From: Mark P. <mar...@us...> - 2008-04-02 19:37:24
|
Update of /cvsroot/springnet/Spring.Net/test/Spring/Spring.Data.Tests/Data/Common In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv1454 Modified Files: AdditionalProviders.xml DbProviderFactoryTests.cs Log Message: SPRNET-902 - DbProvider ExtractError method should explicitly perform ToString operation on object returned from SpEL expression to obtain error code SPRNET-910 - Updated DB2 codes for exception translation Index: AdditionalProviders.xml =================================================================== RCS file: /cvsroot/springnet/Spring.Net/test/Spring/Spring.Data.Tests/Data/Common/AdditionalProviders.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** AdditionalProviders.xml 29 Jan 2008 18:18:17 -0000 1.1 --- AdditionalProviders.xml 2 Apr 2008 19:37:20 -0000 1.2 *************** *** 42,45 **** --- 42,86 ---- </object> + + <object id="Test-SqlServer-2.0-BadErrorCodeExpression" type="Spring.Data.Common.DbProvider, Spring.Data" singleton="false"> + <constructor-arg name="dbMetaData"> + <object type="Spring.Data.Common.DbMetadata"> + <constructor-arg name="productName" value="Microsoft SQL Server, provider V2.0.0.0 in framework .NET V2.0" /> + <constructor-arg name="assemblyName" value="System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/> + <constructor-arg name="connectionType" value="System.Data.SqlClient.SqlConnection, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/> + <constructor-arg name="commandType" value="System.Data.SqlClient.SqlCommand, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/> + <constructor-arg name="parameterType" value="System.Data.SqlClient.SqlParameter, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/> + <constructor-arg name="dataAdapterType" value="System.Data.SqlClient.SqlDataAdapter, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/> + <constructor-arg name="commandBuilderType" value="System.Data.SqlClient.SqlCommandBuilder, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/> + <constructor-arg name="commandBuilderDeriveParametersMethod" value="DeriveParameters"/> + <constructor-arg name="parameterDbType" value="System.Data.SqlDbType, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/> + <constructor-arg name="parameterDbTypeProperty" value="SqlDbType"/> + <constructor-arg name="parameterIsNullableProperty" value="IsNullable"/> + <constructor-arg name="parameterNamePrefix" value="@"/> + <constructor-arg name="exceptionType" value="System.Data.SqlClient.SqlException, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/> + <constructor-arg name="useParameterNamePrefixInParameterCollection" value="true"/> + <constructor-arg name="useParameterPrefixInSql" value="true"/> + <constructor-arg name="bindByName" value="true"/> + <!-- this is only true for .net 1.1 kept it here just in case we want to revert back to this strategy for + obtaining error codes--> + <constructor-arg name="errorCodeExceptionExpression" value="156"/> + + <!-- TODO select form system db all errors that have 'incorrect syntax' at the start of the error string--> + <property name="ErrorCodes.BadSqlGrammarCodes"> + <value>156,170,207,208</value> + </property> + <property name="ErrorCodes.PermissionDeniedCodes"> + <value>229</value> + </property> + <property name="ErrorCodes.DataIntegrityViolationCodes"> + <value>544,2627,8114,8115</value> + </property> + <property name="ErrorCodes.DeadlockLoserCodes"> + <value>1205</value> + </property> + </object> + </constructor-arg> + + </object> </objects> \ No newline at end of file Index: DbProviderFactoryTests.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/test/Spring/Spring.Data.Tests/Data/Common/DbProviderFactoryTests.cs,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** DbProviderFactoryTests.cs 29 Jan 2008 18:50:32 -0000 1.12 --- DbProviderFactoryTests.cs 2 Apr 2008 19:37:20 -0000 1.13 *************** *** 95,98 **** --- 95,109 ---- [Test] + [Ignore("Can't guarantee test order")] + public void BadErrorExpression() + { + + IDbProvider provider = DbProviderFactory.GetDbProvider("Test-SqlServer-2.0-BadErrorCodeExpression"); + Assert.IsNotNull(provider); + string errorCode = provider.ExtractError(new Exception("foo")); + Assert.AreEqual("156",errorCode); + } + + [Test] public void DefaultInstanceWithSqlServer2005() { |
From: Mark P. <mar...@us...> - 2008-04-02 19:37:17
|
Update of /cvsroot/springnet/Spring.Net/src/Spring/Spring.Data/Data/Common In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv1434 Modified Files: DbProvider.cs dbproviders.xml Log Message: SPRNET-902 - DbProvider ExtractError method should explicitly perform ToString operation on object returned from SpEL expression to obtain error code SPRNET-910 - Updated DB2 codes for exception translation Index: DbProvider.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Data/Data/Common/DbProvider.cs,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** DbProvider.cs 29 Jan 2008 18:15:38 -0000 1.16 --- DbProvider.cs 2 Apr 2008 19:37:11 -0000 1.17 *************** *** 193,197 **** if (!StringUtils.IsNullOrEmpty(dbMetadata.ErrorCodeExceptionExpression)) { ! return (string) ExpressionEvaluator.GetValue(e, dbMetadata.ErrorCodeExceptionExpression); } else --- 193,197 ---- if (!StringUtils.IsNullOrEmpty(dbMetadata.ErrorCodeExceptionExpression)) { ! return ExpressionEvaluator.GetValue(e, dbMetadata.ErrorCodeExceptionExpression).ToString(); } else Index: dbproviders.xml =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Data/Data/Common/dbproviders.xml,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** dbproviders.xml 25 Jan 2008 21:37:51 -0000 1.31 --- dbproviders.xml 2 Apr 2008 19:37:11 -0000 1.32 *************** *** 707,711 **** <property name="ErrorCodes.badSqlGrammarCodes"> ! <value>-204,-206,-301,-408</value> </property> <property name="ErrorCodes.DataAccessResourceFailureCodes"> --- 707,711 ---- <property name="ErrorCodes.badSqlGrammarCodes"> ! <value>-007,-029,-097,-104,-109,-115,-128,-199,-204,-206,-301,-408,-441,-491</value> </property> <property name="ErrorCodes.DataAccessResourceFailureCodes"> *************** *** 713,717 **** </property> <property name="ErrorCodes.DataIntegrityViolationCodes"> ! <value>-803</value> </property> <property name="ErrorCodes.DeadlockLoserCodes"> --- 713,717 ---- </property> <property name="ErrorCodes.DataIntegrityViolationCodes"> ! <value>-407,-530,-531,-532,-543,-544,-545,-603,-667,-803</value> </property> <property name="ErrorCodes.DeadlockLoserCodes"> *************** *** 749,753 **** <property name="ErrorCodes.badSqlGrammarCodes"> ! <value>-204,-206,-301,-408</value> </property> <property name="ErrorCodes.DataAccessResourceFailureCodes"> --- 749,753 ---- <property name="ErrorCodes.badSqlGrammarCodes"> ! <value>-007,-029,-097,-104,-109,-115,-128,-199,-204,-206,-301,-408,-441,-491</value> </property> <property name="ErrorCodes.DataAccessResourceFailureCodes"> *************** *** 755,759 **** </property> <property name="ErrorCodes.DataIntegrityViolationCodes"> ! <value>-803</value> </property> <property name="ErrorCodes.DeadlockLoserCodes"> --- 755,759 ---- </property> <property name="ErrorCodes.DataIntegrityViolationCodes"> ! <value>-407,-530,-531,-532,-543,-544,-545,-603,-667,-803</value> </property> <property name="ErrorCodes.DeadlockLoserCodes"> *************** *** 793,797 **** <property name="ErrorCodes.badSqlGrammarCodes"> ! <value>-204,-206,-301,-408</value> </property> <property name="ErrorCodes.DataAccessResourceFailureCodes"> --- 793,797 ---- <property name="ErrorCodes.badSqlGrammarCodes"> ! <value>-007,-029,-097,-104,-109,-115,-128,-199,-204,-206,-301,-408,-441,-491</value> </property> <property name="ErrorCodes.DataAccessResourceFailureCodes"> *************** *** 799,803 **** </property> <property name="ErrorCodes.DataIntegrityViolationCodes"> ! <value>-803</value> </property> <property name="ErrorCodes.DeadlockLoserCodes"> --- 799,803 ---- </property> <property name="ErrorCodes.DataIntegrityViolationCodes"> ! <value>-407,-530,-531,-532,-543,-544,-545,-603,-667,-803</value> </property> <property name="ErrorCodes.DeadlockLoserCodes"> *************** *** 833,839 **** <!-- error codes taken from http://publib.boulder.ibm.com/infocenter/iseries/v5r3/index.jsp?topic=/rzala/rzalaco.htm and from Spring.Java sql-error-codes.xml --> ! <property name="ErrorCodes.badSqlGrammarCodes"> ! <value>-204,-206,-301,-408</value> </property> <property name="ErrorCodes.DataAccessResourceFailureCodes"> --- 833,839 ---- <!-- error codes taken from http://publib.boulder.ibm.com/infocenter/iseries/v5r3/index.jsp?topic=/rzala/rzalaco.htm and from Spring.Java sql-error-codes.xml --> ! <property name="ErrorCodes.badSqlGrammarCodes"> ! <value>-007,-029,-097,-104,-109,-115,-128,-199,-204,-206,-301,-408,-441,-491</value> </property> <property name="ErrorCodes.DataAccessResourceFailureCodes"> *************** *** 841,845 **** </property> <property name="ErrorCodes.DataIntegrityViolationCodes"> ! <value>-803</value> </property> <property name="ErrorCodes.DeadlockLoserCodes"> --- 841,845 ---- </property> <property name="ErrorCodes.DataIntegrityViolationCodes"> ! <value>-407,-530,-531,-532,-543,-544,-545,-603,-667,-803</value> </property> <property name="ErrorCodes.DeadlockLoserCodes"> *************** *** 880,884 **** <property name="ErrorCodes.badSqlGrammarCodes"> ! <value>-204,-206,-301,-408</value> </property> <property name="ErrorCodes.DataAccessResourceFailureCodes"> --- 880,884 ---- <property name="ErrorCodes.badSqlGrammarCodes"> ! <value>-007,-029,-097,-104,-109,-115,-128,-199,-204,-206,-301,-408,-441,-491</value> </property> <property name="ErrorCodes.DataAccessResourceFailureCodes"> *************** *** 886,890 **** </property> <property name="ErrorCodes.DataIntegrityViolationCodes"> ! <value>-803</value> </property> <property name="ErrorCodes.DeadlockLoserCodes"> --- 886,890 ---- </property> <property name="ErrorCodes.DataIntegrityViolationCodes"> ! <value>-407,-530,-531,-532,-543,-544,-545,-603,-667,-803</value> </property> <property name="ErrorCodes.DeadlockLoserCodes"> |
From: Mark P. <mar...@us...> - 2008-04-02 18:17:38
|
Update of /cvsroot/springnet/Spring.Net/doc/reference/src In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv1090 Modified Files: webservices.xml Log Message: SPRNET-909 - Document that WebServiceExporter does not add WebServiceBinding attribute with WSI basic profile 1.1 by default. Index: webservices.xml =================================================================== RCS file: /cvsroot/springnet/Spring.Net/doc/reference/src/webservices.xml,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** webservices.xml 16 Jan 2008 17:21:44 -0000 1.17 --- webservices.xml 2 Apr 2008 18:17:34 -0000 1.18 *************** *** 259,264 **** but that really does defeat the purpose.</para> ! <para>A second, better way, is to set all the necessary values within ! the definition of the service exporter, like so...</para> <programlisting> --- 259,265 ---- but that really does defeat the purpose.</para> ! <para>To add specific attributes to the exported web service, you can ! set all the necessary values within the definition of the service ! exporter, like so...</para> <programlisting> *************** *** 297,303 **** <emphasis>any</emphasis> class as a web service.</para> <para>One can also export only certain interfaces that a service class implements by setting the <literal>Interfaces</literal> property of the ! <classname>WebServiceExporter</classname>...</para> <warning> --- 298,314 ---- <emphasis>any</emphasis> class as a web service.</para> + <para>The WebServiceExporter also has a + <literal>TypeAttributes</literal> IList property for applying attributes + at the type level.<note> + <para>The attribute to confirms to the WSI basic profile 1.1 is not + added by default. This will be added in a future release. In the + meantime use the TypeAttributes IList property to add + <literal>[WebServiceBinding(ConformsTo=WsiProfiles.BasicProfile1_1)]</literal> + to the generated proxy.</para> + </note></para> + <para>One can also export only certain interfaces that a service class implements by setting the <literal>Interfaces</literal> property of the ! <classname>WebServiceExporter</classname>.</para> <warning> *************** *** 489,520 **** <programlisting> ! <object id="PublicarAltasWebService" type="Spring.Web.Services.WebServiceProxyFactory, Spring.Services"> ! <property name="ProxyType" value="My.WebService" /> ! <property name="ServiceInterface" value="My.IWebServiceInterface" /> ! <emphasis role="bold"><property name="ProductTemplate"> </emphasis> ! <object> <!-- Configure the web service URL --> <property name="Url" value="https://localhost/MyApp/webservice.jws" /> <emphasis role="bold"> <!-- Configure the Username and password for the web service --> </emphasis> <property name="Credentials"> ! <object type="System.Net.NetworkCredential, System"> ! <property name="UserName" value="user"/> ! <property name="Password" value="password"/> ! </object> </property> <emphasis role="bold"><!-- Configure client certificate for the web service --> </emphasis> <property name="ClientCertificates"> ! <list> ! <object id="MyCertificate" type="System.Security.Cryptography.X509Certificates.X509Certificate2, System"> ! <constructor-arg name="fileName" value="Certificate.p12" /> ! <constructor-arg name="password" value="notgoingtotellyou" /> ! </object> ! </list> ! </property> ! </object> </property> ! </object> </programlisting> ! </sect2> </sect1> --- 500,535 ---- <programlisting> ! <object id="PublicarAltasWebService" type="Spring.Web.Services.WebServiceProxyFactory, Spring.Services"> ! <property name="ProxyType" value="My.WebService" /> ! <property name="ServiceInterface" value="My.IWebServiceInterface" /> ! <emphasis role="bold"><property name="ProductTemplate"> </emphasis> ! <object> <!-- Configure the web service URL --> <property name="Url" value="https://localhost/MyApp/webservice.jws" /> <emphasis role="bold"> <!-- Configure the Username and password for the web service --> </emphasis> <property name="Credentials"> ! <object type="System.Net.NetworkCredential, System"> ! <property name="UserName" value="user"/> ! <property name="Password" value="password"/> ! </object> </property> <emphasis role="bold"><!-- Configure client certificate for the web service --> </emphasis> <property name="ClientCertificates"> ! <list> ! <object id="MyCertificate" type="System.Security.Cryptography.X509Certificates.X509Certificate2, System"> ! <constructor-arg name="fileName" value="Certificate.p12" /> ! <constructor-arg name="password" value="notgoingtotellyou" /> ! </object> ! </list> </property> ! </object> ! </property> ! </object> </programlisting> ! ! <para>For an example of how using SOAP headers for authentication using ! the WebServiceExporter and WebServiceProxyFactory, refer to this <ulink ! url="http://opensource.atlassian.com/confluence/spring/download/attachments/708/Spring.Examples.SoapHeader.rar?version=1">solution</ulink> ! on our wiki.</para> </sect2> </sect1> |