Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

release v1.1.0 #208

Merged
merged 23 commits into from
Jul 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
e3dd8ac
MT-28 XbyK upgrade 29.2.0 & obsolete configuration removed
tkrch Jul 2, 2024
3b912c3
MT-28 legacy XbyK DB model regeneration + implied fixes
tkrch Jul 2, 2024
7401a2a
MT-17 migration of documents with non-unique DocumentGuid
tkrch Jul 3, 2024
f9c273a
MT-17 non-unique DocumentGUID & NodeGUID support
tkrch Jul 9, 2024
a0214b5
MT-17 cleanup
tkrch Jul 9, 2024
b318df1
#184 deprecation of XbKConnectionString
tkrch Jul 14, 2024
d69d071
#184 deprecation of XbKConnectionString - md file update
tkrch Jul 14, 2024
73ba959
#198 migration of media file refactor; fails for member users resoved
tkrch Jul 14, 2024
385963b
Merge pull request #205 from Kentico/fix/184_deprecation_of_XbKConnec…
fialafilip Jul 15, 2024
9d815ec
Merge pull request #206 from Kentico/fix/198_media_migration_non_admi…
fialafilip Jul 15, 2024
9e2a34c
confict resolving in relation to master branch
tkrch Jul 15, 2024
e677291
solution reformat to match master formatting
tkrch Jul 15, 2024
9f5f9df
conflicts resolving
tkrch Jul 15, 2024
17fd926
eol crlf
tkrch Jul 15, 2024
4e5fc0a
dotnet format autofix
tkrch Jul 15, 2024
ec82551
merge conflicts fix
tkrch Jul 16, 2024
f650f95
.editorconfig update & global reformat
tkrch Jul 16, 2024
f5c66ae
reformat and code cleanup
tkrch Jul 16, 2024
e0806a9
Merge branch 'master' into rls/v1.1.0
tkrch Jul 16, 2024
42ce815
dotnet format uncommented
tkrch Jul 22, 2024
45d664a
Feat/199 unpublished doc versions published (#209)
tkrch Jul 22, 2024
d2e4440
naming conventions update, obsolete class removal
tkrch Jul 22, 2024
94f5c49
handling of multiple attachments with same guid in source instance - …
tkrch Jul 22, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Severity levels of analyzers https://docs.microsoft.com/en-us/visualstudio/code-quality/roslyn-analyzers-overview?view=vs-2019#severity-levels-of-analyzers
# Severity levels of analyzers https://docs.microsoft.com/en-us/visualstudio/code-quality/roslyn-analyzers-overview?view=vs-2019#severity-levels-of-analyzers

root = true

Expand Down
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text eol=crlf
154 changes: 77 additions & 77 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,77 +1,77 @@
name: "CI: Build and Test"
on:
push:
branches: [master]
paths:
- "**.cs"
- "**.tsx"
- "**.js"
- "**.csproj"
- "**.props"
- "**.targets"
- "**.sln"
pull_request:
branches: [master]
paths:
- ".github/workflows/build.yml"
- "**.cs"
- "**.cshtml"
- "**.tsx"
- "**.js"
- "**.json"
- "**.csproj"
- "**.props"
- "**.targets"
- "**.sln"
jobs:
dotnet-format:
name: .Net Format Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# - name: Run dotnet format
# run: dotnet format --exclude ./examples/** --verify-no-changes
build_and_test:
name: Build and Test
runs-on: ubuntu-latest
needs: dotnet-format
defaults:
run:
shell: pwsh
env:
ASPNETCORE_ENVIRONMENT: CI
DOTNET_CLI_TELEMETRY_OPTOUT: 1
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
DOTNET_NOLOGO: 1
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
global-json-file: global.json
- name: Install dependencies
run: |
dotnet restore `
--locked-mode
- name: Build Solution
run: |
dotnet build `
--configuration Release `
--no-restore
- name: Test Solution
run: |
dotnet test `
--configuration Release `
--no-build `
--no-restore
name: "CI: Build and Test"

on:
push:
branches: [master]
paths:
- "**.cs"
- "**.tsx"
- "**.js"
- "**.csproj"
- "**.props"
- "**.targets"
- "**.sln"
pull_request:
branches: [master]
paths:
- ".github/workflows/build.yml"
- "**.cs"
- "**.cshtml"
- "**.tsx"
- "**.js"
- "**.json"
- "**.csproj"
- "**.props"
- "**.targets"
- "**.sln"

jobs:
dotnet-format:
name: .Net Format Check
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Run dotnet format
run: dotnet format --exclude ./examples/** --verify-no-changes

build_and_test:
name: Build and Test
runs-on: ubuntu-latest
needs: dotnet-format
defaults:
run:
shell: pwsh

env:
ASPNETCORE_ENVIRONMENT: CI
DOTNET_CLI_TELEMETRY_OPTOUT: 1
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
DOTNET_NOLOGO: 1

steps:
- uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
global-json-file: global.json

- name: Install dependencies
run: |
dotnet restore `
--locked-mode

- name: Build Solution
run: |
dotnet build `
--configuration Release `
--no-restore

- name: Test Solution
run: |
dotnet test `
--configuration Release `
--no-build `
--no-restore
153 changes: 77 additions & 76 deletions KVA/Migration.Toolkit.Source/Auxiliary/NodeXmlAdapter.cs
Original file line number Diff line number Diff line change
@@ -1,76 +1,77 @@
namespace Migration.Toolkit.Source.Auxiliary;

using System;
using System.Xml.Linq;
using Migration.Toolkit.Common;
using Migration.Toolkit.Common.Enumerations;

internal class NodeXmlAdapter
{
private readonly XElement _xClass;

public bool ParsingSuccessful { get; }

public NodeXmlAdapter(string xml)
{
var xDoc = XDocument.Parse(xml);
if (xDoc.Root?.FirstNode is XElement dClass)
{
_xClass = dClass;
ParsingSuccessful = true;
}
else
{
_xClass = null!;
ParsingSuccessful = false;
}
}

public string? GetValue(string columnName)
{
return _xClass.Element(columnName)?.Value;
}

public bool HasValueSet(string columnName)
{
return _xClass.Element(columnName) != null;
}

public int? NodeID => _xClass.Element(NodeXmlColumns.NODE_ID)?.Value<int>();
public string? NodeAliasPath => _xClass.Element(NodeXmlColumns.NODE_ALIAS_PATH)?.Value;
public string? NodeName => _xClass.Element(NodeXmlColumns.NODE_NAME)?.Value;
public string? NodeAlias => _xClass.Element(NodeXmlColumns.NODE_ALIAS)?.Value;
public int? NodeClassID => _xClass.Element(NodeXmlColumns.NODE_CLASS_ID)?.Value<int>();
public int? NodeParentID => _xClass.Element(NodeXmlColumns.NODE_PARENT_ID)?.Value<int>();
public int? NodeLevel => _xClass.Element(NodeXmlColumns.NODE_LEVEL)?.Value<int>();
public int? NodeSiteID => _xClass.Element(NodeXmlColumns.NODE_SITE_ID)?.Value<int>();
public Guid? NodeGUID => _xClass.Element(NodeXmlColumns.NODE_GUID)?.Value<Guid>();
public int? NodeOrder => _xClass.Element(NodeXmlColumns.NODE_ORDER)?.Value<int>();
public int? NodeOwner => _xClass.Element(NodeXmlColumns.NODE_OWNER)?.Value<int>();
public bool? NodeHasChildren => _xClass.Element(NodeXmlColumns.NODE_HAS_CHILDREN)?.ValueAsBool();
public bool? NodeHasLinks => _xClass.Element(NodeXmlColumns.NODE_HAS_LINKS)?.ValueAsBool();
public int? NodeOriginalNodeID => _xClass.Element(NodeXmlColumns.NODE_ORIGINAL_NODE_ID)?.Value<int>();
public bool? NodeIsPage => _xClass.Element(NodeXmlColumns.NODE_IS_PAGE)?.ValueAsBool();
public bool? NodeIsSecured => _xClass.Element(NodeXmlColumns.NODE_IS_SECURED)?.ValueAsBool();
public int? DocumentID => _xClass.Element(NodeXmlColumns.DOCUMENT_ID)?.Value<int>();
public string? DocumentName => _xClass.Element(NodeXmlColumns.DOCUMENT_NAME)?.Value;
public DateTime? DocumentModifiedWhen => _xClass.Element(NodeXmlColumns.DOCUMENT_MODIFIED_WHEN)?.Value<DateTime>();
public int? DocumentModifiedByUserID => _xClass.Element(NodeXmlColumns.DOCUMENT_MODIFIED_BY_USER_ID)?.Value<int>();
public int? DocumentCreatedByUserID => _xClass.Element(NodeXmlColumns.DOCUMENT_CREATED_BY_USER_ID)?.Value<int>();
public DateTime? DocumentCreatedWhen => _xClass.Element(NodeXmlColumns.DOCUMENT_CREATED_WHEN)?.Value<DateTime>();
public int? DocumentCheckedOutVersionHistoryID => _xClass.Element(NodeXmlColumns.DOCUMENT_CHECKED_OUT_VERSION_HISTORY_ID)?.Value<int>();
public int? DocumentPublishedVersionHistoryID => _xClass.Element(NodeXmlColumns.DOCUMENT_PUBLISHED_VERSION_HISTORY_ID)?.Value<int>();
public int? DocumentWorkflowStepID => _xClass.Element(NodeXmlColumns.DOCUMENT_WORKFLOW_STEP_ID)?.Value<int>();
public string? DocumentCulture => _xClass.Element(NodeXmlColumns.DOCUMENT_CULTURE)?.Value;
public int? DocumentNodeID => _xClass.Element(NodeXmlColumns.DOCUMENT_NODE_ID)?.Value<int>();
public string? DocumentContent => _xClass.Element(NodeXmlColumns.DOCUMENT_CONTENT)?.Value;
public string? DocumentLastVersionNumber => _xClass.Element(NodeXmlColumns.DOCUMENT_LAST_VERSION_NUMBER)?.Value;
public bool? DocumentIsArchived => _xClass.Element(NodeXmlColumns.DOCUMENT_IS_ARCHIVED)?.ValueAsBool();
public Guid? DocumentGUID => _xClass.Element(NodeXmlColumns.DOCUMENT_GUID)?.Value<Guid>();
public Guid? DocumentWorkflowCycleGUID => _xClass.Element(NodeXmlColumns.DOCUMENT_WORKFLOW_CYCLE_GUID)?.Value<Guid>();
public bool? DocumentCanBePublished => _xClass.Element(NodeXmlColumns.DOCUMENT_CAN_BE_PUBLISHED)?.ValueAsBool();
public string? DocumentPageBuilderWidgets => _xClass.Element(NodeXmlColumns.DOCUMENT_PAGE_BUILDER_WIDGETS)?.Value;
public string? ClassName => _xClass.Element(NodeXmlColumns.CLASS_NAME)?.Value;

public string? DocumentPageTemplateConfiguration => _xClass.Element(NodeXmlColumns.DOCUMENT_PAGE_TEMPLATE_CONFIGURATION)?.Value;
}
using System.Xml.Linq;

using Migration.Toolkit.Common;
using Migration.Toolkit.Common.Enumerations;
// ReSharper disable InconsistentNaming // generated class

namespace Migration.Toolkit.Source.Auxiliary;

internal class NodeXmlAdapter
{
private readonly XElement xClass;

public NodeXmlAdapter(string xml)
{
var xDoc = XDocument.Parse(xml);
if (xDoc.Root?.FirstNode is XElement dClass)
{
xClass = dClass;
ParsingSuccessful = true;
}
else
{
xClass = null!;
ParsingSuccessful = false;
}
}

public bool ParsingSuccessful { get; }

public int? NodeID => xClass.Element(NodeXmlColumns.NODE_ID)?.Value<int>();
public string? NodeAliasPath => xClass.Element(NodeXmlColumns.NODE_ALIAS_PATH)?.Value;
public string? NodeName => xClass.Element(NodeXmlColumns.NODE_NAME)?.Value;
public string? NodeAlias => xClass.Element(NodeXmlColumns.NODE_ALIAS)?.Value;
public int? NodeClassID => xClass.Element(NodeXmlColumns.NODE_CLASS_ID)?.Value<int>();
public int? NodeParentID => xClass.Element(NodeXmlColumns.NODE_PARENT_ID)?.Value<int>();
public int? NodeLevel => xClass.Element(NodeXmlColumns.NODE_LEVEL)?.Value<int>();
public int? NodeSiteID => xClass.Element(NodeXmlColumns.NODE_SITE_ID)?.Value<int>();

[Obsolete("NodeGUID is not unique, use other means of node identification", true)]
public Guid? NodeGUID => xClass.Element(NodeXmlColumns.NODE_GUID)?.Value<Guid>();

public int? NodeOrder => xClass.Element(NodeXmlColumns.NODE_ORDER)?.Value<int>();
public int? NodeOwner => xClass.Element(NodeXmlColumns.NODE_OWNER)?.Value<int>();
public bool? NodeHasChildren => xClass.Element(NodeXmlColumns.NODE_HAS_CHILDREN)?.ValueAsBool();
public bool? NodeHasLinks => xClass.Element(NodeXmlColumns.NODE_HAS_LINKS)?.ValueAsBool();
public int? NodeOriginalNodeID => xClass.Element(NodeXmlColumns.NODE_ORIGINAL_NODE_ID)?.Value<int>();
public bool? NodeIsPage => xClass.Element(NodeXmlColumns.NODE_IS_PAGE)?.ValueAsBool();
public bool? NodeIsSecured => xClass.Element(NodeXmlColumns.NODE_IS_SECURED)?.ValueAsBool();
public int? DocumentID => xClass.Element(NodeXmlColumns.DOCUMENT_ID)?.Value<int>();
public string? DocumentName => xClass.Element(NodeXmlColumns.DOCUMENT_NAME)?.Value;
public DateTime? DocumentModifiedWhen => xClass.Element(NodeXmlColumns.DOCUMENT_MODIFIED_WHEN)?.Value<DateTime>();
public int? DocumentModifiedByUserID => xClass.Element(NodeXmlColumns.DOCUMENT_MODIFIED_BY_USER_ID)?.Value<int>();
public int? DocumentCreatedByUserID => xClass.Element(NodeXmlColumns.DOCUMENT_CREATED_BY_USER_ID)?.Value<int>();
public DateTime? DocumentCreatedWhen => xClass.Element(NodeXmlColumns.DOCUMENT_CREATED_WHEN)?.Value<DateTime>();
public int? DocumentCheckedOutVersionHistoryID => xClass.Element(NodeXmlColumns.DOCUMENT_CHECKED_OUT_VERSION_HISTORY_ID)?.Value<int>();
public int? DocumentPublishedVersionHistoryID => xClass.Element(NodeXmlColumns.DOCUMENT_PUBLISHED_VERSION_HISTORY_ID)?.Value<int>();
public int? DocumentWorkflowStepID => xClass.Element(NodeXmlColumns.DOCUMENT_WORKFLOW_STEP_ID)?.Value<int>();
public string? DocumentCulture => xClass.Element(NodeXmlColumns.DOCUMENT_CULTURE)?.Value;
public int? DocumentNodeID => xClass.Element(NodeXmlColumns.DOCUMENT_NODE_ID)?.Value<int>();
public string? DocumentContent => xClass.Element(NodeXmlColumns.DOCUMENT_CONTENT)?.Value;
public string? DocumentLastVersionNumber => xClass.Element(NodeXmlColumns.DOCUMENT_LAST_VERSION_NUMBER)?.Value;
public bool? DocumentIsArchived => xClass.Element(NodeXmlColumns.DOCUMENT_IS_ARCHIVED)?.ValueAsBool();

[Obsolete("DocumentGUID is not unique, use other means of document identification", true)]
public Guid? DocumentGUID => xClass.Element(NodeXmlColumns.DOCUMENT_GUID)?.Value<Guid>();

public Guid? DocumentWorkflowCycleGUID => xClass.Element(NodeXmlColumns.DOCUMENT_WORKFLOW_CYCLE_GUID)?.Value<Guid>();
public bool? DocumentCanBePublished => xClass.Element(NodeXmlColumns.DOCUMENT_CAN_BE_PUBLISHED)?.ValueAsBool();
public string? DocumentPageBuilderWidgets => xClass.Element(NodeXmlColumns.DOCUMENT_PAGE_BUILDER_WIDGETS)?.Value;
public string? ClassName => xClass.Element(NodeXmlColumns.CLASS_NAME)?.Value;

public string? DocumentPageTemplateConfiguration => xClass.Element(NodeXmlColumns.DOCUMENT_PAGE_TEMPLATE_CONFIGURATION)?.Value;

public string? GetValue(string columnName) => xClass.Element(columnName)?.Value;

public bool HasValueSet(string columnName) => xClass.Element(columnName) != null;
}
Loading