# Conflicts: # src/Umbraco.Configuration/Legacy/GlobalSettings.cs # src/Umbraco.Core/Configuration/IGlobalSettings.cs # src/Umbraco.Core/Models/ContentBaseExtensions.cs # src/Umbraco.Core/Routing/ContentFinderByRedirectUrl.cs # src/Umbraco.Core/Routing/DefaultUrlProvider.cs # src/Umbraco.Core/Runtime/MainDom.cs # src/Umbraco.Core/Services/IRuntimeState.cs # src/Umbraco.Infrastructure/Compose/NotificationsComponent.cs # src/Umbraco.Infrastructure/PropertyEditors/ValueConverters/ImageCropperValueConverter.cs # src/Umbraco.Infrastructure/RuntimeState.cs # src/Umbraco.Tests/Routing/UrlsWithNestedDomains.cs # src/Umbraco.Tests/Runtimes/StandaloneTests.cs # src/Umbraco.Tests/TestHelpers/TestObjects.cs # src/Umbraco.Web.BackOffice/Controllers/LogViewerController.cs # src/Umbraco.Web.BackOffice/Controllers/UsersController.cs # src/Umbraco.Web.BackOffice/Mapping/ContentMapDefinition.cs # src/Umbraco.Web.BackOffice/PropertyEditors/RteEmbedController.cs # src/Umbraco.Web.BackOffice/Trees/DictionaryTreeController.cs # src/Umbraco.Web.UI.NetCore/umbraco/UmbracoBackOffice/Default.cshtml # src/Umbraco.Web.UI.NetCore/umbraco/config/lang/da.xml # src/Umbraco.Web.UI.NetCore/umbraco/config/lang/en.xml # src/Umbraco.Web.UI.NetCore/umbraco/config/lang/en_us.xml # src/Umbraco.Web.UI/Umbraco/config/lang/cs.xml # src/Umbraco.Web.UI/Views/Partials/Grid/Editors/Rte.cshtml # src/Umbraco.Web/Controllers/UmbLoginController.cs # src/Umbraco.Web/Install/Controllers/InstallController.cs # src/Umbraco.Web/PublishedElementExtensions.cs # src/Umbraco.Web/Runtime/WebInitialComposer.cs # src/Umbraco.Web/UmbracoHelper.cs # src/Umbraco.Web/UmbracoInjectedModule.cs # src/Umbraco.Web/UrlHelperExtensions.cs # src/Umbraco.Web/UrlHelperRenderExtensions.cs # src/Umbraco.Web/WebApi/UmbracoApiControllerBase.cs
78 lines
2.6 KiB
C#
78 lines
2.6 KiB
C#
using System.Web.Mvc;
|
|
using System.Web.Services;
|
|
using Microsoft.Extensions.Logging;
|
|
using Umbraco.Core.Configuration.Models;
|
|
using Umbraco.Core.Logging;
|
|
using Umbraco.Core.Security;
|
|
using Umbraco.Core.Services;
|
|
using Umbraco.Web.Composing;
|
|
|
|
namespace Umbraco.Web
|
|
{
|
|
/// <summary>
|
|
/// An abstract web service class exposing common umbraco objects
|
|
/// </summary>
|
|
public abstract class UmbracoWebService : WebService
|
|
{
|
|
private UrlHelper _url;
|
|
|
|
protected UmbracoWebService(ILogger logger, IProfilingLogger profilingLogger, IUmbracoContextAccessor umbracoContextAccessor, IBackOfficeSecurityAccessor backOfficeSecurityAccessor, ServiceContext services, GlobalSettings globalSettings)
|
|
{
|
|
Logger = logger;
|
|
ProfilingLogger = profilingLogger;
|
|
UmbracoContextAccessor = umbracoContextAccessor;
|
|
BackOfficeSecurityAccessor = backOfficeSecurityAccessor;
|
|
Services = services;
|
|
GlobalSettings = globalSettings;
|
|
}
|
|
|
|
protected UmbracoWebService()
|
|
: this(Current.Logger, Current.ProfilingLogger, Current.UmbracoContextAccessor, Current.BackOfficeSecurityAccessor, Current.Services,new GlobalSettings())
|
|
{
|
|
}
|
|
|
|
/// <summary>
|
|
/// Gets the logger.
|
|
/// </summary>
|
|
public ILogger Logger { get; }
|
|
|
|
/// <summary>
|
|
/// Gets the ProfilingLogger.
|
|
/// </summary>
|
|
public IProfilingLogger ProfilingLogger { get; }
|
|
|
|
/// <summary>
|
|
/// Gets the Umbraco context.
|
|
/// </summary>
|
|
public IUmbracoContext UmbracoContext => UmbracoContextAccessor.UmbracoContext;
|
|
|
|
/// <summary>
|
|
/// Gets the Umbraco context accessor.
|
|
/// </summary>
|
|
public IUmbracoContextAccessor UmbracoContextAccessor { get; }
|
|
|
|
public IBackOfficeSecurityAccessor BackOfficeSecurityAccessor { get; }
|
|
|
|
/// <summary>
|
|
/// Gets the services context.
|
|
/// </summary>
|
|
public ServiceContext Services { get; }
|
|
|
|
/// <summary>
|
|
/// Gets the global settings.
|
|
/// </summary>
|
|
public GlobalSettings GlobalSettings { get; }
|
|
|
|
/// <summary>
|
|
/// Gets the web security helper.
|
|
/// </summary>
|
|
public IBackOfficeSecurity Security => BackOfficeSecurityAccessor.BackOfficeSecurity;
|
|
|
|
/// <summary>
|
|
/// Gets the URL helper.
|
|
/// </summary>
|
|
/// <remarks>This URL helper is created without any route data and an empty request context.</remarks>
|
|
public UrlHelper Url => _url ?? (_url = new UrlHelper(Context.Request.RequestContext));
|
|
}
|
|
}
|