Update: Plugin Functionality Extended
Additional plugin extensions and functionality.
This commit is contained in:
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
|
|||||||
// You can specify all the values or you can default the Build and Revision Numbers
|
// You can specify all the values or you can default the Build and Revision Numbers
|
||||||
// by using the '*' as shown below:
|
// by using the '*' as shown below:
|
||||||
// [assembly: AssemblyVersion("1.0.*")]
|
// [assembly: AssemblyVersion("1.0.*")]
|
||||||
[assembly: AssemblyVersion("1.2.0411.1608")]
|
[assembly: AssemblyVersion("1.2.0429.1616")]
|
||||||
[assembly: AssemblyFileVersion("1.2.0411.1608")]
|
[assembly: AssemblyFileVersion("1.2.0429.1616")]
|
||||||
|
|||||||
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
|
|||||||
// You can specify all the values or you can default the Build and Revision Numbers
|
// You can specify all the values or you can default the Build and Revision Numbers
|
||||||
// by using the '*' as shown below:
|
// by using the '*' as shown below:
|
||||||
// [assembly: AssemblyVersion("1.0.*")]
|
// [assembly: AssemblyVersion("1.0.*")]
|
||||||
[assembly: AssemblyVersion("1.2.0418.1759")]
|
[assembly: AssemblyVersion("1.2.0426.1841")]
|
||||||
[assembly: AssemblyFileVersion("1.2.0418.1759")]
|
[assembly: AssemblyFileVersion("1.2.0426.1841")]
|
||||||
|
|||||||
@@ -97,22 +97,50 @@
|
|||||||
<Compile Include="Repository\User\UserAttachment.cs" />
|
<Compile Include="Repository\User\UserAttachment.cs" />
|
||||||
<Compile Include="Repository\User\UserDetail.cs" />
|
<Compile Include="Repository\User\UserDetail.cs" />
|
||||||
<Compile Include="UI\BaseUIModel.cs" />
|
<Compile Include="UI\BaseUIModel.cs" />
|
||||||
|
<Compile Include="UI\Config\DeviceBatch\ConfigDeviceBatchCreateModel.cs" />
|
||||||
|
<Compile Include="UI\Config\DeviceBatch\ConfigDeviceBatchIndexModel.cs" />
|
||||||
|
<Compile Include="UI\Config\DeviceBatch\ConfigDeviceBatchIndexModelItem.cs" />
|
||||||
|
<Compile Include="UI\Config\DeviceBatch\ConfigDeviceBatchShowModel.cs" />
|
||||||
|
<Compile Include="UI\Config\DeviceBatch\ConfigDeviceBatchTimelineModel.cs" />
|
||||||
|
<Compile Include="UI\Config\DeviceModel\ConfigDeviceModelIndexModel.cs" />
|
||||||
|
<Compile Include="UI\Config\DeviceModel\ConfigDeviceModelIndexModelItem.cs" />
|
||||||
|
<Compile Include="UI\Config\DeviceModel\ConfigDeviceModelShowModelComponents.cs" />
|
||||||
|
<Compile Include="UI\Config\DeviceModel\ConfigDeviceModelShowModel.cs" />
|
||||||
|
<Compile Include="UI\Config\DeviceProfile\ConfigDeviceProfileCreateModel.cs" />
|
||||||
|
<Compile Include="UI\Config\DeviceProfile\ConfigDeviceProfileDefaultsModel.cs" />
|
||||||
|
<Compile Include="UI\Config\DeviceProfile\ConfigDeviceProfileIndexModel.cs" />
|
||||||
|
<Compile Include="UI\Config\DeviceProfile\ConfigDeviceProfileIndexModelItem.cs" />
|
||||||
|
<Compile Include="UI\Config\DeviceProfile\ConfigDeviceProfileShowModel.cs" />
|
||||||
|
<Compile Include="UI\Config\DocumentTemplate\ConfigDocumentTemplateCreateModel.cs" />
|
||||||
|
<Compile Include="UI\Config\DocumentTemplate\ConfigDocumentTemplateExpressionBrowserModel.cs" />
|
||||||
|
<Compile Include="UI\Config\DocumentTemplate\ConfigDocumentTemplateImportStatusModel.cs" />
|
||||||
|
<Compile Include="UI\Config\DocumentTemplate\ConfigDocumentTemplateIndexModel.cs" />
|
||||||
|
<Compile Include="UI\Config\DocumentTemplate\ConfigDocumentTemplateShowModel.cs" />
|
||||||
|
<Compile Include="UI\Config\DocumentTemplate\ConfigDocumentTemplateUndetectedPagesModel.cs" />
|
||||||
|
<Compile Include="UI\Config\Enrolment\ConfigEnrolmentIndexModel.cs" />
|
||||||
|
<Compile Include="UI\Config\Enrolment\ConfigEnrolmentStatusModel.cs" />
|
||||||
|
<Compile Include="UI\Config\Logging\ConfigLoggingIndexModel.cs" />
|
||||||
|
<Compile Include="UI\Config\Logging\ConfigLoggingTaskStatusModel.cs" />
|
||||||
|
<Compile Include="UI\Config\Organisation\ConfigOrganisationIndexModel.cs" />
|
||||||
|
<Compile Include="UI\Device\DeviceAddOfflineModel.cs" />
|
||||||
<Compile Include="UI\Device\DeviceIndexModel.cs" />
|
<Compile Include="UI\Device\DeviceIndexModel.cs" />
|
||||||
<Compile Include="UI\Device\DeviceShowModel.cs" />
|
<Compile Include="UI\Device\DeviceShowModel.cs" />
|
||||||
<Compile Include="UI\Job\JobCreateModel.cs" />
|
<Compile Include="UI\Job\JobCreateModel.cs" />
|
||||||
<Compile Include="UI\Job\JobIndexModel.cs" />
|
<Compile Include="UI\Job\JobIndexModel.cs" />
|
||||||
<Compile Include="UI\Job\JobListModel.cs" />
|
<Compile Include="UI\Job\JobListModel.cs" />
|
||||||
<Compile Include="UI\Job\JobShowModel.cs" />
|
<Compile Include="UI\Job\JobShowModel.cs" />
|
||||||
|
<Compile Include="UI\Search\SearchQueryModel.cs" />
|
||||||
<Compile Include="UI\User\UserIndexModel.cs" />
|
<Compile Include="UI\User\UserIndexModel.cs" />
|
||||||
<Compile Include="UI\User\UserShowModel.cs" />
|
<Compile Include="UI\User\UserShowModel.cs" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Include="App.config" />
|
<None Include="App.config" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
<ItemGroup />
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
<ProjectExtensions>
|
<ProjectExtensions>
|
||||||
<VisualStudio>
|
<VisualStudio>
|
||||||
<UserProperties BuildVersion_UpdateFileVersion="True" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_BuildVersioningStyle="None.DeltaBaseYear.MonthAndDayStamp.TimeStamp" BuildVersion_StartDate="2011/7/1" BuildVersion_DetectChanges="False" BuildVersion_UseGlobalSettings="False" BuildVersion_BuildAction="Both" />
|
<UserProperties BuildVersion_BuildAction="Both" BuildVersion_UseGlobalSettings="False" BuildVersion_DetectChanges="False" BuildVersion_StartDate="2011/7/1" BuildVersion_BuildVersioningStyle="None.DeltaBaseYear.MonthAndDayStamp.TimeStamp" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_UpdateFileVersion="True" />
|
||||||
</VisualStudio>
|
</VisualStudio>
|
||||||
</ProjectExtensions>
|
</ProjectExtensions>
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
|
|||||||
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
|
|||||||
// You can specify all the values or you can default the Build and Revision Numbers
|
// You can specify all the values or you can default the Build and Revision Numbers
|
||||||
// by using the '*' as shown below:
|
// by using the '*' as shown below:
|
||||||
// [assembly: AssemblyVersion("1.0.*")]
|
// [assembly: AssemblyVersion("1.0.*")]
|
||||||
[assembly: AssemblyVersion("1.2.0411.1908")]
|
[assembly: AssemblyVersion("1.2.0430.1219")]
|
||||||
[assembly: AssemblyFileVersion("1.2.0411.1908")]
|
[assembly: AssemblyFileVersion("1.2.0430.1219")]
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ namespace Disco.Services.Plugins.CommunityInterop
|
|||||||
webRequest = (HttpWebRequest)HttpWebRequest.Create(PluginLibraryUpdateUrl());
|
webRequest = (HttpWebRequest)HttpWebRequest.Create(PluginLibraryUpdateUrl());
|
||||||
webRequest.KeepAlive = false;
|
webRequest.KeepAlive = false;
|
||||||
|
|
||||||
webRequest.ContentType = "application/json";
|
webRequest.ContentType = "application/xml";
|
||||||
webRequest.Method = WebRequestMethods.Http.Post;
|
webRequest.Method = WebRequestMethods.Http.Post;
|
||||||
webRequest.UserAgent = string.Format("Disco/{0} (PluginLibrary)", DiscoBIVersion);
|
webRequest.UserAgent = string.Format("Disco/{0} (PluginLibrary)", DiscoBIVersion);
|
||||||
|
|
||||||
|
|||||||
@@ -140,7 +140,8 @@ namespace Disco.Services.Plugins
|
|||||||
Plugins.AddPlugin(packageManifest);
|
Plugins.AddPlugin(packageManifest);
|
||||||
|
|
||||||
PluginsLog.LogInstalled(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");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -145,10 +145,14 @@ namespace Disco.Services.Plugins
|
|||||||
return ViewPage.DiscoPluginConfigureUrl(manifest);
|
return ViewPage.DiscoPluginConfigureUrl(manifest);
|
||||||
}
|
}
|
||||||
public static HtmlString DiscoPluginConfigureUrl<T>(this WebViewPage<T> ViewPage, PluginManifest manifest)
|
public static HtmlString DiscoPluginConfigureUrl<T>(this WebViewPage<T> 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 });
|
var routeValues = new RouteValueDictionary(new { PluginId = manifest.Id });
|
||||||
string pluginActionUrl = UrlHelper.GenerateUrl("Config_Plugins_Configure", null, null, routeValues, RouteTable.Routes, ViewPage.ViewContext.RequestContext, false);
|
string pluginActionUrl = UrlHelper.GenerateUrl("Config_Plugins_Configure", null, null, routeValues, RouteTable.Routes, RequestContext, false);
|
||||||
return new HtmlString(pluginActionUrl);
|
return pluginActionUrl;
|
||||||
}
|
}
|
||||||
public static MvcForm DiscoPluginActionBeginForm<T>(this WebViewPage<T> ViewPage, string PluginAction, FormMethod method, IDictionary<string, object> htmlAttributes)
|
public static MvcForm DiscoPluginActionBeginForm<T>(this WebViewPage<T> ViewPage, string PluginAction, FormMethod method, IDictionary<string, object> htmlAttributes)
|
||||||
{
|
{
|
||||||
@@ -203,7 +207,42 @@ namespace Disco.Services.Plugins
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static void DiscoPluginRegisterStylesheet<T>(this WebViewPage<T> 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<T>(this WebViewPage<T> 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<HtmlString>;
|
||||||
|
if (deferredBundles == null)
|
||||||
|
{
|
||||||
|
deferredBundles = new List<HtmlString>();
|
||||||
|
HttpContext.Current.Items["Bundles.UIExtensionCss"] = deferredBundles;
|
||||||
|
}
|
||||||
|
if (!deferredBundles.Contains(pluginResourceUrlHtml))
|
||||||
|
deferredBundles.Add(pluginResourceUrlHtml);
|
||||||
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -125,6 +125,62 @@ namespace Disco.Services.Plugins
|
|||||||
|
|
||||||
return manifest;
|
return manifest;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static Lazy<IReadOnlyCollection<string>> pluginExcludedAssemblies = new Lazy<IReadOnlyCollection<string>>(() =>
|
||||||
|
{
|
||||||
|
return new List<string>()
|
||||||
|
{
|
||||||
|
"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<string> PluginExcludedAssemblies
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return pluginExcludedAssemblies.Value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Uses reflection to build a Plugin Manifest
|
/// Uses reflection to build a Plugin Manifest
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -173,16 +229,21 @@ namespace Disco.Services.Plugins
|
|||||||
select type).FirstOrDefault();
|
select type).FirstOrDefault();
|
||||||
|
|
||||||
Dictionary<string, string> pluginAssemblyReferences = new Dictionary<string, string>();
|
Dictionary<string, string> pluginAssemblyReferences = new Dictionary<string, string>();
|
||||||
|
|
||||||
foreach (string referenceFilename in Directory.EnumerateFiles(pluginLocation, "*.dll", SearchOption.TopDirectoryOnly))
|
foreach (string referenceFilename in Directory.EnumerateFiles(pluginLocation, "*.dll", SearchOption.TopDirectoryOnly))
|
||||||
{
|
{
|
||||||
if (!referenceFilename.Equals(assembly.Location, StringComparison.InvariantCultureIgnoreCase))
|
if (!referenceFilename.Equals(assembly.Location, StringComparison.InvariantCultureIgnoreCase))
|
||||||
{
|
{
|
||||||
try
|
// Ignore Excluded Assemblies
|
||||||
|
if (!PluginExcludedAssemblies.Contains(Path.GetFileNameWithoutExtension(referenceFilename)))
|
||||||
{
|
{
|
||||||
Assembly pluginRefAssembly = Assembly.ReflectionOnlyLoadFrom(referenceFilename);
|
try
|
||||||
pluginAssemblyReferences[pluginRefAssembly.FullName] = referenceFilename.Substring(pluginLocation.Length + 1);
|
{
|
||||||
|
Assembly pluginRefAssembly = Assembly.ReflectionOnlyLoadFrom(referenceFilename);
|
||||||
|
pluginAssemblyReferences[pluginRefAssembly.FullName] = referenceFilename.Substring(pluginLocation.Length + 1);
|
||||||
|
}
|
||||||
|
catch (Exception) { } // Ignore Load Exceptions
|
||||||
}
|
}
|
||||||
catch (Exception) { } // Ignore Load Exceptions
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -22,7 +22,6 @@ namespace Disco.Services.Plugins
|
|||||||
// Nothing in Base Class
|
// Nothing in Base Class
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#region Action Results
|
#region Action Results
|
||||||
|
|
||||||
#region Compiled View
|
#region Compiled View
|
||||||
@@ -139,6 +138,11 @@ namespace Disco.Services.Plugins
|
|||||||
|
|
||||||
return new RedirectResult(url, true);
|
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)
|
public ActionResult RedirectToPluginAction(string PluginAction)
|
||||||
{
|
{
|
||||||
if (string.IsNullOrEmpty(PluginAction))
|
if (string.IsNullOrEmpty(PluginAction))
|
||||||
|
|||||||
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
|
|||||||
// You can specify all the values or you can default the Build and Revision Numbers
|
// You can specify all the values or you can default the Build and Revision Numbers
|
||||||
// by using the '*' as shown below:
|
// by using the '*' as shown below:
|
||||||
// [assembly: AssemblyVersion("1.0.*")]
|
// [assembly: AssemblyVersion("1.0.*")]
|
||||||
[assembly: AssemblyVersion("1.2.0411.1843")]
|
[assembly: AssemblyVersion("1.2.0430.1219")]
|
||||||
[assembly: AssemblyFileVersion("1.2.0411.1843")]
|
[assembly: AssemblyFileVersion("1.2.0430.1219")]
|
||||||
|
|||||||
Reference in New Issue
Block a user