From 334260fed446c89e01d61617b054cb0a824c6d50 Mon Sep 17 00:00:00 2001 From: Simon Templer Date: Tue, 24 Oct 2023 09:50:32 +0200 Subject: [PATCH 1/2] fix(resources): fix download of INSPIRE code lists For some code lists requests may time out if a language is not explicitly specified. ING-3236 --- modules/resources/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/resources/build.gradle b/modules/resources/build.gradle index 335efa7..987d6b7 100644 --- a/modules/resources/build.gradle +++ b/modules/resources/build.gradle @@ -260,7 +260,7 @@ task downloadInspireCodeLists { exec { workingDir = genericDir executable = 'wget' - args '--force-directories', '--no-host-directories', "--header=Accept: application/xml", url + args '--force-directories', '--no-host-directories', "--header=Accept: application/xml", "--header=Accept-Language: en", url } } From bd8846820866b028d518a7083f022ccfd5b283c7 Mon Sep 17 00:00:00 2001 From: Simon Templer Date: Tue, 24 Oct 2023 11:11:24 +0200 Subject: [PATCH 2/2] fix(resources): download INSPIRE schemas from GitHub repo ...instead of website. The website used to be a static directory listing but has now changed to a page that requires Javascript. ING-3236 --- modules/resources/build.gradle | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/modules/resources/build.gradle b/modules/resources/build.gradle index 987d6b7..6fe5ccc 100644 --- a/modules/resources/build.gradle +++ b/modules/resources/build.gradle @@ -131,16 +131,28 @@ task downloadInspireSchemas() { // delete existing schema archive inspireSchemas.delete() + // download Zip (TODO better way, e.g. Gradle download task?) exec { workingDir = temporaryDir executable = 'wget' - args '-e', 'robots=off', '-r', '--no-parent', '--no-host-directories', '-A', 'xsd,xml,txt', 'https://inspire.ec.europa.eu/schemas/' + args 'https://github.com/INSPIRE-MIF/application-schemas/archive/refs/heads/main.zip' } - exec { - workingDir = temporaryDir - executable = 'wget' - args '-e', 'robots=off', '-r', '--no-parent', '-X', 'draft-schemas/geoportal', '--no-host-directories', '-A', 'xsd,xml,txt', 'https://inspire.ec.europa.eu/draft-schemas/' + // unzip + def zipFile = new File(temporaryDir, 'main.zip') + ant.unzip(src: zipFile, dest: temporaryDir) + // delete zip file + zipFile.delete() + // move content up out of "application-schemas-main" + ant.move(todir: temporaryDir) { + ant.fileset(dir: new File(temporaryDir, 'application-schemas-main')) { + // only include XML schemas + include( name: '**/*.xsd' ) + // README that includes information about the state/date + include( name: '**/readme.txt' ) + } } + // delete remainder + delete(new File(temporaryDir, 'application-schemas-main')) // add fixups copy { from new File(projectDir, 'inspire-fixup')