Merge remote-tracking branch 'origin/release/11.0' into v11/dev
# Conflicts: # version.json
This commit is contained in:
@@ -50,4 +50,12 @@
|
||||
<Target Name="RemoveAppsettingsSchema" AfterTargets="Clean" Condition="Exists('$(_UmbracoCmsJsonSchemaReference)')">
|
||||
<Delete Files="$(_UmbracoCmsJsonSchemaReference)" />
|
||||
</Target>
|
||||
|
||||
<!-- Create and pack empty file to add TFM dependency -->
|
||||
<Target Name="PackTargetFrameworkFile" BeforeTargets="Build">
|
||||
<WriteLinesToFile File="$(IntermediateOutputPath)_._" />
|
||||
<ItemGroup>
|
||||
<None Include="$(IntermediateOutputPath)_._" Pack="true" PackagePath="lib\$(TargetFramework)" />
|
||||
</ItemGroup>
|
||||
</Target>
|
||||
</Project>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<DefaultItemExcludes>$(DefaultItemExcludes);umbraco\Logs\**</DefaultItemExcludes>
|
||||
<DefaultItemExcludes>$(DefaultItemExcludes);wwwroot\media\**</DefaultItemExcludes>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<ItemGroup Condition="'$(ImplicitUsings)' == 'enable' or '$(ImplicitUsings)' == 'true'">
|
||||
<Using Include="Umbraco.Cms.Core.DependencyInjection" />
|
||||
<Using Include="Umbraco.Extensions" />
|
||||
</ItemGroup>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<Title>Umbraco CMS</Title>
|
||||
<Description>Installs Umbraco CMS with all default dependencies in your ASP.NET Core project.</Description>
|
||||
@@ -12,4 +12,12 @@
|
||||
<ProjectReference Include="..\Umbraco.Cms.Persistence.Sqlite\Umbraco.Cms.Persistence.Sqlite.csproj" />
|
||||
<ProjectReference Include="..\Umbraco.Cms.Persistence.SqlServer\Umbraco.Cms.Persistence.SqlServer.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<!-- Create and pack empty file to add TFM dependency -->
|
||||
<Target Name="PackTargetFrameworkFile" BeforeTargets="Build">
|
||||
<WriteLinesToFile File="$(IntermediateOutputPath)_._" />
|
||||
<ItemGroup>
|
||||
<None Include="$(IntermediateOutputPath)_._" Pack="true" PackagePath="lib\$(TargetFramework)" />
|
||||
</ItemGroup>
|
||||
</Target>
|
||||
</Project>
|
||||
|
||||
@@ -7,6 +7,6 @@ public static partial class Constants
|
||||
/// </summary>
|
||||
public static class Marketplace
|
||||
{
|
||||
public const string Url = "https://dev.marketplace.umbraco.com";
|
||||
public const string Url = "https://marketplace.umbraco.com";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
using Umbraco.Cms.Core.Models;
|
||||
|
||||
namespace Umbraco.Cms.Core.Deploy;
|
||||
|
||||
/// <summary>
|
||||
/// Extension methods adding backwards-compatability between <see cref="IDataTypeConfigurationConnector" /> and <see cref="IDataTypeConfigurationConnector2" />.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// These extension methods will be removed in Umbraco 13.
|
||||
/// </remarks>
|
||||
public static class DataTypeConfigurationConnectorExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the artifact configuration value corresponding to a data type configuration and gather dependencies.
|
||||
/// </summary>
|
||||
/// <param name="connector">The connector.</param>
|
||||
/// <param name="dataType">The data type.</param>
|
||||
/// <param name="dependencies">The dependencies.</param>
|
||||
/// <param name="contextCache">The context cache.</param>
|
||||
/// <returns>
|
||||
/// The artifact configuration value.
|
||||
/// </returns>
|
||||
/// <remarks>
|
||||
/// This extension method tries to make use of the <see cref="IContextCache" /> on types also implementing <see cref="IDataTypeConfigurationConnector2" />.
|
||||
/// </remarks>
|
||||
public static string? ToArtifact(this IDataTypeConfigurationConnector connector, IDataType dataType, ICollection<ArtifactDependency> dependencies, IContextCache contextCache)
|
||||
=> connector is IDataTypeConfigurationConnector2 connector2
|
||||
? connector2.ToArtifact(dataType, dependencies, contextCache)
|
||||
: connector.ToArtifact(dataType, dependencies);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the data type configuration corresponding to an artifact configuration value.
|
||||
/// </summary>
|
||||
/// <param name="connector">The connector.</param>
|
||||
/// <param name="dataType">The data type.</param>
|
||||
/// <param name="configuration">The artifact configuration value.</param>
|
||||
/// <param name="contextCache">The context cache.</param>
|
||||
/// <returns>
|
||||
/// The data type configuration.
|
||||
/// </returns>
|
||||
/// <remarks>
|
||||
/// This extension method tries to make use of the <see cref="IContextCache" /> on types also implementing <see cref="IDataTypeConfigurationConnector2" />.
|
||||
/// </remarks>
|
||||
public static object? FromArtifact(this IDataTypeConfigurationConnector connector, IDataType dataType, string? configuration, IContextCache contextCache)
|
||||
=> connector is IDataTypeConfigurationConnector2 connector2
|
||||
? connector2.FromArtifact(dataType, configuration, contextCache)
|
||||
: connector.FromArtifact(dataType, configuration);
|
||||
}
|
||||
@@ -27,20 +27,8 @@ public interface IDataTypeConfigurationConnector
|
||||
/// <returns>
|
||||
/// The artifact configuration value.
|
||||
/// </returns>
|
||||
[Obsolete("Use the overload accepting IContextCache instead. This overload will be removed in a future version.")]
|
||||
string? ToArtifact(IDataType dataType, ICollection<ArtifactDependency> dependencies)
|
||||
=> ToArtifact(dataType, dependencies, PassThroughCache.Instance);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the artifact configuration value corresponding to a data type configuration and gather dependencies.
|
||||
/// </summary>
|
||||
/// <param name="dataType">The data type.</param>
|
||||
/// <param name="dependencies">The dependencies.</param>
|
||||
/// <param name="contextCache">The context cache.</param>
|
||||
/// <returns>
|
||||
/// The artifact configuration value.
|
||||
/// </returns>
|
||||
string? ToArtifact(IDataType dataType, ICollection<ArtifactDependency> dependencies, IContextCache contextCache);
|
||||
[Obsolete($"Implement {nameof(IDataTypeConfigurationConnector2)} and use the overload accepting {nameof(IContextCache)} instead. This overload will be removed in Umbraco 13.")]
|
||||
string? ToArtifact(IDataType dataType, ICollection<ArtifactDependency> dependencies);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the data type configuration corresponding to an artifact configuration value.
|
||||
@@ -50,18 +38,6 @@ public interface IDataTypeConfigurationConnector
|
||||
/// <returns>
|
||||
/// The data type configuration.
|
||||
/// </returns>
|
||||
[Obsolete("Use the overload accepting IContextCache instead. This overload will be removed in a future version.")]
|
||||
object? FromArtifact(IDataType dataType, string? configuration)
|
||||
=> FromArtifact(dataType, configuration, PassThroughCache.Instance);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the data type configuration corresponding to an artifact configuration value.
|
||||
/// </summary>
|
||||
/// <param name="dataType">The data type.</param>
|
||||
/// <param name="configuration">The artifact configuration value.</param>
|
||||
/// <param name="contextCache">The context cache.</param>
|
||||
/// <returns>
|
||||
/// The data type configuration.
|
||||
/// </returns>
|
||||
object? FromArtifact(IDataType dataType, string? configuration, IContextCache contextCache);
|
||||
[Obsolete($"Implement {nameof(IDataTypeConfigurationConnector2)} and use the overload accepting {nameof(IContextCache)} instead. This overload will be removed in Umbraco 13.")]
|
||||
object? FromArtifact(IDataType dataType, string? configuration);
|
||||
}
|
||||
|
||||
56
src/Umbraco.Core/Deploy/IDataTypeConfigurationConnector2.cs
Normal file
56
src/Umbraco.Core/Deploy/IDataTypeConfigurationConnector2.cs
Normal file
@@ -0,0 +1,56 @@
|
||||
using Umbraco.Cms.Core.Models;
|
||||
|
||||
namespace Umbraco.Cms.Core.Deploy;
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <remarks>
|
||||
/// This interface will be merged back into <see cref="IDataTypeConfigurationConnector" /> and removed in Umbraco 13.
|
||||
/// </remarks>
|
||||
public interface IDataTypeConfigurationConnector2 : IDataTypeConfigurationConnector
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the artifact configuration value corresponding to a data type configuration and gather dependencies.
|
||||
/// </summary>
|
||||
/// <param name="dataType">The data type.</param>
|
||||
/// <param name="dependencies">The dependencies.</param>
|
||||
/// <returns>
|
||||
/// The artifact configuration value.
|
||||
/// </returns>
|
||||
[Obsolete($"Use the overload accepting {nameof(IContextCache)} instead. This overload will be removed in Umbraco 13.")]
|
||||
string? IDataTypeConfigurationConnector.ToArtifact(IDataType dataType, ICollection<ArtifactDependency> dependencies)
|
||||
=> ToArtifact(dataType, dependencies, PassThroughCache.Instance);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the artifact configuration value corresponding to a data type configuration and gather dependencies.
|
||||
/// </summary>
|
||||
/// <param name="dataType">The data type.</param>
|
||||
/// <param name="dependencies">The dependencies.</param>
|
||||
/// <param name="contextCache">The context cache.</param>
|
||||
/// <returns>
|
||||
/// The artifact configuration value.
|
||||
/// </returns>
|
||||
string? ToArtifact(IDataType dataType, ICollection<ArtifactDependency> dependencies, IContextCache contextCache);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the data type configuration corresponding to an artifact configuration value.
|
||||
/// </summary>
|
||||
/// <param name="dataType">The data type.</param>
|
||||
/// <param name="configuration">The artifact configuration value.</param>
|
||||
/// <returns>
|
||||
/// The data type configuration.
|
||||
/// </returns>
|
||||
[Obsolete($"Use the overload accepting {nameof(IContextCache)} instead. This overload will be removed in Umbraco 13.")]
|
||||
object? IDataTypeConfigurationConnector.FromArtifact(IDataType dataType, string? configuration)
|
||||
=> FromArtifact(dataType, configuration, PassThroughCache.Instance);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the data type configuration corresponding to an artifact configuration value.
|
||||
/// </summary>
|
||||
/// <param name="dataType">The data type.</param>
|
||||
/// <param name="configuration">The artifact configuration value.</param>
|
||||
/// <param name="contextCache">The context cache.</param>
|
||||
/// <returns>
|
||||
/// The data type configuration.
|
||||
/// </returns>
|
||||
object? FromArtifact(IDataType dataType, string? configuration, IContextCache contextCache);
|
||||
}
|
||||
@@ -15,19 +15,8 @@ public interface IServiceConnector : IDiscoverable
|
||||
/// <returns>
|
||||
/// The corresponding artifact, or null.
|
||||
/// </returns>
|
||||
[Obsolete("Use the overload accepting IContextCache instead. This overload will be removed in a future version.")]
|
||||
IArtifact? GetArtifact(Udi udi)
|
||||
=> GetArtifact(udi, PassThroughCache.Instance);
|
||||
|
||||
/// <summary>
|
||||
/// Gets an artifact.
|
||||
/// </summary>
|
||||
/// <param name="udi">The entity identifier of the artifact.</param>
|
||||
/// <param name="contextCache">The context cache.</param>
|
||||
/// <returns>
|
||||
/// The corresponding artifact, or null.
|
||||
/// </returns>
|
||||
IArtifact? GetArtifact(Udi udi, IContextCache contextCache);
|
||||
[Obsolete($"Implement {nameof(IServiceConnector2)} and use the overload accepting {nameof(IContextCache)} instead. This overload will be removed in Umbraco 13.")]
|
||||
IArtifact? GetArtifact(Udi udi);
|
||||
|
||||
/// <summary>
|
||||
/// Gets an artifact.
|
||||
@@ -36,19 +25,8 @@ public interface IServiceConnector : IDiscoverable
|
||||
/// <returns>
|
||||
/// The corresponding artifact.
|
||||
/// </returns>
|
||||
[Obsolete("Use the overload accepting IContextCache instead. This overload will be removed in a future version.")]
|
||||
IArtifact GetArtifact(object entity)
|
||||
=> GetArtifact(entity, PassThroughCache.Instance);
|
||||
|
||||
/// <summary>
|
||||
/// Gets an artifact.
|
||||
/// </summary>
|
||||
/// <param name="entity">The entity.</param>
|
||||
/// <param name="contextCache">The context cache.</param>
|
||||
/// <returns>
|
||||
/// The corresponding artifact.
|
||||
/// </returns>
|
||||
IArtifact GetArtifact(object entity, IContextCache contextCache);
|
||||
[Obsolete($"Implement {nameof(IServiceConnector2)} and use the overload accepting {nameof(IContextCache)} instead. This overload will be removed in Umbraco 13.")]
|
||||
IArtifact GetArtifact(object entity);
|
||||
|
||||
/// <summary>
|
||||
/// Initializes processing for an artifact.
|
||||
|
||||
38
src/Umbraco.Core/Deploy/IServiceConnector2.cs
Normal file
38
src/Umbraco.Core/Deploy/IServiceConnector2.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
namespace Umbraco.Cms.Core.Deploy;
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <remarks>
|
||||
/// This interface will be merged back into <see cref="IServiceConnector" /> and removed in Umbraco 13.
|
||||
/// </remarks>
|
||||
public interface IServiceConnector2 : IServiceConnector
|
||||
{
|
||||
/// <inheritdoc />
|
||||
[Obsolete($"Use the overload accepting {nameof(IContextCache)} instead. This overload will be removed in Umbraco 13.")]
|
||||
IArtifact? IServiceConnector.GetArtifact(Udi udi)
|
||||
=> GetArtifact(udi, PassThroughCache.Instance);
|
||||
|
||||
/// <summary>
|
||||
/// Gets an artifact.
|
||||
/// </summary>
|
||||
/// <param name="udi">The entity identifier of the artifact.</param>
|
||||
/// <param name="contextCache">The context cache.</param>
|
||||
/// <returns>
|
||||
/// The corresponding artifact, or null.
|
||||
/// </returns>
|
||||
IArtifact? GetArtifact(Udi udi, IContextCache contextCache);
|
||||
|
||||
/// <inheritdoc />
|
||||
[Obsolete($"Use the overload accepting {nameof(IContextCache)} instead. This overload will be removed in Umbraco 13.")]
|
||||
IArtifact IServiceConnector.GetArtifact(object entity)
|
||||
=> GetArtifact(entity, PassThroughCache.Instance);
|
||||
|
||||
/// <summary>
|
||||
/// Gets an artifact.
|
||||
/// </summary>
|
||||
/// <param name="entity">The entity.</param>
|
||||
/// <param name="contextCache">The context cache.</param>
|
||||
/// <returns>
|
||||
/// The corresponding artifact.
|
||||
/// </returns>
|
||||
IArtifact GetArtifact(object entity, IContextCache contextCache);
|
||||
}
|
||||
@@ -29,21 +29,8 @@ public interface IValueConnector
|
||||
/// <returns>
|
||||
/// The deploy property value.
|
||||
/// </returns>
|
||||
[Obsolete("Use the overload accepting IContextCache instead. This overload will be removed in a future version.")]
|
||||
string? ToArtifact(object? value, IPropertyType propertyType, ICollection<ArtifactDependency> dependencies)
|
||||
=> ToArtifact(value, propertyType, dependencies, PassThroughCache.Instance);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the deploy property value corresponding to a content property value, and gather dependencies.
|
||||
/// </summary>
|
||||
/// <param name="value">The content property value.</param>
|
||||
/// <param name="propertyType">The value property type</param>
|
||||
/// <param name="dependencies">The content dependencies.</param>
|
||||
/// <param name="contextCache">The context cache.</param>
|
||||
/// <returns>
|
||||
/// The deploy property value.
|
||||
/// </returns>
|
||||
string? ToArtifact(object? value, IPropertyType propertyType, ICollection<ArtifactDependency> dependencies, IContextCache contextCache);
|
||||
[Obsolete($"Implement {nameof(IValueConnector2)} and use the overload accepting {nameof(IContextCache)} instead. This overload will be removed in Umbraco 13.")]
|
||||
string? ToArtifact(object? value, IPropertyType propertyType, ICollection<ArtifactDependency> dependencies);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the content property value corresponding to a deploy property value.
|
||||
@@ -54,19 +41,6 @@ public interface IValueConnector
|
||||
/// <returns>
|
||||
/// The content property value.
|
||||
/// </returns>
|
||||
[Obsolete("Use the overload accepting IContextCache instead. This overload will be removed in a future version.")]
|
||||
object? FromArtifact(string? value, IPropertyType propertyType, object? currentValue)
|
||||
=> FromArtifact(value, propertyType, currentValue, PassThroughCache.Instance);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the content property value corresponding to a deploy property value.
|
||||
/// </summary>
|
||||
/// <param name="value">The deploy property value.</param>
|
||||
/// <param name="propertyType">The value property type</param>
|
||||
/// <param name="currentValue">The current content property value.</param>
|
||||
/// <param name="contextCache">The context cache.</param>
|
||||
/// <returns>
|
||||
/// The content property value.
|
||||
/// </returns>
|
||||
object? FromArtifact(string? value, IPropertyType propertyType, object? currentValue, IContextCache contextCache);
|
||||
[Obsolete($"Implement {nameof(IValueConnector2)} and use the overload accepting {nameof(IContextCache)} instead. This overload will be removed in Umbraco 13.")]
|
||||
object? FromArtifact(string? value, IPropertyType propertyType, object? currentValue);
|
||||
}
|
||||
|
||||
44
src/Umbraco.Core/Deploy/IValueConnector2.cs
Normal file
44
src/Umbraco.Core/Deploy/IValueConnector2.cs
Normal file
@@ -0,0 +1,44 @@
|
||||
using Umbraco.Cms.Core.Models;
|
||||
|
||||
namespace Umbraco.Cms.Core.Deploy;
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <remarks>
|
||||
/// This interface will be merged back into <see cref="IValueConnector" /> and removed in Umbraco 13.
|
||||
/// </remarks>
|
||||
public interface IValueConnector2 : IValueConnector
|
||||
{
|
||||
/// <inheritdoc />
|
||||
[Obsolete($"Use the overload accepting {nameof(IContextCache)} instead. This overload will be removed in Umbraco 13.")]
|
||||
string? IValueConnector.ToArtifact(object? value, IPropertyType propertyType, ICollection<ArtifactDependency> dependencies)
|
||||
=> ToArtifact(value, propertyType, dependencies, PassThroughCache.Instance);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the deploy property value corresponding to a content property value, and gather dependencies.
|
||||
/// </summary>
|
||||
/// <param name="value">The content property value.</param>
|
||||
/// <param name="propertyType">The value property type</param>
|
||||
/// <param name="dependencies">The content dependencies.</param>
|
||||
/// <param name="contextCache">The context cache.</param>
|
||||
/// <returns>
|
||||
/// The deploy property value.
|
||||
/// </returns>
|
||||
string? ToArtifact(object? value, IPropertyType propertyType, ICollection<ArtifactDependency> dependencies, IContextCache contextCache);
|
||||
|
||||
/// <inheritdoc />
|
||||
[Obsolete($"Use the overload accepting {nameof(IContextCache)} instead. This overload will be removed in Umbraco 13.")]
|
||||
object? IValueConnector.FromArtifact(string? value, IPropertyType propertyType, object? currentValue)
|
||||
=> FromArtifact(value, propertyType, currentValue, PassThroughCache.Instance);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the content property value corresponding to a deploy property value.
|
||||
/// </summary>
|
||||
/// <param name="value">The deploy property value.</param>
|
||||
/// <param name="propertyType">The value property type</param>
|
||||
/// <param name="currentValue">The current content property value.</param>
|
||||
/// <param name="contextCache">The context cache.</param>
|
||||
/// <returns>
|
||||
/// The content property value.
|
||||
/// </returns>
|
||||
object? FromArtifact(string? value, IPropertyType propertyType, object? currentValue, IContextCache contextCache);
|
||||
}
|
||||
44
src/Umbraco.Core/Deploy/ServiceConnectorExtensions.cs
Normal file
44
src/Umbraco.Core/Deploy/ServiceConnectorExtensions.cs
Normal file
@@ -0,0 +1,44 @@
|
||||
namespace Umbraco.Cms.Core.Deploy;
|
||||
|
||||
/// <summary>
|
||||
/// Extension methods adding backwards-compatability between <see cref="IServiceConnector" /> and <see cref="IServiceConnector2" />.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// These extension methods will be removed in Umbraco 13.
|
||||
/// </remarks>
|
||||
public static class ServiceConnectorExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets an artifact.
|
||||
/// </summary>
|
||||
/// <param name="connector">The connector.</param>
|
||||
/// <param name="udi">The entity identifier of the artifact.</param>
|
||||
/// <param name="contextCache">The context cache.</param>
|
||||
/// <returns>
|
||||
/// The corresponding artifact, or null.
|
||||
/// </returns>
|
||||
/// <remarks>
|
||||
/// This extension method tries to make use of the <see cref="IContextCache" /> on types also implementing <see cref="IServiceConnector2" />.
|
||||
/// </remarks>
|
||||
public static IArtifact? GetArtifact(this IServiceConnector connector, Udi udi, IContextCache contextCache)
|
||||
=> connector is IServiceConnector2 connector2
|
||||
? connector2.GetArtifact(udi, contextCache)
|
||||
: connector.GetArtifact(udi);
|
||||
|
||||
/// <summary>
|
||||
/// Gets an artifact.
|
||||
/// </summary>
|
||||
/// <param name="connector">The connector.</param>
|
||||
/// <param name="entity">The entity.</param>
|
||||
/// <param name="contextCache">The context cache.</param>
|
||||
/// <returns>
|
||||
/// The corresponding artifact.
|
||||
/// </returns>
|
||||
/// <remarks>
|
||||
/// This extension method tries to make use of the <see cref="IContextCache" /> on types also implementing <see cref="IServiceConnector2" />.
|
||||
/// </remarks>
|
||||
public static IArtifact GetArtifact(this IServiceConnector connector, object entity, IContextCache contextCache)
|
||||
=> connector is IServiceConnector2 connector2
|
||||
? connector2.GetArtifact(entity, contextCache)
|
||||
: connector.GetArtifact(entity);
|
||||
}
|
||||
50
src/Umbraco.Core/Deploy/ValueConnectorExtensions.cs
Normal file
50
src/Umbraco.Core/Deploy/ValueConnectorExtensions.cs
Normal file
@@ -0,0 +1,50 @@
|
||||
using Umbraco.Cms.Core.Models;
|
||||
|
||||
namespace Umbraco.Cms.Core.Deploy;
|
||||
|
||||
/// <summary>
|
||||
/// Extension methods adding backwards-compatability between <see cref="IValueConnector" /> and <see cref="IValueConnector2" />.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// These extension methods will be removed in Umbraco 13.
|
||||
/// </remarks>
|
||||
public static class ValueConnectorExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the artifact value corresponding to a property value and gather dependencies.
|
||||
/// </summary>
|
||||
/// <param name="connector">The connector.</param>
|
||||
/// <param name="value">The property value.</param>
|
||||
/// <param name="propertyType">The property type.</param>
|
||||
/// <param name="dependencies">The dependencies.</param>
|
||||
/// <param name="contextCache">The context cache.</param>
|
||||
/// <returns>
|
||||
/// The artifact value.
|
||||
/// </returns>
|
||||
/// <remarks>
|
||||
/// This extension method tries to make use of the <see cref="IContextCache" /> on types also implementing <see cref="IValueConnector2" />.
|
||||
/// </remarks>
|
||||
public static string? ToArtifact(this IValueConnector connector, object? value, IPropertyType propertyType, ICollection<ArtifactDependency> dependencies, IContextCache contextCache)
|
||||
=> connector is IValueConnector2 connector2
|
||||
? connector2.ToArtifact(value, propertyType, dependencies, contextCache)
|
||||
: connector.ToArtifact(value, propertyType, dependencies);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the property value corresponding to an artifact value.
|
||||
/// </summary>
|
||||
/// <param name="connector">The connector.</param>
|
||||
/// <param name="value">The artifact value.</param>
|
||||
/// <param name="propertyType">The property type.</param>
|
||||
/// <param name="currentValue">The current property value.</param>
|
||||
/// <param name="contextCache">The context cache.</param>
|
||||
/// <returns>
|
||||
/// The property value.
|
||||
/// </returns>
|
||||
/// <remarks>
|
||||
/// This extension method tries to make use of the <see cref="IContextCache" /> on types also implementing <see cref="IValueConnector2" />.
|
||||
/// </remarks>
|
||||
public static object? FromArtifact(this IValueConnector connector, string? value, IPropertyType propertyType, object? currentValue, IContextCache contextCache)
|
||||
=> connector is IValueConnector2 connector2
|
||||
? connector2.FromArtifact(value, propertyType, currentValue, contextCache)
|
||||
: connector.FromArtifact(value, propertyType, currentValue);
|
||||
}
|
||||
@@ -2784,7 +2784,7 @@ To manage your website, simply open the Umbraco backoffice and start adding cont
|
||||
<key alias="allowBlockInRoot">Allow in root</key>
|
||||
<key alias="allowBlockInRootHelp">Make this block available in the root of the layout.</key>
|
||||
<key alias="allowBlockInAreas">Allow in areas</key>
|
||||
<key alias="allowBlockInAreasHelp">Make this block available within other Blocks.</key>
|
||||
<key alias="allowBlockInAreasHelp">Make this block available by default within the areas of other Blocks (unless explicit permissions are set for these areas).</key>
|
||||
<key alias="areaAllowedBlocksEmpty">When empty all Blocks allowed for Areas can be created.</key>
|
||||
<key alias="areas">Areas</key>
|
||||
<key alias="areasLayoutColumns">Grid Columns for Areas</key>
|
||||
|
||||
@@ -2887,7 +2887,7 @@ To manage your website, simply open the Umbraco backoffice and start adding cont
|
||||
<key alias="allowBlockInRoot">Allow in root</key>
|
||||
<key alias="allowBlockInRootHelp">Make this block available in the root of the layout.</key>
|
||||
<key alias="allowBlockInAreas">Allow in areas</key>
|
||||
<key alias="allowBlockInAreasHelp">Make this block available within other Blocks.</key>
|
||||
<key alias="allowBlockInAreasHelp">Make this block available by default within the areas of other Blocks (unless explicit permissions are set for these areas).</key>
|
||||
<key alias="areaAllowedBlocksEmpty">When empty all Blocks allowed for Areas can be created.</key>
|
||||
<key alias="areas">Areas</key>
|
||||
<key alias="areasLayoutColumns">Grid Columns for Areas</key>
|
||||
|
||||
@@ -2520,6 +2520,38 @@ Echter, Runway biedt een gemakkelijke basis om je snel op weg te helpen. Als je
|
||||
<key alias="propertyEditorNotSupported">Eigenschap '%0%' gebruikt editor '%1%' die niet ondersteund wordt in
|
||||
blokken.
|
||||
</key>
|
||||
<key alias="focusParentBlock">Geef focus aan het container blok</key>
|
||||
<key alias="areaIdentification">Identificatie</key>
|
||||
<key alias="areaValidation">Validatie</key>
|
||||
<key alias="areaValidationEntriesShort"><![CDATA[<strong>%0%</strong> moet minimaal <strong>%2%</strong> keer aanwezig zijn.]]></key>
|
||||
<key alias="areaValidationEntriesExceed"><![CDATA[<strong>%0%</strong>mag maximaal <strong>%3%</strong> keer aanwezig zijn.]]></key>
|
||||
<key alias="areaNumberOfBlocks">Hoeveelheid blokken</key>
|
||||
<key alias="areaDisallowAllBlocks">Sta alleen specifiek bloktype toe</key>
|
||||
<key alias="areaAllowedBlocks">Toegestane bloktypes</key>
|
||||
<key alias="areaAllowedBlocksHelp">Definieer de type blokken die zijn toegestaan in dit gebied, en optioneel hoeveel van ieder type aanwezig moet zijn.</key>
|
||||
<key alias="confirmDeleteBlockAreaMessage">Weet je zeker dat je dit gebied wilt verwijderen?</key>
|
||||
<key alias="confirmDeleteBlockAreaNotice">Alle blokken op dit moment aangemaakt binnen dit gebied zullen worden verwijderd.</key>
|
||||
<key alias="layoutOptions">Lay-out opties</key>
|
||||
<key alias="structuralOptions">Structuur</key>
|
||||
<key alias="sizeOptions">Afmetingen</key>
|
||||
<key alias="sizeOptionsHelp">Definiëer een of meer afmetingen, dit maakt het mogelijk blokken te vergroten/verkleinen</key>
|
||||
<key alias="allowedBlockColumns">Beschikbare kolommen</key>
|
||||
<key alias="allowedBlockColumnsHelp">Definieer de verschillende aantal kolombreedtes dat dit blok mag in nemen. Dit voorkomt niet dat blokken in gebieden met kleine kolombreedtes kan worden geplaatst.</key>
|
||||
<key alias="allowedBlockRows">Beschikbare rijen</key>
|
||||
<key alias="allowedBlockRowsHelp">Definiëer de verschillende aantal rijen dat dit blok mag innemen.</key>
|
||||
<key alias="allowBlockInRoot">Sta toe in root</key>
|
||||
<key alias="allowBlockInRootHelp">Maak dit blok beschikbaar in de root van de lay-out</key>
|
||||
<key alias="allowBlockInAreas">Sta toe in gebieden</key>
|
||||
<key alias="block">Blok</key>
|
||||
<key alias="tabBlock">Blokken</key>
|
||||
<key alias="tabBlockTypeSettings">Instellingen</key>
|
||||
<key alias="allowBlockInAreasHelp">Maak dit blok standaard beschikbaar binnen de gebieden van andere blokken (behalve wanneer expliciete rechten zijn gezet voor deze gebieden).</key>
|
||||
<key alias="areas">Gebieden</key>
|
||||
<key alias="tabAreas">Gebieden</key>
|
||||
<key alias="tabAdvanced">Geadvanceerd</key>
|
||||
<key alias="headlineAllowance">Rechten</key>
|
||||
<key alias="configureArea">Configureer gebied</key>
|
||||
<key alias="deleteArea">Verwijder gebied</key>
|
||||
</area>
|
||||
<area alias="contentTemplatesDashboard">
|
||||
<key alias="whatHeadline">Wat zijn Inhoudssjablonen?</key>
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
using Umbraco.Cms.Core.Models;
|
||||
|
||||
namespace Umbraco.Cms.Core.Deploy;
|
||||
|
||||
/// <summary>
|
||||
/// Extension methods adding backwards-compatability between <see cref="IGridCellValueConnector" /> and <see cref="IGridCellValueConnector2" />.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// These extension methods will be removed in Umbraco 13.
|
||||
/// </remarks>
|
||||
public static class GridCellValueConnectorExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the value.
|
||||
/// </summary>
|
||||
/// <param name="connector">The connector.</param>
|
||||
/// <param name="gridControl">The grid control.</param>
|
||||
/// <param name="dependencies">The dependencies.</param>
|
||||
/// <param name="contextCache">The context cache.</param>
|
||||
/// <returns>
|
||||
/// The value.
|
||||
/// </returns>
|
||||
/// <remarks>
|
||||
/// This extension method tries to make use of the <see cref="IContextCache" /> on types also implementing <see cref="IGridCellValueConnector2" />.
|
||||
/// </remarks>
|
||||
public static string? GetValue(this IGridCellValueConnector connector, GridValue.GridControl gridControl, ICollection<ArtifactDependency> dependencies, IContextCache contextCache)
|
||||
=> connector is IGridCellValueConnector2 connector2
|
||||
? connector2.GetValue(gridControl, dependencies, contextCache)
|
||||
: connector.GetValue(gridControl, dependencies);
|
||||
|
||||
/// <summary>
|
||||
/// Sets the value.
|
||||
/// </summary>
|
||||
/// <param name="connector">The connector.</param>
|
||||
/// <param name="gridControl">The grid control.</param>
|
||||
/// <param name="contextCache">The context cache.</param>
|
||||
/// <remarks>
|
||||
/// This extension method tries to make use of the <see cref="IContextCache" /> on types also implementing <see cref="IGridCellValueConnector2" />.
|
||||
/// </remarks>
|
||||
public static void SetValue(this IGridCellValueConnector connector, GridValue.GridControl gridControl, IContextCache contextCache)
|
||||
{
|
||||
if (connector is IGridCellValueConnector2 connector2)
|
||||
{
|
||||
connector2.SetValue(gridControl, contextCache);
|
||||
}
|
||||
else
|
||||
{
|
||||
connector.SetValue(gridControl);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,4 @@
|
||||
using Umbraco.Cms.Core.Models;
|
||||
using static Umbraco.Cms.Core.Models.GridValue;
|
||||
|
||||
namespace Umbraco.Cms.Core.Deploy;
|
||||
|
||||
@@ -37,20 +36,8 @@ public interface IGridCellValueConnector
|
||||
/// <remarks>
|
||||
/// Note that
|
||||
/// </remarks>
|
||||
[Obsolete("Use the overload accepting IContextCache instead. This overload will be removed in a future version.")]
|
||||
string? GetValue(GridValue.GridControl gridControl, ICollection<ArtifactDependency> dependencies)
|
||||
=> GetValue(gridControl, dependencies, PassThroughCache.Instance);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the value to be deployed from the control value as a string.
|
||||
/// </summary>
|
||||
/// <param name="gridControl">The control containing the value.</param>
|
||||
/// <param name="dependencies">The dependencies of the property.</param>
|
||||
/// <param name="contextCache">The context cache.</param>
|
||||
/// <returns>
|
||||
/// The grid cell value to be deployed.
|
||||
/// </returns>
|
||||
string? GetValue(GridValue.GridControl gridControl, ICollection<ArtifactDependency> dependencies, IContextCache contextCache);
|
||||
[Obsolete($"Implement {nameof(IGridCellValueConnector2)} and use the overload accepting {nameof(IContextCache)} instead. This overload will be removed in Umbraco 13.")]
|
||||
string? GetValue(GridValue.GridControl gridControl, ICollection<ArtifactDependency> dependencies);
|
||||
|
||||
/// <summary>
|
||||
/// Allows you to modify the value of a control being deployed.
|
||||
@@ -60,18 +47,6 @@ public interface IGridCellValueConnector
|
||||
/// Follows the pattern of the property value connectors (<see cref="IValueConnector" />).
|
||||
/// The SetValue method is used to modify the value of the <paramref name="gridControl" />.
|
||||
/// </remarks>
|
||||
[Obsolete("Use the overload accepting IContextCache instead. This overload will be removed in a future version.")]
|
||||
void SetValue(GridValue.GridControl gridControl)
|
||||
=> SetValue(gridControl, PassThroughCache.Instance);
|
||||
|
||||
/// <summary>
|
||||
/// Allows you to modify the value of a control being deployed.
|
||||
/// </summary>
|
||||
/// <param name="gridControl">The control being deployed.</param>
|
||||
/// <param name="contextCache">The context cache.</param>
|
||||
/// <remarks>
|
||||
/// Follows the pattern of the property value connectors (<see cref="IValueConnector" />).
|
||||
/// The SetValue method is used to modify the value of the <paramref name="gridControl" />.
|
||||
/// </remarks>
|
||||
void SetValue(GridValue.GridControl gridControl, IContextCache contextCache);
|
||||
[Obsolete($"Implement {nameof(IGridCellValueConnector2)} and use the overload accepting {nameof(IContextCache)} instead. This overload will be removed in Umbraco 13.")]
|
||||
void SetValue(GridValue.GridControl gridControl);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
using Umbraco.Cms.Core.Models;
|
||||
|
||||
namespace Umbraco.Cms.Core.Deploy;
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <remarks>
|
||||
/// This interface will be merged back into <see cref="IGridCellValueConnector" /> and removed in Umbraco 13.
|
||||
/// </remarks>
|
||||
public interface IGridCellValueConnector2 : IGridCellValueConnector
|
||||
{
|
||||
/// <inheritdoc />
|
||||
[Obsolete($"Use the overload accepting {nameof(IContextCache)} instead. This overload will be removed in Umbraco 13.")]
|
||||
string? IGridCellValueConnector.GetValue(GridValue.GridControl gridControl, ICollection<ArtifactDependency> dependencies)
|
||||
=> GetValue(gridControl, dependencies, PassThroughCache.Instance);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the value to be deployed from the control value as a string.
|
||||
/// </summary>
|
||||
/// <param name="gridControl">The control containing the value.</param>
|
||||
/// <param name="dependencies">The dependencies of the property.</param>
|
||||
/// <param name="contextCache">The context cache.</param>
|
||||
/// <returns>
|
||||
/// The grid cell value to be deployed.
|
||||
/// </returns>
|
||||
string? GetValue(GridValue.GridControl gridControl, ICollection<ArtifactDependency> dependencies, IContextCache contextCache);
|
||||
|
||||
/// <inheritdoc />
|
||||
[Obsolete($"Use the overload accepting {nameof(IContextCache)} instead. This overload will be removed in Umbraco 13.")]
|
||||
void IGridCellValueConnector.SetValue(GridValue.GridControl gridControl)
|
||||
=> SetValue(gridControl, PassThroughCache.Instance);
|
||||
|
||||
/// <summary>
|
||||
/// Allows you to modify the value of a control being deployed.
|
||||
/// </summary>
|
||||
/// <param name="gridControl">The control being deployed.</param>
|
||||
/// <param name="contextCache">The context cache.</param>
|
||||
/// <remarks>
|
||||
/// Follows the pattern of the property value connectors (<see cref="IValueConnector" />).
|
||||
/// The SetValue method is used to modify the value of the <paramref name="gridControl" />.
|
||||
/// </remarks>
|
||||
void SetValue(GridValue.GridControl gridControl, IContextCache contextCache);
|
||||
}
|
||||
@@ -305,7 +305,7 @@ public class UdiTests
|
||||
}
|
||||
|
||||
[UdiDefinition("foo", UdiType.GuidUdi)]
|
||||
public class FooConnector : IServiceConnector
|
||||
public class FooConnector : IServiceConnector2
|
||||
{
|
||||
public IArtifact GetArtifact(Udi udi, IContextCache contextCache) => throw new NotImplementedException();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user