Netcore: Migration of Model classes from Umbraco.Infrastructure to Core (#9404)

* Migrating more model, mapping and tree classes

* Migrating files from Mapping dir without Newtonsoft dependency

* Migrating files from PublishedContent and Editors dirs without Newtonsoft dependency + some more of the same kind

* Migrating DataType class without the usage of Newtonsoft.Json and making the corresponding changes to all classes affected

* Combining 3 ContentExtensions files into 1

* Refactoring from migrating ContentExtensions

* Migrating more classes

* Migrating ContentRepositoryExtensions - combining it with existing file in Umbraco.Core

* removing Newtonsoft json dependency & migrating file. Adding partial migration of ConfigurationEditor, so PropertyTagsExtensions can be migrated

* Migrating ContentTagsExtensions, and refactoring from changes in PropertyTagsExtensions

* Changes that should be reverted once ConfigurationEditor class is fully migrated

* VS couldn't find Composing, so build was failing. Removing the using solves the problem

* Handling a single case for deserializing a subset of an input

* Small changes and added tests to JsonNetSerializer

Signed-off-by: Bjarke Berg <mail@bergmania.dk>

* Migrated ConfigurationEditor

Signed-off-by: Bjarke Berg <mail@bergmania.dk>

Co-authored-by: Bjarke Berg <mail@bergmania.dk>
This commit is contained in:
Elitsa Marinovska
2020-11-17 20:27:10 +01:00
committed by GitHub
parent d498c1a2cd
commit dd5f400cf3
116 changed files with 1098 additions and 897 deletions

View File

@@ -13,6 +13,7 @@ using Umbraco.Core.Mapping;
using Umbraco.Core.Models;
using Umbraco.Core.Models.Editors;
using Umbraco.Core.PropertyEditors;
using Umbraco.Core.Serialization;
using Umbraco.Core.Services;
using Umbraco.Core.Strings;
using Umbraco.Extensions;
@@ -34,13 +35,15 @@ namespace Umbraco.Web.BackOffice.Controllers
protected IEventMessagesFactory EventMessages { get; }
protected ILocalizedTextService LocalizedTextService { get; }
private readonly ILogger<ContentControllerBase> _logger;
private readonly IJsonSerializer _serializer;
protected ContentControllerBase(
ICultureDictionary cultureDictionary,
ILoggerFactory loggerFactory,
IShortStringHelper shortStringHelper,
IEventMessagesFactory eventMessages,
ILocalizedTextService localizedTextService)
ILocalizedTextService localizedTextService,
IJsonSerializer serializer)
{
CultureDictionary = cultureDictionary;
LoggerFactory = loggerFactory;
@@ -48,6 +51,7 @@ namespace Umbraco.Web.BackOffice.Controllers
ShortStringHelper = shortStringHelper;
EventMessages = eventMessages;
LocalizedTextService = localizedTextService;
_serializer = serializer;
}
protected NotFoundObjectResult HandleContentNotFound(object id, bool throwException = true)
@@ -117,7 +121,7 @@ namespace Umbraco.Web.BackOffice.Controllers
var tagConfiguration = ConfigurationEditor.ConfigurationAs<TagConfiguration>(propertyDto.DataType.Configuration);
if (tagConfiguration.Delimiter == default) tagConfiguration.Delimiter = tagAttribute.Delimiter;
var tagCulture = property.PropertyType.VariesByCulture() ? culture : null;
property.SetTagsValue(value, tagConfiguration, tagCulture);
property.SetTagsValue(_serializer, value, tagConfiguration, tagCulture);
}
else
savePropertyValue(contentItem, property, value);