2020-04-01 15:50:46 +02:00
|
|
|
using Examine;
|
2020-10-27 10:53:01 +00:00
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
2020-12-24 11:46:17 +11:00
|
|
|
using Microsoft.Extensions.Logging;
|
2020-10-05 21:45:51 +02:00
|
|
|
using Microsoft.Extensions.Options;
|
2021-04-26 21:09:06 +02:00
|
|
|
using Serilog;
|
2021-02-09 10:22:42 +01:00
|
|
|
using Umbraco.Cms.Core;
|
2021-04-26 21:09:06 +02:00
|
|
|
using Umbraco.Cms.Core.Cache;
|
2021-02-09 10:22:42 +01:00
|
|
|
using Umbraco.Cms.Core.Configuration;
|
|
|
|
|
using Umbraco.Cms.Core.Configuration.Models;
|
|
|
|
|
using Umbraco.Cms.Core.DependencyInjection;
|
v10 SQLite support + distributed locking abstractions (#11922)
* Created Persistence.SQLite project skeleton.
* SQLite database initialization
* Various changes and hacks to make things work.
* WIP integration tests
* Fix thread safety tests
* Fix tests that relied on tie breaker sorting.
Spent a fair amount of time looking for a less lazy fix but gave up.
* Convert right join to left join ContentTypeRepository.PerformGetByQuery
SQLite doesn't support right join
* Fix test Can_Generate_Delete_SubQuery_Statement
Worth noting that NPoco.DatabaseTypes.SQLiteDatabaseType doesn't override
EscapeSqlIdentifier so NPoco will escape with [].
SQLite docs say > "A keyword enclosed in square brackets is an identifier.
This is not standard SQL.
This quoting mechanism is used by MS Access and SQL Server and is
included in SQLite for compatibility."
Also could have updated SqliteSyntaxProvider to match npoco but
decided against it.
* Fixes for paginated custom order by
* Fix tests broken by lack of unique indexes.
* Fix SqlServerTableByTableTest tests.
These tests didn't actually do anything as the tables already exist so schema creator just returned.
Did however point out that the default implementation for DoesTableExist just returns false so added a default naive implementation.
* Fix ValidateLoginSession - SelectTop must come later
* dry up database cleanup
* Fix up db migration tests.
We can't drop pk in sqlite without recreating table.
Test looks to be testing that add column works as intended which we can test.
* Prevent schema creation errors.
* SQLite ignore lock tests, WAL back on.
* Fix package schema tests
* Fix NPocoFetchTests - case sensitivity not under test
* Fix AdvancedMigrationTests (where possible)
Migrations probably need a good look later.
Maybe nuke old migrations and only support moving to v10 from v9.
If we do that can do some cleanup.
* Cleanup test database configuration
* Run integration tests against SQLite on build agent.
* Drop MS.Data.SQLite
System.Data.SQLite was quicker to roll out due to more CLR type mapping
* YAML
* Skip Umbraco.Tests.Integration.SqlCe
* Drop SqlServerTableByTable tests.
Until this week they did nothing anyway as they with NewSchemaPerTest
so the tests all passed as CreateTable was no op (already exists).
Also all of the tables are created in an empty database by SchemaValidationTest.cs
DatabaseSchemaCreation_Produces_DatabaseSchemaResult_With_Zero_Errors
* Might aswell run against macOS also.
* Copy azure pipelines task header layout
* Delete SQLCe projects
* Remove SQL CE specific code.
* Remove SQL CE NuSpec, template params, build script setup
* Delete umbraco-netcore-only.sln
* Add SkipTests solution configuration and use for codeql
* Remove reference to deleted nuspec file.
* Refactor ConnectionStrings WRT DataDirectory placeholder & ProviderName.
At this point you can try out SQLite support by setting the following
in appsettings.json and then completing the install process.
"ConnectionStrings": {
"umbracoDbDSN": "Data Source=|DataDirectory|/umbraco.sqlite",
"umbracoDbDSN_ProviderName": "System.Data.SQLite"
},
Not currently possible via installer UI without provider name pre-set in
configuration.
* Switch to Microsoft.Data.Sqlite
Some gross hacks but will be good to find out if this works
with apple silicon.
* Enable selection of SQLite via installer UI (also quick install)
* Remove SqlServerDbProviderFactoryCreator to cleanup a TODO
* Move SQL Server support to its own class library
* Add persistence dependencies to Umbraco.CMS metapackage
* Bugfix packages delete query
Created invalid query for SQLite.
* Try out cypress tests Linux + SQLite
* Prevent cypress test artifact upload failure on attempt 2+
* LocalDb bugfixes
* Drop redundant enum
* Move SqlClient constant
* Misc whitespace
* Remove IsSqlCe extension (TODO: drop non 9->10 migrations later).
* Umbraco.Persistence.* -> Umbraco.Cms.Persistence.*
* Display quick install defaults and per provider default database name.
* Misc remove old comment
* little re-arrange
* Remove almost all usages of IsSqlite extension.
* visual adjustments
* Custom Database Configuration is last step and should then say Install.
* use text instead of disabled inputs
* move legend, rename to Install
* Update SqlMainDomLock to work without distributed locks.
* Added IDistributedLockingMechanism interface and in memory impl.
* Drop locking from ISqlSyntaxProvider & wire up scope to abstraction.
* Added SqlServerDistributedLockingMechanism
* Move distributed locking interfaces and exceptions to Core + xmldocs.
* Fix tests, Misc cleanup, Add SQL distributed locking integration tests
* Provide mechanism to specify DistributedLockingMechanism in config
(even if added by composer)
* Nomplementation -> NoImplementation
* Fix misleading comment
* Integration tests use SqlServerDistributedLockingMechanism when possible
* Handle up-gradable locks SqlServerDistributedLockingMechanism.
TODO: InMemoryDistributedLockingMechanism.
Note: Nuked SqlServerDistributedLockingMechanismTests, will still sleep
at night.
Is covered by Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Persistence.LockTests
* Make tests pass for InMemoryDistributedLockingMechanism, pretty hacky.
* Tweak constraints on WithCollectionBuilder so i can drop bad constructor
* Added SqliteDistributedLockingMechanism
* Dropped InMemoryDistributedMechanism + magic
InMemoryDistributedMechanism was pretty rubbish and now we have
a decent implementation for SQLite as we no longer block readers
see 8d1f42b.
Also drop the CollectionBuilder setup, instead do the same as we do
for syntax providers etc, it's more automagical so we never require an
explicit selection although we are allowing for it.
However keeping the optional IUmbracoBuilder constructor param for
CollectionBuilders as it's extremely useful.
* Fix quick install "" database name.
* Hide Database Configuration section when a connection string is pre-set.
Doesn't seem worth it to extract db name from connection string.
* Ensure wal test 2+
* Fix logging inconsistencies.
* Ensure in transaction when obtaining locks + no-op the SQLite read lock.
There's no point in running the query just to make a single test pass.
* Fix installer database display names
* Allow SQLite shared cache without losing deferred transactions
* Opt into shared cache for new SQLite databases + fix filename
* Fix misc inconsistency in .gitignore
* Prefer our interceptor interface
* Restore DEBUG_DATABASES code OnConnectionOpened in case it's used.
* Back to private cache.
* Added retry strategy for SQLite + refactor out SQL server specific stuff
* Fix SQL server tests.
* Misc - Orphaned comment, incorrect casing.
* InMemory SQLite test database & turn shared cache back on everywhere.
Co-authored-by: Niels Lyngsø <niels.lyngso@gmail.com>
2022-03-11 16:14:20 +00:00
|
|
|
using Umbraco.Cms.Core.DistributedLocking;
|
2021-04-26 21:09:06 +02:00
|
|
|
using Umbraco.Cms.Core.Events;
|
2023-02-14 16:59:08 +01:00
|
|
|
using Umbraco.Cms.Core.Plugin;
|
2021-04-26 21:09:06 +02:00
|
|
|
using Umbraco.Cms.Core.Handlers;
|
2021-02-09 10:22:42 +01:00
|
|
|
using Umbraco.Cms.Core.HealthChecks.NotificationMethods;
|
|
|
|
|
using Umbraco.Cms.Core.Hosting;
|
|
|
|
|
using Umbraco.Cms.Core.Install;
|
2021-04-26 21:09:06 +02:00
|
|
|
using Umbraco.Cms.Core.Logging;
|
2021-02-12 11:38:50 +01:00
|
|
|
using Umbraco.Cms.Core.Logging.Serilog.Enrichers;
|
2021-04-26 21:09:06 +02:00
|
|
|
using Umbraco.Cms.Core.Logging.Viewer;
|
2021-02-09 10:22:42 +01:00
|
|
|
using Umbraco.Cms.Core.Mail;
|
|
|
|
|
using Umbraco.Cms.Core.Manifest;
|
|
|
|
|
using Umbraco.Cms.Core.Media;
|
2021-06-09 16:18:15 +10:00
|
|
|
using Umbraco.Cms.Core.Migrations;
|
2021-02-09 10:22:42 +01:00
|
|
|
using Umbraco.Cms.Core.Models.PublishedContent;
|
2021-06-15 15:05:57 +10:00
|
|
|
using Umbraco.Cms.Core.Notifications;
|
2021-02-15 13:44:18 +01:00
|
|
|
using Umbraco.Cms.Core.Packaging;
|
2021-02-15 10:42:35 +01:00
|
|
|
using Umbraco.Cms.Core.PropertyEditors;
|
2021-02-09 10:22:42 +01:00
|
|
|
using Umbraco.Cms.Core.PropertyEditors.ValueConverters;
|
|
|
|
|
using Umbraco.Cms.Core.PublishedCache;
|
|
|
|
|
using Umbraco.Cms.Core.Routing;
|
|
|
|
|
using Umbraco.Cms.Core.Runtime;
|
2021-02-15 11:41:12 +01:00
|
|
|
using Umbraco.Cms.Core.Scoping;
|
2021-02-09 10:22:42 +01:00
|
|
|
using Umbraco.Cms.Core.Serialization;
|
|
|
|
|
using Umbraco.Cms.Core.Services;
|
2023-01-25 11:53:42 +01:00
|
|
|
using Umbraco.Cms.Core.Services.Implement;
|
2021-02-09 10:22:42 +01:00
|
|
|
using Umbraco.Cms.Core.Strings;
|
|
|
|
|
using Umbraco.Cms.Core.Templates;
|
|
|
|
|
using Umbraco.Cms.Core.Trees;
|
|
|
|
|
using Umbraco.Cms.Core.Web;
|
v10 SQLite support + distributed locking abstractions (#11922)
* Created Persistence.SQLite project skeleton.
* SQLite database initialization
* Various changes and hacks to make things work.
* WIP integration tests
* Fix thread safety tests
* Fix tests that relied on tie breaker sorting.
Spent a fair amount of time looking for a less lazy fix but gave up.
* Convert right join to left join ContentTypeRepository.PerformGetByQuery
SQLite doesn't support right join
* Fix test Can_Generate_Delete_SubQuery_Statement
Worth noting that NPoco.DatabaseTypes.SQLiteDatabaseType doesn't override
EscapeSqlIdentifier so NPoco will escape with [].
SQLite docs say > "A keyword enclosed in square brackets is an identifier.
This is not standard SQL.
This quoting mechanism is used by MS Access and SQL Server and is
included in SQLite for compatibility."
Also could have updated SqliteSyntaxProvider to match npoco but
decided against it.
* Fixes for paginated custom order by
* Fix tests broken by lack of unique indexes.
* Fix SqlServerTableByTableTest tests.
These tests didn't actually do anything as the tables already exist so schema creator just returned.
Did however point out that the default implementation for DoesTableExist just returns false so added a default naive implementation.
* Fix ValidateLoginSession - SelectTop must come later
* dry up database cleanup
* Fix up db migration tests.
We can't drop pk in sqlite without recreating table.
Test looks to be testing that add column works as intended which we can test.
* Prevent schema creation errors.
* SQLite ignore lock tests, WAL back on.
* Fix package schema tests
* Fix NPocoFetchTests - case sensitivity not under test
* Fix AdvancedMigrationTests (where possible)
Migrations probably need a good look later.
Maybe nuke old migrations and only support moving to v10 from v9.
If we do that can do some cleanup.
* Cleanup test database configuration
* Run integration tests against SQLite on build agent.
* Drop MS.Data.SQLite
System.Data.SQLite was quicker to roll out due to more CLR type mapping
* YAML
* Skip Umbraco.Tests.Integration.SqlCe
* Drop SqlServerTableByTable tests.
Until this week they did nothing anyway as they with NewSchemaPerTest
so the tests all passed as CreateTable was no op (already exists).
Also all of the tables are created in an empty database by SchemaValidationTest.cs
DatabaseSchemaCreation_Produces_DatabaseSchemaResult_With_Zero_Errors
* Might aswell run against macOS also.
* Copy azure pipelines task header layout
* Delete SQLCe projects
* Remove SQL CE specific code.
* Remove SQL CE NuSpec, template params, build script setup
* Delete umbraco-netcore-only.sln
* Add SkipTests solution configuration and use for codeql
* Remove reference to deleted nuspec file.
* Refactor ConnectionStrings WRT DataDirectory placeholder & ProviderName.
At this point you can try out SQLite support by setting the following
in appsettings.json and then completing the install process.
"ConnectionStrings": {
"umbracoDbDSN": "Data Source=|DataDirectory|/umbraco.sqlite",
"umbracoDbDSN_ProviderName": "System.Data.SQLite"
},
Not currently possible via installer UI without provider name pre-set in
configuration.
* Switch to Microsoft.Data.Sqlite
Some gross hacks but will be good to find out if this works
with apple silicon.
* Enable selection of SQLite via installer UI (also quick install)
* Remove SqlServerDbProviderFactoryCreator to cleanup a TODO
* Move SQL Server support to its own class library
* Add persistence dependencies to Umbraco.CMS metapackage
* Bugfix packages delete query
Created invalid query for SQLite.
* Try out cypress tests Linux + SQLite
* Prevent cypress test artifact upload failure on attempt 2+
* LocalDb bugfixes
* Drop redundant enum
* Move SqlClient constant
* Misc whitespace
* Remove IsSqlCe extension (TODO: drop non 9->10 migrations later).
* Umbraco.Persistence.* -> Umbraco.Cms.Persistence.*
* Display quick install defaults and per provider default database name.
* Misc remove old comment
* little re-arrange
* Remove almost all usages of IsSqlite extension.
* visual adjustments
* Custom Database Configuration is last step and should then say Install.
* use text instead of disabled inputs
* move legend, rename to Install
* Update SqlMainDomLock to work without distributed locks.
* Added IDistributedLockingMechanism interface and in memory impl.
* Drop locking from ISqlSyntaxProvider & wire up scope to abstraction.
* Added SqlServerDistributedLockingMechanism
* Move distributed locking interfaces and exceptions to Core + xmldocs.
* Fix tests, Misc cleanup, Add SQL distributed locking integration tests
* Provide mechanism to specify DistributedLockingMechanism in config
(even if added by composer)
* Nomplementation -> NoImplementation
* Fix misleading comment
* Integration tests use SqlServerDistributedLockingMechanism when possible
* Handle up-gradable locks SqlServerDistributedLockingMechanism.
TODO: InMemoryDistributedLockingMechanism.
Note: Nuked SqlServerDistributedLockingMechanismTests, will still sleep
at night.
Is covered by Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Persistence.LockTests
* Make tests pass for InMemoryDistributedLockingMechanism, pretty hacky.
* Tweak constraints on WithCollectionBuilder so i can drop bad constructor
* Added SqliteDistributedLockingMechanism
* Dropped InMemoryDistributedMechanism + magic
InMemoryDistributedMechanism was pretty rubbish and now we have
a decent implementation for SQLite as we no longer block readers
see 8d1f42b.
Also drop the CollectionBuilder setup, instead do the same as we do
for syntax providers etc, it's more automagical so we never require an
explicit selection although we are allowing for it.
However keeping the optional IUmbracoBuilder constructor param for
CollectionBuilders as it's extremely useful.
* Fix quick install "" database name.
* Hide Database Configuration section when a connection string is pre-set.
Doesn't seem worth it to extract db name from connection string.
* Ensure wal test 2+
* Fix logging inconsistencies.
* Ensure in transaction when obtaining locks + no-op the SQLite read lock.
There's no point in running the query just to make a single test pass.
* Fix installer database display names
* Allow SQLite shared cache without losing deferred transactions
* Opt into shared cache for new SQLite databases + fix filename
* Fix misc inconsistency in .gitignore
* Prefer our interceptor interface
* Restore DEBUG_DATABASES code OnConnectionOpened in case it's used.
* Back to private cache.
* Added retry strategy for SQLite + refactor out SQL server specific stuff
* Fix SQL server tests.
* Misc - Orphaned comment, incorrect casing.
* InMemory SQLite test database & turn shared cache back on everywhere.
Co-authored-by: Niels Lyngsø <niels.lyngso@gmail.com>
2022-03-11 16:14:20 +00:00
|
|
|
using Umbraco.Cms.Infrastructure.DistributedLocking;
|
2021-02-12 10:57:50 +01:00
|
|
|
using Umbraco.Cms.Infrastructure.Examine;
|
2023-02-14 16:59:08 +01:00
|
|
|
using Umbraco.Cms.Infrastructure.Plugin;
|
2021-02-12 11:03:28 +01:00
|
|
|
using Umbraco.Cms.Infrastructure.HealthChecks;
|
|
|
|
|
using Umbraco.Cms.Infrastructure.HostedServices;
|
2021-02-12 11:11:44 +01:00
|
|
|
using Umbraco.Cms.Infrastructure.Install;
|
2021-08-19 14:15:14 +01:00
|
|
|
using Umbraco.Cms.Infrastructure.Mail;
|
2021-02-12 12:40:08 +01:00
|
|
|
using Umbraco.Cms.Infrastructure.Migrations;
|
|
|
|
|
using Umbraco.Cms.Infrastructure.Migrations.Install;
|
|
|
|
|
using Umbraco.Cms.Infrastructure.Migrations.PostMigrations;
|
2021-04-26 21:09:06 +02:00
|
|
|
using Umbraco.Cms.Infrastructure.Migrations.Upgrade.V_8_0_0.DataTypes;
|
2021-02-12 13:36:50 +01:00
|
|
|
using Umbraco.Cms.Infrastructure.Persistence;
|
2021-06-24 09:43:57 -06:00
|
|
|
using Umbraco.Cms.Infrastructure.Persistence.Mappers;
|
2021-02-15 11:04:19 +01:00
|
|
|
using Umbraco.Cms.Infrastructure.Runtime;
|
2022-07-01 08:48:05 +02:00
|
|
|
using Umbraco.Cms.Infrastructure.Runtime.RuntimeModeValidators;
|
2022-01-13 17:44:11 +00:00
|
|
|
using Umbraco.Cms.Infrastructure.Scoping;
|
2021-02-15 11:45:27 +01:00
|
|
|
using Umbraco.Cms.Infrastructure.Search;
|
2021-02-15 12:42:26 +01:00
|
|
|
using Umbraco.Cms.Infrastructure.Serialization;
|
2022-04-19 15:06:10 +02:00
|
|
|
using Umbraco.Cms.Infrastructure.Services.Implement;
|
2021-02-09 13:32:34 +01:00
|
|
|
using Umbraco.Extensions;
|
2022-06-02 08:18:31 +02:00
|
|
|
using IScopeProvider = Umbraco.Cms.Infrastructure.Scoping.IScopeProvider;
|
2019-01-03 21:00:28 +01:00
|
|
|
|
2022-06-02 08:18:31 +02:00
|
|
|
namespace Umbraco.Cms.Infrastructure.DependencyInjection;
|
|
|
|
|
|
|
|
|
|
public static partial class UmbracoBuilderExtensions
|
2019-01-03 21:00:28 +01:00
|
|
|
{
|
2022-06-02 08:18:31 +02:00
|
|
|
/// <summary>
|
2022-07-01 08:48:05 +02:00
|
|
|
/// Adds all core Umbraco services required to run which may be replaced later in the pipeline.
|
2022-06-02 08:18:31 +02:00
|
|
|
/// </summary>
|
|
|
|
|
public static IUmbracoBuilder AddCoreInitialServices(this IUmbracoBuilder builder)
|
2019-01-03 21:00:28 +01:00
|
|
|
{
|
2022-06-02 08:18:31 +02:00
|
|
|
builder
|
|
|
|
|
.AddMainDom()
|
|
|
|
|
.AddLogging();
|
2020-04-01 15:50:46 +02:00
|
|
|
|
2022-06-02 08:18:31 +02:00
|
|
|
builder.Services.AddSingleton<IDistributedLockingMechanismFactory, DefaultDistributedLockingMechanismFactory>();
|
|
|
|
|
builder.Services.AddSingleton<IUmbracoDatabaseFactory, UmbracoDatabaseFactory>();
|
|
|
|
|
builder.Services.AddSingleton(factory => factory.GetRequiredService<IUmbracoDatabaseFactory>().SqlContext);
|
|
|
|
|
builder.NPocoMappers()?.Add<NullableDateMapper>();
|
|
|
|
|
builder.PackageMigrationPlans()?.Add(() => builder.TypeLoader.GetPackageMigrationPlans());
|
2021-06-24 09:43:57 -06:00
|
|
|
|
2022-06-02 08:18:31 +02:00
|
|
|
builder.Services.AddSingleton<IRuntimeState, RuntimeState>();
|
|
|
|
|
builder.Services.AddSingleton<IRuntime, CoreRuntime>();
|
|
|
|
|
builder.Services.AddSingleton<PendingPackageMigrations>();
|
|
|
|
|
builder.AddNotificationAsyncHandler<RuntimeUnattendedInstallNotification, UnattendedInstaller>();
|
|
|
|
|
builder.AddNotificationAsyncHandler<RuntimeUnattendedUpgradeNotification, UnattendedUpgrader>();
|
2020-12-15 21:47:15 +00:00
|
|
|
|
2022-07-01 08:48:05 +02:00
|
|
|
// Add runtime mode validation
|
|
|
|
|
builder.Services.AddSingleton<IRuntimeModeValidationService, RuntimeModeValidationService>();
|
2022-07-14 16:49:49 +02:00
|
|
|
builder.RuntimeModeValidators()
|
|
|
|
|
.Add<JITOptimizerValidator>()
|
|
|
|
|
.Add<UmbracoApplicationUrlValidator>()
|
|
|
|
|
.Add<UseHttpsValidator>()
|
|
|
|
|
.Add<RuntimeMinificationValidator>()
|
|
|
|
|
.Add<ModelsBuilderModeValidator>();
|
2022-07-01 08:48:05 +02:00
|
|
|
|
2022-06-02 08:18:31 +02:00
|
|
|
// composers
|
|
|
|
|
builder
|
|
|
|
|
.AddRepositories()
|
|
|
|
|
.AddServices()
|
|
|
|
|
.AddCoreMappingProfiles()
|
|
|
|
|
.AddFileSystems()
|
|
|
|
|
.AddWebAssets();
|
2019-01-03 21:00:28 +01:00
|
|
|
|
2022-06-02 08:18:31 +02:00
|
|
|
// register persistence mappers - required by database factory so needs to be done here
|
|
|
|
|
// means the only place the collection can be modified is in a runtime - afterwards it
|
|
|
|
|
// has been frozen and it is too late
|
|
|
|
|
builder.Mappers()?.AddCoreMappers();
|
2019-01-03 21:00:28 +01:00
|
|
|
|
2022-06-02 08:18:31 +02:00
|
|
|
// register the scope provider
|
2022-06-20 09:20:47 +02:00
|
|
|
builder.Services.AddSingleton<ScopeProvider>(sp => ActivatorUtilities.CreateInstance<ScopeProvider>(sp, sp.GetRequiredService<IAmbientScopeStack>())); // implements IScopeProvider, IScopeAccessor
|
2022-06-02 08:18:31 +02:00
|
|
|
builder.Services.AddSingleton<ICoreScopeProvider>(f => f.GetRequiredService<ScopeProvider>());
|
|
|
|
|
builder.Services.AddSingleton<IScopeProvider>(f => f.GetRequiredService<ScopeProvider>());
|
|
|
|
|
builder.Services.AddSingleton<Core.Scoping.IScopeProvider>(f => f.GetRequiredService<ScopeProvider>());
|
2022-06-20 09:20:47 +02:00
|
|
|
|
2022-07-01 08:48:05 +02:00
|
|
|
builder.Services.AddSingleton<IAmbientScopeStack, AmbientScopeStack>();
|
2022-06-20 09:20:47 +02:00
|
|
|
builder.Services.AddSingleton<IScopeAccessor>(f => f.GetRequiredService<IAmbientScopeStack>());
|
2022-07-01 08:48:05 +02:00
|
|
|
builder.Services.AddSingleton<IAmbientScopeContextStack, AmbientScopeContextStack>();
|
2022-01-13 17:44:11 +00:00
|
|
|
|
2022-06-02 08:18:31 +02:00
|
|
|
builder.Services.AddScoped<IHttpScopeReference, HttpScopeReference>();
|
2019-01-03 21:00:28 +01:00
|
|
|
|
2023-02-13 19:03:58 +01:00
|
|
|
builder.Services.AddSingleton<IJsonSerializer, ContextualJsonSerializer>();
|
2022-12-21 14:29:59 +01:00
|
|
|
builder.Services.AddSingleton<IConfigurationEditorJsonSerializer, ContextualConfigurationEditorJsonSerializer>();
|
2022-06-02 08:18:31 +02:00
|
|
|
builder.Services.AddSingleton<IMenuItemCollectionFactory, MenuItemCollectionFactory>();
|
2019-11-07 21:28:56 +11:00
|
|
|
|
2022-06-02 08:18:31 +02:00
|
|
|
// register database builder
|
|
|
|
|
// *not* a singleton, don't want to keep it around
|
|
|
|
|
builder.Services.AddTransient<DatabaseBuilder>();
|
2019-01-03 21:00:28 +01:00
|
|
|
|
2022-06-02 08:18:31 +02:00
|
|
|
// register manifest parser, will be injected in collection builders where needed
|
2023-02-15 14:57:21 +01:00
|
|
|
builder.Services.AddSingleton<ILegacyManifestParser, LegacyManifestParser>();
|
2023-02-14 16:59:08 +01:00
|
|
|
builder.Services.AddSingleton<IPluginConfigurationReader, PluginConfigurationReader>();
|
|
|
|
|
builder.Services.AddSingleton<IPluginConfigurationService, PluginConfigurationService>();
|
2019-01-03 21:00:28 +01:00
|
|
|
|
2022-06-02 08:18:31 +02:00
|
|
|
// register the manifest filter collection builder (collection is empty by default)
|
|
|
|
|
builder.ManifestFilters();
|
2019-06-27 12:42:14 +02:00
|
|
|
|
2022-06-02 08:18:31 +02:00
|
|
|
builder.MediaUrlGenerators()
|
|
|
|
|
.Add<FileUploadPropertyEditor>()
|
|
|
|
|
.Add<ImageCropperPropertyEditor>();
|
2020-02-18 13:56:31 +01:00
|
|
|
|
2022-06-02 08:18:31 +02:00
|
|
|
builder.Services.AddSingleton<IPublishedContentTypeFactory, PublishedContentTypeFactory>();
|
2019-01-03 21:00:28 +01:00
|
|
|
|
2022-06-02 08:18:31 +02:00
|
|
|
builder.Services.AddSingleton<IShortStringHelper>(factory
|
|
|
|
|
=> new DefaultShortStringHelper(new DefaultShortStringHelperConfig().WithDefault(
|
|
|
|
|
factory.GetRequiredService<IOptionsMonitor<RequestHandlerSettings>>().CurrentValue)));
|
2019-01-03 21:00:28 +01:00
|
|
|
|
2022-06-02 08:18:31 +02:00
|
|
|
builder.Services.AddSingleton<IMigrationPlanExecutor, MigrationPlanExecutor>();
|
|
|
|
|
builder.Services.AddSingleton<IMigrationBuilder>(factory => new MigrationBuilder(factory));
|
2019-01-03 21:00:28 +01:00
|
|
|
|
2022-06-02 08:18:31 +02:00
|
|
|
builder.AddPreValueMigrators();
|
2021-04-26 21:09:06 +02:00
|
|
|
|
2022-06-02 08:18:31 +02:00
|
|
|
builder.Services.AddSingleton<IPublishedSnapshotRebuilder, PublishedSnapshotRebuilder>();
|
2019-11-25 21:20:00 +11:00
|
|
|
|
2022-06-02 08:18:31 +02:00
|
|
|
// register the published snapshot accessor - the "current" published snapshot is in the umbraco context
|
|
|
|
|
builder.Services.AddSingleton<IPublishedSnapshotAccessor, UmbracoContextPublishedSnapshotAccessor>();
|
2020-02-13 11:40:56 +01:00
|
|
|
|
2022-06-02 08:18:31 +02:00
|
|
|
builder.Services.AddSingleton<IVariationContextAccessor, HybridVariationContextAccessor>();
|
2020-02-18 11:38:51 +01:00
|
|
|
|
2022-06-02 08:18:31 +02:00
|
|
|
// Config manipulator
|
|
|
|
|
builder.Services.AddSingleton<IConfigManipulator, JsonConfigManipulator>();
|
2020-11-03 11:20:51 +01:00
|
|
|
|
2022-06-02 08:18:31 +02:00
|
|
|
builder.Services.AddSingleton<RichTextEditorPastedImages>();
|
|
|
|
|
builder.Services.AddSingleton<BlockEditorConverter>();
|
2020-04-01 15:50:46 +02:00
|
|
|
|
2022-06-02 08:18:31 +02:00
|
|
|
// both TinyMceValueConverter (in Core) and RteMacroRenderingValueConverter (in Web) will be
|
|
|
|
|
// discovered when CoreBootManager configures the converters. We will remove the basic one defined
|
|
|
|
|
// in core so that the more enhanced version is active.
|
|
|
|
|
builder.PropertyValueConverters()
|
|
|
|
|
.Remove<SimpleTinyMceValueConverter>();
|
2020-04-01 15:50:46 +02:00
|
|
|
|
2022-06-02 08:18:31 +02:00
|
|
|
// register *all* checks, except those marked [HideFromTypeFinder] of course
|
|
|
|
|
builder.Services.AddSingleton<IMarkdownToHtmlConverter, MarkdownToHtmlConverter>();
|
2020-12-24 16:35:59 +11:00
|
|
|
|
2022-06-02 08:18:31 +02:00
|
|
|
builder.Services.AddSingleton<IContentLastChanceFinder, ContentFinderByConfigured404>();
|
2020-04-01 15:50:46 +02:00
|
|
|
|
2022-06-02 08:18:31 +02:00
|
|
|
builder.Services.AddScoped<UmbracoTreeSearcher>();
|
2020-04-01 15:50:46 +02:00
|
|
|
|
2022-06-02 08:18:31 +02:00
|
|
|
// replace
|
|
|
|
|
builder.Services.AddSingleton<IEmailSender, EmailSender>(
|
|
|
|
|
services => new EmailSender(
|
|
|
|
|
services.GetRequiredService<ILogger<EmailSender>>(),
|
|
|
|
|
services.GetRequiredService<IOptionsMonitor<GlobalSettings>>(),
|
|
|
|
|
services.GetRequiredService<IEventAggregator>(),
|
|
|
|
|
services.GetService<INotificationHandler<SendEmailNotification>>(),
|
|
|
|
|
services.GetService<INotificationAsyncHandler<SendEmailNotification>>()));
|
2020-04-01 15:50:46 +02:00
|
|
|
|
2022-06-02 08:18:31 +02:00
|
|
|
builder.Services.AddSingleton<IExamineManager, ExamineManager>();
|
2020-04-01 15:50:46 +02:00
|
|
|
|
2022-06-02 08:18:31 +02:00
|
|
|
builder.Services.AddScoped<ITagQuery, TagQuery>();
|
2020-04-01 15:50:46 +02:00
|
|
|
|
2022-06-02 08:18:31 +02:00
|
|
|
builder.Services.AddSingleton<IUmbracoTreeSearcherFields, UmbracoTreeSearcherFields>();
|
|
|
|
|
builder.Services.AddSingleton<IPublishedContentQueryAccessor, PublishedContentQueryAccessor>(sp =>
|
|
|
|
|
new PublishedContentQueryAccessor(sp.GetRequiredService<IScopedServiceProvider>()));
|
|
|
|
|
builder.Services.AddScoped<IPublishedContentQuery>(factory =>
|
|
|
|
|
{
|
|
|
|
|
IUmbracoContextAccessor umbCtx = factory.GetRequiredService<IUmbracoContextAccessor>();
|
|
|
|
|
IUmbracoContext umbracoContext = umbCtx.GetRequiredUmbracoContext();
|
|
|
|
|
return new PublishedContentQuery(
|
|
|
|
|
umbracoContext.PublishedSnapshot,
|
|
|
|
|
factory.GetRequiredService<IVariationContextAccessor>(), factory.GetRequiredService<IExamineManager>());
|
|
|
|
|
});
|
2020-04-01 15:50:46 +02:00
|
|
|
|
2022-06-02 08:18:31 +02:00
|
|
|
// register accessors for cultures
|
|
|
|
|
builder.Services.AddSingleton<IDefaultCultureAccessor, DefaultCultureAccessor>();
|
2020-04-01 15:50:46 +02:00
|
|
|
|
2022-06-02 08:18:31 +02:00
|
|
|
builder.Services.AddSingleton<IFilePermissionHelper, FilePermissionHelper>();
|
2020-04-01 15:50:46 +02:00
|
|
|
|
2022-06-02 08:18:31 +02:00
|
|
|
builder.Services.AddSingleton<IUmbracoComponentRenderer, UmbracoComponentRenderer>();
|
2020-06-04 12:53:08 +02:00
|
|
|
|
2022-06-02 08:18:31 +02:00
|
|
|
builder.Services.AddSingleton<IBackOfficeExamineSearcher, NoopBackOfficeExamineSearcher>();
|
2020-09-22 21:19:41 +02:00
|
|
|
|
2022-06-02 08:18:31 +02:00
|
|
|
builder.Services.AddSingleton<UploadAutoFillProperties>();
|
2022-09-27 14:22:34 +02:00
|
|
|
builder.Services.AddSingleton<IImageDimensionExtractor, NoopImageDimensionExtractor>();
|
|
|
|
|
builder.Services.AddSingleton<IImageUrlGenerator, NoopImageUrlGenerator>();
|
2020-09-22 21:19:41 +02:00
|
|
|
|
2022-06-02 08:18:31 +02:00
|
|
|
builder.Services.AddSingleton<ICronTabParser, NCronTabParser>();
|
2020-11-19 23:53:04 +11:00
|
|
|
|
2022-06-02 08:18:31 +02:00
|
|
|
builder.Services.AddTransient<INodeCountService, NodeCountService>();
|
|
|
|
|
builder.AddInstaller();
|
2020-12-24 14:29:26 +11:00
|
|
|
|
2022-06-02 08:18:31 +02:00
|
|
|
// Services required to run background jobs (with out the handler)
|
|
|
|
|
builder.Services.AddSingleton<IBackgroundTaskQueue, BackgroundTaskQueue>();
|
2022-07-05 15:17:45 +02:00
|
|
|
|
|
|
|
|
builder.Services.AddTransient<IFireAndForgetRunner, FireAndForgetRunner>();
|
2022-06-02 08:18:31 +02:00
|
|
|
return builder;
|
|
|
|
|
}
|
2020-12-24 11:46:17 +11:00
|
|
|
|
2022-06-02 08:18:31 +02:00
|
|
|
public static IUmbracoBuilder AddLogViewer(this IUmbracoBuilder builder)
|
|
|
|
|
{
|
|
|
|
|
builder.Services.AddSingleton<ILogViewerConfig, LogViewerConfig>();
|
|
|
|
|
builder.Services.AddSingleton<ILogLevelLoader, LogLevelLoader>();
|
|
|
|
|
builder.SetLogViewer<SerilogJsonLogViewer>();
|
|
|
|
|
builder.Services.AddSingleton<ILogViewer>(factory => new SerilogJsonLogViewer(
|
|
|
|
|
factory.GetRequiredService<ILogger<SerilogJsonLogViewer>>(),
|
|
|
|
|
factory.GetRequiredService<ILogViewerConfig>(),
|
|
|
|
|
factory.GetRequiredService<ILoggingConfiguration>(),
|
|
|
|
|
factory.GetRequiredService<ILogLevelLoader>(),
|
|
|
|
|
Log.Logger));
|
2023-01-25 11:53:42 +01:00
|
|
|
builder.Services.AddSingleton<ILogViewerService, LogViewerService>();
|
2022-06-02 08:18:31 +02:00
|
|
|
|
|
|
|
|
return builder;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Adds logging requirements for Umbraco
|
|
|
|
|
/// </summary>
|
|
|
|
|
private static IUmbracoBuilder AddLogging(this IUmbracoBuilder builder)
|
|
|
|
|
{
|
|
|
|
|
builder.Services.AddSingleton<ThreadAbortExceptionEnricher>();
|
|
|
|
|
builder.Services.AddSingleton<HttpSessionIdEnricher>();
|
|
|
|
|
builder.Services.AddSingleton<HttpRequestNumberEnricher>();
|
|
|
|
|
builder.Services.AddSingleton<HttpRequestIdEnricher>();
|
|
|
|
|
return builder;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private static IUmbracoBuilder AddMainDom(this IUmbracoBuilder builder)
|
|
|
|
|
{
|
|
|
|
|
builder.Services.AddSingleton<IMainDomKeyGenerator, DefaultMainDomKeyGenerator>();
|
|
|
|
|
builder.Services.AddSingleton<IMainDomLock>(factory =>
|
2020-12-24 16:35:59 +11:00
|
|
|
{
|
2022-06-02 08:18:31 +02:00
|
|
|
IOptions<GlobalSettings> globalSettings = factory.GetRequiredService<IOptions<GlobalSettings>>();
|
|
|
|
|
IOptionsMonitor<ConnectionStrings> connectionStrings =
|
|
|
|
|
factory.GetRequiredService<IOptionsMonitor<ConnectionStrings>>();
|
|
|
|
|
IHostingEnvironment hostingEnvironment = factory.GetRequiredService<IHostingEnvironment>();
|
|
|
|
|
|
|
|
|
|
IDbProviderFactoryCreator dbCreator = factory.GetRequiredService<IDbProviderFactoryCreator>();
|
|
|
|
|
DatabaseSchemaCreatorFactory databaseSchemaCreatorFactory =
|
|
|
|
|
factory.GetRequiredService<DatabaseSchemaCreatorFactory>();
|
|
|
|
|
ILoggerFactory loggerFactory = factory.GetRequiredService<ILoggerFactory>();
|
|
|
|
|
NPocoMapperCollection npocoMappers = factory.GetRequiredService<NPocoMapperCollection>();
|
|
|
|
|
IMainDomKeyGenerator mainDomKeyGenerator = factory.GetRequiredService<IMainDomKeyGenerator>();
|
|
|
|
|
|
|
|
|
|
switch (globalSettings.Value.MainDomLock)
|
2020-12-24 11:46:17 +11:00
|
|
|
{
|
2022-06-02 08:18:31 +02:00
|
|
|
case "SqlMainDomLock":
|
|
|
|
|
return new SqlMainDomLock(
|
|
|
|
|
loggerFactory,
|
|
|
|
|
globalSettings,
|
|
|
|
|
connectionStrings,
|
|
|
|
|
dbCreator,
|
|
|
|
|
mainDomKeyGenerator,
|
|
|
|
|
databaseSchemaCreatorFactory,
|
|
|
|
|
npocoMappers);
|
|
|
|
|
|
|
|
|
|
case "MainDomSemaphoreLock":
|
|
|
|
|
return new MainDomSemaphoreLock(
|
|
|
|
|
loggerFactory.CreateLogger<MainDomSemaphoreLock>(),
|
|
|
|
|
hostingEnvironment);
|
|
|
|
|
|
|
|
|
|
case "FileSystemMainDomLock":
|
|
|
|
|
default:
|
|
|
|
|
return new FileSystemMainDomLock(
|
|
|
|
|
loggerFactory.CreateLogger<FileSystemMainDomLock>(),
|
|
|
|
|
mainDomKeyGenerator, hostingEnvironment,
|
|
|
|
|
factory.GetRequiredService<IOptionsMonitor<GlobalSettings>>());
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
return builder;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private static IUmbracoBuilder AddPreValueMigrators(this IUmbracoBuilder builder)
|
|
|
|
|
{
|
2022-11-14 12:40:06 +01:00
|
|
|
builder.WithCollectionBuilder<PreValueMigratorCollectionBuilder>();
|
2022-06-02 08:18:31 +02:00
|
|
|
|
|
|
|
|
return builder;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static IUmbracoBuilder AddCoreNotifications(this IUmbracoBuilder builder)
|
|
|
|
|
{
|
|
|
|
|
// add handlers for sending user notifications (i.e. emails)
|
|
|
|
|
builder.Services.AddSingleton<UserNotificationsHandler.Notifier>();
|
|
|
|
|
builder
|
|
|
|
|
.AddNotificationHandler<ContentSavedNotification, UserNotificationsHandler>()
|
|
|
|
|
.AddNotificationHandler<ContentSortedNotification, UserNotificationsHandler>()
|
|
|
|
|
.AddNotificationHandler<ContentPublishedNotification, UserNotificationsHandler>()
|
|
|
|
|
.AddNotificationHandler<ContentMovedNotification, UserNotificationsHandler>()
|
|
|
|
|
.AddNotificationHandler<ContentMovedToRecycleBinNotification, UserNotificationsHandler>()
|
|
|
|
|
.AddNotificationHandler<ContentCopiedNotification, UserNotificationsHandler>()
|
|
|
|
|
.AddNotificationHandler<ContentRolledBackNotification, UserNotificationsHandler>()
|
|
|
|
|
.AddNotificationHandler<ContentSentToPublishNotification, UserNotificationsHandler>()
|
|
|
|
|
.AddNotificationHandler<ContentUnpublishedNotification, UserNotificationsHandler>()
|
|
|
|
|
.AddNotificationHandler<AssignedUserGroupPermissionsNotification, UserNotificationsHandler>()
|
|
|
|
|
.AddNotificationHandler<PublicAccessEntrySavedNotification, UserNotificationsHandler>();
|
|
|
|
|
|
|
|
|
|
// add handlers for building content relations
|
|
|
|
|
builder
|
|
|
|
|
.AddNotificationHandler<ContentCopiedNotification, RelateOnCopyNotificationHandler>()
|
|
|
|
|
.AddNotificationHandler<ContentMovedNotification, RelateOnTrashNotificationHandler>()
|
|
|
|
|
.AddNotificationHandler<ContentMovedToRecycleBinNotification, RelateOnTrashNotificationHandler>()
|
|
|
|
|
.AddNotificationHandler<MediaMovedNotification, RelateOnTrashNotificationHandler>()
|
|
|
|
|
.AddNotificationHandler<MediaMovedToRecycleBinNotification, RelateOnTrashNotificationHandler>();
|
|
|
|
|
|
|
|
|
|
// add notification handlers for property editors
|
|
|
|
|
builder
|
Block Grid Editor (#12826)
* Refactor block list/grid property value editors for code reuse
* Prettify block grid editor data conveter a bit
* correct appearance and colors
* validation should only kick in if value is higher than 0 and not null
* Add copyright notice to code, a little formatting and file scoped namespaces where applicable
* custom views
* custom views for blocks
* Refactor block list min/max validation and reuse for block grid
* Prettify extraction of nested content-and-settings references for block grid
* Fix bad naming
* fix casing
* Refactor block list notification handler and reuse for block grid
* context sensitive ui for Blocks
* Refactor notification handlers for block list and block grid incl. unit tests
* Formatting and review
* Bump number of expected data editors in unit test
* initial progress on column options editor
* column span options UI
* column span UI adjustments
* context aware ui adjustments
* minor border improvement
* get and pick layout stylesheet
* remove random x
* make highlight border standout more
* dedicated context bar
* UI improvements
* remove annoying indication
* copy paste
* UI improvements
* remove div.umb-block-grid__block--view from partial
* show block ui, only hide when hovering area.
* area actions
* UI Adjustments
* Block grid editor localization (#12915)
Co-authored-by: Niels Lyngsø <niels.lyngso@gmail.com>
* fix case of empty value
* use right index
* place border on top of column indication
* heroblock
* userFlowWhenBlockWasCreated
* shorter messages
* overal improvements
* force left/right drag feature
* stylesheet picker localization
* localizations
* space
* unnesecary removal of space
* notes on masonry
* validation form parent skipping + better snapping when drag n drop
* remove icons
* make rows go as minimal as posible
* scale and drop indications
* use item width to determin forceLeft or forceRight
* clean up
* Make clipboard filtering work with block arrays
* readonly mode
* important note
* ask to revert failed paste
* dont allow for backdrop click
* changed wording
* more area actions outside grid container
* droppable indication
* implemented minimal responsive solution.
* add additional data fields about grid clumns
* improved fallback columns width + rows height
* make root element class `umb-block-grid`
* align layout with position relatives, to align visual experience.
* use clientX not screenX
* rename area classes so they dont include the word 'block'
* more renaming
* commit flexbox layout css to repo
* fixes
* fix typo
* only show a broader inline create button if the block is full width.
* simplify css
* remove headline block hover effect
* use some font, to make it look better.
* Drag and drop correctiions/limits
* clean up
* remove log
* make assumptions about proposed distance of target
* slightly white border on validation message for areas to make it standout
* drag n drop seems good at this stage
* force left and right buttons and indication
* correct if
* revert scale handler ui
* If columnSpans is empty we fall back to full width
* Access other PreValues from a PreValue Editor
* maybe temprorary turn of distance drag n' drop condition
* setDirty
* area alias was missing in razor and needed help text
* forceleft forceright translations
* forceLeft / forceRight razor
* correct translation +
remove data- on ng-click
* force placement when moving over edge
* remove unnesecary wrapper element
* show-validation
* red text, might be hard to see, lets see.
* for safety have the border-raduis correct
* better wordings
* Use mouse position to judge if the drop is good before or after.
* fit placeholder when item is begin dragged away
* initial step for finding nearest relation when drag-hovering nothing
* Much better drag n drop experience, must be tested further to prove its not breaking some cases.
* title for scale handler
* new approach + massive drag n drop clean up
* avoid complex CSS transfering of props, instead add the prop in HTML
* adjust placeAfter when in vertical direction mode
* do not scale bigger than the available space to the right
* clean css
* fix numbers
* Fix the case of flickering when hitting an empty area.
* correct placement of code
* package lock
* Adjustment for PreValue Area allowances
* comment on fit in line feature
* fixing scale and drag n drop potential issues
* clean up
* only disallow above max
* outcomment unused code
* clean up
* drag n drop above or below container
* fix for Firefox
* Do not edit block if there is no properties in content
* angularJS form for Entries, to correct validation
* parse layout columns, used to know if block is full width of the layout
* use inherited layout columns
* add this to the example html
* flexbox fix
* highlight if empty area
* comments for undefined column spans
* bring back approvedContainer lock period.
* fix
* Do not edit something without properties
* Remove Force, as thats confusing to read.
* correct localization key
* minor corrections
* Fit within context columns
* Conceptual, inline editor for Grid.
* fix casing
* consider related position in directional conditions
* set default max row span to 1
* update columnSpanOption check for sync
* move Editor to group of Rich Text
* more shift autoScroll
* assume layout columns comes as string
* fix variable name
* force left/right indication
* Inject Areas directly in slot, to enable custom view manipulations of such.
* fix sortableJS mis dropping items
* Overwrite create label
* ability to overwrite root layout create label
* Simplify PreValue editor by hidding options that is not in effect.
* Setup new areas as half width if possible
* Grouping blockTypes
* remove flexbox stylesheet
* Chose groups for area allowance
* ensure a good default width
* improve block active state
* Better contextual sizing
* Comment clean up
* Remove The StarterKit from branch
* Unique group identification for the property editor sortable
* only show avaiable block groups in picker.
* Indication of taget area
* Fallback to root grid columns
* use root layout grid columns, so dont update when layoutColumns change
* Ability to remove block group
* clean up references when removing Group or single Block
* fix drop in same group
* Block picker use contexual create label as headline
* adjust area highlight
* Prevalue editor
* structuralOptions
* Move pre values into tabs for better overview and scope
* Let area grid columns fallback to root grid columns, and let both default to "12" instead of "initial"
* remove input close tag
* Allow in areas
* Move build-in custom views
* only show property-into-button on hover when in group-panel__header
* some height for the show buttons
* filter available block type based on allowInAreas
* remove OnlySpecifiedAllowance
* unsupported block if trouble happend
* move allow at root to allowance group
* easily drop at top or below area if outside. If more than 100px outside then see if there is a parent layout to move into.
* block group validation
* shortcut for opening Areas if areas are defined
* scale label for Areas editor
* Added Legacy name on the old grid layout
* Remove files that come with the starter kit
* Sorting: takeover container detection
* Refactor models + remove unused properties
* Endpoint for creating block grid demo element types
* CTA for getting Block Grid demo blocks
* Refactor block grid sample element creation
* Fix Constants-PropertyEditors spacing
* Fixed unit tests
* Get sample configuration
* Labels for sample blocks
* Improve drag, to swap across unallowed area/root
* improved empty threshold
* hide the after inline-create-button if block is located at right side of area/layout
* clean up
* translations
* danish translations
* move outside edge for forceRight
* Update src/Umbraco.Web.Common/Extensions/BlockGridTemplateExtensions.cs
Co-authored-by: Nikolaj Geisle <70372949+Zeegaan@users.noreply.github.com>
* Review comments
* Remove leftover TODO
* big cleanup
* Hide Sample CTA when installed
* clean up
* correct styling for wrapper + moving Block UI to z-index 3 for visiblity on top of other block
* slightly adjusting inline-create-buttons to avoid collisions
* correct localization for force left/right buttons
* gitignorer update
* Clean up nesting of classes in BlockGridConfiguration
* change gitignorer to include App_Plugin folder
* move default layout stylesheet
* remove specific App_plugin folder
* package-lock
* update sample custom views paths
* add custom views for sample
* Adding sample custom views
* Move sample partial Views and custom views
* Update views to not use ModelsBuilder
* Move sample custom views to wwwroot
* Updated Sample CTA text
* Use localize directory
* Ensure groupKey for items without such to work.
Co-authored-by: kjac <kja@umbraco.dk>
Co-authored-by: Warren Buckley <warren@umbraco.com>
Co-authored-by: Bjarke Berg <mail@bergmania.dk>
Co-authored-by: Nikolaj Geisle <70372949+Zeegaan@users.noreply.github.com>
2022-10-05 13:50:26 +02:00
|
|
|
.AddNotificationHandler<ContentSavingNotification, BlockListPropertyNotificationHandler>()
|
|
|
|
|
.AddNotificationHandler<ContentCopyingNotification, BlockListPropertyNotificationHandler>()
|
|
|
|
|
.AddNotificationHandler<ContentSavingNotification, BlockGridPropertyNotificationHandler>()
|
|
|
|
|
.AddNotificationHandler<ContentCopyingNotification, BlockGridPropertyNotificationHandler>()
|
2022-06-02 08:18:31 +02:00
|
|
|
.AddNotificationHandler<ContentSavingNotification, NestedContentPropertyHandler>()
|
|
|
|
|
.AddNotificationHandler<ContentCopyingNotification, NestedContentPropertyHandler>()
|
|
|
|
|
.AddNotificationHandler<ContentCopiedNotification, FileUploadPropertyEditor>()
|
|
|
|
|
.AddNotificationHandler<ContentDeletedNotification, FileUploadPropertyEditor>()
|
|
|
|
|
.AddNotificationHandler<MediaDeletedNotification, FileUploadPropertyEditor>()
|
|
|
|
|
.AddNotificationHandler<MediaSavingNotification, FileUploadPropertyEditor>()
|
|
|
|
|
.AddNotificationHandler<MemberDeletedNotification, FileUploadPropertyEditor>()
|
|
|
|
|
.AddNotificationHandler<ContentCopiedNotification, ImageCropperPropertyEditor>()
|
|
|
|
|
.AddNotificationHandler<ContentDeletedNotification, ImageCropperPropertyEditor>()
|
|
|
|
|
.AddNotificationHandler<MediaDeletedNotification, ImageCropperPropertyEditor>()
|
|
|
|
|
.AddNotificationHandler<MediaSavingNotification, ImageCropperPropertyEditor>()
|
|
|
|
|
.AddNotificationHandler<MemberDeletedNotification, ImageCropperPropertyEditor>();
|
|
|
|
|
|
|
|
|
|
// add notification handlers for redirect tracking
|
|
|
|
|
builder
|
|
|
|
|
.AddNotificationHandler<ContentPublishingNotification, RedirectTrackingHandler>()
|
|
|
|
|
.AddNotificationHandler<ContentPublishedNotification, RedirectTrackingHandler>()
|
|
|
|
|
.AddNotificationHandler<ContentMovingNotification, RedirectTrackingHandler>()
|
|
|
|
|
.AddNotificationHandler<ContentMovedNotification, RedirectTrackingHandler>();
|
|
|
|
|
|
|
|
|
|
// Add notification handlers for DistributedCache
|
|
|
|
|
builder
|
|
|
|
|
.AddNotificationHandler<DictionaryItemDeletedNotification, DistributedCacheBinder>()
|
|
|
|
|
.AddNotificationHandler<DictionaryItemSavedNotification, DistributedCacheBinder>()
|
|
|
|
|
.AddNotificationHandler<LanguageSavedNotification, DistributedCacheBinder>()
|
|
|
|
|
.AddNotificationHandler<LanguageDeletedNotification, DistributedCacheBinder>()
|
|
|
|
|
.AddNotificationHandler<MemberSavedNotification, DistributedCacheBinder>()
|
|
|
|
|
.AddNotificationHandler<MemberDeletedNotification, DistributedCacheBinder>()
|
|
|
|
|
.AddNotificationHandler<PublicAccessEntrySavedNotification, DistributedCacheBinder>()
|
|
|
|
|
.AddNotificationHandler<PublicAccessEntryDeletedNotification, DistributedCacheBinder>()
|
|
|
|
|
.AddNotificationHandler<UserSavedNotification, DistributedCacheBinder>()
|
|
|
|
|
.AddNotificationHandler<UserDeletedNotification, DistributedCacheBinder>()
|
|
|
|
|
.AddNotificationHandler<UserGroupWithUsersSavedNotification, DistributedCacheBinder>()
|
|
|
|
|
.AddNotificationHandler<UserGroupDeletedNotification, DistributedCacheBinder>()
|
|
|
|
|
.AddNotificationHandler<MemberGroupDeletedNotification, DistributedCacheBinder>()
|
|
|
|
|
.AddNotificationHandler<MemberGroupSavedNotification, DistributedCacheBinder>()
|
|
|
|
|
.AddNotificationHandler<DataTypeDeletedNotification, DistributedCacheBinder>()
|
|
|
|
|
.AddNotificationHandler<DataTypeSavedNotification, DistributedCacheBinder>()
|
|
|
|
|
.AddNotificationHandler<TemplateDeletedNotification, DistributedCacheBinder>()
|
|
|
|
|
.AddNotificationHandler<TemplateSavedNotification, DistributedCacheBinder>()
|
|
|
|
|
.AddNotificationHandler<RelationTypeDeletedNotification, DistributedCacheBinder>()
|
|
|
|
|
.AddNotificationHandler<RelationTypeSavedNotification, DistributedCacheBinder>()
|
|
|
|
|
.AddNotificationHandler<DomainDeletedNotification, DistributedCacheBinder>()
|
|
|
|
|
.AddNotificationHandler<DomainSavedNotification, DistributedCacheBinder>()
|
|
|
|
|
.AddNotificationHandler<MacroSavedNotification, DistributedCacheBinder>()
|
|
|
|
|
.AddNotificationHandler<MacroDeletedNotification, DistributedCacheBinder>()
|
|
|
|
|
.AddNotificationHandler<MediaTreeChangeNotification, DistributedCacheBinder>()
|
|
|
|
|
.AddNotificationHandler<ContentTypeChangedNotification, DistributedCacheBinder>()
|
|
|
|
|
.AddNotificationHandler<MediaTypeChangedNotification, DistributedCacheBinder>()
|
|
|
|
|
.AddNotificationHandler<MemberTypeChangedNotification, DistributedCacheBinder>()
|
|
|
|
|
.AddNotificationHandler<ContentTreeChangeNotification, DistributedCacheBinder>()
|
|
|
|
|
;
|
|
|
|
|
|
|
|
|
|
// add notification handlers for auditing
|
|
|
|
|
builder
|
|
|
|
|
.AddNotificationHandler<MemberSavedNotification, AuditNotificationsHandler>()
|
|
|
|
|
.AddNotificationHandler<MemberDeletedNotification, AuditNotificationsHandler>()
|
|
|
|
|
.AddNotificationHandler<AssignedMemberRolesNotification, AuditNotificationsHandler>()
|
|
|
|
|
.AddNotificationHandler<RemovedMemberRolesNotification, AuditNotificationsHandler>()
|
|
|
|
|
.AddNotificationHandler<ExportedMemberNotification, AuditNotificationsHandler>()
|
|
|
|
|
.AddNotificationHandler<UserSavedNotification, AuditNotificationsHandler>()
|
|
|
|
|
.AddNotificationHandler<UserDeletedNotification, AuditNotificationsHandler>()
|
|
|
|
|
.AddNotificationHandler<UserGroupWithUsersSavedNotification, AuditNotificationsHandler>()
|
|
|
|
|
.AddNotificationHandler<AssignedUserGroupPermissionsNotification, AuditNotificationsHandler>();
|
|
|
|
|
|
|
|
|
|
return builder;
|
2019-01-03 21:00:28 +01:00
|
|
|
}
|
|
|
|
|
}
|