Skip to content

Commit

Permalink
release v1.1.0 (#208)
Browse files Browse the repository at this point in the history
* MT-28 XbyK upgrade 29.2.0 & obsolete configuration removed

- breaking changes on MediatR resolved
- obsolete project cleared
- upgrade of solution dependencies

* MT-28 legacy XbyK DB model regeneration + implied fixes

* MT-17 migration of documents with non-unique DocumentGuid

* MT-17 non-unique DocumentGUID & NodeGUID support

* MT-17 cleanup

* #184 deprecation of XbKConnectionString

* #184 deprecation of XbKConnectionString - md file update

* #198 migration of media file refactor; fails for member users resoved

* confict resolving in relation to master branch

* solution reformat to match master formatting

* eol crlf

* dotnet format autofix

* merge conflicts fix

* .editorconfig update & global reformat

* reformat and code cleanup

* dotnet format uncommented

* Feat/199 unpublished doc versions published (#209)

* document PublishTo & PublishFrom migration path support

* whitespace corrections

---------

Co-authored-by: Tomáš Krch <[email protected]>

* naming conventions update, obsolete class removal

* handling of multiple attachments with same guid in source instance - meaningful warning message

---------

Co-authored-by: Tomáš Krch <[email protected]>
Co-authored-by: fialafilip <[email protected]>
  • Loading branch information
3 people authored Jul 24, 2024
1 parent c06b19c commit 4f7e8ff
Show file tree
Hide file tree
Showing 1,463 changed files with 108,992 additions and 112,972 deletions.
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

0 comments on commit 4f7e8ff

Please sign in to comment.