public void Compose(IUmbracoBuilder builder) { builder.Services.AddUnique <RedirectsServiceDependencies>(); builder.Services.AddUnique <RedirectsBackOfficeHelperDependencies>(); builder.Services.AddUnique <IRedirectsService, RedirectsService>(); builder.Services.AddUnique <RedirectsBackOfficeHelper>(); builder.ContentApps().Append <RedirectsContentAppFactory>(); builder.AddNotificationHandler <ServerVariablesParsingNotification, ServerVariablesParsingHandler>(); builder.AddNotificationHandler <UmbracoApplicationStartingNotification, UmbracoApplicationStartingHandler>(); builder.Services.Configure <UmbracoPipelineOptions>(options => { options.AddFilter(new UmbracoPipelineFilter( "SkybrudRedirects", _ => { }, applicationBuilder => { applicationBuilder.UseMiddleware <RedirectsMiddleware>(); }, _ => { } )); }); builder.DataValueReferenceFactories().Append <OutboundRedirectReferenceFactory>(); }
/// <summary> /// Adds all core collection builders /// </summary> internal static void AddAllCoreCollectionBuilders(this IUmbracoBuilder builder) { builder.CacheRefreshers()?.Add(() => builder.TypeLoader.GetCacheRefreshers()); builder.DataEditors()?.Add(() => builder.TypeLoader.GetDataEditors()); builder.Actions()?.Add(() => builder.TypeLoader.GetActions()); // register known content apps builder.ContentApps()? .Append <ListViewContentAppFactory>() .Append <ContentEditorContentAppFactory>() .Append <ContentInfoContentAppFactory>() .Append <ContentTypeDesignContentAppFactory>() .Append <ContentTypeListViewContentAppFactory>() .Append <ContentTypePermissionsContentAppFactory>() .Append <ContentTypeTemplatesContentAppFactory>() .Append <MemberEditorContentAppFactory>() .Append <DictionaryContentAppFactory>(); // all built-in finders in the correct order, // devs can then modify this list on application startup builder.ContentFinders()? .Append <ContentFinderByPageIdQuery>() .Append <ContentFinderByUrl>() .Append <ContentFinderByIdPath>() /*.Append<ContentFinderByUrlAndTemplate>() // disabled, this is an odd finder */ .Append <ContentFinderByUrlAlias>() .Append <ContentFinderByRedirectUrl>(); builder.EditorValidators()?.Add(() => builder.TypeLoader.GetTypes <IEditorValidator>()); builder.HealthChecks()?.Add(() => builder.TypeLoader.GetTypes <HealthCheck>()); builder.HealthCheckNotificationMethods()?.Add(() => builder.TypeLoader.GetTypes <IHealthCheckNotificationMethod>()); builder.TourFilters(); builder.UrlProviders()? .Append <AliasUrlProvider>() .Append <DefaultUrlProvider>(); builder.MediaUrlProviders()? .Append <DefaultMediaUrlProvider>(); // register back office sections in the order we want them rendered builder.Sections()? .Append <ContentSection>() .Append <MediaSection>() .Append <SettingsSection>() .Append <PackagesSection>() .Append <UsersSection>() .Append <MembersSection>() .Append <FormsSection>() .Append <TranslationSection>(); builder.Components(); // register core CMS dashboards and 3rd party types - will be ordered by weight attribute & merged with package.manifest dashboards builder.Dashboards()? .Add <ContentDashboard>() .Add <ExamineDashboard>() .Add <FormsDashboard>() .Add <HealthCheckDashboard>() .Add <ManifestDashboard>() .Add <MediaDashboard>() .Add <MembersDashboard>() .Add <ProfilerDashboard>() .Add <PublishedStatusDashboard>() .Add <RedirectUrlDashboard>() .Add <SettingsDashboard>() .Add(builder.TypeLoader.GetTypes <IDashboard>()); builder.DataValueReferenceFactories(); builder.PropertyValueConverters()?.Append(builder.TypeLoader.GetTypes <IPropertyValueConverter>()); builder.UrlSegmentProviders()?.Append <DefaultUrlSegmentProvider>(); builder.ManifestValueValidators()? .Add <RequiredValidator>() .Add <RegexValidator>() .Add <DelimitedValueValidator>() .Add <EmailValidator>() .Add <IntegerValidator>() .Add <DecimalValidator>(); builder.ManifestFilters(); builder.MediaUrlGenerators(); // register OEmbed providers - no type scanning - all explicit opt-in of adding types, IEmbedProvider is not IDiscoverable builder.EmbedProviders()? .Append <YouTube>() .Append <Twitter>() .Append <Vimeo>() .Append <DailyMotion>() .Append <Flickr>() .Append <Slideshare>() .Append <Kickstarter>() .Append <GettyImages>() .Append <Ted>() .Append <Soundcloud>() .Append <Issuu>() .Append <Hulu>() .Append <Giphy>() .Append <LottieFiles>(); builder.SearchableTrees()?.Add(() => builder.TypeLoader.GetTypes <ISearchableTree>()); builder.BackOfficeAssets(); }
/// <summary> /// Register a content app. /// </summary> /// <typeparam name="T">The type of the content app.</typeparam> /// <param name="builder">The builder.</param> public static IUmbracoBuilder AddContentApp <T>(this IUmbracoBuilder builder) where T : class, IContentAppFactory { builder.ContentApps().Append <T>(); return(builder); }