Generate manifest label
This commit is contained in:
parent
3250b4a0f6
commit
e9e299d845
@ -13,6 +13,7 @@ export default async function generateManifest(manifestId) {
|
|||||||
|
|
||||||
let manifest = new Manifest(IIIF_API_VERSION, BASE_URL);
|
let manifest = new Manifest(IIIF_API_VERSION, BASE_URL);
|
||||||
manifest.generateID(manifestId);
|
manifest.generateID(manifestId);
|
||||||
|
manifest.generateLabel();
|
||||||
|
|
||||||
manifest = await Common.populateCanvases(
|
manifest = await Common.populateCanvases(
|
||||||
manifest,
|
manifest,
|
||||||
|
@ -5,7 +5,8 @@ import Sequence from "./Sequence.js";
|
|||||||
*/
|
*/
|
||||||
class Manifest {
|
class Manifest {
|
||||||
id = '';
|
id = '';
|
||||||
type = 'sc:Manifest';
|
_type = 'sc:Manifest';
|
||||||
|
_label = '';
|
||||||
resourceId = '';
|
resourceId = '';
|
||||||
/**
|
/**
|
||||||
* @var {Sequence[]}
|
* @var {Sequence[]}
|
||||||
@ -29,6 +30,12 @@ class Manifest {
|
|||||||
this.id = `${this.BASE_URL}/${resourceId}/manifest` ;
|
this.id = `${this.BASE_URL}/${resourceId}/manifest` ;
|
||||||
this.resourceId = resourceId;
|
this.resourceId = resourceId;
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* Create IIIF label for this manifest
|
||||||
|
*/
|
||||||
|
generateLabel() {
|
||||||
|
this._label = `P.Herc. ${this.resourceId.split('-')[1]}`;
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* Object representation of this
|
* Object representation of this
|
||||||
* manifest
|
* manifest
|
||||||
@ -40,7 +47,8 @@ class Manifest {
|
|||||||
return {
|
return {
|
||||||
"@context" : this.context,
|
"@context" : this.context,
|
||||||
"@id" : this.id,
|
"@id" : this.id,
|
||||||
"@type" : this.type,
|
"@type" : this._type,
|
||||||
|
label : this._label,
|
||||||
sequences: this.sequences,
|
sequences: this.sequences,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user