Update: New Plugin Framework
Plugin Framework re-written. Initial commit.
This commit is contained in:
@@ -96,6 +96,7 @@
|
|||||||
<Compile Include="BI\DataStore.cs" />
|
<Compile Include="BI\DataStore.cs" />
|
||||||
<Compile Include="BI\AttachmentBI\Utilities.cs" />
|
<Compile Include="BI\AttachmentBI\Utilities.cs" />
|
||||||
<Compile Include="BI\DeviceBI\BatchUtilities.cs" />
|
<Compile Include="BI\DeviceBI\BatchUtilities.cs" />
|
||||||
|
<Compile Include="BI\DeviceBI\DeviceModelBI.cs" />
|
||||||
<Compile Include="BI\DeviceBI\Searching.cs" />
|
<Compile Include="BI\DeviceBI\Searching.cs" />
|
||||||
<Compile Include="BI\DisposableImageCollection.cs" />
|
<Compile Include="BI\DisposableImageCollection.cs" />
|
||||||
<Compile Include="BI\DocumentTemplateBI\DocumentTemplateQRCodeLocationCache.cs" />
|
<Compile Include="BI\DocumentTemplateBI\DocumentTemplateQRCodeLocationCache.cs" />
|
||||||
@@ -218,7 +219,7 @@
|
|||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
<ProjectExtensions>
|
<ProjectExtensions>
|
||||||
<VisualStudio>
|
<VisualStudio>
|
||||||
<UserProperties BuildVersion_UseGlobalSettings="True" BuildVersion_DetectChanges="False" BuildVersion_BuildAction="ReBuild" BuildVersion_StartDate="2001/1/1" />
|
<UserProperties BuildVersion_StartDate="2001/1/1" BuildVersion_BuildAction="ReBuild" BuildVersion_DetectChanges="False" BuildVersion_UseGlobalSettings="True" />
|
||||||
</VisualStudio>
|
</VisualStudio>
|
||||||
</ProjectExtensions>
|
</ProjectExtensions>
|
||||||
<Import Project="$(SolutionDir)\.nuget\nuget.targets" />
|
<Import Project="$(SolutionDir)\.nuget\nuget.targets" />
|
||||||
|
|||||||
@@ -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.0131.2002")]
|
[assembly: AssemblyVersion("1.2.0207.1727")]
|
||||||
[assembly: AssemblyFileVersion("1.2.0131.2002")]
|
[assembly: AssemblyFileVersion("1.2.0207.1727")]
|
||||||
|
|||||||
Binary file not shown.
@@ -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.0131.2002")]
|
[assembly: AssemblyVersion("1.2.0207.1727")]
|
||||||
[assembly: AssemblyFileVersion("1.2.0131.2002")]
|
[assembly: AssemblyFileVersion("1.2.0207.1727")]
|
||||||
|
|||||||
@@ -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.0131.2002")]
|
[assembly: AssemblyVersion("1.2.0207.1727")]
|
||||||
[assembly: AssemblyFileVersion("1.2.0131.2002")]
|
[assembly: AssemblyFileVersion("1.2.0207.1727")]
|
||||||
|
|||||||
@@ -258,6 +258,13 @@ namespace Disco.Data.Configuration
|
|||||||
return System.IO.Path.Combine(this.DataStoreLocation, @"PluginStorage\");
|
return System.IO.Path.Combine(this.DataStoreLocation, @"PluginStorage\");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
public string PluginPackagesLocation
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return System.IO.Path.Combine(this.DataStoreLocation, @"PluginPackages\");
|
||||||
|
}
|
||||||
|
}
|
||||||
#region Organisation Logo
|
#region Organisation Logo
|
||||||
private string OrganisationLogoPath
|
private string OrganisationLogoPath
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -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.0131.2002")]
|
[assembly: AssemblyVersion("1.2.0207.1727")]
|
||||||
[assembly: AssemblyFileVersion("1.2.0131.2002")]
|
[assembly: AssemblyFileVersion("1.2.0207.1727")]
|
||||||
|
|||||||
@@ -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.0131.2002")]
|
[assembly: AssemblyVersion("1.2.0207.1727")]
|
||||||
[assembly: AssemblyFileVersion("1.2.0131.2002")]
|
[assembly: AssemblyFileVersion("1.2.0207.1727")]
|
||||||
|
|||||||
@@ -89,7 +89,6 @@
|
|||||||
</Reference>
|
</Reference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Include="App_Start\RazorGeneratorMvcStart.cs" />
|
|
||||||
<Compile Include="Logging\LogBase.cs" />
|
<Compile Include="Logging\LogBase.cs" />
|
||||||
<Compile Include="Logging\LogContext.cs" />
|
<Compile Include="Logging\LogContext.cs" />
|
||||||
<Compile Include="Logging\LogReInitalizeJob.cs" />
|
<Compile Include="Logging\LogReInitalizeJob.cs" />
|
||||||
@@ -119,6 +118,7 @@
|
|||||||
<None Include="_Plugins\PluginWebControllerException.cs" />
|
<None Include="_Plugins\PluginWebControllerException.cs" />
|
||||||
<None Include="_Plugins\PluginWebControllerExtensions.cs" />
|
<None Include="_Plugins\PluginWebControllerExtensions.cs" />
|
||||||
<None Include="_Plugins\UnknownPluginException.cs" />
|
<None Include="_Plugins\UnknownPluginException.cs" />
|
||||||
|
<Compile Include="Plugins\InstallPluginTask.cs" />
|
||||||
<Compile Include="Plugins\PluginAttribute.cs" />
|
<Compile Include="Plugins\PluginAttribute.cs" />
|
||||||
<Compile Include="Plugins\PluginExtensions.cs" />
|
<Compile Include="Plugins\PluginExtensions.cs" />
|
||||||
<Compile Include="Plugins\PluginFeatureAttribute.cs" />
|
<Compile Include="Plugins\PluginFeatureAttribute.cs" />
|
||||||
@@ -139,6 +139,7 @@
|
|||||||
<Compile Include="Plugins\PluginsLog.cs" />
|
<Compile Include="Plugins\PluginsLog.cs" />
|
||||||
<Compile Include="Plugins\PluginWebHandler.cs" />
|
<Compile Include="Plugins\PluginWebHandler.cs" />
|
||||||
<Compile Include="Plugins\PluginWebHandlerController.cs" />
|
<Compile Include="Plugins\PluginWebHandlerController.cs" />
|
||||||
|
<Compile Include="Plugins\UninstallPluginTask.cs" />
|
||||||
<Compile Include="Plugins\UnknownPluginException.cs" />
|
<Compile Include="Plugins\UnknownPluginException.cs" />
|
||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
<Compile Include="Tasks\ScheduledTask.cs" />
|
<Compile Include="Tasks\ScheduledTask.cs" />
|
||||||
|
|||||||
@@ -0,0 +1,132 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.IO;
|
||||||
|
using System.IO.Compression;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using Disco.Data.Repository;
|
||||||
|
using Disco.Services.Tasks;
|
||||||
|
using Quartz;
|
||||||
|
|
||||||
|
namespace Disco.Services.Plugins
|
||||||
|
{
|
||||||
|
public class InstallPluginTask : ScheduledTask
|
||||||
|
{
|
||||||
|
public override string TaskName { get { return "Installing Plugin"; } }
|
||||||
|
|
||||||
|
protected override void ExecuteTask()
|
||||||
|
{
|
||||||
|
string packageFilePath = (string)this.ExecutionContext.JobDetail.JobDataMap["PackageFilePath"];
|
||||||
|
bool DeletePackageAfterInstall = (bool)this.ExecutionContext.JobDetail.JobDataMap["DeletePackageAfterInstall"];
|
||||||
|
|
||||||
|
if (!Plugins.PluginsLoaded)
|
||||||
|
throw new InvalidOperationException("Plugins have not been initialized");
|
||||||
|
|
||||||
|
this.Status.UpdateStatus(10, "Opening Plugin Package", Path.GetFileName(packageFilePath));
|
||||||
|
|
||||||
|
using (var packageStream = File.OpenRead(packageFilePath))
|
||||||
|
{
|
||||||
|
using (ZipArchive packageArchive = new ZipArchive(packageStream, ZipArchiveMode.Read, false))
|
||||||
|
{
|
||||||
|
|
||||||
|
ZipArchiveEntry packageManifestEntry = packageArchive.GetEntry("manifest.json");
|
||||||
|
if (packageManifestEntry == null)
|
||||||
|
throw new InvalidDataException("The plugin package does not contain the 'manifest.json' entry");
|
||||||
|
|
||||||
|
PluginManifest packageManifest;
|
||||||
|
|
||||||
|
using (Stream packageManifestStream = packageManifestEntry.Open())
|
||||||
|
{
|
||||||
|
packageManifest = PluginManifest.FromPluginManifestFile(packageManifestStream);
|
||||||
|
}
|
||||||
|
|
||||||
|
this.Status.UpdateStatus(20, string.Format("{0} [{1} v{2}] by {3}", packageManifest.Name, packageManifest.Id, packageManifest.Version.ToString(4), packageManifest.Author), "Initializing Install Environment");
|
||||||
|
|
||||||
|
PluginsLog.LogInstalling(packageManifest);
|
||||||
|
|
||||||
|
lock (Plugins._PluginLock)
|
||||||
|
{
|
||||||
|
if (!Plugins.PluginsLoaded)
|
||||||
|
throw new InvalidOperationException("Plugins have not been initialized");
|
||||||
|
|
||||||
|
// Ensure not already installed
|
||||||
|
if (Plugins.GetPlugins().FirstOrDefault(p => p.Id == packageManifest.Id) != null)
|
||||||
|
throw new InvalidOperationException(string.Format("The '{0} [{1}]' Plugin is already installed, please uninstall any existing versions before trying again", packageManifest.Name, packageManifest.Id));
|
||||||
|
|
||||||
|
using (DiscoDataContext dbContext = new DiscoDataContext())
|
||||||
|
{
|
||||||
|
string packagePath = Path.Combine(dbContext.DiscoConfiguration.PluginsLocation, packageManifest.Id);
|
||||||
|
|
||||||
|
// Force Delete of Existing Folder
|
||||||
|
if (Directory.Exists(packagePath))
|
||||||
|
{
|
||||||
|
this.Status.UpdateStatus(25, "Removing Existing Files");
|
||||||
|
Directory.Delete(packagePath, true);
|
||||||
|
}
|
||||||
|
Directory.CreateDirectory(packagePath);
|
||||||
|
|
||||||
|
|
||||||
|
this.Status.UpdateStatus(30, "Extracting Files");
|
||||||
|
|
||||||
|
double extractFileInterval = (double)50 / packageArchive.Entries.Count;
|
||||||
|
int countExtractedFiles = 0;
|
||||||
|
|
||||||
|
// Extract Package Contents
|
||||||
|
foreach (var packageEntry in packageArchive.Entries)
|
||||||
|
{
|
||||||
|
this.Status.UpdateStatus(30 + (countExtractedFiles++ * extractFileInterval), string.Format("Extracting File: {0}", packageEntry.FullName));
|
||||||
|
|
||||||
|
// Determine Extraction Path
|
||||||
|
var packageEntryTarget = Path.Combine(packagePath, packageEntry.FullName);
|
||||||
|
|
||||||
|
// Create Sub Directories
|
||||||
|
Directory.CreateDirectory(Path.GetDirectoryName(packageEntryTarget));
|
||||||
|
|
||||||
|
using (var packageEntryStream = packageEntry.Open())
|
||||||
|
{
|
||||||
|
using (var packageTargetStream = File.Open(packageEntryTarget, FileMode.Create, FileAccess.Write, FileShare.None))
|
||||||
|
{
|
||||||
|
packageEntryStream.CopyTo(packageTargetStream);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Reload Manifest
|
||||||
|
packageManifest = PluginManifest.FromPluginManifestFile(Path.Combine(packagePath, "manifest.json"));
|
||||||
|
|
||||||
|
// Install Plugin
|
||||||
|
this.Status.UpdateStatus(80, "Initial Package Configuration");
|
||||||
|
packageManifest.InstallPlugin(dbContext, this.Status);
|
||||||
|
|
||||||
|
// Initialize Plugin
|
||||||
|
this.Status.UpdateStatus(98, "Initializing Plugin for Use");
|
||||||
|
packageManifest.InitializePlugin(dbContext);
|
||||||
|
|
||||||
|
// Add Plugin Manifest to Host Environment
|
||||||
|
Plugins.AddPlugin(packageManifest);
|
||||||
|
|
||||||
|
PluginsLog.LogInstalled(packageManifest);
|
||||||
|
this.Status.Finished("Plugin Installation Completed", string.Format("/Config/Plugins/{0}", System.Web.HttpUtility.UrlEncode(packageManifest.Id)));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (DeletePackageAfterInstall)
|
||||||
|
File.Delete(packageFilePath);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static ScheduledTaskStatus InstallPlugin(string PackageFilePath, bool DeletePackageAfterInstall)
|
||||||
|
{
|
||||||
|
if (ScheduledTasks.GetTaskStatuses(typeof(InstallPluginTask)).Where(s => s.IsRunning).Count() > 0)
|
||||||
|
throw new InvalidOperationException("A plugin is already being Installed");
|
||||||
|
|
||||||
|
JobDataMap taskData = new JobDataMap() { { "PackageFilePath", PackageFilePath }, { "DeletePackageAfterInstall", DeletePackageAfterInstall } };
|
||||||
|
|
||||||
|
var instance = new InstallPluginTask();
|
||||||
|
|
||||||
|
return instance.ScheduleTask(taskData);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -4,6 +4,7 @@ using System.Linq;
|
|||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Disco.Data.Repository;
|
using Disco.Data.Repository;
|
||||||
|
using Disco.Services.Tasks;
|
||||||
|
|
||||||
namespace Disco.Services.Plugins
|
namespace Disco.Services.Plugins
|
||||||
{
|
{
|
||||||
@@ -12,10 +13,12 @@ namespace Disco.Services.Plugins
|
|||||||
public PluginManifest Manifest {get; internal set;}
|
public PluginManifest Manifest {get; internal set;}
|
||||||
|
|
||||||
#region Lifecycle
|
#region Lifecycle
|
||||||
public abstract bool Install(DiscoDataContext dbContext);
|
// Events/Triggers for Custom Plugin Initialization (Optional)
|
||||||
public abstract bool Initalize(DiscoDataContext dbContext);
|
public virtual void Install(DiscoDataContext dbContext, ScheduledTaskStatus Status) { return; }
|
||||||
public abstract bool Uninstall(DiscoDataContext dbContext);
|
public virtual void Initialize(DiscoDataContext dbContext) { return; }
|
||||||
public abstract bool BeforeUpdate(DiscoDataContext dbContext, PluginManifest updateManifest);
|
public virtual void Uninstall(DiscoDataContext dbContext, bool UninstallData, ScheduledTaskStatus Status) { return; }
|
||||||
|
public virtual void BeforeUpdate(DiscoDataContext dbContext, PluginManifest UpdateManifest, ScheduledTaskStatus Status) { return; }
|
||||||
|
public virtual void AfterUpdate(DiscoDataContext dbContext, PluginManifest PreviousManifest) { return; }
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
public virtual void Dispose()
|
public virtual void Dispose()
|
||||||
|
|||||||
@@ -11,7 +11,8 @@ namespace Disco.Services.Plugins
|
|||||||
{
|
{
|
||||||
public PluginFeatureManifest Manifest {get; internal set;}
|
public PluginFeatureManifest Manifest {get; internal set;}
|
||||||
|
|
||||||
public abstract bool Initalize(DiscoDataContext dbContext);
|
// Allow Custom Initialization (Optional)
|
||||||
|
public virtual void Initialize(DiscoDataContext dbContext) { return; }
|
||||||
|
|
||||||
public virtual void Dispose()
|
public virtual void Dispose()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ namespace Disco.Services.Plugins
|
|||||||
|
|
||||||
using (var instance = this.CreateInstance())
|
using (var instance = this.CreateInstance())
|
||||||
{
|
{
|
||||||
instance.Initalize(dbContext);
|
instance.Initialize(dbContext);
|
||||||
}
|
}
|
||||||
|
|
||||||
PluginsLog.LogInitializedPluginFeature(this.PluginManifest, this);
|
PluginsLog.LogInitializedPluginFeature(this.PluginManifest, this);
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ using System.Threading.Tasks;
|
|||||||
using System.Web;
|
using System.Web;
|
||||||
using System.Web.Mvc;
|
using System.Web.Mvc;
|
||||||
using Disco.Data.Repository;
|
using Disco.Data.Repository;
|
||||||
|
using Disco.Services.Tasks;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
namespace Disco.Services.Plugins
|
namespace Disco.Services.Plugins
|
||||||
@@ -48,6 +49,9 @@ namespace Disco.Services.Plugins
|
|||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public string StorageLocation { get; private set; }
|
public string StorageLocation { get; private set; }
|
||||||
|
|
||||||
|
[JsonIgnore]
|
||||||
|
private bool environmentInitalized { get; set; }
|
||||||
|
|
||||||
private static Dictionary<string, Tuple<string, DateTime>> WebResourceHashes = new Dictionary<string, Tuple<string, DateTime>>();
|
private static Dictionary<string, Tuple<string, DateTime>> WebResourceHashes = new Dictionary<string, Tuple<string, DateTime>>();
|
||||||
|
|
||||||
public List<PluginFeatureManifest> GetFeatures(Type FeatureCategoryType)
|
public List<PluginFeatureManifest> GetFeatures(Type FeatureCategoryType)
|
||||||
@@ -186,41 +190,102 @@ namespace Disco.Services.Plugins
|
|||||||
{
|
{
|
||||||
return JsonConvert.SerializeObject(this, Formatting.Indented);
|
return JsonConvert.SerializeObject(this, Formatting.Indented);
|
||||||
}
|
}
|
||||||
public bool InitializePlugin(DiscoDataContext dbContext)
|
private bool InitializePluginEnvironment(DiscoDataContext dbContext)
|
||||||
{
|
{
|
||||||
var assemblyFullPath = Path.Combine(this.PluginLocation, this.AssemblyPath);
|
if (!environmentInitalized)
|
||||||
|
{
|
||||||
|
|
||||||
if (!File.Exists(assemblyFullPath))
|
var assemblyFullPath = Path.Combine(this.PluginLocation, this.AssemblyPath);
|
||||||
throw new FileNotFoundException(string.Format("Plugin Assembly [{0}] not found at: {1}", this.Id, assemblyFullPath), assemblyFullPath);
|
|
||||||
|
|
||||||
if (this.PluginAssembly == null)
|
if (!File.Exists(assemblyFullPath))
|
||||||
this.PluginAssembly = Assembly.LoadFile(assemblyFullPath);
|
throw new FileNotFoundException(string.Format("Plugin Assembly [{0}] not found at: {1}", this.Id, assemblyFullPath), assemblyFullPath);
|
||||||
|
|
||||||
if (this.PluginAssembly == null)
|
if (this.PluginAssembly == null)
|
||||||
throw new InvalidOperationException(string.Format("Unable to load Plugin Assembly [{0}] at: {1}", this.Id, assemblyFullPath));
|
this.PluginAssembly = Assembly.LoadFile(assemblyFullPath);
|
||||||
|
|
||||||
PluginsLog.LogInitializingPluginAssembly(this.PluginAssembly);
|
if (this.PluginAssembly == null)
|
||||||
|
throw new InvalidOperationException(string.Format("Unable to load Plugin Assembly [{0}] at: {1}", this.Id, assemblyFullPath));
|
||||||
|
|
||||||
// Check Manifest/Assembly Versions Match
|
PluginsLog.LogInitializingPluginAssembly(this.PluginAssembly);
|
||||||
if (this.Version != this.PluginAssembly.GetName().Version)
|
|
||||||
throw new InvalidOperationException(string.Format("The plugin [{0}] manifest version [{1}] doesn't match the plugin assembly [{2} : {3}]", this.Id, this.Version, assemblyFullPath, this.PluginAssembly.GetName().Version));
|
|
||||||
|
|
||||||
if (this.Type == null)
|
// Check Manifest/Assembly Versions Match
|
||||||
this.Type = this.PluginAssembly.GetType(this.TypeName, true, true);
|
if (this.Version != this.PluginAssembly.GetName().Version)
|
||||||
|
throw new InvalidOperationException(string.Format("The plugin [{0}] manifest version [{1}] doesn't match the plugin assembly [{2} : {3}]", this.Id, this.Version, assemblyFullPath, this.PluginAssembly.GetName().Version));
|
||||||
|
|
||||||
if (this.ConfigurationHandlerType == null)
|
if (this.Type == null)
|
||||||
this.ConfigurationHandlerType = this.PluginAssembly.GetType(this.ConfigurationHandlerTypeName, true, true);
|
this.Type = this.PluginAssembly.GetType(this.TypeName, true, true);
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(this.WebHandlerTypeName) && this.WebHandlerType == null)
|
if (this.ConfigurationHandlerType == null)
|
||||||
this.WebHandlerType = this.PluginAssembly.GetType(this.WebHandlerTypeName, true, true);
|
this.ConfigurationHandlerType = this.PluginAssembly.GetType(this.ConfigurationHandlerTypeName, true, true);
|
||||||
|
|
||||||
// Update non-static values
|
if (!string.IsNullOrEmpty(this.WebHandlerTypeName) && this.WebHandlerType == null)
|
||||||
this.StorageLocation = Path.Combine(dbContext.DiscoConfiguration.PluginStorageLocation, this.Id);
|
this.WebHandlerType = this.PluginAssembly.GetType(this.WebHandlerTypeName, true, true);
|
||||||
|
|
||||||
|
// Update non-static values
|
||||||
|
this.StorageLocation = Path.Combine(dbContext.DiscoConfiguration.PluginStorageLocation, this.Id);
|
||||||
|
|
||||||
|
environmentInitalized = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
internal bool BeforePluginUpdate(DiscoDataContext dbContext, PluginManifest UpdateManifest, ScheduledTaskStatus Status)
|
||||||
|
{
|
||||||
|
// Initialize Plugin
|
||||||
|
InitializePluginEnvironment(dbContext);
|
||||||
|
|
||||||
|
using (var pluginInstance = this.CreateInstance())
|
||||||
|
{
|
||||||
|
pluginInstance.BeforeUpdate(dbContext, UpdateManifest, Status);
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
internal bool AfterPluginUpdate(DiscoDataContext dbContext, PluginManifest PreviousManifest)
|
||||||
|
{
|
||||||
|
// Initialize Plugin
|
||||||
|
InitializePluginEnvironment(dbContext);
|
||||||
|
|
||||||
|
using (var pluginInstance = this.CreateInstance())
|
||||||
|
{
|
||||||
|
pluginInstance.AfterUpdate(dbContext, PreviousManifest);
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
internal bool UninstallPlugin(DiscoDataContext dbContext, bool UninstallData, ScheduledTaskStatus Status)
|
||||||
|
{
|
||||||
|
// Initialize Plugin
|
||||||
|
InitializePluginEnvironment(dbContext);
|
||||||
|
|
||||||
|
using (var pluginInstance = this.CreateInstance())
|
||||||
|
{
|
||||||
|
pluginInstance.Uninstall(dbContext, UninstallData, Status);
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
internal bool InstallPlugin(DiscoDataContext dbContext, ScheduledTaskStatus Status)
|
||||||
|
{
|
||||||
|
// Initialize Plugin
|
||||||
|
InitializePluginEnvironment(dbContext);
|
||||||
|
|
||||||
|
using (var pluginInstance = this.CreateInstance())
|
||||||
|
{
|
||||||
|
pluginInstance.Install(dbContext, Status);
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
internal bool InitializePlugin(DiscoDataContext dbContext)
|
||||||
|
{
|
||||||
|
// Initialize Plugin
|
||||||
|
InitializePluginEnvironment(dbContext);
|
||||||
|
|
||||||
// Initialize Plugin
|
// Initialize Plugin
|
||||||
using (var pluginInstance = this.CreateInstance())
|
using (var pluginInstance = this.CreateInstance())
|
||||||
{
|
{
|
||||||
pluginInstance.Initalize(dbContext);
|
pluginInstance.Initialize(dbContext);
|
||||||
}
|
}
|
||||||
PluginsLog.LogInitializedPlugin(this);
|
PluginsLog.LogInitializedPlugin(this);
|
||||||
|
|
||||||
|
|||||||
@@ -16,9 +16,32 @@ namespace Disco.Services.Plugins
|
|||||||
private static Dictionary<string, PluginManifest> _PluginManifests;
|
private static Dictionary<string, PluginManifest> _PluginManifests;
|
||||||
internal static Dictionary<Type, string> FeatureCategoryDisplayNames;
|
internal static Dictionary<Type, string> FeatureCategoryDisplayNames;
|
||||||
|
|
||||||
private static object _PluginLock = new object();
|
internal static object _PluginLock = new object();
|
||||||
public static string PluginPath { get; private set; }
|
public static string PluginPath { get; private set; }
|
||||||
|
|
||||||
|
public static bool PluginsLoaded
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return (_PluginManifests != null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
internal static void AddPlugin(PluginManifest Manifest)
|
||||||
|
{
|
||||||
|
lock (_PluginLock)
|
||||||
|
{
|
||||||
|
if (_PluginManifests.ContainsKey(Manifest.Id))
|
||||||
|
throw new InvalidOperationException(string.Format("The '{0} [{1}]' Plugin is already installed, please uninstall any existing versions before trying again", Manifest.Name, Manifest.Id));
|
||||||
|
|
||||||
|
// Add Plugin Manifest to Environment
|
||||||
|
_PluginManifests[Manifest.Id] = Manifest;
|
||||||
|
|
||||||
|
// Reinitialize Plugin Host Environment
|
||||||
|
Plugins.ReinitializePluginHostEnvironment();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static PluginManifest GetPlugin(string PluginId, Type ContainsCategoryType)
|
public static PluginManifest GetPlugin(string PluginId, Type ContainsCategoryType)
|
||||||
{
|
{
|
||||||
if (_PluginManifests == null)
|
if (_PluginManifests == null)
|
||||||
@@ -157,58 +180,100 @@ namespace Disco.Services.Plugins
|
|||||||
if (loadedPlugins.ContainsKey(pluginManifest.Id))
|
if (loadedPlugins.ContainsKey(pluginManifest.Id))
|
||||||
throw new InvalidOperationException(string.Format("The plugin [{0}] is already initialized", pluginManifest.Id));
|
throw new InvalidOperationException(string.Format("The plugin [{0}] is already initialized", pluginManifest.Id));
|
||||||
|
|
||||||
pluginManifest.InitializePlugin(dbContext);
|
// Check for Update
|
||||||
|
string updatePackagePath = Path.Combine(pluginDirectoryRoot.FullName, string.Format("{0}.discoPlugin", pluginManifest.Id));
|
||||||
|
if (File.Exists(updatePackagePath))
|
||||||
|
{
|
||||||
|
// Update Plugin
|
||||||
|
pluginManifest = UpdatePlugin(dbContext, pluginManifest, updatePackagePath);
|
||||||
|
}
|
||||||
|
|
||||||
loadedPlugins[pluginManifest.Id] = pluginManifest;
|
if (pluginManifest != null)
|
||||||
|
{
|
||||||
|
pluginManifest.InitializePlugin(dbContext);
|
||||||
|
loadedPlugins[pluginManifest.Id] = pluginManifest;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception ex) { PluginsLog.LogInitializeException(pluginManifestFilename, ex); }
|
catch (Exception ex) { PluginsLog.LogInitializeException(pluginManifestFilename, ex); }
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
string pluginManifestUninstallFilename = Path.Combine(pluginDirectory.FullName, "manifest.uninstall.json");
|
||||||
|
if (File.Exists(pluginManifestUninstallFilename))
|
||||||
|
{
|
||||||
|
PluginManifest uninstallManifest = PluginManifest.FromPluginManifestFile(pluginManifestUninstallFilename);
|
||||||
|
|
||||||
|
// Remove All Files
|
||||||
|
DateTime removeRetryTime = DateTime.Now.AddSeconds(60);
|
||||||
|
while (true)
|
||||||
|
{
|
||||||
|
UnauthorizedAccessException lastAccessException;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
pluginDirectory.Delete(true);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
catch (UnauthorizedAccessException ex) { lastAccessException = ex; }
|
||||||
|
if (removeRetryTime < DateTime.Now)
|
||||||
|
throw lastAccessException;
|
||||||
|
System.Threading.Thread.Sleep(2000);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check for Data Removal
|
||||||
|
bool DataUninstalled = false;
|
||||||
|
string pluginStorageLocation = Path.Combine(dbContext.DiscoConfiguration.PluginStorageLocation, uninstallManifest.Id);
|
||||||
|
|
||||||
|
string pluginManifestUninstallDataFilename = Path.Combine(pluginStorageLocation, "manifest.uninstall.json");
|
||||||
|
if (File.Exists(pluginManifestUninstallDataFilename))
|
||||||
|
{
|
||||||
|
DataUninstalled = true;
|
||||||
|
Directory.Delete(pluginStorageLocation, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
PluginsLog.LogUninstalled(uninstallManifest, DataUninstalled);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_PluginManifests = loadedPlugins;
|
_PluginManifests = loadedPlugins;
|
||||||
|
|
||||||
ReinitializePluginEnvironment();
|
ReinitializePluginHostEnvironment();
|
||||||
|
|
||||||
// Install Plugins - TEMPORARY? Workaround until UI in place? Or Useful for 'built-in' plugins?
|
|
||||||
if (pluginDirectoryRoot.Exists)
|
|
||||||
{
|
|
||||||
foreach (FileInfo pluginPackageFile in pluginDirectoryRoot.EnumerateFiles("*.discoPlugin", SearchOption.TopDirectoryOnly))
|
|
||||||
{
|
|
||||||
// Install Plugin
|
|
||||||
InstallPlugin(dbContext, pluginPackageFile.FullName);
|
|
||||||
// Delete Package File
|
|
||||||
pluginPackageFile.Delete();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void ReinitializePluginEnvironment()
|
private static void ReinitializePluginHostEnvironment()
|
||||||
{
|
{
|
||||||
FeatureCategoryDisplayNames = InitializeFeatureCategoryDetails(_PluginManifests.Values);
|
FeatureCategoryDisplayNames = InitializeFeatureCategoryDetails(_PluginManifests.Values);
|
||||||
_PluginAssemblyManifests = _PluginManifests.Values.ToDictionary(p => p.PluginAssembly, p => p);
|
_PluginAssemblyManifests = _PluginManifests.Values.ToDictionary(p => p.PluginAssembly, p => p);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void InstallPlugin(DiscoDataContext dbContext, String PackageFilePath)
|
public static PluginManifest UpdatePlugin(DiscoDataContext dbContext, PluginManifest ExistingManifest, String UpdatePluginPackageFilePath)
|
||||||
{
|
{
|
||||||
using (var packageStream = File.OpenRead(PackageFilePath))
|
PluginManifest updatedManifest;
|
||||||
|
|
||||||
|
using (var packageStream = File.OpenRead(UpdatePluginPackageFilePath))
|
||||||
{
|
{
|
||||||
InstallPlugin(dbContext, packageStream);
|
updatedManifest = UpdatePlugin(dbContext, ExistingManifest, packageStream);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Remove Update after processing
|
||||||
|
File.Delete(UpdatePluginPackageFilePath);
|
||||||
|
|
||||||
|
return updatedManifest;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void InstallPlugin(DiscoDataContext dbContext, Stream PluginPackage)
|
public static PluginManifest UpdatePlugin(DiscoDataContext dbContext, PluginManifest ExistingManifest, Stream UpdatePluginPackage)
|
||||||
{
|
{
|
||||||
if (_PluginManifests == null)
|
|
||||||
throw new InvalidOperationException("Plugins have not been initialized");
|
|
||||||
|
|
||||||
using (MemoryStream packageStream = new MemoryStream())
|
using (MemoryStream packageStream = new MemoryStream())
|
||||||
{
|
{
|
||||||
PluginPackage.CopyTo(packageStream);
|
if (UpdatePluginPackage.Position != 0)
|
||||||
|
UpdatePluginPackage.Position = 0;
|
||||||
|
|
||||||
|
UpdatePluginPackage.CopyTo(packageStream);
|
||||||
packageStream.Position = 0;
|
packageStream.Position = 0;
|
||||||
|
|
||||||
using (ZipArchive packageArchive = new ZipArchive(packageStream, ZipArchiveMode.Read, false))
|
using (ZipArchive packageArchive = new ZipArchive(packageStream, ZipArchiveMode.Read, false))
|
||||||
@@ -225,54 +290,53 @@ namespace Disco.Services.Plugins
|
|||||||
packageManifest = PluginManifest.FromPluginManifestFile(packageManifestStream);
|
packageManifest = PluginManifest.FromPluginManifestFile(packageManifestStream);
|
||||||
}
|
}
|
||||||
|
|
||||||
lock (_PluginLock)
|
if (ExistingManifest.Version == packageManifest.Version)
|
||||||
{
|
{
|
||||||
if (_PluginManifests == null)
|
// Skip Update if already installed
|
||||||
throw new InvalidOperationException("Plugins have not been initialized");
|
PluginsLog.LogInitializeWarning(string.Format("This plugin [{0}] version [{1}] is already installed, skipping Update", ExistingManifest.Id, ExistingManifest.Version));
|
||||||
|
return ExistingManifest;
|
||||||
// Ensure not already installed
|
}
|
||||||
if (_PluginManifests.ContainsKey(packageManifest.Id))
|
if (ExistingManifest.Version > packageManifest.Version)
|
||||||
throw new InvalidOperationException(string.Format("The '{0} [{1}]' Plugin is already installed, please uninstall any existing versions before trying again", packageManifest.Name, packageManifest.Id));
|
{
|
||||||
|
throw new InvalidDataException("A newer version of this plugin is already installed");
|
||||||
string packagePath = Path.Combine(dbContext.DiscoConfiguration.PluginsLocation, packageManifest.Id);
|
|
||||||
|
|
||||||
// Force Delete of Existing Folder
|
|
||||||
if (Directory.Exists(packagePath))
|
|
||||||
Directory.Delete(packagePath, true);
|
|
||||||
|
|
||||||
Directory.CreateDirectory(packagePath);
|
|
||||||
|
|
||||||
// Extract Package Contents
|
|
||||||
foreach (var packageEntry in packageArchive.Entries)
|
|
||||||
{
|
|
||||||
// Determine Extraction Path
|
|
||||||
var packageEntryTarget = Path.Combine(packagePath, packageEntry.FullName);
|
|
||||||
|
|
||||||
// Create Sub Directories
|
|
||||||
Directory.CreateDirectory(Path.GetDirectoryName(packageEntryTarget));
|
|
||||||
|
|
||||||
using (var packageEntryStream = packageEntry.Open())
|
|
||||||
{
|
|
||||||
using (var packageTargetStream = File.Open(packageEntryTarget, FileMode.Create, FileAccess.Write, FileShare.None))
|
|
||||||
{
|
|
||||||
packageEntryStream.CopyTo(packageTargetStream);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Reload Manifest
|
|
||||||
packageManifest = PluginManifest.FromPluginManifestFile(Path.Combine(packagePath, "manifest.json"));
|
|
||||||
|
|
||||||
// Initialize Plugin
|
|
||||||
packageManifest.InitializePlugin(dbContext);
|
|
||||||
|
|
||||||
// Add Plugin Manifest to Environment
|
|
||||||
_PluginManifests[packageManifest.Id] = packageManifest;
|
|
||||||
|
|
||||||
// Reinitialize Plugin Environment
|
|
||||||
ReinitializePluginEnvironment();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
string packagePath = Path.Combine(dbContext.DiscoConfiguration.PluginsLocation, packageManifest.Id);
|
||||||
|
|
||||||
|
// Force Delete of Existing Folder
|
||||||
|
if (Directory.Exists(packagePath))
|
||||||
|
Directory.Delete(packagePath, true);
|
||||||
|
|
||||||
|
Directory.CreateDirectory(packagePath);
|
||||||
|
|
||||||
|
// Extract Package Contents
|
||||||
|
foreach (var packageEntry in packageArchive.Entries)
|
||||||
|
{
|
||||||
|
// Determine Extraction Path
|
||||||
|
var packageEntryTarget = Path.Combine(packagePath, packageEntry.FullName);
|
||||||
|
|
||||||
|
// Create Sub Directories
|
||||||
|
Directory.CreateDirectory(Path.GetDirectoryName(packageEntryTarget));
|
||||||
|
|
||||||
|
using (var packageEntryStream = packageEntry.Open())
|
||||||
|
{
|
||||||
|
using (var packageTargetStream = File.Open(packageEntryTarget, FileMode.Create, FileAccess.Write, FileShare.None))
|
||||||
|
{
|
||||||
|
packageEntryStream.CopyTo(packageTargetStream);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Reload Manifest
|
||||||
|
packageManifest = PluginManifest.FromPluginManifestFile(Path.Combine(packagePath, "manifest.json"));
|
||||||
|
|
||||||
|
// Trigger AfterPluginUpdate
|
||||||
|
packageManifest.AfterPluginUpdate(dbContext, ExistingManifest);
|
||||||
|
|
||||||
|
PluginsLog.LogAfterUpdate(ExistingManifest, packageManifest);
|
||||||
|
|
||||||
|
// Return Updated Manifest
|
||||||
|
return packageManifest;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,7 +31,14 @@ namespace Disco.Services.Plugins
|
|||||||
PluginReferenceAssemblyLoaded = 50,
|
PluginReferenceAssemblyLoaded = 50,
|
||||||
PluginConfigurationLoaded = 100,
|
PluginConfigurationLoaded = 100,
|
||||||
PluginConfigurationSaved = 104,
|
PluginConfigurationSaved = 104,
|
||||||
PluginWebControllerAccessed = 200
|
PluginWebControllerAccessed = 200,
|
||||||
|
|
||||||
|
Installing = 500,
|
||||||
|
Installed = 550,
|
||||||
|
BeforeUpdate = 600,
|
||||||
|
AfterUpdate = 700,
|
||||||
|
Uninstalling = 800,
|
||||||
|
Uninstalled = 850
|
||||||
}
|
}
|
||||||
|
|
||||||
public static PluginsLog Current
|
public static PluginsLog Current
|
||||||
@@ -87,6 +94,31 @@ namespace Disco.Services.Plugins
|
|||||||
Current.Log((int)EventTypeIds.PluginWebControllerAccessed, PluginId, PluginAction, UserId);
|
Current.Log((int)EventTypeIds.PluginWebControllerAccessed, PluginId, PluginAction, UserId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void LogInstalling(PluginManifest Manifest)
|
||||||
|
{
|
||||||
|
Current.Log((int)EventTypeIds.Installing, Manifest.Id, Manifest.Version.ToString(4), Manifest.Name);
|
||||||
|
}
|
||||||
|
public static void LogInstalled(PluginManifest Manifest)
|
||||||
|
{
|
||||||
|
Current.Log((int)EventTypeIds.Installing, Manifest.Id, Manifest.Version.ToString(4), Manifest.Name, Manifest.PluginLocation);
|
||||||
|
}
|
||||||
|
public static void LogBeforeUpdate(PluginManifest ExistingManifest, PluginManifest UpdateManifest)
|
||||||
|
{
|
||||||
|
Current.Log((int)EventTypeIds.BeforeUpdate, ExistingManifest.Id, ExistingManifest.Name, ExistingManifest.PluginLocation, ExistingManifest.Version.ToString(4), UpdateManifest.Version.ToString(4));
|
||||||
|
}
|
||||||
|
public static void LogAfterUpdate(PluginManifest ExistingManifest, PluginManifest UpdateManifest)
|
||||||
|
{
|
||||||
|
Current.Log((int)EventTypeIds.AfterUpdate, UpdateManifest.Id, UpdateManifest.Name, UpdateManifest.PluginLocation, ExistingManifest.Version.ToString(4), UpdateManifest.Version.ToString(4));
|
||||||
|
}
|
||||||
|
public static void LogUninstalling(PluginManifest Manifest, bool UninstallData)
|
||||||
|
{
|
||||||
|
Current.Log((int)EventTypeIds.Uninstalling, Manifest.Id, Manifest.Name, Manifest.PluginLocation, Manifest.Version.ToString(4), UninstallData);
|
||||||
|
}
|
||||||
|
public static void LogUninstalled(PluginManifest Manifest, bool UninstalledData)
|
||||||
|
{
|
||||||
|
Current.Log((int)EventTypeIds.Uninstalled, Manifest.Id, Manifest.Name, Manifest.PluginLocation, Manifest.Version.ToString(4), UninstalledData);
|
||||||
|
}
|
||||||
|
|
||||||
public static void LogInitializeException(string PluginFilename, Exception ex)
|
public static void LogInitializeException(string PluginFilename, Exception ex)
|
||||||
{
|
{
|
||||||
if (ex.InnerException != null)
|
if (ex.InnerException != null)
|
||||||
@@ -268,6 +300,72 @@ namespace Disco.Services.Plugins
|
|||||||
UseLive = true,
|
UseLive = true,
|
||||||
UsePersist = true,
|
UsePersist = true,
|
||||||
UseDisplay = true
|
UseDisplay = true
|
||||||
|
},
|
||||||
|
new LogEventType
|
||||||
|
{
|
||||||
|
Id = (int)EventTypeIds.Installing,
|
||||||
|
ModuleId = _ModuleId,
|
||||||
|
Name = "Installing Plugin",
|
||||||
|
Format = "Installing Plugin: {2} [{0} v{1}]",
|
||||||
|
Severity = (int)LogEventType.Severities.Information,
|
||||||
|
UseLive = true,
|
||||||
|
UsePersist = true,
|
||||||
|
UseDisplay = true
|
||||||
|
},
|
||||||
|
new LogEventType
|
||||||
|
{
|
||||||
|
Id = (int)EventTypeIds.Installed,
|
||||||
|
ModuleId = _ModuleId,
|
||||||
|
Name = "Plugin Installed",
|
||||||
|
Format = "Plugin Installed: {2} [{0} v{1}], Location: {3}",
|
||||||
|
Severity = (int)LogEventType.Severities.Information,
|
||||||
|
UseLive = true,
|
||||||
|
UsePersist = true,
|
||||||
|
UseDisplay = true
|
||||||
|
},
|
||||||
|
new LogEventType
|
||||||
|
{
|
||||||
|
Id = (int)EventTypeIds.BeforeUpdate,
|
||||||
|
ModuleId = _ModuleId,
|
||||||
|
Name = "Updating Plugin",
|
||||||
|
Format = "Updating Plugin: {1} [{0}], v{3} -> v{4}, Location: {2}",
|
||||||
|
Severity = (int)LogEventType.Severities.Information,
|
||||||
|
UseLive = true,
|
||||||
|
UsePersist = true,
|
||||||
|
UseDisplay = true
|
||||||
|
},
|
||||||
|
new LogEventType
|
||||||
|
{
|
||||||
|
Id = (int)EventTypeIds.AfterUpdate,
|
||||||
|
ModuleId = _ModuleId,
|
||||||
|
Name = "Plugin Updated",
|
||||||
|
Format = "Plugin Updated: {1} [{0}], v{3} -> v{4}, Location: {2}",
|
||||||
|
Severity = (int)LogEventType.Severities.Information,
|
||||||
|
UseLive = false,
|
||||||
|
UsePersist = true,
|
||||||
|
UseDisplay = true
|
||||||
|
},
|
||||||
|
new LogEventType
|
||||||
|
{
|
||||||
|
Id = (int)EventTypeIds.Uninstalling,
|
||||||
|
ModuleId = _ModuleId,
|
||||||
|
Name = "Uninstalling Plugin",
|
||||||
|
Format = "Uninstalling Plugin: {1} [{0} v{3}], Location: {2}, UninstallData: {4}",
|
||||||
|
Severity = (int)LogEventType.Severities.Information,
|
||||||
|
UseLive = true,
|
||||||
|
UsePersist = true,
|
||||||
|
UseDisplay = true
|
||||||
|
},
|
||||||
|
new LogEventType
|
||||||
|
{
|
||||||
|
Id = (int)EventTypeIds.Uninstalled,
|
||||||
|
ModuleId = _ModuleId,
|
||||||
|
Name = "Plugin Uninstalled",
|
||||||
|
Format = "Plugin Uninstalled: {1} [{0} v{3}], Location: {2}, UninstallData: {4}",
|
||||||
|
Severity = (int)LogEventType.Severities.Information,
|
||||||
|
UseLive = false,
|
||||||
|
UsePersist = true,
|
||||||
|
UseDisplay = true
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,84 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Web;
|
||||||
|
using Disco.Services.Tasks;
|
||||||
|
using Quartz;
|
||||||
|
|
||||||
|
namespace Disco.Services.Plugins
|
||||||
|
{
|
||||||
|
public class UninstallPluginTask : ScheduledTask
|
||||||
|
{
|
||||||
|
public override string TaskName { get { return "Uninstalling Plugin"; } }
|
||||||
|
|
||||||
|
protected override void ExecuteTask()
|
||||||
|
{
|
||||||
|
PluginManifest manifest = (PluginManifest)this.ExecutionContext.JobDetail.JobDataMap["PluginManifest"];
|
||||||
|
bool UninstallData = (bool)this.ExecutionContext.JobDetail.JobDataMap["UninstallData"];
|
||||||
|
|
||||||
|
this.Status.UpdateStatus(25, string.Format("Uninstalling Plugin: {0} [{1}]", manifest.Name, manifest.Id), "Queuing plugin for uninstall");
|
||||||
|
|
||||||
|
PluginsLog.LogUninstalling(manifest, UninstallData);
|
||||||
|
|
||||||
|
string manifestFileLocation = Path.Combine(manifest.PluginLocation, "manifest.json");
|
||||||
|
if (!File.Exists(manifestFileLocation))
|
||||||
|
throw new FileNotFoundException("Plugin Manifest File Not Found", manifestFileLocation);
|
||||||
|
|
||||||
|
string manifestUninstallFileLocation = Path.Combine(manifest.PluginLocation, "manifest.uninstall.json");
|
||||||
|
|
||||||
|
if (File.Exists(manifestUninstallFileLocation))
|
||||||
|
File.Delete(manifestUninstallFileLocation);
|
||||||
|
|
||||||
|
File.Move(manifestFileLocation, manifestUninstallFileLocation);
|
||||||
|
|
||||||
|
if (UninstallData && Directory.Exists(manifest.StorageLocation))
|
||||||
|
{
|
||||||
|
var manifestDataUninstallFileLocation = Path.Combine(manifest.StorageLocation, "manifest.uninstall.json");
|
||||||
|
if (File.Exists(manifestDataUninstallFileLocation))
|
||||||
|
File.Delete(manifestDataUninstallFileLocation);
|
||||||
|
|
||||||
|
File.Copy(manifestUninstallFileLocation, manifestDataUninstallFileLocation);
|
||||||
|
}
|
||||||
|
|
||||||
|
this.Status.Finished("Restarting Disco, please wait...", "/Config/Plugins");
|
||||||
|
RestartApp(1500);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static ScheduledTaskStatus UninstallPlugin(PluginManifest Manifest, bool UninstallData)
|
||||||
|
{
|
||||||
|
if (ScheduledTasks.GetTaskStatuses(typeof(InstallPluginTask)).Where(s => s.IsRunning).Count() > 0)
|
||||||
|
throw new InvalidOperationException("A plugin is already being Uninstalled");
|
||||||
|
|
||||||
|
JobDataMap taskData = new JobDataMap() { { "PluginManifest", Manifest }, { "UninstallData", UninstallData } };
|
||||||
|
|
||||||
|
var instance = new UninstallPluginTask();
|
||||||
|
|
||||||
|
return instance.ScheduleTask(taskData);
|
||||||
|
}
|
||||||
|
|
||||||
|
#region Restart App
|
||||||
|
private static object _restartTimerLock = new object();
|
||||||
|
private static Timer _restartTimer;
|
||||||
|
private void RestartApp(int DelayMilliseconds)
|
||||||
|
{
|
||||||
|
lock (_restartTimerLock)
|
||||||
|
{
|
||||||
|
if (_restartTimer != null)
|
||||||
|
{
|
||||||
|
_restartTimer.Dispose();
|
||||||
|
}
|
||||||
|
|
||||||
|
_restartTimer = new Timer((state) =>
|
||||||
|
{
|
||||||
|
HttpRuntime.UnloadAppDomain();
|
||||||
|
//AppDomain.Unload(AppDomain.CurrentDomain);
|
||||||
|
}, null, DelayMilliseconds, Timeout.Infinite);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -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.0131.2002")]
|
[assembly: AssemblyVersion("1.2.0207.1727")]
|
||||||
[assembly: AssemblyFileVersion("1.2.0131.2002")]
|
[assembly: AssemblyFileVersion("1.2.0207.1727")]
|
||||||
|
|||||||
@@ -9,13 +9,13 @@ namespace Disco.Services.Tasks
|
|||||||
{
|
{
|
||||||
public abstract class ScheduledTask : IJob
|
public abstract class ScheduledTask : IJob
|
||||||
{
|
{
|
||||||
public abstract void InitalizeScheduledTask(DiscoDataContext dbContext);
|
public virtual void InitalizeScheduledTask(DiscoDataContext dbContext) { return; }
|
||||||
|
|
||||||
internal protected ScheduledTaskStatus Status { get; private set; }
|
internal protected ScheduledTaskStatus Status { get; private set; }
|
||||||
internal protected IJobExecutionContext ExecutionContext { get; private set; }
|
internal protected IJobExecutionContext ExecutionContext { get; private set; }
|
||||||
|
|
||||||
public abstract bool CancelInitiallySupported { get; }
|
public virtual bool CancelInitiallySupported { get { return true; } }
|
||||||
public abstract bool SingleInstanceTask { get; }
|
public virtual bool SingleInstanceTask { get { return true; } }
|
||||||
public virtual bool IsSilent { get { return false; } }
|
public virtual bool IsSilent { get { return false; } }
|
||||||
public virtual bool LogExceptionsOnly { get { return false; } }
|
public virtual bool LogExceptionsOnly { get { return false; } }
|
||||||
public abstract string TaskName { get; }
|
public abstract string TaskName { get; }
|
||||||
|
|||||||
+24
@@ -32,5 +32,29 @@ namespace Disco.Web.Extensions
|
|||||||
|
|
||||||
return selectItems;
|
return selectItems;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static List<SelectListItem> ToSelectListItems(this IEnumerable<PluginManifest> PluginFeatureDefinitions, PluginManifest SelectedItem)
|
||||||
|
{
|
||||||
|
string selectedId = default(string);
|
||||||
|
|
||||||
|
if (SelectedItem != null)
|
||||||
|
selectedId = SelectedItem.Id;
|
||||||
|
|
||||||
|
return PluginFeatureDefinitions.ToSelectListItems(selectedId);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static List<SelectListItem> ToSelectListItems(this IEnumerable<PluginManifest> PluginDefinitions, string SelectedId = null, bool IncludeInstructionFirst = false, string InstructionMessage = "Select a Plugin")
|
||||||
|
{
|
||||||
|
var selectItems = default(List<SelectListItem>);
|
||||||
|
if (SelectedId == null)
|
||||||
|
selectItems = PluginDefinitions.Select(wpd => new SelectListItem { Value = wpd.Id, Text = wpd.Name }).ToList();
|
||||||
|
else
|
||||||
|
selectItems = PluginDefinitions.Select(wpd => new SelectListItem { Value = wpd.Id, Text = wpd.Name, Selected = (SelectedId.Equals(wpd.Id)) }).ToList();
|
||||||
|
|
||||||
|
if (IncludeInstructionFirst)
|
||||||
|
selectItems.Insert(0, new SelectListItem() { Value = String.Empty, Text = String.Format("<{0}>", InstructionMessage), Selected = String.IsNullOrEmpty(SelectedId) });
|
||||||
|
|
||||||
|
return selectItems;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -91,7 +91,7 @@
|
|||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Include="BIModelExtensions\OrganisationAddressExtensions.cs" />
|
<Compile Include="BIModelExtensions\OrganisationAddressExtensions.cs" />
|
||||||
<Compile Include="BIModelExtensions\UtilityExtensions.cs" />
|
<Compile Include="BIModelExtensions\UtilityExtensions.cs" />
|
||||||
<Compile Include="BIModelExtensions\DiscoPluginDefinitionExtensions.cs" />
|
<Compile Include="BIModelExtensions\PluginExtensions.cs" />
|
||||||
<Compile Include="DataModelExtension\DeviceBatchExtensions.cs" />
|
<Compile Include="DataModelExtension\DeviceBatchExtensions.cs" />
|
||||||
<Compile Include="DataModelExtension\DeviceModelExtensions.cs" />
|
<Compile Include="DataModelExtension\DeviceModelExtensions.cs" />
|
||||||
<Compile Include="DataModelExtension\DeviceProfileExtensions.cs" />
|
<Compile Include="DataModelExtension\DeviceProfileExtensions.cs" />
|
||||||
@@ -136,7 +136,7 @@
|
|||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
<ProjectExtensions>
|
<ProjectExtensions>
|
||||||
<VisualStudio>
|
<VisualStudio>
|
||||||
<UserProperties BuildVersion_BuildAction="ReBuild" BuildVersion_DetectChanges="False" BuildVersion_UseGlobalSettings="True" BuildVersion_StartDate="2001/1/1" />
|
<UserProperties BuildVersion_StartDate="2001/1/1" BuildVersion_UseGlobalSettings="True" BuildVersion_DetectChanges="False" BuildVersion_BuildAction="ReBuild" />
|
||||||
</VisualStudio>
|
</VisualStudio>
|
||||||
</ProjectExtensions>
|
</ProjectExtensions>
|
||||||
<Import Project="$(SolutionDir)\.nuget\nuget.targets" />
|
<Import Project="$(SolutionDir)\.nuget\nuget.targets" />
|
||||||
|
|||||||
@@ -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.0131.2002")]
|
[assembly: AssemblyVersion("1.2.0207.1727")]
|
||||||
[assembly: AssemblyFileVersion("1.2.0131.2002")]
|
[assembly: AssemblyFileVersion("1.2.0207.1727")]
|
||||||
|
|||||||
@@ -0,0 +1,47 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Web;
|
||||||
|
using System.Web.Mvc;
|
||||||
|
using Disco.Services.Plugins;
|
||||||
|
|
||||||
|
namespace Disco.Web.Areas.API.Controllers
|
||||||
|
{
|
||||||
|
public partial class PluginController : dbAdminController
|
||||||
|
{
|
||||||
|
|
||||||
|
public virtual ActionResult Uninstall(string id, bool UninstallData)
|
||||||
|
{
|
||||||
|
if (string.IsNullOrEmpty(id))
|
||||||
|
throw new ArgumentNullException("id");
|
||||||
|
|
||||||
|
PluginManifest manifest = Plugins.GetPlugin(id);
|
||||||
|
|
||||||
|
var status = UninstallPluginTask.UninstallPlugin(manifest, UninstallData);
|
||||||
|
|
||||||
|
return RedirectToAction(MVC.Config.Logging.TaskStatus(status.SessionId));
|
||||||
|
}
|
||||||
|
|
||||||
|
public virtual ActionResult Install(HttpPostedFileBase Plugin)
|
||||||
|
{
|
||||||
|
if (Plugin == null || Plugin.ContentLength <= 0 || string.IsNullOrWhiteSpace(Plugin.FileName))
|
||||||
|
throw new ArgumentException("A discoPlugin file must be uploaded", "Plugin");
|
||||||
|
|
||||||
|
var tempPluginLocation = Path.Combine(dbContext.DiscoConfiguration.PluginPackagesLocation, Path.GetFileName(Plugin.FileName));
|
||||||
|
|
||||||
|
if (!Directory.Exists(dbContext.DiscoConfiguration.PluginPackagesLocation))
|
||||||
|
Directory.CreateDirectory(dbContext.DiscoConfiguration.PluginPackagesLocation);
|
||||||
|
|
||||||
|
if (System.IO.File.Exists(tempPluginLocation))
|
||||||
|
System.IO.File.Delete(tempPluginLocation);
|
||||||
|
|
||||||
|
|
||||||
|
Plugin.SaveAs(tempPluginLocation);
|
||||||
|
|
||||||
|
var status = InstallPluginTask.InstallPlugin(tempPluginLocation, true);
|
||||||
|
|
||||||
|
return RedirectToAction(MVC.Config.Logging.TaskStatus(status.SessionId));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -65,35 +65,5 @@ namespace Disco.Web.Areas.Config.Controllers
|
|||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
//public virtual ActionResult PluginAction(string PluginId, string PluginAction)
|
|
||||||
//{
|
|
||||||
// if (string.IsNullOrEmpty(PluginId))
|
|
||||||
// return HttpNotFound("PluginId is Required");
|
|
||||||
// if (string.IsNullOrEmpty(PluginAction))
|
|
||||||
// return HttpNotFound("PluginAction is Required");
|
|
||||||
|
|
||||||
// PluginManifest def = Plugins.GetPlugin(PluginId);
|
|
||||||
|
|
||||||
// using (Plugin instance = def.CreateInstance())
|
|
||||||
// {
|
|
||||||
// IPluginWebController instanceController = instance as IPluginWebController;
|
|
||||||
|
|
||||||
// if (instanceController == null)
|
|
||||||
// return HttpNotFound("Plugin is not a Web Controller");
|
|
||||||
|
|
||||||
// PluginsLog.LogPluginWebControllerAccessed(instance.Id, PluginAction, DiscoApplication.CurrentUser.Id);
|
|
||||||
|
|
||||||
// try
|
|
||||||
// {
|
|
||||||
// return instanceController.ExecuteAction(PluginAction, this);
|
|
||||||
// }
|
|
||||||
// catch (Exception ex)
|
|
||||||
// {
|
|
||||||
// PluginsLog.LogPluginException("Disco Plugin Web Controller Action", new PluginWebControllerException(instance.Id, PluginAction, ex));
|
|
||||||
// return null;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,8 +6,8 @@
|
|||||||
@{
|
@{
|
||||||
if (Model.PluginManifests.Count == 0)
|
if (Model.PluginManifests.Count == 0)
|
||||||
{
|
{
|
||||||
<div class="form" style="width: 450px">
|
<div class="form" style="width: 450px; padding: 100px 0;">
|
||||||
<span class="smallMessage">No Plugins Installed</span>
|
<h2>No Plugins are Installed</h2>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -45,32 +45,157 @@
|
|||||||
}
|
}
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
<div id="dialogUninstallPlugins" title="Uninstall Plugin">
|
||||||
|
<div>
|
||||||
|
@Html.DropDownList("uninstallPlugin", Model.PluginManifests.ToSelectListItems(null, true, "Select a Plugin to Uninstall"))
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<input id="uninstallPluginData" type="checkbox" /><label for="uninstallPluginData"> Uninstall Plugin Data</label>
|
||||||
|
<div id="uninstallPluginDataAlert" style="display: none; padding: 0.7em 0.7em; margin-top: 8px;" class="ui-state-error ui-corner-all">
|
||||||
|
<span style="margin-right: 0.3em; float: left;" class="ui-icon ui-icon-alert"></span>NOTE: Data will be permanently deleted
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div id="dialogUninstallPluginConfirm" title="Confirm Plugin Uninstall">
|
||||||
|
<div style="padding: 0.7em 0.7em; margin-top: 8px;" class="ui-state-highlight ui-corner-all">
|
||||||
|
<span style="margin-right: 0.3em; float: left;" class="ui-icon ui-icon-help"></span>Are you sure you want to uninstall this plugin?
|
||||||
|
<h4 id="uninstallPluginConfirm"></h4>
|
||||||
|
</div>
|
||||||
|
<div id="uninstallPluginDataConfirm" style="display: none; padding: 0.7em 0.7em; margin-top: 8px;" class="ui-state-error ui-corner-all">
|
||||||
|
<span style="margin-right: 0.3em; float: left;" class="ui-icon ui-icon-alert"></span>NOTE: Data will be permanently deleted
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<script>
|
||||||
|
$(function () {
|
||||||
|
// Uninstall
|
||||||
|
var uninstallUrl = '@(Url.Action(MVC.API.Plugin.Uninstall()))/';
|
||||||
|
var uninstallPlugin, uninstallPluginData, $dialogConfirm, uninstallPluginConfirm, uninstallPluginDataConfirm;
|
||||||
|
|
||||||
@*
|
var pluginId, pluginName, pluginUninstallData;
|
||||||
foreach (var pluginGroup in pluginGroups)
|
|
||||||
{
|
var $dialog = $('#dialogUninstallPlugins').dialog({
|
||||||
<div class="form" style="width: 450px">
|
resizable: false,
|
||||||
<h2>@DiscoPlugins.PluginCategoryDisplayName(pluginGroup.Key)</h2>
|
modal: true,
|
||||||
<table>
|
width: 350,
|
||||||
@foreach (var pluginDefinition in pluginGroup)
|
autoOpen: false,
|
||||||
{
|
buttons: {
|
||||||
<tr>
|
"Uninstall": function () {
|
||||||
<td>
|
pluginId = uninstallPlugin.val();
|
||||||
@if (pluginDefinition.HasConfiguration)
|
pluginName = uninstallPlugin.find('option:selected').text();
|
||||||
{
|
pluginUninstallData = uninstallPluginData.is(':checked');
|
||||||
@Html.ActionLink(pluginDefinition.Name, MVC.Config.Plugins.Configure(pluginDefinition.Id))<br />
|
|
||||||
<span class="smallMessage">@pluginDefinition.Id | v@(pluginDefinition.Version.ToString(3))</span>
|
if (!pluginId) {
|
||||||
|
alert('Select a plugin to uninstall');
|
||||||
|
} else {
|
||||||
|
uninstallPluginConfirm.text(pluginName + ' [' + pluginId + ']');
|
||||||
|
if (pluginUninstallData)
|
||||||
|
uninstallPluginDataConfirm.show();
|
||||||
|
else
|
||||||
|
uninstallPluginDataConfirm.hide();
|
||||||
|
|
||||||
|
$dialogConfirm.dialog('open');
|
||||||
|
$(this).dialog("close");
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
Cancel: function () {
|
||||||
|
uninstallPluginData.removeAttr('checked');
|
||||||
|
$('#uninstallPluginDataAlert').hide();
|
||||||
|
$(this).dialog("close");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
$dialogConfirm = $('#dialogUninstallPluginConfirm').dialog({
|
||||||
|
resizable: false,
|
||||||
|
modal: true,
|
||||||
|
width: 350,
|
||||||
|
autoOpen: false,
|
||||||
|
buttons: {
|
||||||
|
"Confirm Uninstall": function () {
|
||||||
|
var url = uninstallUrl + pluginId;
|
||||||
|
if (pluginUninstallData)
|
||||||
|
url += '?UninstallData=true'
|
||||||
else
|
else
|
||||||
{
|
url += '?UninstallData=false'
|
||||||
@pluginDefinition.Name <br />
|
|
||||||
<span class="smallMessage">@pluginDefinition.Id | v@(pluginDefinition.Version.ToString(2))
|
window.location.href = url;
|
||||||
| Not Configurable</span>
|
$(this).dialog("disable");
|
||||||
}
|
},
|
||||||
</td>
|
Cancel: function () {
|
||||||
</tr>
|
uninstallPluginData.removeAttr('checked');
|
||||||
}
|
$('#uninstallPluginDataAlert').hide();
|
||||||
</table>
|
$(this).dialog("close");
|
||||||
</div> *@
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
uninstallPlugin = $('#uninstallPlugin');
|
||||||
|
uninstallPluginData = $('#uninstallPluginData');
|
||||||
|
uninstallPluginConfirm = $('#uninstallPluginConfirm');
|
||||||
|
uninstallPluginDataConfirm = $('#uninstallPluginDataConfirm');
|
||||||
|
|
||||||
|
$('#buttonUninstall').click(function () {
|
||||||
|
$dialog.dialog('open');
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
|
||||||
|
$('#uninstallPluginData').change(function () {
|
||||||
|
if ($(this).is(':checked')) {
|
||||||
|
$('#uninstallPluginDataAlert').slideDown();
|
||||||
|
} else {
|
||||||
|
$('#uninstallPluginDataAlert').slideUp();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
<div id="dialogInstallPlugin" title="Install Plugin">
|
||||||
|
<div style="padding-bottom: 10px;">
|
||||||
|
@using (Html.BeginForm(MVC.API.Plugin.Install(), FormMethod.Post, new { enctype = "multipart/form-data" }))
|
||||||
|
{
|
||||||
|
<label for="pluginFile">Plugin Package: </label>
|
||||||
|
<input id="pluginFile" name="Plugin" type="file" />
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
<div style="padding: 0.7em 0.7em; margin-top: 8px;" class="ui-state-error ui-corner-all">
|
||||||
|
<span style="margin-right: 0.3em; margin-bottom: 2em; float: left;" class="ui-icon ui-icon-alert"></span>Warning: All plugins run with the same level of network privileges as the Disco Web App.<br />
|
||||||
|
<strong>Only install plugins from a trusted source.</strong>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<script>
|
||||||
|
$(function () {
|
||||||
|
// Install
|
||||||
|
var $dialogInstall = $('#dialogInstallPlugin').dialog({
|
||||||
|
resizable: false,
|
||||||
|
modal: true,
|
||||||
|
width: 350,
|
||||||
|
autoOpen: false,
|
||||||
|
buttons: {
|
||||||
|
"Upload & Install": function () {
|
||||||
|
var pluginFile = $('#pluginFile');
|
||||||
|
if (pluginFile.val()) {
|
||||||
|
pluginFile.closest('form').submit();
|
||||||
|
$(this).dialog('disable');
|
||||||
|
} else {
|
||||||
|
alert('Choose a Plugin Package to Install');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
Cancel: function () {
|
||||||
|
$(this).dialog("close");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
$('#buttonInstall').click(function () {
|
||||||
|
$dialogInstall.dialog('open');
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<div class="actionBar">
|
||||||
|
@if (Model.PluginManifests.Count > 0)
|
||||||
|
{
|
||||||
|
@Html.ActionLinkButton("Uninstall Plugins", MVC.Config.Plugins.Index(), "buttonUninstall")
|
||||||
|
}
|
||||||
|
@Html.ActionLinkButton("Install Plugins", MVC.Config.Plugins.Index(), "buttonInstall")
|
||||||
|
</div>
|
||||||
|
|||||||
@@ -69,13 +69,9 @@ WriteLiteral(" <div");
|
|||||||
|
|
||||||
WriteLiteral(" class=\"form\"");
|
WriteLiteral(" class=\"form\"");
|
||||||
|
|
||||||
WriteLiteral(" style=\"width: 450px\"");
|
WriteLiteral(" style=\"width: 450px; padding: 100px 0;\"");
|
||||||
|
|
||||||
WriteLiteral(">\r\n <span");
|
WriteLiteral(">\r\n <h2>No Plugins are Installed</h2>\r\n </div> \r\n");
|
||||||
|
|
||||||
WriteLiteral(" class=\"smallMessage\"");
|
|
||||||
|
|
||||||
WriteLiteral(">No Plugins Installed</span>\r\n </div> \r\n");
|
|
||||||
|
|
||||||
|
|
||||||
#line 12 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
|
#line 12 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
|
||||||
@@ -228,22 +224,287 @@ WriteLiteral("\r\n </td>\r\n");
|
|||||||
#line hidden
|
#line hidden
|
||||||
WriteLiteral(" </tr>\r\n </table>\r\n");
|
WriteLiteral(" </tr>\r\n </table>\r\n");
|
||||||
|
|
||||||
|
WriteLiteral(" <div");
|
||||||
|
|
||||||
#line 48 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
|
WriteLiteral(" id=\"dialogUninstallPlugins\"");
|
||||||
|
|
||||||
|
WriteLiteral(" title=\"Uninstall Plugin\"");
|
||||||
|
|
||||||
|
WriteLiteral(">\r\n <div>\r\n");
|
||||||
|
|
||||||
|
WriteLiteral(" ");
|
||||||
|
|
||||||
|
|
||||||
|
#line 50 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
|
||||||
|
Write(Html.DropDownList("uninstallPlugin", Model.PluginManifests.ToSelectListItems(null, true, "Select a Plugin to Uninstall")));
|
||||||
|
|
||||||
|
|
||||||
|
#line default
|
||||||
|
#line hidden
|
||||||
|
WriteLiteral("\r\n </div>\r\n <div>\r\n <input");
|
||||||
|
|
||||||
|
WriteLiteral(" id=\"uninstallPluginData\"");
|
||||||
|
|
||||||
|
WriteLiteral(" type=\"checkbox\"");
|
||||||
|
|
||||||
|
WriteLiteral(" /><label");
|
||||||
|
|
||||||
|
WriteLiteral(" for=\"uninstallPluginData\"");
|
||||||
|
|
||||||
|
WriteLiteral("> Uninstall Plugin Data</label>\r\n <div");
|
||||||
|
|
||||||
|
WriteLiteral(" id=\"uninstallPluginDataAlert\"");
|
||||||
|
|
||||||
|
WriteLiteral(" style=\"display: none; padding: 0.7em 0.7em; margin-top: 8px;\"");
|
||||||
|
|
||||||
|
WriteLiteral(" class=\"ui-state-error ui-corner-all\"");
|
||||||
|
|
||||||
|
WriteLiteral(">\r\n <span");
|
||||||
|
|
||||||
|
WriteLiteral(" style=\"margin-right: 0.3em; float: left;\"");
|
||||||
|
|
||||||
|
WriteLiteral(" class=\"ui-icon ui-icon-alert\"");
|
||||||
|
|
||||||
|
WriteLiteral("></span>NOTE: Data will be permanently deleted\r\n </div>\r\n </div" +
|
||||||
|
">\r\n </div>\r\n");
|
||||||
|
|
||||||
|
WriteLiteral(" <div");
|
||||||
|
|
||||||
|
WriteLiteral(" id=\"dialogUninstallPluginConfirm\"");
|
||||||
|
|
||||||
|
WriteLiteral(" title=\"Confirm Plugin Uninstall\"");
|
||||||
|
|
||||||
|
WriteLiteral(">\r\n <div");
|
||||||
|
|
||||||
|
WriteLiteral(" style=\"padding: 0.7em 0.7em; margin-top: 8px;\"");
|
||||||
|
|
||||||
|
WriteLiteral(" class=\"ui-state-highlight ui-corner-all\"");
|
||||||
|
|
||||||
|
WriteLiteral(">\r\n <span");
|
||||||
|
|
||||||
|
WriteLiteral(" style=\"margin-right: 0.3em; float: left;\"");
|
||||||
|
|
||||||
|
WriteLiteral(" class=\"ui-icon ui-icon-help\"");
|
||||||
|
|
||||||
|
WriteLiteral("></span>Are you sure you want to uninstall this plugin?\r\n <h4");
|
||||||
|
|
||||||
|
WriteLiteral(" id=\"uninstallPluginConfirm\"");
|
||||||
|
|
||||||
|
WriteLiteral("></h4>\r\n </div>\r\n <div");
|
||||||
|
|
||||||
|
WriteLiteral(" id=\"uninstallPluginDataConfirm\"");
|
||||||
|
|
||||||
|
WriteLiteral(" style=\"display: none; padding: 0.7em 0.7em; margin-top: 8px;\"");
|
||||||
|
|
||||||
|
WriteLiteral(" class=\"ui-state-error ui-corner-all\"");
|
||||||
|
|
||||||
|
WriteLiteral(">\r\n <span");
|
||||||
|
|
||||||
|
WriteLiteral(" style=\"margin-right: 0.3em; float: left;\"");
|
||||||
|
|
||||||
|
WriteLiteral(" class=\"ui-icon ui-icon-alert\"");
|
||||||
|
|
||||||
|
WriteLiteral("></span>NOTE: Data will be permanently deleted\r\n </div>\r\n </div>\r\n");
|
||||||
|
|
||||||
|
WriteLiteral(" <script>\r\n $(function () {\r\n // Uninstall\r\n var " +
|
||||||
|
"uninstallUrl = \'");
|
||||||
|
|
||||||
|
|
||||||
|
#line 71 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
|
||||||
|
Write(Url.Action(MVC.API.Plugin.Uninstall()));
|
||||||
|
|
||||||
|
|
||||||
|
#line default
|
||||||
|
#line hidden
|
||||||
|
WriteLiteral("/\';\r\n var uninstallPlugin, uninstallPluginData, $dialogConfirm, uninst" +
|
||||||
|
"allPluginConfirm, uninstallPluginDataConfirm;\r\n\r\n var pluginId, plugi" +
|
||||||
|
"nName, pluginUninstallData;\r\n\r\n var $dialog = $(\'#dialogUninstallPlug" +
|
||||||
|
"ins\').dialog({\r\n resizable: false,\r\n modal: true,\r" +
|
||||||
|
"\n width: 350,\r\n autoOpen: false,\r\n " +
|
||||||
|
"buttons: {\r\n \"Uninstall\": function () {\r\n " +
|
||||||
|
" pluginId = uninstallPlugin.val();\r\n pluginName = unin" +
|
||||||
|
"stallPlugin.find(\'option:selected\').text();\r\n pluginUnins" +
|
||||||
|
"tallData = uninstallPluginData.is(\':checked\');\r\n\r\n if (!p" +
|
||||||
|
"luginId) {\r\n alert(\'Select a plugin to uninstall\');\r\n" +
|
||||||
|
" } else {\r\n uninstallPluginCon" +
|
||||||
|
"firm.text(pluginName + \' [\' + pluginId + \']\');\r\n if (" +
|
||||||
|
"pluginUninstallData)\r\n uninstallPluginDataConfirm" +
|
||||||
|
".show();\r\n else\r\n unin" +
|
||||||
|
"stallPluginDataConfirm.hide();\r\n\r\n $dialogConfirm.dia" +
|
||||||
|
"log(\'open\');\r\n $(this).dialog(\"close\");\r\n " +
|
||||||
|
" }\r\n },\r\n Cancel: function () {" +
|
||||||
|
"\r\n uninstallPluginData.removeAttr(\'checked\');\r\n " +
|
||||||
|
" $(\'#uninstallPluginDataAlert\').hide();\r\n $(" +
|
||||||
|
"this).dialog(\"close\");\r\n }\r\n }\r\n })" +
|
||||||
|
";\r\n\r\n $dialogConfirm = $(\'#dialogUninstallPluginConfirm\').dialog({\r\n " +
|
||||||
|
" resizable: false,\r\n modal: true,\r\n " +
|
||||||
|
"width: 350,\r\n autoOpen: false,\r\n buttons: {\r\n " +
|
||||||
|
" \"Confirm Uninstall\": function () {\r\n var u" +
|
||||||
|
"rl = uninstallUrl + pluginId;\r\n if (pluginUninstallData)\r" +
|
||||||
|
"\n url += \'?UninstallData=true\'\r\n " +
|
||||||
|
" else\r\n url += \'?UninstallData=false\'\r\n\r\n " +
|
||||||
|
" window.location.href = url;\r\n $(this).dialo" +
|
||||||
|
"g(\"disable\");\r\n },\r\n Cancel: function () {" +
|
||||||
|
"\r\n uninstallPluginData.removeAttr(\'checked\');\r\n " +
|
||||||
|
" $(\'#uninstallPluginDataAlert\').hide();\r\n $(" +
|
||||||
|
"this).dialog(\"close\");\r\n }\r\n }\r\n })" +
|
||||||
|
";\r\n\r\n uninstallPlugin = $(\'#uninstallPlugin\');\r\n uninstall" +
|
||||||
|
"PluginData = $(\'#uninstallPluginData\');\r\n uninstallPluginConfirm = $(" +
|
||||||
|
"\'#uninstallPluginConfirm\');\r\n uninstallPluginDataConfirm = $(\'#uninst" +
|
||||||
|
"allPluginDataConfirm\');\r\n\r\n $(\'#buttonUninstall\').click(function () {" +
|
||||||
|
"\r\n $dialog.dialog(\'open\');\r\n return false;\r\n " +
|
||||||
|
" });\r\n\r\n $(\'#uninstallPluginData\').change(function () {\r\n " +
|
||||||
|
" if ($(this).is(\':checked\')) {\r\n $(\'#uninstallPluginD" +
|
||||||
|
"ataAlert\').slideDown();\r\n } else {\r\n $(\'#unins" +
|
||||||
|
"tallPluginDataAlert\').slideUp();\r\n }\r\n });\r\n })" +
|
||||||
|
";\r\n </script>\r\n");
|
||||||
|
|
||||||
|
|
||||||
|
#line 151 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#line default
|
||||||
|
#line hidden
|
||||||
|
WriteLiteral("\r\n<div");
|
||||||
|
|
||||||
|
WriteLiteral(" id=\"dialogInstallPlugin\"");
|
||||||
|
|
||||||
|
WriteLiteral(" title=\"Install Plugin\"");
|
||||||
|
|
||||||
|
WriteLiteral(">\r\n <div");
|
||||||
|
|
||||||
|
WriteLiteral(" style=\"padding-bottom: 10px;\"");
|
||||||
|
|
||||||
|
WriteLiteral(">\r\n");
|
||||||
|
|
||||||
|
|
||||||
|
#line 155 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
|
||||||
|
|
||||||
|
|
||||||
#line default
|
#line default
|
||||||
#line hidden
|
#line hidden
|
||||||
|
|
||||||
#line 74 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
|
#line 155 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
|
||||||
|
using (Html.BeginForm(MVC.API.Plugin.Install(), FormMethod.Post, new { enctype = "multipart/form-data" }))
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
#line default
|
||||||
|
#line hidden
|
||||||
|
WriteLiteral(" <label");
|
||||||
|
|
||||||
|
WriteLiteral(" for=\"pluginFile\"");
|
||||||
|
|
||||||
|
WriteLiteral(">Plugin Package: </label>\r\n");
|
||||||
|
|
||||||
|
WriteLiteral(" <input");
|
||||||
|
|
||||||
|
WriteLiteral(" id=\"pluginFile\"");
|
||||||
|
|
||||||
|
WriteLiteral(" name=\"Plugin\"");
|
||||||
|
|
||||||
|
WriteLiteral(" type=\"file\"");
|
||||||
|
|
||||||
|
WriteLiteral(" />\r\n");
|
||||||
|
|
||||||
|
|
||||||
|
#line 159 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#line default
|
||||||
|
#line hidden
|
||||||
|
WriteLiteral(" </div>\r\n <div");
|
||||||
|
|
||||||
|
WriteLiteral(" style=\"padding: 0.7em 0.7em; margin-top: 8px;\"");
|
||||||
|
|
||||||
|
WriteLiteral(" class=\"ui-state-error ui-corner-all\"");
|
||||||
|
|
||||||
|
WriteLiteral(">\r\n <span");
|
||||||
|
|
||||||
|
WriteLiteral(" style=\"margin-right: 0.3em; margin-bottom: 2em; float: left;\"");
|
||||||
|
|
||||||
|
WriteLiteral(" class=\"ui-icon ui-icon-alert\"");
|
||||||
|
|
||||||
|
WriteLiteral(@"></span>Warning: All plugins run with the same level of network privileges as the Disco Web App.<br />
|
||||||
|
<strong>Only install plugins from a trusted source.</strong>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<script>
|
||||||
|
$(function () {
|
||||||
|
// Install
|
||||||
|
var $dialogInstall = $('#dialogInstallPlugin').dialog({
|
||||||
|
resizable: false,
|
||||||
|
modal: true,
|
||||||
|
width: 350,
|
||||||
|
autoOpen: false,
|
||||||
|
buttons: {
|
||||||
|
""Upload & Install"": function () {
|
||||||
|
var pluginFile = $('#pluginFile');
|
||||||
|
if (pluginFile.val()) {
|
||||||
|
pluginFile.closest('form').submit();
|
||||||
|
$(this).dialog('disable');
|
||||||
|
} else {
|
||||||
|
alert('Choose a Plugin Package to Install');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
Cancel: function () {
|
||||||
|
$(this).dialog(""close"");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
$('#buttonInstall').click(function () {
|
||||||
|
$dialogInstall.dialog('open');
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<div");
|
||||||
|
|
||||||
|
WriteLiteral(" class=\"actionBar\"");
|
||||||
|
|
||||||
|
WriteLiteral(">\r\n");
|
||||||
|
|
||||||
|
|
||||||
|
#line 196 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
|
||||||
|
|
||||||
|
|
||||||
|
#line default
|
||||||
|
#line hidden
|
||||||
|
|
||||||
|
#line 196 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
|
||||||
|
if (Model.PluginManifests.Count > 0)
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
#line default
|
||||||
|
#line hidden
|
||||||
|
|
||||||
|
#line 198 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
|
||||||
|
Write(Html.ActionLinkButton("Uninstall Plugins", MVC.Config.Plugins.Index(), "buttonUninstall"));
|
||||||
|
|
||||||
|
|
||||||
|
#line default
|
||||||
|
#line hidden
|
||||||
|
|
||||||
|
#line 198 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#line default
|
#line default
|
||||||
#line hidden
|
#line hidden
|
||||||
WriteLiteral("\r\n");
|
WriteLiteral(" ");
|
||||||
|
|
||||||
|
|
||||||
|
#line 200 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
|
||||||
|
Write(Html.ActionLinkButton("Install Plugins", MVC.Config.Plugins.Index(), "buttonInstall"));
|
||||||
|
|
||||||
|
|
||||||
|
#line default
|
||||||
|
#line hidden
|
||||||
|
WriteLiteral("\r\n</div>\r\n");
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ using System.IO;
|
|||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
using System.IO.Compression;
|
using System.IO.Compression;
|
||||||
using System.Management;
|
using System.Management;
|
||||||
|
using System.Web;
|
||||||
|
|
||||||
namespace Disco.Web.Controllers
|
namespace Disco.Web.Controllers
|
||||||
{
|
{
|
||||||
@@ -295,7 +296,8 @@ namespace Disco.Web.Controllers
|
|||||||
|
|
||||||
_restartTimer = new Timer((state) =>
|
_restartTimer = new Timer((state) =>
|
||||||
{
|
{
|
||||||
AppDomain.Unload(AppDomain.CurrentDomain);
|
HttpRuntime.UnloadAppDomain();
|
||||||
|
//AppDomain.Unload(AppDomain.CurrentDomain);
|
||||||
}, null, DelayMilliseconds, Timeout.Infinite);
|
}, null, DelayMilliseconds, Timeout.Infinite);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+13
-12
@@ -162,6 +162,7 @@
|
|||||||
<DesignTime>True</DesignTime>
|
<DesignTime>True</DesignTime>
|
||||||
<DependentUpon>CommonHelpers.cshtml</DependentUpon>
|
<DependentUpon>CommonHelpers.cshtml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
<Compile Include="Areas\API\Controllers\PluginController.cs" />
|
||||||
<Compile Include="Areas\Config\Models\Config\IndexModel.cs" />
|
<Compile Include="Areas\Config\Models\Config\IndexModel.cs" />
|
||||||
<Compile Include="Controllers\InitialConfigController.cs" />
|
<Compile Include="Controllers\InitialConfigController.cs" />
|
||||||
<Compile Include="Controllers\PluginWebHandlerController.cs" />
|
<Compile Include="Controllers\PluginWebHandlerController.cs" />
|
||||||
@@ -184,7 +185,7 @@
|
|||||||
<Compile Include="Areas\API\Controllers\LoggingController.cs" />
|
<Compile Include="Areas\API\Controllers\LoggingController.cs" />
|
||||||
<Compile Include="Areas\API\Controllers\SystemController.cs" />
|
<Compile Include="Areas\API\Controllers\SystemController.cs" />
|
||||||
<Compile Include="Areas\API\Controllers\UserController.cs" />
|
<Compile Include="Areas\API\Controllers\UserController.cs" />
|
||||||
<Compile Include="Areas\API\Controllers\WirelessCertificateController.cs" />
|
<Compile Include="Areas\API\Controllers\DeviceCertificateController.cs" />
|
||||||
<Compile Include="Areas\API\Models\Attachment\AttachmentModel.cs" />
|
<Compile Include="Areas\API\Models\Attachment\AttachmentModel.cs" />
|
||||||
<Compile Include="Areas\API\Models\Attachment\AttachmentsModel.cs" />
|
<Compile Include="Areas\API\Models\Attachment\AttachmentsModel.cs" />
|
||||||
<Compile Include="Areas\API\Models\Attachment\_AttachmentModel.cs" />
|
<Compile Include="Areas\API\Models\Attachment\_AttachmentModel.cs" />
|
||||||
@@ -1149,7 +1150,7 @@
|
|||||||
<None Include="ClientSource\Style\Timeline\graphics.min.css">
|
<None Include="ClientSource\Style\Timeline\graphics.min.css">
|
||||||
<DependentUpon>graphics.css</DependentUpon>
|
<DependentUpon>graphics.css</DependentUpon>
|
||||||
</None>
|
</None>
|
||||||
<None Include="ClientSource\Style\Timeline\images\blue-circle.png" />
|
<Content Include="ClientSource\Style\Timeline\images\blue-circle.png" />
|
||||||
<None Include="ClientSource\Style\Timeline\images\bubble-arrow-point-down.png" />
|
<None Include="ClientSource\Style\Timeline\images\bubble-arrow-point-down.png" />
|
||||||
<None Include="ClientSource\Style\Timeline\images\bubble-arrow-point-left.png" />
|
<None Include="ClientSource\Style\Timeline\images\bubble-arrow-point-left.png" />
|
||||||
<None Include="ClientSource\Style\Timeline\images\bubble-arrow-point-right.png" />
|
<None Include="ClientSource\Style\Timeline\images\bubble-arrow-point-right.png" />
|
||||||
@@ -1170,14 +1171,14 @@
|
|||||||
<None Include="ClientSource\Style\Timeline\images\copy.png" />
|
<None Include="ClientSource\Style\Timeline\images\copy.png" />
|
||||||
<None Include="ClientSource\Style\Timeline\images\copyright-vertical.png" />
|
<None Include="ClientSource\Style\Timeline\images\copyright-vertical.png" />
|
||||||
<None Include="ClientSource\Style\Timeline\images\copyright.png" />
|
<None Include="ClientSource\Style\Timeline\images\copyright.png" />
|
||||||
<None Include="ClientSource\Style\Timeline\images\dark-blue-circle.png" />
|
<Content Include="ClientSource\Style\Timeline\images\dark-blue-circle.png" />
|
||||||
<None Include="ClientSource\Style\Timeline\images\dark-green-circle.png" />
|
<Content Include="ClientSource\Style\Timeline\images\dark-green-circle.png" />
|
||||||
<None Include="ClientSource\Style\Timeline\images\dark-red-circle.png" />
|
<Content Include="ClientSource\Style\Timeline\images\dark-red-circle.png" />
|
||||||
<None Include="ClientSource\Style\Timeline\images\dull-blue-circle.png" />
|
<Content Include="ClientSource\Style\Timeline\images\dull-blue-circle.png" />
|
||||||
<None Include="ClientSource\Style\Timeline\images\dull-green-circle.png" />
|
<Content Include="ClientSource\Style\Timeline\images\dull-green-circle.png" />
|
||||||
<None Include="ClientSource\Style\Timeline\images\dull-red-circle.png" />
|
<Content Include="ClientSource\Style\Timeline\images\dull-red-circle.png" />
|
||||||
<None Include="ClientSource\Style\Timeline\images\gray-circle.png" />
|
<Content Include="ClientSource\Style\Timeline\images\gray-circle.png" />
|
||||||
<None Include="ClientSource\Style\Timeline\images\green-circle.png" />
|
<Content Include="ClientSource\Style\Timeline\images\green-circle.png" />
|
||||||
<None Include="ClientSource\Style\Timeline\images\message-bottom-left.png" />
|
<None Include="ClientSource\Style\Timeline\images\message-bottom-left.png" />
|
||||||
<None Include="ClientSource\Style\Timeline\images\message-bottom-right.png" />
|
<None Include="ClientSource\Style\Timeline\images\message-bottom-right.png" />
|
||||||
<None Include="ClientSource\Style\Timeline\images\message-left.png" />
|
<None Include="ClientSource\Style\Timeline\images\message-left.png" />
|
||||||
@@ -1185,7 +1186,7 @@
|
|||||||
<None Include="ClientSource\Style\Timeline\images\message-top-left.png" />
|
<None Include="ClientSource\Style\Timeline\images\message-top-left.png" />
|
||||||
<None Include="ClientSource\Style\Timeline\images\message-top-right.png" />
|
<None Include="ClientSource\Style\Timeline\images\message-top-right.png" />
|
||||||
<None Include="ClientSource\Style\Timeline\images\progress-running.gif" />
|
<None Include="ClientSource\Style\Timeline\images\progress-running.gif" />
|
||||||
<None Include="ClientSource\Style\Timeline\images\red-circle.png" />
|
<Content Include="ClientSource\Style\Timeline\images\red-circle.png" />
|
||||||
<None Include="ClientSource\Style\Timeline\images\top-bubble.png" />
|
<None Include="ClientSource\Style\Timeline\images\top-bubble.png" />
|
||||||
<None Include="ClientSource\Style\Timeline\timeline-bundle.css" />
|
<None Include="ClientSource\Style\Timeline\timeline-bundle.css" />
|
||||||
<None Include="ClientSource\Style\Timeline\timeline-bundle.min.css">
|
<None Include="ClientSource\Style\Timeline\timeline-bundle.min.css">
|
||||||
@@ -1811,7 +1812,7 @@
|
|||||||
<SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile>
|
<SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile>
|
||||||
</WebProjectProperties>
|
</WebProjectProperties>
|
||||||
</FlavorProperties>
|
</FlavorProperties>
|
||||||
<UserProperties BuildVersion_StartDate="2001/1/1" BuildVersion_BuildAction="ReBuild" BuildVersion_UseGlobalSettings="True" BuildVersion_DetectChanges="False" />
|
<UserProperties BuildVersion_DetectChanges="False" BuildVersion_UseGlobalSettings="True" BuildVersion_BuildAction="ReBuild" BuildVersion_StartDate="2001/1/1" />
|
||||||
</VisualStudio>
|
</VisualStudio>
|
||||||
</ProjectExtensions>
|
</ProjectExtensions>
|
||||||
<Import Project="$(SolutionDir)\.nuget\nuget.targets" />
|
<Import Project="$(SolutionDir)\.nuget\nuget.targets" />
|
||||||
|
|||||||
@@ -31,5 +31,5 @@ using System.Runtime.InteropServices;
|
|||||||
//
|
//
|
||||||
// You can specify all the values or you can default the Revision and Build Numbers
|
// You can specify all the values or you can default the Revision and Build Numbers
|
||||||
// by using the '*' as shown below:
|
// by using the '*' as shown below:
|
||||||
[assembly: AssemblyVersion("1.2.0131.2002")]
|
[assembly: AssemblyVersion("1.2.0207.1727")]
|
||||||
[assembly: AssemblyFileVersion("1.2.0131.2002")]
|
[assembly: AssemblyFileVersion("1.2.0207.1727")]
|
||||||
|
|||||||
+213
-119
@@ -50,6 +50,7 @@ namespace T4MVC
|
|||||||
public readonly string Name = "API";
|
public readonly string Name = "API";
|
||||||
public Disco.Web.Areas.API.Controllers.BootstrapperController Bootstrapper = new Disco.Web.Areas.API.Controllers.T4MVC_BootstrapperController();
|
public Disco.Web.Areas.API.Controllers.BootstrapperController Bootstrapper = new Disco.Web.Areas.API.Controllers.T4MVC_BootstrapperController();
|
||||||
public Disco.Web.Areas.API.Controllers.DeviceBatchController DeviceBatch = new Disco.Web.Areas.API.Controllers.T4MVC_DeviceBatchController();
|
public Disco.Web.Areas.API.Controllers.DeviceBatchController DeviceBatch = new Disco.Web.Areas.API.Controllers.T4MVC_DeviceBatchController();
|
||||||
|
public Disco.Web.Areas.API.Controllers.DeviceCertificateController DeviceCertificate = new Disco.Web.Areas.API.Controllers.T4MVC_DeviceCertificateController();
|
||||||
public Disco.Web.Areas.API.Controllers.DeviceController Device = new Disco.Web.Areas.API.Controllers.T4MVC_DeviceController();
|
public Disco.Web.Areas.API.Controllers.DeviceController Device = new Disco.Web.Areas.API.Controllers.T4MVC_DeviceController();
|
||||||
public Disco.Web.Areas.API.Controllers.DeviceModelController DeviceModel = new Disco.Web.Areas.API.Controllers.T4MVC_DeviceModelController();
|
public Disco.Web.Areas.API.Controllers.DeviceModelController DeviceModel = new Disco.Web.Areas.API.Controllers.T4MVC_DeviceModelController();
|
||||||
public Disco.Web.Areas.API.Controllers.DeviceProfileController DeviceProfile = new Disco.Web.Areas.API.Controllers.T4MVC_DeviceProfileController();
|
public Disco.Web.Areas.API.Controllers.DeviceProfileController DeviceProfile = new Disco.Web.Areas.API.Controllers.T4MVC_DeviceProfileController();
|
||||||
@@ -57,9 +58,9 @@ namespace T4MVC
|
|||||||
public Disco.Web.Areas.API.Controllers.ExpressionsController Expressions = new Disco.Web.Areas.API.Controllers.T4MVC_ExpressionsController();
|
public Disco.Web.Areas.API.Controllers.ExpressionsController Expressions = new Disco.Web.Areas.API.Controllers.T4MVC_ExpressionsController();
|
||||||
public Disco.Web.Areas.API.Controllers.JobController Job = new Disco.Web.Areas.API.Controllers.T4MVC_JobController();
|
public Disco.Web.Areas.API.Controllers.JobController Job = new Disco.Web.Areas.API.Controllers.T4MVC_JobController();
|
||||||
public Disco.Web.Areas.API.Controllers.LoggingController Logging = new Disco.Web.Areas.API.Controllers.T4MVC_LoggingController();
|
public Disco.Web.Areas.API.Controllers.LoggingController Logging = new Disco.Web.Areas.API.Controllers.T4MVC_LoggingController();
|
||||||
|
public Disco.Web.Areas.API.Controllers.PluginController Plugin = new Disco.Web.Areas.API.Controllers.T4MVC_PluginController();
|
||||||
public Disco.Web.Areas.API.Controllers.SystemController System = new Disco.Web.Areas.API.Controllers.T4MVC_SystemController();
|
public Disco.Web.Areas.API.Controllers.SystemController System = new Disco.Web.Areas.API.Controllers.T4MVC_SystemController();
|
||||||
public Disco.Web.Areas.API.Controllers.UserController User = new Disco.Web.Areas.API.Controllers.T4MVC_UserController();
|
public Disco.Web.Areas.API.Controllers.UserController User = new Disco.Web.Areas.API.Controllers.T4MVC_UserController();
|
||||||
public Disco.Web.Areas.API.Controllers.WirelessCertificateController WirelessCertificate = new Disco.Web.Areas.API.Controllers.T4MVC_WirelessCertificateController();
|
|
||||||
}
|
}
|
||||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||||
public class ConfigClass
|
public class ConfigClass
|
||||||
@@ -2826,6 +2827,99 @@ namespace Disco.Web.Areas.API.Controllers
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
namespace Disco.Web.Areas.API.Controllers
|
||||||
|
{
|
||||||
|
public partial class DeviceCertificateController
|
||||||
|
{
|
||||||
|
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||||
|
public DeviceCertificateController() { }
|
||||||
|
|
||||||
|
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||||
|
protected DeviceCertificateController(Dummy d) { }
|
||||||
|
|
||||||
|
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||||
|
protected RedirectToRouteResult RedirectToAction(ActionResult result)
|
||||||
|
{
|
||||||
|
var callInfo = result.GetT4MVCResult();
|
||||||
|
return RedirectToRoute(callInfo.RouteValueDictionary);
|
||||||
|
}
|
||||||
|
|
||||||
|
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||||
|
protected RedirectToRouteResult RedirectToActionPermanent(ActionResult result)
|
||||||
|
{
|
||||||
|
var callInfo = result.GetT4MVCResult();
|
||||||
|
return RedirectToRoutePermanent(callInfo.RouteValueDictionary);
|
||||||
|
}
|
||||||
|
|
||||||
|
[NonAction]
|
||||||
|
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||||
|
public System.Web.Mvc.ActionResult Download()
|
||||||
|
{
|
||||||
|
return new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.Download);
|
||||||
|
}
|
||||||
|
|
||||||
|
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||||
|
public DeviceCertificateController Actions { get { return MVC.API.DeviceCertificate; } }
|
||||||
|
[GeneratedCode("T4MVC", "2.0")]
|
||||||
|
public readonly string Area = "API";
|
||||||
|
[GeneratedCode("T4MVC", "2.0")]
|
||||||
|
public readonly string Name = "DeviceCertificate";
|
||||||
|
[GeneratedCode("T4MVC", "2.0")]
|
||||||
|
public const string NameConst = "DeviceCertificate";
|
||||||
|
|
||||||
|
static readonly ActionNamesClass s_actions = new ActionNamesClass();
|
||||||
|
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||||
|
public ActionNamesClass ActionNames { get { return s_actions; } }
|
||||||
|
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||||
|
public class ActionNamesClass
|
||||||
|
{
|
||||||
|
public readonly string Download = "Download";
|
||||||
|
}
|
||||||
|
|
||||||
|
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||||
|
public class ActionNameConstants
|
||||||
|
{
|
||||||
|
public const string Download = "Download";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static readonly ActionParamsClass_Download s_params_Download = new ActionParamsClass_Download();
|
||||||
|
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||||
|
public ActionParamsClass_Download DownloadParams { get { return s_params_Download; } }
|
||||||
|
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||||
|
public class ActionParamsClass_Download
|
||||||
|
{
|
||||||
|
public readonly string id = "id";
|
||||||
|
}
|
||||||
|
static readonly ViewsClass s_views = new ViewsClass();
|
||||||
|
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||||
|
public ViewsClass Views { get { return s_views; } }
|
||||||
|
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||||
|
public class ViewsClass
|
||||||
|
{
|
||||||
|
static readonly _ViewNamesClass s_ViewNames = new _ViewNamesClass();
|
||||||
|
public _ViewNamesClass ViewNames { get { return s_ViewNames; } }
|
||||||
|
public class _ViewNamesClass
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||||
|
public class T4MVC_DeviceCertificateController : Disco.Web.Areas.API.Controllers.DeviceCertificateController
|
||||||
|
{
|
||||||
|
public T4MVC_DeviceCertificateController() : base(Dummy.Instance) { }
|
||||||
|
|
||||||
|
public override System.Web.Mvc.ActionResult Download(int id)
|
||||||
|
{
|
||||||
|
var callInfo = new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.Download);
|
||||||
|
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "id", id);
|
||||||
|
return callInfo;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
namespace Disco.Web.Areas.API.Controllers
|
namespace Disco.Web.Areas.API.Controllers
|
||||||
{
|
{
|
||||||
public partial class DeviceController
|
public partial class DeviceController
|
||||||
@@ -6641,6 +6735,124 @@ namespace Disco.Web.Areas.API.Controllers
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
namespace Disco.Web.Areas.API.Controllers
|
||||||
|
{
|
||||||
|
public partial class PluginController
|
||||||
|
{
|
||||||
|
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||||
|
public PluginController() { }
|
||||||
|
|
||||||
|
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||||
|
protected PluginController(Dummy d) { }
|
||||||
|
|
||||||
|
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||||
|
protected RedirectToRouteResult RedirectToAction(ActionResult result)
|
||||||
|
{
|
||||||
|
var callInfo = result.GetT4MVCResult();
|
||||||
|
return RedirectToRoute(callInfo.RouteValueDictionary);
|
||||||
|
}
|
||||||
|
|
||||||
|
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||||
|
protected RedirectToRouteResult RedirectToActionPermanent(ActionResult result)
|
||||||
|
{
|
||||||
|
var callInfo = result.GetT4MVCResult();
|
||||||
|
return RedirectToRoutePermanent(callInfo.RouteValueDictionary);
|
||||||
|
}
|
||||||
|
|
||||||
|
[NonAction]
|
||||||
|
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||||
|
public System.Web.Mvc.ActionResult Uninstall()
|
||||||
|
{
|
||||||
|
return new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.Uninstall);
|
||||||
|
}
|
||||||
|
[NonAction]
|
||||||
|
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||||
|
public System.Web.Mvc.ActionResult Install()
|
||||||
|
{
|
||||||
|
return new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.Install);
|
||||||
|
}
|
||||||
|
|
||||||
|
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||||
|
public PluginController Actions { get { return MVC.API.Plugin; } }
|
||||||
|
[GeneratedCode("T4MVC", "2.0")]
|
||||||
|
public readonly string Area = "API";
|
||||||
|
[GeneratedCode("T4MVC", "2.0")]
|
||||||
|
public readonly string Name = "Plugin";
|
||||||
|
[GeneratedCode("T4MVC", "2.0")]
|
||||||
|
public const string NameConst = "Plugin";
|
||||||
|
|
||||||
|
static readonly ActionNamesClass s_actions = new ActionNamesClass();
|
||||||
|
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||||
|
public ActionNamesClass ActionNames { get { return s_actions; } }
|
||||||
|
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||||
|
public class ActionNamesClass
|
||||||
|
{
|
||||||
|
public readonly string Uninstall = "Uninstall";
|
||||||
|
public readonly string Install = "Install";
|
||||||
|
}
|
||||||
|
|
||||||
|
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||||
|
public class ActionNameConstants
|
||||||
|
{
|
||||||
|
public const string Uninstall = "Uninstall";
|
||||||
|
public const string Install = "Install";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static readonly ActionParamsClass_Uninstall s_params_Uninstall = new ActionParamsClass_Uninstall();
|
||||||
|
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||||
|
public ActionParamsClass_Uninstall UninstallParams { get { return s_params_Uninstall; } }
|
||||||
|
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||||
|
public class ActionParamsClass_Uninstall
|
||||||
|
{
|
||||||
|
public readonly string id = "id";
|
||||||
|
public readonly string UninstallData = "UninstallData";
|
||||||
|
}
|
||||||
|
static readonly ActionParamsClass_Install s_params_Install = new ActionParamsClass_Install();
|
||||||
|
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||||
|
public ActionParamsClass_Install InstallParams { get { return s_params_Install; } }
|
||||||
|
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||||
|
public class ActionParamsClass_Install
|
||||||
|
{
|
||||||
|
public readonly string Plugin = "Plugin";
|
||||||
|
}
|
||||||
|
static readonly ViewsClass s_views = new ViewsClass();
|
||||||
|
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||||
|
public ViewsClass Views { get { return s_views; } }
|
||||||
|
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||||
|
public class ViewsClass
|
||||||
|
{
|
||||||
|
static readonly _ViewNamesClass s_ViewNames = new _ViewNamesClass();
|
||||||
|
public _ViewNamesClass ViewNames { get { return s_ViewNames; } }
|
||||||
|
public class _ViewNamesClass
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||||
|
public class T4MVC_PluginController : Disco.Web.Areas.API.Controllers.PluginController
|
||||||
|
{
|
||||||
|
public T4MVC_PluginController() : base(Dummy.Instance) { }
|
||||||
|
|
||||||
|
public override System.Web.Mvc.ActionResult Uninstall(string id, bool UninstallData)
|
||||||
|
{
|
||||||
|
var callInfo = new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.Uninstall);
|
||||||
|
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "id", id);
|
||||||
|
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "UninstallData", UninstallData);
|
||||||
|
return callInfo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public override System.Web.Mvc.ActionResult Install(System.Web.HttpPostedFileBase Plugin)
|
||||||
|
{
|
||||||
|
var callInfo = new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.Install);
|
||||||
|
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "Plugin", Plugin);
|
||||||
|
return callInfo;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
namespace Disco.Web.Areas.API.Controllers
|
namespace Disco.Web.Areas.API.Controllers
|
||||||
{
|
{
|
||||||
public partial class SystemController
|
public partial class SystemController
|
||||||
@@ -7126,124 +7338,6 @@ namespace Disco.Web.Areas.API.Controllers
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace Disco.Web.Areas.API.Controllers
|
|
||||||
{
|
|
||||||
public partial class WirelessCertificateController
|
|
||||||
{
|
|
||||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
|
||||||
public WirelessCertificateController() { }
|
|
||||||
|
|
||||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
|
||||||
protected WirelessCertificateController(Dummy d) { }
|
|
||||||
|
|
||||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
|
||||||
protected RedirectToRouteResult RedirectToAction(ActionResult result)
|
|
||||||
{
|
|
||||||
var callInfo = result.GetT4MVCResult();
|
|
||||||
return RedirectToRoute(callInfo.RouteValueDictionary);
|
|
||||||
}
|
|
||||||
|
|
||||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
|
||||||
protected RedirectToRouteResult RedirectToActionPermanent(ActionResult result)
|
|
||||||
{
|
|
||||||
var callInfo = result.GetT4MVCResult();
|
|
||||||
return RedirectToRoutePermanent(callInfo.RouteValueDictionary);
|
|
||||||
}
|
|
||||||
|
|
||||||
[NonAction]
|
|
||||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
|
||||||
public System.Web.Mvc.ActionResult Download()
|
|
||||||
{
|
|
||||||
return new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.Download);
|
|
||||||
}
|
|
||||||
[NonAction]
|
|
||||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
|
||||||
public System.Web.Mvc.ActionResult FillBuffer()
|
|
||||||
{
|
|
||||||
return new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.FillBuffer);
|
|
||||||
}
|
|
||||||
|
|
||||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
|
||||||
public WirelessCertificateController Actions { get { return MVC.API.WirelessCertificate; } }
|
|
||||||
[GeneratedCode("T4MVC", "2.0")]
|
|
||||||
public readonly string Area = "API";
|
|
||||||
[GeneratedCode("T4MVC", "2.0")]
|
|
||||||
public readonly string Name = "WirelessCertificate";
|
|
||||||
[GeneratedCode("T4MVC", "2.0")]
|
|
||||||
public const string NameConst = "WirelessCertificate";
|
|
||||||
|
|
||||||
static readonly ActionNamesClass s_actions = new ActionNamesClass();
|
|
||||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
|
||||||
public ActionNamesClass ActionNames { get { return s_actions; } }
|
|
||||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
|
||||||
public class ActionNamesClass
|
|
||||||
{
|
|
||||||
public readonly string Download = "Download";
|
|
||||||
public readonly string FillBuffer = "FillBuffer";
|
|
||||||
}
|
|
||||||
|
|
||||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
|
||||||
public class ActionNameConstants
|
|
||||||
{
|
|
||||||
public const string Download = "Download";
|
|
||||||
public const string FillBuffer = "FillBuffer";
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static readonly ActionParamsClass_Download s_params_Download = new ActionParamsClass_Download();
|
|
||||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
|
||||||
public ActionParamsClass_Download DownloadParams { get { return s_params_Download; } }
|
|
||||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
|
||||||
public class ActionParamsClass_Download
|
|
||||||
{
|
|
||||||
public readonly string id = "id";
|
|
||||||
}
|
|
||||||
static readonly ActionParamsClass_FillBuffer s_params_FillBuffer = new ActionParamsClass_FillBuffer();
|
|
||||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
|
||||||
public ActionParamsClass_FillBuffer FillBufferParams { get { return s_params_FillBuffer; } }
|
|
||||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
|
||||||
public class ActionParamsClass_FillBuffer
|
|
||||||
{
|
|
||||||
public readonly string Value = "Value";
|
|
||||||
public readonly string redirect = "redirect";
|
|
||||||
}
|
|
||||||
static readonly ViewsClass s_views = new ViewsClass();
|
|
||||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
|
||||||
public ViewsClass Views { get { return s_views; } }
|
|
||||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
|
||||||
public class ViewsClass
|
|
||||||
{
|
|
||||||
static readonly _ViewNamesClass s_ViewNames = new _ViewNamesClass();
|
|
||||||
public _ViewNamesClass ViewNames { get { return s_ViewNames; } }
|
|
||||||
public class _ViewNamesClass
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
|
||||||
public class T4MVC_WirelessCertificateController : Disco.Web.Areas.API.Controllers.WirelessCertificateController
|
|
||||||
{
|
|
||||||
public T4MVC_WirelessCertificateController() : base(Dummy.Instance) { }
|
|
||||||
|
|
||||||
public override System.Web.Mvc.ActionResult Download(int id)
|
|
||||||
{
|
|
||||||
var callInfo = new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.Download);
|
|
||||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "id", id);
|
|
||||||
return callInfo;
|
|
||||||
}
|
|
||||||
|
|
||||||
public override System.Web.Mvc.ActionResult FillBuffer(int Value, bool? redirect)
|
|
||||||
{
|
|
||||||
var callInfo = new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.FillBuffer);
|
|
||||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "Value", Value);
|
|
||||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "redirect", redirect);
|
|
||||||
return callInfo;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
namespace Disco.Web.Areas.Config.Controllers
|
namespace Disco.Web.Areas.Config.Controllers
|
||||||
{
|
{
|
||||||
public partial class ConfigController
|
public partial class ConfigController
|
||||||
|
|||||||
Reference in New Issue
Block a user