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-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;
|
Content Delivery API (#14051)
* Add the core parts of the headless PoC
* Add Content API project (WIP - loads of TODOs and dupes that need to be fixed!)
* Rename the content API project and namespaces
* Fixed bad merge
* Rename everything "Headless" to "ContentApi" or "Api"
* Refactor Content + Media: Key => Id, Name not nullable
* Make Content API property return value types independent of datatype configuration
* Clean up refactorings
* First stab at an expansion strategy using content picker as example implementation
* Use named JSON options for content API serialization
* Proper inclusion and registration of the content API
* Introduce API media builder
* Make MNTP return API content/media depending on configuration (instead of links) and support output expansion
* Content API: Get by controllers (#13740)
* Adding ContentApiControllerBase
* Adding get by id and url controllers
* Change route of get all test controller
* Rename to ContentApiController
* Refactoring
* Removing test controller
* Content API: Add start-node header value to deal with url collisions (#13746)
* Use start-node header value to deal with url collisions
* Cleanup
* Rename "url" param to "path"
* Adding a start node service to get the start-node header value
* Trim '/' from both beginning and end
* Content API: Support Accept-Language header (#13831)
* Move the content API JSON type resolver to an appropriate namespace
* Add localization based on Accept-Language header
* Content API: Output expansion (#13848)
* Implement request based output expansion strategy + expansion output cache at property level
* Slighty leaner implementation for default output expansion strategy
* Clarify the code a bit
* Fix bad merge
* Encapsulate content API dependencies in the DI
* Support multi-site and multi-culture routing + a little rename/refactor (#13882)
* Support multi-site and multi-culture routing + a little rename/refactor
* Make the by route controller handle root nodes
* Rename Url to Path in API content output
* Add a few comments for magic route creation
* Rename services from "Default" to "Noop"
* Ensure that Umbraco can boot without adding "AddContentApi()" to ConfigureServices
* Moved incorrectly placed media builder
* Fix API routes (#13915)
* Fix multi URL picker value converter trying to access disposed objects in edge cases
* Delivery API: Content routing and structure (#13984)
* Introduce content route instead of content path, rename and rework start item (previously start node) handling
* Strip out start node path in generated route path
* Make the start-item header take precedence over the request domain
* Conditionally enabling the delivery API + add protection and preview support + refactor all services to be singletons + ensure no-op implementations for all required services (#13992)
* Include umbraco properties (width, height, ...) in the Media Properties collection (#14023)
* Move umbraco properties (width, height, ...) to the Properties collection of the API Media model
* Don't output the umbracoFile property of media items
* Add content type deny list (#14025)
* Create a deny list of content types and utilize it for output generation
* Add unit tests
* Dedicated property cache level for Content API (#14027)
* Support redirect tracking (#14033)
* Create a deny list of content types and utilize it for output generation
* Add unit tests
* Handle redirect tracking in the content API
* Include start item routing info for redirects
* Add cultures and their routes to the API output (#14038)
* Create a deny list of content types and utilize it for output generation
* Add unit tests
* Handle redirect tracking in the content API
* Include start item routing info for redirects
* Add culture routes to root output (for HREFLANG support)
* Rename redirect service method to better match its purpose
* Review changes
* Delivery API: Query controller (#14041)
* Initial commit
* Custom ContentAPIFieldDefinitionCollection
* Make index IUmbracoContentIndex
* Add querying for children by parent id (key)
* Add missing interface
* Adding querying endpoint
* Test code
* Compose unpublishedValueSet, so that you get the correct data in the ContentAPI index
* Renaming
* Fix ancestorKeys index values
* Adding IApiQueryExtensionService to be able to query the ContentAPI index in a generic way
* Fix IApiQueryService and clean up QueryContentApiController using it
* Support querying for path
* Fix content API indexing
* Fix default sorting
* Implement concrete QueryOption implementations
* Introduce new ExecuteQuery that uses the Core OptionHandlers
* Implement ExecuteQuery
* Change ExecuteQuery signature and implementation
* Implement demo sorting and fetching
* Add query option handlers and collection builder for them
* Cleanup
* Revert "Conditionally enabling the delivery API + add protection and preview support + refactor all services to be singletons + ensure no-op implementations for all required services (#13992)"
This reverts commit 78e1f748e55383baecd123d06457111e18f13365.
* Revert "Delivery API: Content routing and structure (#13984)"
This reverts commit a0292ae5350362dd6c1c5bc9763deda928c78a75.
* Revert "Fix multi URL picker value converter trying to access disposed objects in edge cases"
This reverts commit 6b7c37a5bf7871bee93a2b2640bbc6ef591f14db.
* Revert "Conditionally enabling the delivery API + add protection and preview support + refactor all services to be singletons + ensure no-op implementations for all required services (#13992)"
This reverts commit 78e1f748e55383baecd123d06457111e18f13365.
* Revert "Delivery API: Content routing and structure (#13984)"
This reverts commit a0292ae5350362dd6c1c5bc9763deda928c78a75.
* Revert "Fix multi URL picker value converter trying to access disposed objects in edge cases"
This reverts commit 6b7c37a5bf7871bee93a2b2640bbc6ef591f14db.
* Fix multi URL picker value converter trying to access disposed objects in edge cases
* Delivery API: Content routing and structure (#13984)
* Introduce content route instead of content path, rename and rework start item (previously start node) handling
* Strip out start node path in generated route path
* Make the start-item header take precedence over the request domain
* Conditionally enabling the delivery API + add protection and preview support + refactor all services to be singletons + ensure no-op implementations for all required services (#13992)
* Test commit
* Refactored interfaces for the query handlers and for the selectors (that will handle the value of the fetch query option)
* Implemented a base class for the query options
* Refactored the names of the selectors and made use of the base class
* Refactored the ApiQueryService
* Refactored the QueryContentApiController.cs
* Conditionally enabling the delivery API + add protection and preview support + refactor all services to be singletons + ensure no-op implementations for all required services (#13992)
* Fixing merge gone wrong
* Fix multi URL picker value converter trying to access disposed objects in edge cases
* Delivery API: Content routing and structure (#13984)
* Introduce content route instead of content path, rename and rework start item (previously start node) handling
* Strip out start node path in generated route path
* Make the start-item header take precedence over the request domain
* Conditionally enabling the delivery API + add protection and preview support + refactor all services to be singletons + ensure no-op implementations for all required services (#13992)
* Make fetching work with the new setup
* Moving files to dedicated folders
* Removing ? for array
* Rename selector query method
* Implement FilterHandler and some filters
* Implement SortHandler and sort some sorts
* Refactoring
* Adding more fields to index due to querying
* Appending filtering and sorting queries
* Implementing a new ISelectorHandler without Examine types
* Re-implementing the collection to have a dedicated one for the selectors
* Implementing a new IFilterHandler without Examine types & refactoring the filters implementing it
* Adding a new collection dedicated to filters
* Renaming the old collection
* Implementing a new ISortHandler without Examine types & refactoring the sorts implementing it
* Adding a new collection for the sorts & adding all collections to UmbracoBuilder.Collections
* Refactoring the service to use the new collections and types
* Refactoring the fields in ContentApiFieldDefinitionCollection
* Remove nullability in Handlers
* Don't return null for selector
* Add TODO for having the filters support negation
* Changing the SortType to FieldType with our custom types on the SortOption
* Fix AncestorsSelector
* Fix ApiQueryService
* Documentation
* Fix Swagger docs
* Refactor the QueryContentApiController
* Adding handling for the IApiContentResponse in the JsonTypeResolver
* Refactor the service to use a safe fallback value in Examine queries
* Adding Noop for the IApiQueryService
* Cleanup
* Remove comment
* Fix name field for indexing
* Don't inherit QueryOptionBase in filters
* Fix casing for API index constant + swap FIXME with TODO
* Add TODO for handling missing fetch with start-item header
* Rename query handler parameters to not leak source (i.e. query string)
---------
Co-authored-by: kjac <kja@umbraco.dk>
Co-authored-by: Elitsa <>
Co-authored-by: Zeegaan <nge@umbraco.dk>
* Delivery API: Adding pagination to query endpoint (#14083)
* Adding pagination to query endpoint
* Optimize the paging using Examine directly
* Fix comment
* Remove skip/take code duplication
---------
Co-authored-by: kjac <kja@umbraco.dk>
* Add missing CompatibilitySuppressions.xml
* Make Delivery API packable
* Make Api.Common packable
* Renamed extension method and namespace so it is discoverable
* Untangle ApiVersion configuration into api.common, so delivery api do not require the management api to boot.
* configure options in management api
* RTE output as JSON for Content API (#14067)
* Conditionally serve RTE output as JSON instead of HTML
* Fixed merge
* Rename to Delivery API (#14119)
* Rename ContentApi to DeliveryApi
* Rename delivery API index implementation
* Update comments from "Content API" to "Delivery API"
* Rename project from Content to Delivery
* Add dedicated controller base for content delivery API
* Rename delivery API content index to include "content" specifically
* Fix compat suppressions
---------
Co-authored-by: kjac <kja@umbraco.dk>
Co-authored-by: Elitsa Marinovska <21998037+elit0451@users.noreply.github.com>
Co-authored-by: Zeegaan <nge@umbraco.dk>
2023-04-19 11:21:31 +02:00
|
|
|
using Umbraco.Cms.Core.DeliveryApi;
|
|
|
|
|
using Umbraco.Cms.Core.DeliveryApi.Accessors;
|
2021-02-09 10:22:42 +01:00
|
|
|
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;
|
|
|
|
|
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-02-12 11:38:50 +01:00
|
|
|
using Umbraco.Cms.Core.Logging.Serilog.Enrichers;
|
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;
|
2024-01-16 07:47:43 +01:00
|
|
|
using Umbraco.Cms.Core.Models.Context;
|
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;
|
2023-03-29 08:14:47 +02:00
|
|
|
using Umbraco.Cms.Core.Security;
|
2021-02-09 10:22:42 +01:00
|
|
|
using Umbraco.Cms.Core.Serialization;
|
|
|
|
|
using Umbraco.Cms.Core.Services;
|
|
|
|
|
using Umbraco.Cms.Core.Strings;
|
|
|
|
|
using Umbraco.Cms.Core.Templates;
|
|
|
|
|
using Umbraco.Cms.Core.Web;
|
2024-01-24 11:07:18 +01:00
|
|
|
using Umbraco.Cms.Infrastructure.Configuration;
|
Content Delivery API (#14051)
* Add the core parts of the headless PoC
* Add Content API project (WIP - loads of TODOs and dupes that need to be fixed!)
* Rename the content API project and namespaces
* Fixed bad merge
* Rename everything "Headless" to "ContentApi" or "Api"
* Refactor Content + Media: Key => Id, Name not nullable
* Make Content API property return value types independent of datatype configuration
* Clean up refactorings
* First stab at an expansion strategy using content picker as example implementation
* Use named JSON options for content API serialization
* Proper inclusion and registration of the content API
* Introduce API media builder
* Make MNTP return API content/media depending on configuration (instead of links) and support output expansion
* Content API: Get by controllers (#13740)
* Adding ContentApiControllerBase
* Adding get by id and url controllers
* Change route of get all test controller
* Rename to ContentApiController
* Refactoring
* Removing test controller
* Content API: Add start-node header value to deal with url collisions (#13746)
* Use start-node header value to deal with url collisions
* Cleanup
* Rename "url" param to "path"
* Adding a start node service to get the start-node header value
* Trim '/' from both beginning and end
* Content API: Support Accept-Language header (#13831)
* Move the content API JSON type resolver to an appropriate namespace
* Add localization based on Accept-Language header
* Content API: Output expansion (#13848)
* Implement request based output expansion strategy + expansion output cache at property level
* Slighty leaner implementation for default output expansion strategy
* Clarify the code a bit
* Fix bad merge
* Encapsulate content API dependencies in the DI
* Support multi-site and multi-culture routing + a little rename/refactor (#13882)
* Support multi-site and multi-culture routing + a little rename/refactor
* Make the by route controller handle root nodes
* Rename Url to Path in API content output
* Add a few comments for magic route creation
* Rename services from "Default" to "Noop"
* Ensure that Umbraco can boot without adding "AddContentApi()" to ConfigureServices
* Moved incorrectly placed media builder
* Fix API routes (#13915)
* Fix multi URL picker value converter trying to access disposed objects in edge cases
* Delivery API: Content routing and structure (#13984)
* Introduce content route instead of content path, rename and rework start item (previously start node) handling
* Strip out start node path in generated route path
* Make the start-item header take precedence over the request domain
* Conditionally enabling the delivery API + add protection and preview support + refactor all services to be singletons + ensure no-op implementations for all required services (#13992)
* Include umbraco properties (width, height, ...) in the Media Properties collection (#14023)
* Move umbraco properties (width, height, ...) to the Properties collection of the API Media model
* Don't output the umbracoFile property of media items
* Add content type deny list (#14025)
* Create a deny list of content types and utilize it for output generation
* Add unit tests
* Dedicated property cache level for Content API (#14027)
* Support redirect tracking (#14033)
* Create a deny list of content types and utilize it for output generation
* Add unit tests
* Handle redirect tracking in the content API
* Include start item routing info for redirects
* Add cultures and their routes to the API output (#14038)
* Create a deny list of content types and utilize it for output generation
* Add unit tests
* Handle redirect tracking in the content API
* Include start item routing info for redirects
* Add culture routes to root output (for HREFLANG support)
* Rename redirect service method to better match its purpose
* Review changes
* Delivery API: Query controller (#14041)
* Initial commit
* Custom ContentAPIFieldDefinitionCollection
* Make index IUmbracoContentIndex
* Add querying for children by parent id (key)
* Add missing interface
* Adding querying endpoint
* Test code
* Compose unpublishedValueSet, so that you get the correct data in the ContentAPI index
* Renaming
* Fix ancestorKeys index values
* Adding IApiQueryExtensionService to be able to query the ContentAPI index in a generic way
* Fix IApiQueryService and clean up QueryContentApiController using it
* Support querying for path
* Fix content API indexing
* Fix default sorting
* Implement concrete QueryOption implementations
* Introduce new ExecuteQuery that uses the Core OptionHandlers
* Implement ExecuteQuery
* Change ExecuteQuery signature and implementation
* Implement demo sorting and fetching
* Add query option handlers and collection builder for them
* Cleanup
* Revert "Conditionally enabling the delivery API + add protection and preview support + refactor all services to be singletons + ensure no-op implementations for all required services (#13992)"
This reverts commit 78e1f748e55383baecd123d06457111e18f13365.
* Revert "Delivery API: Content routing and structure (#13984)"
This reverts commit a0292ae5350362dd6c1c5bc9763deda928c78a75.
* Revert "Fix multi URL picker value converter trying to access disposed objects in edge cases"
This reverts commit 6b7c37a5bf7871bee93a2b2640bbc6ef591f14db.
* Revert "Conditionally enabling the delivery API + add protection and preview support + refactor all services to be singletons + ensure no-op implementations for all required services (#13992)"
This reverts commit 78e1f748e55383baecd123d06457111e18f13365.
* Revert "Delivery API: Content routing and structure (#13984)"
This reverts commit a0292ae5350362dd6c1c5bc9763deda928c78a75.
* Revert "Fix multi URL picker value converter trying to access disposed objects in edge cases"
This reverts commit 6b7c37a5bf7871bee93a2b2640bbc6ef591f14db.
* Fix multi URL picker value converter trying to access disposed objects in edge cases
* Delivery API: Content routing and structure (#13984)
* Introduce content route instead of content path, rename and rework start item (previously start node) handling
* Strip out start node path in generated route path
* Make the start-item header take precedence over the request domain
* Conditionally enabling the delivery API + add protection and preview support + refactor all services to be singletons + ensure no-op implementations for all required services (#13992)
* Test commit
* Refactored interfaces for the query handlers and for the selectors (that will handle the value of the fetch query option)
* Implemented a base class for the query options
* Refactored the names of the selectors and made use of the base class
* Refactored the ApiQueryService
* Refactored the QueryContentApiController.cs
* Conditionally enabling the delivery API + add protection and preview support + refactor all services to be singletons + ensure no-op implementations for all required services (#13992)
* Fixing merge gone wrong
* Fix multi URL picker value converter trying to access disposed objects in edge cases
* Delivery API: Content routing and structure (#13984)
* Introduce content route instead of content path, rename and rework start item (previously start node) handling
* Strip out start node path in generated route path
* Make the start-item header take precedence over the request domain
* Conditionally enabling the delivery API + add protection and preview support + refactor all services to be singletons + ensure no-op implementations for all required services (#13992)
* Make fetching work with the new setup
* Moving files to dedicated folders
* Removing ? for array
* Rename selector query method
* Implement FilterHandler and some filters
* Implement SortHandler and sort some sorts
* Refactoring
* Adding more fields to index due to querying
* Appending filtering and sorting queries
* Implementing a new ISelectorHandler without Examine types
* Re-implementing the collection to have a dedicated one for the selectors
* Implementing a new IFilterHandler without Examine types & refactoring the filters implementing it
* Adding a new collection dedicated to filters
* Renaming the old collection
* Implementing a new ISortHandler without Examine types & refactoring the sorts implementing it
* Adding a new collection for the sorts & adding all collections to UmbracoBuilder.Collections
* Refactoring the service to use the new collections and types
* Refactoring the fields in ContentApiFieldDefinitionCollection
* Remove nullability in Handlers
* Don't return null for selector
* Add TODO for having the filters support negation
* Changing the SortType to FieldType with our custom types on the SortOption
* Fix AncestorsSelector
* Fix ApiQueryService
* Documentation
* Fix Swagger docs
* Refactor the QueryContentApiController
* Adding handling for the IApiContentResponse in the JsonTypeResolver
* Refactor the service to use a safe fallback value in Examine queries
* Adding Noop for the IApiQueryService
* Cleanup
* Remove comment
* Fix name field for indexing
* Don't inherit QueryOptionBase in filters
* Fix casing for API index constant + swap FIXME with TODO
* Add TODO for handling missing fetch with start-item header
* Rename query handler parameters to not leak source (i.e. query string)
---------
Co-authored-by: kjac <kja@umbraco.dk>
Co-authored-by: Elitsa <>
Co-authored-by: Zeegaan <nge@umbraco.dk>
* Delivery API: Adding pagination to query endpoint (#14083)
* Adding pagination to query endpoint
* Optimize the paging using Examine directly
* Fix comment
* Remove skip/take code duplication
---------
Co-authored-by: kjac <kja@umbraco.dk>
* Add missing CompatibilitySuppressions.xml
* Make Delivery API packable
* Make Api.Common packable
* Renamed extension method and namespace so it is discoverable
* Untangle ApiVersion configuration into api.common, so delivery api do not require the management api to boot.
* configure options in management api
* RTE output as JSON for Content API (#14067)
* Conditionally serve RTE output as JSON instead of HTML
* Fixed merge
* Rename to Delivery API (#14119)
* Rename ContentApi to DeliveryApi
* Rename delivery API index implementation
* Update comments from "Content API" to "Delivery API"
* Rename project from Content to Delivery
* Add dedicated controller base for content delivery API
* Rename delivery API content index to include "content" specifically
* Fix compat suppressions
---------
Co-authored-by: kjac <kja@umbraco.dk>
Co-authored-by: Elitsa Marinovska <21998037+elit0451@users.noreply.github.com>
Co-authored-by: Zeegaan <nge@umbraco.dk>
2023-04-19 11:21:31 +02:00
|
|
|
using Umbraco.Cms.Infrastructure.DeliveryApi;
|
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;
|
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;
|
2023-02-15 15:17:50 +01:00
|
|
|
using Umbraco.Cms.Infrastructure.Manifest;
|
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-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;
|
2023-10-31 12:38:44 +01:00
|
|
|
using Umbraco.Cms.Infrastructure.Routing;
|
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;
|
2023-03-29 08:14:47 +02:00
|
|
|
using Umbraco.Cms.Infrastructure.Security;
|
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);
|
2023-11-06 18:10:09 +01:00
|
|
|
builder.NPocoMappers().Add<NullableDateMapper>();
|
2023-11-06 20:15:34 +01:00
|
|
|
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>();
|
2024-04-10 12:30:30 +02:00
|
|
|
builder.AddNotificationAsyncHandler<RuntimePremigrationsUpgradeNotification, PremigrationUpgrader>();
|
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<ModelsBuilderModeValidator>();
|
2022-07-01 08:48:05 +02:00
|
|
|
|
2022-06-02 08:18:31 +02:00
|
|
|
// composers
|
|
|
|
|
builder
|
|
|
|
|
.AddRepositories()
|
|
|
|
|
.AddServices()
|
|
|
|
|
.AddCoreMappingProfiles()
|
2024-02-28 11:27:54 +00:00
|
|
|
.AddFileSystems();
|
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
|
2023-11-06 18:10:09 +01:00
|
|
|
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
|
|
|
|
2024-02-22 11:22:57 +01:00
|
|
|
builder.Services.AddSingleton<IJsonSerializer, SystemTextJsonSerializer>();
|
|
|
|
|
builder.Services.AddSingleton<IConfigurationEditorJsonSerializer, SystemTextConfigurationEditorJsonSerializer>();
|
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
|
2024-02-15 15:23:01 +01:00
|
|
|
builder.Services.AddSingleton<IPackageManifestReader, BackOfficePackageManifestReader>();
|
|
|
|
|
builder.Services.AddSingleton<IPackageManifestReader, AppPluginsPackageManifestReader>();
|
2023-02-15 15:17:50 +01:00
|
|
|
builder.Services.AddSingleton<IPackageManifestService, PackageManifestService>();
|
2019-01-03 21:00:28 +01: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.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>();
|
2024-01-16 07:47:43 +01:00
|
|
|
builder.Services.AddSingleton<IBackOfficeVariationContextAccessor, HttpContextBackOfficeVariationContextAccessor>();
|
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>();
|
2023-11-29 12:27:07 +01:00
|
|
|
builder.Services.AddSingleton<BlockListPropertyValueConstructorCache>();
|
|
|
|
|
builder.Services.AddSingleton<BlockGridPropertyValueConstructorCache>();
|
|
|
|
|
builder.Services.AddSingleton<RichTextBlockPropertyValueConstructorCache>();
|
2020-04-01 15:50:46 +02:00
|
|
|
|
2024-02-29 15:11:06 +01:00
|
|
|
// both SimpleTinyMceValueConverter (in Core) and RteBlockRenderingValueConverter (in Infrastructure) will be
|
2022-06-02 08:18:31 +02:00
|
|
|
// 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
|
|
|
// 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>>()));
|
2023-03-29 08:14:47 +02:00
|
|
|
builder.Services.AddTransient<IUserInviteSender, EmailUserInviteSender>();
|
2023-08-28 12:14:16 +02:00
|
|
|
builder.Services.AddTransient<IUserForgotPasswordSender, EmailUserForgotPasswordSender>();
|
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>();
|
2023-10-31 12:38:44 +01:00
|
|
|
|
|
|
|
|
builder.Services.AddSingleton<IRedirectTracker, RedirectTracker>();
|
|
|
|
|
|
2022-06-02 08:18:31 +02:00
|
|
|
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>();
|
2023-02-13 14:47:26 +01:00
|
|
|
|
|
|
|
|
builder.AddPropertyIndexValueFactories();
|
|
|
|
|
|
Content Delivery API (#14051)
* Add the core parts of the headless PoC
* Add Content API project (WIP - loads of TODOs and dupes that need to be fixed!)
* Rename the content API project and namespaces
* Fixed bad merge
* Rename everything "Headless" to "ContentApi" or "Api"
* Refactor Content + Media: Key => Id, Name not nullable
* Make Content API property return value types independent of datatype configuration
* Clean up refactorings
* First stab at an expansion strategy using content picker as example implementation
* Use named JSON options for content API serialization
* Proper inclusion and registration of the content API
* Introduce API media builder
* Make MNTP return API content/media depending on configuration (instead of links) and support output expansion
* Content API: Get by controllers (#13740)
* Adding ContentApiControllerBase
* Adding get by id and url controllers
* Change route of get all test controller
* Rename to ContentApiController
* Refactoring
* Removing test controller
* Content API: Add start-node header value to deal with url collisions (#13746)
* Use start-node header value to deal with url collisions
* Cleanup
* Rename "url" param to "path"
* Adding a start node service to get the start-node header value
* Trim '/' from both beginning and end
* Content API: Support Accept-Language header (#13831)
* Move the content API JSON type resolver to an appropriate namespace
* Add localization based on Accept-Language header
* Content API: Output expansion (#13848)
* Implement request based output expansion strategy + expansion output cache at property level
* Slighty leaner implementation for default output expansion strategy
* Clarify the code a bit
* Fix bad merge
* Encapsulate content API dependencies in the DI
* Support multi-site and multi-culture routing + a little rename/refactor (#13882)
* Support multi-site and multi-culture routing + a little rename/refactor
* Make the by route controller handle root nodes
* Rename Url to Path in API content output
* Add a few comments for magic route creation
* Rename services from "Default" to "Noop"
* Ensure that Umbraco can boot without adding "AddContentApi()" to ConfigureServices
* Moved incorrectly placed media builder
* Fix API routes (#13915)
* Fix multi URL picker value converter trying to access disposed objects in edge cases
* Delivery API: Content routing and structure (#13984)
* Introduce content route instead of content path, rename and rework start item (previously start node) handling
* Strip out start node path in generated route path
* Make the start-item header take precedence over the request domain
* Conditionally enabling the delivery API + add protection and preview support + refactor all services to be singletons + ensure no-op implementations for all required services (#13992)
* Include umbraco properties (width, height, ...) in the Media Properties collection (#14023)
* Move umbraco properties (width, height, ...) to the Properties collection of the API Media model
* Don't output the umbracoFile property of media items
* Add content type deny list (#14025)
* Create a deny list of content types and utilize it for output generation
* Add unit tests
* Dedicated property cache level for Content API (#14027)
* Support redirect tracking (#14033)
* Create a deny list of content types and utilize it for output generation
* Add unit tests
* Handle redirect tracking in the content API
* Include start item routing info for redirects
* Add cultures and their routes to the API output (#14038)
* Create a deny list of content types and utilize it for output generation
* Add unit tests
* Handle redirect tracking in the content API
* Include start item routing info for redirects
* Add culture routes to root output (for HREFLANG support)
* Rename redirect service method to better match its purpose
* Review changes
* Delivery API: Query controller (#14041)
* Initial commit
* Custom ContentAPIFieldDefinitionCollection
* Make index IUmbracoContentIndex
* Add querying for children by parent id (key)
* Add missing interface
* Adding querying endpoint
* Test code
* Compose unpublishedValueSet, so that you get the correct data in the ContentAPI index
* Renaming
* Fix ancestorKeys index values
* Adding IApiQueryExtensionService to be able to query the ContentAPI index in a generic way
* Fix IApiQueryService and clean up QueryContentApiController using it
* Support querying for path
* Fix content API indexing
* Fix default sorting
* Implement concrete QueryOption implementations
* Introduce new ExecuteQuery that uses the Core OptionHandlers
* Implement ExecuteQuery
* Change ExecuteQuery signature and implementation
* Implement demo sorting and fetching
* Add query option handlers and collection builder for them
* Cleanup
* Revert "Conditionally enabling the delivery API + add protection and preview support + refactor all services to be singletons + ensure no-op implementations for all required services (#13992)"
This reverts commit 78e1f748e55383baecd123d06457111e18f13365.
* Revert "Delivery API: Content routing and structure (#13984)"
This reverts commit a0292ae5350362dd6c1c5bc9763deda928c78a75.
* Revert "Fix multi URL picker value converter trying to access disposed objects in edge cases"
This reverts commit 6b7c37a5bf7871bee93a2b2640bbc6ef591f14db.
* Revert "Conditionally enabling the delivery API + add protection and preview support + refactor all services to be singletons + ensure no-op implementations for all required services (#13992)"
This reverts commit 78e1f748e55383baecd123d06457111e18f13365.
* Revert "Delivery API: Content routing and structure (#13984)"
This reverts commit a0292ae5350362dd6c1c5bc9763deda928c78a75.
* Revert "Fix multi URL picker value converter trying to access disposed objects in edge cases"
This reverts commit 6b7c37a5bf7871bee93a2b2640bbc6ef591f14db.
* Fix multi URL picker value converter trying to access disposed objects in edge cases
* Delivery API: Content routing and structure (#13984)
* Introduce content route instead of content path, rename and rework start item (previously start node) handling
* Strip out start node path in generated route path
* Make the start-item header take precedence over the request domain
* Conditionally enabling the delivery API + add protection and preview support + refactor all services to be singletons + ensure no-op implementations for all required services (#13992)
* Test commit
* Refactored interfaces for the query handlers and for the selectors (that will handle the value of the fetch query option)
* Implemented a base class for the query options
* Refactored the names of the selectors and made use of the base class
* Refactored the ApiQueryService
* Refactored the QueryContentApiController.cs
* Conditionally enabling the delivery API + add protection and preview support + refactor all services to be singletons + ensure no-op implementations for all required services (#13992)
* Fixing merge gone wrong
* Fix multi URL picker value converter trying to access disposed objects in edge cases
* Delivery API: Content routing and structure (#13984)
* Introduce content route instead of content path, rename and rework start item (previously start node) handling
* Strip out start node path in generated route path
* Make the start-item header take precedence over the request domain
* Conditionally enabling the delivery API + add protection and preview support + refactor all services to be singletons + ensure no-op implementations for all required services (#13992)
* Make fetching work with the new setup
* Moving files to dedicated folders
* Removing ? for array
* Rename selector query method
* Implement FilterHandler and some filters
* Implement SortHandler and sort some sorts
* Refactoring
* Adding more fields to index due to querying
* Appending filtering and sorting queries
* Implementing a new ISelectorHandler without Examine types
* Re-implementing the collection to have a dedicated one for the selectors
* Implementing a new IFilterHandler without Examine types & refactoring the filters implementing it
* Adding a new collection dedicated to filters
* Renaming the old collection
* Implementing a new ISortHandler without Examine types & refactoring the sorts implementing it
* Adding a new collection for the sorts & adding all collections to UmbracoBuilder.Collections
* Refactoring the service to use the new collections and types
* Refactoring the fields in ContentApiFieldDefinitionCollection
* Remove nullability in Handlers
* Don't return null for selector
* Add TODO for having the filters support negation
* Changing the SortType to FieldType with our custom types on the SortOption
* Fix AncestorsSelector
* Fix ApiQueryService
* Documentation
* Fix Swagger docs
* Refactor the QueryContentApiController
* Adding handling for the IApiContentResponse in the JsonTypeResolver
* Refactor the service to use a safe fallback value in Examine queries
* Adding Noop for the IApiQueryService
* Cleanup
* Remove comment
* Fix name field for indexing
* Don't inherit QueryOptionBase in filters
* Fix casing for API index constant + swap FIXME with TODO
* Add TODO for handling missing fetch with start-item header
* Rename query handler parameters to not leak source (i.e. query string)
---------
Co-authored-by: kjac <kja@umbraco.dk>
Co-authored-by: Elitsa <>
Co-authored-by: Zeegaan <nge@umbraco.dk>
* Delivery API: Adding pagination to query endpoint (#14083)
* Adding pagination to query endpoint
* Optimize the paging using Examine directly
* Fix comment
* Remove skip/take code duplication
---------
Co-authored-by: kjac <kja@umbraco.dk>
* Add missing CompatibilitySuppressions.xml
* Make Delivery API packable
* Make Api.Common packable
* Renamed extension method and namespace so it is discoverable
* Untangle ApiVersion configuration into api.common, so delivery api do not require the management api to boot.
* configure options in management api
* RTE output as JSON for Content API (#14067)
* Conditionally serve RTE output as JSON instead of HTML
* Fixed merge
* Rename to Delivery API (#14119)
* Rename ContentApi to DeliveryApi
* Rename delivery API index implementation
* Update comments from "Content API" to "Delivery API"
* Rename project from Content to Delivery
* Add dedicated controller base for content delivery API
* Rename delivery API content index to include "content" specifically
* Fix compat suppressions
---------
Co-authored-by: kjac <kja@umbraco.dk>
Co-authored-by: Elitsa Marinovska <21998037+elit0451@users.noreply.github.com>
Co-authored-by: Zeegaan <nge@umbraco.dk>
2023-04-19 11:21:31 +02:00
|
|
|
builder.AddDeliveryApiCoreServices();
|
2023-10-31 10:06:14 +01:00
|
|
|
builder.Services.AddTransient<IWebhookFiringService, WebhookFiringService>();
|
Content Delivery API (#14051)
* Add the core parts of the headless PoC
* Add Content API project (WIP - loads of TODOs and dupes that need to be fixed!)
* Rename the content API project and namespaces
* Fixed bad merge
* Rename everything "Headless" to "ContentApi" or "Api"
* Refactor Content + Media: Key => Id, Name not nullable
* Make Content API property return value types independent of datatype configuration
* Clean up refactorings
* First stab at an expansion strategy using content picker as example implementation
* Use named JSON options for content API serialization
* Proper inclusion and registration of the content API
* Introduce API media builder
* Make MNTP return API content/media depending on configuration (instead of links) and support output expansion
* Content API: Get by controllers (#13740)
* Adding ContentApiControllerBase
* Adding get by id and url controllers
* Change route of get all test controller
* Rename to ContentApiController
* Refactoring
* Removing test controller
* Content API: Add start-node header value to deal with url collisions (#13746)
* Use start-node header value to deal with url collisions
* Cleanup
* Rename "url" param to "path"
* Adding a start node service to get the start-node header value
* Trim '/' from both beginning and end
* Content API: Support Accept-Language header (#13831)
* Move the content API JSON type resolver to an appropriate namespace
* Add localization based on Accept-Language header
* Content API: Output expansion (#13848)
* Implement request based output expansion strategy + expansion output cache at property level
* Slighty leaner implementation for default output expansion strategy
* Clarify the code a bit
* Fix bad merge
* Encapsulate content API dependencies in the DI
* Support multi-site and multi-culture routing + a little rename/refactor (#13882)
* Support multi-site and multi-culture routing + a little rename/refactor
* Make the by route controller handle root nodes
* Rename Url to Path in API content output
* Add a few comments for magic route creation
* Rename services from "Default" to "Noop"
* Ensure that Umbraco can boot without adding "AddContentApi()" to ConfigureServices
* Moved incorrectly placed media builder
* Fix API routes (#13915)
* Fix multi URL picker value converter trying to access disposed objects in edge cases
* Delivery API: Content routing and structure (#13984)
* Introduce content route instead of content path, rename and rework start item (previously start node) handling
* Strip out start node path in generated route path
* Make the start-item header take precedence over the request domain
* Conditionally enabling the delivery API + add protection and preview support + refactor all services to be singletons + ensure no-op implementations for all required services (#13992)
* Include umbraco properties (width, height, ...) in the Media Properties collection (#14023)
* Move umbraco properties (width, height, ...) to the Properties collection of the API Media model
* Don't output the umbracoFile property of media items
* Add content type deny list (#14025)
* Create a deny list of content types and utilize it for output generation
* Add unit tests
* Dedicated property cache level for Content API (#14027)
* Support redirect tracking (#14033)
* Create a deny list of content types and utilize it for output generation
* Add unit tests
* Handle redirect tracking in the content API
* Include start item routing info for redirects
* Add cultures and their routes to the API output (#14038)
* Create a deny list of content types and utilize it for output generation
* Add unit tests
* Handle redirect tracking in the content API
* Include start item routing info for redirects
* Add culture routes to root output (for HREFLANG support)
* Rename redirect service method to better match its purpose
* Review changes
* Delivery API: Query controller (#14041)
* Initial commit
* Custom ContentAPIFieldDefinitionCollection
* Make index IUmbracoContentIndex
* Add querying for children by parent id (key)
* Add missing interface
* Adding querying endpoint
* Test code
* Compose unpublishedValueSet, so that you get the correct data in the ContentAPI index
* Renaming
* Fix ancestorKeys index values
* Adding IApiQueryExtensionService to be able to query the ContentAPI index in a generic way
* Fix IApiQueryService and clean up QueryContentApiController using it
* Support querying for path
* Fix content API indexing
* Fix default sorting
* Implement concrete QueryOption implementations
* Introduce new ExecuteQuery that uses the Core OptionHandlers
* Implement ExecuteQuery
* Change ExecuteQuery signature and implementation
* Implement demo sorting and fetching
* Add query option handlers and collection builder for them
* Cleanup
* Revert "Conditionally enabling the delivery API + add protection and preview support + refactor all services to be singletons + ensure no-op implementations for all required services (#13992)"
This reverts commit 78e1f748e55383baecd123d06457111e18f13365.
* Revert "Delivery API: Content routing and structure (#13984)"
This reverts commit a0292ae5350362dd6c1c5bc9763deda928c78a75.
* Revert "Fix multi URL picker value converter trying to access disposed objects in edge cases"
This reverts commit 6b7c37a5bf7871bee93a2b2640bbc6ef591f14db.
* Revert "Conditionally enabling the delivery API + add protection and preview support + refactor all services to be singletons + ensure no-op implementations for all required services (#13992)"
This reverts commit 78e1f748e55383baecd123d06457111e18f13365.
* Revert "Delivery API: Content routing and structure (#13984)"
This reverts commit a0292ae5350362dd6c1c5bc9763deda928c78a75.
* Revert "Fix multi URL picker value converter trying to access disposed objects in edge cases"
This reverts commit 6b7c37a5bf7871bee93a2b2640bbc6ef591f14db.
* Fix multi URL picker value converter trying to access disposed objects in edge cases
* Delivery API: Content routing and structure (#13984)
* Introduce content route instead of content path, rename and rework start item (previously start node) handling
* Strip out start node path in generated route path
* Make the start-item header take precedence over the request domain
* Conditionally enabling the delivery API + add protection and preview support + refactor all services to be singletons + ensure no-op implementations for all required services (#13992)
* Test commit
* Refactored interfaces for the query handlers and for the selectors (that will handle the value of the fetch query option)
* Implemented a base class for the query options
* Refactored the names of the selectors and made use of the base class
* Refactored the ApiQueryService
* Refactored the QueryContentApiController.cs
* Conditionally enabling the delivery API + add protection and preview support + refactor all services to be singletons + ensure no-op implementations for all required services (#13992)
* Fixing merge gone wrong
* Fix multi URL picker value converter trying to access disposed objects in edge cases
* Delivery API: Content routing and structure (#13984)
* Introduce content route instead of content path, rename and rework start item (previously start node) handling
* Strip out start node path in generated route path
* Make the start-item header take precedence over the request domain
* Conditionally enabling the delivery API + add protection and preview support + refactor all services to be singletons + ensure no-op implementations for all required services (#13992)
* Make fetching work with the new setup
* Moving files to dedicated folders
* Removing ? for array
* Rename selector query method
* Implement FilterHandler and some filters
* Implement SortHandler and sort some sorts
* Refactoring
* Adding more fields to index due to querying
* Appending filtering and sorting queries
* Implementing a new ISelectorHandler without Examine types
* Re-implementing the collection to have a dedicated one for the selectors
* Implementing a new IFilterHandler without Examine types & refactoring the filters implementing it
* Adding a new collection dedicated to filters
* Renaming the old collection
* Implementing a new ISortHandler without Examine types & refactoring the sorts implementing it
* Adding a new collection for the sorts & adding all collections to UmbracoBuilder.Collections
* Refactoring the service to use the new collections and types
* Refactoring the fields in ContentApiFieldDefinitionCollection
* Remove nullability in Handlers
* Don't return null for selector
* Add TODO for having the filters support negation
* Changing the SortType to FieldType with our custom types on the SortOption
* Fix AncestorsSelector
* Fix ApiQueryService
* Documentation
* Fix Swagger docs
* Refactor the QueryContentApiController
* Adding handling for the IApiContentResponse in the JsonTypeResolver
* Refactor the service to use a safe fallback value in Examine queries
* Adding Noop for the IApiQueryService
* Cleanup
* Remove comment
* Fix name field for indexing
* Don't inherit QueryOptionBase in filters
* Fix casing for API index constant + swap FIXME with TODO
* Add TODO for handling missing fetch with start-item header
* Rename query handler parameters to not leak source (i.e. query string)
---------
Co-authored-by: kjac <kja@umbraco.dk>
Co-authored-by: Elitsa <>
Co-authored-by: Zeegaan <nge@umbraco.dk>
* Delivery API: Adding pagination to query endpoint (#14083)
* Adding pagination to query endpoint
* Optimize the paging using Examine directly
* Fix comment
* Remove skip/take code duplication
---------
Co-authored-by: kjac <kja@umbraco.dk>
* Add missing CompatibilitySuppressions.xml
* Make Delivery API packable
* Make Api.Common packable
* Renamed extension method and namespace so it is discoverable
* Untangle ApiVersion configuration into api.common, so delivery api do not require the management api to boot.
* configure options in management api
* RTE output as JSON for Content API (#14067)
* Conditionally serve RTE output as JSON instead of HTML
* Fixed merge
* Rename to Delivery API (#14119)
* Rename ContentApi to DeliveryApi
* Rename delivery API index implementation
* Update comments from "Content API" to "Delivery API"
* Rename project from Content to Delivery
* Add dedicated controller base for content delivery API
* Rename delivery API content index to include "content" specifically
* Fix compat suppressions
---------
Co-authored-by: kjac <kja@umbraco.dk>
Co-authored-by: Elitsa Marinovska <21998037+elit0451@users.noreply.github.com>
Co-authored-by: Zeegaan <nge@umbraco.dk>
2023-04-19 11:21:31 +02:00
|
|
|
|
2024-02-05 06:42:07 +01:00
|
|
|
builder.Services.AddUnique<IPasswordChanger<BackOfficeIdentityUser>, PasswordChanger<BackOfficeIdentityUser>>();
|
|
|
|
|
builder.Services.AddUnique<IPasswordChanger<MemberIdentityUser>, PasswordChanger<MemberIdentityUser>>();
|
|
|
|
|
builder.Services.AddTransient<IMemberEditingService, MemberEditingService>();
|
|
|
|
|
|
2023-02-13 14:47:26 +01:00
|
|
|
return builder;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static IUmbracoBuilder AddPropertyIndexValueFactories(this IUmbracoBuilder builder)
|
|
|
|
|
{
|
|
|
|
|
builder.Services.AddSingleton<IBlockValuePropertyIndexValueFactory, BlockValuePropertyIndexValueFactory>();
|
|
|
|
|
builder.Services.AddSingleton<ITagPropertyIndexValueFactory, TagPropertyIndexValueFactory>();
|
2023-10-31 12:52:35 +01:00
|
|
|
builder.Services.AddSingleton<IRichTextPropertyIndexValueFactory, RichTextPropertyIndexValueFactory>();
|
2023-02-13 14:47:26 +01:00
|
|
|
|
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
|
|
|
/// <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;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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>()
|
2024-01-10 12:22:36 +01:00
|
|
|
.AddNotificationHandler<ContentScaffoldedNotification, BlockListPropertyNotificationHandler>()
|
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, BlockGridPropertyNotificationHandler>()
|
|
|
|
|
.AddNotificationHandler<ContentCopyingNotification, BlockGridPropertyNotificationHandler>()
|
2024-01-10 12:22:36 +01:00
|
|
|
.AddNotificationHandler<ContentScaffoldedNotification, BlockGridPropertyNotificationHandler>()
|
2022-06-02 08:18:31 +02:00
|
|
|
.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>()
|
2023-11-29 12:27:07 +01:00
|
|
|
.AddNotificationHandler<MemberDeletedNotification, ImageCropperPropertyEditor>()
|
|
|
|
|
.AddNotificationHandler<ContentTypeCacheRefresherNotification, ConstructorCacheClearNotificationHandler>()
|
|
|
|
|
.AddNotificationHandler<DataTypeCacheRefresherNotification, ConstructorCacheClearNotificationHandler>();
|
2022-06-02 08:18:31 +02:00
|
|
|
|
|
|
|
|
// 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
|
2023-06-20 11:15:47 +02:00
|
|
|
.AddNotificationHandler<DictionaryItemDeletedNotification, DictionaryItemDeletedDistributedCacheNotificationHandler>()
|
|
|
|
|
.AddNotificationHandler<DictionaryItemSavedNotification, DictionaryItemSavedDistributedCacheNotificationHandler>()
|
|
|
|
|
.AddNotificationHandler<LanguageSavedNotification, LanguageSavedDistributedCacheNotificationHandler>()
|
|
|
|
|
.AddNotificationHandler<LanguageDeletedNotification, LanguageDeletedDistributedCacheNotificationHandler>()
|
|
|
|
|
.AddNotificationHandler<MemberSavedNotification, MemberSavedDistributedCacheNotificationHandler>()
|
|
|
|
|
.AddNotificationHandler<MemberDeletedNotification, MemberDeletedDistributedCacheNotificationHandler>()
|
|
|
|
|
.AddNotificationHandler<PublicAccessEntrySavedNotification, PublicAccessEntrySavedDistributedCacheNotificationHandler>()
|
|
|
|
|
.AddNotificationHandler<PublicAccessEntryDeletedNotification, PublicAccessEntryDeletedDistributedCacheNotificationHandler>()
|
|
|
|
|
.AddNotificationHandler<UserSavedNotification, UserSavedDistributedCacheNotificationHandler>()
|
|
|
|
|
.AddNotificationHandler<UserDeletedNotification, UserDeletedDistributedCacheNotificationHandler>()
|
|
|
|
|
.AddNotificationHandler<UserGroupWithUsersSavedNotification, UserGroupWithUsersSavedDistributedCacheNotificationHandler>()
|
|
|
|
|
.AddNotificationHandler<UserGroupDeletedNotification, UserGroupDeletedDistributedCacheNotificationHandler>()
|
|
|
|
|
.AddNotificationHandler<MemberGroupDeletedNotification, MemberGroupDeletedDistributedCacheNotificationHandler>()
|
|
|
|
|
.AddNotificationHandler<MemberGroupSavedNotification, MemberGroupSavedDistributedCacheNotificationHandler>()
|
|
|
|
|
.AddNotificationHandler<DataTypeDeletedNotification, DataTypeDeletedDistributedCacheNotificationHandler>()
|
|
|
|
|
.AddNotificationHandler<DataTypeSavedNotification, DataTypeSavedDistributedCacheNotificationHandler>()
|
|
|
|
|
.AddNotificationHandler<TemplateDeletedNotification, TemplateDeletedDistributedCacheNotificationHandler>()
|
|
|
|
|
.AddNotificationHandler<TemplateSavedNotification, TemplateSavedDistributedCacheNotificationHandler>()
|
|
|
|
|
.AddNotificationHandler<RelationTypeDeletedNotification, RelationTypeDeletedDistributedCacheNotificationHandler>()
|
|
|
|
|
.AddNotificationHandler<RelationTypeSavedNotification, RelationTypeSavedDistributedCacheNotificationHandler>()
|
|
|
|
|
.AddNotificationHandler<DomainDeletedNotification, DomainDeletedDistributedCacheNotificationHandler>()
|
|
|
|
|
.AddNotificationHandler<DomainSavedNotification, DomainSavedDistributedCacheNotificationHandler>()
|
|
|
|
|
.AddNotificationHandler<MediaTreeChangeNotification, MediaTreeChangeDistributedCacheNotificationHandler>()
|
|
|
|
|
.AddNotificationHandler<ContentTypeChangedNotification, ContentTypeChangedDistributedCacheNotificationHandler>()
|
|
|
|
|
.AddNotificationHandler<MediaTypeChangedNotification, MediaTypeChangedDistributedCacheNotificationHandler>()
|
|
|
|
|
.AddNotificationHandler<MemberTypeChangedNotification, MemberTypeChangedDistributedCacheNotificationHandler>()
|
|
|
|
|
.AddNotificationHandler<ContentTreeChangeNotification, ContentTreeChangeDistributedCacheNotificationHandler>()
|
2022-06-02 08:18:31 +02:00
|
|
|
;
|
|
|
|
|
|
|
|
|
|
// 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
|
|
|
}
|
Content Delivery API (#14051)
* Add the core parts of the headless PoC
* Add Content API project (WIP - loads of TODOs and dupes that need to be fixed!)
* Rename the content API project and namespaces
* Fixed bad merge
* Rename everything "Headless" to "ContentApi" or "Api"
* Refactor Content + Media: Key => Id, Name not nullable
* Make Content API property return value types independent of datatype configuration
* Clean up refactorings
* First stab at an expansion strategy using content picker as example implementation
* Use named JSON options for content API serialization
* Proper inclusion and registration of the content API
* Introduce API media builder
* Make MNTP return API content/media depending on configuration (instead of links) and support output expansion
* Content API: Get by controllers (#13740)
* Adding ContentApiControllerBase
* Adding get by id and url controllers
* Change route of get all test controller
* Rename to ContentApiController
* Refactoring
* Removing test controller
* Content API: Add start-node header value to deal with url collisions (#13746)
* Use start-node header value to deal with url collisions
* Cleanup
* Rename "url" param to "path"
* Adding a start node service to get the start-node header value
* Trim '/' from both beginning and end
* Content API: Support Accept-Language header (#13831)
* Move the content API JSON type resolver to an appropriate namespace
* Add localization based on Accept-Language header
* Content API: Output expansion (#13848)
* Implement request based output expansion strategy + expansion output cache at property level
* Slighty leaner implementation for default output expansion strategy
* Clarify the code a bit
* Fix bad merge
* Encapsulate content API dependencies in the DI
* Support multi-site and multi-culture routing + a little rename/refactor (#13882)
* Support multi-site and multi-culture routing + a little rename/refactor
* Make the by route controller handle root nodes
* Rename Url to Path in API content output
* Add a few comments for magic route creation
* Rename services from "Default" to "Noop"
* Ensure that Umbraco can boot without adding "AddContentApi()" to ConfigureServices
* Moved incorrectly placed media builder
* Fix API routes (#13915)
* Fix multi URL picker value converter trying to access disposed objects in edge cases
* Delivery API: Content routing and structure (#13984)
* Introduce content route instead of content path, rename and rework start item (previously start node) handling
* Strip out start node path in generated route path
* Make the start-item header take precedence over the request domain
* Conditionally enabling the delivery API + add protection and preview support + refactor all services to be singletons + ensure no-op implementations for all required services (#13992)
* Include umbraco properties (width, height, ...) in the Media Properties collection (#14023)
* Move umbraco properties (width, height, ...) to the Properties collection of the API Media model
* Don't output the umbracoFile property of media items
* Add content type deny list (#14025)
* Create a deny list of content types and utilize it for output generation
* Add unit tests
* Dedicated property cache level for Content API (#14027)
* Support redirect tracking (#14033)
* Create a deny list of content types and utilize it for output generation
* Add unit tests
* Handle redirect tracking in the content API
* Include start item routing info for redirects
* Add cultures and their routes to the API output (#14038)
* Create a deny list of content types and utilize it for output generation
* Add unit tests
* Handle redirect tracking in the content API
* Include start item routing info for redirects
* Add culture routes to root output (for HREFLANG support)
* Rename redirect service method to better match its purpose
* Review changes
* Delivery API: Query controller (#14041)
* Initial commit
* Custom ContentAPIFieldDefinitionCollection
* Make index IUmbracoContentIndex
* Add querying for children by parent id (key)
* Add missing interface
* Adding querying endpoint
* Test code
* Compose unpublishedValueSet, so that you get the correct data in the ContentAPI index
* Renaming
* Fix ancestorKeys index values
* Adding IApiQueryExtensionService to be able to query the ContentAPI index in a generic way
* Fix IApiQueryService and clean up QueryContentApiController using it
* Support querying for path
* Fix content API indexing
* Fix default sorting
* Implement concrete QueryOption implementations
* Introduce new ExecuteQuery that uses the Core OptionHandlers
* Implement ExecuteQuery
* Change ExecuteQuery signature and implementation
* Implement demo sorting and fetching
* Add query option handlers and collection builder for them
* Cleanup
* Revert "Conditionally enabling the delivery API + add protection and preview support + refactor all services to be singletons + ensure no-op implementations for all required services (#13992)"
This reverts commit 78e1f748e55383baecd123d06457111e18f13365.
* Revert "Delivery API: Content routing and structure (#13984)"
This reverts commit a0292ae5350362dd6c1c5bc9763deda928c78a75.
* Revert "Fix multi URL picker value converter trying to access disposed objects in edge cases"
This reverts commit 6b7c37a5bf7871bee93a2b2640bbc6ef591f14db.
* Revert "Conditionally enabling the delivery API + add protection and preview support + refactor all services to be singletons + ensure no-op implementations for all required services (#13992)"
This reverts commit 78e1f748e55383baecd123d06457111e18f13365.
* Revert "Delivery API: Content routing and structure (#13984)"
This reverts commit a0292ae5350362dd6c1c5bc9763deda928c78a75.
* Revert "Fix multi URL picker value converter trying to access disposed objects in edge cases"
This reverts commit 6b7c37a5bf7871bee93a2b2640bbc6ef591f14db.
* Fix multi URL picker value converter trying to access disposed objects in edge cases
* Delivery API: Content routing and structure (#13984)
* Introduce content route instead of content path, rename and rework start item (previously start node) handling
* Strip out start node path in generated route path
* Make the start-item header take precedence over the request domain
* Conditionally enabling the delivery API + add protection and preview support + refactor all services to be singletons + ensure no-op implementations for all required services (#13992)
* Test commit
* Refactored interfaces for the query handlers and for the selectors (that will handle the value of the fetch query option)
* Implemented a base class for the query options
* Refactored the names of the selectors and made use of the base class
* Refactored the ApiQueryService
* Refactored the QueryContentApiController.cs
* Conditionally enabling the delivery API + add protection and preview support + refactor all services to be singletons + ensure no-op implementations for all required services (#13992)
* Fixing merge gone wrong
* Fix multi URL picker value converter trying to access disposed objects in edge cases
* Delivery API: Content routing and structure (#13984)
* Introduce content route instead of content path, rename and rework start item (previously start node) handling
* Strip out start node path in generated route path
* Make the start-item header take precedence over the request domain
* Conditionally enabling the delivery API + add protection and preview support + refactor all services to be singletons + ensure no-op implementations for all required services (#13992)
* Make fetching work with the new setup
* Moving files to dedicated folders
* Removing ? for array
* Rename selector query method
* Implement FilterHandler and some filters
* Implement SortHandler and sort some sorts
* Refactoring
* Adding more fields to index due to querying
* Appending filtering and sorting queries
* Implementing a new ISelectorHandler without Examine types
* Re-implementing the collection to have a dedicated one for the selectors
* Implementing a new IFilterHandler without Examine types & refactoring the filters implementing it
* Adding a new collection dedicated to filters
* Renaming the old collection
* Implementing a new ISortHandler without Examine types & refactoring the sorts implementing it
* Adding a new collection for the sorts & adding all collections to UmbracoBuilder.Collections
* Refactoring the service to use the new collections and types
* Refactoring the fields in ContentApiFieldDefinitionCollection
* Remove nullability in Handlers
* Don't return null for selector
* Add TODO for having the filters support negation
* Changing the SortType to FieldType with our custom types on the SortOption
* Fix AncestorsSelector
* Fix ApiQueryService
* Documentation
* Fix Swagger docs
* Refactor the QueryContentApiController
* Adding handling for the IApiContentResponse in the JsonTypeResolver
* Refactor the service to use a safe fallback value in Examine queries
* Adding Noop for the IApiQueryService
* Cleanup
* Remove comment
* Fix name field for indexing
* Don't inherit QueryOptionBase in filters
* Fix casing for API index constant + swap FIXME with TODO
* Add TODO for handling missing fetch with start-item header
* Rename query handler parameters to not leak source (i.e. query string)
---------
Co-authored-by: kjac <kja@umbraco.dk>
Co-authored-by: Elitsa <>
Co-authored-by: Zeegaan <nge@umbraco.dk>
* Delivery API: Adding pagination to query endpoint (#14083)
* Adding pagination to query endpoint
* Optimize the paging using Examine directly
* Fix comment
* Remove skip/take code duplication
---------
Co-authored-by: kjac <kja@umbraco.dk>
* Add missing CompatibilitySuppressions.xml
* Make Delivery API packable
* Make Api.Common packable
* Renamed extension method and namespace so it is discoverable
* Untangle ApiVersion configuration into api.common, so delivery api do not require the management api to boot.
* configure options in management api
* RTE output as JSON for Content API (#14067)
* Conditionally serve RTE output as JSON instead of HTML
* Fixed merge
* Rename to Delivery API (#14119)
* Rename ContentApi to DeliveryApi
* Rename delivery API index implementation
* Update comments from "Content API" to "Delivery API"
* Rename project from Content to Delivery
* Add dedicated controller base for content delivery API
* Rename delivery API content index to include "content" specifically
* Fix compat suppressions
---------
Co-authored-by: kjac <kja@umbraco.dk>
Co-authored-by: Elitsa Marinovska <21998037+elit0451@users.noreply.github.com>
Co-authored-by: Zeegaan <nge@umbraco.dk>
2023-04-19 11:21:31 +02:00
|
|
|
|
|
|
|
|
private static IUmbracoBuilder AddDeliveryApiCoreServices(this IUmbracoBuilder builder)
|
|
|
|
|
{
|
|
|
|
|
builder.Services.AddSingleton<IApiElementBuilder, ApiElementBuilder>();
|
|
|
|
|
builder.Services.AddSingleton<IApiContentBuilder, ApiContentBuilder>();
|
|
|
|
|
builder.Services.AddSingleton<IApiContentResponseBuilder, ApiContentResponseBuilder>();
|
|
|
|
|
builder.Services.AddSingleton<IApiMediaBuilder, ApiMediaBuilder>();
|
2023-08-21 13:57:36 +02:00
|
|
|
builder.Services.AddSingleton<IApiMediaWithCropsBuilder, ApiMediaWithCropsBuilder>();
|
|
|
|
|
builder.Services.AddSingleton<IApiMediaWithCropsResponseBuilder, ApiMediaWithCropsResponseBuilder>();
|
Content Delivery API (#14051)
* Add the core parts of the headless PoC
* Add Content API project (WIP - loads of TODOs and dupes that need to be fixed!)
* Rename the content API project and namespaces
* Fixed bad merge
* Rename everything "Headless" to "ContentApi" or "Api"
* Refactor Content + Media: Key => Id, Name not nullable
* Make Content API property return value types independent of datatype configuration
* Clean up refactorings
* First stab at an expansion strategy using content picker as example implementation
* Use named JSON options for content API serialization
* Proper inclusion and registration of the content API
* Introduce API media builder
* Make MNTP return API content/media depending on configuration (instead of links) and support output expansion
* Content API: Get by controllers (#13740)
* Adding ContentApiControllerBase
* Adding get by id and url controllers
* Change route of get all test controller
* Rename to ContentApiController
* Refactoring
* Removing test controller
* Content API: Add start-node header value to deal with url collisions (#13746)
* Use start-node header value to deal with url collisions
* Cleanup
* Rename "url" param to "path"
* Adding a start node service to get the start-node header value
* Trim '/' from both beginning and end
* Content API: Support Accept-Language header (#13831)
* Move the content API JSON type resolver to an appropriate namespace
* Add localization based on Accept-Language header
* Content API: Output expansion (#13848)
* Implement request based output expansion strategy + expansion output cache at property level
* Slighty leaner implementation for default output expansion strategy
* Clarify the code a bit
* Fix bad merge
* Encapsulate content API dependencies in the DI
* Support multi-site and multi-culture routing + a little rename/refactor (#13882)
* Support multi-site and multi-culture routing + a little rename/refactor
* Make the by route controller handle root nodes
* Rename Url to Path in API content output
* Add a few comments for magic route creation
* Rename services from "Default" to "Noop"
* Ensure that Umbraco can boot without adding "AddContentApi()" to ConfigureServices
* Moved incorrectly placed media builder
* Fix API routes (#13915)
* Fix multi URL picker value converter trying to access disposed objects in edge cases
* Delivery API: Content routing and structure (#13984)
* Introduce content route instead of content path, rename and rework start item (previously start node) handling
* Strip out start node path in generated route path
* Make the start-item header take precedence over the request domain
* Conditionally enabling the delivery API + add protection and preview support + refactor all services to be singletons + ensure no-op implementations for all required services (#13992)
* Include umbraco properties (width, height, ...) in the Media Properties collection (#14023)
* Move umbraco properties (width, height, ...) to the Properties collection of the API Media model
* Don't output the umbracoFile property of media items
* Add content type deny list (#14025)
* Create a deny list of content types and utilize it for output generation
* Add unit tests
* Dedicated property cache level for Content API (#14027)
* Support redirect tracking (#14033)
* Create a deny list of content types and utilize it for output generation
* Add unit tests
* Handle redirect tracking in the content API
* Include start item routing info for redirects
* Add cultures and their routes to the API output (#14038)
* Create a deny list of content types and utilize it for output generation
* Add unit tests
* Handle redirect tracking in the content API
* Include start item routing info for redirects
* Add culture routes to root output (for HREFLANG support)
* Rename redirect service method to better match its purpose
* Review changes
* Delivery API: Query controller (#14041)
* Initial commit
* Custom ContentAPIFieldDefinitionCollection
* Make index IUmbracoContentIndex
* Add querying for children by parent id (key)
* Add missing interface
* Adding querying endpoint
* Test code
* Compose unpublishedValueSet, so that you get the correct data in the ContentAPI index
* Renaming
* Fix ancestorKeys index values
* Adding IApiQueryExtensionService to be able to query the ContentAPI index in a generic way
* Fix IApiQueryService and clean up QueryContentApiController using it
* Support querying for path
* Fix content API indexing
* Fix default sorting
* Implement concrete QueryOption implementations
* Introduce new ExecuteQuery that uses the Core OptionHandlers
* Implement ExecuteQuery
* Change ExecuteQuery signature and implementation
* Implement demo sorting and fetching
* Add query option handlers and collection builder for them
* Cleanup
* Revert "Conditionally enabling the delivery API + add protection and preview support + refactor all services to be singletons + ensure no-op implementations for all required services (#13992)"
This reverts commit 78e1f748e55383baecd123d06457111e18f13365.
* Revert "Delivery API: Content routing and structure (#13984)"
This reverts commit a0292ae5350362dd6c1c5bc9763deda928c78a75.
* Revert "Fix multi URL picker value converter trying to access disposed objects in edge cases"
This reverts commit 6b7c37a5bf7871bee93a2b2640bbc6ef591f14db.
* Revert "Conditionally enabling the delivery API + add protection and preview support + refactor all services to be singletons + ensure no-op implementations for all required services (#13992)"
This reverts commit 78e1f748e55383baecd123d06457111e18f13365.
* Revert "Delivery API: Content routing and structure (#13984)"
This reverts commit a0292ae5350362dd6c1c5bc9763deda928c78a75.
* Revert "Fix multi URL picker value converter trying to access disposed objects in edge cases"
This reverts commit 6b7c37a5bf7871bee93a2b2640bbc6ef591f14db.
* Fix multi URL picker value converter trying to access disposed objects in edge cases
* Delivery API: Content routing and structure (#13984)
* Introduce content route instead of content path, rename and rework start item (previously start node) handling
* Strip out start node path in generated route path
* Make the start-item header take precedence over the request domain
* Conditionally enabling the delivery API + add protection and preview support + refactor all services to be singletons + ensure no-op implementations for all required services (#13992)
* Test commit
* Refactored interfaces for the query handlers and for the selectors (that will handle the value of the fetch query option)
* Implemented a base class for the query options
* Refactored the names of the selectors and made use of the base class
* Refactored the ApiQueryService
* Refactored the QueryContentApiController.cs
* Conditionally enabling the delivery API + add protection and preview support + refactor all services to be singletons + ensure no-op implementations for all required services (#13992)
* Fixing merge gone wrong
* Fix multi URL picker value converter trying to access disposed objects in edge cases
* Delivery API: Content routing and structure (#13984)
* Introduce content route instead of content path, rename and rework start item (previously start node) handling
* Strip out start node path in generated route path
* Make the start-item header take precedence over the request domain
* Conditionally enabling the delivery API + add protection and preview support + refactor all services to be singletons + ensure no-op implementations for all required services (#13992)
* Make fetching work with the new setup
* Moving files to dedicated folders
* Removing ? for array
* Rename selector query method
* Implement FilterHandler and some filters
* Implement SortHandler and sort some sorts
* Refactoring
* Adding more fields to index due to querying
* Appending filtering and sorting queries
* Implementing a new ISelectorHandler without Examine types
* Re-implementing the collection to have a dedicated one for the selectors
* Implementing a new IFilterHandler without Examine types & refactoring the filters implementing it
* Adding a new collection dedicated to filters
* Renaming the old collection
* Implementing a new ISortHandler without Examine types & refactoring the sorts implementing it
* Adding a new collection for the sorts & adding all collections to UmbracoBuilder.Collections
* Refactoring the service to use the new collections and types
* Refactoring the fields in ContentApiFieldDefinitionCollection
* Remove nullability in Handlers
* Don't return null for selector
* Add TODO for having the filters support negation
* Changing the SortType to FieldType with our custom types on the SortOption
* Fix AncestorsSelector
* Fix ApiQueryService
* Documentation
* Fix Swagger docs
* Refactor the QueryContentApiController
* Adding handling for the IApiContentResponse in the JsonTypeResolver
* Refactor the service to use a safe fallback value in Examine queries
* Adding Noop for the IApiQueryService
* Cleanup
* Remove comment
* Fix name field for indexing
* Don't inherit QueryOptionBase in filters
* Fix casing for API index constant + swap FIXME with TODO
* Add TODO for handling missing fetch with start-item header
* Rename query handler parameters to not leak source (i.e. query string)
---------
Co-authored-by: kjac <kja@umbraco.dk>
Co-authored-by: Elitsa <>
Co-authored-by: Zeegaan <nge@umbraco.dk>
* Delivery API: Adding pagination to query endpoint (#14083)
* Adding pagination to query endpoint
* Optimize the paging using Examine directly
* Fix comment
* Remove skip/take code duplication
---------
Co-authored-by: kjac <kja@umbraco.dk>
* Add missing CompatibilitySuppressions.xml
* Make Delivery API packable
* Make Api.Common packable
* Renamed extension method and namespace so it is discoverable
* Untangle ApiVersion configuration into api.common, so delivery api do not require the management api to boot.
* configure options in management api
* RTE output as JSON for Content API (#14067)
* Conditionally serve RTE output as JSON instead of HTML
* Fixed merge
* Rename to Delivery API (#14119)
* Rename ContentApi to DeliveryApi
* Rename delivery API index implementation
* Update comments from "Content API" to "Delivery API"
* Rename project from Content to Delivery
* Add dedicated controller base for content delivery API
* Rename delivery API content index to include "content" specifically
* Fix compat suppressions
---------
Co-authored-by: kjac <kja@umbraco.dk>
Co-authored-by: Elitsa Marinovska <21998037+elit0451@users.noreply.github.com>
Co-authored-by: Zeegaan <nge@umbraco.dk>
2023-04-19 11:21:31 +02:00
|
|
|
builder.Services.AddSingleton<IApiContentNameProvider, ApiContentNameProvider>();
|
|
|
|
|
builder.Services.AddSingleton<IOutputExpansionStrategyAccessor, NoopOutputExpansionStrategyAccessor>();
|
|
|
|
|
builder.Services.AddSingleton<IRequestStartItemProviderAccessor, NoopRequestStartItemProviderAccessor>();
|
|
|
|
|
builder.Services.AddSingleton<IRequestCultureService, NoopRequestCultureService>();
|
|
|
|
|
builder.Services.AddSingleton<IRequestRoutingService, NoopRequestRoutingService>();
|
|
|
|
|
builder.Services.AddSingleton<IRequestRedirectService, NoopRequestRedirectService>();
|
|
|
|
|
builder.Services.AddSingleton<IRequestPreviewService, NoopRequestPreviewService>();
|
2023-09-26 09:22:45 +02:00
|
|
|
builder.Services.AddSingleton<IRequestMemberAccessService, NoopRequestMemberAccessService>();
|
Content Delivery API (#14051)
* Add the core parts of the headless PoC
* Add Content API project (WIP - loads of TODOs and dupes that need to be fixed!)
* Rename the content API project and namespaces
* Fixed bad merge
* Rename everything "Headless" to "ContentApi" or "Api"
* Refactor Content + Media: Key => Id, Name not nullable
* Make Content API property return value types independent of datatype configuration
* Clean up refactorings
* First stab at an expansion strategy using content picker as example implementation
* Use named JSON options for content API serialization
* Proper inclusion and registration of the content API
* Introduce API media builder
* Make MNTP return API content/media depending on configuration (instead of links) and support output expansion
* Content API: Get by controllers (#13740)
* Adding ContentApiControllerBase
* Adding get by id and url controllers
* Change route of get all test controller
* Rename to ContentApiController
* Refactoring
* Removing test controller
* Content API: Add start-node header value to deal with url collisions (#13746)
* Use start-node header value to deal with url collisions
* Cleanup
* Rename "url" param to "path"
* Adding a start node service to get the start-node header value
* Trim '/' from both beginning and end
* Content API: Support Accept-Language header (#13831)
* Move the content API JSON type resolver to an appropriate namespace
* Add localization based on Accept-Language header
* Content API: Output expansion (#13848)
* Implement request based output expansion strategy + expansion output cache at property level
* Slighty leaner implementation for default output expansion strategy
* Clarify the code a bit
* Fix bad merge
* Encapsulate content API dependencies in the DI
* Support multi-site and multi-culture routing + a little rename/refactor (#13882)
* Support multi-site and multi-culture routing + a little rename/refactor
* Make the by route controller handle root nodes
* Rename Url to Path in API content output
* Add a few comments for magic route creation
* Rename services from "Default" to "Noop"
* Ensure that Umbraco can boot without adding "AddContentApi()" to ConfigureServices
* Moved incorrectly placed media builder
* Fix API routes (#13915)
* Fix multi URL picker value converter trying to access disposed objects in edge cases
* Delivery API: Content routing and structure (#13984)
* Introduce content route instead of content path, rename and rework start item (previously start node) handling
* Strip out start node path in generated route path
* Make the start-item header take precedence over the request domain
* Conditionally enabling the delivery API + add protection and preview support + refactor all services to be singletons + ensure no-op implementations for all required services (#13992)
* Include umbraco properties (width, height, ...) in the Media Properties collection (#14023)
* Move umbraco properties (width, height, ...) to the Properties collection of the API Media model
* Don't output the umbracoFile property of media items
* Add content type deny list (#14025)
* Create a deny list of content types and utilize it for output generation
* Add unit tests
* Dedicated property cache level for Content API (#14027)
* Support redirect tracking (#14033)
* Create a deny list of content types and utilize it for output generation
* Add unit tests
* Handle redirect tracking in the content API
* Include start item routing info for redirects
* Add cultures and their routes to the API output (#14038)
* Create a deny list of content types and utilize it for output generation
* Add unit tests
* Handle redirect tracking in the content API
* Include start item routing info for redirects
* Add culture routes to root output (for HREFLANG support)
* Rename redirect service method to better match its purpose
* Review changes
* Delivery API: Query controller (#14041)
* Initial commit
* Custom ContentAPIFieldDefinitionCollection
* Make index IUmbracoContentIndex
* Add querying for children by parent id (key)
* Add missing interface
* Adding querying endpoint
* Test code
* Compose unpublishedValueSet, so that you get the correct data in the ContentAPI index
* Renaming
* Fix ancestorKeys index values
* Adding IApiQueryExtensionService to be able to query the ContentAPI index in a generic way
* Fix IApiQueryService and clean up QueryContentApiController using it
* Support querying for path
* Fix content API indexing
* Fix default sorting
* Implement concrete QueryOption implementations
* Introduce new ExecuteQuery that uses the Core OptionHandlers
* Implement ExecuteQuery
* Change ExecuteQuery signature and implementation
* Implement demo sorting and fetching
* Add query option handlers and collection builder for them
* Cleanup
* Revert "Conditionally enabling the delivery API + add protection and preview support + refactor all services to be singletons + ensure no-op implementations for all required services (#13992)"
This reverts commit 78e1f748e55383baecd123d06457111e18f13365.
* Revert "Delivery API: Content routing and structure (#13984)"
This reverts commit a0292ae5350362dd6c1c5bc9763deda928c78a75.
* Revert "Fix multi URL picker value converter trying to access disposed objects in edge cases"
This reverts commit 6b7c37a5bf7871bee93a2b2640bbc6ef591f14db.
* Revert "Conditionally enabling the delivery API + add protection and preview support + refactor all services to be singletons + ensure no-op implementations for all required services (#13992)"
This reverts commit 78e1f748e55383baecd123d06457111e18f13365.
* Revert "Delivery API: Content routing and structure (#13984)"
This reverts commit a0292ae5350362dd6c1c5bc9763deda928c78a75.
* Revert "Fix multi URL picker value converter trying to access disposed objects in edge cases"
This reverts commit 6b7c37a5bf7871bee93a2b2640bbc6ef591f14db.
* Fix multi URL picker value converter trying to access disposed objects in edge cases
* Delivery API: Content routing and structure (#13984)
* Introduce content route instead of content path, rename and rework start item (previously start node) handling
* Strip out start node path in generated route path
* Make the start-item header take precedence over the request domain
* Conditionally enabling the delivery API + add protection and preview support + refactor all services to be singletons + ensure no-op implementations for all required services (#13992)
* Test commit
* Refactored interfaces for the query handlers and for the selectors (that will handle the value of the fetch query option)
* Implemented a base class for the query options
* Refactored the names of the selectors and made use of the base class
* Refactored the ApiQueryService
* Refactored the QueryContentApiController.cs
* Conditionally enabling the delivery API + add protection and preview support + refactor all services to be singletons + ensure no-op implementations for all required services (#13992)
* Fixing merge gone wrong
* Fix multi URL picker value converter trying to access disposed objects in edge cases
* Delivery API: Content routing and structure (#13984)
* Introduce content route instead of content path, rename and rework start item (previously start node) handling
* Strip out start node path in generated route path
* Make the start-item header take precedence over the request domain
* Conditionally enabling the delivery API + add protection and preview support + refactor all services to be singletons + ensure no-op implementations for all required services (#13992)
* Make fetching work with the new setup
* Moving files to dedicated folders
* Removing ? for array
* Rename selector query method
* Implement FilterHandler and some filters
* Implement SortHandler and sort some sorts
* Refactoring
* Adding more fields to index due to querying
* Appending filtering and sorting queries
* Implementing a new ISelectorHandler without Examine types
* Re-implementing the collection to have a dedicated one for the selectors
* Implementing a new IFilterHandler without Examine types & refactoring the filters implementing it
* Adding a new collection dedicated to filters
* Renaming the old collection
* Implementing a new ISortHandler without Examine types & refactoring the sorts implementing it
* Adding a new collection for the sorts & adding all collections to UmbracoBuilder.Collections
* Refactoring the service to use the new collections and types
* Refactoring the fields in ContentApiFieldDefinitionCollection
* Remove nullability in Handlers
* Don't return null for selector
* Add TODO for having the filters support negation
* Changing the SortType to FieldType with our custom types on the SortOption
* Fix AncestorsSelector
* Fix ApiQueryService
* Documentation
* Fix Swagger docs
* Refactor the QueryContentApiController
* Adding handling for the IApiContentResponse in the JsonTypeResolver
* Refactor the service to use a safe fallback value in Examine queries
* Adding Noop for the IApiQueryService
* Cleanup
* Remove comment
* Fix name field for indexing
* Don't inherit QueryOptionBase in filters
* Fix casing for API index constant + swap FIXME with TODO
* Add TODO for handling missing fetch with start-item header
* Rename query handler parameters to not leak source (i.e. query string)
---------
Co-authored-by: kjac <kja@umbraco.dk>
Co-authored-by: Elitsa <>
Co-authored-by: Zeegaan <nge@umbraco.dk>
* Delivery API: Adding pagination to query endpoint (#14083)
* Adding pagination to query endpoint
* Optimize the paging using Examine directly
* Fix comment
* Remove skip/take code duplication
---------
Co-authored-by: kjac <kja@umbraco.dk>
* Add missing CompatibilitySuppressions.xml
* Make Delivery API packable
* Make Api.Common packable
* Renamed extension method and namespace so it is discoverable
* Untangle ApiVersion configuration into api.common, so delivery api do not require the management api to boot.
* configure options in management api
* RTE output as JSON for Content API (#14067)
* Conditionally serve RTE output as JSON instead of HTML
* Fixed merge
* Rename to Delivery API (#14119)
* Rename ContentApi to DeliveryApi
* Rename delivery API index implementation
* Update comments from "Content API" to "Delivery API"
* Rename project from Content to Delivery
* Add dedicated controller base for content delivery API
* Rename delivery API content index to include "content" specifically
* Fix compat suppressions
---------
Co-authored-by: kjac <kja@umbraco.dk>
Co-authored-by: Elitsa Marinovska <21998037+elit0451@users.noreply.github.com>
Co-authored-by: Zeegaan <nge@umbraco.dk>
2023-04-19 11:21:31 +02:00
|
|
|
builder.Services.AddSingleton<IApiAccessService, NoopApiAccessService>();
|
|
|
|
|
builder.Services.AddSingleton<IApiContentQueryService, NoopApiContentQueryService>();
|
2023-08-21 13:57:36 +02:00
|
|
|
builder.Services.AddSingleton<IApiMediaQueryService, NoopApiMediaQueryService>();
|
Content Delivery API (#14051)
* Add the core parts of the headless PoC
* Add Content API project (WIP - loads of TODOs and dupes that need to be fixed!)
* Rename the content API project and namespaces
* Fixed bad merge
* Rename everything "Headless" to "ContentApi" or "Api"
* Refactor Content + Media: Key => Id, Name not nullable
* Make Content API property return value types independent of datatype configuration
* Clean up refactorings
* First stab at an expansion strategy using content picker as example implementation
* Use named JSON options for content API serialization
* Proper inclusion and registration of the content API
* Introduce API media builder
* Make MNTP return API content/media depending on configuration (instead of links) and support output expansion
* Content API: Get by controllers (#13740)
* Adding ContentApiControllerBase
* Adding get by id and url controllers
* Change route of get all test controller
* Rename to ContentApiController
* Refactoring
* Removing test controller
* Content API: Add start-node header value to deal with url collisions (#13746)
* Use start-node header value to deal with url collisions
* Cleanup
* Rename "url" param to "path"
* Adding a start node service to get the start-node header value
* Trim '/' from both beginning and end
* Content API: Support Accept-Language header (#13831)
* Move the content API JSON type resolver to an appropriate namespace
* Add localization based on Accept-Language header
* Content API: Output expansion (#13848)
* Implement request based output expansion strategy + expansion output cache at property level
* Slighty leaner implementation for default output expansion strategy
* Clarify the code a bit
* Fix bad merge
* Encapsulate content API dependencies in the DI
* Support multi-site and multi-culture routing + a little rename/refactor (#13882)
* Support multi-site and multi-culture routing + a little rename/refactor
* Make the by route controller handle root nodes
* Rename Url to Path in API content output
* Add a few comments for magic route creation
* Rename services from "Default" to "Noop"
* Ensure that Umbraco can boot without adding "AddContentApi()" to ConfigureServices
* Moved incorrectly placed media builder
* Fix API routes (#13915)
* Fix multi URL picker value converter trying to access disposed objects in edge cases
* Delivery API: Content routing and structure (#13984)
* Introduce content route instead of content path, rename and rework start item (previously start node) handling
* Strip out start node path in generated route path
* Make the start-item header take precedence over the request domain
* Conditionally enabling the delivery API + add protection and preview support + refactor all services to be singletons + ensure no-op implementations for all required services (#13992)
* Include umbraco properties (width, height, ...) in the Media Properties collection (#14023)
* Move umbraco properties (width, height, ...) to the Properties collection of the API Media model
* Don't output the umbracoFile property of media items
* Add content type deny list (#14025)
* Create a deny list of content types and utilize it for output generation
* Add unit tests
* Dedicated property cache level for Content API (#14027)
* Support redirect tracking (#14033)
* Create a deny list of content types and utilize it for output generation
* Add unit tests
* Handle redirect tracking in the content API
* Include start item routing info for redirects
* Add cultures and their routes to the API output (#14038)
* Create a deny list of content types and utilize it for output generation
* Add unit tests
* Handle redirect tracking in the content API
* Include start item routing info for redirects
* Add culture routes to root output (for HREFLANG support)
* Rename redirect service method to better match its purpose
* Review changes
* Delivery API: Query controller (#14041)
* Initial commit
* Custom ContentAPIFieldDefinitionCollection
* Make index IUmbracoContentIndex
* Add querying for children by parent id (key)
* Add missing interface
* Adding querying endpoint
* Test code
* Compose unpublishedValueSet, so that you get the correct data in the ContentAPI index
* Renaming
* Fix ancestorKeys index values
* Adding IApiQueryExtensionService to be able to query the ContentAPI index in a generic way
* Fix IApiQueryService and clean up QueryContentApiController using it
* Support querying for path
* Fix content API indexing
* Fix default sorting
* Implement concrete QueryOption implementations
* Introduce new ExecuteQuery that uses the Core OptionHandlers
* Implement ExecuteQuery
* Change ExecuteQuery signature and implementation
* Implement demo sorting and fetching
* Add query option handlers and collection builder for them
* Cleanup
* Revert "Conditionally enabling the delivery API + add protection and preview support + refactor all services to be singletons + ensure no-op implementations for all required services (#13992)"
This reverts commit 78e1f748e55383baecd123d06457111e18f13365.
* Revert "Delivery API: Content routing and structure (#13984)"
This reverts commit a0292ae5350362dd6c1c5bc9763deda928c78a75.
* Revert "Fix multi URL picker value converter trying to access disposed objects in edge cases"
This reverts commit 6b7c37a5bf7871bee93a2b2640bbc6ef591f14db.
* Revert "Conditionally enabling the delivery API + add protection and preview support + refactor all services to be singletons + ensure no-op implementations for all required services (#13992)"
This reverts commit 78e1f748e55383baecd123d06457111e18f13365.
* Revert "Delivery API: Content routing and structure (#13984)"
This reverts commit a0292ae5350362dd6c1c5bc9763deda928c78a75.
* Revert "Fix multi URL picker value converter trying to access disposed objects in edge cases"
This reverts commit 6b7c37a5bf7871bee93a2b2640bbc6ef591f14db.
* Fix multi URL picker value converter trying to access disposed objects in edge cases
* Delivery API: Content routing and structure (#13984)
* Introduce content route instead of content path, rename and rework start item (previously start node) handling
* Strip out start node path in generated route path
* Make the start-item header take precedence over the request domain
* Conditionally enabling the delivery API + add protection and preview support + refactor all services to be singletons + ensure no-op implementations for all required services (#13992)
* Test commit
* Refactored interfaces for the query handlers and for the selectors (that will handle the value of the fetch query option)
* Implemented a base class for the query options
* Refactored the names of the selectors and made use of the base class
* Refactored the ApiQueryService
* Refactored the QueryContentApiController.cs
* Conditionally enabling the delivery API + add protection and preview support + refactor all services to be singletons + ensure no-op implementations for all required services (#13992)
* Fixing merge gone wrong
* Fix multi URL picker value converter trying to access disposed objects in edge cases
* Delivery API: Content routing and structure (#13984)
* Introduce content route instead of content path, rename and rework start item (previously start node) handling
* Strip out start node path in generated route path
* Make the start-item header take precedence over the request domain
* Conditionally enabling the delivery API + add protection and preview support + refactor all services to be singletons + ensure no-op implementations for all required services (#13992)
* Make fetching work with the new setup
* Moving files to dedicated folders
* Removing ? for array
* Rename selector query method
* Implement FilterHandler and some filters
* Implement SortHandler and sort some sorts
* Refactoring
* Adding more fields to index due to querying
* Appending filtering and sorting queries
* Implementing a new ISelectorHandler without Examine types
* Re-implementing the collection to have a dedicated one for the selectors
* Implementing a new IFilterHandler without Examine types & refactoring the filters implementing it
* Adding a new collection dedicated to filters
* Renaming the old collection
* Implementing a new ISortHandler without Examine types & refactoring the sorts implementing it
* Adding a new collection for the sorts & adding all collections to UmbracoBuilder.Collections
* Refactoring the service to use the new collections and types
* Refactoring the fields in ContentApiFieldDefinitionCollection
* Remove nullability in Handlers
* Don't return null for selector
* Add TODO for having the filters support negation
* Changing the SortType to FieldType with our custom types on the SortOption
* Fix AncestorsSelector
* Fix ApiQueryService
* Documentation
* Fix Swagger docs
* Refactor the QueryContentApiController
* Adding handling for the IApiContentResponse in the JsonTypeResolver
* Refactor the service to use a safe fallback value in Examine queries
* Adding Noop for the IApiQueryService
* Cleanup
* Remove comment
* Fix name field for indexing
* Don't inherit QueryOptionBase in filters
* Fix casing for API index constant + swap FIXME with TODO
* Add TODO for handling missing fetch with start-item header
* Rename query handler parameters to not leak source (i.e. query string)
---------
Co-authored-by: kjac <kja@umbraco.dk>
Co-authored-by: Elitsa <>
Co-authored-by: Zeegaan <nge@umbraco.dk>
* Delivery API: Adding pagination to query endpoint (#14083)
* Adding pagination to query endpoint
* Optimize the paging using Examine directly
* Fix comment
* Remove skip/take code duplication
---------
Co-authored-by: kjac <kja@umbraco.dk>
* Add missing CompatibilitySuppressions.xml
* Make Delivery API packable
* Make Api.Common packable
* Renamed extension method and namespace so it is discoverable
* Untangle ApiVersion configuration into api.common, so delivery api do not require the management api to boot.
* configure options in management api
* RTE output as JSON for Content API (#14067)
* Conditionally serve RTE output as JSON instead of HTML
* Fixed merge
* Rename to Delivery API (#14119)
* Rename ContentApi to DeliveryApi
* Rename delivery API index implementation
* Update comments from "Content API" to "Delivery API"
* Rename project from Content to Delivery
* Add dedicated controller base for content delivery API
* Rename delivery API content index to include "content" specifically
* Fix compat suppressions
---------
Co-authored-by: kjac <kja@umbraco.dk>
Co-authored-by: Elitsa Marinovska <21998037+elit0451@users.noreply.github.com>
Co-authored-by: Zeegaan <nge@umbraco.dk>
2023-04-19 11:21:31 +02:00
|
|
|
builder.Services.AddSingleton<IApiMediaUrlProvider, ApiMediaUrlProvider>();
|
|
|
|
|
builder.Services.AddSingleton<IApiContentRouteBuilder, ApiContentRouteBuilder>();
|
2024-03-22 14:12:33 +01:00
|
|
|
builder.Services.AddSingleton<IApiContentPathProvider, ApiContentPathProvider>();
|
|
|
|
|
builder.Services.AddSingleton<IApiContentPathResolver, ApiContentPathResolver>();
|
Content Delivery API (#14051)
* Add the core parts of the headless PoC
* Add Content API project (WIP - loads of TODOs and dupes that need to be fixed!)
* Rename the content API project and namespaces
* Fixed bad merge
* Rename everything "Headless" to "ContentApi" or "Api"
* Refactor Content + Media: Key => Id, Name not nullable
* Make Content API property return value types independent of datatype configuration
* Clean up refactorings
* First stab at an expansion strategy using content picker as example implementation
* Use named JSON options for content API serialization
* Proper inclusion and registration of the content API
* Introduce API media builder
* Make MNTP return API content/media depending on configuration (instead of links) and support output expansion
* Content API: Get by controllers (#13740)
* Adding ContentApiControllerBase
* Adding get by id and url controllers
* Change route of get all test controller
* Rename to ContentApiController
* Refactoring
* Removing test controller
* Content API: Add start-node header value to deal with url collisions (#13746)
* Use start-node header value to deal with url collisions
* Cleanup
* Rename "url" param to "path"
* Adding a start node service to get the start-node header value
* Trim '/' from both beginning and end
* Content API: Support Accept-Language header (#13831)
* Move the content API JSON type resolver to an appropriate namespace
* Add localization based on Accept-Language header
* Content API: Output expansion (#13848)
* Implement request based output expansion strategy + expansion output cache at property level
* Slighty leaner implementation for default output expansion strategy
* Clarify the code a bit
* Fix bad merge
* Encapsulate content API dependencies in the DI
* Support multi-site and multi-culture routing + a little rename/refactor (#13882)
* Support multi-site and multi-culture routing + a little rename/refactor
* Make the by route controller handle root nodes
* Rename Url to Path in API content output
* Add a few comments for magic route creation
* Rename services from "Default" to "Noop"
* Ensure that Umbraco can boot without adding "AddContentApi()" to ConfigureServices
* Moved incorrectly placed media builder
* Fix API routes (#13915)
* Fix multi URL picker value converter trying to access disposed objects in edge cases
* Delivery API: Content routing and structure (#13984)
* Introduce content route instead of content path, rename and rework start item (previously start node) handling
* Strip out start node path in generated route path
* Make the start-item header take precedence over the request domain
* Conditionally enabling the delivery API + add protection and preview support + refactor all services to be singletons + ensure no-op implementations for all required services (#13992)
* Include umbraco properties (width, height, ...) in the Media Properties collection (#14023)
* Move umbraco properties (width, height, ...) to the Properties collection of the API Media model
* Don't output the umbracoFile property of media items
* Add content type deny list (#14025)
* Create a deny list of content types and utilize it for output generation
* Add unit tests
* Dedicated property cache level for Content API (#14027)
* Support redirect tracking (#14033)
* Create a deny list of content types and utilize it for output generation
* Add unit tests
* Handle redirect tracking in the content API
* Include start item routing info for redirects
* Add cultures and their routes to the API output (#14038)
* Create a deny list of content types and utilize it for output generation
* Add unit tests
* Handle redirect tracking in the content API
* Include start item routing info for redirects
* Add culture routes to root output (for HREFLANG support)
* Rename redirect service method to better match its purpose
* Review changes
* Delivery API: Query controller (#14041)
* Initial commit
* Custom ContentAPIFieldDefinitionCollection
* Make index IUmbracoContentIndex
* Add querying for children by parent id (key)
* Add missing interface
* Adding querying endpoint
* Test code
* Compose unpublishedValueSet, so that you get the correct data in the ContentAPI index
* Renaming
* Fix ancestorKeys index values
* Adding IApiQueryExtensionService to be able to query the ContentAPI index in a generic way
* Fix IApiQueryService and clean up QueryContentApiController using it
* Support querying for path
* Fix content API indexing
* Fix default sorting
* Implement concrete QueryOption implementations
* Introduce new ExecuteQuery that uses the Core OptionHandlers
* Implement ExecuteQuery
* Change ExecuteQuery signature and implementation
* Implement demo sorting and fetching
* Add query option handlers and collection builder for them
* Cleanup
* Revert "Conditionally enabling the delivery API + add protection and preview support + refactor all services to be singletons + ensure no-op implementations for all required services (#13992)"
This reverts commit 78e1f748e55383baecd123d06457111e18f13365.
* Revert "Delivery API: Content routing and structure (#13984)"
This reverts commit a0292ae5350362dd6c1c5bc9763deda928c78a75.
* Revert "Fix multi URL picker value converter trying to access disposed objects in edge cases"
This reverts commit 6b7c37a5bf7871bee93a2b2640bbc6ef591f14db.
* Revert "Conditionally enabling the delivery API + add protection and preview support + refactor all services to be singletons + ensure no-op implementations for all required services (#13992)"
This reverts commit 78e1f748e55383baecd123d06457111e18f13365.
* Revert "Delivery API: Content routing and structure (#13984)"
This reverts commit a0292ae5350362dd6c1c5bc9763deda928c78a75.
* Revert "Fix multi URL picker value converter trying to access disposed objects in edge cases"
This reverts commit 6b7c37a5bf7871bee93a2b2640bbc6ef591f14db.
* Fix multi URL picker value converter trying to access disposed objects in edge cases
* Delivery API: Content routing and structure (#13984)
* Introduce content route instead of content path, rename and rework start item (previously start node) handling
* Strip out start node path in generated route path
* Make the start-item header take precedence over the request domain
* Conditionally enabling the delivery API + add protection and preview support + refactor all services to be singletons + ensure no-op implementations for all required services (#13992)
* Test commit
* Refactored interfaces for the query handlers and for the selectors (that will handle the value of the fetch query option)
* Implemented a base class for the query options
* Refactored the names of the selectors and made use of the base class
* Refactored the ApiQueryService
* Refactored the QueryContentApiController.cs
* Conditionally enabling the delivery API + add protection and preview support + refactor all services to be singletons + ensure no-op implementations for all required services (#13992)
* Fixing merge gone wrong
* Fix multi URL picker value converter trying to access disposed objects in edge cases
* Delivery API: Content routing and structure (#13984)
* Introduce content route instead of content path, rename and rework start item (previously start node) handling
* Strip out start node path in generated route path
* Make the start-item header take precedence over the request domain
* Conditionally enabling the delivery API + add protection and preview support + refactor all services to be singletons + ensure no-op implementations for all required services (#13992)
* Make fetching work with the new setup
* Moving files to dedicated folders
* Removing ? for array
* Rename selector query method
* Implement FilterHandler and some filters
* Implement SortHandler and sort some sorts
* Refactoring
* Adding more fields to index due to querying
* Appending filtering and sorting queries
* Implementing a new ISelectorHandler without Examine types
* Re-implementing the collection to have a dedicated one for the selectors
* Implementing a new IFilterHandler without Examine types & refactoring the filters implementing it
* Adding a new collection dedicated to filters
* Renaming the old collection
* Implementing a new ISortHandler without Examine types & refactoring the sorts implementing it
* Adding a new collection for the sorts & adding all collections to UmbracoBuilder.Collections
* Refactoring the service to use the new collections and types
* Refactoring the fields in ContentApiFieldDefinitionCollection
* Remove nullability in Handlers
* Don't return null for selector
* Add TODO for having the filters support negation
* Changing the SortType to FieldType with our custom types on the SortOption
* Fix AncestorsSelector
* Fix ApiQueryService
* Documentation
* Fix Swagger docs
* Refactor the QueryContentApiController
* Adding handling for the IApiContentResponse in the JsonTypeResolver
* Refactor the service to use a safe fallback value in Examine queries
* Adding Noop for the IApiQueryService
* Cleanup
* Remove comment
* Fix name field for indexing
* Don't inherit QueryOptionBase in filters
* Fix casing for API index constant + swap FIXME with TODO
* Add TODO for handling missing fetch with start-item header
* Rename query handler parameters to not leak source (i.e. query string)
---------
Co-authored-by: kjac <kja@umbraco.dk>
Co-authored-by: Elitsa <>
Co-authored-by: Zeegaan <nge@umbraco.dk>
* Delivery API: Adding pagination to query endpoint (#14083)
* Adding pagination to query endpoint
* Optimize the paging using Examine directly
* Fix comment
* Remove skip/take code duplication
---------
Co-authored-by: kjac <kja@umbraco.dk>
* Add missing CompatibilitySuppressions.xml
* Make Delivery API packable
* Make Api.Common packable
* Renamed extension method and namespace so it is discoverable
* Untangle ApiVersion configuration into api.common, so delivery api do not require the management api to boot.
* configure options in management api
* RTE output as JSON for Content API (#14067)
* Conditionally serve RTE output as JSON instead of HTML
* Fixed merge
* Rename to Delivery API (#14119)
* Rename ContentApi to DeliveryApi
* Rename delivery API index implementation
* Update comments from "Content API" to "Delivery API"
* Rename project from Content to Delivery
* Add dedicated controller base for content delivery API
* Rename delivery API content index to include "content" specifically
* Fix compat suppressions
---------
Co-authored-by: kjac <kja@umbraco.dk>
Co-authored-by: Elitsa Marinovska <21998037+elit0451@users.noreply.github.com>
Co-authored-by: Zeegaan <nge@umbraco.dk>
2023-04-19 11:21:31 +02:00
|
|
|
builder.Services.AddSingleton<IApiPublishedContentCache, ApiPublishedContentCache>();
|
2023-05-24 08:02:42 +02:00
|
|
|
builder.Services.AddSingleton<IApiRichTextElementParser, ApiRichTextElementParser>();
|
|
|
|
|
builder.Services.AddSingleton<IApiRichTextMarkupParser, ApiRichTextMarkupParser>();
|
2023-06-21 08:32:57 +02:00
|
|
|
builder.Services.AddSingleton<IApiPropertyRenderer, ApiPropertyRenderer>();
|
Content Delivery API (#14051)
* Add the core parts of the headless PoC
* Add Content API project (WIP - loads of TODOs and dupes that need to be fixed!)
* Rename the content API project and namespaces
* Fixed bad merge
* Rename everything "Headless" to "ContentApi" or "Api"
* Refactor Content + Media: Key => Id, Name not nullable
* Make Content API property return value types independent of datatype configuration
* Clean up refactorings
* First stab at an expansion strategy using content picker as example implementation
* Use named JSON options for content API serialization
* Proper inclusion and registration of the content API
* Introduce API media builder
* Make MNTP return API content/media depending on configuration (instead of links) and support output expansion
* Content API: Get by controllers (#13740)
* Adding ContentApiControllerBase
* Adding get by id and url controllers
* Change route of get all test controller
* Rename to ContentApiController
* Refactoring
* Removing test controller
* Content API: Add start-node header value to deal with url collisions (#13746)
* Use start-node header value to deal with url collisions
* Cleanup
* Rename "url" param to "path"
* Adding a start node service to get the start-node header value
* Trim '/' from both beginning and end
* Content API: Support Accept-Language header (#13831)
* Move the content API JSON type resolver to an appropriate namespace
* Add localization based on Accept-Language header
* Content API: Output expansion (#13848)
* Implement request based output expansion strategy + expansion output cache at property level
* Slighty leaner implementation for default output expansion strategy
* Clarify the code a bit
* Fix bad merge
* Encapsulate content API dependencies in the DI
* Support multi-site and multi-culture routing + a little rename/refactor (#13882)
* Support multi-site and multi-culture routing + a little rename/refactor
* Make the by route controller handle root nodes
* Rename Url to Path in API content output
* Add a few comments for magic route creation
* Rename services from "Default" to "Noop"
* Ensure that Umbraco can boot without adding "AddContentApi()" to ConfigureServices
* Moved incorrectly placed media builder
* Fix API routes (#13915)
* Fix multi URL picker value converter trying to access disposed objects in edge cases
* Delivery API: Content routing and structure (#13984)
* Introduce content route instead of content path, rename and rework start item (previously start node) handling
* Strip out start node path in generated route path
* Make the start-item header take precedence over the request domain
* Conditionally enabling the delivery API + add protection and preview support + refactor all services to be singletons + ensure no-op implementations for all required services (#13992)
* Include umbraco properties (width, height, ...) in the Media Properties collection (#14023)
* Move umbraco properties (width, height, ...) to the Properties collection of the API Media model
* Don't output the umbracoFile property of media items
* Add content type deny list (#14025)
* Create a deny list of content types and utilize it for output generation
* Add unit tests
* Dedicated property cache level for Content API (#14027)
* Support redirect tracking (#14033)
* Create a deny list of content types and utilize it for output generation
* Add unit tests
* Handle redirect tracking in the content API
* Include start item routing info for redirects
* Add cultures and their routes to the API output (#14038)
* Create a deny list of content types and utilize it for output generation
* Add unit tests
* Handle redirect tracking in the content API
* Include start item routing info for redirects
* Add culture routes to root output (for HREFLANG support)
* Rename redirect service method to better match its purpose
* Review changes
* Delivery API: Query controller (#14041)
* Initial commit
* Custom ContentAPIFieldDefinitionCollection
* Make index IUmbracoContentIndex
* Add querying for children by parent id (key)
* Add missing interface
* Adding querying endpoint
* Test code
* Compose unpublishedValueSet, so that you get the correct data in the ContentAPI index
* Renaming
* Fix ancestorKeys index values
* Adding IApiQueryExtensionService to be able to query the ContentAPI index in a generic way
* Fix IApiQueryService and clean up QueryContentApiController using it
* Support querying for path
* Fix content API indexing
* Fix default sorting
* Implement concrete QueryOption implementations
* Introduce new ExecuteQuery that uses the Core OptionHandlers
* Implement ExecuteQuery
* Change ExecuteQuery signature and implementation
* Implement demo sorting and fetching
* Add query option handlers and collection builder for them
* Cleanup
* Revert "Conditionally enabling the delivery API + add protection and preview support + refactor all services to be singletons + ensure no-op implementations for all required services (#13992)"
This reverts commit 78e1f748e55383baecd123d06457111e18f13365.
* Revert "Delivery API: Content routing and structure (#13984)"
This reverts commit a0292ae5350362dd6c1c5bc9763deda928c78a75.
* Revert "Fix multi URL picker value converter trying to access disposed objects in edge cases"
This reverts commit 6b7c37a5bf7871bee93a2b2640bbc6ef591f14db.
* Revert "Conditionally enabling the delivery API + add protection and preview support + refactor all services to be singletons + ensure no-op implementations for all required services (#13992)"
This reverts commit 78e1f748e55383baecd123d06457111e18f13365.
* Revert "Delivery API: Content routing and structure (#13984)"
This reverts commit a0292ae5350362dd6c1c5bc9763deda928c78a75.
* Revert "Fix multi URL picker value converter trying to access disposed objects in edge cases"
This reverts commit 6b7c37a5bf7871bee93a2b2640bbc6ef591f14db.
* Fix multi URL picker value converter trying to access disposed objects in edge cases
* Delivery API: Content routing and structure (#13984)
* Introduce content route instead of content path, rename and rework start item (previously start node) handling
* Strip out start node path in generated route path
* Make the start-item header take precedence over the request domain
* Conditionally enabling the delivery API + add protection and preview support + refactor all services to be singletons + ensure no-op implementations for all required services (#13992)
* Test commit
* Refactored interfaces for the query handlers and for the selectors (that will handle the value of the fetch query option)
* Implemented a base class for the query options
* Refactored the names of the selectors and made use of the base class
* Refactored the ApiQueryService
* Refactored the QueryContentApiController.cs
* Conditionally enabling the delivery API + add protection and preview support + refactor all services to be singletons + ensure no-op implementations for all required services (#13992)
* Fixing merge gone wrong
* Fix multi URL picker value converter trying to access disposed objects in edge cases
* Delivery API: Content routing and structure (#13984)
* Introduce content route instead of content path, rename and rework start item (previously start node) handling
* Strip out start node path in generated route path
* Make the start-item header take precedence over the request domain
* Conditionally enabling the delivery API + add protection and preview support + refactor all services to be singletons + ensure no-op implementations for all required services (#13992)
* Make fetching work with the new setup
* Moving files to dedicated folders
* Removing ? for array
* Rename selector query method
* Implement FilterHandler and some filters
* Implement SortHandler and sort some sorts
* Refactoring
* Adding more fields to index due to querying
* Appending filtering and sorting queries
* Implementing a new ISelectorHandler without Examine types
* Re-implementing the collection to have a dedicated one for the selectors
* Implementing a new IFilterHandler without Examine types & refactoring the filters implementing it
* Adding a new collection dedicated to filters
* Renaming the old collection
* Implementing a new ISortHandler without Examine types & refactoring the sorts implementing it
* Adding a new collection for the sorts & adding all collections to UmbracoBuilder.Collections
* Refactoring the service to use the new collections and types
* Refactoring the fields in ContentApiFieldDefinitionCollection
* Remove nullability in Handlers
* Don't return null for selector
* Add TODO for having the filters support negation
* Changing the SortType to FieldType with our custom types on the SortOption
* Fix AncestorsSelector
* Fix ApiQueryService
* Documentation
* Fix Swagger docs
* Refactor the QueryContentApiController
* Adding handling for the IApiContentResponse in the JsonTypeResolver
* Refactor the service to use a safe fallback value in Examine queries
* Adding Noop for the IApiQueryService
* Cleanup
* Remove comment
* Fix name field for indexing
* Don't inherit QueryOptionBase in filters
* Fix casing for API index constant + swap FIXME with TODO
* Add TODO for handling missing fetch with start-item header
* Rename query handler parameters to not leak source (i.e. query string)
---------
Co-authored-by: kjac <kja@umbraco.dk>
Co-authored-by: Elitsa <>
Co-authored-by: Zeegaan <nge@umbraco.dk>
* Delivery API: Adding pagination to query endpoint (#14083)
* Adding pagination to query endpoint
* Optimize the paging using Examine directly
* Fix comment
* Remove skip/take code duplication
---------
Co-authored-by: kjac <kja@umbraco.dk>
* Add missing CompatibilitySuppressions.xml
* Make Delivery API packable
* Make Api.Common packable
* Renamed extension method and namespace so it is discoverable
* Untangle ApiVersion configuration into api.common, so delivery api do not require the management api to boot.
* configure options in management api
* RTE output as JSON for Content API (#14067)
* Conditionally serve RTE output as JSON instead of HTML
* Fixed merge
* Rename to Delivery API (#14119)
* Rename ContentApi to DeliveryApi
* Rename delivery API index implementation
* Update comments from "Content API" to "Delivery API"
* Rename project from Content to Delivery
* Add dedicated controller base for content delivery API
* Rename delivery API content index to include "content" specifically
* Fix compat suppressions
---------
Co-authored-by: kjac <kja@umbraco.dk>
Co-authored-by: Elitsa Marinovska <21998037+elit0451@users.noreply.github.com>
Co-authored-by: Zeegaan <nge@umbraco.dk>
2023-04-19 11:21:31 +02:00
|
|
|
|
|
|
|
|
return builder;
|
|
|
|
|
}
|
2019-01-03 21:00:28 +01:00
|
|
|
}
|