Changeset 37018 for gs3-installations


Ignore:
Timestamp:
2022-12-10T23:19:11+13:00 (17 months ago)
Author:
davidb
Message:

Introduction of book/bookswitch param for mirador. Serves static content when accessing Mirador viewer

Location:
gs3-installations/intermuse/trunk/sites/intermuse/collect/programmes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • gs3-installations/intermuse/trunk/sites/intermuse/collect/programmes/etc/collectionConfig.xml

    r37012 r37018  
    3434                </gsf:choose-metadata>
    3535            </gsf:template>
     36
     37
     38            <xsl:template name="document-link-mirador">
     39              <a>
     40                <xsl:attribute name="href">
     41                  <xsl:value-of select='$library_name'/>
     42                  <xsl:text>/collection/</xsl:text>
     43                  <xsl:value-of select='/page/pageResponse/collection/@name'/>
     44                  <xsl:text>/document/</xsl:text>
     45                  <xsl:choose>
     46                <xsl:when test="@OID">
     47                  <xsl:value-of select="@OID"/>
     48                </xsl:when>
     49                <xsl:when test="@OIDmetadata">
     50                  <xsl:variable name="OIDmeta" select="@OIDmetadata"/>
     51                  <xsl:value-of select="metadataList/metadata[@name='{$OIDmeta}']"/>
     52                </xsl:when>
     53                <xsl:otherwise>
     54                  <xsl:value-of select='@nodeID'/>
     55                </xsl:otherwise>
     56                  </xsl:choose>               
     57                  <xsl:text>?book=mirador</xsl:text>
     58                </xsl:attribute>
     59                (<gsf:icon type="document" style="vertical-align:middle;"/> Mirador Annotate)
     60                <!-- <xsl:copy-of select="@value"/> -->
     61                <!-- <xsl:apply-templates selet="@*|node()"/> -->
     62              </a>
     63            </xsl:template>
     64           
    3665<!--
    3766modify the collection description template to output the "this collection contains X documents and was last built Y days ago" message
     
    89118                </gsf:link>
    90119              </td>
     120              <td valign="top">
     121                <xsl:call-template name="document-link-mirador" />
     122              </td>
    91123              <td>
    92124                <gsf:link type="document">
     
    184216                </gsf:link>
    185217              </td>
     218
     219              <td valign="top">
     220                <xsl:call-template name="document-link-mirador"/>
     221              </td>
     222             
    186223              <td valign="top">
    187224                <gsf:link type="document">
  • gs3-installations/intermuse/trunk/sites/intermuse/collect/programmes/transform/pages/document.xsl

    r37017 r37018  
    99    exclude-result-prefixes="java util gsf">
    1010
    11 
     11 
    1212  <xsl:template name="iiif-links">
    1313    <xsl:param name="identifier"/>
     
    9999     </style>
    100100  </xsl:template>
    101  
    102   <xsl:template name="documentPost">
     101
     102
     103  <xsl:template name="documentContentMirador">
     104   
     105    <gsf:script src="https://unpkg.com/mirador@latest/dist/mirador.min.js"/>
     106
     107   
     108    <!-- By default uses Roboto font. Be sure to load this or change the font -->
     109    <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500" />
     110    <!-- Container element of Mirador whose id should be passed to the instantiating call as "id" -->
     111   
     112    <div style="position: relative; width: 100%; height: 800px;">
     113      <div id="my-mirador"> <xsl:comment>filler</xsl:comment></div>
     114    </div>
     115   
     116    <gsf:script>
     117                 
     118var mirador = Mirador.viewer({
     119  "id": "my-mirador",
     120  "manifests": {
     121    "https://intermuse.sowemustthink.space/greenstone3/sample-manifest.json": {
     122      "provider": "IntermusE"
     123    }
     124    },
     125  "window" : { "panels" : { "annotations": true, "attribution": false } },
     126  "annotations": {
     127    "htmlSanitizationRuleSet": 'iiif', // See src/lib/htmlRules.js for acceptable values
     128    "filteredMotivations": ['oa:commenting', 'oa:tagging', 'sc:painting', 'commenting', 'tagging'],
     129  },   
     130  "windows": [
     131    {
     132      "loadedManifest": "https://intermuse.sowemustthink.space/greenstone3/sample-manifest.json",
     133      "canvasIndex": 2,
     134      "thumbnailNavigationPosition": 'far-bottom'
     135    }
     136  ]
     137});
     138    </gsf:script>
     139
     140
    103141    <xsl:if test="@docType='simple'">
    104142      <!-- add in IIIF Server link for simple page image -->
     
    106144    <xsl:with-param name="identifier" select="$docID" />
    107145      </xsl:call-template>
     146    </xsl:if>
     147
     148
     149  </xsl:template>
     150 
     151  <xsl:template name="documentContent">
     152    <div id="gs-document">
     153
     154      <xsl:choose>
     155    <xsl:when test="$bookswitch = 'mirador'">
     156      <xsl:call-template name="documentPre"/>
     157      <xsl:call-template name="documentContentMirador"/>
     158      <xsl:call-template name="documentPost"/>
     159    </xsl:when>
     160    <xsl:otherwise>
     161      <div>book swith = <xsl:value-of select="$bookswitch"/></div>
     162      <xsl:call-template name="documentPre"/>
     163      <xsl:call-template name="wrappedSectionImage"/>
     164      <div id="gs-document-text">
     165        <xsl:call-template name="documentNodeText"/>
     166      </div>
     167      <xsl:call-template name="documentPost"/>
     168    </xsl:otherwise>
     169      </xsl:choose>
     170    </div>
     171     
     172  </xsl:template>
     173
     174 
     175  <xsl:template name="documentPost">
     176    <xsl:if test="@docType='simple'">
    108177
    109178      <!--
     
    122191-->
    123192     
    124     </xsl:if>   
     193    </xsl:if>
     194
     195
     196
    125197  </xsl:template>
    126198
Note: See TracChangeset for help on using the changeset viewer.