diff --git a/yavscModel/ChangeLog b/yavscModel/ChangeLog index 37ec1c2b..68590a83 100644 --- a/yavscModel/ChangeLog +++ b/yavscModel/ChangeLog @@ -1,3 +1,12 @@ +2015-11-23 Paul Schneider + + * Manager.cs: implémente la fonction de construction des + fournisseurs définis par une interface (sans type, ni concret, + ni abstrait, comme ceux du workflow). + + * WorkFlowManager.cs: refactorisation: utiliser le code commun + pour instancier le fournisseur de données. + 2015-11-23 Paul Schneider * ITitle.cs: diff --git a/yavscModel/Manager.cs b/yavscModel/Manager.cs index 90abdeef..dd500b93 100644 --- a/yavscModel/Manager.cs +++ b/yavscModel/Manager.cs @@ -59,5 +59,10 @@ namespace Yavsc.Model { bp.Initialize (celt.Name, celt.Parameters); return bp as TProvider; } + + public static ProviderBase GetDefaultProvider (string configSetion) + { + return GetDefaultProvider(configSetion); + } } } diff --git a/yavscModel/WorkFlow/WorkFlowManager.cs b/yavscModel/WorkFlow/WorkFlowManager.cs index f4df6bae..f51185e5 100644 --- a/yavscModel/WorkFlow/WorkFlowManager.cs +++ b/yavscModel/WorkFlow/WorkFlowManager.cs @@ -5,6 +5,7 @@ using System.Collections.Specialized; using Yavsc.Model.FrontOffice; using System.Configuration.Provider; using Yavsc.Model.FrontOffice.Catalog; +using System.Collections.Generic; namespace Yavsc.Model.WorkFlow { @@ -15,6 +16,26 @@ namespace Yavsc.Model.WorkFlow /// public static class WorkFlowManager { + /// + /// Finds the activity. + /// + /// The activity. + /// Pattern. + public static IEnumerable FindActivity(string pattern = "%") + { + throw new NotImplementedException (); + } + + /// + /// Gets the activity. + /// + /// The activity. + /// MAE code. + public static Activity GetActivity (string MAECode) + { + throw new NotImplementedException (); + } + /// /// Gets or sets the catalog. /// @@ -123,33 +144,11 @@ namespace Yavsc.Model.WorkFlow /// /// The content provider. public static IContentProvider ContentProvider { + get { - DataProviderConfigurationSection c = (DataProviderConfigurationSection) ConfigurationManager.GetSection ("system.web/workflow"); - if (c == null) - throw new Exception ("No system.web/workflow configuration section found"); - ProviderSettings confprov = c.Providers[c.DefaultProvider] as ProviderSettings; - if (confprov == null) - throw new Exception ("Default workflow provider not found (system.web/workflow@defaultProvider)"); - string clsName = confprov.Type; - if (clsName == null) - throw new Exception ("Provider type not specified (system.web/workflow@type)"); - - if (contentProvider != null) - { - if (contentProvider.GetType ().Name != clsName) - contentProvider = null; - } - if (contentProvider == null) - { - Type cpt = Type.GetType (clsName); - if (cpt == null) - throw new Exception (string.Format("Type not found : {0} (wrong name, or missing assembly reference?)",clsName)); - System.Reflection.ConstructorInfo ci =cpt.GetConstructor (System.Type.EmptyTypes); - contentProvider = (IContentProvider)ci.Invoke (System.Type.EmptyTypes); - } - contentProvider.Initialize (confprov.Name, confprov.Parameters); - + contentProvider = ManagerHelper.GetDefaultProvider + ("system.web/workflow") as IContentProvider; return contentProvider; } }