diff --git a/src/components/Catalog.vue b/src/components/Catalog.vue
index e87a1a049..18c4a90c0 100644
--- a/src/components/Catalog.vue
+++ b/src/components/Catalog.vue
@@ -363,8 +363,7 @@ export default {
// recommended
identifier: this.catalog.id,
keywords: this._keywords,
- license:
- this._license && `https://spdx.org/licenses/${this._license}.html`,
+ license: this.licenseUrl,
isBasedOn: this.url,
version: this.version,
url: this.path,
@@ -429,8 +428,27 @@ export default {
);
},
license() {
+ if (this._license === "proprietary") {
+ if (this.licenseUrl != null) {
+ return `${this._license}`;
+ }
+
+ return this._license;
+ }
+
return spdxToHTML(this._license);
},
+ licenseUrl() {
+ if (this._license === "proprietary") {
+ return this.links
+ .concat((this.rootCatalog && this.rootCatalog.links) || [])
+ .filter(x => x.rel === "license")
+ .map(x => x.href)
+ .pop();
+ }
+
+ return `https://spdx.org/licenses/${this._license}.html`;
+ },
links() {
// REQUIRED
return this.catalog.links;
diff --git a/src/components/Item.vue b/src/components/Item.vue
index ce52e3351..f36bb6e9c 100644
--- a/src/components/Item.vue
+++ b/src/components/Item.vue
@@ -267,8 +267,7 @@ export default {
// recommended
identifier: this.item.id,
keywords: this.keywords,
- license:
- this._license && `https://spdx.org/licenses/${this._license}.html`,
+ license: this.licenseUrl,
isBasedOn: this.url,
url: this.path,
includedInDataCatalog: [this.collectionLink, this.parentLink].filter(x => !!x).map(
@@ -396,8 +395,31 @@ export default {
);
},
license() {
+ if (this._license === "proprietary") {
+ if (this.licenseUrl != null) {
+ return `${this._license}`;
+ }
+
+ return this._license;
+ }
+
return spdxToHTML(this._license);
},
+ licenseUrl() {
+ if (this._license === "proprietary") {
+ return this.links
+ .concat(
+ ((this.collection && this.collection.links) || []).concat(
+ (this.rootCatalog && this.rootCatalog.links) || []
+ )
+ )
+ .filter(x => x.rel === "license")
+ .map(x => x.href)
+ .pop();
+ }
+
+ return `https://spdx.org/licenses/${this._license}.html`;
+ },
licensor() {
return this.providers
.filter(x => x.roles.includes("licensor"))