Beispiel #1
0
        public ActionResult CreateMetadataForLayers(string uuid, string wfsUrl, String[] selectedLayers, string[] keywords)
        {
            MetadataViewModel metadata = _metadataService.GetMetadataModel(uuid);

            WfsServiceViewModel serviceModel = _wfsServiceParser.GetLayers(wfsUrl);

            List <WfsLayerViewModel> createMetadataForLayers = new List <WfsLayerViewModel>();

            if (selectedLayers != null)
            {
                foreach (var layer in serviceModel.Layers)
                {
                    if (selectedLayers.Contains(layer.Name))
                    {
                        createMetadataForLayers.Add(layer);
                    }
                }
            }
            string username = GetUsername();
            List <WfsLayerViewModel> newlyCreatedLayerMetadata = _metadataService.CreateMetadataForFeature(uuid, createMetadataForLayers, keywords, username);

            WfsServiceLayerViewModel model = new WfsServiceLayerViewModel
            {
                Metadata = metadata,
                Layers   = newlyCreatedLayerMetadata,
                WfsUrl   = wfsUrl,
            };

            return(View("LayersCreated", model));
        }