Example #1
0
        private static void ConfigureDevelopment(IApplicationBuilder app, IHostingEnvironment env)
        {
            if (!env.IsDevelopment())
            {
                return;
            }

            app.UseDeveloperExceptionPage();
            app.UseSwagger();
            app.UseSwaggerUI(c =>
            {
                c.SwaggerEndpoint("/swagger/v1/swagger.json", "NiN API V1");
            });
            string frontendPath = FileLocator.FindDirectoryInTree(Config.Settings.FrontEndSubdirectory);

            app.UseStaticFiles(new StaticFileOptions
            {
                FileProvider = new PhysicalFileProvider(frontendPath),
                RequestPath  = new PathString("")
            });

            app.UseDirectoryBrowser(new DirectoryBrowserOptions
            {
                FileProvider = new PhysicalFileProvider(frontendPath),
                RequestPath  = new PathString("")
            });
        }
Example #2
0
        public DataleveranseXmlGreier()
        {
            var schemaPath   = FileLocator.FindDirectoryInTree(Config.Settings.SchemaSubdirectory);
            var xsdPath      = Path.Combine(schemaPath, "NiNCoreDataleveranse.xsd");
            var xsdGridPath  = Path.Combine(schemaPath, "NiNCoreGridleveranse.xsd");
            var xsdCachePath = Path.Combine(schemaPath, "cache");

            var gmlXmlResolver = CreateGmlXmlResolver(xsdCachePath);

            var schemas = new XmlSchemaSet {
                XmlResolver = gmlXmlResolver
            };

            var xsdMarkup = File.ReadAllText(xsdPath);

            var xsdDocument   = XDocument.Parse(xsdMarkup);
            var xsdAttributes = GetAttributes(xsdDocument.Root);
            var xsdNamespace  = xsdAttributes.ContainsKey("xmlns:nin")
                ? xsdAttributes["xmlns:nin"].Replace("\"", "")
                : "";

            var stringReader = new StringReader(xsdMarkup);
            var xmlReader    = XmlReader.Create(stringReader);

            schemas.Add(xsdNamespace, xmlReader);

            dataleveranseValiderer = new DataleveranseValiderer(schemas);

            schemas = new XmlSchemaSet {
                XmlResolver = gmlXmlResolver
            };

            xsdMarkup     = File.ReadAllText(xsdGridPath);
            xsdDocument   = XDocument.Parse(xsdMarkup);
            xsdAttributes = GetAttributes(xsdDocument.Root);
            xsdNamespace  = xsdAttributes.ContainsKey("xmlns:nin") ? xsdAttributes["xmlns:nin"].Replace("\"", "") : "";

            stringReader = new StringReader(xsdMarkup);
            xmlReader    = XmlReader.Create(stringReader);
            schemas.Add(xsdNamespace, xmlReader);

            gridValidator = new DataleveranseValiderer(schemas);
        }