diff --git a/Directory.Packages.props b/Directory.Packages.props
index e5ff6712ea..871c5b2e8f 100644
--- a/Directory.Packages.props
+++ b/Directory.Packages.props
@@ -17,7 +17,7 @@
-
+
@@ -90,7 +90,7 @@
-
+
diff --git a/src/Umbraco.Cms.Api.Management/Controllers/BackOfficeLoginController.cs b/src/Umbraco.Cms.Api.Management/Controllers/BackOfficeLoginController.cs
index aa8b711257..c6ff576b93 100644
--- a/src/Umbraco.Cms.Api.Management/Controllers/BackOfficeLoginController.cs
+++ b/src/Umbraco.Cms.Api.Management/Controllers/BackOfficeLoginController.cs
@@ -51,7 +51,7 @@ public class BackOfficeLoginController : Controller
if (string.IsNullOrEmpty(model.UmbracoUrl))
{
- model.UmbracoUrl = _hostingEnvironment.ToAbsolute(_globalSettings.UmbracoPath);
+ model.UmbracoUrl = _hostingEnvironment.ToAbsolute(Constants.System.DefaultUmbracoPath);
}
if (string.IsNullOrEmpty(model.ReturnUrl))
diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Document/ByKeyPublishedDocumentController.cs b/src/Umbraco.Cms.Api.Management/Controllers/Document/ByKeyPublishedDocumentController.cs
new file mode 100644
index 0000000000..2368afc732
--- /dev/null
+++ b/src/Umbraco.Cms.Api.Management/Controllers/Document/ByKeyPublishedDocumentController.cs
@@ -0,0 +1,58 @@
+using Asp.Versioning;
+using Microsoft.AspNetCore.Authorization;
+using Microsoft.AspNetCore.Http;
+using Microsoft.AspNetCore.Mvc;
+using Umbraco.Cms.Api.Management.Factories;
+using Umbraco.Cms.Api.Management.ViewModels.Document;
+using Umbraco.Cms.Core.Actions;
+using Umbraco.Cms.Core.Models;
+using Umbraco.Cms.Core.Security.Authorization;
+using Umbraco.Cms.Core.Services;
+using Umbraco.Cms.Web.Common.Authorization;
+using Umbraco.Extensions;
+
+namespace Umbraco.Cms.Api.Management.Controllers.Document;
+
+[ApiVersion("1.0")]
+public class ByKeyPublishedDocumentController : DocumentControllerBase
+{
+ private readonly IAuthorizationService _authorizationService;
+ private readonly IContentEditingService _contentEditingService;
+ private readonly IDocumentPresentationFactory _documentPresentationFactory;
+
+ public ByKeyPublishedDocumentController(
+ IAuthorizationService authorizationService,
+ IContentEditingService contentEditingService,
+ IDocumentPresentationFactory documentPresentationFactory)
+ {
+ _authorizationService = authorizationService;
+ _contentEditingService = contentEditingService;
+ _documentPresentationFactory = documentPresentationFactory;
+ }
+
+ [HttpGet("{id:guid}/published")]
+ [MapToApiVersion("1.0")]
+ [ProducesResponseType(typeof(PublishedDocumentResponseModel), StatusCodes.Status200OK)]
+ [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)]
+ public async Task ByKeyPublished(CancellationToken cancellationToken, Guid id)
+ {
+ AuthorizationResult authorizationResult = await _authorizationService.AuthorizeResourceAsync(
+ User,
+ ContentPermissionResource.WithKeys(ActionBrowse.ActionLetter, id),
+ AuthorizationPolicies.ContentPermissionByResource);
+
+ if (!authorizationResult.Succeeded)
+ {
+ return Forbidden();
+ }
+
+ IContent? content = await _contentEditingService.GetAsync(id);
+ if (content == null || content.Published is false)
+ {
+ return DocumentNotFound();
+ }
+
+ PublishedDocumentResponseModel model = await _documentPresentationFactory.CreatePublishedResponseModelAsync(content);
+ return Ok(model);
+ }
+}
diff --git a/src/Umbraco.Cms.Api.Management/Controllers/PartialView/ByPathPartialViewController.cs b/src/Umbraco.Cms.Api.Management/Controllers/PartialView/ByPathPartialViewController.cs
index 3fdae52115..bbf1dec98f 100644
--- a/src/Umbraco.Cms.Api.Management/Controllers/PartialView/ByPathPartialViewController.cs
+++ b/src/Umbraco.Cms.Api.Management/Controllers/PartialView/ByPathPartialViewController.cs
@@ -23,7 +23,7 @@ public class ByPathPartialViewController : PartialViewControllerBase
_mapper = mapper;
}
- [HttpGet("{path}")]
+ [HttpGet("{*path}")]
[MapToApiVersion("1.0")]
[ProducesResponseType(typeof(PartialViewResponseModel), StatusCodes.Status200OK)]
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)]
diff --git a/src/Umbraco.Cms.Api.Management/Controllers/PartialView/DeletePartialViewController.cs b/src/Umbraco.Cms.Api.Management/Controllers/PartialView/DeletePartialViewController.cs
index a72c8129b5..b44990b41e 100644
--- a/src/Umbraco.Cms.Api.Management/Controllers/PartialView/DeletePartialViewController.cs
+++ b/src/Umbraco.Cms.Api.Management/Controllers/PartialView/DeletePartialViewController.cs
@@ -22,7 +22,7 @@ public class DeletePartialViewController : PartialViewControllerBase
_backOfficeSecurityAccessor = backOfficeSecurityAccessor;
}
- [HttpDelete("{path}")]
+ [HttpDelete("{*path}")]
[MapToApiVersion("1.0")]
[ProducesResponseType(StatusCodes.Status200OK)]
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status400BadRequest)]
diff --git a/src/Umbraco.Cms.Api.Management/Controllers/PartialView/Folder/ByPathPartialViewFolderController.cs b/src/Umbraco.Cms.Api.Management/Controllers/PartialView/Folder/ByPathPartialViewFolderController.cs
index df15c726b5..727f4d1d68 100644
--- a/src/Umbraco.Cms.Api.Management/Controllers/PartialView/Folder/ByPathPartialViewFolderController.cs
+++ b/src/Umbraco.Cms.Api.Management/Controllers/PartialView/Folder/ByPathPartialViewFolderController.cs
@@ -22,7 +22,7 @@ public class ByPathPartialViewFolderController : PartialViewFolderControllerBase
_mapper = mapper;
}
- [HttpGet("{path}")]
+ [HttpGet("{*path}")]
[MapToApiVersion("1.0")]
[ProducesResponseType(typeof(PartialViewFolderResponseModel), StatusCodes.Status200OK)]
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)]
diff --git a/src/Umbraco.Cms.Api.Management/Controllers/PartialView/Folder/DeletePartialViewFolderController.cs b/src/Umbraco.Cms.Api.Management/Controllers/PartialView/Folder/DeletePartialViewFolderController.cs
index 121cb1dae7..41cf9548d5 100644
--- a/src/Umbraco.Cms.Api.Management/Controllers/PartialView/Folder/DeletePartialViewFolderController.cs
+++ b/src/Umbraco.Cms.Api.Management/Controllers/PartialView/Folder/DeletePartialViewFolderController.cs
@@ -15,7 +15,7 @@ public class DeletePartialViewFolderController : PartialViewFolderControllerBase
public DeletePartialViewFolderController(IPartialViewFolderService partialViewFolderService)
=> _partialViewFolderService = partialViewFolderService;
- [HttpDelete("{path}")]
+ [HttpDelete("{*path}")]
[MapToApiVersion("1.0")]
[ProducesResponseType(StatusCodes.Status200OK)]
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status400BadRequest)]
diff --git a/src/Umbraco.Cms.Api.Management/Controllers/PartialView/UpdatePartialViewController.cs b/src/Umbraco.Cms.Api.Management/Controllers/PartialView/UpdatePartialViewController.cs
index a935f87a80..e460b0adf0 100644
--- a/src/Umbraco.Cms.Api.Management/Controllers/PartialView/UpdatePartialViewController.cs
+++ b/src/Umbraco.Cms.Api.Management/Controllers/PartialView/UpdatePartialViewController.cs
@@ -29,7 +29,7 @@ public class UpdatePartialViewController : PartialViewControllerBase
_mapper = mapper;
}
- [HttpPut("{path}")]
+ [HttpPut("{*path}")]
[MapToApiVersion("1.0")]
[ProducesResponseType(StatusCodes.Status200OK)]
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status400BadRequest)]
diff --git a/src/Umbraco.Cms.Api.Management/Controllers/PublishedCache/CollectPublishedCacheController.cs b/src/Umbraco.Cms.Api.Management/Controllers/PublishedCache/CollectPublishedCacheController.cs
index 4cbac68446..ef759ca5a4 100644
--- a/src/Umbraco.Cms.Api.Management/Controllers/PublishedCache/CollectPublishedCacheController.cs
+++ b/src/Umbraco.Cms.Api.Management/Controllers/PublishedCache/CollectPublishedCacheController.cs
@@ -1,7 +1,6 @@
using Asp.Versioning;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
-using Umbraco.Cms.Core.PublishedCache;
namespace Umbraco.Cms.Api.Management.Controllers.PublishedCache;
@@ -11,9 +10,9 @@ public class CollectPublishedCacheController : PublishedCacheControllerBase
{
[HttpPost("collect")]
[MapToApiVersion("1.0")]
- [ProducesResponseType(StatusCodes.Status200OK)]
+ [ProducesResponseType(StatusCodes.Status501NotImplemented)]
public async Task Collect(CancellationToken cancellationToken)
{
- return Ok();
+ return StatusCode(StatusCodes.Status501NotImplemented);
}
}
diff --git a/src/Umbraco.Cms.Api.Management/Controllers/PublishedCache/StatusPublishedCacheController.cs b/src/Umbraco.Cms.Api.Management/Controllers/PublishedCache/StatusPublishedCacheController.cs
index aad76e7dbf..3a9d72c12c 100644
--- a/src/Umbraco.Cms.Api.Management/Controllers/PublishedCache/StatusPublishedCacheController.cs
+++ b/src/Umbraco.Cms.Api.Management/Controllers/PublishedCache/StatusPublishedCacheController.cs
@@ -1,7 +1,6 @@
using Asp.Versioning;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
-using Umbraco.Cms.Core.PublishedCache;
namespace Umbraco.Cms.Api.Management.Controllers.PublishedCache;
@@ -11,7 +10,9 @@ public class StatusPublishedCacheController : PublishedCacheControllerBase
{
[HttpGet("status")]
[MapToApiVersion("1.0")]
- [ProducesResponseType(typeof(string), StatusCodes.Status200OK)]
+ [ProducesResponseType(StatusCodes.Status501NotImplemented)]
public async Task> Status(CancellationToken cancellationToken)
- => await Task.FromResult(Ok("Obsoleted"));
+ {
+ return StatusCode(StatusCodes.Status501NotImplemented);
+ }
}
diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Script/ByPathScriptController.cs b/src/Umbraco.Cms.Api.Management/Controllers/Script/ByPathScriptController.cs
index 67a3b605a7..60c5fe644a 100644
--- a/src/Umbraco.Cms.Api.Management/Controllers/Script/ByPathScriptController.cs
+++ b/src/Umbraco.Cms.Api.Management/Controllers/Script/ByPathScriptController.cs
@@ -23,7 +23,7 @@ public class ByPathScriptController : ScriptControllerBase
_mapper = mapper;
}
- [HttpGet("{path}")]
+ [HttpGet("{*path}")]
[MapToApiVersion("1.0")]
[ProducesResponseType(typeof(ScriptResponseModel), StatusCodes.Status200OK)]
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)]
diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Script/DeleteScriptController.cs b/src/Umbraco.Cms.Api.Management/Controllers/Script/DeleteScriptController.cs
index 74dc1554e8..94c2e0a1c0 100644
--- a/src/Umbraco.Cms.Api.Management/Controllers/Script/DeleteScriptController.cs
+++ b/src/Umbraco.Cms.Api.Management/Controllers/Script/DeleteScriptController.cs
@@ -22,7 +22,7 @@ public class DeleteScriptController : ScriptControllerBase
_backOfficeSecurityAccessor = backOfficeSecurityAccessor;
}
- [HttpDelete("{path}")]
+ [HttpDelete("{*path}")]
[MapToApiVersion("1.0")]
[ProducesResponseType(StatusCodes.Status200OK)]
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status400BadRequest)]
diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Script/Folder/ByPathScriptFolderController.cs b/src/Umbraco.Cms.Api.Management/Controllers/Script/Folder/ByPathScriptFolderController.cs
index 84543bffe4..698c94f685 100644
--- a/src/Umbraco.Cms.Api.Management/Controllers/Script/Folder/ByPathScriptFolderController.cs
+++ b/src/Umbraco.Cms.Api.Management/Controllers/Script/Folder/ByPathScriptFolderController.cs
@@ -22,7 +22,7 @@ public class ByPathScriptFolderController : ScriptFolderControllerBase
_mapper = mapper;
}
- [HttpGet("{path}")]
+ [HttpGet("{*path}")]
[MapToApiVersion("1.0")]
[ProducesResponseType(typeof(ScriptFolderResponseModel), StatusCodes.Status200OK)]
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)]
diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Script/Folder/DeleteScriptFolderController.cs b/src/Umbraco.Cms.Api.Management/Controllers/Script/Folder/DeleteScriptFolderController.cs
index b5fd5022b7..48d97e9b4b 100644
--- a/src/Umbraco.Cms.Api.Management/Controllers/Script/Folder/DeleteScriptFolderController.cs
+++ b/src/Umbraco.Cms.Api.Management/Controllers/Script/Folder/DeleteScriptFolderController.cs
@@ -15,7 +15,7 @@ public class DeleteScriptFolderController : ScriptFolderControllerBase
public DeleteScriptFolderController(IScriptFolderService scriptFolderService)
=> _scriptFolderService = scriptFolderService;
- [HttpDelete("{path}")]
+ [HttpDelete("{*path}")]
[MapToApiVersion("1.0")]
[ProducesResponseType(StatusCodes.Status200OK)]
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status400BadRequest)]
diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Script/UpdateScriptController.cs b/src/Umbraco.Cms.Api.Management/Controllers/Script/UpdateScriptController.cs
index 87ff3502ba..a18f82ebc8 100644
--- a/src/Umbraco.Cms.Api.Management/Controllers/Script/UpdateScriptController.cs
+++ b/src/Umbraco.Cms.Api.Management/Controllers/Script/UpdateScriptController.cs
@@ -29,7 +29,7 @@ public class UpdateScriptController : ScriptControllerBase
_backOfficeSecurityAccessor = backOfficeSecurityAccessor;
}
- [HttpPut("{path}")]
+ [HttpPut("{*path}")]
[MapToApiVersion("1.0")]
[ProducesResponseType(StatusCodes.Status200OK)]
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status400BadRequest)]
diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Stylesheet/ByPathStylesheetController.cs b/src/Umbraco.Cms.Api.Management/Controllers/Stylesheet/ByPathStylesheetController.cs
index a7e3a6139f..87aec60133 100644
--- a/src/Umbraco.Cms.Api.Management/Controllers/Stylesheet/ByPathStylesheetController.cs
+++ b/src/Umbraco.Cms.Api.Management/Controllers/Stylesheet/ByPathStylesheetController.cs
@@ -23,7 +23,7 @@ public class ByPathStylesheetController : StylesheetControllerBase
_umbracoMapper = umbracoMapper;
}
- [HttpGet("{path}")]
+ [HttpGet("{*path}")]
[MapToApiVersion("1.0")]
[ProducesResponseType(typeof(StylesheetResponseModel), StatusCodes.Status200OK)]
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)]
diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Stylesheet/DeleteStylesheetController.cs b/src/Umbraco.Cms.Api.Management/Controllers/Stylesheet/DeleteStylesheetController.cs
index 3dcdb92bbd..9996ddeae0 100644
--- a/src/Umbraco.Cms.Api.Management/Controllers/Stylesheet/DeleteStylesheetController.cs
+++ b/src/Umbraco.Cms.Api.Management/Controllers/Stylesheet/DeleteStylesheetController.cs
@@ -25,7 +25,7 @@ public class DeleteStylesheetController : StylesheetControllerBase
_backOfficeSecurityAccessor = backOfficeSecurityAccessor;
}
- [HttpDelete("{path}")]
+ [HttpDelete("{*path}")]
[MapToApiVersion("1.0")]
[ProducesResponseType(StatusCodes.Status200OK)]
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status400BadRequest)]
diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Stylesheet/Folder/ByPathStylesheetFolderController.cs b/src/Umbraco.Cms.Api.Management/Controllers/Stylesheet/Folder/ByPathStylesheetFolderController.cs
index d5d0cca84f..95c7d853ab 100644
--- a/src/Umbraco.Cms.Api.Management/Controllers/Stylesheet/Folder/ByPathStylesheetFolderController.cs
+++ b/src/Umbraco.Cms.Api.Management/Controllers/Stylesheet/Folder/ByPathStylesheetFolderController.cs
@@ -24,7 +24,7 @@ public class ByPathStylesheetFolderController : StylesheetFolderControllerBase
_mapper = mapper;
}
- [HttpGet("{path}")]
+ [HttpGet("{*path}")]
[MapToApiVersion("1.0")]
[ProducesResponseType(typeof(StylesheetFolderResponseModel), StatusCodes.Status200OK)]
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)]
diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Stylesheet/Folder/DeleteStylesheetFolderController.cs b/src/Umbraco.Cms.Api.Management/Controllers/Stylesheet/Folder/DeleteStylesheetFolderController.cs
index 38760b34e7..deb38f0865 100644
--- a/src/Umbraco.Cms.Api.Management/Controllers/Stylesheet/Folder/DeleteStylesheetFolderController.cs
+++ b/src/Umbraco.Cms.Api.Management/Controllers/Stylesheet/Folder/DeleteStylesheetFolderController.cs
@@ -15,7 +15,7 @@ public class DeleteStylesheetFolderController : StylesheetFolderControllerBase
public DeleteStylesheetFolderController(IStylesheetFolderService stylesheetFolderService)
=> _stylesheetFolderService = stylesheetFolderService;
- [HttpDelete("{path}")]
+ [HttpDelete("{*path}")]
[MapToApiVersion("1.0")]
[ProducesResponseType(StatusCodes.Status200OK)]
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status400BadRequest)]
diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Stylesheet/UpdateStylesheetController.cs b/src/Umbraco.Cms.Api.Management/Controllers/Stylesheet/UpdateStylesheetController.cs
index 377fef87d1..7000ca7b40 100644
--- a/src/Umbraco.Cms.Api.Management/Controllers/Stylesheet/UpdateStylesheetController.cs
+++ b/src/Umbraco.Cms.Api.Management/Controllers/Stylesheet/UpdateStylesheetController.cs
@@ -32,7 +32,7 @@ public class UpdateStylesheetController : StylesheetControllerBase
_backOfficeSecurityAccessor = backOfficeSecurityAccessor;
}
- [HttpPut("{path}")]
+ [HttpPut("{*path}")]
[MapToApiVersion("1.0")]
[ProducesResponseType(StatusCodes.Status200OK)]
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status400BadRequest)]
diff --git a/src/Umbraco.Cms.Api.Management/Controllers/User/ClientCredentials/ClientCredentialsUserControllerBase.cs b/src/Umbraco.Cms.Api.Management/Controllers/User/ClientCredentials/ClientCredentialsUserControllerBase.cs
index 9a30da3811..1751564b37 100644
--- a/src/Umbraco.Cms.Api.Management/Controllers/User/ClientCredentials/ClientCredentialsUserControllerBase.cs
+++ b/src/Umbraco.Cms.Api.Management/Controllers/User/ClientCredentials/ClientCredentialsUserControllerBase.cs
@@ -18,6 +18,10 @@ public abstract class ClientCredentialsUserControllerBase : UserControllerBase
.WithTitle("Duplicate client ID")
.WithDetail("The specified client ID is already in use. Choose another client ID.")
.Build()),
+ BackOfficeUserClientCredentialsOperationStatus.InvalidClientId => BadRequest(problemDetailsBuilder
+ .WithTitle("Invalid client ID")
+ .WithDetail("The specified client ID is invalid. A valid client ID can only contain [a-z], [A-Z], [0-9], and [-._~].")
+ .Build()),
_ => StatusCode(StatusCodes.Status500InternalServerError, problemDetailsBuilder
.WithTitle("Unknown client credentials operation status.")
.Build()),
diff --git a/src/Umbraco.Cms.Api.Management/Factories/DocumentPresentationFactory.cs b/src/Umbraco.Cms.Api.Management/Factories/DocumentPresentationFactory.cs
index c6291f4db0..817cd9fa2e 100644
--- a/src/Umbraco.Cms.Api.Management/Factories/DocumentPresentationFactory.cs
+++ b/src/Umbraco.Cms.Api.Management/Factories/DocumentPresentationFactory.cs
@@ -54,6 +54,23 @@ internal sealed class DocumentPresentationFactory : IDocumentPresentationFactory
return responseModel;
}
+ public async Task CreatePublishedResponseModelAsync(IContent content)
+ {
+ PublishedDocumentResponseModel responseModel = _umbracoMapper.Map(content)!;
+
+ responseModel.Urls = await _documentUrlFactory.CreateUrlsAsync(content);
+
+ Guid? templateKey = content.PublishTemplateId.HasValue
+ ? _templateService.GetAsync(content.PublishTemplateId.Value).Result?.Key
+ : null;
+
+ responseModel.Template = templateKey.HasValue
+ ? new ReferenceByIdModel { Id = templateKey.Value }
+ : null;
+
+ return responseModel;
+ }
+
public DocumentItemResponseModel CreateItemResponseModel(IDocumentEntitySlim entity)
{
var responseModel = new DocumentItemResponseModel
diff --git a/src/Umbraco.Cms.Api.Management/Factories/IDocumentPresentationFactory.cs b/src/Umbraco.Cms.Api.Management/Factories/IDocumentPresentationFactory.cs
index 23b11b0e4f..40a537e01a 100644
--- a/src/Umbraco.Cms.Api.Management/Factories/IDocumentPresentationFactory.cs
+++ b/src/Umbraco.Cms.Api.Management/Factories/IDocumentPresentationFactory.cs
@@ -14,6 +14,8 @@ public interface IDocumentPresentationFactory
{
Task CreateResponseModelAsync(IContent content);
+ Task CreatePublishedResponseModelAsync(IContent content);
+
DocumentItemResponseModel CreateItemResponseModel(IDocumentEntitySlim entity);
DocumentBlueprintItemResponseModel CreateBlueprintItemResponseModel(IDocumentEntitySlim entity);
diff --git a/src/Umbraco.Cms.Api.Management/Mapping/Content/ContentMapDefinition.cs b/src/Umbraco.Cms.Api.Management/Mapping/Content/ContentMapDefinition.cs
index 038e3fbf8b..6970e7d251 100644
--- a/src/Umbraco.Cms.Api.Management/Mapping/Content/ContentMapDefinition.cs
+++ b/src/Umbraco.Cms.Api.Management/Mapping/Content/ContentMapDefinition.cs
@@ -19,7 +19,7 @@ public abstract class ContentMapDefinition MapValueViewModels(IEnumerable properties, ValueViewModelMapping? additionalPropertyMapping = null) =>
+ protected IEnumerable MapValueViewModels(IEnumerable properties, ValueViewModelMapping? additionalPropertyMapping = null, bool published = false) =>
properties
.SelectMany(property => property
.Values
@@ -31,12 +31,19 @@ public abstract class ContentMapDefinition((_, _) => new DocumentResponseModel(), Map);
+ mapper.Define((_, _) => new PublishedDocumentResponseModel(), Map);
mapper.Define((_, _) => new DocumentCollectionResponseModel(), Map);
mapper.Define((_, _) => new DocumentBlueprintResponseModel(), Map);
}
@@ -44,6 +45,28 @@ public class DocumentMapDefinition : ContentMapDefinition(source.ContentType)!;
+ target.Values = MapValueViewModels(source.Properties, published: true);
+ target.Variants = MapVariantViewModels(
+ source,
+ (culture, _, documentVariantViewModel) =>
+ {
+ documentVariantViewModel.Name = source.GetPublishName(culture) ?? documentVariantViewModel.Name;
+ DocumentVariantState variantState = DocumentVariantStateHelper.GetState(source, culture);
+ documentVariantViewModel.State = variantState == DocumentVariantState.PublishedPendingChanges
+ ? DocumentVariantState.Published
+ : variantState;
+ documentVariantViewModel.PublishDate = culture == null
+ ? source.PublishDate
+ : source.GetPublishDate(culture);
+ });
+ target.IsTrashed = source.Trashed;
+ }
+
// Umbraco.Code.MapAll
private void Map(IContent source, DocumentCollectionResponseModel target, MapperContext context)
{
diff --git a/src/Umbraco.Cms.Api.Management/OpenApi.json b/src/Umbraco.Cms.Api.Management/OpenApi.json
index eb912bf856..6240675b2c 100644
--- a/src/Umbraco.Cms.Api.Management/OpenApi.json
+++ b/src/Umbraco.Cms.Api.Management/OpenApi.json
@@ -8967,6 +8967,66 @@
]
}
},
+ "/umbraco/management/api/v1/document/{id}/published": {
+ "get": {
+ "tags": [
+ "Document"
+ ],
+ "operationId": "GetDocumentByIdPublished",
+ "parameters": [
+ {
+ "name": "id",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "string",
+ "format": "uuid"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "content": {
+ "application/json": {
+ "schema": {
+ "oneOf": [
+ {
+ "$ref": "#/components/schemas/PublishedDocumentResponseModel"
+ }
+ ]
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "Not Found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "oneOf": [
+ {
+ "$ref": "#/components/schemas/ProblemDetails"
+ }
+ ]
+ }
+ }
+ }
+ },
+ "401": {
+ "description": "The resource is protected and requires an authentication token"
+ },
+ "403": {
+ "description": "The authenticated user do not have access to this resource"
+ }
+ },
+ "security": [
+ {
+ "Backoffice User": [ ]
+ }
+ ]
+ }
+ },
"/umbraco/management/api/v1/document/{id}/referenced-by": {
"get": {
"tags": [
@@ -42471,6 +42531,72 @@
},
"additionalProperties": false
},
+ "PublishedDocumentResponseModel": {
+ "required": [
+ "documentType",
+ "id",
+ "isTrashed",
+ "urls",
+ "values",
+ "variants"
+ ],
+ "type": "object",
+ "properties": {
+ "values": {
+ "type": "array",
+ "items": {
+ "oneOf": [
+ {
+ "$ref": "#/components/schemas/DocumentValueResponseModel"
+ }
+ ]
+ }
+ },
+ "variants": {
+ "type": "array",
+ "items": {
+ "oneOf": [
+ {
+ "$ref": "#/components/schemas/DocumentVariantResponseModel"
+ }
+ ]
+ }
+ },
+ "id": {
+ "type": "string",
+ "format": "uuid"
+ },
+ "documentType": {
+ "oneOf": [
+ {
+ "$ref": "#/components/schemas/DocumentTypeReferenceResponseModel"
+ }
+ ]
+ },
+ "urls": {
+ "type": "array",
+ "items": {
+ "oneOf": [
+ {
+ "$ref": "#/components/schemas/DocumentUrlInfoModel"
+ }
+ ]
+ }
+ },
+ "template": {
+ "oneOf": [
+ {
+ "$ref": "#/components/schemas/ReferenceByIdModel"
+ }
+ ],
+ "nullable": true
+ },
+ "isTrashed": {
+ "type": "boolean"
+ }
+ },
+ "additionalProperties": false
+ },
"RedirectStatusModel": {
"enum": [
"Enabled",
diff --git a/src/Umbraco.Cms.Api.Management/ViewModels/Document/PublishedDocumentResponseModel.cs b/src/Umbraco.Cms.Api.Management/ViewModels/Document/PublishedDocumentResponseModel.cs
new file mode 100644
index 0000000000..a228a3954b
--- /dev/null
+++ b/src/Umbraco.Cms.Api.Management/ViewModels/Document/PublishedDocumentResponseModel.cs
@@ -0,0 +1,5 @@
+namespace Umbraco.Cms.Api.Management.ViewModels.Document;
+
+public class PublishedDocumentResponseModel : DocumentResponseModel
+{
+}
diff --git a/src/Umbraco.Cms.Persistence.EFCore/Extensions/BackOfficeAuthBuilderOpenIddictExtensions.cs b/src/Umbraco.Cms.Persistence.EFCore/Extensions/BackOfficeAuthBuilderOpenIddictExtensions.cs
deleted file mode 100644
index 3764537988..0000000000
--- a/src/Umbraco.Cms.Persistence.EFCore/Extensions/BackOfficeAuthBuilderOpenIddictExtensions.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-using Microsoft.EntityFrameworkCore;
-using Umbraco.Cms.Core.DependencyInjection;
-using Umbraco.Cms.Persistence.EFCore;
-
-namespace Umbraco.Extensions;
-
-public static class BackOfficeAuthBuilderOpenIddictExtensions
-{
- [Obsolete("This is no longer used and will be removed in V15. Instead use the overload that specifies the DbContext type.")]
- public static IUmbracoBuilder AddUmbracoEFCoreDbContext(this IUmbracoBuilder builder)
- {
- builder.Services.AddUmbracoEFCoreContext((options, connectionString, providerName) =>
- {
- // Register the entity sets needed by OpenIddict.
- options.UseOpenIddict();
- });
-
- return builder;
- }
-}
diff --git a/src/Umbraco.Cms.Persistence.EFCore/Extensions/UmbracoEFCoreServiceCollectionExtensions.cs b/src/Umbraco.Cms.Persistence.EFCore/Extensions/UmbracoEFCoreServiceCollectionExtensions.cs
index 7694f83dd2..d7da8a65fe 100644
--- a/src/Umbraco.Cms.Persistence.EFCore/Extensions/UmbracoEFCoreServiceCollectionExtensions.cs
+++ b/src/Umbraco.Cms.Persistence.EFCore/Extensions/UmbracoEFCoreServiceCollectionExtensions.cs
@@ -14,45 +14,6 @@ public static class UmbracoEFCoreServiceCollectionExtensions
{
public delegate void DefaultEFCoreOptionsAction(DbContextOptionsBuilder options, string? providerName, string? connectionString);
- [Obsolete("Use AddUmbracoDbContext(this IServiceCollection services, Action? optionsAction = null) instead.")]
- public static IServiceCollection AddUmbracoEFCoreContext(this IServiceCollection services, DefaultEFCoreOptionsAction? defaultEFCoreOptionsAction = null)
- where T : DbContext
- {
- services.AddPooledDbContextFactory((provider, builder) => SetupDbContext(defaultEFCoreOptionsAction, provider, builder));
- services.AddTransient(services => services.GetRequiredService>().CreateDbContext());
-
- services.AddUnique, AmbientEFCoreScopeStack>();
- services.AddUnique, EFCoreScopeAccessor>();
- services.AddUnique, EFCoreScopeProvider>();
- services.AddSingleton>();
- services.AddSingleton>();
-
- return services;
- }
-
- [Obsolete("Use AddUmbracoDbContext(this IServiceCollection services, Action? optionsAction = null) instead.")]
- public static IServiceCollection AddUmbracoEFCoreContext(this IServiceCollection services, string connectionString, string providerName, DefaultEFCoreOptionsAction? defaultEFCoreOptionsAction = null)
- where T : DbContext
- {
- // Replace data directory
- string? dataDirectory = AppDomain.CurrentDomain.GetData(Constants.System.DataDirectoryName)?.ToString();
- if (string.IsNullOrEmpty(dataDirectory) is false)
- {
- connectionString = connectionString.Replace(Constants.System.DataDirectoryPlaceholder, dataDirectory);
- }
-
- services.AddPooledDbContextFactory(options => defaultEFCoreOptionsAction?.Invoke(options, providerName, connectionString));
- services.AddTransient(services => services.GetRequiredService>().CreateDbContext());
-
- services.AddUnique, AmbientEFCoreScopeStack>();
- services.AddUnique, EFCoreScopeAccessor>();
- services.AddUnique, EFCoreScopeProvider>();
- services.AddSingleton>();
- services.AddSingleton>();
-
- return services;
- }
-
///
/// Adds a EFCore DbContext with all the services needed to integrate with Umbraco scopes.
///
@@ -149,26 +110,4 @@ public static class UmbracoEFCoreServiceCollectionExtensions
builder.UseDatabaseProvider(connectionStrings.ProviderName, connectionStrings.ConnectionString);
}
-
- [Obsolete]
- private static void SetupDbContext(DefaultEFCoreOptionsAction? defaultEFCoreOptionsAction, IServiceProvider provider, DbContextOptionsBuilder builder)
- {
- ConnectionStrings connectionStrings = GetConnectionStringAndProviderName(provider);
- defaultEFCoreOptionsAction?.Invoke(builder, connectionStrings.ConnectionString, connectionStrings.ProviderName);
- }
-
- [Obsolete]
- private static ConnectionStrings GetConnectionStringAndProviderName(IServiceProvider serviceProvider)
- {
- ConnectionStrings connectionStrings = serviceProvider.GetRequiredService>().CurrentValue;
-
- // Replace data directory
- string? dataDirectory = AppDomain.CurrentDomain.GetData(Constants.System.DataDirectoryName)?.ToString();
- if (string.IsNullOrEmpty(dataDirectory) is false)
- {
- connectionStrings.ConnectionString = connectionStrings.ConnectionString?.Replace(Constants.System.DataDirectoryPlaceholder, dataDirectory);
- }
-
- return connectionStrings;
- }
}
diff --git a/src/Umbraco.Core/Actions/ActionToPublish.cs b/src/Umbraco.Core/Actions/ActionToPublish.cs
deleted file mode 100644
index a980d819aa..0000000000
--- a/src/Umbraco.Core/Actions/ActionToPublish.cs
+++ /dev/null
@@ -1,35 +0,0 @@
-// Copyright (c) Umbraco.
-// See LICENSE for more details.
-
-namespace Umbraco.Cms.Core.Actions;
-
-///
-/// This action is invoked when children to a document is being sent to published (by an editor without publishrights).
-///
-[Obsolete("Scheduled for removal in v13")]
-public class ActionToPublish : IAction
-{
- ///
- public const string ActionLetter = "Umb.Document.SendForApproval";
-
- ///
- public const string ActionAlias = "sendtopublish";
-
- ///
- public string Letter => ActionLetter;
-
- ///
- public string Alias => ActionAlias;
-
- ///
- public string Category => Constants.Conventions.PermissionCategories.ContentCategory;
-
- ///
- public string Icon => "icon-outbox";
-
- ///
- public bool ShowInNotifier => true;
-
- ///
- public bool CanBePermissionAssigned => true;
-}
diff --git a/src/Umbraco.Core/Cache/DataTypeConfigurationCache.cs b/src/Umbraco.Core/Cache/DataTypeConfigurationCache.cs
index 78ee17d2f8..70c9b4161b 100644
--- a/src/Umbraco.Core/Cache/DataTypeConfigurationCache.cs
+++ b/src/Umbraco.Core/Cache/DataTypeConfigurationCache.cs
@@ -26,7 +26,7 @@ internal sealed class DataTypeConfigurationCache : IDataTypeConfigurationCache
var cacheKey = GetCacheKey(key);
if (_memoryCache.TryGetValue(cacheKey, out T? configuration) is false)
{
- IDataType? dataType = _dataTypeService.GetDataType(key);
+ IDataType? dataType = _dataTypeService.GetAsync(key).GetAwaiter().GetResult();
configuration = dataType?.ConfigurationAs();
// Only cache if data type was found (but still cache null configurations)
diff --git a/src/Umbraco.Core/Cache/Refreshers/Implement/ContentCacheRefresher.cs b/src/Umbraco.Core/Cache/Refreshers/Implement/ContentCacheRefresher.cs
index da70761466..f84b597b15 100644
--- a/src/Umbraco.Core/Cache/Refreshers/Implement/ContentCacheRefresher.cs
+++ b/src/Umbraco.Core/Cache/Refreshers/Implement/ContentCacheRefresher.cs
@@ -86,15 +86,16 @@ public sealed class ContentCacheRefresher : PayloadCacheRefresherBase();
IAppPolicyCache isolatedCache = AppCaches.IsolatedCaches.GetOrCreate();
- foreach (JsonPayload payload in payloads.Where(x => x.Id != default))
+ foreach (JsonPayload payload in payloads)
{
- // By INT Id
- isolatedCache.Clear(RepositoryCacheKeys.GetKey(payload.Id));
-
- // By GUID Key
- isolatedCache.Clear(RepositoryCacheKeys.GetKey(payload.Key));
-
+ if (payload.Id != default)
+ {
+ // By INT Id
+ isolatedCache.Clear(RepositoryCacheKeys.GetKey(payload.Id));
+ // By GUID Key
+ isolatedCache.Clear(RepositoryCacheKeys.GetKey(payload.Key));
+ }
// remove those that are in the branch
if (payload.ChangeTypes.HasTypesAny(TreeChangeTypes.RefreshBranch | TreeChangeTypes.Remove))
@@ -115,7 +116,10 @@ public sealed class ContentCacheRefresher : PayloadCacheRefresherBase? _assemblies;
- ///
- /// Initializes a new instance of the class.
- ///
- [Obsolete("Please use an alternative constructor.")]
- public TypeLoader(
- ITypeFinder typeFinder,
- IRuntimeHash runtimeHash,
- IAppPolicyCache runtimeCache,
- DirectoryInfo localTempPath,
- ILogger logger,
- IProfiler profiler,
- IEnumerable? assembliesToScan = null)
- : this(typeFinder, logger, assembliesToScan)
- {
- }
-
- ///
- /// Initializes a new instance of the class.
- ///
- [Obsolete("Please use an alternative constructor.")]
- public TypeLoader(
- ITypeFinder typeFinder,
- IRuntimeHash runtimeHash,
- IAppPolicyCache runtimeCache,
- DirectoryInfo localTempPath,
- ILogger logger,
- IProfiler profiler,
- bool detectChanges,
- IEnumerable? assembliesToScan = null)
- : this(typeFinder, logger, assembliesToScan)
- {
- }
-
public TypeLoader(
ITypeFinder typeFinder,
ILogger logger,
@@ -100,18 +67,6 @@ public sealed class TypeLoader
[Obsolete("This will be removed in a future version.")]
public IEnumerable TypeLists => _types.Values;
- ///
- /// Sets a type list.
- ///
- /// For unit tests.
- // internal for tests
- [Obsolete("This will be removed in a future version.")]
- public void AddTypeList(TypeList typeList)
- {
- Type tobject = typeof(object); // CompositeTypeTypeKey does not support null values
- _types[new CompositeTypeTypeKey(typeList.BaseType ?? tobject, typeList.AttributeType ?? tobject)] = typeList;
- }
-
#region Get Assembly Attributes
///
@@ -136,34 +91,6 @@ public sealed class TypeLoader
#region Cache
- // internal for tests
- [Obsolete("This will be removed in a future version.")]
- public Attempt> TryGetCached(Type baseType, Type attributeType) =>
- Attempt>.Fail();
-
- // internal for tests
- [Obsolete("This will be removed in a future version.")]
- public Dictionary<(string, string), IEnumerable>? ReadCache() => null;
-
- // internal for tests
- [Obsolete("This will be removed in a future version.")]
- public string? GetTypesListFilePath() => null;
-
- // internal for tests
- [Obsolete("This will be removed in a future version.")]
- public void WriteCache()
- {
- }
-
- ///
- /// Clears cache.
- ///
- /// Generally only used for resetting cache, for example during the install process.
- [Obsolete("This will be removed in a future version.")]
- public void ClearTypesCache()
- {
- }
-
#endregion
#region Get Types
diff --git a/src/Umbraco.Core/Configuration/GlobalSettingsExtensions.cs b/src/Umbraco.Core/Configuration/GlobalSettingsExtensions.cs
index 2f49bfd146..67966c9849 100644
--- a/src/Umbraco.Core/Configuration/GlobalSettingsExtensions.cs
+++ b/src/Umbraco.Core/Configuration/GlobalSettingsExtensions.cs
@@ -22,7 +22,7 @@ public static class GlobalSettingsExtensions
return _backOfficePath;
}
- _backOfficePath = hostingEnvironment.ToAbsolute(globalSettings.UmbracoPath);
+ _backOfficePath = hostingEnvironment.ToAbsolute(Constants.System.DefaultUmbracoPath);
return _backOfficePath;
}
@@ -54,9 +54,9 @@ public static class GlobalSettingsExtensions
this GlobalSettings globalSettings,
IHostingEnvironment hostingEnvironment)
{
- var path = string.IsNullOrEmpty(globalSettings.UmbracoPath)
+ var path = string.IsNullOrEmpty(Constants.System.DefaultUmbracoPath)
? string.Empty
- : hostingEnvironment.ToAbsolute(globalSettings.UmbracoPath);
+ : hostingEnvironment.ToAbsolute(Constants.System.DefaultUmbracoPath);
if (path.IsNullOrWhiteSpace())
{
diff --git a/src/Umbraco.Core/Configuration/Models/GlobalSettings.cs b/src/Umbraco.Core/Configuration/Models/GlobalSettings.cs
index 58d1bb7134..7d2556ea60 100644
--- a/src/Umbraco.Core/Configuration/Models/GlobalSettings.cs
+++ b/src/Umbraco.Core/Configuration/Models/GlobalSettings.cs
@@ -76,16 +76,6 @@ public class GlobalSettings
[DefaultValue(StaticVersionCheckPeriod)]
public int VersionCheckPeriod { get; set; } = StaticVersionCheckPeriod;
- ///
- /// Gets or sets a value for the Umbraco back-office path.
- ///
- [Obsolete($"UmbracoPath is no longer configurable, use Constants.System.DefaultUmbracoPath instead. This property is scheduled for removal in a future version.")]
- public string UmbracoPath
- {
- get => Constants.System.DefaultUmbracoPath;
- set { }
- }
-
///
/// Gets or sets a value for the Umbraco icons path.
///
diff --git a/src/Umbraco.Core/Configuration/Models/NuCacheSettings.cs b/src/Umbraco.Core/Configuration/Models/NuCacheSettings.cs
index 9b1fde9826..0095a8f165 100644
--- a/src/Umbraco.Core/Configuration/Models/NuCacheSettings.cs
+++ b/src/Umbraco.Core/Configuration/Models/NuCacheSettings.cs
@@ -19,7 +19,7 @@ public class NuCacheSettings
///
/// Gets or sets a value defining the BTree block size.
///
- [Obsolete("This property is no longer used")]
+ [Obsolete("This property is no longer used. Scheduled for removal in v16")]
public int? BTreeBlockSize { get; set; }
///
diff --git a/src/Umbraco.Core/Configuration/Models/SecuritySettings.cs b/src/Umbraco.Core/Configuration/Models/SecuritySettings.cs
index 2a57a0a74c..b5d81c1ab3 100644
--- a/src/Umbraco.Core/Configuration/Models/SecuritySettings.cs
+++ b/src/Umbraco.Core/Configuration/Models/SecuritySettings.cs
@@ -95,13 +95,6 @@ public class SecuritySettings
[DefaultValue(StaticUserDefaultLockoutTimeInMinutes)]
public int UserDefaultLockoutTimeInMinutes { get; set; } = StaticUserDefaultLockoutTimeInMinutes;
- ///
- /// Gets or sets a value indicating whether to allow editing invariant properties from a non-default language variation.
- ///
- [Obsolete("Use ContentSettings.AllowEditFromInvariant instead")]
- [DefaultValue(StaticAllowEditInvariantFromNonDefault)]
- public bool AllowEditInvariantFromNonDefault { get; set; } = StaticAllowEditInvariantFromNonDefault;
-
///
/// Gets or sets a value indicating whether to allow concurrent logins.
///
diff --git a/src/Umbraco.Core/Configuration/Models/WebRoutingSettings.cs b/src/Umbraco.Core/Configuration/Models/WebRoutingSettings.cs
index 37a39a6c92..9c96f87c31 100644
--- a/src/Umbraco.Core/Configuration/Models/WebRoutingSettings.cs
+++ b/src/Umbraco.Core/Configuration/Models/WebRoutingSettings.cs
@@ -60,10 +60,6 @@ public class WebRoutingSettings
[DefaultValue(StaticValidateAlternativeTemplates)]
public bool ValidateAlternativeTemplates { get; set; } = StaticValidateAlternativeTemplates;
- [Obsolete("Use DisableFindContentByIdentifierPath instead. This will be removed in Umbraco 15." )]
- [DefaultValue(StaticDisableFindContentByIdPath)]
- public bool DisableFindContentByIdPath { get; set; } = StaticDisableFindContentByIdPath;
-
[DefaultValue(StaticDisableFindContentByIdentifierPath)]
public bool DisableFindContentByIdentifierPath { get; set; } = StaticDisableFindContentByIdentifierPath;
///
diff --git a/src/Umbraco.Core/Configuration/ModelsBuilderConfigExtensions.cs b/src/Umbraco.Core/Configuration/ModelsBuilderConfigExtensions.cs
index 294040f414..0ade116444 100644
--- a/src/Umbraco.Core/Configuration/ModelsBuilderConfigExtensions.cs
+++ b/src/Umbraco.Core/Configuration/ModelsBuilderConfigExtensions.cs
@@ -1,6 +1,8 @@
+using Microsoft.Extensions.Hosting;
using Umbraco.Cms.Core.Configuration.Models;
using Umbraco.Cms.Core.Exceptions;
-using Umbraco.Cms.Core.Hosting;
+using Umbraco.Cms.Core.Extensions;
+using IHostingEnvironment = Umbraco.Cms.Core.Hosting.IHostingEnvironment;
namespace Umbraco.Extensions;
@@ -8,6 +10,22 @@ public static class ModelsBuilderConfigExtensions
{
private static string? _modelsDirectoryAbsolute;
+ public static string ModelsDirectoryAbsolute(
+ this ModelsBuilderSettings modelsBuilderConfig,
+ IHostEnvironment hostEnvironment)
+ {
+ if (_modelsDirectoryAbsolute is null)
+ {
+ var modelsDirectory = modelsBuilderConfig.ModelsDirectory;
+ var root = hostEnvironment.MapPathContentRoot("~/");
+
+ _modelsDirectoryAbsolute = GetModelsDirectory(root, modelsDirectory, modelsBuilderConfig.AcceptUnsafeModelsDirectory);
+ }
+
+ return _modelsDirectoryAbsolute;
+ }
+
+ [Obsolete("Use the non obsoleted equivalent instead. Scheduled for removal in v16")]
public static string ModelsDirectoryAbsolute(
this ModelsBuilderSettings modelsBuilderConfig,
IHostingEnvironment hostingEnvironment)
diff --git a/src/Umbraco.Core/Constants-Configuration.cs b/src/Umbraco.Core/Constants-Configuration.cs
index a569110f01..60b3397eeb 100644
--- a/src/Umbraco.Core/Constants-Configuration.cs
+++ b/src/Umbraco.Core/Constants-Configuration.cs
@@ -66,7 +66,6 @@ public static partial class Constants
public const string ConfigPackageManifests = ConfigPrefix + "PackageManifests";
public const string ConfigWebhook = ConfigPrefix + "Webhook";
public const string ConfigCache = ConfigPrefix + "Cache";
- public const string ConfigCacheEntry = ConfigCache + ":Entry";
public static class NamedOptions
{
@@ -80,13 +79,6 @@ public static partial class Constants
public const string MemberTypes = "MemberTypes";
}
-
- public static class CacheEntry
- {
- public const string Document = "Document";
-
- public const string Media = "Media";
- }
}
}
}
diff --git a/src/Umbraco.Core/Constants-Security.cs b/src/Umbraco.Core/Constants-Security.cs
index 2f24fa182d..df6f26ca1a 100644
--- a/src/Umbraco.Core/Constants-Security.cs
+++ b/src/Umbraco.Core/Constants-Security.cs
@@ -49,27 +49,35 @@ public static partial class Constants
///
/// The key of the admin group
///
- public static readonly Guid AdminGroupKey = new("E5E7F6C8-7F9C-4B5B-8D5D-9E1E5A4F7E4D");
+ public static readonly Guid AdminGroupKey = new(AdminGroupKeyString);
+ internal const string AdminGroupKeyString = "E5E7F6C8-7F9C-4B5B-8D5D-9E1E5A4F7E4D";
+
///
/// The key of the editor group
///
- public static readonly Guid EditorGroupKey = new("44DC260E-B4D4-4DD9-9081-EEC5598F1641");
+ public static readonly Guid EditorGroupKey = new(EditorGroupKeyString);
+ internal const string EditorGroupKeyString = "44DC260E-B4D4-4DD9-9081-EEC5598F1641";
+
///
/// The key of the sensitive data group
///
- public static readonly Guid SensitiveDataGroupKey = new("8C6AD70F-D307-4E4A-AF58-72C2E4E9439D");
+ public static readonly Guid SensitiveDataGroupKey = new(SensitiveDataGroupKeyString);
+ internal const string SensitiveDataGroupKeyString = "8C6AD70F-D307-4E4A-AF58-72C2E4E9439D";
///
/// The key of the translator group
///
- public static readonly Guid TranslatorGroupKey = new("F2012E4C-D232-4BD1-8EAE-4384032D97D8");
+ public static readonly Guid TranslatorGroupKey = new(TranslatorGroupString);
+ internal const string TranslatorGroupString = "F2012E4C-D232-4BD1-8EAE-4384032D97D8";
///
/// The key of the writer group
///
- public static readonly Guid WriterGroupKey = new("9FC2A16F-528C-46D6-A014-75BF4EC2480C");
+ public static readonly Guid WriterGroupKey = new(WriterGroupKeyString);
+ internal const string WriterGroupKeyString = "9FC2A16F-528C-46D6-A014-75BF4EC2480C";
+
public const string BackOfficeAuthenticationType = "UmbracoBackOffice";
public const string BackOfficeExternalAuthenticationType = "UmbracoExternalCookie";
diff --git a/src/Umbraco.Core/Constants-UdiEntityType.cs b/src/Umbraco.Core/Constants-UdiEntityType.cs
index 81e64b534c..9c2a25b314 100644
--- a/src/Umbraco.Core/Constants-UdiEntityType.cs
+++ b/src/Umbraco.Core/Constants-UdiEntityType.cs
@@ -17,48 +17,42 @@ public static partial class Constants
// need to keep it around in a field nor to make it readonly
public const string Unknown = "unknown";
- // guid entity types
+ // GUID entity types
public const string AnyGuid = "any-guid"; // that one is for tests
-
- public const string Element = "element";
- public const string Document = "document";
-
- public const string DocumentBlueprint = "document-blueprint";
-
- public const string Media = "media";
- public const string Member = "member";
-
- public const string DictionaryItem = "dictionary-item";
- public const string Template = "template";
-
- public const string DocumentType = "document-type";
- public const string DocumentTypeContainer = "document-type-container";
-
- public const string DocumentBlueprintContainer = "document-blueprint-container";
- public const string MediaType = "media-type";
- public const string MediaTypeContainer = "media-type-container";
public const string DataType = "data-type";
public const string DataTypeContainer = "data-type-container";
- public const string MemberType = "member-type";
+ public const string DictionaryItem = "dictionary-item";
+ public const string Document = "document";
+ public const string DocumentBlueprint = "document-blueprint";
+ public const string DocumentBlueprintContainer = "document-blueprint-container";
+ public const string DocumentType = "document-type";
+ public const string DocumentTypeContainer = "document-type-container";
+ public const string Element = "element";
+ public const string Media = "media";
+ public const string MediaType = "media-type";
+ public const string MediaTypeContainer = "media-type-container";
+ public const string Member = "member";
public const string MemberGroup = "member-group";
-
+ public const string MemberType = "member-type";
+ public const string Relation = "relation";
public const string RelationType = "relation-type";
-
+ public const string Template = "template";
+ public const string User = "user";
+ public const string UserGroup = "user-group";
public const string Webhook = "webhook";
- // forms
- public const string FormsForm = "forms-form";
- public const string FormsPreValue = "forms-prevalue";
- public const string FormsDataSource = "forms-datasource";
-
- // string entity types
+ // String entity types
public const string AnyString = "any-string"; // that one is for tests
-
public const string Language = "language";
public const string MediaFile = "media-file";
- public const string TemplateFile = "template-file";
+ public const string PartialView = "partial-view";
public const string Script = "script";
public const string Stylesheet = "stylesheet";
- public const string PartialView = "partial-view";
+ public const string TemplateFile = "template-file";
+
+ // Forms entity types
+ public const string FormsDataSource = "forms-datasource";
+ public const string FormsForm = "forms-form";
+ public const string FormsPreValue = "forms-prevalue";
}
}
diff --git a/src/Umbraco.Core/DeliveryApi/ApiPublishedContentCache.cs b/src/Umbraco.Core/DeliveryApi/ApiPublishedContentCache.cs
index 1c153b0143..5ee6f8d379 100644
--- a/src/Umbraco.Core/DeliveryApi/ApiPublishedContentCache.cs
+++ b/src/Umbraco.Core/DeliveryApi/ApiPublishedContentCache.cs
@@ -80,9 +80,18 @@ public sealed class ApiPublishedContentCache : IApiPublishedContentCache
}
}
+ var requestCulture = _requestCultureService.GetRequestedCulture();
+
+ if (requestCulture?.Trim().Length <= 0)
+ {
+ // documentUrlService does not like empty strings
+ // todo: align culture null vs empty string behaviour across the codebase
+ requestCulture = null;
+ }
+
Guid? documentKey = _documentUrlService.GetDocumentKeyByRoute(
route,
- _requestCultureService.GetRequestedCulture(),
+ requestCulture,
documentStartNodeId,
_requestPreviewService.IsPreview()
);
diff --git a/src/Umbraco.Core/DeliveryApi/IApiRichTextElementParser.cs b/src/Umbraco.Core/DeliveryApi/IApiRichTextElementParser.cs
index 50b9b5d581..4b1b1e92d3 100644
--- a/src/Umbraco.Core/DeliveryApi/IApiRichTextElementParser.cs
+++ b/src/Umbraco.Core/DeliveryApi/IApiRichTextElementParser.cs
@@ -5,9 +5,6 @@ namespace Umbraco.Cms.Core.DeliveryApi;
public interface IApiRichTextElementParser
{
- // NOTE: remember to also remove the default implementation of the method overload when this one is removed.
- [Obsolete($"Please use the overload that accepts {nameof(RichTextBlockModel)}. Will be removed in V15.")]
- IRichTextElement? Parse(string html);
- IRichTextElement? Parse(string html, RichTextBlockModel? richTextBlockModel) => null;
+ IRichTextElement? Parse(string html, RichTextBlockModel? richTextBlockModel);
}
diff --git a/src/Umbraco.Core/DependencyInjection/UmbracoBuilder.Configuration.cs b/src/Umbraco.Core/DependencyInjection/UmbracoBuilder.Configuration.cs
index 83f046dfb1..f5aad4d0fb 100644
--- a/src/Umbraco.Core/DependencyInjection/UmbracoBuilder.Configuration.cs
+++ b/src/Umbraco.Core/DependencyInjection/UmbracoBuilder.Configuration.cs
@@ -104,26 +104,6 @@ public static partial class UmbracoBuilderExtensions
builder.Services.Configure(
Constants.Configuration.NamedOptions.InstallDefaultData.MemberTypes,
builder.Config.GetSection($"{Constants.Configuration.ConfigInstallDefaultData}:{Constants.Configuration.NamedOptions.InstallDefaultData.MemberTypes}"));
- builder.Services.Configure(
- Constants.Configuration.NamedOptions.CacheEntry.Media,
- builder.Config.GetSection($"{Constants.Configuration.ConfigCacheEntry}:{Constants.Configuration.NamedOptions.CacheEntry.Media}"));
- builder.Services.Configure(
- Constants.Configuration.NamedOptions.CacheEntry.Document,
- builder.Config.GetSection($"{Constants.Configuration.ConfigCacheEntry}:{Constants.Configuration.NamedOptions.CacheEntry.Document}"));
-
- // TODO: Remove this in V12
- // This is to make the move of the AllowEditInvariantFromNonDefault setting from SecuritySettings to ContentSettings backwards compatible
- // If there is a value in security settings, but no value in content setting we'll use that value, otherwise content settings always wins.
- builder.Services.Configure(settings =>
- {
- var securitySettingsValue = builder.Config.GetSection($"{Constants.Configuration.ConfigSecurity}").GetValue(nameof(SecuritySettings.AllowEditInvariantFromNonDefault));
- var contentSettingsValue = builder.Config.GetSection($"{Constants.Configuration.ConfigContent}").GetValue(nameof(ContentSettings.AllowEditInvariantFromNonDefault));
-
- if (securitySettingsValue is not null && contentSettingsValue is null)
- {
- settings.AllowEditInvariantFromNonDefault = securitySettingsValue.Value;
- }
- });
return builder;
}
diff --git a/src/Umbraco.Core/DependencyInjection/UmbracoBuilder.cs b/src/Umbraco.Core/DependencyInjection/UmbracoBuilder.cs
index 9fb195481f..5e06ea5042 100644
--- a/src/Umbraco.Core/DependencyInjection/UmbracoBuilder.cs
+++ b/src/Umbraco.Core/DependencyInjection/UmbracoBuilder.cs
@@ -63,6 +63,7 @@ namespace Umbraco.Cms.Core.DependencyInjection
public ILoggerFactory BuilderLoggerFactory { get; }
///
+ [Obsolete("Only here to comply with obsolete implementation. Scheduled for removal in v16")]
public IHostingEnvironment? BuilderHostingEnvironment { get; }
public IProfiler Profiler { get; }
@@ -79,6 +80,7 @@ namespace Umbraco.Cms.Core.DependencyInjection
///
/// Initializes a new instance of the class.
///
+ [Obsolete("Use a non obsolete constructor instead. Scheduled for removal in v16")]
public UmbracoBuilder(
IServiceCollection services,
IConfiguration config,
@@ -99,6 +101,27 @@ namespace Umbraco.Cms.Core.DependencyInjection
AddCoreServices();
}
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ public UmbracoBuilder(
+ IServiceCollection services,
+ IConfiguration config,
+ TypeLoader typeLoader,
+ ILoggerFactory loggerFactory,
+ IProfiler profiler,
+ AppCaches appCaches)
+ {
+ Services = services;
+ Config = config;
+ BuilderLoggerFactory = loggerFactory;
+ Profiler = profiler;
+ AppCaches = appCaches;
+ TypeLoader = typeLoader;
+
+ AddCoreServices();
+ }
+
///
/// Gets a collection builder (and registers the collection).
///
diff --git a/src/Umbraco.Core/Deploy/IDataTypeConfigurationConnector.cs b/src/Umbraco.Core/Deploy/IDataTypeConfigurationConnector.cs
index 052d3df388..bfaf32196e 100644
--- a/src/Umbraco.Core/Deploy/IDataTypeConfigurationConnector.cs
+++ b/src/Umbraco.Core/Deploy/IDataTypeConfigurationConnector.cs
@@ -19,18 +19,6 @@ public interface IDataTypeConfigurationConnector
///
IEnumerable PropertyEditorAliases { get; }
- ///
- /// Gets the artifact configuration value corresponding to a data type configuration and gather dependencies.
- ///
- /// The data type.
- /// The dependencies.
- /// The context cache.
- ///
- /// The artifact configuration value.
- ///
- [Obsolete("Use ToArtifactAsync() instead. This method will be removed in a future version.")]
- string? ToArtifact(IDataType dataType, ICollection dependencies, IContextCache contextCache);
-
///
/// Gets the artifact configuration value corresponding to a data type configuration and gather dependencies.
///
@@ -41,22 +29,11 @@ public interface IDataTypeConfigurationConnector
///
/// A task that represents the asynchronous operation. The task result contains the artifact configuration value.
///
- Task ToArtifactAsync(IDataType dataType, ICollection dependencies, IContextCache contextCache, CancellationToken cancellationToken = default)
-#pragma warning disable CS0618 // Type or member is obsolete
- => Task.FromResult(ToArtifact(dataType, dependencies, contextCache)); // TODO: Remove default implementation in v15
-#pragma warning restore CS0618 // Type or member is obsolete
-
- ///
- /// Gets the data type configuration corresponding to an artifact configuration value.
- ///
- /// The data type.
- /// The artifact configuration value.
- /// The context cache.
- ///
- /// The data type configuration.
- ///
- [Obsolete("Use FromArtifactAsync() instead. This method will be removed in a future version.")]
- IDictionary FromArtifact(IDataType dataType, string? configuration, IContextCache contextCache);
+ Task ToArtifactAsync(
+ IDataType dataType,
+ ICollection dependencies,
+ IContextCache contextCache,
+ CancellationToken cancellationToken = default);
///
/// Gets the data type configuration corresponding to an artifact configuration value.
@@ -68,8 +45,9 @@ public interface IDataTypeConfigurationConnector
///
/// A task that represents the asynchronous operation. The task result contains the data type configuration.
///
- Task> FromArtifactAsync(IDataType dataType, string? configuration, IContextCache contextCache, CancellationToken cancellationToken = default)
-#pragma warning disable CS0618 // Type or member is obsolete
- => Task.FromResult(FromArtifact(dataType, configuration, contextCache)); // TODO: Remove default implementation in v15
-#pragma warning restore CS0618 // Type or member is obsolete
+ Task> FromArtifactAsync(
+ IDataType dataType,
+ string? configuration,
+ IContextCache contextCache,
+ CancellationToken cancellationToken = default);
}
diff --git a/src/Umbraco.Core/Deploy/IFileSource.cs b/src/Umbraco.Core/Deploy/IFileSource.cs
index 53db3e26e6..230140c9bf 100644
--- a/src/Umbraco.Core/Deploy/IFileSource.cs
+++ b/src/Umbraco.Core/Deploy/IFileSource.cs
@@ -6,19 +6,6 @@ namespace Umbraco.Cms.Core.Deploy;
///
public interface IFileSource
{
- ///
- /// Gets the content of a file as a stream.
- ///
- /// A file entity identifier.
- ///
- /// A stream with read access to the file content.
- ///
- ///
- /// Returns null if no content could be read.
- /// The caller should ensure that the stream is properly closed/disposed.
- ///
- [Obsolete("Use GetFileStreamAsync() instead. This method will be removed in a future version.")]
- Stream GetFileStream(StringUdi udi);
///
/// Gets the content of a file as a stream.
@@ -34,19 +21,6 @@ public interface IFileSource
///
Task GetFileStreamAsync(StringUdi udi, CancellationToken token);
- ///
- /// Gets the content of a file as a string.
- ///
- /// A file entity identifier.
- ///
- /// A string containing the file content.
- ///
- ///
- /// Returns null if no content could be read.
- ///
- [Obsolete("Use GetFileContentAsync() instead. This method will be removed in a future version.")]
- string GetFileContent(StringUdi udi);
-
///
/// Gets the content of a file as a string.
///
@@ -60,16 +34,6 @@ public interface IFileSource
///
Task GetFileContentAsync(StringUdi udi, CancellationToken token);
- ///
- /// Gets the length of a file.
- ///
- /// A file entity identifier.
- ///
- /// The length of the file, or -1 if the file does not exist.
- ///
- [Obsolete("Use GetFileLengthAsync() instead. This method will be removed in a future version.")]
- long GetFileLength(StringUdi udi);
-
///
/// Gets the length of a file.
///
@@ -80,15 +44,6 @@ public interface IFileSource
///
Task GetFileLengthAsync(StringUdi udi, CancellationToken token);
- ///
- /// Gets files and store them using a file store.
- ///
- /// The UDIs of the files to get.
- /// A flag indicating whether to continue if a file isn't found or to stop and throw a FileNotFoundException.
- /// A collection of file types which can store the files.
- [Obsolete("Use GetFilesAsync() instead. This method will be removed in a future version.")]
- void GetFiles(IEnumerable udis, bool continueOnFileNotFound, IFileTypeCollection fileTypes);
-
///
/// Gets files and store them using a file store.
///
diff --git a/src/Umbraco.Core/Deploy/IFileType.cs b/src/Umbraco.Core/Deploy/IFileType.cs
index a135481eb4..f8fa5ba92d 100644
--- a/src/Umbraco.Core/Deploy/IFileType.cs
+++ b/src/Umbraco.Core/Deploy/IFileType.cs
@@ -13,16 +13,6 @@ public interface IFileType
///
bool CanSetPhysical { get; }
- ///
- /// Gets the stream.
- ///
- /// The UDI.
- ///
- /// The stream.
- ///
- [Obsolete("Use GetStreamAsync() instead. This method will be removed in a future version.")]
- Stream GetStream(StringUdi udi);
-
///
/// Gets the stream as an asynchronous operation.
///
@@ -51,14 +41,6 @@ public interface IFileType
///
long GetLength(StringUdi udi);
- ///
- /// Sets the stream.
- ///
- /// The UDI.
- /// The stream.
- [Obsolete("Use SetStreamAsync() instead. This method will be removed in a future version.")]
- void SetStream(StringUdi udi, Stream stream);
-
///
/// Sets the stream as an asynchronous operation.
///
diff --git a/src/Umbraco.Core/Deploy/IImageSourceParser.cs b/src/Umbraco.Core/Deploy/IImageSourceParser.cs
index 3817dc6fb8..dd4124e889 100644
--- a/src/Umbraco.Core/Deploy/IImageSourceParser.cs
+++ b/src/Umbraco.Core/Deploy/IImageSourceParser.cs
@@ -5,21 +5,6 @@ namespace Umbraco.Cms.Core.Deploy;
///
public interface IImageSourceParser
{
- ///
- /// Parses an Umbraco property value and produces an artifact property value.
- ///
- /// The property value.
- /// A list of dependencies.
- /// The context cache.
- ///
- /// The parsed value.
- ///
- ///
- /// Turns src="/media/..." into src="umb://media/..." and adds the corresponding udi to the dependencies.
- ///
- [Obsolete("Use ToArtifactAsync() instead. This method will be removed in a future version.")]
- string ToArtifact(string value, ICollection dependencies, IContextCache contextCache);
-
///
/// Parses an Umbraco property value and produces an artifact property value.
///
@@ -33,24 +18,7 @@ public interface IImageSourceParser
///
/// Turns src="/media/..." into src="umb://media/..." and adds the corresponding udi to the dependencies.
///
- Task ToArtifactAsync(string value, ICollection dependencies, IContextCache contextCache, CancellationToken cancellationToken = default)
-#pragma warning disable CS0618 // Type or member is obsolete
- => Task.FromResult(ToArtifact(value, dependencies, contextCache)); // TODO: Remove default implementation in v15
-#pragma warning restore CS0618 // Type or member is obsolete
-
- ///
- /// Parses an artifact property value and produces an Umbraco property value.
- ///
- /// The artifact property value.
- /// The context cache.
- ///
- /// The parsed value.
- ///
- ///
- /// Turns umb://media/... into /media/....
- ///
- [Obsolete("Use FromArtifactAsync() instead. This method will be removed in a future version.")]
- string FromArtifact(string value, IContextCache contextCache);
+ Task ToArtifactAsync(string value, ICollection dependencies, IContextCache contextCache, CancellationToken cancellationToken = default);
///
/// Parses an artifact property value and produces an Umbraco property value.
@@ -64,8 +32,5 @@ public interface IImageSourceParser
///
/// Turns umb://media/... into /media/....
///
- Task FromArtifactAsync(string value, IContextCache contextCache, CancellationToken cancellationToken = default)
-#pragma warning disable CS0618 // Type or member is obsolete
- => Task.FromResult(FromArtifact(value, contextCache)); // TODO: Remove default implementation in v15
-#pragma warning restore CS0618 // Type or member is obsolete
+ Task FromArtifactAsync(string value, IContextCache contextCache, CancellationToken cancellationToken = default);
}
diff --git a/src/Umbraco.Core/Deploy/ILocalLinkParser.cs b/src/Umbraco.Core/Deploy/ILocalLinkParser.cs
index fcd3405a3c..357b0ecda6 100644
--- a/src/Umbraco.Core/Deploy/ILocalLinkParser.cs
+++ b/src/Umbraco.Core/Deploy/ILocalLinkParser.cs
@@ -5,21 +5,6 @@ namespace Umbraco.Cms.Core.Deploy;
///
public interface ILocalLinkParser
{
- ///
- /// Parses an Umbraco property value and produces an artifact property value.
- ///
- /// The property value.
- /// A list of dependencies.
- /// The context cache.
- ///
- /// The parsed value.
- ///
- ///
- /// Turns {{localLink:1234}} into {{localLink:umb://{type}/{id}}} and adds the corresponding udi to the dependencies.
- ///
- [Obsolete("Use ToArtifactAsync() instead. This method will be removed in a future version.")]
- string ToArtifact(string value, ICollection dependencies, IContextCache contextCache);
-
///
/// Parses an Umbraco property value and produces an artifact property value.
///
@@ -33,24 +18,7 @@ public interface ILocalLinkParser
///
/// Turns {{localLink:1234}} into {{localLink:umb://{type}/{id}}} and adds the corresponding udi to the dependencies.
///
- Task ToArtifactAsync(string value, ICollection dependencies, IContextCache contextCache, CancellationToken cancellationToken = default)
-#pragma warning disable CS0618 // Type or member is obsolete
- => Task.FromResult(ToArtifact(value, dependencies, contextCache)); // TODO: Remove default implementation in v15
-#pragma warning restore CS0618 // Type or member is obsolete
-
- ///
- /// Parses an artifact property value and produces an Umbraco property value.
- ///
- /// The artifact property value.
- /// The context cache.
- ///
- /// The parsed value.
- ///
- ///
- /// Turns {{localLink:umb://{type}/{id}}} into {{localLink:1234}}.
- ///
- [Obsolete("Use FromArtifactAsync() instead. This method will be removed in a future version.")]
- string FromArtifact(string value, IContextCache contextCache);
+ Task ToArtifactAsync(string value, ICollection dependencies, IContextCache contextCache, CancellationToken cancellationToken = default);
///
/// Parses an artifact property value and produces an Umbraco property value.
@@ -64,8 +32,5 @@ public interface ILocalLinkParser
///
/// Turns {{localLink:umb://{type}/{id}}} into {{localLink:1234}}.
///
- Task FromArtifactAsync(string value, IContextCache contextCache, CancellationToken cancellationToken = default)
-#pragma warning disable CS0618 // Type or member is obsolete
- => Task.FromResult(FromArtifact(value, contextCache)); // TODO: Remove default implementation in v15
-#pragma warning restore CS0618 // Type or member is obsolete
+ Task FromArtifactAsync(string value, IContextCache contextCache, CancellationToken cancellationToken = default);
}
diff --git a/src/Umbraco.Core/Deploy/IServiceConnector.cs b/src/Umbraco.Core/Deploy/IServiceConnector.cs
index 79666f2fa7..4f8b2bfe5d 100644
--- a/src/Umbraco.Core/Deploy/IServiceConnector.cs
+++ b/src/Umbraco.Core/Deploy/IServiceConnector.cs
@@ -8,17 +8,6 @@ namespace Umbraco.Cms.Core.Deploy;
///
public interface IServiceConnector : IDiscoverable
{
- ///
- /// Gets an artifact.
- ///
- /// The entity identifier of the artifact.
- /// The context cache.
- ///
- /// The corresponding artifact or null.
- ///
- [Obsolete("Use GetArtifactAsync() instead. This method will be removed in a future version.")]
- IArtifact? GetArtifact(Udi udi, IContextCache contextCache);
-
///
/// Gets an artifact.
///
@@ -28,21 +17,7 @@ public interface IServiceConnector : IDiscoverable
///
/// A task that represents the asynchronous operation. The task result contains the corresponding artifact or null.
///
- Task GetArtifactAsync(Udi udi, IContextCache contextCache, CancellationToken cancellationToken = default)
-#pragma warning disable CS0618 // Type or member is obsolete
- => Task.FromResult(GetArtifact(udi, contextCache)); // TODO: Remove default implementation in v15
-#pragma warning restore CS0618 // Type or member is obsolete
-
- ///
- /// Gets an artifact.
- ///
- /// The entity.
- /// The context cache.
- ///
- /// The corresponding artifact.
- ///
- [Obsolete("Use GetArtifactAsync() instead. This method will be removed in a future version.")]
- IArtifact GetArtifact(object entity, IContextCache contextCache);
+ Task GetArtifactAsync(Udi udi, IContextCache contextCache, CancellationToken cancellationToken = default);
///
/// Gets an artifact.
@@ -53,21 +28,7 @@ public interface IServiceConnector : IDiscoverable
///
/// A task that represents the asynchronous operation. The task result contains the corresponding artifact.
///
- Task GetArtifactAsync(object entity, IContextCache contextCache, CancellationToken cancellationToken = default)
-#pragma warning disable CS0618 // Type or member is obsolete
- => Task.FromResult(GetArtifact(entity, contextCache)); // TODO: Remove default implementation in v15
-#pragma warning restore CS0618 // Type or member is obsolete
-
- ///
- /// Initializes processing for an artifact.
- ///
- /// The artifact.
- /// The deploy context.
- ///
- /// The state of an artifact being deployed.
- ///
- [Obsolete("Use ProcessInitAsync() instead. This method will be removed in a future version.")]
- ArtifactDeployState ProcessInit(IArtifact art, IDeployContext context);
+ Task GetArtifactAsync(object entity, IContextCache contextCache, CancellationToken cancellationToken = default);
///
/// Initializes processing for an artifact.
@@ -78,19 +39,7 @@ public interface IServiceConnector : IDiscoverable
///
/// A task that represents the asynchronous operation. The task result contains the state of an artifact being deployed.
///
- Task ProcessInitAsync(IArtifact artifact, IDeployContext context, CancellationToken cancellationToken = default)
-#pragma warning disable CS0618 // Type or member is obsolete
- => Task.FromResult(ProcessInit(artifact, context)); // TODO: Remove default implementation in v15
-#pragma warning restore CS0618 // Type or member is obsolete
-
- ///
- /// Processes an artifact.
- ///
- /// The state of the artifact being deployed.
- /// The deploy context.
- /// The processing pass number.
- [Obsolete("Use ProcessAsync() instead. This method will be removed in a future version.")]
- void Process(ArtifactDeployState dart, IDeployContext context, int pass);
+ Task ProcessInitAsync(IArtifact artifact, IDeployContext context, CancellationToken cancellationToken = default);
///
/// Processes an artifact.
@@ -102,23 +51,7 @@ public interface IServiceConnector : IDiscoverable
///
/// A task that represents the asynchronous operation.
///
- Task ProcessAsync(ArtifactDeployState state, IDeployContext context, int pass, CancellationToken cancellationToken = default)
- {
- // TODO: Remove default implementation in v15
-#pragma warning disable CS0618 // Type or member is obsolete
- Process(state, context, pass);
-#pragma warning restore CS0618 // Type or member is obsolete
-
- return Task.CompletedTask;
- }
-
- ///
- /// Explodes/expands an UDI range into UDIs.
- ///
- /// The UDI range.
- /// The list of UDIs where to add the exploded/expanded UDIs.
- [Obsolete("Use ExpandRangeAsync() instead. This method will be removed in a future version.")]
- void Explode(UdiRange range, List udis);
+ Task ProcessAsync(ArtifactDeployState state, IDeployContext context, int pass, CancellationToken cancellationToken = default);
///
/// Expands an UDI range into UDIs.
@@ -128,30 +61,7 @@ public interface IServiceConnector : IDiscoverable
///
/// Returns an which when enumerated will asynchronously expand the UDI range into UDIs.
///
- async IAsyncEnumerable ExpandRangeAsync(UdiRange range, [EnumeratorCancellation] CancellationToken cancellationToken = default)
- {
- // TODO: Remove default implementation in v15
- var udis = new List();
-#pragma warning disable CS0618 // Type or member is obsolete
- Explode(range, udis);
-#pragma warning restore CS0618 // Type or member is obsolete
-
- foreach (Udi udi in udis)
- {
- yield return await ValueTask.FromResult(udi);
- }
- }
-
- ///
- /// Gets a named range for a specified UDI and selector.
- ///
- /// The UDI.
- /// The selector.
- ///
- /// The named range for the specified UDI and selector.
- ///
- [Obsolete("Use GetRangeAsync() instead. This method will be removed in a future version.")]
- NamedUdiRange GetRange(Udi udi, string selector);
+ IAsyncEnumerable ExpandRangeAsync(UdiRange range, CancellationToken cancellationToken = default);
///
/// Gets a named range for a specified UDI and selector.
@@ -162,31 +72,7 @@ public interface IServiceConnector : IDiscoverable
///
/// A task that represents the asynchronous operation. The task result contains the named range for the specified UDI and selector.
///
- Task GetRangeAsync(Udi udi, string selector, CancellationToken cancellationToken = default)
-#pragma warning disable CS0618 // Type or member is obsolete
- => Task.FromResult(GetRange(udi, selector)); // TODO: Remove default implementation in v15
-#pragma warning restore CS0618 // Type or member is obsolete
-
- ///
- /// Gets a named range for specified entity type, identifier and selector.
- ///
- /// The entity type.
- /// The identifier.
- /// The selector.
- ///
- /// The named range for the specified entity type, identifier and selector.
- ///
- ///
- /// This is temporary. At least we thought it would be, in sept. 2016. What day is it now?
- ///
- /// At the moment our UI has a hard time returning proper UDIs, mainly because Core's tree do
- /// not manage GUIDs but only integers... so we have to provide a way to support it. The string id here
- /// can be either a real string (for string UDIs) or an "integer as a string", using the value "-1" to
- /// indicate the "root" i.e. an open UDI.
- ///
- ///
- [Obsolete("Use GetRangeAsync() instead. This method will be removed in a future version.")]
- NamedUdiRange GetRange(string entityType, string sid, string selector);
+ Task GetRangeAsync(Udi udi, string selector, CancellationToken cancellationToken = default);
///
/// Gets a named range for specified entity type, identifier and selector.
@@ -207,10 +93,7 @@ public interface IServiceConnector : IDiscoverable
/// indicate the "root" i.e. an open UDI.
///
///
- Task GetRangeAsync(string entityType, string sid, string selector, CancellationToken cancellationToken = default)
-#pragma warning disable CS0618 // Type or member is obsolete
- => Task.FromResult(GetRange(entityType, sid, selector)); // TODO: Remove default implementation in v15
-#pragma warning restore CS0618 // Type or member is obsolete
+ Task GetRangeAsync(string entityType, string sid, string selector, CancellationToken cancellationToken = default);
///
/// Compares two artifacts.
diff --git a/src/Umbraco.Core/Deploy/IValueConnector.cs b/src/Umbraco.Core/Deploy/IValueConnector.cs
index 06d37e792e..663d3bd471 100644
--- a/src/Umbraco.Core/Deploy/IValueConnector.cs
+++ b/src/Umbraco.Core/Deploy/IValueConnector.cs
@@ -20,19 +20,6 @@ public interface IValueConnector
///
IEnumerable PropertyEditorAliases { get; }
- ///
- /// Gets the deploy property value corresponding to a content property value, and gather dependencies.
- ///
- /// The content property value.
- /// The value property type
- /// The content dependencies.
- /// The context cache.
- ///
- /// The deploy property value.
- ///
- [Obsolete("Use ToArtifactAsync() instead. This method will be removed in a future version.")]
- string? ToArtifact(object? value, IPropertyType propertyType, ICollection dependencies, IContextCache contextCache);
-
///
/// Gets the deploy property value corresponding to a content property value, and gather dependencies.
///
@@ -44,23 +31,11 @@ public interface IValueConnector
///
/// A task that represents the asynchronous operation. The task result contains the deploy property value.
///
- Task ToArtifactAsync(object? value, IPropertyType propertyType, ICollection dependencies, IContextCache contextCache, CancellationToken cancellationToken = default)
-#pragma warning disable CS0618 // Type or member is obsolete
- => Task.FromResult(ToArtifact(value, propertyType, dependencies, contextCache)); // TODO: Remove default implementation in v15
-#pragma warning restore CS0618 // Type or member is obsolete
-
- ///
- /// Gets the content property value corresponding to a deploy property value.
- ///
- /// The deploy property value.
- /// The value property type
- /// The current content property value.
- /// The context cache.
- ///
- /// The content property value.
- ///
- [Obsolete("Use FromArtifactAsync() instead. This method will be removed in a future version.")]
- object? FromArtifact(string? value, IPropertyType propertyType, object? currentValue, IContextCache contextCache);
+ Task ToArtifactAsync(object? value,
+ IPropertyType propertyType,
+ ICollection dependencies,
+ IContextCache contextCache,
+ CancellationToken cancellationToken = default);
///
/// Gets the content property value corresponding to a deploy property value.
@@ -73,8 +48,10 @@ public interface IValueConnector
///
/// A task that represents the asynchronous operation. The task result contains the content property value.
///
- Task