diff --git a/.gitignore b/.gitignore index 5a1f299..7cdd9f4 100644 --- a/.gitignore +++ b/.gitignore @@ -6,25 +6,40 @@ node_modules/ .vs/ # User-specific files +*.suo *.user +*.userosscache +*.sln.docstates # Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +build/ +bld/ [Bb]in/ [Oo]bj/ +[Oo]ut/ +msbuild.log +msbuild.err +msbuild.wrn *.zip package-lock.json # Resources -src/Resources/* -!src/Resources/.gitkeep +[Rr]esources/ +![Rr]esources/.gitkeep # Licenses -src/Licenses -!src/Licenses/.gitkeep +Licenses/ +!Licenses/.gitkeep # Document samples -src/DocumentSamples -!src/DocumentSamples/.gitkeep +DocumentSamples +!DocumentSamples/.gitkeep # Git !.gitkeep diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..b5d743a --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,37 @@ +{ + // Use IntelliSense to find out which attributes exist for C# debugging + // Use hover for the description of the existing attributes + // For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md + "version": "0.2.0", + "configurations": [ + { + "name": ".NET Core Launch (web)", + "type": "coreclr", + "request": "launch", + "preLaunchTask": "build", + // If you have changed target frameworks, make sure to update the program path. + "program": "${workspaceFolder}/GroupDocs.Editor.MVC/bin/Debug/netcoreapp3.1/GroupDocs.Editor.MVC.dll", + "args": [], + "cwd": "${workspaceFolder}/GroupDocs.Editor.MVC", + "stopAtEntry": false, + // Enable launching a web browser when ASP.NET Core starts. For more information: https://aka.ms/VSCode-CS-LaunchJson-WebBrowser + "serverReadyAction": { + "action": "openExternally", + "pattern": "^\\s*Now listening on:\\s+(https?://\\S+)", + "uriFormat": "%s/editor" + }, + "env": { + "ASPNETCORE_ENVIRONMENT": "Development" + }, + "sourceFileMap": { + "/Views": "${workspaceFolder}/Views" + } + }, + { + "name": ".NET Core Attach", + "type": "coreclr", + "request": "attach", + "processId": "${command:pickProcess}" + } + ] + } \ No newline at end of file diff --git a/GroupDocs.Editor MVC.sln b/GroupDocs.Editor MVC.sln index 8ff6f09..f5e50ff 100644 --- a/GroupDocs.Editor MVC.sln +++ b/GroupDocs.Editor MVC.sln @@ -1,11 +1,11 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.28010.2050 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.29806.167 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GroupDocs.Editor.MVC", "src\GroupDocs.Editor.MVC.csproj", "{A33CA8B0-A193-40A3-A86A-90FF444EE878}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GroupDocs.Editor.MVC", "GroupDocs.Editor.MVC\GroupDocs.Editor.MVC.csproj", "{EAF24520-33E2-458D-AD20-BCD9532DC78E}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GroupDocs.Editor.MVC.Test", "GroupDocs.Editor.MVC.Test\GroupDocs.Editor.MVC.Test.csproj", "{C8F2EDB6-BD6C-465F-B59F-2CEA33BD7FE6}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GroupDocs.Editor.MVC.Test", "GroupDocs.Editor.MVC.Test\GroupDocs.Editor.MVC.Test.csproj", "{68D3E81C-B9F5-443B-89F2-DC430D0A2A17}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -13,19 +13,19 @@ Global Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {A33CA8B0-A193-40A3-A86A-90FF444EE878}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A33CA8B0-A193-40A3-A86A-90FF444EE878}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A33CA8B0-A193-40A3-A86A-90FF444EE878}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A33CA8B0-A193-40A3-A86A-90FF444EE878}.Release|Any CPU.Build.0 = Release|Any CPU - {C8F2EDB6-BD6C-465F-B59F-2CEA33BD7FE6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C8F2EDB6-BD6C-465F-B59F-2CEA33BD7FE6}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C8F2EDB6-BD6C-465F-B59F-2CEA33BD7FE6}.Release|Any CPU.ActiveCfg = Release|Any CPU - {C8F2EDB6-BD6C-465F-B59F-2CEA33BD7FE6}.Release|Any CPU.Build.0 = Release|Any CPU + {EAF24520-33E2-458D-AD20-BCD9532DC78E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {EAF24520-33E2-458D-AD20-BCD9532DC78E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {EAF24520-33E2-458D-AD20-BCD9532DC78E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {EAF24520-33E2-458D-AD20-BCD9532DC78E}.Release|Any CPU.Build.0 = Release|Any CPU + {68D3E81C-B9F5-443B-89F2-DC430D0A2A17}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {68D3E81C-B9F5-443B-89F2-DC430D0A2A17}.Debug|Any CPU.Build.0 = Debug|Any CPU + {68D3E81C-B9F5-443B-89F2-DC430D0A2A17}.Release|Any CPU.ActiveCfg = Release|Any CPU + {68D3E81C-B9F5-443B-89F2-DC430D0A2A17}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {6F5D4665-4B9E-40D7-8CC1-DBD46FAEB755} + SolutionGuid = {24E7FCE7-6EEA-41F7-921A-B15A096E3867} EndGlobalSection EndGlobal diff --git a/GroupDocs.Editor.MVC.Test/EditorControllerTest.cs b/GroupDocs.Editor.MVC.Test/EditorControllerTest.cs index e3bd888..6763147 100644 --- a/GroupDocs.Editor.MVC.Test/EditorControllerTest.cs +++ b/GroupDocs.Editor.MVC.Test/EditorControllerTest.cs @@ -1,80 +1,55 @@ -using GroupDocs.Editor.MVC.Controllers; -using NUnit.Framework; -using System.Web.Routing; -using MvcContrib.TestHelper; -using Huygens; -using System; -using System.Collections.Generic; -using System.Text; -using Newtonsoft.Json; using GroupDocs.Editor.MVC.Products.Common.Entity.Web; +using GroupDocs.Editor.MVC.Products.Editor.Controllers; +using Microsoft.AspNetCore.Mvc; +using Microsoft.Extensions.Configuration; +using Moq; +using NUnit.Framework; -namespace GroupDocs.Editor.MVC.Test +namespace NUnitTestProject1 { - [TestFixture] - public static class EditorControllerTest { - + public class EditorControllerTest + { + Mock mockServerConfSection; + Mock mockCommonConfSection; + Mock mockConfig; + Mock mockPostedData; + EditorApiController controller; [SetUp] - public static void TestInitialize() - { - RouteConfig.RegisterRoutes(RouteTable.Routes); - } - - [TearDown] - public static void TearDown() + public void Setup() { - RouteTable.Routes.Clear(); + mockServerConfSection = new Mock(); + mockServerConfSection.SetupGet(m => m[It.Is(s => s == "HttpPort")]).Returns("8080"); + + mockCommonConfSection = new Mock(); + mockCommonConfSection.SetupGet(m => m[It.Is(s => s == "IsPageSelector")]).Returns("true"); + mockCommonConfSection.SetupGet(m => m[It.Is(s => s == "IsDownload")]).Returns("true"); + mockCommonConfSection.SetupGet(m => m[It.Is(s => s == "IsUpload")]).Returns("true"); + mockCommonConfSection.SetupGet(m => m[It.Is(s => s == "IsPrint")]).Returns("true"); + mockCommonConfSection.SetupGet(m => m[It.Is(s => s == "IsBrowse")]).Returns("true"); + mockCommonConfSection.SetupGet(m => m[It.Is(s => s == "IsRewrite")]).Returns("true"); + + mockConfig = new Mock(); + mockConfig.Setup(a => a.GetSection(It.Is(s => s == "ServerConfiguration"))).Returns(mockServerConfSection.Object); + mockConfig.Setup(a => a.GetSection(It.Is(s => s == "CommonConfiguration"))).Returns(mockCommonConfSection.Object); + + mockPostedData = new Mock(); + controller = new EditorApiController(mockConfig.Object); } [Test] - public static void ViewStatusTest() + public void LoadFileTree_ReturnsOkActionResult() { - string path = AppDomain.CurrentDomain.BaseDirectory + "/../../../src"; - using (var server = new DirectServer(path)) - { - var request = new SerialisableRequest - { - Method = "GET", - RequestUri = "/editor", - Content = null - }; + // Arrange - var result = server.DirectCall(request); - Assert.That(result.StatusCode, Is.EqualTo(200)); - } - } - [Test] - public static void ViewMapControllerTest() - { - "~/editor".Route().ShouldMapTo(x => x.Index()); - } - - [Test] - public static void FileTreeStatusCodeTest() - { - string path = AppDomain.CurrentDomain.BaseDirectory + "/../../../src"; - using (var server = new DirectServer(path)) - { + // Act + var result = controller.loadFileTree(mockPostedData.Object); + var okResult = result as OkObjectResult; - PostedDataEntity requestData = new PostedDataEntity(); - requestData.path = ""; - - var request = new SerialisableRequest - { - Method = "POST", - RequestUri = "/loadfiletree", - Content = Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(requestData)), - Headers = new Dictionary{ - { "Content-Type", "application/json"}, - { "Content-Length", JsonConvert.SerializeObject(requestData).Length.ToString()} - } - }; - - var result = server.DirectCall(request); - Assert.That(result.StatusCode, Is.EqualTo(200)); - } - } + // Assert + Assert.IsNotNull(okResult); + Assert.AreEqual(200, okResult.StatusCode); + } } -} +} \ No newline at end of file diff --git a/GroupDocs.Editor.MVC.Test/GroupDocs.Editor.MVC.Test.csproj b/GroupDocs.Editor.MVC.Test/GroupDocs.Editor.MVC.Test.csproj index 0219f8d..a7fab1b 100644 --- a/GroupDocs.Editor.MVC.Test/GroupDocs.Editor.MVC.Test.csproj +++ b/GroupDocs.Editor.MVC.Test/GroupDocs.Editor.MVC.Test.csproj @@ -1,222 +1,20 @@ - - - - - + + - Debug - AnyCPU - {C8F2EDB6-BD6C-465F-B59F-2CEA33BD7FE6} - Library - Properties - GroupDocs.Editor.MVC.Test - GroupDocs.Editor.MVC.Test - v4.6.1 - 512 - true - - + netcoreapp3.1 + + false - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - ..\packages\Antlr.3.4.1.9004\lib\Antlr3.Runtime.dll - - - ..\packages\Castle.Core.4.3.1\lib\net45\Castle.Core.dll - - - ..\packages\GroupDocs.Editor.19.5.0\lib\GroupDocs.Editor.dll - - - ..\packages\Huygens.1.4.5\lib\net46\Huygens.dll - - - ..\packages\Microsoft.Extensions.Configuration.2.1.1\lib\netstandard2.0\Microsoft.Extensions.Configuration.dll - - - ..\packages\Microsoft.Extensions.Configuration.Abstractions.2.1.1\lib\netstandard2.0\Microsoft.Extensions.Configuration.Abstractions.dll - - - ..\packages\Microsoft.Extensions.Configuration.Binder.2.1.1\lib\netstandard2.0\Microsoft.Extensions.Configuration.Binder.dll - - - ..\packages\Microsoft.Extensions.DependencyInjection.2.1.1\lib\net461\Microsoft.Extensions.DependencyInjection.dll - - - ..\packages\Microsoft.Extensions.DependencyInjection.Abstractions.2.1.1\lib\netstandard2.0\Microsoft.Extensions.DependencyInjection.Abstractions.dll - - - ..\packages\Microsoft.Extensions.Http.2.1.1\lib\netstandard2.0\Microsoft.Extensions.Http.dll - - - ..\packages\Microsoft.Extensions.Logging.2.1.1\lib\netstandard2.0\Microsoft.Extensions.Logging.dll - - - ..\packages\Microsoft.Extensions.Logging.Abstractions.2.1.1\lib\netstandard2.0\Microsoft.Extensions.Logging.Abstractions.dll - - - ..\packages\Microsoft.Extensions.Options.2.1.1\lib\netstandard2.0\Microsoft.Extensions.Options.dll - - - ..\packages\Microsoft.Extensions.Primitives.2.1.1\lib\netstandard2.0\Microsoft.Extensions.Primitives.dll - - - ..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll - - - ..\packages\Mvc2Futures.2.0.50217.0\lib\Microsoft.Web.Mvc.dll - - - ..\packages\Moq.4.10.1\lib\net45\Moq.dll - - - .\MvcContrib.TestHelper.dll - - - ..\packages\MvcIntegrationTestFramework.1.0.8\lib\net45\MvcIntegrationTestFramework.dll - - - ..\packages\MvcRouteTester.1.2.1\lib\net40\MvcRouteTester.dll - - - ..\packages\Newtonsoft.Json.12.0.1\lib\net45\Newtonsoft.Json.dll - - - ..\packages\NUnit.3.11.0\lib\net45\nunit.framework.dll - - - - ..\packages\System.Buffers.4.4.0\lib\netstandard2.0\System.Buffers.dll - - - - - ..\packages\System.Memory.4.5.1\lib\netstandard2.0\System.Memory.dll - - - ..\packages\System.Net.Http.4.3.3\lib\net46\System.Net.Http.dll - True - True - - - ..\packages\Microsoft.AspNet.WebApi.Client.5.2.7\lib\net45\System.Net.Http.Formatting.dll - - - - ..\packages\System.Numerics.Vectors.4.4.0\lib\net46\System.Numerics.Vectors.dll - - - ..\packages\System.Runtime.CompilerServices.Unsafe.4.5.1\lib\netstandard2.0\System.Runtime.CompilerServices.Unsafe.dll - - - ..\packages\System.Security.Cryptography.Algorithms.4.3.0\lib\net461\System.Security.Cryptography.Algorithms.dll - True - True - - - ..\packages\System.Security.Cryptography.Encoding.4.3.0\lib\net46\System.Security.Cryptography.Encoding.dll - True - True - - - ..\packages\System.Security.Cryptography.Primitives.4.3.0\lib\net46\System.Security.Cryptography.Primitives.dll - True - True - - - ..\packages\System.Security.Cryptography.X509Certificates.4.3.0\lib\net461\System.Security.Cryptography.X509Certificates.dll - True - True - - - ..\packages\System.Threading.Tasks.Extensions.4.5.1\lib\netstandard2.0\System.Threading.Tasks.Extensions.dll - - - ..\packages\System.ValueTuple.4.4.0\lib\net461\System.ValueTuple.dll - True - True - - - - ..\packages\Microsoft.AspNet.WebPages.3.2.7\lib\net45\System.Web.Helpers.dll - - - ..\packages\Microsoft.AspNet.WebApi.Core.5.2.7\lib\net45\System.Web.Http.dll - - - ..\packages\Microsoft.AspNet.WebApi.WebHost.5.2.7\lib\net45\System.Web.Http.WebHost.dll - - - ..\packages\Microsoft.AspNet.Mvc.5.2.3\lib\net45\System.Web.Mvc.dll - - - ..\packages\Microsoft.AspNet.Web.Optimization.1.1.3\lib\net40\System.Web.Optimization.dll - - - ..\packages\Microsoft.AspNet.Razor.3.2.7\lib\net45\System.Web.Razor.dll - - - ..\packages\Microsoft.AspNet.WebPages.3.2.7\lib\net45\System.Web.WebPages.dll - - - ..\packages\Microsoft.AspNet.WebPages.3.2.7\lib\net45\System.Web.WebPages.Deployment.dll - - - ..\packages\Microsoft.AspNet.WebPages.3.2.7\lib\net45\System.Web.WebPages.Razor.dll - - - - - - - - ..\packages\WebGrease.1.6.0\lib\WebGrease.dll - - - - - - - - - - + - + + + + + - - {a33ca8b0-a193-40a3-a86a-90ff444ee878} - GroupDocs.Editor.MVC - + - - - - Данный проект ссылается на пакеты NuGet, отсутствующие на этом компьютере. Используйте восстановление пакетов NuGet, чтобы скачать их. Дополнительную информацию см. по адресу: http://go.microsoft.com/fwlink/?LinkID=322105. Отсутствует следующий файл: {0}. - - - - - - - - - \ No newline at end of file + + diff --git a/GroupDocs.Editor.MVC.Test/MvcContrib.TestHelper.dll b/GroupDocs.Editor.MVC.Test/MvcContrib.TestHelper.dll deleted file mode 100644 index a7877ea..0000000 Binary files a/GroupDocs.Editor.MVC.Test/MvcContrib.TestHelper.dll and /dev/null differ diff --git a/GroupDocs.Editor.MVC.Test/Properties/AssemblyInfo.cs b/GroupDocs.Editor.MVC.Test/Properties/AssemblyInfo.cs deleted file mode 100644 index f7f61ce..0000000 --- a/GroupDocs.Editor.MVC.Test/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// Общие сведения об этой сборке предоставляются следующим набором -// набора атрибутов. Измените значения этих атрибутов, чтобы изменить сведения, -// связанные со сборкой. -[assembly: AssemblyTitle("GroupDocs.Editor.MVC.Test")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("GroupDocs.Editor.MVC.Test")] -[assembly: AssemblyCopyright("Copyright © 2018")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Установка значения False для параметра ComVisible делает типы в этой сборке невидимыми -// для компонентов COM. Если необходимо обратиться к типу в этой сборке через -// COM, задайте атрибуту ComVisible значение TRUE для этого типа. -[assembly: ComVisible(false)] - -// Следующий GUID служит для идентификации библиотеки типов, если этот проект будет видимым для COM -[assembly: Guid("c8f2edb6-bd6c-465f-b59f-2cea33bd7fe6")] - -// Сведения о версии сборки состоят из следующих четырех значений: -// -// Основной номер версии -// Дополнительный номер версии -// Номер сборки -// Редакция -// -// Можно задать все значения или принять номер сборки и номер редакции по умолчанию. -// используя "*", как показано ниже: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/GroupDocs.Editor.MVC.Test/app.config b/GroupDocs.Editor.MVC.Test/app.config deleted file mode 100644 index a7b7d9a..0000000 --- a/GroupDocs.Editor.MVC.Test/app.config +++ /dev/null @@ -1,83 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/GroupDocs.Editor.MVC.Test/packages.config b/GroupDocs.Editor.MVC.Test/packages.config deleted file mode 100644 index 7134b1c..0000000 --- a/GroupDocs.Editor.MVC.Test/packages.config +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/GroupDocs.Editor.MVC/AppDomainGenerator/DomainGenerator.cs b/GroupDocs.Editor.MVC/AppDomainGenerator/DomainGenerator.cs new file mode 100644 index 0000000..ff7ff59 --- /dev/null +++ b/GroupDocs.Editor.MVC/AppDomainGenerator/DomainGenerator.cs @@ -0,0 +1,31 @@ +using Microsoft.Extensions.Configuration; + +namespace GroupDocs.Editor.MVC.AppDomainGenerator +{ + /// + /// DomainGenerator + /// + public class DomainGenerator + { + private readonly Products.Common.Config.GlobalConfiguration globalConfiguration; + + /// + /// Constructor + /// + public DomainGenerator(string assemblyName, string className, IConfiguration config) + { + globalConfiguration = new Products.Common.Config.GlobalConfiguration(config); + } + + /// + /// Set GroupDocs.Editor license + /// + /// Type + public void SetEditorLicense() + { + // Initiate license class + License license = new License(); + license.SetLicense(globalConfiguration.GetApplicationConfiguration().GetLicensePath()); + } + } +} diff --git a/src/Controllers/EditorController.cs b/GroupDocs.Editor.MVC/Controllers/EditorController.cs similarity index 63% rename from src/Controllers/EditorController.cs rename to GroupDocs.Editor.MVC/Controllers/EditorController.cs index 5c53936..4faabab 100644 --- a/src/Controllers/EditorController.cs +++ b/GroupDocs.Editor.MVC/Controllers/EditorController.cs @@ -1,15 +1,12 @@ -using System.Web.Mvc; +using Microsoft.AspNetCore.Mvc; namespace GroupDocs.Editor.MVC.Controllers { - /// - /// Editor Web page controller - /// public class EditorController : Controller - { + { public ActionResult Index() { return View("Index"); } } -} \ No newline at end of file +} diff --git a/GroupDocs.Editor.MVC/GroupDocs.Editor.MVC.csproj b/GroupDocs.Editor.MVC/GroupDocs.Editor.MVC.csproj new file mode 100644 index 0000000..c5d61e2 --- /dev/null +++ b/GroupDocs.Editor.MVC/GroupDocs.Editor.MVC.csproj @@ -0,0 +1,39 @@ + + + + netcoreapp3.1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Products/Common/Config/ApplicationConfiguration.cs b/GroupDocs.Editor.MVC/Products/Common/Config/ApplicationConfiguration.cs similarity index 71% rename from src/Products/Common/Config/ApplicationConfiguration.cs rename to GroupDocs.Editor.MVC/Products/Common/Config/ApplicationConfiguration.cs index 0839af1..6239cce 100644 --- a/src/Products/Common/Config/ApplicationConfiguration.cs +++ b/GroupDocs.Editor.MVC/Products/Common/Config/ApplicationConfiguration.cs @@ -1,8 +1,5 @@ using GroupDocs.Editor.MVC.Products.Common.Util.Parser; using System; -using System.Collections.Generic; -using System.Collections.Specialized; -using System.Configuration; using System.Diagnostics; using System.IO; using System.Linq; @@ -24,23 +21,28 @@ public ApplicationConfiguration() YamlParser parser = new YamlParser(); dynamic configuration = parser.GetConfiguration("application"); ConfigurationValuesGetter valuesGetter = new ConfigurationValuesGetter(configuration); - string license = valuesGetter.GetStringPropertyValue("licensePath"); - if (String.IsNullOrEmpty(license)) + string licPath = valuesGetter.GetStringPropertyValue("licensePath"); + var appRoot = AppContext.BaseDirectory.Substring(0, AppContext.BaseDirectory.LastIndexOf("bin")); + + if (String.IsNullOrEmpty(licPath)) { - string[] files = System.IO.Directory.GetFiles(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, LicensePath), "*.lic"); + // TODO: check for more cross-platform solution + + var licenseDirectory = Path.Combine(appRoot, licPath); + string[] files = Directory.GetFiles(licenseDirectory, "*.lic"); LicensePath = Path.Combine(LicensePath, files[0]); } else { - if (!IsFullPath(license)) + if (!IsFullPath(licPath)) { - license = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, license); - if (!Directory.Exists(Path.GetDirectoryName(license))) + licPath = Path.Combine(appRoot, licPath); + if (!Directory.Exists(Path.GetDirectoryName(licPath))) { - Directory.CreateDirectory(Path.GetDirectoryName(license)); + Directory.CreateDirectory(Path.GetDirectoryName(licPath)); } } - LicensePath = license; + LicensePath = licPath; if (!File.Exists(LicensePath)) { Debug.WriteLine("License file path is incorrect, launched in trial mode"); @@ -52,7 +54,7 @@ public ApplicationConfiguration() private static bool IsFullPath(string path) { return !String.IsNullOrWhiteSpace(path) - && path.IndexOfAny(System.IO.Path.GetInvalidPathChars().ToArray()) == -1 + && path.IndexOfAny(Path.GetInvalidPathChars().ToArray()) == -1 && Path.IsPathRooted(path) && !Path.GetPathRoot(path).Equals(Path.DirectorySeparatorChar.ToString(), StringComparison.Ordinal); } diff --git a/src/Products/Common/Config/CommonConfiguration.cs b/GroupDocs.Editor.MVC/Products/Common/Config/CommonConfiguration.cs similarity index 65% rename from src/Products/Common/Config/CommonConfiguration.cs rename to GroupDocs.Editor.MVC/Products/Common/Config/CommonConfiguration.cs index 3cf28ee..fec2734 100644 --- a/src/Products/Common/Config/CommonConfiguration.cs +++ b/GroupDocs.Editor.MVC/Products/Common/Config/CommonConfiguration.cs @@ -1,15 +1,14 @@ using GroupDocs.Editor.MVC.Products.Common.Util.Parser; +using Microsoft.Extensions.Configuration; using Newtonsoft.Json; using System; -using System.Collections.Specialized; -using System.Configuration; namespace GroupDocs.Editor.MVC.Products.Common.Config { /// /// CommonConfiguration /// - public class CommonConfiguration : ConfigurationSection + public class CommonConfiguration { [JsonProperty] public bool pageSelector { get; set; } @@ -31,23 +30,26 @@ public class CommonConfiguration : ConfigurationSection [JsonProperty] public bool enableRightClick { get; set; } - private readonly NameValueCollection commonConfiguration = (NameValueCollection)System.Configuration.ConfigurationManager.GetSection("commonConfiguration"); + + private IConfigurationSection CommonConfig { get; set; } /// /// Constructor /// - public CommonConfiguration() + public CommonConfiguration(IConfiguration config) { + CommonConfig = config.GetSection("CommonConfiguration"); + YamlParser parser = new YamlParser(); dynamic configuration = parser.GetConfiguration("common"); ConfigurationValuesGetter valuesGetter = new ConfigurationValuesGetter(configuration); - pageSelector = valuesGetter.GetBooleanPropertyValue("pageSelector", Convert.ToBoolean(commonConfiguration["isPageSelector"])); - download = valuesGetter.GetBooleanPropertyValue("download", Convert.ToBoolean(commonConfiguration["isDownload"])); - upload = valuesGetter.GetBooleanPropertyValue("upload", Convert.ToBoolean(commonConfiguration["isUpload"])); - print = valuesGetter.GetBooleanPropertyValue("print", Convert.ToBoolean(commonConfiguration["isPrint"])); - browse = valuesGetter.GetBooleanPropertyValue("browse", Convert.ToBoolean(commonConfiguration["isBrowse"])); - rewrite = valuesGetter.GetBooleanPropertyValue("rewrite", Convert.ToBoolean(commonConfiguration["isRewrite"])); - enableRightClick = valuesGetter.GetBooleanPropertyValue("enableRightClick", Convert.ToBoolean(commonConfiguration["enableRightClick"])); + pageSelector = valuesGetter.GetBooleanPropertyValue("pageSelector", Convert.ToBoolean(CommonConfig["IsPageSelector"])); + download = valuesGetter.GetBooleanPropertyValue("download", Convert.ToBoolean(CommonConfig["IsDownload"])); + upload = valuesGetter.GetBooleanPropertyValue("upload", Convert.ToBoolean(CommonConfig["IsUpload"])); + print = valuesGetter.GetBooleanPropertyValue("print", Convert.ToBoolean(CommonConfig["IsPrint"])); + browse = valuesGetter.GetBooleanPropertyValue("browse", Convert.ToBoolean(CommonConfig["IsBrowse"])); + rewrite = valuesGetter.GetBooleanPropertyValue("rewrite", Convert.ToBoolean(CommonConfig["IsRewrite"])); + enableRightClick = valuesGetter.GetBooleanPropertyValue("enableRightClick", Convert.ToBoolean(CommonConfig["EnableRightClick"])); } } } \ No newline at end of file diff --git a/src/Products/Common/Config/ConfigurationValuesGetter.cs b/GroupDocs.Editor.MVC/Products/Common/Config/ConfigurationValuesGetter.cs similarity index 100% rename from src/Products/Common/Config/ConfigurationValuesGetter.cs rename to GroupDocs.Editor.MVC/Products/Common/Config/ConfigurationValuesGetter.cs diff --git a/src/Products/Common/Config/GlobalConfiguration.cs b/GroupDocs.Editor.MVC/Products/Common/Config/GlobalConfiguration.cs similarity index 80% rename from src/Products/Common/Config/GlobalConfiguration.cs rename to GroupDocs.Editor.MVC/Products/Common/Config/GlobalConfiguration.cs index 0f62359..8b6245b 100644 --- a/src/Products/Common/Config/GlobalConfiguration.cs +++ b/GroupDocs.Editor.MVC/Products/Common/Config/GlobalConfiguration.cs @@ -1,4 +1,5 @@ using GroupDocs.Editor.MVC.Products.Editor.Config; +using Microsoft.Extensions.Configuration; namespace GroupDocs.Editor.MVC.Products.Common.Config { @@ -15,12 +16,12 @@ public class GlobalConfiguration /// /// Get all configurations /// - public GlobalConfiguration() + public GlobalConfiguration(IConfiguration config) { - Server = new ServerConfiguration(); + Server = new ServerConfiguration(config); Application = new ApplicationConfiguration(); - Common = new CommonConfiguration(); - Editor = new EditorConfiguration(); + Common = new CommonConfiguration(config); + Editor = new EditorConfiguration(config); } public EditorConfiguration GetEditorConfiguration() diff --git a/src/Products/Common/Config/ServerConfiguration.cs b/GroupDocs.Editor.MVC/Products/Common/Config/ServerConfiguration.cs similarity index 58% rename from src/Products/Common/Config/ServerConfiguration.cs rename to GroupDocs.Editor.MVC/Products/Common/Config/ServerConfiguration.cs index 1050ad1..63b127e 100644 --- a/src/Products/Common/Config/ServerConfiguration.cs +++ b/GroupDocs.Editor.MVC/Products/Common/Config/ServerConfiguration.cs @@ -1,29 +1,31 @@ using GroupDocs.Editor.MVC.Products.Common.Util.Parser; +using Microsoft.Extensions.Configuration; using System; -using System.Collections.Specialized; -using System.Configuration; namespace GroupDocs.Editor.MVC.Products.Common.Config { /// /// Server configuration /// - public class ServerConfiguration : ConfigurationSection + public class ServerConfiguration { public int HttpPort { get; set; } public string HostAddress { get; set; } - private readonly NameValueCollection serverConfiguration = (NameValueCollection)System.Configuration.ConfigurationManager.GetSection("serverConfiguration"); + private IConfigurationSection ServerConfig { get; set; } /// - /// Get server configuration section of the web.config + /// Get server configuration section of the appsettings.json /// - public ServerConfiguration() { + public ServerConfiguration(IConfiguration config) { + ServerConfig = config.GetSection("ServerConfiguration"); + YamlParser parser = new YamlParser(); dynamic configuration = parser.GetConfiguration("server"); ConfigurationValuesGetter valuesGetter = new ConfigurationValuesGetter(configuration); - int defaultPort = Convert.ToInt32(serverConfiguration["httpPort"]); + int defaultPort = Convert.ToInt32(ServerConfig["HttpPort"]); + HttpPort = valuesGetter.GetIntegerPropertyValue("connector", defaultPort, "port"); - HostAddress = valuesGetter.GetStringPropertyValue("hostAddress", serverConfiguration["hostAddress"]); + HostAddress = valuesGetter.GetStringPropertyValue("hostAddress", ServerConfig["HostAddress"]); } } } \ No newline at end of file diff --git a/src/Products/Common/Entity/Web/ExceptionEntity.cs b/GroupDocs.Editor.MVC/Products/Common/Entity/Web/ExceptionEntity.cs similarity index 100% rename from src/Products/Common/Entity/Web/ExceptionEntity.cs rename to GroupDocs.Editor.MVC/Products/Common/Entity/Web/ExceptionEntity.cs diff --git a/src/Products/Common/Entity/Web/FileDescriptionEntity.cs b/GroupDocs.Editor.MVC/Products/Common/Entity/Web/FileDescriptionEntity.cs similarity index 73% rename from src/Products/Common/Entity/Web/FileDescriptionEntity.cs rename to GroupDocs.Editor.MVC/Products/Common/Entity/Web/FileDescriptionEntity.cs index 763bd9e..e5ca96e 100644 --- a/src/Products/Common/Entity/Web/FileDescriptionEntity.cs +++ b/GroupDocs.Editor.MVC/Products/Common/Entity/Web/FileDescriptionEntity.cs @@ -1,4 +1,6 @@  +using Newtonsoft.Json; + namespace GroupDocs.Editor.MVC.Products.Common.Entity.Web { /// @@ -6,10 +8,15 @@ namespace GroupDocs.Editor.MVC.Products.Common.Entity.Web /// public class FileDescriptionEntity { + [JsonProperty] public string guid{ get; set; } + [JsonProperty] public string name{ get; set; } + [JsonProperty] public string docType{ get; set; } + [JsonProperty] public bool isDirectory{ get; set; } + [JsonProperty] public long size{ get; set; } } } \ No newline at end of file diff --git a/src/Products/Common/Entity/Web/LoadDocumentEntity.cs b/GroupDocs.Editor.MVC/Products/Common/Entity/Web/LoadDocumentEntity.cs similarity index 100% rename from src/Products/Common/Entity/Web/LoadDocumentEntity.cs rename to GroupDocs.Editor.MVC/Products/Common/Entity/Web/LoadDocumentEntity.cs diff --git a/src/Products/Common/Entity/Web/PageDescriptionEntity.cs b/GroupDocs.Editor.MVC/Products/Common/Entity/Web/PageDescriptionEntity.cs similarity index 100% rename from src/Products/Common/Entity/Web/PageDescriptionEntity.cs rename to GroupDocs.Editor.MVC/Products/Common/Entity/Web/PageDescriptionEntity.cs diff --git a/src/Products/Common/Entity/Web/PostedDataEntity.cs b/GroupDocs.Editor.MVC/Products/Common/Entity/Web/PostedDataEntity.cs similarity index 100% rename from src/Products/Common/Entity/Web/PostedDataEntity.cs rename to GroupDocs.Editor.MVC/Products/Common/Entity/Web/PostedDataEntity.cs diff --git a/src/Products/Common/Entity/Web/UploadedDocumentEntity.cs b/GroupDocs.Editor.MVC/Products/Common/Entity/Web/UploadedDocumentEntity.cs similarity index 100% rename from src/Products/Common/Entity/Web/UploadedDocumentEntity.cs rename to GroupDocs.Editor.MVC/Products/Common/Entity/Web/UploadedDocumentEntity.cs diff --git a/src/Products/Common/Resources/Resources.cs b/GroupDocs.Editor.MVC/Products/Common/Resources/Resources.cs similarity index 100% rename from src/Products/Common/Resources/Resources.cs rename to GroupDocs.Editor.MVC/Products/Common/Resources/Resources.cs diff --git a/src/Products/Common/Util/Comparator/FileDateComparator.cs b/GroupDocs.Editor.MVC/Products/Common/Util/Comparator/FileDateComparator.cs similarity index 100% rename from src/Products/Common/Util/Comparator/FileDateComparator.cs rename to GroupDocs.Editor.MVC/Products/Common/Util/Comparator/FileDateComparator.cs diff --git a/src/Products/Common/Util/Comparator/FileNameComparator.cs b/GroupDocs.Editor.MVC/Products/Common/Util/Comparator/FileNameComparator.cs similarity index 100% rename from src/Products/Common/Util/Comparator/FileNameComparator.cs rename to GroupDocs.Editor.MVC/Products/Common/Util/Comparator/FileNameComparator.cs diff --git a/src/Products/Common/Util/Comparator/FileTypeComparator.cs b/GroupDocs.Editor.MVC/Products/Common/Util/Comparator/FileTypeComparator.cs similarity index 100% rename from src/Products/Common/Util/Comparator/FileTypeComparator.cs rename to GroupDocs.Editor.MVC/Products/Common/Util/Comparator/FileTypeComparator.cs diff --git a/src/Products/Common/Util/Directory/IDirectoryUtils.cs b/GroupDocs.Editor.MVC/Products/Common/Util/Directory/IDirectoryUtils.cs similarity index 100% rename from src/Products/Common/Util/Directory/IDirectoryUtils.cs rename to GroupDocs.Editor.MVC/Products/Common/Util/Directory/IDirectoryUtils.cs diff --git a/src/Products/Common/Util/Parser/YamlParser.cs b/GroupDocs.Editor.MVC/Products/Common/Util/Parser/YamlParser.cs similarity index 86% rename from src/Products/Common/Util/Parser/YamlParser.cs rename to GroupDocs.Editor.MVC/Products/Common/Util/Parser/YamlParser.cs index 731e9db..17a8236 100644 --- a/src/Products/Common/Util/Parser/YamlParser.cs +++ b/GroupDocs.Editor.MVC/Products/Common/Util/Parser/YamlParser.cs @@ -10,7 +10,8 @@ namespace GroupDocs.Editor.MVC.Products.Common.Util.Parser { public class YamlParser { - private static string YamlPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "configuration.yml"); + private static string appRoot = AppContext.BaseDirectory.Substring(0, AppContext.BaseDirectory.LastIndexOf("bin")); + private static string YamlPath = Path.Combine(appRoot, "configuration.yml"); private readonly dynamic ConfiguationData; public YamlParser() diff --git a/src/Products/Editor/Config/EditorConfiguration.cs b/GroupDocs.Editor.MVC/Products/Editor/Config/EditorConfiguration.cs similarity index 86% rename from src/Products/Editor/Config/EditorConfiguration.cs rename to GroupDocs.Editor.MVC/Products/Editor/Config/EditorConfiguration.cs index 2d5118e..921bbb7 100644 --- a/src/Products/Editor/Config/EditorConfiguration.cs +++ b/GroupDocs.Editor.MVC/Products/Editor/Config/EditorConfiguration.cs @@ -1,5 +1,6 @@ using GroupDocs.Editor.MVC.Products.Common.Config; using GroupDocs.Editor.MVC.Products.Common.Util.Parser; +using Microsoft.Extensions.Configuration; using Newtonsoft.Json; using System; using System.IO; @@ -27,7 +28,7 @@ public class EditorConfiguration : CommonConfiguration /// /// Constructor /// - public EditorConfiguration() + public EditorConfiguration(IConfiguration config) : base(config) { YamlParser parser = new YamlParser(); dynamic configuration = parser.GetConfiguration("editor"); @@ -37,7 +38,9 @@ public EditorConfiguration() filesDirectory = valuesGetter.GetStringPropertyValue("filesDirectory", filesDirectory); if (!IsFullPath(filesDirectory)) { - filesDirectory = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, filesDirectory); + // TODO: check for more cross-platform solution + var appRoot = AppContext.BaseDirectory.Substring(0, AppContext.BaseDirectory.LastIndexOf("bin")); + filesDirectory = Path.Combine(appRoot, filesDirectory); if (!Directory.Exists(filesDirectory)) { Directory.CreateDirectory(filesDirectory); @@ -51,7 +54,7 @@ public EditorConfiguration() private static bool IsFullPath(string path) { return !String.IsNullOrWhiteSpace(path) - && path.IndexOfAny(System.IO.Path.GetInvalidPathChars().ToArray()) == -1 + && path.IndexOfAny(Path.GetInvalidPathChars().ToArray()) == -1 && Path.IsPathRooted(path) && !Path.GetPathRoot(path).Equals(Path.DirectorySeparatorChar.ToString(), StringComparison.Ordinal); } diff --git a/src/Products/Editor/Controllers/EditorApiController.cs b/GroupDocs.Editor.MVC/Products/Editor/Controllers/EditorApiController.cs similarity index 60% rename from src/Products/Editor/Controllers/EditorApiController.cs rename to GroupDocs.Editor.MVC/Products/Editor/Controllers/EditorApiController.cs index 406d6f6..9174ad9 100644 --- a/src/Products/Editor/Controllers/EditorApiController.cs +++ b/GroupDocs.Editor.MVC/Products/Editor/Controllers/EditorApiController.cs @@ -5,26 +5,33 @@ using GroupDocs.Editor.MVC.Products.Editor.Config; using System; using System.Collections.Generic; -using System.Globalization; using System.IO; using System.Net; using System.Net.Http; using System.Net.Http.Headers; -using System.Web; -using System.Web.Http; -using System.Web.Http.Cors; using GroupDocs.Editor.MVC.Products.Editor.Entity.Web.Request; +using GroupDocs.Editor.Formats; +using System.Globalization; +using Microsoft.AspNetCore.Cors; +using Microsoft.AspNetCore.Mvc; +using Newtonsoft.Json; +using Microsoft.AspNetCore.Http; +using Microsoft.Extensions.Configuration; namespace GroupDocs.Editor.MVC.Products.Editor.Controllers { /// /// EditorApiController /// - [EnableCors(origins: "*", headers: "*", methods: "*")] - public class EditorApiController : ApiController + [EnableCors] + public class EditorApiController : ControllerBase { + private readonly Common.Config.GlobalConfiguration globalConfiguration; - private static Common.Config.GlobalConfiguration globalConfiguration = new Common.Config.GlobalConfiguration(); + public EditorApiController(IConfiguration _config) + { + globalConfiguration = new Common.Config.GlobalConfiguration(_config); + } /// /// Load Viewr configuration @@ -43,11 +50,14 @@ public EditorConfiguration LoadConfig() /// Post data /// List of files and directories [HttpPost] + [ProducesResponseType(StatusCodes.Status200OK)] + [ProducesResponseType(StatusCodes.Status500InternalServerError)] [Route("loadFileTree")] - public HttpResponseMessage loadFileTree(PostedDataEntity postedData) + public IActionResult loadFileTree(PostedDataEntity postedData) { // get request body string relDirPath = postedData.path; + // get file list from storage path try { @@ -95,11 +105,12 @@ public HttpResponseMessage loadFileTree(PostedDataEntity postedData) fileList.Add(fileDescription); } } - return Request.CreateResponse(HttpStatusCode.OK, fileList); + + return Ok(JsonConvert.SerializeObject(fileList)); } - catch (System.Exception ex) + catch (Exception ex) { - return Request.CreateResponse(HttpStatusCode.InternalServerError, new Resources().GenerateException(ex)); + return StatusCode(500, new Resources().GenerateException(ex)); } } @@ -120,19 +131,27 @@ public List LoadFormats() /// Post data /// Document info object [HttpPost] + [ProducesResponseType(StatusCodes.Status200OK)] + [ProducesResponseType(StatusCodes.Status500InternalServerError)] + [ProducesResponseType(StatusCodes.Status403Forbidden)] [Route("loadDocumentDescription")] - public HttpResponseMessage LoadDocumentDescription(PostedDataEntity postedData) + public IActionResult LoadDocumentDescription([FromBody] PostedDataEntity postedData) { try { LoadDocumentEntity loadDocumentEntity = LoadDocument(postedData.guid, postedData.password); // return document description - return Request.CreateResponse(HttpStatusCode.OK, loadDocumentEntity); + return Ok(JsonConvert.SerializeObject(loadDocumentEntity)); } - catch (System.Exception ex) + catch (PasswordRequiredException ex) { // set exception message - return Request.CreateResponse(HttpStatusCode.Forbidden, new Resources().GenerateException(ex, postedData.password)); + return StatusCode(403, new Resources().GenerateException(ex, postedData.password)); + } + catch (Exception ex) + { + // set exception message + return StatusCode(500, new Resources().GenerateException(ex, postedData.password)); } } @@ -147,7 +166,7 @@ public HttpResponseMessage DownloadDocument(string path) { if (!string.IsNullOrEmpty(path)) { - if (File.Exists(path)) + if (System.IO.File.Exists(path)) { HttpResponseMessage response = new HttpResponseMessage(HttpStatusCode.OK); var fileStream = new FileStream(path, FileMode.Open); @@ -167,22 +186,24 @@ public HttpResponseMessage DownloadDocument(string path) /// Post data /// Uploaded document object [HttpPost] + [ProducesResponseType(StatusCodes.Status200OK)] + [ProducesResponseType(StatusCodes.Status500InternalServerError)] [Route("uploadDocument")] - public HttpResponseMessage UploadDocument() + public IActionResult UploadDocument() { try { - string url = HttpContext.Current.Request.Form["url"]; + string url = HttpContext.Request.Form["url"]; // get documents storage path string documentStoragePath = globalConfiguration.GetEditorConfiguration().GetFilesDirectory(); - bool rewrite = bool.Parse(HttpContext.Current.Request.Form["rewrite"]); + bool rewrite = bool.Parse(HttpContext.Request.Form["rewrite"]); string fileSavePath = ""; if (string.IsNullOrEmpty(url)) { - if (HttpContext.Current.Request.Files.AllKeys != null) + if (HttpContext.Request.Form.Files.Count > 0) { // Get the uploaded document from the Files collection - var httpPostedFile = HttpContext.Current.Request.Files["file"]; + var httpPostedFile = HttpContext.Request.Form.Files["file"]; if (httpPostedFile != null) { if (rewrite) @@ -196,7 +217,10 @@ public HttpResponseMessage UploadDocument() } // Save the uploaded file to "UploadedFiles" folder - httpPostedFile.SaveAs(fileSavePath); + using (var fileStream = new FileStream(fileSavePath, FileMode.Create)) + { + httpPostedFile.CopyToAsync(fileStream); + } } } } @@ -222,12 +246,13 @@ public HttpResponseMessage UploadDocument() } UploadedDocumentEntity uploadedDocument = new UploadedDocumentEntity(); uploadedDocument.guid = fileSavePath; - return Request.CreateResponse(HttpStatusCode.OK, uploadedDocument); + + return Ok(JsonConvert.SerializeObject(uploadedDocument)); } - catch (System.Exception ex) + catch (Exception ex) { // set exception message - return Request.CreateResponse(HttpStatusCode.InternalServerError, new Resources().GenerateException(ex)); + return StatusCode(500, new Resources().GenerateException(ex)); } } @@ -237,40 +262,67 @@ public HttpResponseMessage UploadDocument() /// Post data /// Document info object [HttpPost] + [ProducesResponseType(StatusCodes.Status200OK)] + [ProducesResponseType(StatusCodes.Status500InternalServerError)] [Route("saveFile")] - public HttpResponseMessage SaveFile(EditDocumentRequest postedData) + public IActionResult SaveFile([FromBody] EditDocumentRequest postedData) { try { string htmlContent = postedData.getContent(); // Initialize with HTML markup of the edited document - string saveFilePath = Path.Combine(globalConfiguration.GetEditorConfiguration().GetFilesDirectory(), postedData.GetGuid()); - if (File.Exists(saveFilePath)) - { - File.Delete(saveFilePath); - } - using (OutputHtmlDocument editedHtmlDoc = new OutputHtmlDocument(htmlContent, null)) + string tempFilename = Path.GetFileNameWithoutExtension(saveFilePath) + "_tmp"; + string tempPath = Path.Combine(Path.GetDirectoryName(saveFilePath), tempFilename + Path.GetExtension(saveFilePath)); + + ILoadOptions loadOptions = GetLoadOptions(postedData.GetGuid()); + loadOptions.Password = postedData.getPassword(); + + // Instantiate Editor object by loading the input file + using (GroupDocs.Editor.Editor editor = new GroupDocs.Editor.Editor(postedData.GetGuid(), delegate { return loadOptions; })) { - dynamic options = GetSaveOptions(saveFilePath); - if (options.GetType().Equals(typeof(WordProcessingSaveOptions))) + dynamic editOptions = GetEditOptions(postedData.GetGuid()); + + if (editOptions is WordProcessingEditOptions) { - options.EnablePagination = true; + editOptions.EnablePagination = true; + editOptions.FontExtraction = FontExtractionOptions.ExtractEmbeddedWithoutSystem; + editOptions.EnableLanguageInformation = true; } - options.Password = postedData.getPassword(); - options.OutputFormat = GetSaveFormat(saveFilePath); - using (System.IO.FileStream outputStream = System.IO.File.Create(saveFilePath)) + + using (EditableDocument beforeEdit = editor.Edit(editOptions)) { - EditorHandler.ToDocument(editedHtmlDoc, outputStream, options); + EditableDocument htmlContentDoc = EditableDocument.FromMarkup(htmlContent, null); + + dynamic saveOptions = GetSaveOptions(postedData.GetGuid()); + saveOptions.Password = postedData.getPassword(); + + if (saveOptions is WordProcessingSaveOptions) + { + saveOptions.EnablePagination = true; + } + + using (FileStream outputStream = System.IO.File.Create(tempPath)) + { + editor.Save(htmlContentDoc, outputStream, saveOptions); + } } } + + if (System.IO.File.Exists(saveFilePath)) + { + System.IO.File.Delete(saveFilePath); + } + + System.IO.File.Move(tempPath, saveFilePath); + LoadDocumentEntity loadDocumentEntity = LoadDocument(saveFilePath, postedData.getPassword()); // return document description - return Request.CreateResponse(HttpStatusCode.OK, loadDocumentEntity); + return Ok(JsonConvert.SerializeObject(loadDocumentEntity)); } - catch (System.Exception ex) + catch (Exception ex) { // set exception message - return Request.CreateResponse(HttpStatusCode.Forbidden, new Resources().GenerateException(ex, postedData.getPassword())); + return StatusCode(500, new Resources().GenerateException(ex, postedData.getPassword())); } } @@ -279,6 +331,7 @@ private dynamic GetSaveFormat(string saveFilePath) string extension = Path.GetExtension(saveFilePath).Replace(".", ""); extension = CultureInfo.CurrentCulture.TextInfo.ToTitleCase(extension); dynamic format = null; + switch (extension) { @@ -309,30 +362,15 @@ private dynamic GetSaveFormat(string saveFilePath) case "Ott": format = WordProcessingFormats.Ott; break; - case "txt": - format = WordProcessingFormats.Text; - break; - case "Html": - format = WordProcessingFormats.Html; - break; - case "Mhtml": - format = WordProcessingFormats.Mhtml; - break; case "WordML": format = WordProcessingFormats.WordML; break; - case "Csv": - format = SpreadsheetFormats.Csv; - break; case "Ods": format = SpreadsheetFormats.Ods; break; case "SpreadsheetML": format = SpreadsheetFormats.SpreadsheetML; break; - case "TabDelimited": - format = SpreadsheetFormats.TabDelimited; - break; case "Xls": format = SpreadsheetFormats.Xls; break; @@ -354,114 +392,179 @@ private dynamic GetSaveFormat(string saveFilePath) default: format = WordProcessingFormats.Docx; break; - } + return format; } - private dynamic GetSaveOptions(string saveFilePath) + private ILoadOptions GetLoadOptions(string guid) { - string extension = Path.GetExtension(saveFilePath).Replace(".", ""); + string extension = Path.GetExtension(guid).Replace(".", ""); extension = CultureInfo.CurrentCulture.TextInfo.ToTitleCase(extension); + if (extension.Equals("Txt")) { extension = "Text"; } - dynamic options = null; - foreach (var item in Enum.GetNames(typeof(WordProcessingFormats))) + + ILoadOptions options = null; + + foreach (var item in typeof(WordProcessingFormats).GetFields()) { - if (item.Equals("Auto")) + if (item.Name.Equals("Auto")) { continue; } - if (item.Equals(extension)) + + if (item.Name.Equals(extension)) { - options = new WordProcessingSaveOptions(); + options = new WordProcessingLoadOptions(); break; } } + if (options == null) { - options = new SpreadsheetSaveOptions(); + options = new SpreadsheetLoadOptions(); } + return options; } - private static List PrepareFormats() + private IEditOptions GetEditOptions(string guid) { - List outputListItems = new List(); + string extension = Path.GetExtension(guid).Replace(".", ""); + extension = CultureInfo.CurrentCulture.TextInfo.ToTitleCase(extension); + + if (extension.Equals("Txt")) + { + extension = "Text"; + } + + IEditOptions options = null; - foreach (var item in Enum.GetNames(typeof(WordProcessingFormats))) + foreach (var item in typeof(WordProcessingFormats).GetFields()) { - if (item.Equals("Auto")) + if (item.Name.Equals("Auto")) { continue; } - if (item.Equals("Text")) - { - outputListItems.Add("Txt"); - } - else + + if (item.Name.Equals(extension)) { - outputListItems.Add(item); + options = new WordProcessingEditOptions(); + break; } + } + if (options == null) + { + options = new SpreadsheetEditOptions(); } - foreach (var item in Enum.GetNames(typeof(SpreadsheetFormats))) + return options; + } + + private ISaveOptions GetSaveOptions(string saveFilePath) + { + string extension = Path.GetExtension(saveFilePath).Replace(".", ""); + extension = CultureInfo.CurrentCulture.TextInfo.ToTitleCase(extension); + + if (extension.Equals("Txt")) { - if (item.Equals("Auto")) + extension = "Text"; + } + + ISaveOptions options = null; + + foreach (var item in typeof(WordProcessingFormats).GetFields()) + { + if (item.Name.Equals("Auto")) { continue; } - outputListItems.Add(item); + + if (item.Name.Equals(extension)) + { + options = new WordProcessingSaveOptions(WordProcessingFormats.Docm); + break; + } } - return outputListItems; + if (options == null) + { + options = new SpreadsheetSaveOptions(SpreadsheetFormats.Xlsb); + } + + return options; } - private LoadDocumentEntity LoadDocument(string guid, string password) + private static List PrepareFormats() { - try + List outputListItems = new List(); + + foreach (var item in typeof(WordProcessingFormats).GetFields()) { - dynamic options = null; - //GroupDocs.Editor cannot detect text-based Cells documents formats (like CSV) automatically - if (guid.EndsWith("csv", StringComparison.OrdinalIgnoreCase)) + if (item.Name.Equals("Auto")) { - options = new SpreadsheetToHtmlOptions(); + continue; } - else + + if (item.Name.Equals("Text")) { - options = EditorHandler.DetectOptionsFromExtension(guid); + outputListItems.Add("Txt"); } - if (options is SpreadsheetToHtmlOptions) + else { - options.TextOptions = new SpreadsheetToHtmlOptions.TextLoadOptions(","); + outputListItems.Add(item.Name); } - else + } + + foreach (var item in typeof(SpreadsheetFormats).GetFields()) + { + if (item.Name.Equals("Auto")) { - options.Password = password; + continue; } - string bodyContent; - using (System.IO.FileStream inputDoc = System.IO.File.OpenRead(guid)) + outputListItems.Add(item.Name); + } + + return outputListItems; + } - using (InputHtmlDocument htmlDoc = EditorHandler.ToHtml(inputDoc, options)) + private LoadDocumentEntity LoadDocument(string guid, string password) + { + LoadDocumentEntity loadDocumentEntity = new LoadDocumentEntity(); + ILoadOptions loadOptions = GetLoadOptions(guid); + loadOptions.Password = password; + + // Instantiate Editor object by loading the input file + using (GroupDocs.Editor.Editor editor = new GroupDocs.Editor.Editor(guid, delegate { return loadOptions; })) + { + dynamic editOptions = GetEditOptions(guid); + if (editOptions is WordProcessingEditOptions) { - bodyContent = htmlDoc.GetEmbeddedHtml(); + editOptions.EnablePagination = true; } - LoadDocumentEntity loadDocumentEntity = new LoadDocumentEntity(); - loadDocumentEntity.SetGuid(System.IO.Path.GetFileName(guid)); + + // Open input document for edit — obtain an intermediate document, that can be edited + EditableDocument beforeEdit = editor.Edit(editOptions); + + // Get document as a single base64-encoded string, where all resources (images, fonts, etc) + // are embedded inside this string along with main textual content + string allEmbeddedInsideString = beforeEdit.GetEmbeddedHtml(); + + loadDocumentEntity.SetGuid(guid); PageDescriptionEntity page = new PageDescriptionEntity(); - page.SetData(bodyContent); + page.SetData(allEmbeddedInsideString); loadDocumentEntity.SetPages(page); - return loadDocumentEntity; - } - catch - { - throw; + + beforeEdit.Dispose(); } + + return loadDocumentEntity; } } } \ No newline at end of file diff --git a/src/Products/Editor/Entity/Web/EditableDocumentType.cs b/GroupDocs.Editor.MVC/Products/Editor/Entity/Web/EditableDocumentType.cs similarity index 100% rename from src/Products/Editor/Entity/Web/EditableDocumentType.cs rename to GroupDocs.Editor.MVC/Products/Editor/Entity/Web/EditableDocumentType.cs diff --git a/src/Products/Editor/Entity/Web/Request/EditDocumentRequest.cs b/GroupDocs.Editor.MVC/Products/Editor/Entity/Web/Request/EditDocumentRequest.cs similarity index 100% rename from src/Products/Editor/Entity/Web/Request/EditDocumentRequest.cs rename to GroupDocs.Editor.MVC/Products/Editor/Entity/Web/Request/EditDocumentRequest.cs diff --git a/GroupDocs.Editor.MVC/Program.cs b/GroupDocs.Editor.MVC/Program.cs new file mode 100644 index 0000000..73f80e8 --- /dev/null +++ b/GroupDocs.Editor.MVC/Program.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Hosting; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.Hosting; +using Microsoft.Extensions.Logging; + +namespace GroupDocs.Editor.MVC +{ + public class Program + { + public static void Main(string[] args) + { + CreateHostBuilder(args).Build().Run(); + } + + public static IHostBuilder CreateHostBuilder(string[] args) => + Host.CreateDefaultBuilder(args) + .ConfigureWebHostDefaults(webBuilder => + { + webBuilder.UseStartup(); + webBuilder.UseUrls("http://localhost:8080"); + }); + } +} diff --git a/GroupDocs.Editor.MVC/Properties/launchSettings.json b/GroupDocs.Editor.MVC/Properties/launchSettings.json new file mode 100644 index 0000000..fabbfb0 --- /dev/null +++ b/GroupDocs.Editor.MVC/Properties/launchSettings.json @@ -0,0 +1,28 @@ +{ + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:8080/editor", + "sslPort": 0 + } + }, + "profiles": { + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "launchUrl": "http://localhost:8080/editor", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "GroupDocs.Editor.MVC": { + "commandName": "Project", + "launchBrowser": true, + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + }, + "applicationUrl": "https://localhost:5001;http://localhost:5000" + } + } +} \ No newline at end of file diff --git a/GroupDocs.Editor.MVC/Startup.cs b/GroupDocs.Editor.MVC/Startup.cs new file mode 100644 index 0000000..63ee488 --- /dev/null +++ b/GroupDocs.Editor.MVC/Startup.cs @@ -0,0 +1,83 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using GroupDocs.Editor.MVC.AppDomainGenerator; +using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Hosting; +using Microsoft.AspNetCore.HttpsPolicy; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.FileProviders; +using Microsoft.Extensions.Hosting; + +namespace GroupDocs.Editor.MVC +{ + public class Startup + { + public Startup(IConfiguration configuration) + { + Configuration = configuration; + DomainGenerator editorDomainGenerator = new DomainGenerator("GroupDocs.Editor.dll", "GroupDocs.Editor.License", Configuration); + editorDomainGenerator.SetEditorLicense(); + } + + public IConfiguration Configuration { get; } + + // This method gets called by the runtime. Use this method to add services to the container. + public void ConfigureServices(IServiceCollection services) + { + services.AddControllersWithViews() + .AddNewtonsoftJson(options => + options.SerializerSettings.ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore + ); + + services.AddCors(o => o.AddPolicy("EditorPolicy", builder => + { + builder.AllowAnyOrigin() + .AllowAnyMethod() + .AllowAnyHeader(); + })); + + services.AddMvc().AddNewtonsoftJson(); + } + + // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. + public void Configure(IApplicationBuilder app, IWebHostEnvironment env) + { + app.UsePathBase("/editor"); + + if (env.IsDevelopment()) + { + app.UseDeveloperExceptionPage(); + } + else + { + app.UseExceptionHandler("/Editor/Error"); + // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. + app.UseHsts(); + } + app.UseHttpsRedirection(); + app.UseStaticFiles(); + + app.UseStaticFiles(new StaticFileOptions + { + FileProvider = new PhysicalFileProvider( + Path.Combine(Directory.GetCurrentDirectory(), "resources")), + RequestPath = "/resources" + }); + + app.UseRouting(); + app.UseCors("EditorPolicy"); + app.UseAuthorization(); + + app.UseEndpoints(endpoints => + { + endpoints.MapControllerRoute( + name: "default", + pattern: "{controller=Editor}/{action=Index}/{id?}"); + }); + } + } +} diff --git a/GroupDocs.Editor.MVC/Views/Editor/Index.cshtml b/GroupDocs.Editor.MVC/Views/Editor/Index.cshtml new file mode 100644 index 0000000..2426778 --- /dev/null +++ b/GroupDocs.Editor.MVC/Views/Editor/Index.cshtml @@ -0,0 +1,21 @@ + + + + + Editor for .NET MVC + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/GroupDocs.Editor.MVC/appsettings.Development.json b/GroupDocs.Editor.MVC/appsettings.Development.json new file mode 100644 index 0000000..8983e0f --- /dev/null +++ b/GroupDocs.Editor.MVC/appsettings.Development.json @@ -0,0 +1,9 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft": "Warning", + "Microsoft.Hosting.Lifetime": "Information" + } + } +} diff --git a/GroupDocs.Editor.MVC/appsettings.json b/GroupDocs.Editor.MVC/appsettings.json new file mode 100644 index 0000000..dfa0744 --- /dev/null +++ b/GroupDocs.Editor.MVC/appsettings.json @@ -0,0 +1,22 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft": "Warning", + "Microsoft.Hosting.Lifetime": "Information" + } + }, + "AllowedHosts": "*", + "ServerConfiguration": { + "HostAddress": "localhost", + "HttpPort": 8080 + }, + "CommonConfiguration": { + "IsPageSelector": "true", + "IsDownload": "true", + "IsUpload": "true", + "IsPrint": "true", + "IsBrowse": "true", + "IsRewrite": "true" + } +} diff --git a/src/client/.editorconfig b/GroupDocs.Editor.MVC/client/.editorconfig similarity index 100% rename from src/client/.editorconfig rename to GroupDocs.Editor.MVC/client/.editorconfig diff --git a/src/client/.gitignore b/GroupDocs.Editor.MVC/client/.gitignore similarity index 100% rename from src/client/.gitignore rename to GroupDocs.Editor.MVC/client/.gitignore diff --git a/GroupDocs.Editor.MVC/client/.npmrc b/GroupDocs.Editor.MVC/client/.npmrc new file mode 100644 index 0000000..a21347f --- /dev/null +++ b/GroupDocs.Editor.MVC/client/.npmrc @@ -0,0 +1 @@ +scripts-prepend-node-path=true \ No newline at end of file diff --git a/src/client/.prettierignore b/GroupDocs.Editor.MVC/client/.prettierignore similarity index 100% rename from src/client/.prettierignore rename to GroupDocs.Editor.MVC/client/.prettierignore diff --git a/src/client/.prettierrc b/GroupDocs.Editor.MVC/client/.prettierrc similarity index 100% rename from src/client/.prettierrc rename to GroupDocs.Editor.MVC/client/.prettierrc diff --git a/src/client/.vscode/extensions.json b/GroupDocs.Editor.MVC/client/.vscode/extensions.json similarity index 100% rename from src/client/.vscode/extensions.json rename to GroupDocs.Editor.MVC/client/.vscode/extensions.json diff --git a/src/client/README.md b/GroupDocs.Editor.MVC/client/README.md similarity index 100% rename from src/client/README.md rename to GroupDocs.Editor.MVC/client/README.md diff --git a/src/client/angular.json b/GroupDocs.Editor.MVC/client/angular.json similarity index 100% rename from src/client/angular.json rename to GroupDocs.Editor.MVC/client/angular.json diff --git a/src/client/apps/.gitkeep b/GroupDocs.Editor.MVC/client/apps/.gitkeep similarity index 100% rename from src/client/apps/.gitkeep rename to GroupDocs.Editor.MVC/client/apps/.gitkeep diff --git a/src/client/apps/editor-e2e/cypress.json b/GroupDocs.Editor.MVC/client/apps/editor-e2e/cypress.json similarity index 100% rename from src/client/apps/editor-e2e/cypress.json rename to GroupDocs.Editor.MVC/client/apps/editor-e2e/cypress.json diff --git a/src/client/apps/editor-e2e/src/fixtures/example.json b/GroupDocs.Editor.MVC/client/apps/editor-e2e/src/fixtures/example.json similarity index 100% rename from src/client/apps/editor-e2e/src/fixtures/example.json rename to GroupDocs.Editor.MVC/client/apps/editor-e2e/src/fixtures/example.json diff --git a/src/client/apps/editor-e2e/src/integration/app.spec.ts b/GroupDocs.Editor.MVC/client/apps/editor-e2e/src/integration/app.spec.ts similarity index 100% rename from src/client/apps/editor-e2e/src/integration/app.spec.ts rename to GroupDocs.Editor.MVC/client/apps/editor-e2e/src/integration/app.spec.ts diff --git a/src/client/apps/editor-e2e/src/plugins/index.js b/GroupDocs.Editor.MVC/client/apps/editor-e2e/src/plugins/index.js similarity index 100% rename from src/client/apps/editor-e2e/src/plugins/index.js rename to GroupDocs.Editor.MVC/client/apps/editor-e2e/src/plugins/index.js diff --git a/src/client/apps/editor-e2e/src/support/app.po.ts b/GroupDocs.Editor.MVC/client/apps/editor-e2e/src/support/app.po.ts similarity index 100% rename from src/client/apps/editor-e2e/src/support/app.po.ts rename to GroupDocs.Editor.MVC/client/apps/editor-e2e/src/support/app.po.ts diff --git a/src/client/apps/editor-e2e/src/support/commands.ts b/GroupDocs.Editor.MVC/client/apps/editor-e2e/src/support/commands.ts similarity index 100% rename from src/client/apps/editor-e2e/src/support/commands.ts rename to GroupDocs.Editor.MVC/client/apps/editor-e2e/src/support/commands.ts diff --git a/src/client/apps/editor-e2e/src/support/index.ts b/GroupDocs.Editor.MVC/client/apps/editor-e2e/src/support/index.ts similarity index 100% rename from src/client/apps/editor-e2e/src/support/index.ts rename to GroupDocs.Editor.MVC/client/apps/editor-e2e/src/support/index.ts diff --git a/src/client/apps/editor-e2e/tsconfig.e2e.json b/GroupDocs.Editor.MVC/client/apps/editor-e2e/tsconfig.e2e.json similarity index 100% rename from src/client/apps/editor-e2e/tsconfig.e2e.json rename to GroupDocs.Editor.MVC/client/apps/editor-e2e/tsconfig.e2e.json diff --git a/src/client/apps/editor-e2e/tsconfig.json b/GroupDocs.Editor.MVC/client/apps/editor-e2e/tsconfig.json similarity index 100% rename from src/client/apps/editor-e2e/tsconfig.json rename to GroupDocs.Editor.MVC/client/apps/editor-e2e/tsconfig.json diff --git a/src/client/apps/editor/browserslist b/GroupDocs.Editor.MVC/client/apps/editor/browserslist similarity index 100% rename from src/client/apps/editor/browserslist rename to GroupDocs.Editor.MVC/client/apps/editor/browserslist diff --git a/src/client/apps/editor/jest.config.js b/GroupDocs.Editor.MVC/client/apps/editor/jest.config.js similarity index 100% rename from src/client/apps/editor/jest.config.js rename to GroupDocs.Editor.MVC/client/apps/editor/jest.config.js diff --git a/src/client/apps/editor/src/app/app.component.html b/GroupDocs.Editor.MVC/client/apps/editor/src/app/app.component.html similarity index 100% rename from src/client/apps/editor/src/app/app.component.html rename to GroupDocs.Editor.MVC/client/apps/editor/src/app/app.component.html diff --git a/src/client/apps/editor/src/app/app.component.less b/GroupDocs.Editor.MVC/client/apps/editor/src/app/app.component.less similarity index 100% rename from src/client/apps/editor/src/app/app.component.less rename to GroupDocs.Editor.MVC/client/apps/editor/src/app/app.component.less diff --git a/src/client/apps/editor/src/app/app.component.spec.ts b/GroupDocs.Editor.MVC/client/apps/editor/src/app/app.component.spec.ts similarity index 100% rename from src/client/apps/editor/src/app/app.component.spec.ts rename to GroupDocs.Editor.MVC/client/apps/editor/src/app/app.component.spec.ts diff --git a/src/client/apps/editor/src/app/app.component.ts b/GroupDocs.Editor.MVC/client/apps/editor/src/app/app.component.ts similarity index 100% rename from src/client/apps/editor/src/app/app.component.ts rename to GroupDocs.Editor.MVC/client/apps/editor/src/app/app.component.ts diff --git a/src/client/apps/editor/src/app/app.module.ts b/GroupDocs.Editor.MVC/client/apps/editor/src/app/app.module.ts similarity index 100% rename from src/client/apps/editor/src/app/app.module.ts rename to GroupDocs.Editor.MVC/client/apps/editor/src/app/app.module.ts diff --git a/src/DocumentSamples/Editor/.gitkeep b/GroupDocs.Editor.MVC/client/apps/editor/src/assets/.gitkeep similarity index 100% rename from src/DocumentSamples/Editor/.gitkeep rename to GroupDocs.Editor.MVC/client/apps/editor/src/assets/.gitkeep diff --git a/src/client/apps/editor/src/environments/environment.prod.ts b/GroupDocs.Editor.MVC/client/apps/editor/src/environments/environment.prod.ts similarity index 100% rename from src/client/apps/editor/src/environments/environment.prod.ts rename to GroupDocs.Editor.MVC/client/apps/editor/src/environments/environment.prod.ts diff --git a/src/client/apps/editor/src/environments/environment.ts b/GroupDocs.Editor.MVC/client/apps/editor/src/environments/environment.ts similarity index 100% rename from src/client/apps/editor/src/environments/environment.ts rename to GroupDocs.Editor.MVC/client/apps/editor/src/environments/environment.ts diff --git a/src/client/apps/editor/src/favicon.ico b/GroupDocs.Editor.MVC/client/apps/editor/src/favicon.ico similarity index 100% rename from src/client/apps/editor/src/favicon.ico rename to GroupDocs.Editor.MVC/client/apps/editor/src/favicon.ico diff --git a/src/client/apps/editor/src/index.html b/GroupDocs.Editor.MVC/client/apps/editor/src/index.html similarity index 100% rename from src/client/apps/editor/src/index.html rename to GroupDocs.Editor.MVC/client/apps/editor/src/index.html diff --git a/src/client/apps/editor/src/main.ts b/GroupDocs.Editor.MVC/client/apps/editor/src/main.ts similarity index 100% rename from src/client/apps/editor/src/main.ts rename to GroupDocs.Editor.MVC/client/apps/editor/src/main.ts diff --git a/src/client/apps/editor/src/polyfills.ts b/GroupDocs.Editor.MVC/client/apps/editor/src/polyfills.ts similarity index 100% rename from src/client/apps/editor/src/polyfills.ts rename to GroupDocs.Editor.MVC/client/apps/editor/src/polyfills.ts diff --git a/src/client/apps/editor/src/styles.less b/GroupDocs.Editor.MVC/client/apps/editor/src/styles.less similarity index 100% rename from src/client/apps/editor/src/styles.less rename to GroupDocs.Editor.MVC/client/apps/editor/src/styles.less diff --git a/src/client/apps/editor/src/test-setup.ts b/GroupDocs.Editor.MVC/client/apps/editor/src/test-setup.ts similarity index 100% rename from src/client/apps/editor/src/test-setup.ts rename to GroupDocs.Editor.MVC/client/apps/editor/src/test-setup.ts diff --git a/src/client/apps/editor/tsconfig.app.json b/GroupDocs.Editor.MVC/client/apps/editor/tsconfig.app.json similarity index 100% rename from src/client/apps/editor/tsconfig.app.json rename to GroupDocs.Editor.MVC/client/apps/editor/tsconfig.app.json diff --git a/src/client/apps/editor/tsconfig.json b/GroupDocs.Editor.MVC/client/apps/editor/tsconfig.json similarity index 100% rename from src/client/apps/editor/tsconfig.json rename to GroupDocs.Editor.MVC/client/apps/editor/tsconfig.json diff --git a/src/client/apps/editor/tsconfig.spec.json b/GroupDocs.Editor.MVC/client/apps/editor/tsconfig.spec.json similarity index 100% rename from src/client/apps/editor/tsconfig.spec.json rename to GroupDocs.Editor.MVC/client/apps/editor/tsconfig.spec.json diff --git a/src/client/apps/editor/tslint.json b/GroupDocs.Editor.MVC/client/apps/editor/tslint.json similarity index 100% rename from src/client/apps/editor/tslint.json rename to GroupDocs.Editor.MVC/client/apps/editor/tslint.json diff --git a/src/client/jest.config.js b/GroupDocs.Editor.MVC/client/jest.config.js similarity index 100% rename from src/client/jest.config.js rename to GroupDocs.Editor.MVC/client/jest.config.js diff --git a/src/Licenses/.gitkeep b/GroupDocs.Editor.MVC/client/libs/.gitkeep similarity index 100% rename from src/Licenses/.gitkeep rename to GroupDocs.Editor.MVC/client/libs/.gitkeep diff --git a/src/client/nx.json b/GroupDocs.Editor.MVC/client/nx.json similarity index 100% rename from src/client/nx.json rename to GroupDocs.Editor.MVC/client/nx.json diff --git a/src/client/package.json b/GroupDocs.Editor.MVC/client/package.json similarity index 82% rename from src/client/package.json rename to GroupDocs.Editor.MVC/client/package.json index 68e19b4..766dcd1 100644 --- a/src/client/package.json +++ b/GroupDocs.Editor.MVC/client/package.json @@ -6,7 +6,9 @@ "ng": "ng", "nx": "nx", "start": "ng serve", - "build": "..\\..\\packages\\Node-Kit.11.1.0.1\\node\\win\\node.exe .\\node_modules\\@angular\\cli\\bin\\ng build", + "build-linux": "../../packages/node-kit/11.1.0.1/node/linux/node ./node_modules/@angular/cli/bin/ng build", + "build-win": "..\\..\\packages\\Node-Kit\\11.1.0.1\\node\\win\\node.exe .\\node_modules\\@angular\\cli\\bin\\ng build", + "build-osx": "../../packages/node-kit/11.1.0.1/node/osx/node ./node_modules/@angular/cli/bin/ng build", "test": "ng test", "lint": "nx workspace-lint && ng lint", "e2e": "ng e2e", @@ -41,7 +43,7 @@ "rxjs": "~6.4.0", "zone.js": "^0.9.1", "@nrwl/angular": "^8.3.0", - "@groupdocs.examples.angular/editor": "^0.5.0" + "@groupdocs.examples.angular/editor": "^0.7.0" }, "devDependencies": { "cypress": "3.4.0", diff --git a/src/Resources/.gitkeep b/GroupDocs.Editor.MVC/client/tools/schematics/.gitkeep similarity index 100% rename from src/Resources/.gitkeep rename to GroupDocs.Editor.MVC/client/tools/schematics/.gitkeep diff --git a/src/client/tools/tsconfig.tools.json b/GroupDocs.Editor.MVC/client/tools/tsconfig.tools.json similarity index 100% rename from src/client/tools/tsconfig.tools.json rename to GroupDocs.Editor.MVC/client/tools/tsconfig.tools.json diff --git a/src/client/tsconfig.json b/GroupDocs.Editor.MVC/client/tsconfig.json similarity index 100% rename from src/client/tsconfig.json rename to GroupDocs.Editor.MVC/client/tsconfig.json diff --git a/src/client/tslint.json b/GroupDocs.Editor.MVC/client/tslint.json similarity index 100% rename from src/client/tslint.json rename to GroupDocs.Editor.MVC/client/tslint.json diff --git a/src/configuration.yml b/GroupDocs.Editor.MVC/configuration.yml similarity index 100% rename from src/configuration.yml rename to GroupDocs.Editor.MVC/configuration.yml diff --git a/GroupDocs.Editor.MVC/wwwroot/favicon.ico b/GroupDocs.Editor.MVC/wwwroot/favicon.ico new file mode 100644 index 0000000..a3a7999 Binary files /dev/null and b/GroupDocs.Editor.MVC/wwwroot/favicon.ico differ diff --git a/LICENSE b/LICENSE deleted file mode 100644 index af0a3df..0000000 --- a/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2001-2018 Aspose Pty Ltd - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/NuGet.Config b/NuGet.Config new file mode 100644 index 0000000..e4e43b0 --- /dev/null +++ b/NuGet.Config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/README.md b/README.md deleted file mode 100644 index e13b395..0000000 --- a/README.md +++ /dev/null @@ -1,117 +0,0 @@ -![Alt text](https://raw.githubusercontent.com/groupdocs-Editor/groupdocs-Editor.github.io/master/resources/image/banner.png "Document Editor API for .NET MVC") -# GroupDocs.Editor for .NET MVC Example -###### version 1.20.0 - -[![Build status](https://ci.appveyor.com/api/projects/status/qu9h9b6wl177vmmn?svg=true)](https://ci.appveyor.com/project/egorovpavel/groupdocs-editor-for-net-mvc) -[![Codacy Badge](https://api.codacy.com/project/badge/Grade/92a01202aa6b45c39febe3fe77d1e6c6)](https://www.codacy.com/app/GroupDocs/GroupDocs.Editor-for-.NET-MVC?utm_source=github.com&utm_medium=referral&utm_content=groupdocs-editor/GroupDocs.Editor-for-.NET-MVC&utm_campaign=Badge_Grade) -[![GitHub license](https://img.shields.io/github/license/groupdocs-Editor/GroupDocs.Editor-for-.NET-MVC.svg)](https://github.com/groupdocs-Editor/GroupDocs.Editor-for-.NET-MVC/blob/master/LICENSE) - -## System Requirements -- .NET Framework 4.5 -- Visual Studio 2015 - - -## Document Editor API for .NET MVC - -[GroupDocs.Editor for .NET](https://products.groupdocs.com/Editor/net) is a library that allows you to **edit DOCX, ODT, XLS and other supported formats in form of HTML** and save it back to the original format. With GroupDocs.Editor you can easily edit documents on the web with your favorite WYSIWYG editor without external dependencies. - -This web application demonstrates the powerful capabilities of GroupDocs.Editor with a built-in **WYSIWYG document editor** and can be used as a standalone application or can be easily integrated into your project. - - -**Note:** without a license application will run in trial mode, purchase [GroupDocs.Editor for .NET license](https://purchase.groupdocs.com/order-online-step-1-of-8.aspx) or request [GroupDocs.Editor for .NET temporary license](https://purchase.groupdocs.com/temporary-license). - - -## Supported document Formats - -| Family | Formats | -| --------------------------- |:---------------------------------------------------------------------------------------------------------------------------------- | -| Microsoft Word | `DOC`, `DOCM` , `DOCX`, `DOT`, `DOTM`, `DOTX` | -| Microsoft Excel | `XLS`, `XLSB`, `XLSM`, `XLSX`, `XLT`, `XLTM`, `XLTX` | -| OpenDocument Formats | `ODT`, `ODP`, `ODS`, `OTT` | -| Plain Text File | `TXT` | -| Comma-Separated Values | `CSV` | -| HyperText Markup Language | `HTML`, `MHT`, `MHTML`, `SVG` | -| Extensible Markup Language | `XML`,`XML`, `XPS` | - -## Demo Video - -

- - - -

- -## Features -- Responsive design -- Cross-browser support (Safari, Chrome, Opera, Firefox) -- Cross-platform support (Windows, Linux, MacOS) -- Clean, modern and intuitive design -- Edit, format documents -- Mobile support (open application on any mobile device) -- Support over 50 documents and image formats including **DOCX**, **ODT** **XLS** -- Fully customizable navigation panel -- Open password protected documents -- Download documents -- Upload documents -- Print document - - -## How to run - -You can run this sample by one of following methods - -#### Build from source - -Download [source code](https://github.com/groupdocs-Editor/GroupDocs.Editor-for-.NET-MVC/archive/master.zip) from github or clone this repository. - -```bash -git clone https://github.com/groupdocs-Editor/GroupDocs.Editor-for-.NET-MVC -``` - -Open solution in the VisualStudio. -Update common parameters in `web.config` and example related properties in the `configuration.yml` to meet your requirements. - -Open http://localhost:8080/Editor in your favorite browser - -#### Docker image -Use [docker](https://www.docker.com/) image. - -```bash -mkdir DocumentSamples -mkdir Licenses -docker run -p 8080:8080 --env application.hostAddress=localhost -v `pwd`/DocumentSamples:/home/groupdocs/app/DocumentSamples -v `pwd`/Licenses:/home/groupdocs/app/Licenses groupdocs/Editor -## Open http://localhost:8080/Editor in your favorite browser. -``` - -### Configuration -For all methods above you can adjust settings in `configuration.yml`. By default in this sample will lookup for license file in `./Licenses` folder, so you can simply put your license file in that folder or specify relative/absolute path by setting `licensePath` value in `configuration.yml`. - -#### Editor configuration options - -| Option | Type | Default value | Description | -| ---------------------- | ------- |:-----------------:|:-------------------------------------------------------------------------------------------------------------------------------------------- | -| **`filesDirectory`** | String | `DocumentSamples` | Files directory path. Indicates where uploaded and predefined files are stored. It can be absolute or relative path | -| **`fontsDirectory`** | String | | Path to custom fonts directory. | -| **`defaultDocument`** | String | | Absolute path to default document that will be loaded automatically. | -| **`createNewFile`** | String | | Enable / disable new document creation. | - -## License -The MIT License (MIT). - -Please have a look at the LICENSE.md for more details - -## GroupDocs Document Editor on other platforms/frameworks - -- JAVA DropWizard [Document Editor](https://github.com/groupdocs-Editor/GroupDocs.Editor-for-Java-Dropwizard) -- JAVA Spring boot [Document Editor](https://github.com/groupdocs-Editor/GroupDocs.Editor-for-Java-Spring) -- .NET WebForms [Document Editor](https://github.com/groupdocs-Editor/GroupDocs.Editor-for-.NET-WebForms) - -## Resources -- **Website:** [www.groupdocs.com](http://www.groupdocs.com) -- **Product Home:** [GroupDocs.Editor for .NET](https://products.groupdocs.com/Editor/net) -- **Product API References:** [GroupDocs.Editor for .NET API](https://apireference.groupdocs.com/net/Editor) -- **Download:** [Download GroupDocs.Editor for .NET](http://downloads.groupdocs.com/Editor/net) -- **Documentation:** [GroupDocs.Editor for .NET Documentation](https://docs.groupdocs.com/display/Editornet/Home) -- **Free Support Forum:** [GroupDocs.Editor for .NET Free Support Forum](https://forum.groupdocs.com/c/Editor) -- **Paid Support Helpdesk:** [GroupDocs.Editor for .NET Paid Support Helpdesk](https://helpdesk.groupdocs.com) -- **Blog:** [GroupDocs.Editor for .NET Blog](https://blog.groupdocs.com/category/groupdocs-Editor-product-family/) diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index 418632b..0000000 --- a/appveyor.yml +++ /dev/null @@ -1,5 +0,0 @@ -version: 1.0.{build} -before_build: -- cmd: nuget restore -build: - verbosity: minimal \ No newline at end of file diff --git a/src/AppDomainGenerator/DomainGenerator.cs b/src/AppDomainGenerator/DomainGenerator.cs deleted file mode 100644 index 56de5c3..0000000 --- a/src/AppDomainGenerator/DomainGenerator.cs +++ /dev/null @@ -1,82 +0,0 @@ -using System; -using System.IO; -using System.Reflection; - -namespace GroupDocs.Editor.MVC.AppDomainGenerator -{ - /// - /// DomainGenerator - /// - public class DomainGenerator - { - private readonly Products.Common.Config.GlobalConfiguration globalConfiguration; - private readonly Type CurrentType; - - /// - /// Constructor - /// - public DomainGenerator(string assemblyName, string className) - { - globalConfiguration = new Products.Common.Config.GlobalConfiguration(); - // Get assembly path - string assemblyPath = GetAssemblyPath(assemblyName); - // Initiate GroupDocs license class - CurrentType = this.CreateDomain(assemblyName + "Domain", assemblyPath, className); - } - - /// - /// Get assembly full path by its name - /// - /// string - /// - private static string GetAssemblyPath(string assemblyName) - { - string path = ""; - // Get path of the executable - string codeBase = Assembly.GetExecutingAssembly().CodeBase; - UriBuilder uri = new UriBuilder(codeBase); - string uriPath = Uri.UnescapeDataString(uri.Path); - // Get path of the assembly - path = Path.Combine(Path.GetDirectoryName(uriPath), assemblyName); - return path; - } - - /// - /// Create AppDomain for the assembly - /// - /// string - /// string - /// string - /// - private Type CreateDomain(string domainName, string assemblyPath, string className) - { - // Create domain - AppDomain dom = AppDomain.CreateDomain(domainName); - AssemblyName assemblyName = new AssemblyName { CodeBase = assemblyPath }; - // Load assembly into the domain - Assembly assembly = dom.Load(assemblyName); - // Initiate class from the loaded assembly - Type type = assembly.GetType(className); - return type; - } - - /// - /// Set GroupDocs.Editor license - /// - /// Type - public void SetEditorLicense() - { - // Initiate license class - var obj = (GroupDocs.Editor.License)Activator.CreateInstance(CurrentType); - // Set license - SetLicense(obj); - } - - private void SetLicense(dynamic obj) { - if (!String.IsNullOrEmpty(globalConfiguration.GetApplicationConfiguration().GetLicensePath())) - { - obj.SetLicense(globalConfiguration.GetApplicationConfiguration().GetLicensePath()); - } - } - } -} \ No newline at end of file diff --git a/src/App_Start/FilterConfig.cs b/src/App_Start/FilterConfig.cs deleted file mode 100644 index fdaedf7..0000000 --- a/src/App_Start/FilterConfig.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System.Web.Mvc; - -namespace GroupDocs.Editor.MVC -{ - public class FilterConfig - { - public static void RegisterGlobalFilters(GlobalFilterCollection filters) - { - filters.Add(new HandleErrorAttribute()); - } - } -} diff --git a/src/App_Start/RouteConfig.cs b/src/App_Start/RouteConfig.cs deleted file mode 100644 index 6c5245c..0000000 --- a/src/App_Start/RouteConfig.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System.Web.Mvc; -using System.Web.Routing; - -namespace GroupDocs.Editor.MVC -{ - public class RouteConfig - { - public static void RegisterRoutes(RouteCollection routes) - { - routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); - - routes.MapRoute( - name: "Default", - url: "{controller}/{action}/{id}", - defaults: new { controller = "Editor", action = "Index", id = UrlParameter.Optional } - ); - } - } -} diff --git a/src/App_Start/WebApiConfig.cs b/src/App_Start/WebApiConfig.cs deleted file mode 100644 index 88020e4..0000000 --- a/src/App_Start/WebApiConfig.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System.Web.Http; -using System.Web.Http.Cors; - -namespace GroupDocs.Editor.MVC -{ - public static class WebApiConfig - { - public static void Register(HttpConfiguration config) - { - // enable CORS - config.EnableCors(); - - // Web API routes - config.MapHttpAttributeRoutes(); - } - } -} diff --git a/src/Global.asax b/src/Global.asax deleted file mode 100644 index 6872676..0000000 --- a/src/Global.asax +++ /dev/null @@ -1 +0,0 @@ -<%@ Application Codebehind="Global.asax.cs" Inherits="GroupDocs.Editor.MVC.WebApiApplication" Language="C#" %> diff --git a/src/Global.asax.cs b/src/Global.asax.cs deleted file mode 100644 index a60de11..0000000 --- a/src/Global.asax.cs +++ /dev/null @@ -1,25 +0,0 @@ -using GroupDocs.Editor.MVC.AppDomainGenerator; -using System.Web.Http; -using System.Web.Mvc; -using System.Web.Routing; - -namespace GroupDocs.Editor.MVC -{ - public class WebApiApplication : System.Web.HttpApplication - { - protected void Application_Start() - { - // Fix required to use several GroupDocs products in one project. - // Set GroupDocs products assemblies names - string editorAssemblyName = "GroupDocs.Editor.dll"; - // set GroupDocs.Editor license - DomainGenerator editorDomainGenerator = new DomainGenerator(editorAssemblyName, "GroupDocs.Editor.License"); - editorDomainGenerator.SetEditorLicense(); - - AreaRegistration.RegisterAllAreas(); - GlobalConfiguration.Configure(WebApiConfig.Register); - FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); - RouteConfig.RegisterRoutes(RouteTable.Routes); - } - } -} \ No newline at end of file diff --git a/src/GroupDocs.Editor.MVC.csproj b/src/GroupDocs.Editor.MVC.csproj deleted file mode 100644 index 461e986..0000000 --- a/src/GroupDocs.Editor.MVC.csproj +++ /dev/null @@ -1,294 +0,0 @@ - - - - - - - Debug - AnyCPU - - - 2.0 - {A33CA8B0-A193-40A3-A86A-90FF444EE878} - {349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} - Library - Properties - GroupDocs.Editor.MVC - GroupDocs.Editor.MVC - v4.5 - false - true - - - - - - - - - - - true - full - false - bin\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\ - TRACE - prompt - 4 - - - - ..\packages\Castle.Core.4.3.1\lib\net45\Castle.Core.dll - - - ..\packages\GroupDocs.Editor.19.5.0\lib\GroupDocs.Editor.dll - - - ..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.0\lib\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll - True - - - True - - - ..\packages\Moq.4.10.1\lib\net45\Moq.dll - - - ..\packages\Newtonsoft.Json.11.0.2\lib\net45\Newtonsoft.Json.dll - - - True - - - False - True - - - True - - - True - - - True - - - True - - - ..\packages\Microsoft.AspNet.WebApi.Client.5.2.5\lib\net45\System.Net.Http.Formatting.dll - - - ..\packages\System.Runtime.CompilerServices.Unsafe.4.5.0\lib\netstandard1.0\System.Runtime.CompilerServices.Unsafe.dll - - - ..\packages\System.Threading.Tasks.Extensions.4.5.1\lib\portable-net45+win8+wp8+wpa81\System.Threading.Tasks.Extensions.dll - - - ..\packages\System.ValueTuple.4.3.0\lib\netstandard1.0\System.ValueTuple.dll - - - ..\packages\Microsoft.AspNet.Cors.5.2.7\lib\net45\System.Web.Cors.dll - - - True - - - True - - - True - - - True - - - True - - - ..\packages\Microsoft.AspNet.WebApi.Core.5.2.5\lib\net45\System.Web.Http.dll - - - ..\packages\Microsoft.AspNet.WebApi.Cors.5.2.5\lib\net45\System.Web.Http.Cors.dll - True - - - ..\packages\Microsoft.AspNet.WebApi.WebHost.5.2.3\lib\net45\System.Web.Http.WebHost.dll - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - ..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll - - - True - - - True - - - True - ..\packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.Helpers.dll - - - True - ..\packages\Microsoft.AspNet.Mvc.5.2.3\lib\net45\System.Web.Mvc.dll - - - ..\packages\Microsoft.AspNet.Web.Optimization.1.1.3\lib\net40\System.Web.Optimization.dll - - - True - ..\packages\Microsoft.AspNet.Razor.3.2.3\lib\net45\System.Web.Razor.dll - - - True - ..\packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.WebPages.dll - - - True - ..\packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.WebPages.Deployment.dll - - - True - ..\packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.WebPages.Razor.dll - - - True - ..\packages\WebGrease.1.5.2\lib\WebGrease.dll - - - True - ..\packages\Antlr.3.4.1.9004\lib\Antlr3.Runtime.dll - - - ..\packages\YamlDotNet.5.2.1\lib\net45\YamlDotNet.dll - - - - - - - - - - - - - - - - - - - - - - - - - - - Global.asax - - - - - - - - - - - Designer - - - Web.config - - - Web.config - - - - - - - - - - - - - - - 10.0 - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - - - - - - - - - - - - True - True - 50289 - / - http://localhost:8080/editor - False - False - - - False - - - - - - - This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/Properties/AssemblyInfo.cs b/src/Properties/AssemblyInfo.cs deleted file mode 100644 index fea60f6..0000000 --- a/src/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("GroupDocs.Editor MVC")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("Aspose Pty Ltd")] -[assembly: AssemblyProduct("GroupDocs.Editor MVC")] -[assembly: AssemblyCopyright("2001-2018 Aspose Pty Ltd")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(true)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("cb1d0987-217d-43e0-afff-fae210c23d96")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Revision and Build Numbers -// by using the '*' as shown below: -[assembly: AssemblyVersion("0.1.0.0")] -[assembly: AssemblyFileVersion("0.1.0.0")] diff --git a/src/Views/Editor/Index.cshtml b/src/Views/Editor/Index.cshtml deleted file mode 100644 index a3f860a..0000000 --- a/src/Views/Editor/Index.cshtml +++ /dev/null @@ -1,24 +0,0 @@ -@{ - GroupDocs.Editor.MVC.Products.Common.Config.GlobalConfiguration config = new GroupDocs.Editor.MVC.Products.Common.Config.GlobalConfiguration(); -} - - - - - Editor for .NET MVC - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/Views/Web.config b/src/Views/Web.config deleted file mode 100644 index 54b83f7..0000000 --- a/src/Views/Web.config +++ /dev/null @@ -1,43 +0,0 @@ - - - - - -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/Web.config b/src/Web.config deleted file mode 100644 index 22ff074..0000000 --- a/src/Web.config +++ /dev/null @@ -1,117 +0,0 @@ - - - - -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/client/apps/editor/src/assets/.gitkeep b/src/client/apps/editor/src/assets/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/src/client/libs/.gitkeep b/src/client/libs/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/src/client/tools/schematics/.gitkeep b/src/client/tools/schematics/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/src/package.json b/src/package.json deleted file mode 100644 index dde2837..0000000 --- a/src/package.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "groupdocs.editor-for-net-mvc", - "version": "1.0.0", - "description": "", - "main": "index.js", - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/groupdocs-editor/GroupDocs.Editor-for-NET-MVC.git" - }, - "author": "", - "license": "MIT", - "bugs": { - "url": "https://github.com/groupdocs-editor/GroupDocs.Editor-for-NET-MVC/issues" - }, - "homepage": "https://github.com/groupdocs-editor/GroupDocs.Editor-for-NET-MVC#readme" -} diff --git a/src/packages.config b/src/packages.config deleted file mode 100644 index a90a80d..0000000 --- a/src/packages.config +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file