コード例 #1
0
        public void SetUp()
        {
            graph = new FubuRegistry().BuildGraph();
            urls = MockRepository.GenerateMock<IUrlRegistry>();

            writer = new BehaviorGraphWriter(graph, urls, null, new StubCurrentHttpRequest("http://server"));
        }
コード例 #2
0
 public KatanaHostingActivator(KatanaSettings settings, FubuRouteTable routes, IUrlRegistry urls, IServiceLocator services)
 {
     _settings = settings;
     _routes = routes.Routes;
     _urls = urls;
     _services = services;
 }
コード例 #3
0
 public KatanaHostingActivator(KatanaSettings settings, FubuRouteTable routes, IUrlRegistry urls, IServiceLocator services)
 {
     _settings = settings;
     _routes   = routes.Routes;
     _urls     = urls;
     _services = services;
 }
 public BootstrapAuthorizationFailureHandler(IOutputWriter writer, IRequestData requestData, IUrlRegistry urlRegistry, IHttpRequest currentHttpRequest)
 {
     _writer = writer;
     _requestData = requestData;
     _urlRegistry = urlRegistry;
     _currentHttpRequest = currentHttpRequest;
 }
コード例 #5
0
 public AjaxAuthenticationRedirect(IRequestData data, IJsonWriter jsonWriter, IOutputWriter outputWriter, IUrlRegistry urls)
 {
     _data         = data;
     _jsonWriter   = jsonWriter;
     _outputWriter = outputWriter;
     _urls         = urls;
 }
コード例 #6
0
 public ResourceAction(ConnegActionFinder connegActionActionFinder, ActionCallMapper actionCallMapper, IUrlRegistry urlRegistry, ICurrentHttpRequest currentHttpRequest)
 {
     _connegActionActionFinder = connegActionActionFinder;
     _actionCallMapper = actionCallMapper;
     _urlRegistry = urlRegistry;
     _currentHttpRequest = currentHttpRequest;
 }
コード例 #7
0
 public ExampleHtmlWriter(IServiceLocator serviceLocator, IUrlRegistry urlRegistry, BehaviorGraph behaviorGraph)
 {
     _serviceLocator = serviceLocator;
     _urlRegistry    = urlRegistry;
     _behaviorGraph  = behaviorGraph;
     _examplePageUrl = "_fubu/html/example".ToAbsoluteUrl();
 }
コード例 #8
0
        public void SetUp()
        {
            graph = new FubuRegistry(x => { x.Applies.ToThisAssembly(); }).BuildGraph();
            urls = MockRepository.GenerateMock<IUrlRegistry>();

            writer = new BehaviorGraphWriter(graph, urls);
        }
コード例 #9
0
        public void SetUp()
        {
            urls = MockRepository.GenerateMock<IUrlRegistry>();
            page = MockRepository.GenerateMock<IFubuPage>();

            page.Stub(x => x.Urls).Return(urls);
        }
コード例 #10
0
 public CaseController(IRepository repository, FubuHtmlDocument <Case> document, ISqlRunner runner, IUrlRegistry urls)
 {
     _repository = repository;
     _document   = document;
     _runner     = runner;
     _urls       = urls;
 }
コード例 #11
0
 public ExampleHtmlWriter(IServiceLocator serviceLocator, IUrlRegistry urlRegistry, BehaviorGraph behaviorGraph)
 {
     _serviceLocator = serviceLocator;
     _urlRegistry = urlRegistry;
     _behaviorGraph = behaviorGraph;
     _examplePageUrl = "_fubu/html/example".ToAbsoluteUrl();
 }
コード例 #12
0
        public DiagnosticMenuTag(IDiagnosticContext context, ICurrentHttpRequest currentHttpRequest, IUrlRegistry urls) : base("ul")
        {
            AddClass("nav");

            var group = context.CurrentGroup();

            var index = group.Index();
            if (index != null)
            {
                addLink(index, context, currentHttpRequest);
            }
            else
            {
                var url = urls.UrlFor(new GroupRequest {Name = group.Name});
                var li = Add("li");
                li.Add("a").Attr("href", url).Text(group.Name).Attr("title", group.Description);

                if (context.CurrentChain() == null)
                {
                    li.AddClass("active");
                }
            }

            group.Links().Each(x => addLink(x, context, currentHttpRequest));
        }
コード例 #13
0
        public void SetUp()
        {
            graph = new FubuRegistry().BuildGraph();
            urls = MockRepository.GenerateMock<IUrlRegistry>();

            writer = new BehaviorGraphWriter(graph, urls, null);
        }
コード例 #14
0
ファイル: NavigationService.cs プロジェクト: moacap/fubumvc
 public NavigationService(BehaviorGraph graph, ICurrentHttpRequest request, IMenuStateService stateService, IUrlRegistry urls)
 {
     _request      = request;
     _stateService = stateService;
     _urls         = urls;
     _navigation   = graph.Settings.Get <NavigationGraph>();
 }
コード例 #15
0
ファイル: PostHandler.cs プロジェクト: alistair/fubumvc.blog
 public PostHandler(IDocumentDatabase database, ISecurityContext securityContext,
                    IUrlRegistry urlRegistry)
 {
     _database        = database;
     _securityContext = securityContext;
     _urlRegistry     = urlRegistry;
 }
コード例 #16
0
        public RequestLinksTag(RequestLog log, IUrlRegistry urls)
        {
            AddHeader("Chain Details");

            Add("li").Add("a").Id("chain-summary").Attr("href", "#").Text("View Summary");
            Add("li").Add("span/a").Attr("href", urls.UrlFor(new ChainDetailsRequest{Id = log.ChainId})).Text("View Details").AddClass("external").Attr("target", "_blank");
        }
コード例 #17
0
ファイル: SingleContentEndpoint.cs プロジェクト: flq/Rf.Sites
 public SingleContentEndpoint(IRepository<Content> repository, SiteSettings settings, ServerVariables vars, IUrlRegistry reg)
 {
     _repository = repository;
     _settings = settings;
     _vars = vars;
     _reg = reg;
 }
コード例 #18
0
 public ProductNotFoundConvention(IOutputWriter outputWriter, IUrlRegistry urlRegistry, IFubuRequest fubuRequest)
     : base(PartialBehavior.Executes)
 {
     _outputWriter = outputWriter;
     _urlRegistry  = urlRegistry;
     _fubuRequest  = fubuRequest;
 }
コード例 #19
0
 public BehaviorGraphWriter(BehaviorGraph graph, IUrlRegistry urls, IServiceLocator services)
 {
     _graph = graph;
     _urls = urls;
     _services = services;
     _diagnosticsNamespace = GetType().Namespace;
 }
コード例 #20
0
        protected MessagesTableTag(IEnumerable <QueueMessage> messages, IUrlRegistry urls,
                                   Action <TableRowTag> additionalHeaders, Action <TableRowTag, PersistentMessage> additionalColumns)
        {
            _urls = urls;
            AddClass("table");

            AddHeaderRow(row =>
            {
                row.Header("Id");
                row.Header("Status");
                row.Header("Sent At");
                row.Header("Headers");
                if (additionalHeaders != null)
                {
                    additionalHeaders(row);
                }
            });

            messages.Each(message => AddBodyRow(row =>
            {
                AddMessageRow(row, message);
                if (additionalColumns != null)
                {
                    additionalColumns(row, message.InternalMessage);
                }
            }));
        }
コード例 #21
0
		public AjaxAuthenticationRedirect(IRequestData data, IJsonWriter jsonWriter, IOutputWriter outputWriter, IUrlRegistry urls)
		{
			_data = data;
			_jsonWriter = jsonWriter;
			_outputWriter = outputWriter;
			_urls = urls;
		}
コード例 #22
0
ファイル: SamlEndpoint.cs プロジェクト: kalash-/FubuMVC.Saml2
 public SamlEndpoint(IRequestData requestData, SamlResponseRedirector redirector, IUrlRegistry urls, ISamlResponseWriter writer)
 {
     _requestData = requestData;
     _redirector  = redirector;
     _urls        = urls;
     _writer      = writer;
 }
コード例 #23
0
 public SamlEndpoint(IRequestData requestData, SamlResponseRedirector redirector, IUrlRegistry urls, ISamlResponseWriter writer)
 {
     _requestData = requestData;
     _redirector = redirector;
     _urls = urls;
     _writer = writer;
 }
コード例 #24
0
 public DiagnosticBehavior(IDebugReport report, IDebugDetector detector, IActionBehavior inner, IUrlRegistry urls)
 {
     _report   = report;
     _detector = detector;
     _inner    = inner;
     _urls     = urls;
 }
コード例 #25
0
        public static HtmlDocument BuildDocument(IUrlRegistry urls, string title, params HtmlTag[] tags)
        {
            string css = GetDiagnosticCss();

            var realTitle = "FubuMVC: " + title;

            var document = new HtmlDocument();

            document.Title = realTitle;

            var mainDiv = new HtmlTag("div").AddClass("main");

            mainDiv.Add("h2").Text("FubuMVC Diagnostics").Append(buildVersionTag());
            var navBar = mainDiv.Add("div").AddClass("homelink");

            if (urls != null)
            {
                navBar.Append(new LinkTag("Home", urls.UrlFor <BehaviorGraphWriter>(w => w.Index(), null)));
            }
            navBar.Add("span").Text(" > " + title);
            document.Add(mainDiv);

            mainDiv.Append(tags);

            document.AddStyle(css);

            return(document);
        }
コード例 #26
0
 public ProjectEndpoints(IUrlRegistry urls, ITopicTokenCache tokenCache, ISnippetCache cache, AppReloaded reloaded)
 {
     _urls       = urls;
     _tokenCache = tokenCache;
     _cache      = cache;
     _reloaded   = reloaded;
 }
コード例 #27
0
 public DiagnosticBehavior(IDebugReport report, IDebugDetector detector, IActionBehavior inner, IUrlRegistry urls)
 {
     _report = report;
     _detector = detector;
     _inner = inner;
     _urls = urls;
 }
コード例 #28
0
 public BootstrapAuthorizationFailureHandler(IOutputWriter writer, IRequestData requestData, IUrlRegistry urlRegistry, IHttpRequest currentHttpRequest)
 {
     _writer             = writer;
     _requestData        = requestData;
     _urlRegistry        = urlRegistry;
     _currentHttpRequest = currentHttpRequest;
 }
コード例 #29
0
 public AuthenticationRequiredBehavior(ISecurityContext securityContext, IUrlRegistry urlRegistry, IOutputWriter outputWriter)
     : base(PartialBehavior.Ignored)
 {
     _securityContext = securityContext;
     _urlRegistry = urlRegistry;
     _outputWriter = outputWriter;
 }
コード例 #30
0
 public ResourceAction(ConnegActionFinder connegActionActionFinder, ActionCallMapper actionCallMapper, IUrlRegistry urlRegistry, ICurrentHttpRequest currentHttpRequest)
 {
     _connegActionActionFinder = connegActionActionFinder;
     _actionCallMapper         = actionCallMapper;
     _urlRegistry        = urlRegistry;
     _currentHttpRequest = currentHttpRequest;
 }
コード例 #31
0
 public FeedWriter(IFeedDefinition <T> definition, ILinkSource <T> links, IUrlRegistry urls, IOutputWriter writer)
 {
     _definition = definition;
     _links      = links;
     _urls       = urls;
     _writer     = writer;
 }
コード例 #32
0
ファイル: NavigationService.cs プロジェクト: aluetjen/fubumvc
 public NavigationService(BehaviorGraph graph, ICurrentHttpRequest request, IMenuStateService stateService, IUrlRegistry urls)
 {
     _request = request;
     _stateService = stateService;
     _urls = urls;
     _navigation = graph.Settings.Get<NavigationGraph>();
 }
コード例 #33
0
        public void SetUp()
        {
            urls = MockRepository.GenerateMock <IUrlRegistry>();
            page = MockRepository.GenerateMock <IFubuPage>();

            page.Stub(x => x.Urls).Return(urls);
        }
コード例 #34
0
 public BehaviorGraphWriter(BehaviorGraph graph, IUrlRegistry urls, IServiceLocator services)
 {
     _graph                = graph;
     _urls                 = urls;
     _services             = services;
     _diagnosticsNamespace = GetType().Namespace;
 }
コード例 #35
0
        public virtual HtmlDocument BuildView(IUrlRegistry urls, IOutputWriter writer, LoginRequest request)
        {
            // TODO -- Revisit all of this when we get HTML conventions everywhere
            var view = new HtmlDocument();
            var form = new FormTag(urls.UrlFor <LoginRequest>("POST"));

            form.Append(new HtmlTag("legend").Text(LoginKeys.Login));

            if (request.Message.IsNotEmpty())
            {
                form.Append(new HtmlTag("p").Text(request.Message).Style("color", "red"));
            }

            form.Append(new TextboxTag("UserName", request.UserName));
            form.Append(new TextboxTag("Password", request.Password));
            form.Append(new CheckboxTag(request.RememberMe).Name("RememberMe"));


            form.Append(new DivTag().Text(request.Message).Id("login-message"));



            form.Append(new HiddenTag().Name("Url").Attr("value", request.Url));

            form.Append(new HtmlTag("input").Attr("type", "submit").Attr("value", LoginKeys.Login).Id("login-submit"));

            view.Add(form);

            return(view);
        }
コード例 #36
0
 public GridTagWriter(IColumnPolicies policies, ITemplateWriter templates, IAssetRequirements assets, IUrlRegistry urls, T grid)
 {
     _policies  = policies;
     _templates = templates;
     _assets    = assets;
     _urls      = urls;
     _grid      = grid;
 }
コード例 #37
0
 public AuthenticationRequiredBehaviour(ISecurityContext securityContext, ICurrentHttpRequest httpRequest, IUrlRegistry urlRegistry, IOutputWriter outputWriter)
     : base(PartialBehavior.Ignored)
 {
     this.securityContext = securityContext;
     this.httpRequest = httpRequest;
     this.urlRegistry = urlRegistry;
     this.outputWriter = outputWriter;
 }
コード例 #38
0
 public DiagnosticBehavior(IRequestTrace trace, IDebugDetector detector, IOutputWriter writer, IExceptionHandlingObserver exceptionObserver, IUrlRegistry urls)
 {
     _trace = trace;
     _detector = detector;
     _writer = writer;
     _exceptionObserver = exceptionObserver;
     _urls = urls;
 }
コード例 #39
0
        public EmbeddedFubuMvcServer(KatanaSettings settings, IUrlRegistry urls, IServiceLocator services, IList <RouteBase> routes)
        {
            _urls     = urls;
            _services = services;

            startServer(routes, AppDomain.CurrentDomain.BaseDirectory, settings.Port);
            buildEndpointDriver(settings.Port);
        }
コード例 #40
0
 public RequestLogBuilder(IUrlRegistry urls, ISystemTime systemTime, ICurrentHttpRequest request, ICurrentChain currentChain, IRequestData requestData)
 {
     _urls = urls;
     _systemTime = systemTime;
     _request = request;
     _currentChain = currentChain;
     _requestData = requestData;
 }
コード例 #41
0
 public static RouteReport ForChain(BehaviorChain chain, IUrlRegistry urls)
 {
     return(new RouteReport(chain, urls.UrlFor(new ChainRequest {
         Id = chain.UniqueId
     }), urls.UrlFor(new ChainDetailsRequest {
         Id = chain.UniqueId
     })));
 }
コード例 #42
0
 public ScheduledJobsFubuDiagnostics(IUrlRegistry urls, ISchedulePersistence persistence, ChannelGraph graph, ScheduledJobGraph jobs, IScheduledJobController controller)
 {
     _urls = urls;
     _persistence = persistence;
     _graph = graph;
     _jobs = jobs;
     _controller = controller;
 }
コード例 #43
0
 public ContinuationHandler(IUrlRegistry registry, IOutputWriter writer, IFubuRequest request, IPartialFactory factory, IChainResolver resolver)
 {
     _registry = registry;
     _writer = writer;
     _request = request;
     _factory = factory;
     _resolver = resolver;
 }
コード例 #44
0
ファイル: IUrlRegistry.cs プロジェクト: xeno3/fubumvc
        /// <summary>
        /// Inline way to resolve a url for an input model type by defining the RouteParameters object by
        /// expressions
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="registry"></param>
        /// <param name="configure"></param>
        /// <returns></returns>
        public static string UrlFor <T>(this IUrlRegistry registry, Action <RouteParameters <T> > configure)
        {
            var parameters = new RouteParameters <T>();

            configure(parameters);

            return(registry.UrlFor <T>(parameters));
        }
コード例 #45
0
        public Link CreateLink(IUrlRegistry urls)
        {
            var url = _source(urls);
            var link = new Link(url);
            _modifications.Each(x => x(link));

            return link;
        }
コード例 #46
0
 public void SetUp()
 {
     _page = MockRepository.GenerateMock <IFubuPage>();
     _urls = MockRepository.GenerateStub <IUrlRegistry>();
     _page.Expect(p => p.Urls).Return(_urls);
     _model = new InputModel();
     _urls.Stub(u => u.UrlFor(Arg <InputModel> .Is.NotNull)).Return("some url");
 }
コード例 #47
0
ファイル: IUrlRegistry.cs プロジェクト: xeno3/fubumvc
        /// <summary>
        /// Inline way to resolve a url for an input model type by defining the RouteParameters object by
        /// expressions
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="registry"></param>
        /// <param name="configure"></param>
        /// <returns></returns>
        public static string UrlFor <T>(this IUrlRegistry registry, string category, Action <RouteParameters <T> > configure)
        {
            var parameters = new RouteParameters <T>();

            configure(parameters);

            return(registry.UrlFor(typeof(T), parameters, category));
        }
コード例 #48
0
 public ScheduledJobsFubuDiagnostics(IUrlRegistry urls, ISchedulePersistence persistence, ChannelGraph graph, ScheduledJobGraph jobs, IScheduledJobController controller)
 {
     _urls        = urls;
     _persistence = persistence;
     _graph       = graph;
     _jobs        = jobs;
     _controller  = controller;
 }
コード例 #49
0
 public FeedWriter(IFeedSource <T> feedSource, IFeedDefinition <T> definition, ILinkSource <T> links,
                   IUrlRegistry urls)
 {
     _feedSource = feedSource;
     _definition = definition;
     _links      = links;
     _urls       = urls;
 }
コード例 #50
0
ファイル: MediaWriter.cs プロジェクト: DRHouk/fubumvc
 public MediaWriter(IMediaDocument document, ILinkSource <T> links, IUrlRegistry urls,
                    IValueProjection <T> projection)
 {
     _document   = document;
     _links      = links;
     _urls       = urls;
     _projection = projection;
 }
コード例 #51
0
 public MustBeAuthenticatedBehaviour(ISecurityContext securityContext, IOutputWriter writer, IUrlRegistry urls, IFubuRequest request)
     : base(PartialBehavior.Ignored)
 {
     _securityContext = securityContext;
     _writer = writer;
     _urls = urls;
     _request = request;
 }
コード例 #52
0
        public void SetUp()
        {
            graph = new DiagnosticsRegistry().BuildGraph();
            urls = MockRepository.GenerateMock<IUrlRegistry>();

            graph.Behaviors.Any().ShouldBeTrue();
            graph.Actions().Each(x => Debug.WriteLine(x.Description));
        }
コード例 #53
0
 protected override void beforeEach()
 {
     _serviceLocator = MockFor <IServiceLocator>();
     _urlRegistry    = MockFor <IUrlRegistry>();
     ClassUnderTest.ServiceLocator.ShouldBeNull();
     ClassUnderTest.ServiceLocator = _serviceLocator;
     _serviceLocator.Stub(x => x.GetInstance(typeof(IUrlRegistry))).Return(_urlRegistry);
 }
コード例 #54
0
 public ContinuationHandler(IUrlRegistry registry, IOutputWriter writer, IFubuRequest request, IPartialFactory factory, IChainResolver resolver)
 {
     _registry = registry;
     _writer   = writer;
     _request  = request;
     _factory  = factory;
     _resolver = resolver;
 }
コード例 #55
0
 public EntityCreator(INewEntityHandler <TEdit> newEntityHandler, IEntitySaver <TEntity> saver, IValidator validator, IUrlRegistry urls, IFlattener flattener)
 {
     _newEntityHandler = newEntityHandler;
     _saver            = saver;
     _validator        = validator;
     _urls             = urls;
     _flattener        = flattener;
 }
コード例 #56
0
 public ValidationContinuationHandler(IUrlRegistry registry, IOutputWriter writer, IFubuRequest request,
     IPartialFactory factory)
 {
     _registry = registry;
     _writer = writer;
     _request = request;
     _factory = factory;
 }
コード例 #57
0
        public void SetUp()
        {
            _page = MockRepository.GenerateMock<IFubuPage>();
            _urls = new StubUrlRegistry();

            _page.Expect(p => p.Urls).Return(_urls);
            _model = new InputModel();
            //_urls.Stub(u => u.UrlFor(Arg<InputModel>.Is.NotNull)).Return("some url");
        }
コード例 #58
0
        public DiagnosticBehavior(IDebugReport report, IDebugDetector detector, IUrlRegistry urls,
            IRequestHistoryCache history)
        {
            _report = report;
            _detector = detector;
            _urls = urls;

            history.AddReport(report);
        }
コード例 #59
0
ファイル: ExampleHtmlWriter.cs プロジェクト: jemacom/fubumvc
        public ExampleHtmlWriter(IServiceLocator serviceLocator, IUrlRegistry urlRegistry, BehaviorGraph behaviorGraph, ICurrentHttpRequest httpRequest)
        {
            _serviceLocator = serviceLocator;
            _urlRegistry = urlRegistry;
            _behaviorGraph = behaviorGraph;
            _httpRequest = httpRequest;

            _examplePageUrl = httpRequest.ToFullUrl("_fubu/html/example");
        }
コード例 #60
0
 public MustBeAuthorizedBehavior(ActionCall actionCall, ISecurityContext securityContext, IUrlRegistry urls, IFubuRequest request, IOutputWriter writer)
     : base(PartialBehavior.Ignored)
 {
     _actionCall = actionCall;
     _securityContext = securityContext;
     _urls = urls;
     _request = request;
     _writer = writer;
 }