diff --git a/Disco.Client/Properties/AssemblyInfo.cs b/Disco.Client/Properties/AssemblyInfo.cs index fe777b84..557e67c2 100644 --- a/Disco.Client/Properties/AssemblyInfo.cs +++ b/Disco.Client/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ using System.Runtime.InteropServices; // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.2.0411.1608")] -[assembly: AssemblyFileVersion("1.2.0411.1608")] +[assembly: AssemblyVersion("1.2.0429.1616")] +[assembly: AssemblyFileVersion("1.2.0429.1616")] diff --git a/Disco.ClientBootstrapper/Properties/AssemblyInfo.cs b/Disco.ClientBootstrapper/Properties/AssemblyInfo.cs index 25e404e7..dcea1094 100644 --- a/Disco.ClientBootstrapper/Properties/AssemblyInfo.cs +++ b/Disco.ClientBootstrapper/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ using System.Runtime.InteropServices; // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.2.0418.1759")] -[assembly: AssemblyFileVersion("1.2.0418.1759")] +[assembly: AssemblyVersion("1.2.0426.1841")] +[assembly: AssemblyFileVersion("1.2.0426.1841")] diff --git a/Disco.Models/Disco.Models.csproj b/Disco.Models/Disco.Models.csproj index 069ee3cc..a321be92 100644 --- a/Disco.Models/Disco.Models.csproj +++ b/Disco.Models/Disco.Models.csproj @@ -97,22 +97,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + diff --git a/Disco.Models/Properties/AssemblyInfo.cs b/Disco.Models/Properties/AssemblyInfo.cs index 455361ee..6940ba47 100644 --- a/Disco.Models/Properties/AssemblyInfo.cs +++ b/Disco.Models/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ using System.Runtime.InteropServices; // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.2.0411.1908")] -[assembly: AssemblyFileVersion("1.2.0411.1908")] +[assembly: AssemblyVersion("1.2.0430.1219")] +[assembly: AssemblyFileVersion("1.2.0430.1219")] diff --git a/Disco.Services/Plugins/CommunityInterop/PluginLibraryUpdateTask.cs b/Disco.Services/Plugins/CommunityInterop/PluginLibraryUpdateTask.cs index bc096411..e3531cea 100644 --- a/Disco.Services/Plugins/CommunityInterop/PluginLibraryUpdateTask.cs +++ b/Disco.Services/Plugins/CommunityInterop/PluginLibraryUpdateTask.cs @@ -64,7 +64,7 @@ namespace Disco.Services.Plugins.CommunityInterop webRequest = (HttpWebRequest)HttpWebRequest.Create(PluginLibraryUpdateUrl()); webRequest.KeepAlive = false; - webRequest.ContentType = "application/json"; + webRequest.ContentType = "application/xml"; webRequest.Method = WebRequestMethods.Http.Post; webRequest.UserAgent = string.Format("Disco/{0} (PluginLibrary)", DiscoBIVersion); diff --git a/Disco.Services/Plugins/InstallPluginTask.cs b/Disco.Services/Plugins/InstallPluginTask.cs index 74d632a9..c8df3764 100644 --- a/Disco.Services/Plugins/InstallPluginTask.cs +++ b/Disco.Services/Plugins/InstallPluginTask.cs @@ -140,7 +140,8 @@ namespace Disco.Services.Plugins Plugins.AddPlugin(packageManifest); PluginsLog.LogInstalled(packageManifest); - this.Status.Finished("Plugin Installation Completed", string.Format("/Config/Plugins/{0}", System.Web.HttpUtility.UrlEncode(packageManifest.Id))); + this.Status.SetFinishedUrl(string.Format("/Config/Plugins/{0}", System.Web.HttpUtility.UrlEncode(packageManifest.Id))); + this.Status.UpdateStatus(100, "Plugin Installation Completed"); } } } diff --git a/Disco.Services/Plugins/PluginExtensions.cs b/Disco.Services/Plugins/PluginExtensions.cs index d56268e9..32db4811 100644 --- a/Disco.Services/Plugins/PluginExtensions.cs +++ b/Disco.Services/Plugins/PluginExtensions.cs @@ -145,10 +145,14 @@ namespace Disco.Services.Plugins return ViewPage.DiscoPluginConfigureUrl(manifest); } public static HtmlString DiscoPluginConfigureUrl(this WebViewPage ViewPage, PluginManifest manifest) + { + return new HtmlString(ViewPage.ViewContext.RequestContext.DiscoPluginConfigureUrl(manifest)); + } + public static string DiscoPluginConfigureUrl(this RequestContext RequestContext, PluginManifest manifest) { var routeValues = new RouteValueDictionary(new { PluginId = manifest.Id }); - string pluginActionUrl = UrlHelper.GenerateUrl("Config_Plugins_Configure", null, null, routeValues, RouteTable.Routes, ViewPage.ViewContext.RequestContext, false); - return new HtmlString(pluginActionUrl); + string pluginActionUrl = UrlHelper.GenerateUrl("Config_Plugins_Configure", null, null, routeValues, RouteTable.Routes, RequestContext, false); + return pluginActionUrl; } public static MvcForm DiscoPluginActionBeginForm(this WebViewPage ViewPage, string PluginAction, FormMethod method, IDictionary htmlAttributes) { @@ -203,7 +207,42 @@ namespace Disco.Services.Plugins } + public static void DiscoPluginRegisterStylesheet(this WebViewPage ViewPage, string Resource) + { + if (string.IsNullOrEmpty(Resource)) + throw new ArgumentNullException("Resource"); + // Find Plugin + var pageType = ViewPage.GetType(); + var pageAssembly = pageType.Assembly; + var manifest = Plugins.GetPlugin(pageAssembly); + + ViewPage.DiscoPluginRegisterStylesheet(Resource, manifest); + } + public static void DiscoPluginRegisterStylesheet(this WebViewPage ViewPage, string Resource, PluginManifest manifest) + { + ViewPage.ViewContext.RequestContext.DiscoPluginRegisterStylesheet(Resource, manifest); + } + public static void DiscoPluginRegisterStylesheet(this RequestContext RequestContext, string Resource, PluginManifest manifest) + { + var resourcePath = manifest.WebResourcePath(Resource); + + var routeValues = new RouteValueDictionary(new { PluginId = manifest.Id, res = Resource }); + string pluginResourceUrl = UrlHelper.GenerateUrl("Plugin_Resources", null, null, routeValues, RouteTable.Routes, RequestContext, false); + + pluginResourceUrl += string.Format("?v={0}", resourcePath.Item2); + + HtmlString pluginResourceUrlHtml = new HtmlString(pluginResourceUrl); + + var deferredBundles = RequestContext.HttpContext.Items["Bundles.UIExtensionCss"] as List; + if (deferredBundles == null) + { + deferredBundles = new List(); + HttpContext.Current.Items["Bundles.UIExtensionCss"] = deferredBundles; + } + if (!deferredBundles.Contains(pluginResourceUrlHtml)) + deferredBundles.Add(pluginResourceUrlHtml); + } #endregion } diff --git a/Disco.Services/Plugins/PluginManifest.cs b/Disco.Services/Plugins/PluginManifest.cs index 29a7f573..3e6450a4 100644 --- a/Disco.Services/Plugins/PluginManifest.cs +++ b/Disco.Services/Plugins/PluginManifest.cs @@ -125,6 +125,62 @@ namespace Disco.Services.Plugins return manifest; } + + private static Lazy> pluginExcludedAssemblies = new Lazy>(() => + { + return new List() + { + "BitMiracle.LibTiff.NET", + "C5", + "Common.Logging", + "DiffieHellman", + "Disco.BI", + "Disco.Data", + "Disco.Models", + "Disco.Services", + "Disco.Web", + "Disco.Web.Extensions", + "DotNet.Highcharts", + "EntityFramework", + "itextsharp", + "Microsoft.Web.Infrastructure", + "Newtonsoft.Json", + "Org.Mentalis.Security", + "Quartz", + "RazorGenerator.Mvc", + "SignalR", + "SignalR.Hosting.AspNet", + "SignalR.Hosting.Common", + "Spring.Core", + "System.Data.SqlServerCe", + "System.Data.SqlServerCe.Entity", + "System.Net.Http.Formatting", + "System.Reactive.Core", + "System.Reactive.Interfaces", + "System.Reactive.Linq", + "System.Reactive.PlatformServices", + "System.Web.Helpers", + "System.Web.Http", + "System.Web.Http.WebHost", + "System.Web.Mvc", + "System.Web.Razor", + "System.Web.WebPages.Deployment", + "System.Web.WebPages", + "System.Web.WebPages.Razor", + "T4MVCExtensions", + "Tamir.SharpSSH", + "WebActivatorEx", + "zxing" + }; + }); + public static IReadOnlyCollection PluginExcludedAssemblies + { + get + { + return pluginExcludedAssemblies.Value; + } + } + /// /// Uses reflection to build a Plugin Manifest /// @@ -173,16 +229,21 @@ namespace Disco.Services.Plugins select type).FirstOrDefault(); Dictionary pluginAssemblyReferences = new Dictionary(); + foreach (string referenceFilename in Directory.EnumerateFiles(pluginLocation, "*.dll", SearchOption.TopDirectoryOnly)) { if (!referenceFilename.Equals(assembly.Location, StringComparison.InvariantCultureIgnoreCase)) { - try + // Ignore Excluded Assemblies + if (!PluginExcludedAssemblies.Contains(Path.GetFileNameWithoutExtension(referenceFilename))) { - Assembly pluginRefAssembly = Assembly.ReflectionOnlyLoadFrom(referenceFilename); - pluginAssemblyReferences[pluginRefAssembly.FullName] = referenceFilename.Substring(pluginLocation.Length + 1); + try + { + Assembly pluginRefAssembly = Assembly.ReflectionOnlyLoadFrom(referenceFilename); + pluginAssemblyReferences[pluginRefAssembly.FullName] = referenceFilename.Substring(pluginLocation.Length + 1); + } + catch (Exception) { } // Ignore Load Exceptions } - catch (Exception) { } // Ignore Load Exceptions } } diff --git a/Disco.Services/Plugins/PluginWebHandler.cs b/Disco.Services/Plugins/PluginWebHandler.cs index 72f61578..9973e4ca 100644 --- a/Disco.Services/Plugins/PluginWebHandler.cs +++ b/Disco.Services/Plugins/PluginWebHandler.cs @@ -22,7 +22,6 @@ namespace Disco.Services.Plugins // Nothing in Base Class } - #region Action Results #region Compiled View @@ -139,6 +138,11 @@ namespace Disco.Services.Plugins return new RedirectResult(url, true); } + public ActionResult RedirectToPluginConfiguration() + { + var routeValues = new RouteValueDictionary(new { PluginId = this.Manifest.Id }); + return new RedirectToRouteResult("Config_Plugins_Configure", routeValues); + } public ActionResult RedirectToPluginAction(string PluginAction) { if (string.IsNullOrEmpty(PluginAction)) diff --git a/Disco.Services/Properties/AssemblyInfo.cs b/Disco.Services/Properties/AssemblyInfo.cs index 83542eaa..0943b85a 100644 --- a/Disco.Services/Properties/AssemblyInfo.cs +++ b/Disco.Services/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ using System.Runtime.InteropServices; // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.2.0411.1843")] -[assembly: AssemblyFileVersion("1.2.0411.1843")] +[assembly: AssemblyVersion("1.2.0430.1219")] +[assembly: AssemblyFileVersion("1.2.0430.1219")]