public void Configure(FubuRegistry registry) { registry.Policies.Global.Add<ApplyScheduledJobRouting>(); registry.Services<ScheduledJobServicesRegistry>(); registry.Services<MonitoringServiceRegistry>(); registry.Policies.Global.Add<RegisterScheduledJobs>(); registry.Policies.ChainSource<ImportHandlers>(); registry.Services<FubuTransportServiceRegistry>(); registry.Services<PollingServicesRegistry>(); registry.Policies.Global.Add<RegisterPollingJobs>(); registry.Policies.Global.Add<StatefulSagaConvention>(); registry.Policies.Global.Add<AsyncHandlingConvention>(); if (FubuTransport.AllQueuesInMemory) { registry.Policies.Global.Add<AllQueuesInMemoryPolicy>(); } registry.Policies.Global.Add<InMemoryQueueRegistration>(); registry.Policies.Global.Add<ReorderBehaviorsPolicy>(x => { x.ThisNodeMustBeBefore<StatefulSagaNode>(); x.ThisNodeMustBeAfter<HandlerCall>(); }); }
public void Configure(FubuRegistry registry) { registry.Services(s => s.AddService<IAssetPrecompiler, RequireJsAssetPrecompiler>()); var requireJsAssetRegistry = new RequireJsAssetRegistry(); registry.Services(s => s.SetServiceIfNone<IRequireJsAssetRegistry>(requireJsAssetRegistry)); _actions.Each(x => x(registry)); }
public void Configure(FubuRegistry registry) { registry.Services(x => x.SetServiceIfNone<IQueryService, QueryService>()); registry.Services(x => x.SetServiceIfNone<ISmartGridService, SmartGridService>()); registry.Models .BindModelsWith<EditEntityModelBinder>() .BindModelsWith<EntityModelBinder>() .ConvertUsing<EntityConversionFamily>(); }
void IFubuRegistryExtension.Configure(FubuRegistry registry) { registry.Actions.FindWith<TwitterEndpoints>(); registry.Services<TwitterServiceRegistry>(); registry.Policies.Add<AttachDefaultTwitterView>(); registry.Services(x => x.SetServiceIfNone(_settings)); registry.Extensions().For(new TwitterContentExtension()); }
void IFubuRegistryExtension.Configure(FubuRegistry registry) { registry.Services<BasicLocalizationServices>(); if(_modifications.Any()) { registry.Services(x => _modifications.Each(modify => modify(x))); } registry.Import<HtmlConventionRegistry>(x => x.Labels.Add(new LabelBuilder())); }
public void Configure(FubuRegistry registry) { registry.Services(x => { x.Scan(y => { y.Applies.ToAllPackageAssemblies(); y.Applies.ToThisAssembly(); y.Applies.ToAssemblyContainingType(registry.GetType()); y.Applies.ToAssemblyContainingType<ICmsEndpoint>(); y.AddAllTypesOf<ICmsComponent>(); y.AddAllTypesOf<ICmsEndpoint>(); y.AddAllTypesOf<ITheme>(); y.AddAllTypesOf<ICmsViewEngine>(); y.AddAllTypesOf<ITextParser>(); y.AddAllTypesOf<IParseModelExpression>(); y.ConnectImplementationsToTypesClosing(typeof(ICmsRenderer<>)); }); x.SetServiceIfNone<ICmsRenderer, DefaultCmsRenderer>(); x.SetServiceIfNone<IFindParameterValueFromModel, DefaultParameterValueFinder>(); x.SetServiceIfNone<ITemplateStorage, DefaultTemplateStorage>(); }); registry.Policies.Add<ConfigureWidgetBehaviorChain>(); }
public void register_with_basic_authentication_disabled() { var registry = new FubuRegistry(); registry.Import<Saml2Extensions>(); registry.Import<ApplyAuthentication>(); var samlCertificateRepository = MockRepository.GenerateMock<ISamlCertificateRepository>(); samlCertificateRepository.Stub(x => x.AllKnownCertificates()).Return(new SamlCertificate[0]); registry.Services(x => { x.SetServiceIfNone<IPrincipalBuilder>(MockRepository.GenerateMock<IPrincipalBuilder>()); x.AddService<ISamlResponseHandler>(MockRepository.GenerateMock<ISamlResponseHandler>()); x.SetServiceIfNone<ISamlCertificateRepository>(samlCertificateRepository); }); registry.AlterSettings<AuthenticationSettings>(x => { x.MembershipEnabled = MembershipStatus.Disabled; }); var container = new Container(); var runtime = FubuApplication.For(registry).StructureMap(container).Bootstrap(); var strategies = container.GetAllInstances<IAuthenticationStrategy>(); strategies.Single().ShouldBeOfType<SamlAuthenticationStrategy>(); }
public void Configure(FubuRegistry registry) { registry.Services(x => { x.AddService<IActivator, NowinHostingActivator>(); x.AddService<IDeactivator, KatanaHostingDeactivator>(); }); }
public void Configure(FubuRegistry registry) { registry.Actions.FindWith<WindowsActionSource>(); registry.Services<WindowsRegistry>(); registry.Extensions().For(new WindowsLoginExtension()); }
public void SetUp() { var registry = new FubuRegistry(); registry.Services<ResourcesServiceRegistry>(); theServices = BehaviorGraph.BuildFrom(registry).Services; }
public void configures_settings_with_default_assemblies_and_namespaces() { var registry = new FubuRegistry(); registry.WithSparkDefaults(); SparkSettings settings = null; registry.Services(x => { settings = (SparkSettings) x.DefaultServiceFor<ISparkSettings>().Value; }); registry.BuildGraph(); settings .UseAssemblies .ShouldContain(typeof(HtmlTag).Assembly.FullName); settings .UseAssemblies .ShouldContain(typeof(FubuPageExtensions).Assembly.FullName); settings .UseNamespaces .ShouldContain(typeof(FubuRegistryExtensions).Namespace); settings .UseNamespaces .ShouldContain(typeof(FubuPageExtensions).Namespace); settings .UseNamespaces .ShouldContain(typeof(HtmlTag).Namespace); }
public void UseFakeSecurityContext(FubuRegistry registry) { if (FakeSecurityContext == null) { FakeSecurityContext = new FakeSecurityContext(); } registry.Services(serviceRegistry => serviceRegistry.ReplaceService<ISecurityContext>(FakeSecurityContext)); }
public void Configure(FubuRegistry registry) { registry.Services<ServerSentEventRegistry>(); registry.Actions.FindWith<TopicActions>(); registry.Routes.UrlPolicy<TopicUrls>(); }
public void Configure(FubuRegistry registry) { locateTemplates(); registry.Views.Facility(new SparkViewFacility(_composer)); registry.Services(configureServices); }
public void Configure(FubuRegistry registry) { registry.Policies.Add<MenuItemAttributeConfigurator>(); registry.Policies.Add<CompileNavigationStep>(); registry.Services<NavigationServiceRegistry>(); }
void IFubuRegistryExtension.Configure(FubuRegistry registry) { registry.Actions.FindWith<GoogleEndpoints>(); registry.Services<GoogleServiceRegistry>(); registry.Policies.Add<AttachDefaultGoogleView>(); registry.Extensions().For(new OAuth2ContentExtension<GoogleLoginRequest>()); }
public void Configure(FubuRegistry registry) { registry.Policies.Add<ApplyTracing>(); registry.Policies.Add<DescriptionVisualizationPolicy>(); registry.Policies.Add<DiagnosticChainsPolicy>(); registry.Services<DiagnosticServiceRegistry>(); registry.Configure(graph => { var settings = graph.Settings.Get<DiagnosticsSettings>(); if (settings.TraceLevel == TraceLevel.Verbose) { graph.Services.Clear(typeof(IBindingLogger)); graph.Services.AddService<IBindingLogger, RecordingBindingLogger>(); graph.Services.Clear(typeof(IBindingHistory)); graph.Services.AddService<IBindingHistory, BindingHistory>(); graph.Services.AddService<ILogListener, RequestTraceListener>(); } if (settings.TraceLevel == TraceLevel.Production) { graph.Services.AddService<ILogListener, ProductionModeTraceListener>(); } }); registry.Policies.Add<DefaultHome>(); }
public void Configure(FubuRegistry registry) { MimeType.New("text/jsx", ".jsx"); registry.Services<DiagnosticServiceRegistry>(); registry.AlterSettings<AssetSettings>(x => x.AllowableExtensions.Add(".jsx")); registry.AlterSettings<DiagnosticsSettings>(x => { x.TraceLevel = TraceLevel.Verbose; }); registry.Configure(graph => { var settings = graph.Settings.Get<DiagnosticsSettings>(); if (settings.TraceLevel == TraceLevel.Verbose) { graph.Services.Clear(typeof (IBindingLogger)); graph.Services.AddService<IBindingLogger, RecordingBindingLogger>(); graph.Services.Clear(typeof (IBindingHistory)); graph.Services.AddService<IBindingHistory, BindingHistory>(); graph.Services.AddService<ILogListener, RequestTraceListener>(); } if (settings.TraceLevel == TraceLevel.Production) { graph.Services.AddService<ILogListener, ProductionModeTraceListener>(); } }); }
public void SetUp() { var registry = new FubuRegistry(); registry.Services<ServerSentEventRegistry>(); services = BehaviorGraph.BuildFrom(registry).Services; }
protected override void configure(FubuRegistry registry) { registry.Actions.IncludeType<ActivationEndpoint>(); registry.Services(x => { x.SetServiceIfNone<IActivationRenderer, ActivationRenderer>(); }); }
public void Configure(FubuRegistry registry) { registry.Policies.Add<SamlResponseValidationRulesRegistration>(); registry.Policies.Add<Saml2AuthenticationRegistration>(); registry.Services<Saml2ServicesRegistry>(); }
public void Configure(FubuRegistry registry) { registry.Services(x => x.SetServiceIfNone<IEndpointConfigurationStorage, DefaultEndpointConfigurationStorage>()); registry.Policies.Add(x => { x.Where.ResourceTypeImplements<ICmsEndpointInput>(); x.ModifyBy(y => y.Output.AddWriter(typeof(CmsEndpointWriter<>).MakeGenericType(y.ResourceType()))); }); }
void IFubuRegistryExtension.Configure(FubuRegistry registry) { registry.ViewFacility(new RazorViewFacility(_templateRegistry, _parsings)); registry.Services(configureServices); registry.AlterSettings<CommonViewNamespaces>(x => { x.AddForType<RazorViewFacility>(); // FubuMVC.Razor x.AddForType<IPartialInvoker>(); // FubuMVC.Core.UI }); }
void IFubuRegistryExtension.Configure(FubuRegistry registry) { registry.Policies.Add<RegisterAuthenticationStrategies>(); registry.Services<AuthenticationServiceRegistry>(); registry.Policies.Add(new ApplyAuthenticationPolicy()); registry.Policies.Add<FormsAuthenticationEndpointsRegistration>(); registry.Policies.Add<AttachDefaultLoginView>(); registry.Policies.Add<AddDefaultMembershipAuthentication>(); }
public void ConfigureRegistry(FubuRegistry registry) { registry.Services(x => { var handler = x.SetServiceIfNone(typeof (IValidationFailureHandler), typeof (ValidationFailureHandler)); handler.Dependencies.Add(_policies); }); registry .ApplyConvention(new ValidationConvention(_callMatcher.CallFilters.Matches)); }
public void Configure(FubuRegistry registry) { registry.ApplyConvention<AuthorizationConvention>(); registry.Navigation<AuthorizationNavigationRegistry>(); registry.Services(x => { x.ReplaceService<IAuthorizationFailureHandler,AuthorizationFailureHandler>(); }); }
public void Configure(FubuRegistry registry) { var minifierPolicy = JavascriptTransformerPolicy<MinifierTransformer> .For(ActionType.Transformation, MimeType.Javascript.DefaultExtension()); registry.Services(s => { s.AddService<ITransformerPolicy>(minifierPolicy); s.SetServiceIfNone<IMinifier>(new UglifyMinifier()); }); }
protected override void configure(FubuRegistry registry) { registry.Actions.IncludeType<CreateUserEndpoint>(); registry.Import<FubuMvcValidation>(); theUserService = new UserService(); registry.Services(r => r.SetServiceIfNone<IUserService>(theUserService)); var rule = RemoteFieldRule.For(ReflectionHelper.GetAccessor<CreateUser>(x => x.Username), new UniqueUsernameRule()); theField = new ValidateField { Hash = rule.ToHash(), Value = "joel_arnold" }; theUserService.AddUser(theField.Value); }
public void Configure(FubuRegistry registry) { registry.ViewFacility(new WebFormViewFacility()); registry.Services(x => { x.SetServiceIfNone<IWebFormRenderer, WebFormRenderer>(); x.SetServiceIfNone<IWebFormsControlBuilder, WebFormsControlBuilder>(); x.SetServiceIfNone<IPartialRenderer, PartialRenderer>(); x.SetServiceIfNone<IPartialViewTypeRegistry>(new PartialViewTypeRegistry()); }); }
void IFubuRegistryExtension.Configure(FubuRegistry registry) { registry.Services<FubuValidationServiceRegistry>(); registry.Services<FubuMvcValidationServices>(); registry.Actions.FindWith<RemoteRulesSource>(); registry.Actions.FindWith<ValidationSummarySource>(); registry.Actions.FindWith<ValidationDiagnosticsSource>(); registry.Import<HtmlConventionRegistry>(x => { x.Editors.Add(new FieldValidationElementModifier()); x.Editors.Add(new RemoteValidationElementModifier()); x.Editors.Add(new DateElementModifier()); x.Editors.Add(new NumberElementModifier()); x.Editors.Add(new MaximumLengthModifier()); x.Editors.Add(new MinimumLengthModifier()); x.Editors.Add(new RangeLengthModifier()); x.Editors.Add(new MinValueModifier()); x.Editors.Add(new MaxValueModifier()); x.Editors.Add(new LocalizationLabelModifier()); x.Editors.Add(new RegularExpressionModifier()); x.Forms.Add(new FormValidationSummaryModifier()); x.Forms.Add(new FormValidationModifier()); x.Forms.Add(new FieldEqualityFormModifier()); x.Forms.Add(new NotificationSerializationModifier()); }); registry.Policies.Add<ValidationConvention>(); registry.Policies.Add<AttachDefaultValidationSummary>(); registry.Policies.Add<RegisterRemoteRuleQuery>(); registry.AlterSettings<ValidationSettings>(settings => { settings .Remotes .FindWith<RemoteRuleAttributeFilter>() .FindWith<RemoteFieldValidationRuleFilter>(); }); }