Skip to content

Commit

Permalink
fix: try to compensate INSPIRE schema version redirects
Browse files Browse the repository at this point in the history
...by including every schema in the schemas root.

ING-3236
  • Loading branch information
stempler committed Oct 28, 2023
1 parent 1ac8d04 commit bd60c74
Show file tree
Hide file tree
Showing 11 changed files with 39 additions and 2 deletions.
35 changes: 35 additions & 0 deletions modules/resources/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,41 @@ task downloadInspireSchemas() {
}
// delete remainder
delete(new File(temporaryDir, 'application-schemas-main'))

/*
* The website does redirect for some schemas to a subfolder with older versions.
* For example `hy-p/3.0/HydroPhysicalWaters.xsd` is redirected to `2021.1/hy-p/3.0/HydroPhysicalWaters.xsd`
* The resource bundles don't know about these redirects, the file from the original folder is accessed.
* Loading the full schema may fail though, because some schema have been removed from the root and are only
* available in folders representing older versions.
* Examples:
* - `lc/0.0/LandCover.xsd`
* - `wfd/0.0/WaterFrameworkDirective.xsd`
*
* Since we don't know the exact redirection rules we attempt to have a copy of al schemas in the root, in
* their respective newest version, by copying newer versions over older versions.
*/
def tempRoot = new File(temporaryDir, 'tmp-schemas')
def versions = ['2021.1', '2021.2', '2022.1', '2022.2']
// copy all versions in order
versions.each { v ->
copy {
from new File(temporaryDir, "schemas/$v")
into tempRoot
include '**/*'
}
}
// copy current root
copy {
from new File(temporaryDir, "schemas")
into tempRoot
include '**/*'
}
// delete old root
delete(new File(temporaryDir, 'schemas'))
// rename
ant.move(file: tempRoot, tofile: new File(temporaryDir, 'schemas'))

// add fixups
copy {
from new File(projectDir, 'inspire-fixup')
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
6 changes: 4 additions & 2 deletions version-history.json
Original file line number Diff line number Diff line change
Expand Up @@ -4835,7 +4835,8 @@
},
"5.0.0": {
"i20231028": "4z0ZKg",
"i202310281504": "mSscTA"
"i202310281504": "mSscTA",
"i202310282027": "SUweBg"
}
},
"eu.esdihumboldt.hale.platform.cs3d-map": {
Expand Down Expand Up @@ -4903,7 +4904,8 @@
"i20220816": "ESzIjw"
},
"5.0.0": {
"i20231028": "gLfKAA"
"i20231028": "gLfKAA",
"i202310282027": "pAKJA"
}
},
"eu.esdihumboldt.hale.platform.schemacrawler": {
Expand Down

0 comments on commit bd60c74

Please sign in to comment.