Files delivered using IIIF Universal Viewer are not ordered according to Logical Structure Map of delivered Representation
- Last updated
- Save as PDF
- Product: Rosetta
- Product Version: 7.2
Symptoms
Files delivered using IIIF Universal Viewer are not ordered according to Logical structure of delivered Representation.
Causes
An issue with "Out of the box" deployed IIIF Manifest XSL (for either version 2 or 3).
Defect Status
The issue is under review by Development team.
Workaround
In general, IIIF Manifest XSL can be modified from Rosetta Data Management module → Deposits → Delivery XSL Files →
- For IIIF Manifest version 3 - Click on "Edit" for "mets2manifest_V3.xsl"
- For IIIF Manifest version 2 - Click on "Edit" for "mets2manifest.xsl"
For example, the XSL files below allow the order for the delivered Files to be dictated by the following priority:
- 'LOGICAL' Stracture Map.
- 'PHYSICAL' Stracture Map.
- Ascending order of File found under 'mets:fileGrp' section of METS.
(not relevant for 'Derivative Copy' Representation)
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:mets="http://www.loc.gov/METS/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:dnx="http://www.exlibrisgroup.com/dps/dnx" version="2.0">
<xsl:output method="html" omit-xml-declaration="yes"/>
<xsl:param name="isDownloadFile"/>
<xsl:param name="MDFields"/>
<xsl:variable name="PID" select="/mets:mets/mets:amdSec[@ID=$IE_AMD_ID]/mets:techMD/mets:mdWrap/mets:xmlData/dnx:dnx/dnx:section[@id='internalIdentifier']/dnx:record[dnx:key[@id='internalIdentifierType']='PID']/dnx:key[@id='internalIdentifierValue']"/>
<xsl:variable name="CONTEXT">"@context" : "http://iiif.io/api/presentation/3/context.json"</xsl:variable>
<xsl:variable name="SERVICE_CONTEXT">"@context" : "http://iiif.io/api/image/3/context.json"</xsl:variable>
<xsl:variable name="ID">"id" : "</xsl:variable>
<xsl:variable name="TYPE">"type" : "</xsl:variable>
<xsl:variable name="ON">"on" : "</xsl:variable>
<xsl:variable name="DELIVERY_BASE_URL">baseURLPlaceHolderdelivery/</xsl:variable>
<xsl:variable name="DOWNLOAD_FUNC">downloadFileFunc</xsl:variable>
<xsl:variable name="THUMBNAIL_FUNC">thumbnailFileFunc</xsl:variable>
<xsl:variable name="IMAGE_SERVER_BASE_URL">imageServerBaseURLPlaceHolder</xsl:variable>
<xsl:variable name="UI_CUSTOMIZATION">UIcustomizatioIDplaceHolder</xsl:variable>
<xsl:variable name="CONSOTRIUM_ID">UIconsortiumIDplaceHolder</xsl:variable>
<xsl:variable name="URI_PREFIX">iiif/presentation/3/</xsl:variable>
<xsl:variable name="IMAGE_SERVER_PREFIX">cantaloupe/iiif/2/</xsl:variable>
<xsl:variable name="DVS">DVSplaceHolder</xsl:variable>
<xsl:variable name="OBJECT_TYPE_IE">IE</xsl:variable>
<xsl:variable name="OBJECT_TYPE_REPRESENTATION">REP</xsl:variable>
<xsl:variable name="OBJECT_TYPE_FILE">FILE</xsl:variable>
<xsl:variable name="LABEL">"label" : "</xsl:variable>
<xsl:variable name="VALUE">"value" : "</xsl:variable>
<xsl:variable name="IE_AMD_ID">ie-amd</xsl:variable>
<xsl:variable name="IE_DMD_ID">ie-dmd</xsl:variable>
<xsl:variable name="DESCRIPTION">"description": "</xsl:variable>
<xsl:variable name="ATTRIBUTION">"Attribution"</xsl:variable>
<xsl:variable name="METADATA">"metadata": [</xsl:variable>
<xsl:variable name="LOGO">"logo": "</xsl:variable>
<xsl:variable name="LICENSE">"license": "</xsl:variable>
<xsl:variable name="THUMBNAIL">"thumbnail": "</xsl:variable>
<xsl:variable name="MOTIVATION">"motivation": "sc:painting",</xsl:variable>
<xsl:variable name="VIEWING_DIRECTION">"viewingDirection": </xsl:variable>
<xsl:variable name="VIEWING_HINT">"behavior": </xsl:variable>
<xsl:variable name="WIDTH">"width": </xsl:variable>
<xsl:variable name="HEIGHT">"height": </xsl:variable>
<xsl:variable name="WIDTH_PLACE_HOLDER">"widthPlaceholder</xsl:variable>
<xsl:variable name="HEIGHT_PLACE_HOLDER">"heightPlaceholder</xsl:variable>
<xsl:variable name="INFO_JSON">/info.json</xsl:variable>
<xsl:variable name="FILE_FORMAT">"format": "</xsl:variable>
<xsl:variable name="PROFILE">"profile": "http://iiif.io/api/image/3/level1.json" </xsl:variable>
<xsl:variable name="DURATION">"duration": </xsl:variable>
<xsl:variable name="DURATION_PLACE_HOLDER">durationPlaceHolder</xsl:variable>
<xsl:template match="/">{ <xsl:call-template name="MANIFEST"/>
<xsl:call-template name="SEQUENCES"/>
<xsl:call-template name="RANGES"/>} </xsl:template>
<xsl:template name="IE_PROPERTY">
<xsl:param name="DC_FIELD_NAME"/>
<xsl:param name="DCTERMS_FIELD_NAME"/>
<xsl:choose>
<xsl:when test="/mets:mets/mets:dmdSec[@ID=$IE_DMD_ID]/mets:mdWrap/mets:xmlData/dc:record/*[name()=$DC_FIELD_NAME]">
<xsl:value-of select="/mets:mets/mets:dmdSec[@ID=$IE_DMD_ID]/mets:mdWrap/mets:xmlData/dc:record/*[name()=$DC_FIELD_NAME]"/>
</xsl:when>
<xsl:when test="(//mets:dmdSec[@ID=$IE_DMD_ID]/mets:mdWrap/mets:xmlData/dc:record/*[name()=$DCTERMS_FIELD_NAME])[1]">
<xsl:value-of select="(//mets:dmdSec[@ID=$IE_DMD_ID]/mets:mdWrap/mets:xmlData/dc:record/*[name()=$DCTERMS_FIELD_NAME])[1]"/>
</xsl:when>
<xsl:otherwise/>
</xsl:choose>
</xsl:template>
<xsl:template name="IE_PROPERTY_LABEL">
<xsl:param name="DC_FIELD_NAME"/>
<xsl:param name="DCTERMS_FIELD_NAME"/>
<xsl:param name="DCTERMS_FIELD_NAME_2"/>
<xsl:choose>
<xsl:when test="/mets:mets/mets:dmdSec[@ID=$IE_DMD_ID]/mets:mdWrap/mets:xmlData/dc:record/*[name()=$DC_FIELD_NAME]">
<xsl:value-of select="/mets:mets/mets:dmdSec[@ID=$IE_DMD_ID]/mets:mdWrap/mets:xmlData/dc:record/*[name()=$DC_FIELD_NAME]"/>
</xsl:when>
<xsl:when test="(//mets:dmdSec[@ID=$IE_DMD_ID]/mets:mdWrap/mets:xmlData/dc:record/*[name()=$DCTERMS_FIELD_NAME])[1]">
<xsl:value-of select="(//mets:dmdSec[@ID=$IE_DMD_ID]/mets:mdWrap/mets:xmlData/dc:record/*[name()=$DCTERMS_FIELD_NAME])[1]"/>
</xsl:when>
<xsl:when test="(//mets:dmdSec[@ID=$IE_DMD_ID]/mets:mdWrap/mets:xmlData/dc:record/*[name()=$DCTERMS_FIELD_NAME_2])[1]">
<xsl:value-of select="(//mets:dmdSec[@ID=$IE_DMD_ID]/mets:mdWrap/mets:xmlData/dc:record/*[name()=$DCTERMS_FIELD_NAME_2])[1]"/>
</xsl:when>
<xsl:otherwise>no title</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="IE_METADATA">
<xsl:for-each select="/mets:mets/mets:dmdSec[@ID=$IE_DMD_ID]/mets:mdWrap/mets:xmlData/dc:record/dc:creator | /mets:mets/mets:dmdSec[@ID=$IE_DMD_ID]/mets:mdWrap/mets:xmlData/dc:record/dcterms:creator "> {<xsl:value-of select="$LABEL"/>Author", <xsl:value-of select="$VALUE"/>
<xsl:value-of select="."/>"} <xsl:if test="position()!=last() or count(//dc:subject) > 0 or count(//dcterms:subject) > 0">, </xsl:if>
</xsl:for-each>
<xsl:for-each select="/mets:mets/mets:dmdSec[@ID=$IE_DMD_ID]/mets:mdWrap/mets:xmlData/dc:record/dc:subject | /mets:mets/mets:dmdSec[@ID=$IE_DMD_ID]/mets:mdWrap/mets:xmlData/dc:record/dcterms:subject"> {<xsl:value-of select="$LABEL"/>Subject", <xsl:value-of select="$VALUE"/>
<xsl:value-of select="."/>"} <xsl:if test="position()!=last()">, </xsl:if>
</xsl:for-each> ] </xsl:template>
<xsl:template name="MANIFEST">
<xsl:value-of select="$CONTEXT"/>, <xsl:value-of select="$ID"/>
<xsl:value-of select="$DELIVERY_BASE_URL"/>
<xsl:value-of select="$URI_PREFIX"/>
<xsl:value-of select="$PID"/>/manifest", <xsl:value-of select="$TYPE"/>Manifest", "label": { "none": [ "<xsl:call-template name="IE_PROPERTY_LABEL">
<xsl:with-param name="DC_FIELD_NAME" select=""dc:title""/>
<xsl:with-param name="DCTERMS_FIELD_NAME" select=""dcterms:title""/>
<xsl:with-param name="DCTERMS_FIELD_NAME_2" select=""dcterms:alternative""/>
</xsl:call-template>"] }, "summary": { "none": [ "<xsl:call-template name="IE_PROPERTY">
<xsl:with-param name="DC_FIELD_NAME" select=""dc:description""/>
<xsl:with-param name="DCTERMS_FIELD_NAME" select=""dcterms:description""/>
</xsl:call-template>" ] }, "requiredStatement": { "label": { "none": [ <xsl:value-of select="$ATTRIBUTION"/> ] }, "value": { "none": [ "<xsl:call-template name="IE_PROPERTY">
<xsl:with-param name="DC_FIELD_NAME" select=""dc:rights""/>
<xsl:with-param name="DCTERMS_FIELD_NAME" select=""dcterms:rights""/>
</xsl:call-template>" ] } }, "metadata": [ <xsl:value-of select="//metadataFields/IE_LEVEL"/> ],<xsl:choose>
<xsl:when test="/mets:mets/mets:amdSec[@ID='ie-amd']/mets:techMD[@ID='ie-amd-tech']/mets:mdWrap/mets:xmlData/dnx:dnx/dnx:section[@id='objectCharacteristics']/dnx:record/dnx:key[@id='owner']"> "logo": [ { "id": "<xsl:value-of select="$DELIVERY_BASE_URL"/>images/<xsl:value-of select="$UI_CUSTOMIZATION"/>/logo-main.png", "type": "Image" } ], "provider": [ { "id": "https://example.org/about", "type": "Agent", "label": { "none": [ "<xsl:value-of select="$CONSOTRIUM_ID"/>" ] }, "logo": [ { "id":"<xsl:value-of select="$DELIVERY_BASE_URL"/>images/<xsl:value-of select="$UI_CUSTOMIZATION"/>/logo-main.png", "type": "Image" } ] } ], "rights": "", </xsl:when>
<xsl:otherwise> "logo": [ { "id": "<xsl:value-of select="$DELIVERY_BASE_URL"/>images/1/logo-main.png", "type": "Image" } ], "provider": [ { "id": "https://example.org/about", "type": "Agent", "label": { "none": [ "<xsl:value-of select="$CONSOTRIUM_ID"/>" ] }, "logo": [ { "id": "<xsl:value-of select="$DELIVERY_BASE_URL"/>images/1/logo-main.png", "type": "Image" } ] } ], "rights": "", </xsl:otherwise>
</xsl:choose> "thumbnail": [ { "id": "<xsl:value-of select="$DELIVERY_BASE_URL"/>DeliveryManagerServlet?dps_pid=<xsl:value-of select="$PID"/>
<xsl:value-of select="$THUMBNAIL_FUNC"/>", "type": "Image" }], <xsl:variable name="VIEWING_DIRECTION_VALUE">
<xsl:choose>
<xsl:when test="/mets:mets/mets:dmdSec[@ID='ie-dmd']/mets:mdWrap/mets:xmlData/dc:record/dc:language='heb'"> "right-to-left" </xsl:when>
<xsl:when test="/mets:mets/mets:dmdSec[@ID='ie-dmd']/mets:mdWrap/mets:xmlData/dc:record/dc:language='ara'"> "right-to-left" </xsl:when>
<xsl:when test="/mets:mets/mets:dmdSec[@ID='ie-dmd']/mets:mdWrap/mets:xmlData/dc:record/dc:language='chi'"> "top-to-bottom" </xsl:when>
<xsl:otherwise> "left-to-right" </xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:value-of select="$VIEWING_DIRECTION"/>
<xsl:value-of select="$VIEWING_DIRECTION_VALUE"/>, <xsl:variable name="VIEWING_HINT_VALUE">
<xsl:choose>
<xsl:when test="/mets:mets/mets:amdSec[@ID='ie-amd']/mets:techMD[@ID='ie-amd-tech']/mets:mdWrap/mets:xmlData/dnx:dnx/dnx:section[@id='generalIECharacteristics']/dnx:record/dnx:key[@id='IEEntityType']='Book'"> "paged", </xsl:when>
<xsl:otherwise> "individuals", </xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:value-of select="$VIEWING_HINT"/>
<xsl:value-of select="$VIEWING_HINT_VALUE"/>
</xsl:template>
<xsl:template name="SEQUENCES">"items": [ <xsl:variable name="HAS_PHYSICAL_SM" select="count(/mets:mets/mets:structMap[upper-case(@TYPE)='PHYSICAL']) > 0"/>
<xsl:variable name="HAS_LOGICAL_SM" select="count(/mets:mets/mets:structMap[upper-case(@TYPE)='LOGICAL']) > 0"/>
<xsl:choose>
<xsl:when test="$HAS_LOGICAL_SM = true()">
<xsl:for-each select="//mets:structMap[upper-case(@TYPE)='LOGICAL']/mets:div/mets:div/mets:div[@TYPE='FILE']">
<xsl:variable name="FILEID" select="./mets:fptr/@FILEID"/>
<!-- <xsl:variable name="FILE_LABEL_LABEL" select="/mets:mets/mets:amdSec[@ID=concat($FILEID,'-amd')]/mets:techMD[@ID=concat($FILEID,'-amd-tech')]/mets:mdWrap/mets:xmlData/dnx:dnx/dnx:section[@id='generalFileCharacteristics']/dnx:record/dnx:key[@id='label']/text()"/> -->
<xsl:variable name="FILE_LABEL_LABEL" select="./@LABEL"/>
<!-- <xsl:variable name="FILE_LABEL_NAME" select="(/mets:mets/mets:amdSec[@ID=concat($FILEID,'-amd')]/mets:techMD[@ID=concat($FILEID,'-amd-tech')]/mets:mdWrap/mets:xmlData/dnx:dnx/dnx:section[@id='generalFileCharacteristics']/dnx:record/dnx:key[@id='fileOriginalName'])[1]/text()"/> -->
<xsl:variable name="FILE_LABEL_NAME" select="./@LABEL"/>
<xsl:variable name="FILE_SM_LABEL" select="//mets:div/@LABEL[./mets:fptr/@FILEID=$FILEID]"/>
<xsl:call-template name="CANVAS">
<xsl:with-param name="FILE_ID" select="$FILEID"/>
<xsl:with-param name="FILE_LABEL">
<xsl:choose>
<xsl:when test="$FILE_SM_LABEL">
<xsl:value-of select="$FILE_SM_LABEL"/>
</xsl:when>
<xsl:when test="$FILE_LABEL_LABEL">
<xsl:value-of select="$FILE_LABEL_LABEL"/>
</xsl:when>
<xsl:when test="$FILE_LABEL_NAME">
<xsl:value-of select="$FILE_LABEL_NAME"/>
</xsl:when>
<xsl:otherwise/>
</xsl:choose>
</xsl:with-param>
</xsl:call-template>
</xsl:for-each>
</xsl:when>
<xsl:when test="$HAS_PHYSICAL_SM = true()">
<xsl:for-each select="//mets:structMap[upper-case(@TYPE)='PHYSICAL']/mets:div/mets:div/mets:div[@TYPE='FILE']">
<xsl:variable name="FILEID" select="./mets:fptr/@FILEID"/>
<xsl:variable name="FILE_LABEL_LABEL" select="/mets:mets/mets:amdSec[@ID=concat($FILEID,'-amd')]/mets:techMD[@ID=concat($FILEID,'-amd-tech')]/mets:mdWrap/mets:xmlData/dnx:dnx/dnx:section[@id='generalFileCharacteristics']/dnx:record/dnx:key[@id='label']/text()"/>
<xsl:variable name="FILE_LABEL_NAME" select="(/mets:mets/mets:amdSec[@ID=concat($FILEID,'-amd')]/mets:techMD[@ID=concat($FILEID,'-amd-tech')]/mets:mdWrap/mets:xmlData/dnx:dnx/dnx:section[@id='generalFileCharacteristics']/dnx:record/dnx:key[@id='fileOriginalName'])[1]/text()"/>
<xsl:variable name="FILE_SM_LABEL" select="//mets:div/@LABEL[./mets:fptr/@FILEID=$FILEID]"/>
<xsl:call-template name="CANVAS">
<xsl:with-param name="FILE_ID" select="$FILEID"/>
<xsl:with-param name="FILE_LABEL">
<xsl:choose>
<xsl:when test="$FILE_SM_LABEL">
<xsl:value-of select="$FILE_SM_LABEL"/>
</xsl:when>
<xsl:when test="$FILE_LABEL_LABEL">
<xsl:value-of select="$FILE_LABEL_LABEL"/>
</xsl:when>
<xsl:when test="$FILE_LABEL_NAME">
<xsl:value-of select="$FILE_LABEL_NAME"/>
</xsl:when>
<xsl:otherwise/>
</xsl:choose>
</xsl:with-param>
</xsl:call-template>
</xsl:for-each>
</xsl:when>
<xsl:otherwise>
<xsl:for-each select="//mets:fileGrp/mets:file">
<xsl:variable name="FILEID" select="./@ID"/>
<xsl:variable name="FILE_LABEL_LABEL" select="/mets:mets/mets:amdSec[@ID=concat($FILEID,'-amd')]/mets:techMD[@ID=concat($FILEID,'-amd-tech')]/mets:mdWrap/mets:xmlData/dnx:dnx/dnx:section[@id='generalFileCharacteristics']/dnx:record/dnx:key[@id='label']/text()"/>
<xsl:variable name="FILE_LABEL_NAME" select="(/mets:mets/mets:amdSec[@ID=concat($FILEID,'-amd')]/mets:techMD[@ID=concat($FILEID,'-amd-tech')]/mets:mdWrap/mets:xmlData/dnx:dnx/dnx:section[@id='generalFileCharacteristics']/dnx:record/dnx:key[@id='fileOriginalName'])[1]/text()"/>
<xsl:call-template name="CANVAS">
<xsl:with-param name="FILE_ID" select="$FILEID"/>
<xsl:with-param name="FILE_LABEL">
<xsl:choose>
<xsl:when test="$FILE_LABEL_LABEL">
<xsl:value-of select="$FILE_LABEL_LABEL"/>
</xsl:when>
<xsl:when test="$FILE_LABEL_NAME">
<xsl:value-of select="$FILE_LABEL_NAME"/>
</xsl:when>
<xsl:otherwise/>
</xsl:choose>
</xsl:with-param>
</xsl:call-template>
</xsl:for-each>
</xsl:otherwise>
</xsl:choose> ], </xsl:template>
<xsl:template name="CANVAS">
<xsl:param name="FILE_ID"/>
<xsl:param name="FILE_LABEL"/>
<xsl:variable name="HEIGHT_VALUE" select="/mets:mets/mets:amdSec[@ID=concat($FILE_ID,'-amd')]/mets:techMD[@ID=concat($FILE_ID,'-amd-tech')]/mets:mdWrap/mets:xmlData/dnx:dnx/dnx:section/dnx:record[dnx:key[@id='significantPropertiesType']='nisoImage.imageLength']/dnx:key[@id='significantPropertiesValue']"/>
<xsl:variable name="WIDTH_VALUE" select="/mets:mets/mets:amdSec[@ID=concat($FILE_ID,'-amd')]/mets:techMD[@ID=concat($FILE_ID,'-amd-tech')]/mets:mdWrap/mets:xmlData/dnx:dnx/dnx:section/dnx:record[dnx:key[@id='significantPropertiesType']='nisoImage.imageWidth']/dnx:key[@id='significantPropertiesValue']"/>
<xsl:variable name="FILE_EXTENSION" select="/mets:mets/mets:amdSec[@ID=concat($FILE_ID,'-amd')]/mets:techMD[@ID=concat($FILE_ID,'-amd-tech')]/mets:mdWrap/mets:xmlData/dnx:dnx/dnx:section[@id='generalFileCharacteristics']/dnx:record/dnx:key[@id='fileExtension']"/>
<xsl:variable name="FILE_FORMAT_VALUE" select="/mets:mets/mets:amdSec[@ID=concat($FILE_ID,'-amd')]/mets:techMD[@ID=concat($FILE_ID,'-amd-tech')]/mets:mdWrap/mets:xmlData/dnx:dnx/dnx:section[@id='generalFileCharacteristics']/dnx:record/dnx:key[@id='fileMIMEType']"/>
<xsl:variable name="FILE_SIZE_VALUE" select="/mets:mets/mets:amdSec[@ID=concat($FILE_ID,'-amd')]/mets:techMD[@ID=concat($FILE_ID,'-amd-tech')]/mets:mdWrap/mets:xmlData/dnx:dnx/dnx:section[@id='generalFileCharacteristics']/dnx:record/dnx:key[@id='fileSizeBytes']"/>
<xsl:variable name="DURATION_VALUE" select="/mets:mets/mets:amdSec[@ID=concat($FILE_ID,'-amd')]/mets:techMD[@ID=concat($FILE_ID,'-amd-tech')]/mets:mdWrap/mets:xmlData/dnx:dnx/dnx:section/dnx:record[dnx:key[@id='significantPropertiesType']='audio.durationTotalMilliSeconds']/dnx:key[@id='significantPropertiesValue']"/>
<xsl:variable name="FILE_TYPE">
<xsl:choose>
<xsl:when test="contains($FILE_FORMAT_VALUE, 'video')">Video</xsl:when>
<xsl:when test="contains($FILE_FORMAT_VALUE, 'audio')">Sound</xsl:when>
<xsl:when test="contains($FILE_FORMAT_VALUE, 'pdf')">Text</xsl:when>
<xsl:otherwise>Image</xsl:otherwise>
</xsl:choose>
</xsl:variable> { <xsl:value-of select="$ID"/>
<xsl:value-of select="$DELIVERY_BASE_URL"/>
<xsl:value-of select="$URI_PREFIX"/>
<xsl:value-of select="$PID"/>/canvas/<xsl:value-of select="$FILE_ID"/>", <xsl:value-of select="$TYPE"/>Canvas", "label": { "none": [ "<xsl:value-of select="$FILE_LABEL"/>" ] }, "metadata": [ <xsl:value-of select="//metadataFields/FILE_LEVEL/FILE_MD[@id=$FILE_ID]"/> ], <xsl:if test="$isDownloadFile = true()"> "rendering": [{ <xsl:value-of select="$ID"/>
<xsl:value-of select="$DELIVERY_BASE_URL"/>DeliveryManagerServlet?dps_pid=<xsl:value-of select="$FILE_ID"/>
<xsl:value-of select="$DOWNLOAD_FUNC"/>", <xsl:value-of select="$FILE_FORMAT"/>
<xsl:value-of select="$FILE_FORMAT_VALUE"/>", <xsl:value-of select="$LABEL"/>Original file -<xsl:value-of select="format-number($FILE_SIZE_VALUE div 1024 div 1024,'###,###,##0.00')"/>MB" }], </xsl:if>
<xsl:choose>
<xsl:when test="$HEIGHT_VALUE!='' and $WIDTH_VALUE!=''">
<xsl:value-of select="$HEIGHT"/>
<xsl:value-of select="$HEIGHT_VALUE"/>, <xsl:value-of select="$WIDTH"/>
<xsl:value-of select="$WIDTH_VALUE"/>, </xsl:when>
</xsl:choose>
<xsl:if test="$FILE_TYPE='Sound' or $FILE_TYPE='Video'">
<xsl:value-of select="$DURATION"/>
<xsl:choose>
<xsl:when test="$DURATION_VALUE">
<xsl:value-of select="$DURATION_VALUE div 1000"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$DURATION_PLACE_HOLDER"/>
<xsl:value-of select="$FILE_ID"/>
</xsl:otherwise>
</xsl:choose>, </xsl:if> "items": [{ "id":"<xsl:value-of select="$DELIVERY_BASE_URL"/>
<xsl:value-of select="$URI_PREFIX"/>
<xsl:value-of select="$PID"/>/annopage/<xsl:value-of select="$FILE_ID"/>", "type": "AnnotationPage", "items": [ { "id":"<xsl:value-of select="$DELIVERY_BASE_URL"/>
<xsl:value-of select="$URI_PREFIX"/>
<xsl:value-of select="$PID"/>/annotation/<xsl:value-of select="$FILE_ID"/>", "type": "Annotation", "motivation": "painting", "target": "<xsl:value-of select="$DELIVERY_BASE_URL"/>
<xsl:value-of select="$URI_PREFIX"/>
<xsl:value-of select="$PID"/>/canvas/<xsl:value-of select="$FILE_ID"/>", "body": { <xsl:value-of select="$ID"/>
<xsl:choose>
<xsl:when test="$FILE_TYPE='Image'">
<xsl:value-of select="$IMAGE_SERVER_BASE_URL"/>
<xsl:value-of select="$IMAGE_SERVER_PREFIX"/>
<xsl:value-of select="$PID"/>:<xsl:value-of select="$FILE_ID"/>.<xsl:value-of select="$FILE_EXTENSION"/>/full/max/0/default.jpg", </xsl:when>
<xsl:otherwise>
<xsl:value-of select="$DELIVERY_BASE_URL"/>stream/<xsl:value-of select="$FILE_ID"/>", </xsl:otherwise>
</xsl:choose>
<xsl:value-of select="$TYPE"/>
<xsl:value-of select="$FILE_TYPE"/>", <xsl:value-of select="$FILE_FORMAT"/>
<xsl:value-of select="$FILE_FORMAT_VALUE"/>" <xsl:choose>
<xsl:when test="$HEIGHT_VALUE!='' and $WIDTH_VALUE!=''"> , <xsl:value-of select="$HEIGHT"/>
<xsl:value-of select="$HEIGHT_VALUE"/>, <xsl:value-of select="$WIDTH"/>
<xsl:value-of select="$WIDTH_VALUE"/>
</xsl:when>
</xsl:choose>
<xsl:if test="$FILE_TYPE='Sound' or $FILE_TYPE='Video'">, <xsl:value-of select="$DURATION"/>
<xsl:choose>
<xsl:when test="$DURATION_VALUE">
<xsl:value-of select="$DURATION_VALUE div 1000"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$DURATION_PLACE_HOLDER"/>
<xsl:value-of select="$FILE_ID"/>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
<xsl:choose>
<xsl:when test="$FILE_TYPE='Image'"> , "service": [{ <xsl:value-of select="$SERVICE_CONTEXT"/>, <xsl:value-of select="$ID"/>
<xsl:value-of select="$IMAGE_SERVER_BASE_URL"/>
<xsl:value-of select="$IMAGE_SERVER_PREFIX"/>
<xsl:value-of select="$PID"/>:<xsl:value-of select="$FILE_ID"/>.<xsl:value-of select="$FILE_EXTENSION"/>", <xsl:value-of select="$PROFILE"/> }] </xsl:when>
</xsl:choose> } }] }] , "thumbnail":[{ <xsl:value-of select="$ID"/>
<xsl:value-of select="$DELIVERY_BASE_URL"/>DeliveryManagerServlet?dps_pid=<xsl:value-of select="$FILE_ID"/>
<xsl:value-of select="$THUMBNAIL_FUNC"/>" }] }<xsl:if test="position()!=last()">,</xsl:if>
</xsl:template>
<xsl:template name="RANGES"> "structures": [ <xsl:for-each select="/mets:mets/mets:structMap[upper-case(@TYPE)='LOGICAL']/mets:div/mets:div">
<xsl:choose>
<xsl:when test="not(./@TYPE='FILE')">
<xsl:call-template name="RANGE">
<xsl:with-param name="RANGE_ID" select="/mets:mets/mets:fileSec/mets:fileGrp/@ID"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise> {<xsl:value-of select="$ID"/>
<xsl:value-of select="$DELIVERY_BASE_URL"/>
<xsl:value-of select="$URI_PREFIX"/>
<xsl:value-of select="$PID"/>/canvas/<xsl:value-of select="./mets:fptr/@FILEID"/>", <xsl:value-of select="$TYPE"/>Canvas", <xsl:value-of select="$LABEL"/>
<xsl:value-of select="@LABEL"/>" </xsl:otherwise>
</xsl:choose>} <xsl:if test="position()!=last()">, </xsl:if>
</xsl:for-each> ] </xsl:template>
<xsl:template name="RANGE">
<xsl:param name="RANGE_ID"/> {<xsl:value-of select="$ID"/>
<xsl:value-of select="$DELIVERY_BASE_URL"/>
<xsl:value-of select="$URI_PREFIX"/>
<xsl:value-of select="$PID"/>/range/<xsl:value-of select="$RANGE_ID"/>", <xsl:value-of select="$TYPE"/>Range", <xsl:value-of select="$LABEL"/>
<xsl:value-of select="./@LABEL"/>", <xsl:choose>
<xsl:when test="./mets:div/@TYPE='FILE'"> "items": [ <xsl:for-each select="./mets:div"> "<xsl:value-of select="$DELIVERY_BASE_URL"/>
<xsl:value-of select="$URI_PREFIX"/>
<xsl:value-of select="$PID"/>/canvas/<xsl:value-of select="./mets:fptr/@FILEID"/>" <xsl:if test="position()!=last()">, </xsl:if>
</xsl:for-each> ], "items": [ <xsl:for-each select="./mets:div"> { <xsl:value-of select="$ID"/>
<xsl:value-of select="$DELIVERY_BASE_URL"/>
<xsl:value-of select="$URI_PREFIX"/>
<xsl:value-of select="$PID"/>/canvas/<xsl:value-of select="./mets:fptr/@FILEID"/>", <xsl:value-of select="$TYPE"/>Canvas", <xsl:value-of select="$LABEL"/>
<xsl:value-of select="@LABEL"/>"} <xsl:if test="position()!=last()">, </xsl:if>
</xsl:for-each> ] </xsl:when>
<xsl:otherwise> "items": [ <xsl:for-each select="./mets:div"> "<xsl:value-of select="$DELIVERY_BASE_URL"/>
<xsl:value-of select="$URI_PREFIX"/>
<xsl:value-of select="$PID"/>/range/<xsl:value-of select="concat($RANGE_ID,'-',position())"/>" <xsl:if test="position()!=last()">, </xsl:if>
</xsl:for-each> ], "items": [ <xsl:for-each select="./mets:div"> { <xsl:value-of select="$ID"/>
<xsl:value-of select="$DELIVERY_BASE_URL"/>
<xsl:value-of select="$URI_PREFIX"/>
<xsl:value-of select="$PID"/>/range/<xsl:value-of select="concat($RANGE_ID,'-',position())"/>", <xsl:value-of select="$TYPE"/>Range", <xsl:value-of select="$LABEL"/>
<xsl:value-of select="@LABEL"/>"} <xsl:if test="position()!=last()">, </xsl:if>
</xsl:for-each> ] <xsl:for-each select="./mets:div"> } ,<xsl:call-template name="RANGE">
<xsl:with-param name="RANGE_ID" select="concat($RANGE_ID,'-',position())"/>
</xsl:call-template>
</xsl:for-each>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:mets="http://www.loc.gov/METS/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:dcterms="http://purl.org/dc/terms/"
xmlns:dnx="http://www.exlibrisgroup.com/dps/dnx">
<xsl:output method="html" omit-xml-declaration="yes"/>
<xsl:param name="isDownloadFile" />
<xsl:variable name="PID"
select="/mets:mets/mets:amdSec[@ID=$IE_AMD_ID]/mets:techMD/mets:mdWrap/mets:xmlData/dnx:dnx/dnx:section[@id='internalIdentifier']/dnx:record[dnx:key[@id='internalIdentifierType']='PID']/dnx:key[@id='internalIdentifierValue']" />
<xsl:variable name="CONTEXT">"@context" : "http://iiif.io/api/presentation/2/context.json"</xsl:variable>
<xsl:variable name="SERVICE_CONTEXT">"@context" : "http://iiif.io/api/image/2/context.json"</xsl:variable>
<xsl:variable name="ID">"@id" : "</xsl:variable>
<xsl:variable name="TYPE">"@type" : "</xsl:variable>
<xsl:variable name="ON">"on" : "</xsl:variable>
<xsl:variable name="DELIVERY_BASE_URL">baseURLPlaceHolderdelivery/</xsl:variable>
<xsl:variable name="DOWNLOAD_FUNC">downloadFileFunc</xsl:variable>
<xsl:variable name="IMAGE_SERVER_BASE_URL">imageServerBaseURLPlaceHolder</xsl:variable>
<xsl:variable name="UI_CUSTOMIZATION">UIcustomizatioIDplaceHolder</xsl:variable>
<xsl:variable name="URI_PREFIX">iiif/presentation/2.1/</xsl:variable>
<xsl:variable name="IMAGE_SERVER_PREFIX">cantaloupe/iiif/2/</xsl:variable>
<xsl:variable name="DVS">DVSplaceHolder</xsl:variable>
<xsl:variable name="OBJECT_TYPE_IE">IE</xsl:variable>
<xsl:variable name="OBJECT_TYPE_REPRESENTATION">REP</xsl:variable>
<xsl:variable name="OBJECT_TYPE_FILE">FILE</xsl:variable>
<xsl:variable name="LABEL">"label" : "</xsl:variable>
<xsl:variable name="VALUE">"value" : "</xsl:variable>
<xsl:variable name="IE_AMD_ID">ie-amd</xsl:variable>
<xsl:variable name="IE_DMD_ID">ie-dmd</xsl:variable>
<xsl:variable name="DESCRIPTION">"description": "</xsl:variable>
<xsl:variable name="ATTRIBUTION">"attribution": "</xsl:variable>
<xsl:variable name="METADATA">"metadata": [</xsl:variable>
<xsl:variable name="LOGO">"logo": "</xsl:variable>
<xsl:variable name="LICENSE">"license": "</xsl:variable>
<xsl:variable name="THUMBNAIL">"thumbnail": "</xsl:variable>
<xsl:variable name="MOTIVATION">"motivation": "sc:painting",</xsl:variable>
<xsl:variable name="VIEWING_DIRECTION">"viewingDirection": </xsl:variable>
<xsl:variable name="VIEWING_HINT">"viewingHint": </xsl:variable>
<xsl:variable name="WIDTH">"width": </xsl:variable>
<xsl:variable name="HEIGHT">"height": </xsl:variable>
<xsl:variable name="WIDTH_PLACE_HOLDER">"widthPlaceholder</xsl:variable>
<xsl:variable name="HEIGHT_PLACE_HOLDER">"heightPlaceholder</xsl:variable>
<xsl:variable name="INFO_JSON">/info.json</xsl:variable>
<xsl:variable name="FILE_FORMAT">"format": "</xsl:variable>
<xsl:variable name="PROFILE">"profile": "http://iiif.io/api/image/2/level1.json" }</xsl:variable>
<xsl:template match="/">
{
<xsl:call-template name="MANIFEST" />
<xsl:call-template name="SEQUENCES" />
<xsl:call-template name="RANGES" />
}
</xsl:template>
<xsl:template name="IE_PROPERTY">
<xsl:param name="DC_FIELD_NAME" />
<xsl:param name="DCTERMS_FIELD_NAME" />
<xsl:choose>
<xsl:when test="/mets:mets/mets:dmdSec[@ID=$IE_DMD_ID]/mets:mdWrap/mets:xmlData/dc:record/*[name()=$DC_FIELD_NAME]">
<xsl:value-of select="/mets:mets/mets:dmdSec[@ID=$IE_DMD_ID]/mets:mdWrap/mets:xmlData/dc:record/*[name()=$DC_FIELD_NAME]" />
</xsl:when>
<xsl:when test="(//mets:dmdSec[@ID=$IE_DMD_ID]/mets:mdWrap/mets:xmlData/dc:record/*[name()=$DCTERMS_FIELD_NAME])[1]">
<xsl:value-of select="(//mets:dmdSec[@ID=$IE_DMD_ID]/mets:mdWrap/mets:xmlData/dc:record/*[name()=$DCTERMS_FIELD_NAME])[1]" />
</xsl:when>
<xsl:otherwise></xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="IE_METADATA">
<xsl:for-each select="/mets:mets/mets:dmdSec[@ID=$IE_DMD_ID]/mets:mdWrap/mets:xmlData/dc:record/dc:creator |
/mets:mets/mets:dmdSec[@ID=$IE_DMD_ID]/mets:mdWrap/mets:xmlData/dc:record/dcterms:creator ">
{<xsl:value-of select="$LABEL" />Author", <xsl:value-of select="$VALUE" />
<xsl:value-of select="." />"}
<xsl:if test="position()!=last() or count(//dc:subject) > 0 or count(//dcterms:subject) > 0">, </xsl:if>
</xsl:for-each>
<xsl:for-each select="/mets:mets/mets:dmdSec[@ID=$IE_DMD_ID]/mets:mdWrap/mets:xmlData/dc:record/dc:subject |
/mets:mets/mets:dmdSec[@ID=$IE_DMD_ID]/mets:mdWrap/mets:xmlData/dc:record/dcterms:subject">
{<xsl:value-of select="$LABEL" />Subject", <xsl:value-of select="$VALUE" />
<xsl:value-of select="." />"}
<xsl:if test="position()!=last()">, </xsl:if>
</xsl:for-each>
]
</xsl:template>
<xsl:template name="MANIFEST">
<xsl:value-of select="$CONTEXT" />,
<xsl:value-of select="$ID" /><xsl:value-of select="$DELIVERY_BASE_URL" /><xsl:value-of select="$URI_PREFIX" /><xsl:value-of select="$PID" />/manifest",
<xsl:value-of select="$TYPE" />sc:Manifest",
<xsl:value-of select="$LABEL" />
<xsl:call-template name="IE_PROPERTY">
<xsl:with-param name="DC_FIELD_NAME" select='"dc:title"' />
<xsl:with-param name="DCTERMS_FIELD_NAME" select='"dcterms:title"' />
</xsl:call-template>",
<xsl:value-of select="$DESCRIPTION" />
<xsl:call-template name="IE_PROPERTY">
<xsl:with-param name="DC_FIELD_NAME" select='"dc:description"' />
<xsl:with-param name="DCTERMS_FIELD_NAME" select='"dcterms:description"' />
</xsl:call-template>",
<xsl:value-of select="$ATTRIBUTION" />
<xsl:call-template name="IE_PROPERTY">
<xsl:with-param name="DC_FIELD_NAME" select='"dc:rights"' />
<xsl:with-param name="DCTERMS_FIELD_NAME" select='"dcterms:rights"' />
</xsl:call-template>",
<xsl:value-of select="$METADATA" />
<xsl:call-template name="IE_METADATA" />,
<xsl:choose>
<xsl:when
test="/mets:mets/mets:amdSec[@ID='ie-amd']/mets:techMD[@ID='ie-amd-tech']/mets:mdWrap/mets:xmlData/dnx:dnx/dnx:section[@id='objectCharacteristics']/dnx:record/dnx:key[@id='owner']">
<xsl:value-of select="$LOGO" /><xsl:value-of select="$DELIVERY_BASE_URL" />images/<xsl:value-of select="$UI_CUSTOMIZATION" />/logo-main.png",
<xsl:value-of select="$LICENSE" /><xsl:value-of select="$DELIVERY_BASE_URL" />general/termsofuse.jsp?dps_dvs=DVSplaceHolder",
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$LOGO" /><xsl:value-of select="$DELIVERY_BASE_URL" />images/1/logo-main.png",
<xsl:value-of select="$LICENSE" /><xsl:value-of select="$DELIVERY_BASE_URL" />general/termsofuse.jsp",
</xsl:otherwise>
</xsl:choose>
<xsl:value-of select="$THUMBNAIL" /><xsl:value-of select="$DELIVERY_BASE_URL" />DeliveryManagerServlet?dps_pid=<xsl:value-of select="$PID" />&dps_func=thumbnail",
</xsl:template>
<xsl:template name="SEQUENCES">
"sequences": [{
<xsl:variable name="REP_ID">
<xsl:value-of select="/mets:mets/mets:fileSec/mets:fileGrp/@ID" />
</xsl:variable>
<xsl:variable name="HAS_PHYSICAL_SM" select="count(/mets:mets/mets:structMap[upper-case(@TYPE)='PHYSICAL']) > 0" />
<xsl:variable name="HAS_LOGICAL_SM" select="count(/mets:mets/mets:structMap[upper-case(@TYPE)='LOGICAL']) > 0" />
<xsl:variable name="VIEWING_DIRECTION_VALUE">
<xsl:choose>
<xsl:when test="/mets:mets/mets:dmdSec[@ID='ie-dmd']/mets:mdWrap/mets:xmlData/dc:record/dc:language='heb'">
"right-to-left"
</xsl:when>
<xsl:when test="/mets:mets/mets:dmdSec[@ID='ie-dmd']/mets:mdWrap/mets:xmlData/dc:record/dc:language='ara'">
"right-to-left"
</xsl:when>
<xsl:when test="/mets:mets/mets:dmdSec[@ID='ie-dmd']/mets:mdWrap/mets:xmlData/dc:record/dc:language='chi'">
"top-to-bottom"
</xsl:when>
<xsl:otherwise>
"left-to-right"
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="VIEWING_HINT_VALUE">
<xsl:choose>
<xsl:when
test="/mets:mets/mets:amdSec[@ID='ie-amd']/mets:techMD[@ID='ie-amd-tech']/mets:mdWrap/mets:xmlData/dnx:dnx/dnx:section[@id='generalIECharacteristics']/dnx:record/dnx:key[@id='IEEntityType']='Book'">
"paged",
</xsl:when>
<xsl:otherwise>
"individuals",
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:value-of select="$ID" /><xsl:value-of select="$DELIVERY_BASE_URL" /><xsl:value-of select="$URI_PREFIX" /><xsl:value-of select="$PID" />/sequence/<xsl:value-of select="$REP_ID" />",
<xsl:value-of select="$TYPE" />sc:Sequence",
<xsl:value-of select="$LABEL" />
<xsl:choose>
<xsl:when test="$HAS_LOGICAL_SM = true()">
<xsl:value-of select="/mets:mets/mets:structMap[upper-case(@TYPE)='LOGICAL']/mets:div/mets:div/@LABEL" />",
</xsl:when>
<xsl:when test="$HAS_PHYSICAL_SM = true()">
<xsl:value-of select="/mets:mets/mets:structMap[upper-case(@TYPE)='PHYSICAL']/mets:div/mets:div/@LABEL" />",
</xsl:when>
<xsl:otherwise>
<xsl:value-of
select="/mets:mets/mets:amdSec[@ID=concat($REP_ID,'-amd')]/mets:techMD[@ID=concat($REP_ID,'-amd-tech')]/mets:mdWrap/mets:xmlData/dnx:dnx/dnx:section[@id='generalRepCharacteristics']/dnx:record/dnx:key[@id='label']" />",
</xsl:otherwise>
</xsl:choose>
<xsl:value-of select="$VIEWING_DIRECTION" /><xsl:value-of select="$VIEWING_DIRECTION_VALUE" />,
<xsl:value-of select="$VIEWING_HINT" /><xsl:value-of select="$VIEWING_HINT_VALUE" />
"canvases": [
<xsl:choose>
<xsl:when test="$HAS_LOGICAL_SM = true()">
<xsl:for-each select="//mets:structMap[upper-case(@TYPE)='LOGICAL']/mets:div/mets:div/mets:div[@TYPE='FILE']">
{
<xsl:variable name="FILEID" select="./mets:fptr/@FILEID" />
<!-- <xsl:variable name="FILE_LABEL_LABEL" select="/mets:mets/mets:amdSec[@ID=concat($FILEID,'-amd')]/mets:techMD[@ID=concat($FILEID,'-amd-tech')]/mets:mdWrap/mets:xmlData/dnx:dnx/dnx:section[@id='generalFileCharacteristics']/dnx:record/dnx:key[@id='label']/text()" /> -->
<!-- <xsl:variable name="FILE_LABEL_NAME" select="(/mets:mets/mets:amdSec[@ID=concat($FILEID,'-amd')]/mets:techMD[@ID=concat($FILEID,'-amd-tech')]/mets:mdWrap/mets:xmlData/dnx:dnx/dnx:section[@id='generalFileCharacteristics']/dnx:record/dnx:key[@id='fileOriginalName'])[1]/text()" /> -->
<xsl:variable name="FILE_LABEL_LABEL" select="./@LABEL"/>
<xsl:variable name="FILE_LABEL_NAME" select="./@LABEL"/>
<xsl:variable name="FILE_SM_LABEL" select="//mets:div/@LABEL[./mets:fptr/@FILEID=$FILEID]" />
<xsl:call-template name="CANVAS">
<xsl:with-param name="FILE_ID" select="$FILEID" />
<xsl:with-param name="FILE_LABEL">
<xsl:choose>
<xsl:when test="$FILE_SM_LABEL">
<xsl:value-of select="$FILE_SM_LABEL" />
</xsl:when>
<xsl:when test="$FILE_LABEL_LABEL">
<xsl:value-of select="$FILE_LABEL_LABEL" />
</xsl:when>
<xsl:when test="$FILE_LABEL_NAME">
<xsl:value-of select="$FILE_LABEL_NAME" />
</xsl:when>
<xsl:otherwise></xsl:otherwise>
</xsl:choose>
</xsl:with-param>
</xsl:call-template>
</xsl:for-each>
</xsl:when>
<xsl:when test="$HAS_PHYSICAL_SM = true()">
<xsl:for-each select="//mets:structMap[upper-case(@TYPE)='PHYSICAL']/mets:div/mets:div/mets:div[@TYPE='FILE']">
{
<xsl:variable name="FILEID" select="./mets:fptr/@FILEID" />
<xsl:variable name="FILE_LABEL_LABEL"
select="/mets:mets/mets:amdSec[@ID=concat($FILEID,'-amd')]/mets:techMD[@ID=concat($FILEID,'-amd-tech')]/mets:mdWrap/mets:xmlData/dnx:dnx/dnx:section[@id='generalFileCharacteristics']/dnx:record/dnx:key[@id='label']/text()" />
<xsl:variable name="FILE_LABEL_NAME"
select="(/mets:mets/mets:amdSec[@ID=concat($FILEID,'-amd')]/mets:techMD[@ID=concat($FILEID,'-amd-tech')]/mets:mdWrap/mets:xmlData/dnx:dnx/dnx:section[@id='generalFileCharacteristics']/dnx:record/dnx:key[@id='fileOriginalName'])[1]/text()" />
<xsl:variable name="FILE_SM_LABEL" select="//mets:div/@LABEL[./mets:fptr/@FILEID=$FILEID]" />
<xsl:call-template name="CANVAS">
<xsl:with-param name="FILE_ID" select="$FILEID" />
<xsl:with-param name="FILE_LABEL">
<xsl:choose>
<xsl:when test="$FILE_SM_LABEL">
<xsl:value-of select="$FILE_SM_LABEL" />
</xsl:when>
<xsl:when test="$FILE_LABEL_LABEL">
<xsl:value-of select="$FILE_LABEL_LABEL" />
</xsl:when>
<xsl:when test="$FILE_LABEL_NAME">
<xsl:value-of select="$FILE_LABEL_NAME" />
</xsl:when>
<xsl:otherwise></xsl:otherwise>
</xsl:choose>
</xsl:with-param>
</xsl:call-template>
</xsl:for-each>
</xsl:when>
<xsl:otherwise>
<xsl:for-each select="//mets:fileGrp/mets:file">
{
<xsl:variable name="FILEID" select="./@ID" />
<xsl:variable name="FILE_LABEL_LABEL"
select="/mets:mets/mets:amdSec[@ID=concat($FILEID,'-amd')]/mets:techMD[@ID=concat($FILEID,'-amd-tech')]/mets:mdWrap/mets:xmlData/dnx:dnx/dnx:section[@id='generalFileCharacteristics']/dnx:record/dnx:key[@id='label']/text()" />
<xsl:variable name="FILE_LABEL_NAME"
select="(/mets:mets/mets:amdSec[@ID=concat($FILEID,'-amd')]/mets:techMD[@ID=concat($FILEID,'-amd-tech')]/mets:mdWrap/mets:xmlData/dnx:dnx/dnx:section[@id='generalFileCharacteristics']/dnx:record/dnx:key[@id='fileOriginalName'])[1]/text()" />
<xsl:call-template name="CANVAS">
<xsl:with-param name="FILE_ID" select="$FILEID" />
<xsl:with-param name="FILE_LABEL">
<xsl:choose>
<xsl:when test="$FILE_LABEL_LABEL">
<xsl:value-of select="$FILE_LABEL_LABEL" />
</xsl:when>
<xsl:when test="$FILE_LABEL_NAME">
<xsl:value-of select="$FILE_LABEL_NAME" />
</xsl:when>
<xsl:otherwise></xsl:otherwise>
</xsl:choose>
</xsl:with-param>
</xsl:call-template>
</xsl:for-each>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="CANVAS">
<xsl:param name="FILE_ID" />
<xsl:param name="FILE_LABEL" />
<xsl:variable name="HEIGHT_VALUE"
select="/mets:mets/mets:amdSec[@ID=concat($FILE_ID,'-amd')]/mets:techMD[@ID=concat($FILE_ID,'-amd-tech')]/mets:mdWrap/mets:xmlData/dnx:dnx/dnx:section/dnx:record[dnx:key[@id='significantPropertiesType']='nisoImage.imageLength']/dnx:key[@id='significantPropertiesValue']" />
<xsl:variable name="WIDTH_VALUE"
select="/mets:mets/mets:amdSec[@ID=concat($FILE_ID,'-amd')]/mets:techMD[@ID=concat($FILE_ID,'-amd-tech')]/mets:mdWrap/mets:xmlData/dnx:dnx/dnx:section/dnx:record[dnx:key[@id='significantPropertiesType']='nisoImage.imageWidth']/dnx:key[@id='significantPropertiesValue']" />
<xsl:variable name="FILE_EXTANSION"
select="/mets:mets/mets:amdSec[@ID=concat($FILE_ID,'-amd')]/mets:techMD[@ID=concat($FILE_ID,'-amd-tech')]/mets:mdWrap/mets:xmlData/dnx:dnx/dnx:section[@id='generalFileCharacteristics']/dnx:record/dnx:key[@id='fileExtension']" />
<xsl:variable name="FILE_FORMAT_VALUE"
select="/mets:mets/mets:amdSec[@ID=concat($FILE_ID,'-amd')]/mets:techMD[@ID=concat($FILE_ID,'-amd-tech')]/mets:mdWrap/mets:xmlData/dnx:dnx/dnx:section[@id='generalFileCharacteristics']/dnx:record/dnx:key[@id='fileMIMEType']" />
<xsl:variable name="FILE_SIZE_VALUE"
select="/mets:mets/mets:amdSec[@ID=concat($FILE_ID,'-amd')]/mets:techMD[@ID=concat($FILE_ID,'-amd-tech')]/mets:mdWrap/mets:xmlData/dnx:dnx/dnx:section[@id='generalFileCharacteristics']/dnx:record/dnx:key[@id='fileSizeBytes']" />
<xsl:value-of select="$CONTEXT" />,
<xsl:value-of select="$ID" /><xsl:value-of select="$DELIVERY_BASE_URL" /><xsl:value-of select="$URI_PREFIX" /><xsl:value-of select="$PID" />/canvas/<xsl:value-of select="$FILE_ID" />",
<xsl:value-of select="$TYPE" />sc:Canvas",
<xsl:value-of select="$LABEL" /><xsl:value-of select="$FILE_LABEL" />",
<xsl:if test="$isDownloadFile = true()">
"rendering": [{
<xsl:value-of select="$ID" /><xsl:value-of select="$DELIVERY_BASE_URL" />DeliveryManagerServlet?dps_pid=<xsl:value-of select="$FILE_ID" /><xsl:value-of select="$DOWNLOAD_FUNC" />",
<xsl:value-of select="$FILE_FORMAT" /><xsl:value-of select="$FILE_FORMAT_VALUE" />",
<xsl:value-of select="$LABEL" />Original file - <xsl:value-of select="format-number($FILE_SIZE_VALUE div 1024 div 1024,'###,###,##0.00')"/>MB"
}],
</xsl:if>
<xsl:value-of select="$THUMBNAIL" /><xsl:value-of select="$DELIVERY_BASE_URL" />DeliveryManagerServlet?dps_pid=<xsl:value-of select="$FILE_ID" />&dps_func=thumbnail",
<xsl:value-of select="$HEIGHT" />
<xsl:choose>
<xsl:when test="$HEIGHT_VALUE">
<xsl:value-of select="$HEIGHT_VALUE" />,
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$HEIGHT_PLACE_HOLDER" /><xsl:value-of select="$IMAGE_SERVER_BASE_URL" /><xsl:value-of select="$IMAGE_SERVER_PREFIX" /><xsl:value-of select="$PID" />:<xsl:value-of select="$FILE_ID" />.<xsl:value-of select="$FILE_EXTANSION" /><xsl:value-of select="$INFO_JSON" />",
</xsl:otherwise>
</xsl:choose>
<xsl:value-of select="$WIDTH" />
<xsl:choose>
<xsl:when test="$WIDTH_VALUE">
<xsl:value-of select="$WIDTH_VALUE" />,
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$WIDTH_PLACE_HOLDER" /><xsl:value-of select="$IMAGE_SERVER_BASE_URL" /><xsl:value-of select="$IMAGE_SERVER_PREFIX" /><xsl:value-of select="$PID" />:<xsl:value-of select="$FILE_ID" />.<xsl:value-of select="$FILE_EXTANSION" /><xsl:value-of select="$INFO_JSON" />",
</xsl:otherwise>
</xsl:choose>
"images": [{
<xsl:value-of select="$CONTEXT" />,
<xsl:value-of select="$ID" /><xsl:value-of select="$DELIVERY_BASE_URL" /><xsl:value-of select="$URI_PREFIX" /><xsl:value-of select="$PID" />/annotation/<xsl:value-of select="$FILE_ID" />",
<xsl:value-of select="$TYPE" />oa:Annotation",
<xsl:value-of select="$MOTIVATION" />
"resource": {
<xsl:value-of select="$ID" /><xsl:value-of select="$DELIVERY_BASE_URL" /><xsl:value-of select="$URI_PREFIX" /><xsl:value-of select="$PID" />/res/<xsl:value-of select="$FILE_ID" />.<xsl:value-of select="$FILE_EXTANSION" />",
<xsl:value-of select="$TYPE" />dctypes:Image",
<xsl:value-of select="$FILE_FORMAT" /><xsl:value-of select="$FILE_FORMAT_VALUE" />",
"service": {
<xsl:value-of select="$SERVICE_CONTEXT" />,
<xsl:value-of select="$ID" /><xsl:value-of select="$IMAGE_SERVER_BASE_URL" /><xsl:value-of select="$IMAGE_SERVER_PREFIX" /><xsl:value-of select="$DVS" />:<xsl:value-of select="$FILE_ID" />.<xsl:value-of select="$FILE_EXTANSION" />",
<xsl:value-of select="$PROFILE" />,
<xsl:value-of select="$HEIGHT" />
<xsl:choose>
<xsl:when test="$HEIGHT_VALUE">
<xsl:value-of select="$HEIGHT_VALUE" />,
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$HEIGHT_PLACE_HOLDER" /><xsl:value-of select="$IMAGE_SERVER_BASE_URL" /><xsl:value-of select="$IMAGE_SERVER_PREFIX" /><xsl:value-of select="$PID" />:<xsl:value-of select="$FILE_ID" />.<xsl:value-of select="$FILE_EXTANSION" /><xsl:value-of select="$INFO_JSON" />",
</xsl:otherwise>
</xsl:choose>
<xsl:value-of select="$WIDTH" />
<xsl:choose>
<xsl:when test="$WIDTH_VALUE">
<xsl:value-of select="$WIDTH_VALUE" />
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$WIDTH_PLACE_HOLDER" /><xsl:value-of select="$IMAGE_SERVER_BASE_URL" /><xsl:value-of select="$IMAGE_SERVER_PREFIX" /><xsl:value-of select="$PID" />:<xsl:value-of select="$FILE_ID" />.<xsl:value-of select="$FILE_EXTANSION" /><xsl:value-of select="$INFO_JSON" />"
</xsl:otherwise>
</xsl:choose>
},
<xsl:value-of select="$ON" /><xsl:value-of select="$DELIVERY_BASE_URL" /><xsl:value-of select="$URI_PREFIX" /><xsl:value-of select="$PID" />/canvas/<xsl:value-of select="$FILE_ID" />"
}
]
}
<xsl:if test="position()!=last()">,
</xsl:if>
</xsl:template>
<xsl:template name="RANGES">
]
}
],
"structures": [
<xsl:for-each select="/mets:mets/mets:structMap[@TYPE='LOGICAL']/mets:div/mets:div">
<xsl:choose>
<xsl:when test="not(./@TYPE='FILE')">
<xsl:call-template name="RANGE">
<xsl:with-param name="RANGE_ID" select="/mets:mets/mets:fileSec/mets:fileGrp/@ID" />
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
{<xsl:value-of select="$ID" /><xsl:value-of select="$DELIVERY_BASE_URL" /><xsl:value-of select="$URI_PREFIX" /><xsl:value-of select="$PID" />/canvas/<xsl:value-of select="./mets:fptr/@FILEID" />",
<xsl:value-of select="$TYPE" />sc:Canvas",
<xsl:value-of select="$LABEL" /><xsl:value-of select="@LABEL" />"
</xsl:otherwise>
</xsl:choose>}
<xsl:if test="position()!=last()">, </xsl:if>
</xsl:for-each>
]
</xsl:template>
<xsl:template name="RANGE">
<xsl:param name="RANGE_ID" />
{<xsl:value-of select="$ID" /><xsl:value-of select="$DELIVERY_BASE_URL" /><xsl:value-of select="$URI_PREFIX" /><xsl:value-of select="$PID" />/range/<xsl:value-of select="$RANGE_ID" />",
<xsl:value-of select="$TYPE" />sc:Range",
<xsl:value-of select="$LABEL" /><xsl:value-of select="./@LABEL" />",
<xsl:choose>
<xsl:when test="./mets:div/@TYPE='FILE'">
"canvases": [
<xsl:for-each select="./mets:div">
"<xsl:value-of select="$DELIVERY_BASE_URL" /><xsl:value-of select="$URI_PREFIX" /><xsl:value-of select="$PID" />/canvas/<xsl:value-of select="./mets:fptr/@FILEID" />"
<xsl:if test="position()!=last()">, </xsl:if>
</xsl:for-each>
],
"members": [
<xsl:for-each select="./mets:div">
{
<xsl:value-of select="$ID" /><xsl:value-of select="$DELIVERY_BASE_URL" /><xsl:value-of select="$URI_PREFIX" /><xsl:value-of select="$PID" />/canvas/<xsl:value-of select="./mets:fptr/@FILEID" />",
<xsl:value-of select="$TYPE" />sc:Canvas",
<xsl:value-of select="$LABEL" /><xsl:value-of select="@LABEL" />"}
<xsl:if test="position()!=last()">, </xsl:if>
</xsl:for-each>
]
</xsl:when>
<xsl:otherwise>
"ranges": [
<xsl:for-each select="./mets:div">
"<xsl:value-of select="$DELIVERY_BASE_URL" /><xsl:value-of select="$URI_PREFIX" /><xsl:value-of select="$PID" />/range/<xsl:value-of select="concat($RANGE_ID,'-',position())" />"
<xsl:if test="position()!=last()">, </xsl:if>
</xsl:for-each>
],
"members": [
<xsl:for-each select="./mets:div">
{
<xsl:value-of select="$ID" /><xsl:value-of select="$DELIVERY_BASE_URL" /><xsl:value-of select="$URI_PREFIX" /><xsl:value-of select="$PID" />/range/<xsl:value-of select="concat($RANGE_ID,'-',position())" />",
<xsl:value-of select="$TYPE" />sc:Range",
<xsl:value-of select="$LABEL" /><xsl:value-of select="@LABEL" />"}
<xsl:if test="position()!=last()">, </xsl:if>
</xsl:for-each>
]
<xsl:for-each select="./mets:div">
} ,<xsl:call-template name="RANGE">
<xsl:with-param name="RANGE_ID" select="concat($RANGE_ID,'-',position())" />
</xsl:call-template>
</xsl:for-each>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>
- Article last edited: 18-Apr-2022