From 847ff75845575a2e95386b3d44b58d9a30f70d4d Mon Sep 17 00:00:00 2001 From: Pepijn van Oort Date: Tue, 24 Oct 2023 13:47:58 +0200 Subject: [PATCH] download codelist CL405, soil types --- FarmmapsDownloadCL/DownloadCLInput.json | 2 +- FarmmapsDownloadCL/Models/CodelistsClasses.cs | 22 ++++++++++++++++++- FarmmapsKPI/TODO.txt | 10 ++++----- Secrets/appsettings.json | 20 ++++++++--------- 4 files changed, 37 insertions(+), 17 deletions(-) diff --git a/FarmmapsDownloadCL/DownloadCLInput.json b/FarmmapsDownloadCL/DownloadCLInput.json index 8b5c9c6..0cfa53f 100644 --- a/FarmmapsDownloadCL/DownloadCLInput.json +++ b/FarmmapsDownloadCL/DownloadCLInput.json @@ -1,4 +1,4 @@ { - "codeLists": [ "CL022", "CL127", "CL263", "CL042" ] + "codeLists": [ "CL022", "CL127", "CL263", "CL405", "CL042" ] //"DownloadFolder": "Downloads", //"C:\\hugoschrererdir\\kpidir\\", // "Downloads", -> if you just put "Downloads" the program will download to somewhere in ..\FarmMapsApiClient_WURtest\FarmmapsDataDownload\bin\Debug\netcoreapp3.1\Downloads\ } \ No newline at end of file diff --git a/FarmmapsDownloadCL/Models/CodelistsClasses.cs b/FarmmapsDownloadCL/Models/CodelistsClasses.cs index 22f9c4a..b53615a 100644 --- a/FarmmapsDownloadCL/Models/CodelistsClasses.cs +++ b/FarmmapsDownloadCL/Models/CodelistsClasses.cs @@ -16,6 +16,7 @@ namespace FarmmapsDownloadCL.Models this.dictCl.Add("CL022", new List { "vnd.farmmaps.itemtype.codelist.cl022", "CL022item" }); this.dictCl.Add("CL127", new List { "vnd.farmmaps.itemtype.codelist.cl127", "CL127item" }); this.dictCl.Add("CL263", new List { "vnd.farmmaps.itemtype.codelist.cl263", "CL263item" }); + this.dictCl.Add("CL405", new List { "vnd.farmmaps.itemtype.codelist.cl405", "CL405item" }); } public string itemcode; //Define here the codelist names, their item type and the class defining the contents of the data type (and defined in the Models.CodelistsClasses) @@ -26,7 +27,7 @@ namespace FarmmapsDownloadCL.Models { public CL022item() { - this.headers = new string[] { "codelist","code", "description", "type","k", "n","p","composition" }; + this.headers = new string[] { "codelist", "code", "description", "type", "n", "p", "k", "composition" }; this.codelist = "CL022"; this.about = new string[] { "EDI-Crop, coderingslijst meststoffen", "type MOR = organische meststof; MAN = anorganische meststof" }; } @@ -84,4 +85,23 @@ namespace FarmmapsDownloadCL.Models public string composition { get; set; } } + public class CL405item + { + public CL405item() + { + this.headers = new string[] { "codelist", "code", "description", "description_fr", "description_nl", "hoofdgroep" }; + this.codelist = "CL405"; + this.about = new string[] { }; + } + + public string[] headers { get; } + public string codelist { get; } + public string[] about { get; } + public string code { get; set; } + public string hoofdgroep { get; set; } + public string description { get; set; } + public string description_fr { get; set; } + public string description_nl { get; set; } + + } } \ No newline at end of file diff --git a/FarmmapsKPI/TODO.txt b/FarmmapsKPI/TODO.txt index cdc2529..e51c71f 100644 --- a/FarmmapsKPI/TODO.txt +++ b/FarmmapsKPI/TODO.txt @@ -15,9 +15,9 @@ a. Why? Because ii. so that you can look up crops and fertilizer types and fill in KPIinput.json correctly b. Download full list of items from vnd.farmmaps.itemtype.codelist.cl263 DONE c. Write them to a csv file DONE -d. In any case following lists: 127 operations DONE; 022 meststoffen (fertilizer products) DONE; 263 gewassen DONE; 405 soilcode NOT YET - in which list the productionPurposeCode? +d. In any case following lists: 127 operations DONE; 022 meststoffen (fertilizer products) DONE; 263 gewassen DONE; 405 soilcode DONE + in which list the productionPurposeCode NOT YET? -Testing: in json input data, can certain fields be left out? Which are minimum fields needed? -Testing: effect of location (e.g. different targetValue, different N deposition? Different crop N contents depending on soil?) -Testing: productionPurposeCode: different result depending on starch or consumption potato (different N contents in tubers; different targetValues? +Testing: in json input data, can certain fields be left out? Which are minimum fields needed? NOT YET +Testing: effect of location (e.g. different targetValue, different N deposition? Different crop N contents depending on soil?) NOT YET +Testing: productionPurposeCode: different result depending on starch or consumption potato (different N contents in tubers; different targetValues? NOT YET diff --git a/Secrets/appsettings.json b/Secrets/appsettings.json index 2aff27f..f224b09 100644 --- a/Secrets/appsettings.json +++ b/Secrets/appsettings.json @@ -2,11 +2,11 @@ //There are three farmmaps environments, uncomment the environemnt you want to use with this sample client //test environment - "Authority": "https://accounts.test.farmmaps.eu/", - "Endpoint": "https://test.farmmaps.eu/", - "BasePath": "api/v1", - "DiscoveryEndpointUrl": "https://accounts.test.farmmaps.eu/.well-known/openid-configuration", - "GrantClientId": "farmmapstesteu", + //"Authority": "https://accounts.test.farmmaps.eu/", + //"Endpoint": "https://test.farmmaps.eu/", + //"BasePath": "api/v1", + //"DiscoveryEndpointUrl": "https://accounts.test.farmmaps.eu/.well-known/openid-configuration", + //"GrantClientId": "farmmapstesteu", ////acceptance environment //"Authority": "https://accounts.acc.farmmaps.eu/", @@ -16,11 +16,11 @@ //"GrantClientId": "farmmapsacceu", ////production environment - //"authority": "https://accounts.farmmaps.eu/", - //"endpoint": "https://farmmaps.eu/", - //"basepath": "api/v1", - //"discoveryendpointurl": "https://accounts.farmmaps.eu/.well-known/openid-configuration", - //"GrantClientId": "farmmaps", + "authority": "https://accounts.farmmaps.eu/", + "endpoint": "https://farmmaps.eu/", + "basepath": "api/v1", + "discoveryendpointurl": "https://accounts.farmmaps.eu/.well-known/openid-configuration", + "GrantClientId": "farmmaps", //overige info "RedirectUri": "http://example.nl/api",