diff --git a/ASC.Web.sln b/ASC.Web.sln
index 8f1922e593..cbeef8a77e 100644
--- a/ASC.Web.sln
+++ b/ASC.Web.sln
@@ -79,7 +79,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ASC.EventBus.RabbitMQ", "co
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ASC.EventBus.Extensions.Logger", "common\ASC.EventBus.Extensions.Logger\ASC.EventBus.Extensions.Logger.csproj", "{ED8CEB38-7C95-43A8-B208-9C9828654AC1}"
EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ASC.Migration", "common\ASC.Migration\ASC.Migration.csproj", "{05B8FF27-446B-49BF-B508-4A4C096D2BB2}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ASC.Migration.Core", "common\ASC.Migration\ASC.Migration.Core.csproj", "{05B8FF27-446B-49BF-B508-4A4C096D2BB2}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ASC.ActiveDirectory", "common\ASC.ActiveDirectory\ASC.ActiveDirectory.csproj", "{9F81862F-303D-467F-8DC9-044BE2CCF329}"
EndProject
@@ -91,6 +91,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ASC.ApiSystem", "common\ser
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ASC.ApiCache", "common\services\ASC.ApiCache\ASC.ApiCache.csproj", "{AD4F5F31-625C-472D-BE2C-AD1FB693E065}"
EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ASC.Migration.BackgroundTasks", "common\ASC.Migration.BackgroundTasks\ASC.Migration.BackgroundTasks.csproj", "{7783D579-5A2F-4536-A387-F6E0E0946C07}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -257,6 +259,10 @@ Global
{AD4F5F31-625C-472D-BE2C-AD1FB693E065}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AD4F5F31-625C-472D-BE2C-AD1FB693E065}.Release|Any CPU.ActiveCfg = Release|Any CPU
{AD4F5F31-625C-472D-BE2C-AD1FB693E065}.Release|Any CPU.Build.0 = Release|Any CPU
+ {7783D579-5A2F-4536-A387-F6E0E0946C07}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {7783D579-5A2F-4536-A387-F6E0E0946C07}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {7783D579-5A2F-4536-A387-F6E0E0946C07}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {7783D579-5A2F-4536-A387-F6E0E0946C07}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
diff --git a/ASC.Web.slnf b/ASC.Web.slnf
index 2d96054968..56da385c7f 100644
--- a/ASC.Web.slnf
+++ b/ASC.Web.slnf
@@ -18,6 +18,8 @@
"common\\ASC.Feed\\ASC.Feed.csproj",
"common\\ASC.IPSecurity\\ASC.IPSecurity.csproj",
"common\\ASC.MessagingSystem\\ASC.MessagingSystem.csproj",
+ "common\\ASC.Migration.BackgroundTasks\\ASC.Migration.BackgroundTasks.csproj",
+ "common\\ASC.Migration\\ASC.Migration.Core.csproj",
"common\\ASC.Notify.Textile\\ASC.Notify.Textile.csproj",
"common\\ASC.Textile\\ASC.Textile.csproj",
"common\\ASC.Webhooks.Core\\ASC.Webhooks.Core.csproj",
diff --git a/common/ASC.Migration.BackgroundTasks/ASC.Migration.BackgroundTasks.csproj b/common/ASC.Migration.BackgroundTasks/ASC.Migration.BackgroundTasks.csproj
new file mode 100644
index 0000000000..024b380e2e
--- /dev/null
+++ b/common/ASC.Migration.BackgroundTasks/ASC.Migration.BackgroundTasks.csproj
@@ -0,0 +1,12 @@
+
+
+
+ net7.0
+ enable
+
+
+
+
+
+
+
diff --git a/common/ASC.Migration.BackgroundTasks/GlobalUsings.cs b/common/ASC.Migration.BackgroundTasks/GlobalUsings.cs
new file mode 100644
index 0000000000..3d3c8e4615
--- /dev/null
+++ b/common/ASC.Migration.BackgroundTasks/GlobalUsings.cs
@@ -0,0 +1,37 @@
+// (c) Copyright Ascensio System SIA 2010-2022
+//
+// This program is a free software product.
+// You can redistribute it and/or modify it under the terms
+// of the GNU Affero General Public License (AGPL) version 3 as published by the Free Software
+// Foundation. In accordance with Section 7(a) of the GNU AGPL its Section 15 shall be amended
+// to the effect that Ascensio System SIA expressly excludes the warranty of non-infringement of
+// any third-party rights.
+//
+// This program is distributed WITHOUT ANY WARRANTY, without even the implied warranty
+// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For details, see
+// the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
+//
+// You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia, EU, LV-1021.
+//
+// The interactive user interfaces in modified source and object code versions of the Program must
+// display Appropriate Legal Notices, as required under Section 5 of the GNU AGPL version 3.
+//
+// Pursuant to Section 7(b) of the License you must retain the original Product logo when
+// distributing the program. Pursuant to Section 7(e) we decline to grant you any rights under
+// trademark law for use of our trademarks.
+//
+// All the Product's GUI elements, including illustrations and icon sets, as well as technical writing
+// content are licensed under the terms of the Creative Commons Attribution-ShareAlike 4.0
+// International. See the License terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
+
+global using System.Text;
+
+global using ASC.Api.Core;
+global using ASC.Api.Core.Extensions;
+global using ASC.Migration;
+
+global using Autofac;
+
+global using Microsoft.Extensions.Hosting.WindowsServices;
+
+global using NLog;
diff --git a/common/ASC.Migration/Program.cs b/common/ASC.Migration.BackgroundTasks/Program.cs
similarity index 93%
rename from common/ASC.Migration/Program.cs
rename to common/ASC.Migration.BackgroundTasks/Program.cs
index 31d17b409c..30131e145d 100644
--- a/common/ASC.Migration/Program.cs
+++ b/common/ASC.Migration.BackgroundTasks/Program.cs
@@ -1,88 +1,85 @@
-// (c) Copyright Ascensio System SIA 2010-2022
-//
-// This program is a free software product.
-// You can redistribute it and/or modify it under the terms
-// of the GNU Affero General Public License (AGPL) version 3 as published by the Free Software
-// Foundation. In accordance with Section 7(a) of the GNU AGPL its Section 15 shall be amended
-// to the effect that Ascensio System SIA expressly excludes the warranty of non-infringement of
-// any third-party rights.
-//
-// This program is distributed WITHOUT ANY WARRANTY, without even the implied warranty
-// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For details, see
-// the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
-//
-// You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia, EU, LV-1021.
-//
-// The interactive user interfaces in modified source and object code versions of the Program must
-// display Appropriate Legal Notices, as required under Section 5 of the GNU AGPL version 3.
-//
-// Pursuant to Section 7(b) of the License you must retain the original Product logo when
-// distributing the program. Pursuant to Section 7(e) we decline to grant you any rights under
-// trademark law for use of our trademarks.
-//
-// All the Product's GUI elements, including illustrations and icon sets, as well as technical writing
-// content are licensed under the terms of the Creative Commons Attribution-ShareAlike 4.0
-// International. See the License terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
-
-var options = new WebApplicationOptions
-{
- Args = args,
- ContentRootPath = WindowsServiceHelpers.IsWindowsService() ? AppContext.BaseDirectory : default
-};
-
-var builder = WebApplication.CreateBuilder(options);
-
-builder.Configuration.AddDefaultConfiguration(builder.Environment)
- .AddEnvironmentVariables()
- .AddCommandLine(args);
-
-var logger = LogManager.Setup()
- .SetupExtensions(s =>
- {
- s.RegisterLayoutRenderer("application-context", (logevent) => AppName);
- })
- .LoadConfiguration(builder.Configuration, builder.Environment)
- .GetLogger(typeof(Startup).Namespace);
-
-try
-{
- logger.Info("Configuring web host ({applicationContext})...", AppName);
- builder.Host.ConfigureDefault();
- builder.WebHost.ConfigureDefaultKestrel();
-
- var startup = new Startup(builder.Configuration, builder.Environment);
-
- startup.ConfigureServices(builder.Services);
-
- builder.Host.ConfigureContainer(containerBuilder =>
- {
- startup.ConfigureContainer(containerBuilder);
- });
-
- var app = builder.Build();
-
- startup.Configure(app, app.Environment);
-
- logger.Info("Starting web host ({applicationContext})...", AppName);
- await app.RunWithTasksAsync();
-}
-catch (Exception ex)
-{
- if (logger != null)
- {
- logger.Error(ex, "Program terminated unexpectedly ({applicationContext})!", AppName);
- }
-
- throw;
-}
-finally
-{
- // Ensure to flush and stop internal timers/threads before application-exit (Avoid segmentation fault on Linux)
- LogManager.Shutdown();
-}
-
-public partial class Program
-{
- public static string Namespace = typeof(Startup).Namespace;
- public static string AppName = Namespace.Substring(Namespace.LastIndexOf('.') + 1);
+// (c) Copyright Ascensio System SIA 2010-2022
+//
+// This program is a free software product.
+// You can redistribute it and/or modify it under the terms
+// of the GNU Affero General Public License (AGPL) version 3 as published by the Free Software
+// Foundation. In accordance with Section 7(a) of the GNU AGPL its Section 15 shall be amended
+// to the effect that Ascensio System SIA expressly excludes the warranty of non-infringement of
+// any third-party rights.
+//
+// This program is distributed WITHOUT ANY WARRANTY, without even the implied warranty
+// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For details, see
+// the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
+//
+// You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia, EU, LV-1021.
+//
+// The interactive user interfaces in modified source and object code versions of the Program must
+// display Appropriate Legal Notices, as required under Section 5 of the GNU AGPL version 3.
+//
+// Pursuant to Section 7(b) of the License you must retain the original Product logo when
+// distributing the program. Pursuant to Section 7(e) we decline to grant you any rights under
+// trademark law for use of our trademarks.
+//
+// All the Product's GUI elements, including illustrations and icon sets, as well as technical writing
+// content are licensed under the terms of the Creative Commons Attribution-ShareAlike 4.0
+// International. See the License terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
+
+var options = new WebApplicationOptions
+{
+ Args = args,
+ ContentRootPath = WindowsServiceHelpers.IsWindowsService() ? AppContext.BaseDirectory : default
+};
+
+var builder = WebApplication.CreateBuilder(options);
+
+builder.Configuration.AddDefaultConfiguration(builder.Environment)
+ .AddEnvironmentVariables()
+ .AddCommandLine(args);
+
+var logger = LogManager.Setup()
+ .SetupExtensions(s =>
+ {
+ s.RegisterLayoutRenderer("application-context", (logevent) => AppName);
+ })
+ .LoadConfiguration(builder.Configuration, builder.Environment)
+ .GetLogger(typeof(Startup).Namespace);
+
+try
+{
+ logger.Info("Configuring web host ({applicationContext})...", AppName);
+ builder.Host.ConfigureDefault();
+ builder.WebHost.ConfigureDefaultKestrel();
+
+ var startup = new Startup(builder.Configuration, builder.Environment);
+
+ startup.ConfigureServices(builder.Services);
+
+ builder.Host.ConfigureContainer(startup.ConfigureContainer);
+
+ var app = builder.Build();
+
+ startup.Configure(app, app.Environment);
+
+ logger.Info("Starting web host ({applicationContext})...", AppName);
+ await app.RunWithTasksAsync();
+}
+catch (Exception ex)
+{
+ if (logger != null)
+ {
+ logger.Error(ex, "Program terminated unexpectedly ({applicationContext})!", AppName);
+ }
+
+ throw;
+}
+finally
+{
+ // Ensure to flush and stop internal timers/threads before application-exit (Avoid segmentation fault on Linux)
+ LogManager.Shutdown();
+}
+
+public partial class Program
+{
+ public static string Namespace = typeof(Startup).Namespace;
+ public static string AppName = Namespace.Substring(Namespace.LastIndexOf('.') + 1);
}
\ No newline at end of file
diff --git a/common/ASC.Migration/Properties/launchSettings.json b/common/ASC.Migration.BackgroundTasks/Properties/launchSettings.json
similarity index 96%
rename from common/ASC.Migration/Properties/launchSettings.json
rename to common/ASC.Migration.BackgroundTasks/Properties/launchSettings.json
index 616301c39b..ba327ac555 100644
--- a/common/ASC.Migration/Properties/launchSettings.json
+++ b/common/ASC.Migration.BackgroundTasks/Properties/launchSettings.json
@@ -1,28 +1,28 @@
-{
- "profiles": {
- "Kestrel WebServer": {
- "commandName": "Project",
- "launchBrowser": false,
- "environmentVariables": {
- "$STORAGE_ROOT": "../../Data",
- "log__name": "migration",
- "log__dir": "../../Logs",
- "ASPNETCORE_URLS": "http://localhost:5034",
- "ASPNETCORE_ENVIRONMENT": "Development"
- }
- },
- "WSL 2 : Ubuntu 20.04": {
- "commandName": "WSL2",
- "launchBrowser": false,
- "launchUrl": "http://localhost:5034",
- "environmentVariables": {
- "$STORAGE_ROOT": "../../Data",
- "log__name": "migration",
- "log__dir": "../../Logs",
- "ASPNETCORE_URLS": "http://localhost:5034",
- "ASPNETCORE_ENVIRONMENT": "Development"
- },
- "distributionName": "Ubuntu-20.04"
- }
- }
+{
+ "profiles": {
+ "Kestrel WebServer": {
+ "commandName": "Project",
+ "launchBrowser": false,
+ "environmentVariables": {
+ "$STORAGE_ROOT": "../../Data",
+ "log__name": "migration",
+ "log__dir": "../../Logs",
+ "ASPNETCORE_URLS": "http://localhost:5034",
+ "ASPNETCORE_ENVIRONMENT": "Development"
+ }
+ },
+ "WSL 2 : Ubuntu 20.04": {
+ "commandName": "WSL2",
+ "launchBrowser": false,
+ "launchUrl": "http://localhost:5034",
+ "environmentVariables": {
+ "$STORAGE_ROOT": "../../Data",
+ "log__name": "migration",
+ "log__dir": "../../Logs",
+ "ASPNETCORE_URLS": "http://localhost:5034",
+ "ASPNETCORE_ENVIRONMENT": "Development"
+ },
+ "distributionName": "Ubuntu-20.04"
+ }
+ }
}
\ No newline at end of file
diff --git a/common/ASC.Migration/Startup.cs b/common/ASC.Migration.BackgroundTasks/Startup.cs
similarity index 97%
rename from common/ASC.Migration/Startup.cs
rename to common/ASC.Migration.BackgroundTasks/Startup.cs
index e7a96ec86d..6eb27d2805 100644
--- a/common/ASC.Migration/Startup.cs
+++ b/common/ASC.Migration.BackgroundTasks/Startup.cs
@@ -1,45 +1,45 @@
-// (c) Copyright Ascensio System SIA 2010-2022
-//
-// This program is a free software product.
-// You can redistribute it and/or modify it under the terms
-// of the GNU Affero General Public License (AGPL) version 3 as published by the Free Software
-// Foundation. In accordance with Section 7(a) of the GNU AGPL its Section 15 shall be amended
-// to the effect that Ascensio System SIA expressly excludes the warranty of non-infringement of
-// any third-party rights.
-//
-// This program is distributed WITHOUT ANY WARRANTY, without even the implied warranty
-// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For details, see
-// the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
-//
-// You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia, EU, LV-1021.
-//
-// The interactive user interfaces in modified source and object code versions of the Program must
-// display Appropriate Legal Notices, as required under Section 5 of the GNU AGPL version 3.
-//
-// Pursuant to Section 7(b) of the License you must retain the original Product logo when
-// distributing the program. Pursuant to Section 7(e) we decline to grant you any rights under
-// trademark law for use of our trademarks.
-//
-// All the Product's GUI elements, including illustrations and icon sets, as well as technical writing
-// content are licensed under the terms of the Creative Commons Attribution-ShareAlike 4.0
-// International. See the License terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
-
-namespace ASC.Migration;
-
-public class Startup : BaseStartup
-{
- public Startup(IConfiguration configuration, IHostEnvironment hostEnvironment)
- : base(configuration, hostEnvironment)
- {
-
- }
-
- public override void ConfigureServices(IServiceCollection services)
- {
- Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
-
- services.AddMemoryCache();
-
- base.ConfigureServices(services);
- }
+// (c) Copyright Ascensio System SIA 2010-2022
+//
+// This program is a free software product.
+// You can redistribute it and/or modify it under the terms
+// of the GNU Affero General Public License (AGPL) version 3 as published by the Free Software
+// Foundation. In accordance with Section 7(a) of the GNU AGPL its Section 15 shall be amended
+// to the effect that Ascensio System SIA expressly excludes the warranty of non-infringement of
+// any third-party rights.
+//
+// This program is distributed WITHOUT ANY WARRANTY, without even the implied warranty
+// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For details, see
+// the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
+//
+// You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia, EU, LV-1021.
+//
+// The interactive user interfaces in modified source and object code versions of the Program must
+// display Appropriate Legal Notices, as required under Section 5 of the GNU AGPL version 3.
+//
+// Pursuant to Section 7(b) of the License you must retain the original Product logo when
+// distributing the program. Pursuant to Section 7(e) we decline to grant you any rights under
+// trademark law for use of our trademarks.
+//
+// All the Product's GUI elements, including illustrations and icon sets, as well as technical writing
+// content are licensed under the terms of the Creative Commons Attribution-ShareAlike 4.0
+// International. See the License terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
+
+namespace ASC.Migration;
+
+public class Startup : BaseStartup
+{
+ public Startup(IConfiguration configuration, IHostEnvironment hostEnvironment)
+ : base(configuration, hostEnvironment)
+ {
+
+ }
+
+ public override void ConfigureServices(IServiceCollection services)
+ {
+ Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
+
+ services.AddMemoryCache();
+
+ base.ConfigureServices(services);
+ }
}
diff --git a/common/ASC.Migration.BackgroundTasks/appsettings.json b/common/ASC.Migration.BackgroundTasks/appsettings.json
new file mode 100644
index 0000000000..9bf702e310
--- /dev/null
+++ b/common/ASC.Migration.BackgroundTasks/appsettings.json
@@ -0,0 +1,3 @@
+{
+ "pathToConf": "..\\..\\..\\config"
+}
diff --git a/common/ASC.Migration/ASC.Migration.csproj b/common/ASC.Migration/ASC.Migration.Core.csproj
similarity index 62%
rename from common/ASC.Migration/ASC.Migration.csproj
rename to common/ASC.Migration/ASC.Migration.Core.csproj
index 2f66287406..f6ca6ddf75 100644
--- a/common/ASC.Migration/ASC.Migration.csproj
+++ b/common/ASC.Migration/ASC.Migration.Core.csproj
@@ -1,17 +1,14 @@
-
+net7.0false
- ASC.Migration
+ ASC.Migration.CoreAscensio System SIAASC.Migration(c) Ascensio System SIA. All rights reservedenablefalse
- false
- false
- true
@@ -20,15 +17,34 @@
1701;1702;NU1701
-
-
-
-
+
+
+
+
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+ True
+ True
+ MigrationResource.resx
+
+
+
+
+
+ PublicResXFileCodeGenerator
+ MigrationResource.Designer.cs
+
\ No newline at end of file
diff --git a/common/ASC.Migration/GlobalUsings.cs b/common/ASC.Migration/GlobalUsings.cs
index e4648209ff..fc803d9b26 100644
--- a/common/ASC.Migration/GlobalUsings.cs
+++ b/common/ASC.Migration/GlobalUsings.cs
@@ -26,36 +26,26 @@
global using System.IO.Compression;
global using System.Reflection;
-global using System.Runtime.Caching;
global using System.Runtime.Serialization;
global using System.Text;
global using System.Text.Json.Serialization;
global using System.Text.RegularExpressions;
-global using ASC.Api.Core;
-global using ASC.Api.Core.Extensions;
global using ASC.Common;
-global using ASC.Common.Caching;
global using ASC.Common.Log;
-global using ASC.Common.Web;
global using ASC.Core;
global using ASC.Core.Users;
global using ASC.Files.Core;
global using ASC.Files.Core.Resources;
global using ASC.Files.Core.Security;
-global using ASC.Migration;
-global using ASC.Migration.ApiModels.ResponseDto;
global using ASC.Migration.Core;
global using ASC.Migration.Core.Models;
global using ASC.Migration.Core.Models.Api;
+global using ASC.Migration.Core.Resources;
global using ASC.Migration.GoogleWorkspace.Models;
global using ASC.Migration.GoogleWorkspace.Models.Parse;
-global using ASC.Migration.Resources;
-global using ASC.Web.Api.Routing;
-global using ASC.Web.Core.Files;
global using ASC.Web.Files.Classes;
global using ASC.Web.Files.Services.WCFService;
-global using ASC.Web.Studio.Core.Notify;
global using Autofac;
@@ -63,11 +53,8 @@ global using HtmlAgilityPack;
global using Ical.Net;
-global using Microsoft.AspNetCore.Mvc;
-global using Microsoft.Extensions.Hosting.WindowsServices;
+global using Microsoft.Extensions.Logging;
global using MimeKit;
global using Newtonsoft.Json;
-
-global using NLog;
diff --git a/common/ASC.Migration/Resources/MigrationResource.Designer.cs b/common/ASC.Migration/Resources/MigrationResource.Designer.cs
index ed393ee965..a49a20889d 100644
--- a/common/ASC.Migration/Resources/MigrationResource.Designer.cs
+++ b/common/ASC.Migration/Resources/MigrationResource.Designer.cs
@@ -8,7 +8,7 @@
//
//------------------------------------------------------------------------------
-namespace ASC.Migration.Resources {
+namespace ASC.Migration.Core.Resources {
using System;
@@ -19,10 +19,10 @@ namespace ASC.Migration.Resources {
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
- internal class MigrationResource {
+ public class MigrationResource {
private static global::System.Resources.ResourceManager resourceMan;
@@ -36,10 +36,10 @@ namespace ASC.Migration.Resources {
/// Returns the cached ResourceManager instance used by this class.
///
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
- internal static global::System.Resources.ResourceManager ResourceManager {
+ public static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
- global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ASC.Migration.Resources.MigrationResource", typeof(MigrationResource).Assembly);
+ global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ASC.Migration.Core.Resources.MigrationResource", typeof(MigrationResource).Assembly);
resourceMan = temp;
}
return resourceMan;
@@ -51,7 +51,7 @@ namespace ASC.Migration.Resources {
/// resource lookups using this strongly typed resource class.
///
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
- internal static global::System.Globalization.CultureInfo Culture {
+ public static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
@@ -63,7 +63,7 @@ namespace ASC.Migration.Resources {
///
/// Looks up a localized string similar to Clearing temporary data.
///
- internal static string ClearingTemporaryData {
+ public static string ClearingTemporaryData {
get {
return ResourceManager.GetString("ClearingTemporaryData", resourceCulture);
}
@@ -72,7 +72,7 @@ namespace ASC.Migration.Resources {
///
/// Looks up a localized string similar to Data processing....
///
- internal static string DataProcessing {
+ public static string DataProcessing {
get {
return ResourceManager.GetString("DataProcessing", resourceCulture);
}
@@ -81,7 +81,7 @@ namespace ASC.Migration.Resources {
///
/// Looks up a localized string similar to Data processing completed.
///
- internal static string DataProcessingCompleted {
+ public static string DataProcessingCompleted {
get {
return ResourceManager.GetString("DataProcessingCompleted", resourceCulture);
}
@@ -90,7 +90,7 @@ namespace ASC.Migration.Resources {
///
/// Looks up a localized string similar to Database parsing.
///
- internal static string DumpParse {
+ public static string DumpParse {
get {
return ResourceManager.GetString("DumpParse", resourceCulture);
}
@@ -99,7 +99,7 @@ namespace ASC.Migration.Resources {
///
/// Looks up a localized string similar to Mail`s Contacts.
///
- internal static string GoogleModuleNameContacts {
+ public static string GoogleModuleNameContacts {
get {
return ResourceManager.GetString("GoogleModuleNameContacts", resourceCulture);
}
@@ -108,7 +108,7 @@ namespace ASC.Migration.Resources {
///
/// Looks up a localized string similar to Google Drive`s Files.
///
- internal static string GoogleModuleNameDocuments {
+ public static string GoogleModuleNameDocuments {
get {
return ResourceManager.GetString("GoogleModuleNameDocuments", resourceCulture);
}
@@ -117,7 +117,7 @@ namespace ASC.Migration.Resources {
///
/// Looks up a localized string similar to Group migration {0} ({1}/{2}).
///
- internal static string GroupMigration {
+ public static string GroupMigration {
get {
return ResourceManager.GetString("GroupMigration", resourceCulture);
}
@@ -126,7 +126,7 @@ namespace ASC.Migration.Resources {
///
/// Looks up a localized string similar to Migrating user contacts {0} ({1}/{2}).
///
- internal static string MigratingUserContacts {
+ public static string MigratingUserContacts {
get {
return ResourceManager.GetString("MigratingUserContacts", resourceCulture);
}
@@ -135,7 +135,7 @@ namespace ASC.Migration.Resources {
///
/// Looks up a localized string similar to Migrating user files {0} ({1}/{2}).
///
- internal static string MigratingUserFiles {
+ public static string MigratingUserFiles {
get {
return ResourceManager.GetString("MigratingUserFiles", resourceCulture);
}
@@ -144,7 +144,7 @@ namespace ASC.Migration.Resources {
///
/// Looks up a localized string similar to Migration canceled.
///
- internal static string MigrationCanceled {
+ public static string MigrationCanceled {
get {
return ResourceManager.GetString("MigrationCanceled", resourceCulture);
}
@@ -153,16 +153,61 @@ namespace ASC.Migration.Resources {
///
/// Looks up a localized string similar to Migration completed.
///
- internal static string MigrationCompleted {
+ public static string MigrationCompleted {
get {
return ResourceManager.GetString("MigrationCompleted", resourceCulture);
}
}
+ ///
+ /// Looks up a localized string similar to Error while initializing {0} migrator.
+ ///
+ public static string MigrationInitException {
+ get {
+ return ResourceManager.GetString("MigrationInitException", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to No such migration provider.
+ ///
+ public static string MigrationNotFoundException {
+ get {
+ return ResourceManager.GetString("MigrationNotFoundException", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to No migration is in progress.
+ ///
+ public static string MigrationProgressException {
+ get {
+ return ResourceManager.GetString("MigrationProgressException", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Parsing is still in progress.
+ ///
+ public static string MigrationStartException {
+ get {
+ return ResourceManager.GetString("MigrationStartException", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Migration is already in progress.
+ ///
+ public static string MigrationUploadException {
+ get {
+ return ResourceManager.GetString("MigrationUploadException", resourceCulture);
+ }
+ }
+
///
/// Looks up a localized string similar to Calendar.
///
- internal static string ModuleNameCalendar {
+ public static string ModuleNameCalendar {
get {
return ResourceManager.GetString("ModuleNameCalendar", resourceCulture);
}
@@ -171,7 +216,7 @@ namespace ASC.Migration.Resources {
///
/// Looks up a localized string similar to Groups.
///
- internal static string ModuleNameGroups {
+ public static string ModuleNameGroups {
get {
return ResourceManager.GetString("ModuleNameGroups", resourceCulture);
}
@@ -180,7 +225,7 @@ namespace ASC.Migration.Resources {
///
/// Looks up a localized string similar to Mail.
///
- internal static string ModuleNameMail {
+ public static string ModuleNameMail {
get {
return ResourceManager.GetString("ModuleNameMail", resourceCulture);
}
@@ -189,7 +234,7 @@ namespace ASC.Migration.Resources {
///
/// Looks up a localized string similar to Users.
///
- internal static string ModuleNameUsers {
+ public static string ModuleNameUsers {
get {
return ResourceManager.GetString("ModuleNameUsers", resourceCulture);
}
@@ -198,7 +243,7 @@ namespace ASC.Migration.Resources {
///
/// Looks up a localized string similar to Contacts.
///
- internal static string NextcloudModuleNameContacts {
+ public static string NextcloudModuleNameContacts {
get {
return ResourceManager.GetString("NextcloudModuleNameContacts", resourceCulture);
}
@@ -207,7 +252,7 @@ namespace ASC.Migration.Resources {
///
/// Looks up a localized string similar to User`s Files.
///
- internal static string NextcloudModuleNameDocuments {
+ public static string NextcloudModuleNameDocuments {
get {
return ResourceManager.GetString("NextcloudModuleNameDocuments", resourceCulture);
}
@@ -216,7 +261,7 @@ namespace ASC.Migration.Resources {
///
/// Looks up a localized string similar to Calendar.
///
- internal static string OnlyofficeModuleNameCalendar {
+ public static string OnlyofficeModuleNameCalendar {
get {
return ResourceManager.GetString("OnlyofficeModuleNameCalendar", resourceCulture);
}
@@ -225,7 +270,7 @@ namespace ASC.Migration.Resources {
///
/// Looks up a localized string similar to Documents.
///
- internal static string OnlyofficeModuleNameDocuments {
+ public static string OnlyofficeModuleNameDocuments {
get {
return ResourceManager.GetString("OnlyofficeModuleNameDocuments", resourceCulture);
}
@@ -234,7 +279,7 @@ namespace ASC.Migration.Resources {
///
/// Looks up a localized string similar to Mail.
///
- internal static string OnlyofficeModuleNameMail {
+ public static string OnlyofficeModuleNameMail {
get {
return ResourceManager.GetString("OnlyofficeModuleNameMail", resourceCulture);
}
@@ -243,7 +288,7 @@ namespace ASC.Migration.Resources {
///
/// Looks up a localized string similar to People.
///
- internal static string OnlyofficeModuleNamePeople {
+ public static string OnlyofficeModuleNamePeople {
get {
return ResourceManager.GetString("OnlyofficeModuleNamePeople", resourceCulture);
}
@@ -252,7 +297,7 @@ namespace ASC.Migration.Resources {
///
/// Looks up a localized string similar to Preparing for migration.
///
- internal static string PreparingForMigration {
+ public static string PreparingForMigration {
get {
return ResourceManager.GetString("PreparingForMigration", resourceCulture);
}
@@ -261,7 +306,7 @@ namespace ASC.Migration.Resources {
///
/// Looks up a localized string similar to Starting data processing....
///
- internal static string StartOfDataProcessing {
+ public static string StartOfDataProcessing {
get {
return ResourceManager.GetString("StartOfDataProcessing", resourceCulture);
}
@@ -270,7 +315,7 @@ namespace ASC.Migration.Resources {
///
/// Looks up a localized string similar to Unzipping....
///
- internal static string Unzipping {
+ public static string Unzipping {
get {
return ResourceManager.GetString("Unzipping", resourceCulture);
}
@@ -279,7 +324,7 @@ namespace ASC.Migration.Resources {
///
/// Looks up a localized string similar to Unzipping completed....
///
- internal static string UnzippingFinished {
+ public static string UnzippingFinished {
get {
return ResourceManager.GetString("UnzippingFinished", resourceCulture);
}
@@ -288,7 +333,7 @@ namespace ASC.Migration.Resources {
///
/// Looks up a localized string similar to User calendar migration {0} ({1}/{2}).
///
- internal static string UserCalendarMigration {
+ public static string UserCalendarMigration {
get {
return ResourceManager.GetString("UserCalendarMigration", resourceCulture);
}
@@ -297,7 +342,7 @@ namespace ASC.Migration.Resources {
///
/// Looks up a localized string similar to User migration {0} ({1}/{2}).
///
- internal static string UserMigration {
+ public static string UserMigration {
get {
return ResourceManager.GetString("UserMigration", resourceCulture);
}
@@ -306,7 +351,7 @@ namespace ASC.Migration.Resources {
///
/// Looks up a localized string similar to Failed to import user: {0} ({1}/{2}).
///
- internal static string UserSkipped {
+ public static string UserSkipped {
get {
return ResourceManager.GetString("UserSkipped", resourceCulture);
}
diff --git a/common/ASC.Migration/Resources/MigrationResource.resx b/common/ASC.Migration/Resources/MigrationResource.resx
index b7d7f30210..6e36bc6643 100644
--- a/common/ASC.Migration/Resources/MigrationResource.resx
+++ b/common/ASC.Migration/Resources/MigrationResource.resx
@@ -150,6 +150,21 @@
Migration completed
+
+ Error while initializing {0} migrator
+
+
+ No such migration provider
+
+
+ No migration is in progress
+
+
+ Parsing is still in progress
+
+
+ Migration is already in progress
+
Calendar
diff --git a/web/ASC.Web.Api/ASC.Web.Api.csproj b/web/ASC.Web.Api/ASC.Web.Api.csproj
index 7d45d01b90..1ea8684f59 100644
--- a/web/ASC.Web.Api/ASC.Web.Api.csproj
+++ b/web/ASC.Web.Api/ASC.Web.Api.csproj
@@ -49,6 +49,7 @@
+
diff --git a/common/ASC.Migration/Api/MigrationController.cs b/web/ASC.Web.Api/Api/MigrationController.cs
similarity index 87%
rename from common/ASC.Migration/Api/MigrationController.cs
rename to web/ASC.Web.Api/Api/MigrationController.cs
index e43a723d8f..e6a78e7636 100644
--- a/common/ASC.Migration/Api/MigrationController.cs
+++ b/web/ASC.Web.Api/Api/MigrationController.cs
@@ -1,61 +1,63 @@
-// (c) Copyright Ascensio System SIA 2010-2022
-//
-// This program is a free software product.
-// You can redistribute it and/or modify it under the terms
-// of the GNU Affero General Public License (AGPL) version 3 as published by the Free Software
-// Foundation. In accordance with Section 7(a) of the GNU AGPL its Section 15 shall be amended
-// to the effect that Ascensio System SIA expressly excludes the warranty of non-infringement of
-// any third-party rights.
-//
-// This program is distributed WITHOUT ANY WARRANTY, without even the implied warranty
-// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For details, see
-// the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
-//
-// You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia, EU, LV-1021.
-//
-// The interactive user interfaces in modified source and object code versions of the Program must
-// display Appropriate Legal Notices, as required under Section 5 of the GNU AGPL version 3.
-//
-// Pursuant to Section 7(b) of the License you must retain the original Product logo when
-// distributing the program. Pursuant to Section 7(e) we decline to grant you any rights under
-// trademark law for use of our trademarks.
-//
-// All the Product's GUI elements, including illustrations and icon sets, as well as technical writing
-// content are licensed under the terms of the Creative Commons Attribution-ShareAlike 4.0
-// International. See the License terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
-
+// (c) Copyright Ascensio System SIA 2010-2022
+//
+// This program is a free software product.
+// You can redistribute it and/or modify it under the terms
+// of the GNU Affero General Public License (AGPL) version 3 as published by the Free Software
+// Foundation. In accordance with Section 7(a) of the GNU AGPL its Section 15 shall be amended
+// to the effect that Ascensio System SIA expressly excludes the warranty of non-infringement of
+// any third-party rights.
+//
+// This program is distributed WITHOUT ANY WARRANTY, without even the implied warranty
+// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For details, see
+// the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
+//
+// You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia, EU, LV-1021.
+//
+// The interactive user interfaces in modified source and object code versions of the Program must
+// display Appropriate Legal Notices, as required under Section 5 of the GNU AGPL version 3.
+//
+// Pursuant to Section 7(b) of the License you must retain the original Product logo when
+// distributing the program. Pursuant to Section 7(e) we decline to grant you any rights under
+// trademark law for use of our trademarks.
+//
+// All the Product's GUI elements, including illustrations and icon sets, as well as technical writing
+// content are licensed under the terms of the Creative Commons Attribution-ShareAlike 4.0
+// International. See the License terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
+
+using ASC.Migration.Core.Resources;
+
namespace ASC.Api.Migration;
-
+
[Scope]
[DefaultRoute]
[ApiController]
public class MigrationController : ControllerBase
-{
- private const string MigrationCacheKey = "ASC.Migration.Ongoing";
- private readonly CoreBaseSettings _coreBaseSettings;
- private readonly UserManager _userManager;
- private readonly AuthContext _authContext;
- private readonly TempPath _tempPath;
- private readonly StudioNotifyService _studioNotifyService;
- private readonly ICache _cache;
- private readonly IHttpContextAccessor _httpContextAccessor;
-
- public MigrationController(
- CoreBaseSettings coreBaseSettings,
- UserManager userManager,
- AuthContext authContext,
- TempPath tempPath,
- StudioNotifyService studioNotifyService,
- ICache cache,
+{
+ private const string MigrationCacheKey = "ASC.Migration.Ongoing";
+ private readonly CoreBaseSettings _coreBaseSettings;
+ private readonly UserManager _userManager;
+ private readonly AuthContext _authContext;
+ private readonly TempPath _tempPath;
+ private readonly StudioNotifyService _studioNotifyService;
+ private readonly ICache _cache;
+ private readonly IHttpContextAccessor _httpContextAccessor;
+
+ public MigrationController(
+ CoreBaseSettings coreBaseSettings,
+ UserManager userManager,
+ AuthContext authContext,
+ TempPath tempPath,
+ StudioNotifyService studioNotifyService,
+ ICache cache,
IHttpContextAccessor httpContextAccessor)
- {
- _coreBaseSettings = coreBaseSettings;
- _userManager = userManager;
- _authContext = authContext;
- _tempPath = tempPath;
- _studioNotifyService = studioNotifyService;
- _cache = cache;
- _httpContextAccessor = httpContextAccessor;
+ {
+ _coreBaseSettings = coreBaseSettings;
+ _userManager = userManager;
+ _authContext = authContext;
+ _tempPath = tempPath;
+ _studioNotifyService = studioNotifyService;
+ _cache = cache;
+ _httpContextAccessor = httpContextAccessor;
}
///
@@ -65,11 +67,11 @@ public class MigrationController : ControllerBase
[HttpGet("backuptmp")]
public async Task GetTmpFolderAsync()
{
- if (!_coreBaseSettings.Standalone || !await _userManager.IsDocSpaceAdminAsync(_authContext.CurrentAccount.ID))
- {
- throw new System.Security.SecurityException();
- }
-
+ if (!_coreBaseSettings.Standalone || !await _userManager.IsDocSpaceAdminAsync(_authContext.CurrentAccount.ID))
+ {
+ throw new SecurityException(Resource.ErrorAccessDenied);
+ }
+
var tempFolder = Path.Combine(_tempPath.GetTempPath(), "migration", DateTime.Now.ToString("dd.MM.yyyy_HH_mm"));
if (!Directory.Exists(tempFolder))
@@ -86,11 +88,11 @@ public class MigrationController : ControllerBase
[HttpGet("list")]
public async Task ListAsync()
{
- if (!_coreBaseSettings.Standalone || !await _userManager.IsDocSpaceAdminAsync(_authContext.CurrentAccount.ID))
- {
- throw new System.Security.SecurityException();
- }
-
+ if (!_coreBaseSettings.Standalone || !await _userManager.IsDocSpaceAdminAsync(_authContext.CurrentAccount.ID))
+ {
+ throw new SecurityException(Resource.ErrorAccessDenied);
+ }
+
return MigrationCore.GetAvailableMigrations();
}
@@ -102,20 +104,20 @@ public class MigrationController : ControllerBase
[HttpPost("init/{migratorName}")]
public async Task UploadAndInitAsync(string migratorName, string path)
{
- if (!_coreBaseSettings.Standalone || !await _userManager.IsDocSpaceAdminAsync(_authContext.CurrentAccount.ID))
- {
- throw new System.Security.SecurityException();
- }
-
+ if (!_coreBaseSettings.Standalone || !await _userManager.IsDocSpaceAdminAsync(_authContext.CurrentAccount.ID))
+ {
+ throw new SecurityException(Resource.ErrorAccessDenied);
+ }
+
if (GetOngoingMigration() != null)
{
- throw new Exception("Migration is already in progress");
+ throw new Exception(MigrationResource.MigrationUploadException);
}
var migratorMeta = MigrationCore.GetMigrator(migratorName);
if (migratorMeta == null)
{
- throw new ItemNotFoundException("No such migration provider");
+ throw new ItemNotFoundException(MigrationResource.MigrationNotFoundException);
}
var cts = new CancellationTokenSource();
var migrator = (IMigration)Activator.CreateInstance(migratorMeta.MigratorType);
@@ -125,7 +127,7 @@ public class MigrationController : ControllerBase
}
catch (Exception ex)
{
- throw new Exception($"Error while initializing {migratorMeta.MigratorInfo.Name} migrator", ex);
+ throw new Exception(string.Format(MigrationResource.MigrationUploadException, migratorMeta.MigratorInfo.Name), ex);
}
var ongoingMigration = new OngoingMigration { Migration = migrator, CancelTokenSource = cts };
@@ -141,11 +143,11 @@ public class MigrationController : ControllerBase
[HttpGet("status")]
public async Task