Skip to content

Commit 30de204

Browse files
authored
Merge pull request #575 from Kentico/develop
Release 4.1.0
2 parents bb18ef6 + 64028f4 commit 30de204

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+2952
-241
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ What went wrong?
99

1010
## Output logs
1111

12-
Please include the command line output log file and migration protocol generated for your `Migration.Tool.CLI.exe migrate` command.
12+
Please include the command line output log file generated for your `Migration.Tool.CLI.exe migrate` command.
1313

1414
### Repro steps
1515

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@ appsettings.local.json
88
.vs/
99
*.sln.DotSettings.user
1010
Migration.Tool.CLI/appsettings.local.json_
11+
.nuget/nuget.exe
1112

1213
# MCP server definitions
1314
mcp.json
1415
claude_desktop_config.json
15-
mcp_config.json
16+
mcp_config.json
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Migration.Tool.Source (KVA/)
2+
3+
> **Advanced Customization:** This is an internal abstraction layer. Most users do not need to modify this project. Only modify this if you are contributing to the migration tool itself or need to customize advanced features like [automatic image optimization during migration](https://docs.kentico.com/x/optimize_images_during_upgrade_guides).
4+
5+
## Purpose
6+
7+
Provides version-agnostic abstractions and shared interfaces used by all version-specific Core projects (K11/KX12/KX13). This acts as a bridge between the core infrastructure (Common) and version-specific implementations.
8+
9+
Located in the `KVA/` solution folder to indicate it's part of the Kentico Version Abstraction layer.
10+
11+
## Key Components
12+
13+
- **Source Entity Abstractions** - Interfaces defining common properties across K11/KX12/KX13 entities
14+
- **Repository Patterns** - Shared patterns for querying source databases
15+
- **Source API Contracts** - Common interfaces for source instance API calls (e.g., widget metadata discovery)
16+
- **Mapping Helpers** - Utility functions used across all version-specific implementations
17+
- **Source Configuration** - Source instance connection and configuration models
18+
19+
## Architecture Role
20+
21+
```
22+
Migration.Tool.Common
23+
24+
Migration.Tool.Source ← Abstraction layer (this project)
25+
26+
Core.K11 / Core.KX12 / Core.KX13 ← Version-specific implementations
27+
28+
K11 / KX12 / KX13 ← Source database models
29+
```
30+
31+
This allows Core projects to share common logic while implementing version-specific behavior where source CMS versions differ.

KX13.Extensions/README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# KX13.Extensions
2+
3+
> **Minimal User Interaction:** This project provides API controllers that you deploy to your KX13 source instance for widget metadata discovery. Most users only need to copy the controller file to their source instance - no modification required.
4+
5+
## Purpose
6+
7+
Required when migrating **Page Builder widgets** from KX13. Provides ASP.NET Core API controllers that expose widget metadata (available properties, data types, default values) from your source instance. The migration tool calls these APIs to retrieve Page Builder widget configurations that are not stored in the database.
8+
9+
## Setup
10+
11+
For complete setup instructions, see [Source instance API discovery](../Migration.Tool.CLI/README.md#api-discovery-setup) in the Migration.Tool.CLI README.
12+
13+
**Quick summary:**
14+
1. Copy `ToolApiController.cs` to your KX13 source instance's `Controllers` folder
15+
2. Register the controller route in `Startup.cs` or `Program.cs`
16+
3. Set a secret value in the controller
17+
4. Configure the migration tool's `appsettings.json` with the matching secret
18+
19+
## Technical Details
20+
21+
- ASP.NET Core 3.1+ compatible (use `ToolApiController.NET48.cs` for .NET Framework 4.8 projects)
22+
- Reads widget registrations from the Kentico API
23+
- Returns JSON metadata consumed by the migration tool
24+
- Requires matching secret between controller and migration tool configuration
25+
26+
Most users will not need to modify this code. Contributors may extend it to expose additional widget metadata or handle custom widget registration patterns.

KX13.NET48.Extensions/README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# KX13.NET48.Extensions
2+
3+
> **Minimal User Interaction:** This project provides API controllers for .NET Framework 4.8 KX13 instances. Most users only need to copy the controller file to their source instance - no modification required.
4+
5+
## Purpose
6+
7+
Required when migrating **Page Builder widgets** from KX13 instances running on **.NET Framework 4.8** (not ASP.NET Core). Provides ASP.NET MVC API controllers that expose widget metadata (available properties, data types, default values) from your source instance. If your KX13 instance runs on ASP.NET Core, use the `KX13.Extensions` project instead.
8+
9+
## Setup
10+
11+
For complete setup instructions, see [Source instance API discovery](../Migration.Tool.CLI/README.md#api-discovery-setup) in the Migration.Tool.CLI README.
12+
13+
**Quick summary:**
14+
1. Copy `ToolApiController.NET48.cs` to your KX13 source instance's `Controllers` folder
15+
2. Register the controller route in `/App_Start/RouteConfig.cs`
16+
3. Set a secret value in the controller
17+
4. Configure the migration tool's `appsettings.json` with the matching secret
18+
19+
## Technical Details
20+
21+
- ASP.NET MVC (not Core) - for .NET Framework 4.8
22+
- Uses `System.Web.Http` instead of `Microsoft.AspNetCore.Mvc`
23+
- Returns JSON metadata consumed by the migration tool
24+
- Requires matching secret between controller and migration tool configuration
25+
26+
Most users will not need to modify this code. Use this project only if your KX13 source instance runs on .NET Framework 4.8 instead of ASP.NET Core.

Migration.Tool.CLI/ConfigurationValidator.cs

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,40 @@ public static IEnumerable<ValidationMessage> GetValidationErrors(IConfigurationR
157157
}
158158

159159
#endregion
160+
161+
#region Commerce configuration validation
162+
163+
var commerceConfiguration = settings?.GetSection(ConfigurationNames.CommerceConfiguration);
164+
if (commerceConfiguration is not null)
165+
{
166+
var commerceSiteNames = commerceConfiguration.GetSection(ConfigurationNames.CommerceSiteNames).Get<List<string>?>();
167+
if (commerceSiteNames is null || commerceSiteNames.Count == 0)
168+
{
169+
yield return new ValidationMessage(ValidationMessageType.Error,
170+
$"'{ConfigurationNames.CommerceConfiguration}:{ConfigurationNames.CommerceSiteNames}' must contain at least one site name when '{ConfigurationNames.CommerceConfiguration}' is specified.");
171+
}
172+
else if (commerceSiteNames.Any(string.IsNullOrWhiteSpace))
173+
{
174+
yield return new ValidationMessage(ValidationMessageType.Error,
175+
$"'{ConfigurationNames.CommerceConfiguration}:{ConfigurationNames.CommerceSiteNames}' cannot contain empty or whitespace values.");
176+
}
177+
178+
var systemFieldPrefix = commerceConfiguration.GetValue<string?>(ConfigurationNames.SystemFieldPrefix);
179+
if (systemFieldPrefix is not null && string.IsNullOrWhiteSpace(systemFieldPrefix))
180+
{
181+
yield return new ValidationMessage(ValidationMessageType.Error,
182+
$"'{ConfigurationNames.CommerceConfiguration}:{ConfigurationNames.SystemFieldPrefix}' cannot be empty or whitespace when specified. Either provide a valid prefix value or remove the configuration to use the default.");
183+
}
184+
185+
var orderStatuses = commerceConfiguration.GetValue<Dictionary<string, string[]>>(ConfigurationNames.OrderStatuses);
186+
if (orderStatuses is not null && orderStatuses.Count == 0)
187+
{
188+
yield return new ValidationMessage(ValidationMessageType.Error,
189+
$"'{ConfigurationNames.CommerceConfiguration}:{ConfigurationNames.OrderStatuses}' must contain at least one order status from XbK counterpart.");
190+
}
191+
}
192+
193+
#endregion
160194
}
161195

162196
#region "Helper methods"

0 commit comments

Comments
 (0)