Ejemplo n.º 1
0
        protected virtual async Task RenderOperationsAsync(Stream output, IRequest httpReq, ServiceMetadata metadata)
        {
            var allValidationRules = await httpReq.GetAllValidateRulesAsync().ConfigAwait();

            var defaultPage = new IndexOperationsControl
            {
                Request              = httpReq,
                MetadataConfig       = HostContext.MetadataPagesConfig,
                Title                = HostContext.ServiceName,
                Xsds                 = XsdTypes.Xsds,
                XsdServiceTypesIndex = 1,
                OperationNames       = metadata.GetOperationNamesForMetadata(httpReq),
                GetOperation         = operationName => {
                    var opType = HostContext.Metadata.GetOperationType(operationName);
                    var op     = HostContext.Metadata.GetOperation(opType).ApplyValidationRules(allValidationRules);
                    return(op);
                }
            };

            var metadataFeature = HostContext.GetPlugin <MetadataFeature>();

            metadataFeature?.IndexPageFilter?.Invoke(defaultPage);

            await defaultPage.RenderAsync(output).ConfigAwait();
        }
Ejemplo n.º 2
0
        protected override void RenderOperations(HtmlTextWriter writer, IHttpRequest httpReq, ServiceMetadata metadata)
        {
            var defaultPage = new OperationsControl {
                Title          = EndpointHost.Config.ServiceName,
                OperationNames = metadata.GetOperationNamesForMetadata(httpReq, Format),
                MetadataOperationPageBodyHtml = EndpointHost.Config.MetadataOperationPageBodyHtml,
            };

            defaultPage.RenderControl(writer);
        }
Ejemplo n.º 3
0
        protected void RenderOperations(HtmlTextWriter writer, IRequest httpReq, ServiceMetadata metadata)
        {
            var defaultPage = new IndexOperationsControl
            {
                HttpRequest          = httpReq,
                MetadataConfig       = HostContext.MetadataPagesConfig,
                Title                = HostContext.ServiceName,
                Xsds                 = XsdTypes.Xsds,
                XsdServiceTypesIndex = 1,
                OperationNames       = metadata.GetOperationNamesForMetadata(httpReq),
            };

            defaultPage.RenderControl(writer);
        }
Ejemplo n.º 4
0
        protected override void RenderOperations(HtmlTextWriter writer, IHttpRequest httpReq, ServiceMetadata metadata)
        {
            var defaultPage = new IndexOperationsControl {
                HttpRequest          = httpReq,
                MetadataConfig       = EndpointHost.Config.MetadataPagesConfig,
                Title                = EndpointHost.Config.ServiceName,
                Xsds                 = XsdTypes.Xsds,
                XsdServiceTypesIndex = 1,
                OperationNames       = metadata.GetOperationNamesForMetadata(httpReq),
                MetadataPageBodyHtml = EndpointHost.Config.MetadataPageBodyHtml,
            };

            defaultPage.RenderControl(writer);
        }
Ejemplo n.º 5
0
        protected virtual void RenderOperations(HtmlTextWriter writer, IRequest httpReq, ServiceMetadata metadata)
        {
            var metadataPage = new FormatOperationsControl
            {
                Request             = httpReq,
                MetadataPagesConfig = HostContext.MetadataPagesConfig,
                Title          = HostContext.AppHost.ServiceName + " " + HostContext.AppHost.Config.ApiVersion,
                Format         = ContentFormat,
                OperationNames = metadata.GetOperationNamesForMetadata(httpReq, this.Format)
            };

            var metadataFeature = HostContext.GetPlugin <MetadataFeature>();

            metadataFeature?.FormatPageFilter?.Invoke(metadataPage);

            metadataPage.RenderControl(writer);
        }
Ejemplo n.º 6
0
        protected virtual void RenderOperations(Stream output, IRequest httpReq, ServiceMetadata metadata)
        {
            var defaultPage = new IndexOperationsControl
            {
                Request              = httpReq,
                MetadataConfig       = HostContext.MetadataPagesConfig,
                Title                = HostContext.ServiceName,
                Xsds                 = XsdTypes.Xsds,
                XsdServiceTypesIndex = 1,
                OperationNames       = metadata.GetOperationNamesForMetadata(httpReq),
            };

            var metadataFeature = HostContext.GetPlugin <MetadataFeature>();

            metadataFeature?.IndexPageFilter?.Invoke(defaultPage);

            defaultPage.Render(output);
        }
Ejemplo n.º 7
0
        protected override void RenderOperations(HtmlTextWriter writer, IRequest httpReq, ServiceMetadata metadata)
        {
            var metadataPage = new IndexOperationsControl
            {
                Request             = httpReq,
                MetadataPagesConfig = HostContext.MetadataPagesConfig,
                Title = HostContext.AppHost.ServiceName + " " + HostContext.AppHost.Config.ApiVersion,
                Xsds  = XsdTypes.Xsds,
                XsdServiceTypesIndex = 1,
                OperationNames       = metadata.GetOperationNamesForMetadata(httpReq),
            };

            var metadataFeature = HostContext.GetPlugin <MetadataFeature>();

            metadataFeature?.FormatPageFilter?.Invoke(metadataPage);

            metadataPage.RenderControl(writer);
        }
Ejemplo n.º 8
0
        protected void RenderOperations(HtmlTextWriter writer, IRequest httpReq, ServiceMetadata metadata)
        {
            var defaultPage = new IndexOperationsControl
            {
                HttpRequest          = httpReq,
                MetadataConfig       = HostContext.MetadataPagesConfig,
                Title                = HostContext.ServiceName,
                Xsds                 = XsdTypes.Xsds,
                XsdServiceTypesIndex = 1,
                OperationNames       = metadata.GetOperationNamesForMetadata(httpReq),
            };

            var metadataFeature = HostContext.GetPlugin <MetadataFeature>();

            if (metadataFeature != null && metadataFeature.IndexPageFilter != null)
            {
                metadataFeature.IndexPageFilter(defaultPage);
            }

            defaultPage.RenderControl(writer);
        }