Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue/21 Fixed: Didn't capture license info correctly from AURIN CSW registry #22

Merged
merged 2 commits into from
Feb 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 1.1.1

- #21 Fixed: make sure license info is captured correctly for the AURIN CSW registry

# 1.1.0

- Add POST request support for getRecords endpoints
Expand Down
6 changes: 6 additions & 0 deletions aspect-templates/dcat-distribution-strings.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,12 @@ if (!license) {
if (license.length === 0) {
license = undefined;
}
if (!license) {
license = jsonpath.value(
dataset.json,
"$..MD_LegalConstraints[*]..title[*].CharacterString[*]._"
);
}
}
const rights = jsonpath.value(
constraints,
Expand Down
2 changes: 1 addition & 1 deletion deploy/magda-csw-connector/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v2
name: magda-csw-connector
description: A Helm chart for Magda csw Connector
version: "1.1.0"
version: "1.1.1"
kubeVersion: ">= 1.14.0-0"
home: "https://github.com/magda-io/magda-csw-connector"
sources: [ "https://github.com/magda-io/magda-csw-connector" ]
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@magda/csw-connector",
"description": "MAGDA OGC Catalogue Service for the Web (CSW) Connector",
"version": "1.1.0",
"version": "1.1.1",
"scripts": {
"prebuild": "rimraf dist tsconfig.tsbuildinfo",
"build": "yarn run compile",
Expand Down
315 changes: 315 additions & 0 deletions src/test/aurin-license-response.json

Large diffs are not rendered by default.

1,328 changes: 1,328 additions & 0 deletions src/test/aurin-license-response.xml

Large diffs are not rendered by default.

12 changes: 12 additions & 0 deletions src/test/black-box.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,18 @@ const fs = require("fs");
const path = require("path");

const TEST_CASES = [
/**
* Test for CSW data source: aurin mainly for license info
* https://openapi.aurin.org.au/public/csw?service=CSW&version=2.0.2&request=GetRecords&constraintLanguage=FILTER&constraint_language_version=1.1.0&resultType=results&elementsetname=full&outputschema=http%3A%2F%2Fwww.isotc211.org%2F2005%2Fgmd&typeNames=gmd%3AMD_Metadata&startPosition=1&maxRecords=100
*/
{
input: fs.readFileSync(
path.join(__dirname, "aurin-license-response.xml")
),
output: JSON.parse(
fs.readFileSync(path.join(__dirname, "aurin-license-response.json"))
)
},
/* basic CSW test file */
{
input: fs.readFileSync(path.join(__dirname, "csw1.xml")),
Expand Down