mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-07 01:54:22 +00:00
[DS-706] Alternative to dri2xhtml, with the goal to be more developer-friendly
git-svn-id: http://scm.dspace.org/svn/repo/dspace/trunk@5447 9c30dcfa-912a-0410-8fc2-9e0234be79fd
This commit is contained in:
@@ -0,0 +1,91 @@
|
||||
<!--
|
||||
harvesting.xsl
|
||||
|
||||
Version: $Revision: 3705 $
|
||||
|
||||
Date: $Date: 2009-04-11 17:02:24 +0000 (Sat, 11 Apr 2009) $
|
||||
|
||||
Copyright (c) 2002-2005, Hewlett-Packard Company and Massachusetts
|
||||
Institute of Technology. All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
- Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
- Neither the name of the Hewlett-Packard Company nor the name of the
|
||||
Massachusetts Institute of Technology nor the names of their
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
|
||||
TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
|
||||
USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
|
||||
DAMAGE.
|
||||
-->
|
||||
|
||||
<!--
|
||||
OAI harvesting specific rendering
|
||||
|
||||
Author: art.lowel at atmire.com
|
||||
Author: lieven.droogmans at atmire.com
|
||||
Author: ben at atmire.com
|
||||
Author: Alexey Maslov
|
||||
|
||||
-->
|
||||
|
||||
<xsl:stylesheet xmlns:i18n="http://apache.org/cocoon/i18n/2.1"
|
||||
xmlns:dri="http://di.tamu.edu/DRI/1.0/"
|
||||
xmlns:mets="http://www.loc.gov/METS/"
|
||||
xmlns:xlink="http://www.w3.org/TR/xlink/"
|
||||
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
|
||||
xmlns:dim="http://www.dspace.org/xmlns/dspace/dim"
|
||||
xmlns:xhtml="http://www.w3.org/1999/xhtml"
|
||||
xmlns:mods="http://www.loc.gov/mods/v3"
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns="http://www.w3.org/1999/xhtml"
|
||||
exclude-result-prefixes="i18n dri mets xlink xsl dim xhtml mods dc">
|
||||
|
||||
<xsl:output indent="yes"/>
|
||||
|
||||
<xsl:template match="dri:field[@id='aspect.administrative.collection.SetupCollectionHarvestingForm.field.oai-set-comp' and @type='composite']" mode="formComposite" priority="2">
|
||||
<xsl:for-each select="dri:field[@type='radio']">
|
||||
<div class="ds-form-content">
|
||||
<xsl:for-each select="dri:option">
|
||||
<input type="radio">
|
||||
<xsl:attribute name="id"><xsl:value-of select="@returnValue"/></xsl:attribute>
|
||||
<xsl:attribute name="name"><xsl:value-of select="../@n"/></xsl:attribute>
|
||||
<xsl:attribute name="value"><xsl:value-of select="@returnValue"/></xsl:attribute>
|
||||
<xsl:if test="../dri:value[@type='option'][@option = current()/@returnValue]">
|
||||
<xsl:attribute name="checked">checked</xsl:attribute>
|
||||
</xsl:if>
|
||||
</input>
|
||||
<label>
|
||||
<xsl:attribute name="for"><xsl:value-of select="@returnValue"/></xsl:attribute>
|
||||
<xsl:value-of select="text()"/>
|
||||
</label>
|
||||
<xsl:if test="@returnValue = 'specific'">
|
||||
<xsl:apply-templates select="../../dri:field[@n='oai_setid']"/>
|
||||
</xsl:if>
|
||||
<br/>
|
||||
</xsl:for-each>
|
||||
</div>
|
||||
</xsl:for-each>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
</xsl:stylesheet>
|
@@ -0,0 +1,112 @@
|
||||
<!--
|
||||
COinS.xsl
|
||||
|
||||
Version: $Revision: 3705 $
|
||||
|
||||
Date: $Date: 2009-04-11 17:02:24 +0000 (Sat, 11 Apr 2009) $
|
||||
|
||||
Copyright (c) 2002-2005, Hewlett-Packard Company and Massachusetts
|
||||
Institute of Technology. All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
- Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
- Neither the name of the Hewlett-Packard Company nor the name of the
|
||||
Massachusetts Institute of Technology nor the names of their
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
|
||||
TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
|
||||
USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
|
||||
DAMAGE.
|
||||
-->
|
||||
|
||||
<!--
|
||||
Rendering of the OpenURL COinS references
|
||||
|
||||
Author: art.lowel at atmire.com
|
||||
Author: lieven.droogmans at atmire.com
|
||||
Author: ben at atmire.com
|
||||
Author: Alexey Maslov
|
||||
|
||||
-->
|
||||
|
||||
<xsl:stylesheet
|
||||
xmlns:i18n="http://apache.org/cocoon/i18n/2.1"
|
||||
xmlns:dri="http://di.tamu.edu/DRI/1.0/"
|
||||
xmlns:mets="http://www.loc.gov/METS/"
|
||||
xmlns:dim="http://www.dspace.org/xmlns/dspace/dim"
|
||||
xmlns:xlink="http://www.w3.org/TR/xlink/"
|
||||
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
|
||||
xmlns:atom="http://www.w3.org/2005/Atom"
|
||||
xmlns:ore="http://www.openarchives.org/ore/terms/"
|
||||
xmlns:oreatom="http://www.openarchives.org/ore/atom/"
|
||||
xmlns="http://www.w3.org/1999/xhtml"
|
||||
xmlns:xalan="http://xml.apache.org/xalan"
|
||||
xmlns:encoder="xalan://java.net.URLEncoder"
|
||||
exclude-result-prefixes="xalan encoder i18n dri mets dim xlink xsl">
|
||||
|
||||
<xsl:output indent="yes"/>
|
||||
|
||||
|
||||
<!--
|
||||
*********************************************
|
||||
OpenURL COinS Rendering Template
|
||||
*********************************************
|
||||
|
||||
COinS Example:
|
||||
|
||||
<span class="Z3988"
|
||||
title="ctx_ver=Z39.88-2004&
|
||||
rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Adc&
|
||||
rfr_id=info%3Asid%2Focoins.info%3Agenerator&
|
||||
rft.title=Making+WordPress+Content+Available+to+Zotero&
|
||||
rft.aulast=Kraus&
|
||||
rft.aufirst=Kari&
|
||||
rft.subject=News&
|
||||
rft.source=Zotero%3A+The+Next-Generation+Research+Tool&
|
||||
rft.date=2007-02-08&
|
||||
rft.type=blogPost&
|
||||
rft.format=text&
|
||||
rft.identifier=http://www.zotero.org/blog/making-wordpress-content-available-to-zotero/&
|
||||
rft.language=English"></span>
|
||||
|
||||
This Code does not parse authors names, instead relying on dc.contributor to populate the
|
||||
coins
|
||||
-->
|
||||
|
||||
<xsl:template name="renderCOinS">
|
||||
<xsl:text>ctx_ver=Z39.88-2004&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Adc&</xsl:text>
|
||||
<xsl:for-each select=".//dim:field[@element = 'identifier']">
|
||||
<xsl:text>rft_id=</xsl:text>
|
||||
<xsl:value-of select="encoder:encode(string(.))"/>
|
||||
<xsl:text>&</xsl:text>
|
||||
</xsl:for-each>
|
||||
<xsl:text>rfr_id=info%3Asid%2Fdatadryad.org%3Arepo&</xsl:text>
|
||||
<xsl:for-each select=".//dim:field[@element != 'description' and @mdschema !='dc' and @qualifier != 'provenance']">
|
||||
<xsl:value-of select="concat('rft.', @element,'=',encoder:encode(string(.))) "/>
|
||||
<xsl:if test="position()!=last()">
|
||||
<xsl:text>&</xsl:text>
|
||||
</xsl:if>
|
||||
</xsl:for-each>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
</xsl:stylesheet>
|
@@ -0,0 +1,172 @@
|
||||
<!--
|
||||
ORE.xsl
|
||||
|
||||
Version: $Revision: 3705 $
|
||||
|
||||
Date: $Date: 2009-04-11 17:02:24 +0000 (Sat, 11 Apr 2009) $
|
||||
|
||||
Copyright (c) 2002-2005, Hewlett-Packard Company and Massachusetts
|
||||
Institute of Technology. All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
- Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
- Neither the name of the Hewlett-Packard Company nor the name of the
|
||||
Massachusetts Institute of Technology nor the names of their
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
|
||||
TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
|
||||
USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
|
||||
DAMAGE.
|
||||
-->
|
||||
|
||||
<!--
|
||||
Files listing rendering specific to the ORE bundle
|
||||
|
||||
Author: art.lowel at atmire.com
|
||||
Author: lieven.droogmans at atmire.com
|
||||
Author: ben at atmire.com
|
||||
Author: Alexey Maslov
|
||||
|
||||
-->
|
||||
|
||||
<xsl:stylesheet
|
||||
xmlns:i18n="http://apache.org/cocoon/i18n/2.1"
|
||||
xmlns:dri="http://di.tamu.edu/DRI/1.0/"
|
||||
xmlns:mets="http://www.loc.gov/METS/"
|
||||
xmlns:dim="http://www.dspace.org/xmlns/dspace/dim"
|
||||
xmlns:xlink="http://www.w3.org/TR/xlink/"
|
||||
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
|
||||
xmlns:atom="http://www.w3.org/2005/Atom"
|
||||
xmlns:ore="http://www.openarchives.org/ore/terms/"
|
||||
xmlns:oreatom="http://www.openarchives.org/ore/atom/"
|
||||
xmlns="http://www.w3.org/1999/xhtml"
|
||||
xmlns:xalan="http://xml.apache.org/xalan"
|
||||
xmlns:encoder="xalan://java.net.URLEncoder"
|
||||
exclude-result-prefixes="xalan encoder i18n dri mets dim xlink xsl">
|
||||
|
||||
|
||||
<xsl:output indent="yes"/>
|
||||
|
||||
<!-- Rendering the file list from an Atom ReM bitstream stored in the ORE bundle -->
|
||||
<xsl:template match="mets:fileGrp[@USE='ORE']">
|
||||
<xsl:variable name="AtomMapURL" select="concat('cocoon:/',substring-after(mets:file/mets:FLocat[@LOCTYPE='URL']//@*[local-name(.)='href'],$context-path))"/>
|
||||
<h2><i18n:text>xmlui.dri2xhtml.METS-1.0.item-files-head</i18n:text></h2>
|
||||
<table class="ds-table file-list">
|
||||
<thead>
|
||||
<tr class="ds-table-header-row">
|
||||
<th><i18n:text>xmlui.dri2xhtml.METS-1.0.item-files-file</i18n:text></th>
|
||||
<th><i18n:text>xmlui.dri2xhtml.METS-1.0.item-files-size</i18n:text></th>
|
||||
<th><i18n:text>xmlui.dri2xhtml.METS-1.0.item-files-format</i18n:text></th>
|
||||
<th><i18n:text>xmlui.dri2xhtml.METS-1.0.item-files-view</i18n:text></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<xsl:apply-templates select="document($AtomMapURL)/atom:entry/atom:link[@rel='http://www.openarchives.org/ore/terms/aggregates']">
|
||||
<xsl:sort select="@title"/>
|
||||
</xsl:apply-templates>
|
||||
</tbody>
|
||||
</table>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<!-- Iterate over the links in the ORE resource maps and make them into bitstream references in the file section -->
|
||||
<xsl:template match="atom:link[@rel='http://www.openarchives.org/ore/terms/aggregates']">
|
||||
<tr>
|
||||
<xsl:attribute name="class">
|
||||
<xsl:text>ds-table-row </xsl:text>
|
||||
<xsl:if test="(position() mod 2 = 0)">even </xsl:if>
|
||||
<xsl:if test="(position() mod 2 = 1)">odd </xsl:if>
|
||||
</xsl:attribute>
|
||||
<td>
|
||||
<a>
|
||||
<xsl:attribute name="href">
|
||||
<xsl:value-of select="@href"/>
|
||||
</xsl:attribute>
|
||||
<xsl:attribute name="title">
|
||||
<xsl:choose>
|
||||
<xsl:when test="@title">
|
||||
<xsl:value-of select="@title"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:value-of select="@href"/>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:attribute>
|
||||
<xsl:choose>
|
||||
<xsl:when test="string-length(@title) > 50">
|
||||
<xsl:variable name="title_length" select="string-length(@title)"/>
|
||||
<xsl:value-of select="substring(@title,1,15)"/>
|
||||
<xsl:text> ... </xsl:text>
|
||||
<xsl:value-of select="substring(@title,$title_length - 25,$title_length)"/>
|
||||
</xsl:when>
|
||||
<xsl:when test="@title">
|
||||
<xsl:value-of select="@title"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:value-of select="@href"/>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</a>
|
||||
</td>
|
||||
<!-- File size always comes in bytes and thus needs conversion -->
|
||||
<td>
|
||||
<xsl:choose>
|
||||
<xsl:when test="@length < 1000">
|
||||
<xsl:value-of select="@length"/>
|
||||
<i18n:text>xmlui.dri2xhtml.METS-1.0.size-bytes</i18n:text>
|
||||
</xsl:when>
|
||||
<xsl:when test="@length < 1000000">
|
||||
<xsl:value-of select="substring(string(@length div 1000),1,5)"/>
|
||||
<i18n:text>xmlui.dri2xhtml.METS-1.0.size-kilobytes</i18n:text>
|
||||
</xsl:when>
|
||||
<xsl:when test="@length < 1000000001">
|
||||
<xsl:value-of select="substring(string(@length div 1000000),1,5)"/>
|
||||
<i18n:text>xmlui.dri2xhtml.METS-1.0.size-megabytes</i18n:text>
|
||||
</xsl:when>
|
||||
<xsl:when test="@length > 1000000000">
|
||||
<xsl:value-of select="substring(string(@length div 1000000000),1,5)"/>
|
||||
<i18n:text>xmlui.dri2xhtml.METS-1.0.size-gigabytes</i18n:text>
|
||||
</xsl:when>
|
||||
<!-- When one isn't available -->
|
||||
<xsl:otherwise><xsl:text>n/a</xsl:text></xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</td>
|
||||
<!-- Currently format carries forward the mime type. In the original DSpace, this
|
||||
would get resolved to an application via the Bitstream Registry, but we are
|
||||
constrained by the capabilities of METS and can't really pass that info through. -->
|
||||
<td>
|
||||
<xsl:value-of select="substring-before(@type,'/')"/>
|
||||
<xsl:text>/</xsl:text>
|
||||
<xsl:value-of select="substring-after(@type,'/')"/>
|
||||
</td>
|
||||
<td>
|
||||
<a>
|
||||
<xsl:attribute name="href">
|
||||
<xsl:value-of select="@href"/>
|
||||
</xsl:attribute>
|
||||
<i18n:text>xmlui.dri2xhtml.METS-1.0.item-files-viewOpen</i18n:text>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
@@ -0,0 +1,80 @@
|
||||
<!--
|
||||
artifactbrowser.xsl
|
||||
|
||||
Version: $Revision: 3705 $
|
||||
|
||||
Date: $Date: 2009-04-11 17:02:24 +0000 (Sat, 11 Apr 2009) $
|
||||
|
||||
Copyright (c) 2002-2005, Hewlett-Packard Company and Massachusetts
|
||||
Institute of Technology. All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
- Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
- Neither the name of the Hewlett-Packard Company nor the name of the
|
||||
Massachusetts Institute of Technology nor the names of their
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
|
||||
TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
|
||||
USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
|
||||
DAMAGE.
|
||||
-->
|
||||
|
||||
<!--
|
||||
Starting point of the artifactbrowser transformation.
|
||||
This xsl references all artifactbrowser related dependencies.
|
||||
|
||||
Author: art.lowel at atmire.com
|
||||
Author: lieven.droogmans at atmire.com
|
||||
Author: ben at atmire.com
|
||||
Author: Alexey Maslov
|
||||
|
||||
-->
|
||||
|
||||
<xsl:stylesheet
|
||||
xmlns:i18n="http://apache.org/cocoon/i18n/2.1"
|
||||
xmlns:dri="http://di.tamu.edu/DRI/1.0/"
|
||||
xmlns:mets="http://www.loc.gov/METS/"
|
||||
xmlns:dim="http://www.dspace.org/xmlns/dspace/dim"
|
||||
xmlns:xlink="http://www.w3.org/TR/xlink/"
|
||||
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
|
||||
xmlns:atom="http://www.w3.org/2005/Atom"
|
||||
xmlns:ore="http://www.openarchives.org/ore/terms/"
|
||||
xmlns:oreatom="http://www.openarchives.org/ore/atom/"
|
||||
xmlns="http://www.w3.org/1999/xhtml"
|
||||
xmlns:xalan="http://xml.apache.org/xalan"
|
||||
xmlns:encoder="xalan://java.net.URLEncoder"
|
||||
exclude-result-prefixes="xalan encoder i18n dri mets dim xlink xsl">
|
||||
|
||||
<xsl:import href="common.xsl"/>
|
||||
<xsl:import href="item-list.xsl"/>
|
||||
<xsl:import href="collection-list.xsl"/>
|
||||
<xsl:import href="community-list.xsl"/>
|
||||
<xsl:import href="item-view.xsl"/>
|
||||
<xsl:import href="collection-view.xsl"/>
|
||||
<xsl:import href="community-view.xsl"/>
|
||||
<xsl:import href="ORE.xsl"/>
|
||||
<xsl:import href="COinS.xsl"/>
|
||||
|
||||
<xsl:output indent="yes"/>
|
||||
|
||||
|
||||
</xsl:stylesheet>
|
@@ -0,0 +1,121 @@
|
||||
<!--
|
||||
collection-list.xsl
|
||||
|
||||
Version: $Revision: 3705 $
|
||||
|
||||
Date: $Date: 2009-04-11 17:02:24 +0000 (Sat, 11 Apr 2009) $
|
||||
|
||||
Copyright (c) 2002-2005, Hewlett-Packard Company and Massachusetts
|
||||
Institute of Technology. All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
- Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
- Neither the name of the Hewlett-Packard Company nor the name of the
|
||||
Massachusetts Institute of Technology nor the names of their
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
|
||||
TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
|
||||
USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
|
||||
DAMAGE.
|
||||
-->
|
||||
|
||||
<!--
|
||||
Rendering of a list of collections (e.g. on a community homepage,
|
||||
or on the community-list page)
|
||||
|
||||
Author: art.lowel at atmire.com
|
||||
Author: lieven.droogmans at atmire.com
|
||||
Author: ben at atmire.com
|
||||
Author: Alexey Maslov
|
||||
|
||||
-->
|
||||
|
||||
<xsl:stylesheet
|
||||
xmlns:i18n="http://apache.org/cocoon/i18n/2.1"
|
||||
xmlns:dri="http://di.tamu.edu/DRI/1.0/"
|
||||
xmlns:mets="http://www.loc.gov/METS/"
|
||||
xmlns:dim="http://www.dspace.org/xmlns/dspace/dim"
|
||||
xmlns:xlink="http://www.w3.org/TR/xlink/"
|
||||
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
|
||||
xmlns:atom="http://www.w3.org/2005/Atom"
|
||||
xmlns:ore="http://www.openarchives.org/ore/terms/"
|
||||
xmlns:oreatom="http://www.openarchives.org/ore/atom/"
|
||||
xmlns="http://www.w3.org/1999/xhtml"
|
||||
xmlns:xalan="http://xml.apache.org/xalan"
|
||||
xmlns:encoder="xalan://java.net.URLEncoder"
|
||||
exclude-result-prefixes="xalan encoder i18n dri mets dim xlink xsl">
|
||||
|
||||
<xsl:output indent="yes"/>
|
||||
|
||||
<!-- A collection rendered in the summaryList pattern. Encountered on the community-list page -->
|
||||
<xsl:template name="collectionSummaryList-DIM">
|
||||
<xsl:variable name="data" select="./mets:dmdSec/mets:mdWrap/mets:xmlData/dim:dim"/>
|
||||
<a href="{@OBJID}">
|
||||
<xsl:choose>
|
||||
<xsl:when test="string-length($data/dim:field[@element='title'][1]) > 0">
|
||||
<xsl:value-of select="$data/dim:field[@element='title'][1]"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<i18n:text>xmlui.dri2xhtml.METS-1.0.no-title</i18n:text>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</a>
|
||||
<!--Display collection strengths (item counts) if they exist-->
|
||||
<xsl:if test="string-length($data/dim:field[@element='format'][@qualifier='extent'][1]) > 0">
|
||||
<xsl:text> [</xsl:text>
|
||||
<xsl:value-of select="$data/dim:field[@element='format'][@qualifier='extent'][1]"/>
|
||||
<xsl:text>]</xsl:text>
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
<!-- A collection rendered in the detailList pattern. Encountered on the item view page as
|
||||
the "this item is part of these collections" list -->
|
||||
<xsl:template name="collectionDetailList-DIM">
|
||||
<xsl:variable name="data" select="./mets:dmdSec/mets:mdWrap/mets:xmlData/dim:dim"/>
|
||||
<a href="{@OBJID}">
|
||||
<xsl:choose>
|
||||
<xsl:when test="string-length($data/dim:field[@element='title'][1]) > 0">
|
||||
<xsl:value-of select="$data/dim:field[@element='title'][1]"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<i18n:text>xmlui.dri2xhtml.METS-1.0.no-title</i18n:text>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</a>
|
||||
<!--Display collection strengths (item counts) if they exist-->
|
||||
<xsl:if test="string-length($data/dim:field[@element='format'][@qualifier='extent'][1]) > 0">
|
||||
<xsl:text> [</xsl:text>
|
||||
<xsl:value-of select="$data/dim:field[@element='format'][@qualifier='extent'][1]"/>
|
||||
<xsl:text>]</xsl:text>
|
||||
</xsl:if>
|
||||
<br/>
|
||||
<xsl:choose>
|
||||
<xsl:when test="$data/dim:field[@element='description' and @qualifier='abstract']">
|
||||
<xsl:copy-of select="$data/dim:field[@element='description' and @qualifier='abstract']/node()"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:copy-of select="$data/dim:field[@element='description'][1]/node()"/>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
@@ -0,0 +1,113 @@
|
||||
<!--
|
||||
collection-view.xsl
|
||||
|
||||
Version: $Revision: 3705 $
|
||||
|
||||
Date: $Date: 2009-04-11 17:02:24 +0000 (Sat, 11 Apr 2009) $
|
||||
|
||||
Copyright (c) 2002-2005, Hewlett-Packard Company and Massachusetts
|
||||
Institute of Technology. All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
- Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
- Neither the name of the Hewlett-Packard Company nor the name of the
|
||||
Massachusetts Institute of Technology nor the names of their
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
|
||||
TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
|
||||
USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
|
||||
DAMAGE.
|
||||
-->
|
||||
|
||||
<!--
|
||||
Rendering specific to the collection home page.
|
||||
|
||||
Author: art.lowel at atmire.com
|
||||
Author: lieven.droogmans at atmire.com
|
||||
Author: ben at atmire.com
|
||||
Author: Alexey Maslov
|
||||
|
||||
-->
|
||||
|
||||
<xsl:stylesheet
|
||||
xmlns:i18n="http://apache.org/cocoon/i18n/2.1"
|
||||
xmlns:dri="http://di.tamu.edu/DRI/1.0/"
|
||||
xmlns:mets="http://www.loc.gov/METS/"
|
||||
xmlns:dim="http://www.dspace.org/xmlns/dspace/dim"
|
||||
xmlns:xlink="http://www.w3.org/TR/xlink/"
|
||||
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
|
||||
xmlns:atom="http://www.w3.org/2005/Atom"
|
||||
xmlns:ore="http://www.openarchives.org/ore/terms/"
|
||||
xmlns:oreatom="http://www.openarchives.org/ore/atom/"
|
||||
xmlns="http://www.w3.org/1999/xhtml"
|
||||
xmlns:xalan="http://xml.apache.org/xalan"
|
||||
xmlns:encoder="xalan://java.net.URLEncoder"
|
||||
exclude-result-prefixes="xalan encoder i18n dri mets dim xlink xsl">
|
||||
|
||||
<xsl:output indent="yes"/>
|
||||
|
||||
<!-- The summaryView of communities and collections is undefined. -->
|
||||
<xsl:template name="collectionSummaryView-DIM">
|
||||
<i18n:text>xmlui.dri2xhtml.METS-1.0.collection-not-implemented</i18n:text>
|
||||
</xsl:template>
|
||||
|
||||
<!-- A collection rendered in the detailView pattern; default way of viewing a collection. -->
|
||||
<xsl:template name="collectionDetailView-DIM">
|
||||
<div class="detail-view"> 
|
||||
<!-- Generate the logo, if present, from the file section -->
|
||||
<xsl:apply-templates select="./mets:fileSec/mets:fileGrp[@USE='LOGO']"/>
|
||||
<!-- Generate the info about the collections from the metadata section -->
|
||||
<xsl:apply-templates select="./mets:dmdSec/mets:mdWrap[@OTHERMDTYPE='DIM']/mets:xmlData/dim:dim"
|
||||
mode="collectionDetailView-DIM"/>
|
||||
</div>
|
||||
</xsl:template>
|
||||
|
||||
<!-- Generate the info about the collection from the metadata section -->
|
||||
<xsl:template match="dim:dim" mode="collectionDetailView-DIM">
|
||||
<xsl:if test="string-length(dim:field[@element='description'][not(@qualifier)])>0">
|
||||
<p class="intro-text">
|
||||
<xsl:copy-of select="dim:field[@element='description'][not(@qualifier)]/node()"/>
|
||||
</p>
|
||||
</xsl:if>
|
||||
|
||||
<xsl:if test="string-length(dim:field[@element='description'][@qualifier='tableofcontents'])>0">
|
||||
<div class="detail-view-news">
|
||||
<h3><i18n:text>xmlui.dri2xhtml.METS-1.0.news</i18n:text></h3>
|
||||
<p class="news-text">
|
||||
<xsl:copy-of select="dim:field[@element='description'][@qualifier='tableofcontents']/node()"/>
|
||||
</p>
|
||||
</div>
|
||||
</xsl:if>
|
||||
|
||||
<xsl:if test="string-length(dim:field[@element='rights'][not(@qualifier)])>0">
|
||||
<div class="detail-view-rights-and-license">
|
||||
<xsl:if test="string-length(dim:field[@element='rights'][not(@qualifier)])>0">
|
||||
<p class="copyright-text">
|
||||
<xsl:copy-of select="dim:field[@element='rights'][not(@qualifier)]/node()"/>
|
||||
</p>
|
||||
</xsl:if>
|
||||
</div>
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
</xsl:stylesheet>
|
@@ -0,0 +1,166 @@
|
||||
<!--
|
||||
common.xsl
|
||||
|
||||
Version: $Revision: 3705 $
|
||||
|
||||
Date: $Date: 2009-04-11 17:02:24 +0000 (Sat, 11 Apr 2009) $
|
||||
|
||||
Copyright (c) 2002-2005, Hewlett-Packard Company and Massachusetts
|
||||
Institute of Technology. All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
- Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
- Neither the name of the Hewlett-Packard Company nor the name of the
|
||||
Massachusetts Institute of Technology nor the names of their
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
|
||||
TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
|
||||
USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
|
||||
DAMAGE.
|
||||
-->
|
||||
|
||||
<!--
|
||||
Parts of the artifactbrowser which are not
|
||||
specific to a single listing or page. These will not
|
||||
frequently be adapted in a theme
|
||||
|
||||
Author: art.lowel at atmire.com
|
||||
Author: lieven.droogmans at atmire.com
|
||||
Author: ben at atmire.com
|
||||
Author: Alexey Maslov
|
||||
|
||||
-->
|
||||
|
||||
<xsl:stylesheet
|
||||
xmlns:i18n="http://apache.org/cocoon/i18n/2.1"
|
||||
xmlns:dri="http://di.tamu.edu/DRI/1.0/"
|
||||
xmlns:mets="http://www.loc.gov/METS/"
|
||||
xmlns:dim="http://www.dspace.org/xmlns/dspace/dim"
|
||||
xmlns:xlink="http://www.w3.org/TR/xlink/"
|
||||
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
|
||||
xmlns:atom="http://www.w3.org/2005/Atom"
|
||||
xmlns:ore="http://www.openarchives.org/ore/terms/"
|
||||
xmlns:oreatom="http://www.openarchives.org/ore/atom/"
|
||||
xmlns="http://www.w3.org/1999/xhtml"
|
||||
xmlns:xalan="http://xml.apache.org/xalan"
|
||||
xmlns:encoder="xalan://java.net.URLEncoder"
|
||||
exclude-result-prefixes="xalan encoder i18n dri mets dim xlink xsl">
|
||||
|
||||
<xsl:output indent="yes"/>
|
||||
|
||||
<!--
|
||||
The summaryList display type; used to generate simple surrogates for the item involved
|
||||
-->
|
||||
|
||||
<xsl:template match="mets:METS[mets:dmdSec/mets:mdWrap[@OTHERMDTYPE='DIM']]" mode="summaryList">
|
||||
<xsl:choose>
|
||||
<xsl:when test="@LABEL='DSpace Item'">
|
||||
<xsl:call-template name="itemSummaryList-DIM"/>
|
||||
</xsl:when>
|
||||
<xsl:when test="@LABEL='DSpace Collection'">
|
||||
<xsl:call-template name="collectionSummaryList-DIM"/>
|
||||
</xsl:when>
|
||||
<xsl:when test="@LABEL='DSpace Community'">
|
||||
<xsl:call-template name="communitySummaryList-DIM"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<i18n:text>xmlui.dri2xhtml.METS-1.0.non-conformant</i18n:text>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
|
||||
<!--
|
||||
The detailList display type; used to generate simple surrogates for the item involved, but with
|
||||
a slightly higher level of information provided. Not commonly used.
|
||||
-->
|
||||
|
||||
<xsl:template match="mets:METS[mets:dmdSec/mets:mdWrap[@OTHERMDTYPE='DIM']]" mode="detailList">
|
||||
<xsl:choose>
|
||||
<xsl:when test="@LABEL='DSpace Item'">
|
||||
<xsl:call-template name="itemDetailList-DIM"/>
|
||||
</xsl:when>
|
||||
<xsl:when test="@LABEL='DSpace Collection'">
|
||||
<xsl:call-template name="collectionDetailList-DIM"/>
|
||||
</xsl:when>
|
||||
<xsl:when test="@LABEL='DSpace Community'">
|
||||
<xsl:call-template name="communityDetailList-DIM"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<i18n:text>xmlui.dri2xhtml.METS-1.0.non-conformant</i18n:text>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
|
||||
<!--
|
||||
The summaryView display type; used to generate a near-complete view of the item involved. It is currently
|
||||
not applicable to communities and collections.
|
||||
-->
|
||||
<xsl:template match="mets:METS[mets:dmdSec/mets:mdWrap[@OTHERMDTYPE='DIM']]" mode="summaryView">
|
||||
<xsl:choose>
|
||||
<xsl:when test="@LABEL='DSpace Item'">
|
||||
<xsl:call-template name="itemSummaryView-DIM"/>
|
||||
</xsl:when>
|
||||
<xsl:when test="@LABEL='DSpace Collection'">
|
||||
<xsl:call-template name="collectionSummaryView-DIM"/>
|
||||
</xsl:when>
|
||||
<xsl:when test="@LABEL='DSpace Community'">
|
||||
<xsl:call-template name="communitySummaryView-DIM"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<i18n:text>xmlui.dri2xhtml.METS-1.0.non-conformant</i18n:text>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
|
||||
<!--
|
||||
The detailView display type; used to generate a complete view of the object involved. It is currently
|
||||
used with the "full item record" view of items as well as the default views of communities and collections.
|
||||
-->
|
||||
<xsl:template match="mets:METS[mets:dmdSec/mets:mdWrap[@OTHERMDTYPE='DIM']]" mode="detailView">
|
||||
<xsl:choose>
|
||||
<xsl:when test="@LABEL='DSpace Item'">
|
||||
<xsl:call-template name="itemDetailView-DIM"/>
|
||||
</xsl:when>
|
||||
<xsl:when test="@LABEL='DSpace Collection'">
|
||||
<xsl:call-template name="collectionDetailView-DIM"/>
|
||||
</xsl:when>
|
||||
<xsl:when test="@LABEL='DSpace Community'">
|
||||
<xsl:call-template name="communityDetailView-DIM"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<i18n:text>xmlui.dri2xhtml.METS-1.0.non-conformant</i18n:text>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<!-- Generate the logo, if present, from the file section -->
|
||||
<xsl:template match="mets:fileGrp[@USE='LOGO']">
|
||||
<div class="ds-logo-wrapper">
|
||||
<img src="{mets:file/mets:FLocat[@LOCTYPE='URL']/@xlink:href}" class="logo">
|
||||
<xsl:attribute name="alt">xmlui.dri2xhtml.METS-1.0.collection-logo-alt</xsl:attribute>
|
||||
<xsl:attribute name="attr" namespace="http://apache.org/cocoon/i18n/2.1">alt</xsl:attribute>
|
||||
</img>
|
||||
</div>
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
@@ -0,0 +1,125 @@
|
||||
<!--
|
||||
community-list.xsl
|
||||
|
||||
Version: $Revision: 3705 $
|
||||
|
||||
Date: $Date: 2009-04-11 17:02:24 +0000 (Sat, 11 Apr 2009) $
|
||||
|
||||
Copyright (c) 2002-2005, Hewlett-Packard Company and Massachusetts
|
||||
Institute of Technology. All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
- Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
- Neither the name of the Hewlett-Packard Company nor the name of the
|
||||
Massachusetts Institute of Technology nor the names of their
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
|
||||
TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
|
||||
USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
|
||||
DAMAGE.
|
||||
-->
|
||||
|
||||
<!--
|
||||
Rendering of a list of communities (e.g. on a community homepage,
|
||||
or on the community-list page)
|
||||
|
||||
Author: art.lowel at atmire.com
|
||||
Author: lieven.droogmans at atmire.com
|
||||
Author: ben at atmire.com
|
||||
Author: Alexey Maslov
|
||||
|
||||
-->
|
||||
|
||||
<xsl:stylesheet
|
||||
xmlns:i18n="http://apache.org/cocoon/i18n/2.1"
|
||||
xmlns:dri="http://di.tamu.edu/DRI/1.0/"
|
||||
xmlns:mets="http://www.loc.gov/METS/"
|
||||
xmlns:dim="http://www.dspace.org/xmlns/dspace/dim"
|
||||
xmlns:xlink="http://www.w3.org/TR/xlink/"
|
||||
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
|
||||
xmlns:atom="http://www.w3.org/2005/Atom"
|
||||
xmlns:ore="http://www.openarchives.org/ore/terms/"
|
||||
xmlns:oreatom="http://www.openarchives.org/ore/atom/"
|
||||
xmlns="http://www.w3.org/1999/xhtml"
|
||||
xmlns:xalan="http://xml.apache.org/xalan"
|
||||
xmlns:encoder="xalan://java.net.URLEncoder"
|
||||
exclude-result-prefixes="xalan encoder i18n dri mets dim xlink xsl">
|
||||
|
||||
<xsl:output indent="yes"/>
|
||||
|
||||
<!-- A community rendered in the summaryList pattern. Encountered on the community-list and on
|
||||
on the front page. -->
|
||||
<xsl:template name="communitySummaryList-DIM">
|
||||
<xsl:variable name="data" select="./mets:dmdSec/mets:mdWrap/mets:xmlData/dim:dim"/>
|
||||
<span class="bold">
|
||||
<a href="{@OBJID}">
|
||||
<xsl:choose>
|
||||
<xsl:when test="string-length($data/dim:field[@element='title'][1]) > 0">
|
||||
<xsl:value-of select="$data/dim:field[@element='title'][1]"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<i18n:text>xmlui.dri2xhtml.METS-1.0.no-title</i18n:text>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</a>
|
||||
<!--Display community strengths (item counts) if they exist-->
|
||||
<xsl:if test="string-length($data/dim:field[@element='format'][@qualifier='extent'][1]) > 0">
|
||||
<xsl:text> [</xsl:text>
|
||||
<xsl:value-of select="$data/dim:field[@element='format'][@qualifier='extent'][1]"/>
|
||||
<xsl:text>]</xsl:text>
|
||||
</xsl:if>
|
||||
</span>
|
||||
</xsl:template>
|
||||
|
||||
<!-- A community rendered in the detailList pattern. Not currently used. -->
|
||||
<xsl:template name="communityDetailList-DIM">
|
||||
<xsl:variable name="data" select="./mets:dmdSec/mets:mdWrap/mets:xmlData/dim:dim"/>
|
||||
<span class="bold">
|
||||
<a href="{@OBJID}">
|
||||
<xsl:choose>
|
||||
<xsl:when test="string-length($data/dim:field[@element='title'][1]) > 0">
|
||||
<xsl:value-of select="$data/dim:field[@element='title'][1]"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<i18n:text>xmlui.dri2xhtml.METS-1.0.no-title</i18n:text>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</a>
|
||||
<!--Display community strengths (item counts) if they exist-->
|
||||
<xsl:if test="string-length($data/dim:field[@element='format'][@qualifier='extent'][1]) > 0">
|
||||
<xsl:text> [</xsl:text>
|
||||
<xsl:value-of select="$data/dim:field[@element='format'][@qualifier='extent'][1]"/>
|
||||
<xsl:text>]</xsl:text>
|
||||
</xsl:if>
|
||||
<br/>
|
||||
<xsl:choose>
|
||||
<xsl:when test="$data/dim:field[@element='description' and @qualifier='abstract']">
|
||||
<xsl:copy-of select="$data/dim:field[@element='description' and @qualifier='abstract']/node()"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:copy-of select="$data/dim:field[@element='description'][1]/node()"/>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</span>
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
@@ -0,0 +1,112 @@
|
||||
<!--
|
||||
community-view.xsl
|
||||
|
||||
Version: $Revision: 3705 $
|
||||
|
||||
Date: $Date: 2009-04-11 17:02:24 +0000 (Sat, 11 Apr 2009) $
|
||||
|
||||
Copyright (c) 2002-2005, Hewlett-Packard Company and Massachusetts
|
||||
Institute of Technology. All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
- Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
- Neither the name of the Hewlett-Packard Company nor the name of the
|
||||
Massachusetts Institute of Technology nor the names of their
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
|
||||
TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
|
||||
USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
|
||||
DAMAGE.
|
||||
-->
|
||||
|
||||
<!--
|
||||
Rendering specific to the community home page.
|
||||
|
||||
Author: art.lowel at atmire.com
|
||||
Author: lieven.droogmans at atmire.com
|
||||
Author: ben at atmire.com
|
||||
Author: Alexey Maslov
|
||||
|
||||
-->
|
||||
|
||||
<xsl:stylesheet
|
||||
xmlns:i18n="http://apache.org/cocoon/i18n/2.1"
|
||||
xmlns:dri="http://di.tamu.edu/DRI/1.0/"
|
||||
xmlns:mets="http://www.loc.gov/METS/"
|
||||
xmlns:dim="http://www.dspace.org/xmlns/dspace/dim"
|
||||
xmlns:xlink="http://www.w3.org/TR/xlink/"
|
||||
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
|
||||
xmlns:atom="http://www.w3.org/2005/Atom"
|
||||
xmlns:ore="http://www.openarchives.org/ore/terms/"
|
||||
xmlns:oreatom="http://www.openarchives.org/ore/atom/"
|
||||
xmlns="http://www.w3.org/1999/xhtml"
|
||||
xmlns:xalan="http://xml.apache.org/xalan"
|
||||
xmlns:encoder="xalan://java.net.URLEncoder"
|
||||
exclude-result-prefixes="xalan encoder i18n dri mets dim xlink xsl">
|
||||
|
||||
<xsl:output indent="yes"/>
|
||||
|
||||
|
||||
<xsl:template name="communitySummaryView-DIM">
|
||||
<i18n:text>xmlui.dri2xhtml.METS-1.0.community-not-implemented</i18n:text>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<!-- A community rendered in the detailView pattern; default way of viewing a community. -->
|
||||
<xsl:template name="communityDetailView-DIM">
|
||||
<div class="detail-view"> 
|
||||
<!-- Generate the logo, if present, from the file section -->
|
||||
<xsl:apply-templates select="./mets:fileSec/mets:fileGrp[@USE='LOGO']"/>
|
||||
<!-- Generate the info about the collections from the metadata section -->
|
||||
<xsl:apply-templates select="./mets:dmdSec/mets:mdWrap[@OTHERMDTYPE='DIM']/mets:xmlData/dim:dim"
|
||||
mode="communityDetailView-DIM"/>
|
||||
</div>
|
||||
</xsl:template>
|
||||
|
||||
<!-- Generate the info about the community from the metadata section -->
|
||||
<xsl:template match="dim:dim" mode="communityDetailView-DIM">
|
||||
<xsl:if test="string-length(dim:field[@element='description'][not(@qualifier)])>0">
|
||||
<p class="intro-text">
|
||||
<xsl:copy-of select="dim:field[@element='description'][not(@qualifier)]/node()"/>
|
||||
</p>
|
||||
</xsl:if>
|
||||
|
||||
<xsl:if test="string-length(dim:field[@element='description'][@qualifier='tableofcontents'])>0">
|
||||
<div class="detail-view-news">
|
||||
<h3><i18n:text>xmlui.dri2xhtml.METS-1.0.news</i18n:text></h3>
|
||||
<p class="news-text">
|
||||
<xsl:copy-of select="dim:field[@element='description'][@qualifier='tableofcontents']/node()"/>
|
||||
</p>
|
||||
</div>
|
||||
</xsl:if>
|
||||
|
||||
<xsl:if test="string-length(dim:field[@element='rights'][not(@qualifier)])>0">
|
||||
<div class="detail-view-rights-and-license">
|
||||
<p class="copyright-text">
|
||||
<xsl:copy-of select="dim:field[@element='rights'][not(@qualifier)]/node()"/>
|
||||
</p>
|
||||
</div>
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
</xsl:stylesheet>
|
@@ -0,0 +1,194 @@
|
||||
<!--
|
||||
item-list.xsl
|
||||
|
||||
Version: $Revision: 3705 $
|
||||
|
||||
Date: $Date: 2009-04-11 17:02:24 +0000 (Sat, 11 Apr 2009) $
|
||||
|
||||
Copyright (c) 2002-2005, Hewlett-Packard Company and Massachusetts
|
||||
Institute of Technology. All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
- Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
- Neither the name of the Hewlett-Packard Company nor the name of the
|
||||
Massachusetts Institute of Technology nor the names of their
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
|
||||
TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
|
||||
USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
|
||||
DAMAGE.
|
||||
-->
|
||||
|
||||
<!--
|
||||
Rendering of a list of items (e.g. in a search or
|
||||
browse results page)
|
||||
|
||||
Author: art.lowel at atmire.com
|
||||
Author: lieven.droogmans at atmire.com
|
||||
Author: ben at atmire.com
|
||||
Author: Alexey Maslov
|
||||
|
||||
-->
|
||||
|
||||
<xsl:stylesheet
|
||||
xmlns:i18n="http://apache.org/cocoon/i18n/2.1"
|
||||
xmlns:dri="http://di.tamu.edu/DRI/1.0/"
|
||||
xmlns:mets="http://www.loc.gov/METS/"
|
||||
xmlns:dim="http://www.dspace.org/xmlns/dspace/dim"
|
||||
xmlns:xlink="http://www.w3.org/TR/xlink/"
|
||||
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
|
||||
xmlns:atom="http://www.w3.org/2005/Atom"
|
||||
xmlns:ore="http://www.openarchives.org/ore/terms/"
|
||||
xmlns:oreatom="http://www.openarchives.org/ore/atom/"
|
||||
xmlns="http://www.w3.org/1999/xhtml"
|
||||
xmlns:xalan="http://xml.apache.org/xalan"
|
||||
xmlns:encoder="xalan://java.net.URLEncoder"
|
||||
exclude-result-prefixes="xalan encoder i18n dri mets dim xlink xsl">
|
||||
|
||||
<xsl:output indent="yes"/>
|
||||
|
||||
<!-- An item rendered in the summaryList pattern. Commonly encountered in various browse-by pages
|
||||
and search results. -->
|
||||
<xsl:template name="itemSummaryList-DIM">
|
||||
<!-- Generate the info about the item from the metadata section -->
|
||||
<xsl:apply-templates select="./mets:dmdSec/mets:mdWrap[@OTHERMDTYPE='DIM']/mets:xmlData/dim:dim"
|
||||
mode="itemSummaryList-DIM"/>
|
||||
<!-- Generate the thunbnail, if present, from the file section -->
|
||||
<xsl:apply-templates select="./mets:fileSec" mode="artifact-preview"/>
|
||||
</xsl:template>
|
||||
|
||||
<!-- Generate the info about the item from the metadata section -->
|
||||
<xsl:template match="dim:dim" mode="itemSummaryList-DIM">
|
||||
<xsl:variable name="itemWithdrawn" select="@withdrawn" />
|
||||
<div class="artifact-description">
|
||||
<div class="artifact-title">
|
||||
<xsl:element name="a">
|
||||
<xsl:attribute name="href">
|
||||
<xsl:choose>
|
||||
<xsl:when test="$itemWithdrawn">
|
||||
<xsl:value-of select="ancestor::mets:METS/@OBJEDIT" />
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:value-of select="ancestor::mets:METS/@OBJID" />
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:attribute>
|
||||
<span class="Z3988">
|
||||
<xsl:attribute name="title">
|
||||
<xsl:call-template name="renderCOinS"/>
|
||||
</xsl:attribute>
|
||||
<xsl:choose>
|
||||
<xsl:when test="dim:field[@element='title']">
|
||||
<xsl:value-of select="dim:field[@element='title'][1]/node()"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<i18n:text>xmlui.dri2xhtml.METS-1.0.no-title</i18n:text>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</span>
|
||||
</xsl:element>
|
||||
</div>
|
||||
<div class="artifact-info">
|
||||
<span class="author">
|
||||
<xsl:choose>
|
||||
<xsl:when test="dim:field[@element='contributor'][@qualifier='author']">
|
||||
<xsl:for-each select="dim:field[@element='contributor'][@qualifier='author']">
|
||||
<span>
|
||||
<xsl:if test="@authority">
|
||||
<xsl:attribute name="class"><xsl:text>ds-dc_contributor_author-authority</xsl:text></xsl:attribute>
|
||||
</xsl:if>
|
||||
<xsl:copy-of select="node()"/>
|
||||
</span>
|
||||
<xsl:if test="count(following-sibling::dim:field[@element='contributor'][@qualifier='author']) != 0">
|
||||
<xsl:text>; </xsl:text>
|
||||
</xsl:if>
|
||||
</xsl:for-each>
|
||||
</xsl:when>
|
||||
<xsl:when test="dim:field[@element='creator']">
|
||||
<xsl:for-each select="dim:field[@element='creator']">
|
||||
<xsl:copy-of select="node()"/>
|
||||
<xsl:if test="count(following-sibling::dim:field[@element='creator']) != 0">
|
||||
<xsl:text>; </xsl:text>
|
||||
</xsl:if>
|
||||
</xsl:for-each>
|
||||
</xsl:when>
|
||||
<xsl:when test="dim:field[@element='contributor']">
|
||||
<xsl:for-each select="dim:field[@element='contributor']">
|
||||
<xsl:copy-of select="node()"/>
|
||||
<xsl:if test="count(following-sibling::dim:field[@element='contributor']) != 0">
|
||||
<xsl:text>; </xsl:text>
|
||||
</xsl:if>
|
||||
</xsl:for-each>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<i18n:text>xmlui.dri2xhtml.METS-1.0.no-author</i18n:text>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</span>
|
||||
<xsl:text> </xsl:text>
|
||||
<xsl:if test="dim:field[@element='date' and @qualifier='issued'] or dim:field[@element='publisher']">
|
||||
<span class="publisher-date">
|
||||
<xsl:text>(</xsl:text>
|
||||
<xsl:if test="dim:field[@element='publisher']">
|
||||
<span class="publisher">
|
||||
<xsl:copy-of select="dim:field[@element='publisher']/node()"/>
|
||||
</span>
|
||||
<xsl:text>, </xsl:text>
|
||||
</xsl:if>
|
||||
<span class="date">
|
||||
<xsl:value-of select="substring(dim:field[@element='date' and @qualifier='issued']/node(),1,10)"/>
|
||||
</span>
|
||||
<xsl:text>)</xsl:text>
|
||||
</span>
|
||||
</xsl:if>
|
||||
</div>
|
||||
</div>
|
||||
</xsl:template>
|
||||
|
||||
<!-- An item rendered in the detailList pattern. Currently Manakin does not have a separate use for
|
||||
detailList on items, so the logic of summaryList is used in its place. -->
|
||||
<xsl:template name="itemDetailList-DIM">
|
||||
|
||||
<!-- Generate the info about the item from the metadata section -->
|
||||
<xsl:apply-templates select="./mets:dmdSec/mets:mdWrap[@OTHERMDTYPE='DIM']/mets:xmlData/dim:dim"
|
||||
mode="itemSummaryList-DIM"/>
|
||||
|
||||
<!-- Generate the thunbnail, if present, from the file section -->
|
||||
<xsl:apply-templates select="./mets:fileSec" mode="artifact-preview"/>
|
||||
</xsl:template>
|
||||
|
||||
<!-- Generate the thunbnail, if present, from the file section -->
|
||||
<xsl:template match="mets:fileSec" mode="artifact-preview">
|
||||
<xsl:if test="mets:fileGrp[@USE='THUMBNAIL']">
|
||||
<div class="artifact-preview">
|
||||
<a href="{ancestor::mets:METS/@OBJID}">
|
||||
<img alt="Thumbnail">
|
||||
<xsl:attribute name="src">
|
||||
<xsl:value-of select="mets:fileGrp[@USE='THUMBNAIL']/mets:file/mets:FLocat[@LOCTYPE='URL']/@xlink:href" />
|
||||
</xsl:attribute>
|
||||
</img>
|
||||
</a>
|
||||
</div>
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
@@ -0,0 +1,607 @@
|
||||
<!--
|
||||
item-view.xsl
|
||||
|
||||
Version: $Revision: 3705 $
|
||||
|
||||
Date: $Date: 2009-04-11 17:02:24 +0000 (Sat, 11 Apr 2009) $
|
||||
|
||||
Copyright (c) 2002-2005, Hewlett-Packard Company and Massachusetts
|
||||
Institute of Technology. All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
- Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
- Neither the name of the Hewlett-Packard Company nor the name of the
|
||||
Massachusetts Institute of Technology nor the names of their
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
|
||||
TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
|
||||
USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
|
||||
DAMAGE.
|
||||
-->
|
||||
|
||||
<!--
|
||||
Rendering specific to the item display page.
|
||||
|
||||
Author: art.lowel at atmire.com
|
||||
Author: lieven.droogmans at atmire.com
|
||||
Author: ben at atmire.com
|
||||
Author: Alexey Maslov
|
||||
|
||||
-->
|
||||
|
||||
<xsl:stylesheet
|
||||
xmlns:i18n="http://apache.org/cocoon/i18n/2.1"
|
||||
xmlns:dri="http://di.tamu.edu/DRI/1.0/"
|
||||
xmlns:mets="http://www.loc.gov/METS/"
|
||||
xmlns:dim="http://www.dspace.org/xmlns/dspace/dim"
|
||||
xmlns:xlink="http://www.w3.org/TR/xlink/"
|
||||
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
|
||||
xmlns:atom="http://www.w3.org/2005/Atom"
|
||||
xmlns:ore="http://www.openarchives.org/ore/terms/"
|
||||
xmlns:oreatom="http://www.openarchives.org/ore/atom/"
|
||||
xmlns="http://www.w3.org/1999/xhtml"
|
||||
xmlns:xalan="http://xml.apache.org/xalan"
|
||||
xmlns:encoder="xalan://java.net.URLEncoder"
|
||||
exclude-result-prefixes="xalan encoder i18n dri mets dim xlink xsl">
|
||||
|
||||
<xsl:output indent="yes"/>
|
||||
|
||||
<!-- An item rendered in the summaryView pattern. This is the default way to view a DSpace item in Manakin. -->
|
||||
<xsl:template name="itemSummaryView-DIM">
|
||||
<!-- Generate the info about the item from the metadata section -->
|
||||
<xsl:apply-templates select="./mets:dmdSec/mets:mdWrap[@OTHERMDTYPE='DIM']/mets:xmlData/dim:dim"
|
||||
mode="itemSummaryView-DIM"/>
|
||||
|
||||
<!-- Generate the bitstream information from the file section -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="./mets:fileSec/mets:fileGrp[@USE='CONTENT' or @USE='ORIGINAL']">
|
||||
<xsl:apply-templates select="./mets:fileSec/mets:fileGrp[@USE='CONTENT' or @USE='ORIGINAL']">
|
||||
<xsl:with-param name="context" select="."/>
|
||||
<xsl:with-param name="primaryBitstream" select="./mets:structMap[@TYPE='LOGICAL']/mets:div[@TYPE='DSpace Item']/mets:fptr/@FILEID"/>
|
||||
</xsl:apply-templates>
|
||||
</xsl:when>
|
||||
<!-- Special case for handling ORE resource maps stored as DSpace bitstreams -->
|
||||
<xsl:when test="./mets:fileSec/mets:fileGrp[@USE='ORE']">
|
||||
<xsl:apply-templates select="./mets:fileSec/mets:fileGrp[@USE='ORE']"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<h2><i18n:text>xmlui.dri2xhtml.METS-1.0.item-files-head</i18n:text></h2>
|
||||
<table class="ds-table file-list">
|
||||
<tr class="ds-table-header-row">
|
||||
<th><i18n:text>xmlui.dri2xhtml.METS-1.0.item-files-file</i18n:text></th>
|
||||
<th><i18n:text>xmlui.dri2xhtml.METS-1.0.item-files-size</i18n:text></th>
|
||||
<th><i18n:text>xmlui.dri2xhtml.METS-1.0.item-files-format</i18n:text></th>
|
||||
<th><i18n:text>xmlui.dri2xhtml.METS-1.0.item-files-view</i18n:text></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="4">
|
||||
<p><i18n:text>xmlui.dri2xhtml.METS-1.0.item-no-files</i18n:text></p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
|
||||
<!-- Generate the Creative Commons license information from the file section (DSpace deposit license hidden by default)-->
|
||||
<xsl:apply-templates select="./mets:fileSec/mets:fileGrp[@USE='CC-LICENSE']"/>
|
||||
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<!-- Generate the info about the item from the metadata section -->
|
||||
<xsl:template match="dim:dim" mode="itemSummaryView-DIM">
|
||||
<table class="ds-includeSet-table">
|
||||
<xsl:call-template name="itemSummaryView-DIM-fields">
|
||||
</xsl:call-template>
|
||||
</table>
|
||||
</xsl:template>
|
||||
|
||||
<!-- render each field on a row, alternating phase between odd and even -->
|
||||
<!-- recursion needed since not every row appears for each Item. -->
|
||||
<xsl:template name="itemSummaryView-DIM-fields">
|
||||
<xsl:param name="clause" select="'1'"/>
|
||||
<xsl:param name="phase" select="'even'"/>
|
||||
<xsl:variable name="otherPhase">
|
||||
<xsl:choose>
|
||||
<xsl:when test="$phase = 'even'">
|
||||
<xsl:text>odd</xsl:text>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:text>even</xsl:text>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:variable>
|
||||
|
||||
<xsl:choose>
|
||||
|
||||
<!-- artifact?
|
||||
<tr class="ds-table-row odd">
|
||||
<td><span class="bold"><i18n:text>xmlui.dri2xhtml.METS-1.0.item-preview</i18n:text>:</span></td>
|
||||
<td>
|
||||
<xsl:choose>
|
||||
<xsl:when test="mets:fileSec/mets:fileGrp[@USE='THUMBNAIL']">
|
||||
<a class="image-link">
|
||||
<xsl:attribute name="href"><xsl:value-of select="@OBJID"/></xsl:attribute>
|
||||
<img alt="Thumbnail">
|
||||
<xsl:attribute name="src">
|
||||
<xsl:value-of select="mets:fileSec/mets:fileGrp[@USE='THUMBNAIL']/
|
||||
mets:file/mets:FLocat[@LOCTYPE='URL']/@xlink:href"/>
|
||||
</xsl:attribute>
|
||||
</img>
|
||||
</a>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<i18n:text>xmlui.dri2xhtml.METS-1.0.no-preview</i18n:text>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</td>
|
||||
</tr>-->
|
||||
|
||||
<!-- Title row -->
|
||||
<xsl:when test="$clause = 1">
|
||||
<tr class="ds-table-row {$phase}">
|
||||
<td><span class="bold"><i18n:text>xmlui.dri2xhtml.METS-1.0.item-title</i18n:text>: </span></td>
|
||||
<td>
|
||||
<span class="Z3988">
|
||||
<xsl:attribute name="title">
|
||||
<xsl:call-template name="renderCOinS"/>
|
||||
</xsl:attribute>
|
||||
<xsl:choose>
|
||||
<xsl:when test="count(dim:field[@element='title'][not(@qualifier)]) > 1">
|
||||
<xsl:for-each select="dim:field[@element='title'][not(@qualifier)]">
|
||||
<xsl:value-of select="./node()"/>
|
||||
<xsl:if test="count(following-sibling::dim:field[@element='title'][not(@qualifier)]) != 0">
|
||||
<xsl:text>; </xsl:text><br/>
|
||||
</xsl:if>
|
||||
</xsl:for-each>
|
||||
</xsl:when>
|
||||
<xsl:when test="count(dim:field[@element='title'][not(@qualifier)]) = 1">
|
||||
<xsl:value-of select="dim:field[@element='title'][not(@qualifier)][1]/node()"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<i18n:text>xmlui.dri2xhtml.METS-1.0.no-title</i18n:text>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
<xsl:call-template name="itemSummaryView-DIM-fields">
|
||||
<xsl:with-param name="clause" select="($clause + 1)"/>
|
||||
<xsl:with-param name="phase" select="$otherPhase"/>
|
||||
</xsl:call-template>
|
||||
</xsl:when>
|
||||
|
||||
<!-- Author(s) row -->
|
||||
<xsl:when test="$clause = 2 and (dim:field[@element='contributor'][@qualifier='author'] or dim:field[@element='creator'] or dim:field[@element='contributor'])">
|
||||
<tr class="ds-table-row {$phase}">
|
||||
<td><span class="bold"><i18n:text>xmlui.dri2xhtml.METS-1.0.item-author</i18n:text>:</span></td>
|
||||
<td>
|
||||
<xsl:choose>
|
||||
<xsl:when test="dim:field[@element='contributor'][@qualifier='author']">
|
||||
<xsl:for-each select="dim:field[@element='contributor'][@qualifier='author']">
|
||||
<span>
|
||||
<xsl:if test="@authority">
|
||||
<xsl:attribute name="class"><xsl:text>ds-dc_contributor_author-authority</xsl:text></xsl:attribute>
|
||||
</xsl:if>
|
||||
<xsl:copy-of select="node()"/>
|
||||
</span>
|
||||
<xsl:if test="count(following-sibling::dim:field[@element='contributor'][@qualifier='author']) != 0">
|
||||
<xsl:text>; </xsl:text>
|
||||
</xsl:if>
|
||||
</xsl:for-each>
|
||||
</xsl:when>
|
||||
<xsl:when test="dim:field[@element='creator']">
|
||||
<xsl:for-each select="dim:field[@element='creator']">
|
||||
<xsl:copy-of select="node()"/>
|
||||
<xsl:if test="count(following-sibling::dim:field[@element='creator']) != 0">
|
||||
<xsl:text>; </xsl:text>
|
||||
</xsl:if>
|
||||
</xsl:for-each>
|
||||
</xsl:when>
|
||||
<xsl:when test="dim:field[@element='contributor']">
|
||||
<xsl:for-each select="dim:field[@element='contributor']">
|
||||
<xsl:copy-of select="node()"/>
|
||||
<xsl:if test="count(following-sibling::dim:field[@element='contributor']) != 0">
|
||||
<xsl:text>; </xsl:text>
|
||||
</xsl:if>
|
||||
</xsl:for-each>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<i18n:text>xmlui.dri2xhtml.METS-1.0.no-author</i18n:text>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</td>
|
||||
</tr>
|
||||
<xsl:call-template name="itemSummaryView-DIM-fields">
|
||||
<xsl:with-param name="clause" select="($clause + 1)"/>
|
||||
<xsl:with-param name="phase" select="$otherPhase"/>
|
||||
</xsl:call-template>
|
||||
</xsl:when>
|
||||
|
||||
<!-- Abstract row -->
|
||||
<xsl:when test="$clause = 3 and (dim:field[@element='description' and @qualifier='abstract'])">
|
||||
<tr class="ds-table-row {$phase}">
|
||||
<td><span class="bold"><i18n:text>xmlui.dri2xhtml.METS-1.0.item-abstract</i18n:text>:</span></td>
|
||||
<td>
|
||||
<xsl:if test="count(dim:field[@element='description' and @qualifier='abstract']) > 1">
|
||||
<hr class="metadata-seperator"/>
|
||||
</xsl:if>
|
||||
<xsl:for-each select="dim:field[@element='description' and @qualifier='abstract']">
|
||||
<xsl:copy-of select="./node()"/>
|
||||
<xsl:if test="count(following-sibling::dim:field[@element='description' and @qualifier='abstract']) != 0">
|
||||
<hr class="metadata-seperator"/>
|
||||
</xsl:if>
|
||||
</xsl:for-each>
|
||||
<xsl:if test="count(dim:field[@element='description' and @qualifier='abstract']) > 1">
|
||||
<hr class="metadata-seperator"/>
|
||||
</xsl:if>
|
||||
</td>
|
||||
</tr>
|
||||
<xsl:call-template name="itemSummaryView-DIM-fields">
|
||||
<xsl:with-param name="clause" select="($clause + 1)"/>
|
||||
<xsl:with-param name="phase" select="$otherPhase"/>
|
||||
</xsl:call-template>
|
||||
</xsl:when>
|
||||
|
||||
<!-- Description row -->
|
||||
<xsl:when test="$clause = 4 and (dim:field[@element='description' and not(@qualifier)])">
|
||||
<tr class="ds-table-row {$phase}">
|
||||
<td><span class="bold"><i18n:text>xmlui.dri2xhtml.METS-1.0.item-description</i18n:text>:</span></td>
|
||||
<td>
|
||||
<xsl:if test="count(dim:field[@element='description' and not(@qualifier)]) > 1 and not(count(dim:field[@element='description' and @qualifier='abstract']) > 1)">
|
||||
<hr class="metadata-seperator"/>
|
||||
</xsl:if>
|
||||
<xsl:for-each select="dim:field[@element='description' and not(@qualifier)]">
|
||||
<xsl:copy-of select="./node()"/>
|
||||
<xsl:if test="count(following-sibling::dim:field[@element='description' and not(@qualifier)]) != 0">
|
||||
<hr class="metadata-seperator"/>
|
||||
</xsl:if>
|
||||
</xsl:for-each>
|
||||
<xsl:if test="count(dim:field[@element='description' and not(@qualifier)]) > 1">
|
||||
<hr class="metadata-seperator"/>
|
||||
</xsl:if>
|
||||
</td>
|
||||
</tr>
|
||||
<xsl:call-template name="itemSummaryView-DIM-fields">
|
||||
<xsl:with-param name="clause" select="($clause + 1)"/>
|
||||
<xsl:with-param name="phase" select="$otherPhase"/>
|
||||
</xsl:call-template>
|
||||
</xsl:when>
|
||||
|
||||
<!-- identifier.uri row -->
|
||||
<xsl:when test="$clause = 5 and (dim:field[@element='identifier' and @qualifier='uri'])">
|
||||
<tr class="ds-table-row {$phase}">
|
||||
<td><span class="bold"><i18n:text>xmlui.dri2xhtml.METS-1.0.item-uri</i18n:text>:</span></td>
|
||||
<td>
|
||||
<xsl:for-each select="dim:field[@element='identifier' and @qualifier='uri']">
|
||||
<a>
|
||||
<xsl:attribute name="href">
|
||||
<xsl:copy-of select="./node()"/>
|
||||
</xsl:attribute>
|
||||
<xsl:copy-of select="./node()"/>
|
||||
</a>
|
||||
<xsl:if test="count(following-sibling::dim:field[@element='identifier' and @qualifier='uri']) != 0">
|
||||
<br/>
|
||||
</xsl:if>
|
||||
</xsl:for-each>
|
||||
</td>
|
||||
</tr>
|
||||
<xsl:call-template name="itemSummaryView-DIM-fields">
|
||||
<xsl:with-param name="clause" select="($clause + 1)"/>
|
||||
<xsl:with-param name="phase" select="$otherPhase"/>
|
||||
</xsl:call-template>
|
||||
</xsl:when>
|
||||
|
||||
<!-- date.issued row -->
|
||||
<xsl:when test="$clause = 6 and (dim:field[@element='date' and @qualifier='issued'])">
|
||||
<tr class="ds-table-row {$phase}">
|
||||
<td><span class="bold"><i18n:text>xmlui.dri2xhtml.METS-1.0.item-date</i18n:text>:</span></td>
|
||||
<td>
|
||||
<xsl:for-each select="dim:field[@element='date' and @qualifier='issued']">
|
||||
<xsl:copy-of select="substring(./node(),1,10)"/>
|
||||
<xsl:if test="count(following-sibling::dim:field[@element='date' and @qualifier='issued']) != 0">
|
||||
<br/>
|
||||
</xsl:if>
|
||||
</xsl:for-each>
|
||||
</td>
|
||||
</tr>
|
||||
<xsl:call-template name="itemSummaryView-DIM-fields">
|
||||
<xsl:with-param name="clause" select="($clause + 1)"/>
|
||||
<xsl:with-param name="phase" select="$otherPhase"/>
|
||||
</xsl:call-template>
|
||||
</xsl:when>
|
||||
|
||||
<!-- recurse without changing phase if we didn't output anything -->
|
||||
<xsl:otherwise>
|
||||
<!-- IMPORTANT: This test should be updated if clauses are added! -->
|
||||
<xsl:if test="$clause < 7">
|
||||
<xsl:call-template name="itemSummaryView-DIM-fields">
|
||||
<xsl:with-param name="clause" select="($clause + 1)"/>
|
||||
<xsl:with-param name="phase" select="$phase"/>
|
||||
</xsl:call-template>
|
||||
</xsl:if>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<!-- An item rendered in the detailView pattern, the "full item record" view of a DSpace item in Manakin. -->
|
||||
<xsl:template name="itemDetailView-DIM">
|
||||
<!-- Output all of the metadata about the item from the metadata section -->
|
||||
<xsl:apply-templates select="mets:dmdSec/mets:mdWrap[@OTHERMDTYPE='DIM']/mets:xmlData/dim:dim"
|
||||
mode="itemDetailView-DIM"/>
|
||||
|
||||
<!-- Generate the bitstream information from the file section -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="./mets:fileSec/mets:fileGrp[@USE='CONTENT' or @USE='ORIGINAL']">
|
||||
<xsl:apply-templates select="./mets:fileSec/mets:fileGrp[@USE='CONTENT' or @USE='ORIGINAL']">
|
||||
<xsl:with-param name="context" select="."/>
|
||||
<xsl:with-param name="primaryBitstream" select="./mets:structMap[@TYPE='LOGICAL']/mets:div[@TYPE='DSpace Item']/mets:fptr/@FILEID"/>
|
||||
</xsl:apply-templates>
|
||||
</xsl:when>
|
||||
<!-- Special case for handling ORE resource maps stored as DSpace bitstreams -->
|
||||
<xsl:when test="./mets:fileSec/mets:fileGrp[@USE='ORE']">
|
||||
<xsl:apply-templates select="./mets:fileSec/mets:fileGrp[@USE='ORE']"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<h2><i18n:text>xmlui.dri2xhtml.METS-1.0.item-files-head</i18n:text></h2>
|
||||
<table class="ds-table file-list">
|
||||
<tr class="ds-table-header-row">
|
||||
<th><i18n:text>xmlui.dri2xhtml.METS-1.0.item-files-file</i18n:text></th>
|
||||
<th><i18n:text>xmlui.dri2xhtml.METS-1.0.item-files-size</i18n:text></th>
|
||||
<th><i18n:text>xmlui.dri2xhtml.METS-1.0.item-files-format</i18n:text></th>
|
||||
<th><i18n:text>xmlui.dri2xhtml.METS-1.0.item-files-view</i18n:text></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="4">
|
||||
<p><i18n:text>xmlui.dri2xhtml.METS-1.0.item-no-files</i18n:text></p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
|
||||
|
||||
<!-- Generate the Creative Commons license information from the file section (DSpace deposit license hidden by default) -->
|
||||
<xsl:apply-templates select="mets:fileSec/mets:fileGrp[@USE='CC-LICENSE']"/>
|
||||
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<!-- The block of templates used to render the complete DIM contents of a DRI object -->
|
||||
<xsl:template match="dim:dim" mode="itemDetailView-DIM">
|
||||
<span class="Z3988">
|
||||
<xsl:attribute name="title">
|
||||
<xsl:call-template name="renderCOinS"/>
|
||||
</xsl:attribute>
|
||||
</span>
|
||||
<table class="ds-includeSet-table">
|
||||
<xsl:apply-templates mode="itemDetailView-DIM"/>
|
||||
</table>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="dim:field" mode="itemDetailView-DIM">
|
||||
<xsl:if test="not(@element='description' and @qualifier='provenance')">
|
||||
<tr>
|
||||
<xsl:attribute name="class">
|
||||
<xsl:text>ds-table-row </xsl:text>
|
||||
<xsl:if test="(position() div 2 mod 2 = 0)">even </xsl:if>
|
||||
<xsl:if test="(position() div 2 mod 2 = 1)">odd </xsl:if>
|
||||
</xsl:attribute>
|
||||
<td>
|
||||
<xsl:value-of select="./@mdschema"/>
|
||||
<xsl:text>.</xsl:text>
|
||||
<xsl:value-of select="./@element"/>
|
||||
<xsl:if test="./@qualifier">
|
||||
<xsl:text>.</xsl:text>
|
||||
<xsl:value-of select="./@qualifier"/>
|
||||
</xsl:if>
|
||||
</td>
|
||||
<td>
|
||||
<xsl:copy-of select="./node()"/>
|
||||
<xsl:if test="./@authority and ./@confidence">
|
||||
<xsl:call-template name="authorityConfidenceIcon">
|
||||
<xsl:with-param name="confidence" select="./@confidence"/>
|
||||
</xsl:call-template>
|
||||
</xsl:if>
|
||||
</td>
|
||||
<td><xsl:value-of select="./@language"/></td>
|
||||
</tr>
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
<!-- Generate the bitstream information from the file section -->
|
||||
<xsl:template match="mets:fileGrp[@USE='CONTENT']">
|
||||
<xsl:param name="context"/>
|
||||
<xsl:param name="primaryBitstream" select="-1"/>
|
||||
|
||||
<h2><i18n:text>xmlui.dri2xhtml.METS-1.0.item-files-head</i18n:text></h2>
|
||||
<table class="ds-table file-list">
|
||||
<tr class="ds-table-header-row">
|
||||
<th><i18n:text>xmlui.dri2xhtml.METS-1.0.item-files-file</i18n:text></th>
|
||||
<th><i18n:text>xmlui.dri2xhtml.METS-1.0.item-files-size</i18n:text></th>
|
||||
<th><i18n:text>xmlui.dri2xhtml.METS-1.0.item-files-format</i18n:text></th>
|
||||
<th><i18n:text>xmlui.dri2xhtml.METS-1.0.item-files-view</i18n:text></th>
|
||||
<!-- Display header for 'Description' only if at least one bitstream contains a description -->
|
||||
<xsl:if test="mets:file/mets:FLocat/@xlink:label != ''">
|
||||
<th><i18n:text>xmlui.dri2xhtml.METS-1.0.item-files-description</i18n:text></th>
|
||||
</xsl:if>
|
||||
</tr>
|
||||
<xsl:choose>
|
||||
<!-- If one exists and it's of text/html MIME type, only display the primary bitstream -->
|
||||
<xsl:when test="mets:file[@ID=$primaryBitstream]/@MIMETYPE='text/html'">
|
||||
<xsl:apply-templates select="mets:file[@ID=$primaryBitstream]">
|
||||
<xsl:with-param name="context" select="$context"/>
|
||||
</xsl:apply-templates>
|
||||
</xsl:when>
|
||||
<!-- Otherwise, iterate over and display all of them -->
|
||||
<xsl:otherwise>
|
||||
<xsl:apply-templates select="mets:file">
|
||||
<xsl:sort data-type="number" select="boolean(./@ID=$primaryBitstream)" order="descending" />
|
||||
<xsl:sort select="mets:FLocat[@LOCTYPE='URL']/@xlink:title"/>
|
||||
<xsl:with-param name="context" select="$context"/>
|
||||
</xsl:apply-templates>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</table>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<!-- Build a single row in the bitsreams table of the item view page -->
|
||||
<xsl:template match="mets:file">
|
||||
<xsl:param name="context" select="."/>
|
||||
<tr>
|
||||
<xsl:attribute name="class">
|
||||
<xsl:text>ds-table-row </xsl:text>
|
||||
<xsl:if test="(position() mod 2 = 0)">even </xsl:if>
|
||||
<xsl:if test="(position() mod 2 = 1)">odd </xsl:if>
|
||||
</xsl:attribute>
|
||||
<td>
|
||||
<a>
|
||||
<xsl:attribute name="href">
|
||||
<xsl:value-of select="mets:FLocat[@LOCTYPE='URL']/@xlink:href"/>
|
||||
</xsl:attribute>
|
||||
<xsl:attribute name="title">
|
||||
<xsl:value-of select="mets:FLocat[@LOCTYPE='URL']/@xlink:title"/>
|
||||
</xsl:attribute>
|
||||
<xsl:choose>
|
||||
<xsl:when test="string-length(mets:FLocat[@LOCTYPE='URL']/@xlink:title) > 50">
|
||||
<xsl:variable name="title_length" select="string-length(mets:FLocat[@LOCTYPE='URL']/@xlink:title)"/>
|
||||
<xsl:value-of select="substring(mets:FLocat[@LOCTYPE='URL']/@xlink:title,1,15)"/>
|
||||
<xsl:text> ... </xsl:text>
|
||||
<xsl:value-of select="substring(mets:FLocat[@LOCTYPE='URL']/@xlink:title,$title_length - 25,$title_length)"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:value-of select="mets:FLocat[@LOCTYPE='URL']/@xlink:title"/>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</a>
|
||||
</td>
|
||||
<!-- File size always comes in bytes and thus needs conversion -->
|
||||
<td>
|
||||
<xsl:choose>
|
||||
<xsl:when test="@SIZE < 1024">
|
||||
<xsl:value-of select="@SIZE"/>
|
||||
<i18n:text>xmlui.dri2xhtml.METS-1.0.size-bytes</i18n:text>
|
||||
</xsl:when>
|
||||
<xsl:when test="@SIZE < 1024 * 1024">
|
||||
<xsl:value-of select="substring(string(@SIZE div 1024),1,5)"/>
|
||||
<i18n:text>xmlui.dri2xhtml.METS-1.0.size-kilobytes</i18n:text>
|
||||
</xsl:when>
|
||||
<xsl:when test="@SIZE < 1024 * 1024 * 1024">
|
||||
<xsl:value-of select="substring(string(@SIZE div (1024 * 1024)),1,5)"/>
|
||||
<i18n:text>xmlui.dri2xhtml.METS-1.0.size-megabytes</i18n:text>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:value-of select="substring(string(@SIZE div (1024 * 1024 * 1024)),1,5)"/>
|
||||
<i18n:text>xmlui.dri2xhtml.METS-1.0.size-gigabytes</i18n:text>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</td>
|
||||
<!-- Lookup File Type description in local messages.xml based on MIME Type.
|
||||
In the original DSpace, this would get resolved to an application via
|
||||
the Bitstream Registry, but we are constrained by the capabilities of METS
|
||||
and can't really pass that info through. -->
|
||||
<td>
|
||||
<xsl:call-template name="getFileTypeDesc">
|
||||
<xsl:with-param name="mimetype">
|
||||
<xsl:value-of select="substring-before(@MIMETYPE,'/')"/>
|
||||
<xsl:text>/</xsl:text>
|
||||
<xsl:value-of select="substring-after(@MIMETYPE,'/')"/>
|
||||
</xsl:with-param>
|
||||
</xsl:call-template>
|
||||
</td>
|
||||
<td>
|
||||
<xsl:choose>
|
||||
<xsl:when test="$context/mets:fileSec/mets:fileGrp[@USE='THUMBNAIL']/
|
||||
mets:file[@GROUPID=current()/@GROUPID]">
|
||||
<a class="image-link">
|
||||
<xsl:attribute name="href">
|
||||
<xsl:value-of select="mets:FLocat[@LOCTYPE='URL']/@xlink:href"/>
|
||||
</xsl:attribute>
|
||||
<img alt="Thumbnail">
|
||||
<xsl:attribute name="src">
|
||||
<xsl:value-of select="$context/mets:fileSec/mets:fileGrp[@USE='THUMBNAIL']/
|
||||
mets:file[@GROUPID=current()/@GROUPID]/mets:FLocat[@LOCTYPE='URL']/@xlink:href"/>
|
||||
</xsl:attribute>
|
||||
</img>
|
||||
</a>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<a>
|
||||
<xsl:attribute name="href">
|
||||
<xsl:value-of select="mets:FLocat[@LOCTYPE='URL']/@xlink:href"/>
|
||||
</xsl:attribute>
|
||||
<i18n:text>xmlui.dri2xhtml.METS-1.0.item-files-viewOpen</i18n:text>
|
||||
</a>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</td>
|
||||
<!-- Display the contents of 'Description' as long as at least one bitstream contains a description -->
|
||||
<xsl:if test="$context/mets:fileSec/mets:fileGrp[@USE='CONTENT']/mets:file/mets:FLocat/@xlink:label != ''">
|
||||
<td>
|
||||
<xsl:value-of select="mets:FLocat[@LOCTYPE='URL']/@xlink:label"/>
|
||||
</td>
|
||||
</xsl:if>
|
||||
|
||||
</tr>
|
||||
</xsl:template>
|
||||
|
||||
<!--
|
||||
File Type Mapping template
|
||||
|
||||
This maps format MIME Types to human friendly File Type descriptions.
|
||||
Essentially, it looks for a corresponding 'key' in your messages.xml of this
|
||||
format: xmlui.dri2xhtml.mimetype.{MIME Type}
|
||||
|
||||
(e.g.) <message key="xmlui.dri2xhtml.mimetype.application/pdf">PDF</message>
|
||||
|
||||
If a key is found, the translated value is displayed as the File Type (e.g. PDF)
|
||||
If a key is NOT found, the MIME Type is displayed by default (e.g. application/pdf)
|
||||
-->
|
||||
<xsl:template name="getFileTypeDesc">
|
||||
<xsl:param name="mimetype"/>
|
||||
|
||||
<!--Build full key name for MIME type (format: xmlui.dri2xhtml.mimetype.{MIME type})-->
|
||||
<xsl:variable name="mimetype-key">xmlui.dri2xhtml.mimetype.<xsl:value-of select='$mimetype'/></xsl:variable>
|
||||
|
||||
<!--Lookup the MIME Type's key in messages.xml language file. If not found, just display MIME Type-->
|
||||
<i18n:text i18n:key="{$mimetype-key}"><xsl:value-of select="$mimetype"/></i18n:text>
|
||||
</xsl:template>
|
||||
|
||||
<!-- Generate the license information from the file section -->
|
||||
<xsl:template match="mets:fileGrp[@USE='CC-LICENSE' or @USE='LICENSE']">
|
||||
<div class="license-info">
|
||||
<p><i18n:text>xmlui.dri2xhtml.METS-1.0.license-text</i18n:text></p>
|
||||
<ul>
|
||||
<xsl:if test="@USE='CC-LICENSE'">
|
||||
<li><a href="{mets:file/mets:FLocat[@xlink:title='license_text']/@xlink:href}"><i18n:text>xmlui.dri2xhtml.structural.link_cc</i18n:text></a></li>
|
||||
</xsl:if>
|
||||
<xsl:if test="@USE='LICENSE'">
|
||||
<li><a href="{mets:file/mets:FLocat[@xlink:title='license.txt']/@xlink:href}"><i18n:text>xmlui.dri2xhtml.structural.link_original_license</i18n:text></a></li>
|
||||
</xsl:if>
|
||||
</ul>
|
||||
</div>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
</xsl:stylesheet>
|
@@ -0,0 +1,437 @@
|
||||
<!--
|
||||
choice-authority-control.xsl
|
||||
|
||||
Version: $Revision: 3705 $
|
||||
|
||||
Date: $Date: 2009-04-11 17:02:24 +0000 (Sat, 11 Apr 2009) $
|
||||
|
||||
Copyright (c) 2002-2005, Hewlett-Packard Company and Massachusetts
|
||||
Institute of Technology. All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
- Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
- Neither the name of the Hewlett-Packard Company nor the name of the
|
||||
Massachusetts Institute of Technology nor the names of their
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
|
||||
TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
|
||||
USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
|
||||
DAMAGE.
|
||||
-->
|
||||
|
||||
<!--
|
||||
Rendering of the authority control related pages.
|
||||
|
||||
Author: art.lowel at atmire.com
|
||||
Author: lieven.droogmans at atmire.com
|
||||
Author: ben at atmire.com
|
||||
Author: Alexey Maslov
|
||||
|
||||
-->
|
||||
|
||||
<xsl:stylesheet xmlns:i18n="http://apache.org/cocoon/i18n/2.1"
|
||||
xmlns:dri="http://di.tamu.edu/DRI/1.0/"
|
||||
xmlns:mets="http://www.loc.gov/METS/"
|
||||
xmlns:xlink="http://www.w3.org/TR/xlink/"
|
||||
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
|
||||
xmlns:dim="http://www.dspace.org/xmlns/dspace/dim"
|
||||
xmlns:xhtml="http://www.w3.org/1999/xhtml"
|
||||
xmlns:mods="http://www.loc.gov/mods/v3"
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns="http://www.w3.org/1999/xhtml"
|
||||
exclude-result-prefixes="i18n dri mets xlink xsl dim xhtml mods dc">
|
||||
|
||||
<xsl:output indent="yes"/>
|
||||
|
||||
<!-- =============================================================== -->
|
||||
<!-- - - - - - New templates for Choice/Authority control - - - - - -->
|
||||
|
||||
<!-- choose 'hidden' for invisible auth, 'text' lets CSS control it. -->
|
||||
<xsl:variable name="authorityInputType" select="'text'"/>
|
||||
|
||||
<!-- add button to invoke Choices lookup popup.. assume
|
||||
- that the context is a dri:field, where dri:params/@choices is true.
|
||||
-->
|
||||
<xsl:template name="addLookupButton">
|
||||
<xsl:param name="isName" select="'missing value'"/>
|
||||
<!-- optional param if you want to send authority value to diff field -->
|
||||
<xsl:param name="authorityInput" select="concat(@n,'_authority')"/>
|
||||
<!-- optional param for confidence indicator ID -->
|
||||
<xsl:param name="confIndicator" select="''"/>
|
||||
<input type="button" name="{concat('lookup_',@n)}" class="ds-button-field ds-add-button" >
|
||||
<xsl:attribute name="value">
|
||||
<xsl:text>Lookup</xsl:text>
|
||||
<xsl:if test="contains(dri:params/@operations,'add')">
|
||||
<xsl:text> & Add</xsl:text>
|
||||
</xsl:if>
|
||||
</xsl:attribute>
|
||||
<xsl:attribute name="onClick">
|
||||
<xsl:text>javascript:DSpaceChoiceLookup('</xsl:text>
|
||||
<!-- URL -->
|
||||
<xsl:value-of select="concat($context-path,'/admin/lookup')"/>
|
||||
<xsl:text>', '</xsl:text>
|
||||
<!-- field -->
|
||||
<xsl:value-of select="dri:params/@choices"/>
|
||||
<xsl:text>', '</xsl:text>
|
||||
<!-- formID -->
|
||||
<xsl:value-of select="translate(ancestor::dri:div[@interactive='yes']/@id,'.','_')"/>
|
||||
<xsl:text>', '</xsl:text>
|
||||
<!-- valueInput -->
|
||||
<xsl:value-of select="@n"/>
|
||||
<xsl:text>', '</xsl:text>
|
||||
<!-- authorityInput, name of field to get authority -->
|
||||
<xsl:value-of select="$authorityInput"/>
|
||||
<xsl:text>', '</xsl:text>
|
||||
<!-- Confidence Indicator's ID so lookup can frob it -->
|
||||
<xsl:value-of select="$confIndicator"/>
|
||||
<xsl:text>', </xsl:text>
|
||||
<!-- Collection ID for context -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="/dri:document/dri:meta/dri:pageMeta/dri:metadata[@element='choice'][@qualifier='collection']">
|
||||
<xsl:value-of select="/dri:document/dri:meta/dri:pageMeta/dri:metadata[@element='choice'][@qualifier='collection']"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:text>-1</xsl:text>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<xsl:text>, </xsl:text>
|
||||
<!-- isName -->
|
||||
<xsl:value-of select="$isName"/>
|
||||
<xsl:text>, </xsl:text>
|
||||
<!-- isRepating -->
|
||||
<xsl:value-of select="boolean(contains(dri:params/@operations,'add'))"/>
|
||||
<xsl:text>);</xsl:text>
|
||||
</xsl:attribute>
|
||||
</input>
|
||||
</xsl:template>
|
||||
|
||||
<!-- Fragment to display an authority confidence icon.
|
||||
- Insert an invisible 1x1 image which gets "covered" by background
|
||||
- image as dictated by the CSS, so icons are easily adjusted in CSS.
|
||||
- "confidence" param is confidence _value_, i.e. symbolic name
|
||||
-->
|
||||
<xsl:template name="authorityConfidenceIcon">
|
||||
<!-- default confidence value won't show any image. -->
|
||||
<xsl:param name="confidence" select="'blank'"/>
|
||||
<xsl:param name="id" select="''"/>
|
||||
<xsl:variable name="lcConfidence" select="translate($confidence,'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')"/>
|
||||
<img i18n:attr="title">
|
||||
<xsl:if test="string-length($id) > 0">
|
||||
<xsl:attribute name="id">
|
||||
<xsl:value-of select="$id"/>
|
||||
</xsl:attribute>
|
||||
</xsl:if>
|
||||
<xsl:attribute name="src">
|
||||
<xsl:value-of select="concat($theme-path,'/images/invisible.gif')"/>
|
||||
</xsl:attribute>
|
||||
<xsl:attribute name="class">
|
||||
<xsl:text>ds-authority-confidence </xsl:text>
|
||||
<xsl:choose>
|
||||
<xsl:when test="string-length($lcConfidence) > 0">
|
||||
<xsl:value-of select="concat('cf-',$lcConfidence,' ')"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:text>cf-blank </xsl:text>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:attribute>
|
||||
<xsl:attribute name="title">
|
||||
<xsl:text>xmlui.authority.confidence.description.cf_</xsl:text>
|
||||
<xsl:value-of select="$lcConfidence"/>
|
||||
</xsl:attribute>
|
||||
</img>
|
||||
</xsl:template>
|
||||
|
||||
<!-- Fragment to include an authority confidence hidden input
|
||||
- assumes @n is the name of the field.
|
||||
- param is confidence _value_, i.e. integer 0-6
|
||||
-->
|
||||
<xsl:template name="authorityConfidenceInput">
|
||||
<xsl:param name="confidence"/>
|
||||
<xsl:param name="name"/>
|
||||
<input class="ds-authority-confidence-input" type="hidden">
|
||||
<xsl:attribute name="name">
|
||||
<xsl:value-of select="$name"/>
|
||||
</xsl:attribute>
|
||||
<xsl:attribute name="value">
|
||||
<xsl:value-of select="$confidence"/>
|
||||
</xsl:attribute>
|
||||
</input>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<!-- insert fields needed by Scriptaculous autocomplete -->
|
||||
<xsl:template name="addAuthorityAutocompleteWidgets">
|
||||
<!-- "spinner" indicator to signal "loading", managed by autocompleter -->
|
||||
<!-- put it next to input field -->
|
||||
<span style="display:none;">
|
||||
<xsl:attribute name="id">
|
||||
<xsl:value-of select="concat(translate(@id,'.','_'),'_indicator')"/>
|
||||
</xsl:attribute>
|
||||
<img alt="Loading...">
|
||||
<xsl:attribute name="src">
|
||||
<xsl:value-of select="concat($theme-path,'/images/suggest-indicator.gif')"/>
|
||||
</xsl:attribute>
|
||||
</img>
|
||||
</span>
|
||||
<!-- This is the anchor for autocomplete popup, div id="..._container" -->
|
||||
<!-- put it below input field, give ID to autocomplete below -->
|
||||
<div class="autocomplete">
|
||||
<xsl:attribute name="id">
|
||||
<xsl:value-of select="concat(translate(@id,'.','_'),'_container')"/>
|
||||
</xsl:attribute>
|
||||
<xsl:text> </xsl:text>
|
||||
</div>
|
||||
</xsl:template>
|
||||
|
||||
<!-- adds autocomplete fields and setup script to "normal" submit input -->
|
||||
<xsl:template name="addAuthorityAutocomplete">
|
||||
<xsl:param name="confidenceIndicatorID" select="''"/>
|
||||
<xsl:param name="confidenceName" select="''"/>
|
||||
<xsl:call-template name="addAuthorityAutocompleteWidgets"/>
|
||||
<xsl:call-template name="autocompleteSetup">
|
||||
<xsl:with-param name="formID" select="translate(ancestor::dri:div[@interactive='yes']/@id,'.','_')"/>
|
||||
<xsl:with-param name="metadataField" select="@n"/>
|
||||
<xsl:with-param name="inputName" select="@n"/>
|
||||
<xsl:with-param name="authorityName" select="concat(@n,'_authority')"/>
|
||||
<xsl:with-param name="containerID" select="concat(translate(@id,'.','_'),'_container')"/>
|
||||
<xsl:with-param name="indicatorID" select="concat(translate(@id,'.','_'),'_indicator')"/>
|
||||
<xsl:with-param name="isClosed" select="contains(dri:params/@choicesClosed,'true')"/>
|
||||
<xsl:with-param name="confidenceIndicatorID" select="$confidenceIndicatorID"/>
|
||||
<xsl:with-param name="confidenceName" select="$confidenceName"/>
|
||||
<xsl:with-param name="collectionID">
|
||||
<xsl:choose>
|
||||
<xsl:when test="/dri:document/dri:meta/dri:pageMeta/dri:metadata[@element='choice'][@qualifier='collection']">
|
||||
<xsl:value-of select="/dri:document/dri:meta/dri:pageMeta/dri:metadata[@element='choice'][@qualifier='collection']"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:text>-1</xsl:text>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:with-param>
|
||||
</xsl:call-template>
|
||||
</xsl:template>
|
||||
|
||||
<!-- generate the script that sets up autocomplete feature on input field -->
|
||||
<!-- ..it has lots of params -->
|
||||
<xsl:template name="autocompleteSetup">
|
||||
<xsl:param name="formID" select="'missing value'"/>
|
||||
<xsl:param name="metadataField" select="'missing value'"/>
|
||||
<xsl:param name="inputName" select="'missing value'"/>
|
||||
<xsl:param name="authorityName" select="''"/>
|
||||
<xsl:param name="containerID" select="'missing value'"/>
|
||||
<xsl:param name="collectionID" select="'-1'"/>
|
||||
<xsl:param name="indicatorID" select="'missing value'"/>
|
||||
<xsl:param name="confidenceIndicatorID" select="''"/>
|
||||
<xsl:param name="confidenceName" select="''"/>
|
||||
<xsl:param name="isClosed" select="'false'"/>
|
||||
<script type="text/javascript">
|
||||
<xsl:text>var gigo = DSpaceSetupAutocomplete('</xsl:text>
|
||||
<xsl:value-of select="$formID"/>
|
||||
<xsl:text>', { metadataField: '</xsl:text>
|
||||
<xsl:value-of select="$metadataField"/>
|
||||
<xsl:text>', isClosed: '</xsl:text>
|
||||
<xsl:value-of select="$isClosed"/>
|
||||
<xsl:text>', inputName: '</xsl:text>
|
||||
<xsl:value-of select="$inputName"/>
|
||||
<xsl:text>', authorityName: '</xsl:text>
|
||||
<xsl:value-of select="$authorityName"/>
|
||||
<xsl:text>', containerID: '</xsl:text>
|
||||
<xsl:value-of select="$containerID"/>
|
||||
<xsl:text>', indicatorID: '</xsl:text>
|
||||
<xsl:value-of select="$indicatorID"/>
|
||||
<xsl:text>', confidenceIndicatorID: '</xsl:text>
|
||||
<xsl:value-of select="$confidenceIndicatorID"/>
|
||||
<xsl:text>', confidenceName: '</xsl:text>
|
||||
<xsl:value-of select="$confidenceName"/>
|
||||
<xsl:text>', collection: </xsl:text>
|
||||
<xsl:value-of select="$collectionID"/>
|
||||
<xsl:text>, contextPath: '</xsl:text>
|
||||
<xsl:value-of select="/dri:document/dri:meta/dri:pageMeta/dri:metadata[@element='contextPath'][not(@qualifier)]"/>
|
||||
<xsl:text>'});</xsl:text>
|
||||
</script>
|
||||
</xsl:template>
|
||||
|
||||
<!-- add the extra _authority{_n?} and _confidence input fields -->
|
||||
<xsl:template name="authorityInputFields">
|
||||
<xsl:param name="name" select="''"/>
|
||||
<xsl:param name="id" select="''"/>
|
||||
<xsl:param name="position" select="''"/>
|
||||
<xsl:param name="authValue" select="''"/>
|
||||
<xsl:param name="confValue" select="''"/>
|
||||
<xsl:param name="confIndicatorID" select="''"/>
|
||||
<xsl:param name="unlockButton" select="''"/>
|
||||
<xsl:param name="unlockHelp" select="''"/>
|
||||
<xsl:variable name="authFieldID" select="concat(translate(@id,'.','_'),'_authority')"/>
|
||||
<xsl:variable name="confFieldID" select="concat(translate(@id,'.','_'),'_confidence')"/>
|
||||
<!-- the authority key value -->
|
||||
<input>
|
||||
<xsl:attribute name="class">
|
||||
<xsl:text>ds-authority-value </xsl:text>
|
||||
<xsl:if test="$unlockButton">
|
||||
<xsl:text>ds-authority-visible </xsl:text>
|
||||
</xsl:if>
|
||||
</xsl:attribute>
|
||||
<xsl:attribute name="type"><xsl:value-of select="$authorityInputType"/></xsl:attribute>
|
||||
<xsl:attribute name="readonly"><xsl:text>readonly</xsl:text></xsl:attribute>
|
||||
<xsl:attribute name="name">
|
||||
<xsl:value-of select="concat($name,'_authority')"/>
|
||||
<xsl:if test="$position">
|
||||
<xsl:value-of select="concat('_', $position)"/>
|
||||
</xsl:if>
|
||||
</xsl:attribute>
|
||||
<xsl:if test="$id">
|
||||
<xsl:attribute name="id">
|
||||
<xsl:value-of select="$authFieldID"/>
|
||||
</xsl:attribute>
|
||||
</xsl:if>
|
||||
<xsl:attribute name="value">
|
||||
<xsl:value-of select="$authValue"/>
|
||||
</xsl:attribute>
|
||||
<!-- this updates confidence after a manual change to authority value -->
|
||||
<xsl:attribute name="onChange">
|
||||
<xsl:text>javascript: return DSpaceAuthorityOnChange(this, '</xsl:text>
|
||||
<xsl:value-of select="$confFieldID"/>
|
||||
<xsl:text>','</xsl:text>
|
||||
<xsl:value-of select="$confIndicatorID"/>
|
||||
<xsl:text>');</xsl:text>
|
||||
</xsl:attribute>
|
||||
</input>
|
||||
<!-- optional "unlock" button on (visible) authority value field -->
|
||||
<xsl:if test="$unlockButton">
|
||||
<input type="image" class="ds-authority-lock is-locked ">
|
||||
<xsl:attribute name="onClick">
|
||||
<xsl:text>javascript: return DSpaceToggleAuthorityLock(this, '</xsl:text>
|
||||
<xsl:value-of select="$authFieldID"/>
|
||||
<xsl:text>');</xsl:text>
|
||||
</xsl:attribute>
|
||||
<xsl:attribute name="src">
|
||||
<xsl:value-of select="concat($theme-path,'/images/invisible.gif')"/>
|
||||
</xsl:attribute>
|
||||
<xsl:attribute name="i18n:attr">title</xsl:attribute>
|
||||
<xsl:attribute name="title">
|
||||
<xsl:value-of select="$unlockHelp"/>
|
||||
</xsl:attribute>
|
||||
</input>
|
||||
</xsl:if>
|
||||
<input class="ds-authority-confidence-input" type="hidden">
|
||||
<xsl:attribute name="name">
|
||||
<xsl:value-of select="concat($name,'_confidence')"/>
|
||||
<xsl:if test="$position">
|
||||
<xsl:value-of select="concat('_', $position)"/>
|
||||
</xsl:if>
|
||||
</xsl:attribute>
|
||||
<xsl:if test="$id">
|
||||
<xsl:attribute name="id">
|
||||
<xsl:value-of select="$confFieldID"/>
|
||||
</xsl:attribute>
|
||||
</xsl:if>
|
||||
<xsl:attribute name="value">
|
||||
<xsl:value-of select="$confValue"/>
|
||||
</xsl:attribute>
|
||||
</input>
|
||||
</xsl:template>
|
||||
|
||||
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
|
||||
<!-- Special Transformations for Choice Authority lookup popup page -->
|
||||
|
||||
<!-- indicator spinner -->
|
||||
<xsl:template match="dri:item[@id='aspect.general.ChoiceLookupTransformer.item.select']/dri:figure">
|
||||
<img id="lookup_indicator_id" alt="Loading..." style="display:none;">
|
||||
<xsl:attribute name="src">
|
||||
<xsl:value-of select="concat($theme-path,'/images/lookup-indicator.gif')"/>
|
||||
</xsl:attribute>
|
||||
</img>
|
||||
</xsl:template>
|
||||
|
||||
<!-- This inline JS must be added to the popup page for choice lookups -->
|
||||
<xsl:template name="choiceLookupPopUpSetup">
|
||||
<script type="text/javascript">
|
||||
var form = document.getElementById('aspect_general_ChoiceLookupTransformer_div_lookup');
|
||||
DSpaceChoicesSetup(form);
|
||||
</script>
|
||||
</xsl:template>
|
||||
|
||||
<!-- Special select widget for lookup popup -->
|
||||
<xsl:template match="dri:field[@id='aspect.general.ChoiceLookupTransformer.field.chooser']">
|
||||
<div>
|
||||
<select onChange="javascript:DSpaceChoicesSelectOnChange();">
|
||||
<xsl:call-template name="fieldAttributes"/>
|
||||
<xsl:apply-templates/>
|
||||
<xsl:comment>space filler because "unclosed" select annoys browsers</xsl:comment>
|
||||
</select>
|
||||
<img class="choices-lookup" id="lookup_indicator_id" alt="Loading..." style="display:none;">
|
||||
<xsl:attribute name="src">
|
||||
<xsl:value-of select="concat($theme-path,'/images/lookup-indicator.gif')"/>
|
||||
</xsl:attribute>
|
||||
</img>
|
||||
</div>
|
||||
</xsl:template>
|
||||
|
||||
<!-- Generate buttons with onClick attribute, since it is the easiest
|
||||
- way to set a single event handler in a browser-independent manner.
|
||||
-->
|
||||
|
||||
<!-- choice popup "accept" button -->
|
||||
<xsl:template match="dri:field[@id='aspect.general.ChoiceLookupTransformer.field.accept']">
|
||||
<xsl:call-template name="choiceLookupButton">
|
||||
<xsl:with-param name="onClick" select="'javascript:DSpaceChoicesAcceptOnClick();'"/>
|
||||
</xsl:call-template>
|
||||
</xsl:template>
|
||||
|
||||
<!-- choice popup "more" button -->
|
||||
<xsl:template match="dri:field[@id='aspect.general.ChoiceLookupTransformer.field.more']">
|
||||
<xsl:call-template name="choiceLookupButton">
|
||||
<xsl:with-param name="onClick" select="'javascript:DSpaceChoicesMoreOnClick();'"/>
|
||||
</xsl:call-template>
|
||||
</xsl:template>
|
||||
|
||||
<!-- choice popup "cancel" button -->
|
||||
<xsl:template match="dri:field[@id='aspect.general.ChoiceLookupTransformer.field.cancel']">
|
||||
<xsl:call-template name="choiceLookupButton">
|
||||
<xsl:with-param name="onClick" select="'javascript:DSpaceChoicesCancelOnClick();'"/>
|
||||
</xsl:call-template>
|
||||
</xsl:template>
|
||||
|
||||
<!-- button markup: special handling needed because these must not be <input type=submit> -->
|
||||
<xsl:template name="choiceLookupButton">
|
||||
<xsl:param name="onClick"/>
|
||||
<input type="button" onClick="{$onClick}">
|
||||
<xsl:call-template name="fieldAttributes"/>
|
||||
<xsl:attribute name="value">
|
||||
<xsl:choose>
|
||||
<xsl:when test="./dri:value[@type='raw']">
|
||||
<xsl:value-of select="./dri:value[@type='raw']"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:value-of select="./dri:value[@type='default']"/>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:attribute>
|
||||
<xsl:if test="dri:value/i18n:text">
|
||||
<xsl:attribute name="i18n:attr">value</xsl:attribute>
|
||||
</xsl:if>
|
||||
<xsl:apply-templates />
|
||||
</input>
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
@@ -0,0 +1,252 @@
|
||||
<!--
|
||||
attribute-handlers.xsl
|
||||
|
||||
Version: $Revision: 3705 $
|
||||
|
||||
Date: $Date: 2009-04-11 17:02:24 +0000 (Sat, 11 Apr 2009) $
|
||||
|
||||
Copyright (c) 2002-2005, Hewlett-Packard Company and Massachusetts
|
||||
Institute of Technology. All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
- Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
- Neither the name of the Hewlett-Packard Company nor the name of the
|
||||
Massachusetts Institute of Technology nor the names of their
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
|
||||
TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
|
||||
USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
|
||||
DAMAGE.
|
||||
-->
|
||||
|
||||
<!--
|
||||
Templates to cover the attribute calls.
|
||||
|
||||
Author: art.lowel at atmire.com
|
||||
Author: lieven.droogmans at atmire.com
|
||||
Author: ben at atmire.com
|
||||
Author: Alexey Maslov
|
||||
|
||||
-->
|
||||
|
||||
<xsl:stylesheet xmlns:i18n="http://apache.org/cocoon/i18n/2.1"
|
||||
xmlns:dri="http://di.tamu.edu/DRI/1.0/"
|
||||
xmlns:mets="http://www.loc.gov/METS/"
|
||||
xmlns:xlink="http://www.w3.org/TR/xlink/"
|
||||
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
|
||||
xmlns:dim="http://www.dspace.org/xmlns/dspace/dim"
|
||||
xmlns:xhtml="http://www.w3.org/1999/xhtml"
|
||||
xmlns:mods="http://www.loc.gov/mods/v3"
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns="http://www.w3.org/1999/xhtml"
|
||||
exclude-result-prefixes="i18n dri mets xlink xsl dim xhtml mods dc">
|
||||
|
||||
<xsl:output indent="yes"/>
|
||||
|
||||
<!-- The last thing in the structural elements section are the templates to cover the attribute calls.
|
||||
Although, by default, XSL only parses elements and text, an explicit call to apply the attributes
|
||||
of children tags can still be made. This, in turn, requires templates that handle specific attributes,
|
||||
like the kind you see below. The chief amongst them is the pagination attribute contained by divs,
|
||||
which creates a new div element to display pagination information. -->
|
||||
|
||||
<xsl:template match="@pagination">
|
||||
<xsl:param name="position"/>
|
||||
<xsl:choose>
|
||||
<xsl:when test=". = 'simple'">
|
||||
<div class="pagination {$position}">
|
||||
<xsl:if test="parent::node()/@previousPage">
|
||||
<a class="previous-page-link">
|
||||
<xsl:attribute name="href">
|
||||
<xsl:value-of select="parent::node()/@previousPage"/>
|
||||
</xsl:attribute>
|
||||
<i18n:text>xmlui.dri2xhtml.structural.pagination-previous</i18n:text>
|
||||
</a>
|
||||
</xsl:if>
|
||||
<p class="pagination-info">
|
||||
<i18n:translate>
|
||||
<i18n:text>xmlui.dri2xhtml.structural.pagination-info</i18n:text>
|
||||
<i18n:param><xsl:value-of select="parent::node()/@firstItemIndex"/></i18n:param>
|
||||
<i18n:param><xsl:value-of select="parent::node()/@lastItemIndex"/></i18n:param>
|
||||
<i18n:param><xsl:value-of select="parent::node()/@itemsTotal"/></i18n:param>
|
||||
</i18n:translate>
|
||||
<!--
|
||||
<xsl:text>Now showing items </xsl:text>
|
||||
<xsl:value-of select="parent::node()/@firstItemIndex"/>
|
||||
<xsl:text>-</xsl:text>
|
||||
<xsl:value-of select="parent::node()/@lastItemIndex"/>
|
||||
<xsl:text> of </xsl:text>
|
||||
<xsl:value-of select="parent::node()/@itemsTotal"/>
|
||||
-->
|
||||
</p>
|
||||
<xsl:if test="parent::node()/@nextPage">
|
||||
<a class="next-page-link">
|
||||
<xsl:attribute name="href">
|
||||
<xsl:value-of select="parent::node()/@nextPage"/>
|
||||
</xsl:attribute>
|
||||
<i18n:text>xmlui.dri2xhtml.structural.pagination-next</i18n:text>
|
||||
</a>
|
||||
</xsl:if>
|
||||
</div>
|
||||
</xsl:when>
|
||||
<xsl:when test=". = 'masked'">
|
||||
<div class="pagination-masked {$position}">
|
||||
<xsl:if test="not(parent::node()/@firstItemIndex = 0 or parent::node()/@firstItemIndex = 1)">
|
||||
<a class="previous-page-link">
|
||||
<xsl:attribute name="href">
|
||||
<xsl:value-of select="substring-before(parent::node()/@pageURLMask,'{pageNum}')"/>
|
||||
<xsl:value-of select="parent::node()/@currentPage - 1"/>
|
||||
<xsl:value-of select="substring-after(parent::node()/@pageURLMask,'{pageNum}')"/>
|
||||
</xsl:attribute>
|
||||
<i18n:text>xmlui.dri2xhtml.structural.pagination-previous</i18n:text>
|
||||
</a>
|
||||
</xsl:if>
|
||||
<p class="pagination-info">
|
||||
<i18n:translate>
|
||||
<i18n:text>xmlui.dri2xhtml.structural.pagination-info</i18n:text>
|
||||
<i18n:param><xsl:value-of select="parent::node()/@firstItemIndex"/></i18n:param>
|
||||
<i18n:param><xsl:value-of select="parent::node()/@lastItemIndex"/></i18n:param>
|
||||
<i18n:param><xsl:value-of select="parent::node()/@itemsTotal"/></i18n:param>
|
||||
</i18n:translate>
|
||||
</p>
|
||||
<ul class="pagination-links">
|
||||
<xsl:if test="(parent::node()/@currentPage - 4) > 0">
|
||||
<li class="first-page-link">
|
||||
<a>
|
||||
<xsl:attribute name="href">
|
||||
<xsl:value-of select="substring-before(parent::node()/@pageURLMask,'{pageNum}')"/>
|
||||
<xsl:text>1</xsl:text>
|
||||
<xsl:value-of select="substring-after(parent::node()/@pageURLMask,'{pageNum}')"/>
|
||||
</xsl:attribute>
|
||||
<xsl:text>1</xsl:text>
|
||||
</a>
|
||||
<xsl:text> . . . </xsl:text>
|
||||
</li>
|
||||
</xsl:if>
|
||||
<xsl:call-template name="offset-link">
|
||||
<xsl:with-param name="pageOffset">-3</xsl:with-param>
|
||||
</xsl:call-template>
|
||||
<xsl:call-template name="offset-link">
|
||||
<xsl:with-param name="pageOffset">-2</xsl:with-param>
|
||||
</xsl:call-template>
|
||||
<xsl:call-template name="offset-link">
|
||||
<xsl:with-param name="pageOffset">-1</xsl:with-param>
|
||||
</xsl:call-template>
|
||||
<xsl:call-template name="offset-link">
|
||||
<xsl:with-param name="pageOffset">0</xsl:with-param>
|
||||
</xsl:call-template>
|
||||
<xsl:call-template name="offset-link">
|
||||
<xsl:with-param name="pageOffset">1</xsl:with-param>
|
||||
</xsl:call-template>
|
||||
<xsl:call-template name="offset-link">
|
||||
<xsl:with-param name="pageOffset">2</xsl:with-param>
|
||||
</xsl:call-template>
|
||||
<xsl:call-template name="offset-link">
|
||||
<xsl:with-param name="pageOffset">3</xsl:with-param>
|
||||
</xsl:call-template>
|
||||
<xsl:if test="(parent::node()/@currentPage + 4) <= (parent::node()/@pagesTotal)">
|
||||
<li class="last-page-link">
|
||||
<xsl:text> . . . </xsl:text>
|
||||
<a>
|
||||
<xsl:attribute name="href">
|
||||
<xsl:value-of select="substring-before(parent::node()/@pageURLMask,'{pageNum}')"/>
|
||||
<xsl:value-of select="parent::node()/@pagesTotal"/>
|
||||
<xsl:value-of select="substring-after(parent::node()/@pageURLMask,'{pageNum}')"/>
|
||||
</xsl:attribute>
|
||||
<xsl:value-of select="parent::node()/@pagesTotal"/>
|
||||
</a>
|
||||
</li>
|
||||
</xsl:if>
|
||||
</ul>
|
||||
<xsl:if test="not(parent::node()/@lastItemIndex = parent::node()/@itemsTotal)">
|
||||
<a class="next-page-link">
|
||||
<xsl:attribute name="href">
|
||||
<xsl:value-of select="substring-before(parent::node()/@pageURLMask,'{pageNum}')"/>
|
||||
<xsl:value-of select="parent::node()/@currentPage + 1"/>
|
||||
<xsl:value-of select="substring-after(parent::node()/@pageURLMask,'{pageNum}')"/>
|
||||
</xsl:attribute>
|
||||
<i18n:text>xmlui.dri2xhtml.structural.pagination-next</i18n:text>
|
||||
</a>
|
||||
</xsl:if>
|
||||
</div>
|
||||
</xsl:when>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
|
||||
<!-- A quick helper function used by the @pagination template for repetitive tasks -->
|
||||
<xsl:template name="offset-link">
|
||||
<xsl:param name="pageOffset"/>
|
||||
<xsl:if test="((parent::node()/@currentPage + $pageOffset) > 0) and
|
||||
((parent::node()/@currentPage + $pageOffset) <= (parent::node()/@pagesTotal))">
|
||||
<li class="page-link">
|
||||
<xsl:if test="$pageOffset = 0">
|
||||
<xsl:attribute name="class">current-page-link</xsl:attribute>
|
||||
</xsl:if>
|
||||
<a>
|
||||
<xsl:attribute name="href">
|
||||
<xsl:value-of select="substring-before(parent::node()/@pageURLMask,'{pageNum}')"/>
|
||||
<xsl:value-of select="parent::node()/@currentPage + $pageOffset"/>
|
||||
<xsl:value-of select="substring-after(parent::node()/@pageURLMask,'{pageNum}')"/>
|
||||
</xsl:attribute>
|
||||
<xsl:value-of select="parent::node()/@currentPage + $pageOffset"/>
|
||||
</a>
|
||||
</li>
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<!-- checkbox and radio fields type uses this attribute -->
|
||||
<xsl:template match="@returnValue">
|
||||
<xsl:attribute name="value"><xsl:value-of select="."/></xsl:attribute>
|
||||
</xsl:template>
|
||||
|
||||
<!-- used for image buttons -->
|
||||
<xsl:template match="@source">
|
||||
<xsl:attribute name="src"><xsl:value-of select="."/></xsl:attribute>
|
||||
</xsl:template>
|
||||
|
||||
<!-- size and maxlength used by text, password, and textarea inputs -->
|
||||
<xsl:template match="@size">
|
||||
<xsl:attribute name="size"><xsl:value-of select="."/></xsl:attribute>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="@maxlength">
|
||||
<xsl:attribute name="maxlength"><xsl:value-of select="."/></xsl:attribute>
|
||||
</xsl:template>
|
||||
|
||||
<!-- "multiple" attribute is used by the <select> input method -->
|
||||
<xsl:template match="@multiple[.='yes']">
|
||||
<xsl:attribute name="multiple">multiple</xsl:attribute>
|
||||
</xsl:template>
|
||||
|
||||
<!-- rows and cols attributes are used by textarea input -->
|
||||
<xsl:template match="@rows">
|
||||
<xsl:attribute name="rows"><xsl:value-of select="."/></xsl:attribute>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="@cols">
|
||||
<xsl:attribute name="cols"><xsl:value-of select="."/></xsl:attribute>
|
||||
</xsl:template>
|
||||
|
||||
<!-- The general "catch-all" template for attributes matched, but not handled above -->
|
||||
<xsl:template match="@*"></xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
@@ -0,0 +1,685 @@
|
||||
<!--
|
||||
elements.xsl
|
||||
|
||||
Version: $Revision: 3705 $
|
||||
|
||||
Date: $Date: 2009-04-11 17:02:24 +0000 (Sat, 11 Apr 2009) $
|
||||
|
||||
Copyright (c) 2002-2005, Hewlett-Packard Company and Massachusetts
|
||||
Institute of Technology. All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
- Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
- Neither the name of the Hewlett-Packard Company nor the name of the
|
||||
Massachusetts Institute of Technology nor the names of their
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
|
||||
TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
|
||||
USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
|
||||
DAMAGE.
|
||||
-->
|
||||
|
||||
<!--
|
||||
Templates to cover the common dri elements.
|
||||
|
||||
Author: art.lowel at atmire.com
|
||||
Author: lieven.droogmans at atmire.com
|
||||
Author: ben at atmire.com
|
||||
Author: Alexey Maslov
|
||||
|
||||
-->
|
||||
|
||||
<xsl:stylesheet xmlns:i18n="http://apache.org/cocoon/i18n/2.1"
|
||||
xmlns:dri="http://di.tamu.edu/DRI/1.0/"
|
||||
xmlns:mets="http://www.loc.gov/METS/"
|
||||
xmlns:xlink="http://www.w3.org/TR/xlink/"
|
||||
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
|
||||
xmlns:dim="http://www.dspace.org/xmlns/dspace/dim"
|
||||
xmlns:xhtml="http://www.w3.org/1999/xhtml"
|
||||
xmlns:mods="http://www.loc.gov/mods/v3"
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns="http://www.w3.org/1999/xhtml"
|
||||
exclude-result-prefixes="i18n dri mets xlink xsl dim xhtml mods dc">
|
||||
|
||||
<xsl:output indent="yes"/>
|
||||
|
||||
|
||||
<!-- First and foremost come the div elements, which are the only elements directly under body. Every
|
||||
document has a body and every body has at least one div, which may in turn contain other divs and
|
||||
so on. Divs can be of two types: interactive and non-interactive, as signified by the attribute of
|
||||
the same name. The two types are handled separately.
|
||||
-->
|
||||
|
||||
<!-- Non-interactive divs get turned into HTML div tags. The general process, which is found in many
|
||||
templates in this stylesheet, is to call the template for the head element (creating the HTML h tag),
|
||||
handle the attributes, and then apply the templates for the all children except the head. The id
|
||||
attribute is -->
|
||||
<xsl:template match="dri:div" priority="1">
|
||||
<xsl:apply-templates select="dri:head"/>
|
||||
<xsl:apply-templates select="@pagination">
|
||||
<xsl:with-param name="position">top</xsl:with-param>
|
||||
</xsl:apply-templates>
|
||||
<div>
|
||||
<xsl:call-template name="standardAttributes">
|
||||
<xsl:with-param name="class">ds-static-div</xsl:with-param>
|
||||
</xsl:call-template>
|
||||
<xsl:choose>
|
||||
<!-- does this element have any children -->
|
||||
<xsl:when test="child::node()">
|
||||
<xsl:apply-templates select="*[not(name()='head')]"/>
|
||||
</xsl:when>
|
||||
<!-- if no children are found we add a space to eliminate self closing tags -->
|
||||
<xsl:otherwise>
|
||||
 
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</div>
|
||||
<xsl:apply-templates select="@pagination">
|
||||
<xsl:with-param name="position">bottom</xsl:with-param>
|
||||
</xsl:apply-templates>
|
||||
</xsl:template>
|
||||
|
||||
<!-- Interactive divs get turned into forms. The priority attribute on the template itself
|
||||
signifies that this template should be executed if both it and the one above match the
|
||||
same element (namely, the div element).
|
||||
|
||||
Strictly speaking, XSL should be smart enough to realize that since one template is general
|
||||
and other more specific (matching for a tag and an attribute), it should apply the more
|
||||
specific once is it encounters a div with the matching attribute. However, the way this
|
||||
decision is made depends on the implementation of the XSL parser is not always consistent.
|
||||
For that reason explicit priorities are a safer, if perhaps redundant, alternative. -->
|
||||
<xsl:template match="dri:div[@interactive='yes']" priority="2">
|
||||
<xsl:apply-templates select="dri:head"/>
|
||||
<xsl:apply-templates select="@pagination">
|
||||
<xsl:with-param name="position">top</xsl:with-param>
|
||||
</xsl:apply-templates>
|
||||
<form>
|
||||
<xsl:call-template name="standardAttributes">
|
||||
<xsl:with-param name="class">ds-interactive-div</xsl:with-param>
|
||||
</xsl:call-template>
|
||||
<xsl:attribute name="action"><xsl:value-of select="@action"/></xsl:attribute>
|
||||
<xsl:attribute name="method"><xsl:value-of select="@method"/></xsl:attribute>
|
||||
<xsl:if test="@method='multipart'">
|
||||
<xsl:attribute name="method">post</xsl:attribute>
|
||||
<xsl:attribute name="enctype">multipart/form-data</xsl:attribute>
|
||||
</xsl:if>
|
||||
<xsl:attribute name="onsubmit">javascript:tSubmit(this);</xsl:attribute>
|
||||
<!--For Item Submission process, disable ability to submit a form by pressing 'Enter'-->
|
||||
<xsl:if test="starts-with(@n,'submit')">
|
||||
<xsl:attribute name="onkeydown">javascript:return disableEnterKey(event);</xsl:attribute>
|
||||
</xsl:if>
|
||||
<xsl:apply-templates select="*[not(name()='head')]"/>
|
||||
|
||||
</form>
|
||||
<!-- JS to scroll form to DIV parent of "Add" button if jump-to -->
|
||||
<xsl:if test="/dri:document/dri:meta/dri:pageMeta/dri:metadata[@element='page'][@qualifier='jumpTo']">
|
||||
<script type="text/javascript">
|
||||
<xsl:text>var button = document.getElementById('</xsl:text>
|
||||
<xsl:value-of select="translate(@id,'.','_')"/>
|
||||
<xsl:text>').elements['</xsl:text>
|
||||
<xsl:value-of select="concat('submit_',/dri:document/dri:meta/dri:pageMeta/dri:metadata[@element='page'][@qualifier='jumpTo'],'_add')"/>
|
||||
<xsl:text>'];</xsl:text>
|
||||
<xsl:text>
|
||||
if (button != null) {
|
||||
var n = button.parentNode;
|
||||
for (; n != null; n = n.parentNode) {
|
||||
if (n.tagName == 'DIV') {
|
||||
n.scrollIntoView(false);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
</xsl:text>
|
||||
</script>
|
||||
</xsl:if>
|
||||
<xsl:apply-templates select="@pagination">
|
||||
<xsl:with-param name="position">bottom</xsl:with-param>
|
||||
</xsl:apply-templates>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<!-- Special case for divs tagged as "notice" -->
|
||||
<xsl:template match="dri:div[@n='general-message']" priority="3">
|
||||
<div>
|
||||
<xsl:call-template name="standardAttributes">
|
||||
<xsl:with-param name="class">ds-notice-div</xsl:with-param>
|
||||
</xsl:call-template>
|
||||
<xsl:apply-templates />
|
||||
</div>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<!-- Next come the three structural elements that divs that contain: table, p, and list. These are
|
||||
responsible for display of static content, forms, and option lists. The fourth element under
|
||||
body, referenceSet, is used to reference blocks of metadata and will be discussed further down.
|
||||
-->
|
||||
|
||||
|
||||
<!-- First, the table element, used for rendering data in tabular format. In DRI tables consist of
|
||||
an optional head element followed by a set of row tags. Each row in turn contains a set of cells.
|
||||
Rows and cells can have different roles, the most common ones being header and data (with the
|
||||
attribute omitted in the latter case). -->
|
||||
<xsl:template match="dri:table">
|
||||
<xsl:apply-templates select="dri:head"/>
|
||||
<table>
|
||||
<xsl:call-template name="standardAttributes">
|
||||
<xsl:with-param name="class">ds-table</xsl:with-param>
|
||||
</xsl:call-template>
|
||||
<!-- rows and cols atributes are not allowed in strict
|
||||
<xsl:attribute name="rows"><xsl:value-of select="@rows"/></xsl:attribute>
|
||||
<xsl:attribute name="cols"><xsl:value-of select="@cols"/></xsl:attribute>
|
||||
|
||||
<xsl:if test="count(dri:row[@role='header']) > 0">
|
||||
<thead>
|
||||
<xsl:apply-templates select="dri:row[@role='header']"/>
|
||||
</thead>
|
||||
</xsl:if>
|
||||
<tbody>
|
||||
<xsl:apply-templates select="dri:row[not(@role='header')]"/>
|
||||
</tbody>
|
||||
-->
|
||||
<xsl:apply-templates select="dri:row"/>
|
||||
</table>
|
||||
</xsl:template>
|
||||
|
||||
<!-- Header row, most likely filled with header cells -->
|
||||
<xsl:template match="dri:row[@role='header']" priority="2">
|
||||
<tr>
|
||||
<xsl:call-template name="standardAttributes">
|
||||
<xsl:with-param name="class">ds-table-header-row</xsl:with-param>
|
||||
</xsl:call-template>
|
||||
<xsl:apply-templates />
|
||||
</tr>
|
||||
</xsl:template>
|
||||
|
||||
<!-- Header cell, assumed to be one since it is contained in a header row -->
|
||||
<xsl:template match="dri:row[@role='header']/dri:cell | dri:cell[@role='header']" priority="2">
|
||||
<th>
|
||||
<xsl:call-template name="standardAttributes">
|
||||
<xsl:with-param name="class">ds-table-header-cell
|
||||
<xsl:if test="(position() mod 2 = 0)">even</xsl:if>
|
||||
<xsl:if test="(position() mod 2 = 1)">odd</xsl:if>
|
||||
</xsl:with-param>
|
||||
</xsl:call-template>
|
||||
<xsl:if test="@rows">
|
||||
<xsl:attribute name="rowspan">
|
||||
<xsl:value-of select="@rows"/>
|
||||
</xsl:attribute>
|
||||
</xsl:if>
|
||||
<xsl:if test="@cols">
|
||||
<xsl:attribute name="colspan">
|
||||
<xsl:value-of select="@cols"/>
|
||||
</xsl:attribute>
|
||||
</xsl:if>
|
||||
<xsl:apply-templates />
|
||||
</th>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<!-- Normal row, most likely filled with data cells -->
|
||||
<xsl:template match="dri:row" priority="1">
|
||||
<tr>
|
||||
<xsl:call-template name="standardAttributes">
|
||||
<xsl:with-param name="class">ds-table-row
|
||||
<xsl:if test="(position() mod 2 = 0)">even</xsl:if>
|
||||
<xsl:if test="(position() mod 2 = 1)">odd</xsl:if>
|
||||
</xsl:with-param>
|
||||
</xsl:call-template>
|
||||
<xsl:apply-templates />
|
||||
</tr>
|
||||
</xsl:template>
|
||||
|
||||
<!-- Just a plain old table cell -->
|
||||
<xsl:template match="dri:cell" priority="1">
|
||||
<td>
|
||||
<xsl:call-template name="standardAttributes">
|
||||
<xsl:with-param name="class">ds-table-cell
|
||||
<xsl:if test="(position() mod 2 = 0)">even</xsl:if>
|
||||
<xsl:if test="(position() mod 2 = 1)">odd</xsl:if>
|
||||
</xsl:with-param>
|
||||
</xsl:call-template>
|
||||
<xsl:if test="@rows">
|
||||
<xsl:attribute name="rowspan">
|
||||
<xsl:value-of select="@rows"/>
|
||||
</xsl:attribute>
|
||||
</xsl:if>
|
||||
<xsl:if test="@cols">
|
||||
<xsl:attribute name="colspan">
|
||||
<xsl:value-of select="@cols"/>
|
||||
</xsl:attribute>
|
||||
</xsl:if>
|
||||
<xsl:apply-templates />
|
||||
</td>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- Second, the p element, used for display of text. The p element is a rich text container, meaning it
|
||||
can contain text mixed with inline elements like hi, xref, figure and field. The cell element above
|
||||
and the item element under list are also rich text containers.
|
||||
-->
|
||||
<xsl:template match="dri:p">
|
||||
<p>
|
||||
<xsl:call-template name="standardAttributes">
|
||||
<xsl:with-param name="class">ds-paragraph</xsl:with-param>
|
||||
</xsl:call-template>
|
||||
<xsl:choose>
|
||||
<!-- does this element have any children -->
|
||||
<xsl:when test="child::node()">
|
||||
<xsl:apply-templates />
|
||||
</xsl:when>
|
||||
<!-- if no children are found we add a space to eliminate self closing tags -->
|
||||
<xsl:otherwise>
|
||||
 
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
|
||||
</p>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
|
||||
<!-- Finally, we have the list element, which is used to display set of data. There are several different
|
||||
types of lists, as signified by the type attribute, and several different templates to handle them. -->
|
||||
|
||||
<!-- First list type is the bulleted list, a list with no real labels and no ordering between elements. -->
|
||||
<xsl:template match="dri:list[@type='bulleted']" priority="2">
|
||||
<xsl:apply-templates select="dri:head"/>
|
||||
<ul>
|
||||
<xsl:call-template name="standardAttributes">
|
||||
<xsl:with-param name="class">ds-bulleted-list</xsl:with-param>
|
||||
</xsl:call-template>
|
||||
<xsl:apply-templates select="*[not(name()='head')]" mode="nested"/>
|
||||
</ul>
|
||||
</xsl:template>
|
||||
|
||||
<!-- The item template creates an HTML list item element and places the contents of the DRI item inside it.
|
||||
Additionally, it checks to see if the currently viewed item has a label element directly preceeding it,
|
||||
and if it does, applies the label's template before performing its own actions. This mechanism applies
|
||||
to the list item templates as well. -->
|
||||
<xsl:template match="dri:list[@type='bulleted']/dri:item" priority="2" mode="nested">
|
||||
<li>
|
||||
<xsl:if test="name(preceding-sibling::*[position()=1]) = 'dri:label'">
|
||||
<xsl:apply-templates select="preceding-sibling::*[position()=1]"/>
|
||||
</xsl:if>
|
||||
<xsl:apply-templates />
|
||||
</li>
|
||||
</xsl:template>
|
||||
|
||||
<!-- The case of nested lists is handled in a similar way across all lists. You match the sub-list based on
|
||||
its parent, create a list item approtiate to the list type, fill its content from the sub-list's head
|
||||
element and apply the other templates normally. -->
|
||||
<xsl:template match="dri:list[@type='bulleted']/dri:list" priority="3" mode="nested">
|
||||
<li>
|
||||
<xsl:apply-templates select="."/>
|
||||
</li>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<!-- Second type is the ordered list, which is a list with either labels or names to designate an ordering
|
||||
of some kind. -->
|
||||
<xsl:template match="dri:list[@type='ordered']" priority="2">
|
||||
<xsl:apply-templates select="dri:head"/>
|
||||
<ol>
|
||||
<xsl:call-template name="standardAttributes">
|
||||
<xsl:with-param name="class">ds-ordered-list</xsl:with-param>
|
||||
</xsl:call-template>
|
||||
<xsl:apply-templates select="*[not(name()='head')]" mode="nested">
|
||||
<xsl:sort select="dri:item/@n"/>
|
||||
</xsl:apply-templates>
|
||||
</ol>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="dri:list[@type='ordered']/dri:item" priority="2" mode="nested">
|
||||
<li>
|
||||
<xsl:if test="name(preceding-sibling::*[position()=1]) = 'label'">
|
||||
<xsl:apply-templates select="preceding-sibling::*[position()=1]"/>
|
||||
</xsl:if>
|
||||
<xsl:apply-templates />
|
||||
</li>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="dri:list[@type='ordered']/dri:list" priority="3" mode="nested">
|
||||
<li>
|
||||
<xsl:apply-templates select="."/>
|
||||
</li>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<!-- Progress list used primarily in forms that span several pages. There isn't a template for the nested
|
||||
version of this list, mostly because there isn't a use case for it. -->
|
||||
<xsl:template match="dri:list[@type='progress']" priority="2">
|
||||
<xsl:apply-templates select="dri:head"/>
|
||||
<ul>
|
||||
<xsl:call-template name="standardAttributes">
|
||||
<xsl:with-param name="class">ds-progress-list</xsl:with-param>
|
||||
</xsl:call-template>
|
||||
<xsl:apply-templates select="dri:item"/>
|
||||
</ul>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="dri:list[@type='progress']/dri:item" priority="2">
|
||||
<li>
|
||||
<xsl:attribute name="class">
|
||||
<xsl:value-of select="@rend"/>
|
||||
<xsl:if test="position()=1">
|
||||
<xsl:text> first</xsl:text>
|
||||
</xsl:if>
|
||||
<xsl:if test="descendant::dri:field[@type='button']">
|
||||
<xsl:text> button</xsl:text>
|
||||
</xsl:if>
|
||||
<xsl:if test="position()=last()">
|
||||
<xsl:text> last</xsl:text>
|
||||
</xsl:if>
|
||||
</xsl:attribute>
|
||||
<xsl:apply-templates />
|
||||
</li>
|
||||
<xsl:if test="not(position()=last())">
|
||||
<li class="arrow">
|
||||
<xsl:text>→</xsl:text>
|
||||
</li>
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<!-- The third type of list is the glossary (gloss) list. It is essentially a list of pairs, consisting of
|
||||
a set of labels, each followed by an item. Unlike the ordered and bulleted lists, gloss is implemented
|
||||
via HTML definition list (dd) element. It can also be changed to work as a two-column table. -->
|
||||
<xsl:template match="dri:list[@type='gloss']" priority="2">
|
||||
<xsl:apply-templates select="dri:head"/>
|
||||
<dl>
|
||||
<xsl:call-template name="standardAttributes">
|
||||
<xsl:with-param name="class">ds-gloss-list</xsl:with-param>
|
||||
</xsl:call-template>
|
||||
<xsl:apply-templates select="*[not(name()='head')]" mode="nested"/>
|
||||
</dl>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="dri:list[@type='gloss']/dri:item" priority="2" mode="nested">
|
||||
<dd>
|
||||
<xsl:apply-templates />
|
||||
</dd>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="dri:list[@type='gloss']/dri:label" priority="2" mode="nested">
|
||||
<dt>
|
||||
<span>
|
||||
<xsl:attribute name="class">
|
||||
<xsl:text>ds-gloss-list-label </xsl:text>
|
||||
<xsl:value-of select="@rend"/>
|
||||
</xsl:attribute>
|
||||
<xsl:apply-templates />
|
||||
<xsl:text>:</xsl:text>
|
||||
</span>
|
||||
</dt>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="dri:list[@type='gloss']/dri:list" priority="3" mode="nested">
|
||||
<dd>
|
||||
<xsl:apply-templates select="."/>
|
||||
</dd>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<!-- The next list type is one without a type attribute. In this case XSL makes a decision: if the items
|
||||
of the list have labels the the list will be made into a table-like structure, otherwise it is considered
|
||||
to be a plain unordered list and handled generically. -->
|
||||
<!-- TODO: This should really be done with divs and spans instead of tables. Form lists have already been
|
||||
converted so the solution here would most likely mirror that one -->
|
||||
<xsl:template match="dri:list[not(@type)]" priority="2">
|
||||
<xsl:apply-templates select="dri:head"/>
|
||||
<xsl:if test="count(dri:label)>0">
|
||||
<table>
|
||||
<xsl:call-template name="standardAttributes">
|
||||
<xsl:with-param name="class">ds-gloss-list</xsl:with-param>
|
||||
</xsl:call-template>
|
||||
<xsl:apply-templates select="dri:item" mode="labeled"/>
|
||||
</table>
|
||||
</xsl:if>
|
||||
<xsl:if test="count(dri:label)=0">
|
||||
<ul>
|
||||
<xsl:call-template name="standardAttributes">
|
||||
<xsl:with-param name="class">ds-simple-list</xsl:with-param>
|
||||
</xsl:call-template>
|
||||
<xsl:apply-templates select="dri:item" mode="nested"/>
|
||||
</ul>
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="dri:list[not(@type)]/dri:item" priority="2" mode="labeled">
|
||||
<tr>
|
||||
<xsl:attribute name="class">
|
||||
<xsl:text>ds-table-row </xsl:text>
|
||||
<xsl:if test="(position() mod 2 = 0)">even </xsl:if>
|
||||
<xsl:if test="(position() mod 2 = 1)">odd </xsl:if>
|
||||
<xsl:value-of select="@rend"/>
|
||||
</xsl:attribute>
|
||||
<xsl:if test="name(preceding-sibling::*[position()=1]) = 'label'">
|
||||
<xsl:apply-templates select="preceding-sibling::*[position()=1]" mode="labeled"/>
|
||||
</xsl:if>
|
||||
<td>
|
||||
<xsl:apply-templates />
|
||||
</td>
|
||||
</tr>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="dri:list[not(@type)]/dri:label" priority="2" mode="labeled">
|
||||
<td>
|
||||
<xsl:if test="count(./node())>0">
|
||||
<span>
|
||||
<xsl:attribute name="class">
|
||||
<xsl:text>ds-gloss-list-label </xsl:text>
|
||||
<xsl:value-of select="@rend"/>
|
||||
</xsl:attribute>
|
||||
<xsl:apply-templates />
|
||||
<xsl:text>:</xsl:text>
|
||||
</span>
|
||||
</xsl:if>
|
||||
</td>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="dri:list[not(@type)]/dri:item" priority="2" mode="nested">
|
||||
<li>
|
||||
<xsl:apply-templates />
|
||||
<!-- Wrap orphaned sub-lists into the preceding item -->
|
||||
<xsl:variable name="node-set1" select="./following-sibling::dri:list"/>
|
||||
<xsl:variable name="node-set2" select="./following-sibling::dri:item[1]/following-sibling::dri:list"/>
|
||||
<xsl:apply-templates select="$node-set1[count(.|$node-set2) != count($node-set2)]"/>
|
||||
</li>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<!-- Finally, the following templates match list types not mentioned above. They work for lists of type
|
||||
'simple' as well as any unknown list types. -->
|
||||
<xsl:template match="dri:list" priority="1">
|
||||
<xsl:apply-templates select="dri:head"/>
|
||||
<ul>
|
||||
<xsl:call-template name="standardAttributes">
|
||||
<xsl:with-param name="class">ds-simple-list</xsl:with-param>
|
||||
</xsl:call-template>
|
||||
<xsl:apply-templates select="*[not(name()='head')]" mode="nested"/>
|
||||
</ul>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<!-- Generic label handling: simply place the text of the element followed by a period and space. -->
|
||||
<xsl:template match="dri:label" priority="1" mode="nested">
|
||||
<xsl:copy-of select="./node()"/>
|
||||
</xsl:template>
|
||||
|
||||
<!-- Generic item handling for cases where nothing special needs to be done -->
|
||||
<xsl:template match="dri:item" mode="nested">
|
||||
<li>
|
||||
<xsl:apply-templates />
|
||||
</li>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="dri:list/dri:list" priority="1" mode="nested">
|
||||
<li>
|
||||
<xsl:apply-templates select="."/>
|
||||
</li>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
|
||||
<!-- From here on out come the templates for supporting elements that are contained within structural
|
||||
ones. These include head (in all its myriad forms), rich text container elements (like hi and figure),
|
||||
as well as the field tag and its related elements. The head elements are done first. -->
|
||||
|
||||
<!-- The first (and most complex) case of the header tag is the one used for divisions. Since divisions can
|
||||
nest freely, their headers should reflect that. Thus, the type of HTML h tag produced depends on how
|
||||
many divisions the header tag is nested inside of. -->
|
||||
<!-- The font-sizing variable is the result of a linear function applied to the character count of the heading text -->
|
||||
<xsl:template match="dri:div/dri:head" priority="3">
|
||||
<xsl:variable name="head_count" select="count(ancestor::dri:div)"/>
|
||||
<!-- with the help of the font-sizing variable, the font-size of our header text is made continuously variable based on the character count -->
|
||||
<xsl:variable name="font-sizing" select="365 - $head_count * 80 - string-length(current())"></xsl:variable>
|
||||
<xsl:element name="h{$head_count}">
|
||||
<!-- in case the chosen size is less than 120%, don't let it go below. Shrinking stops at 120% -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="$font-sizing < 120">
|
||||
<xsl:attribute name="style">font-size: 120%;</xsl:attribute>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:attribute name="style">font-size: <xsl:value-of select="$font-sizing"/>%;</xsl:attribute>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<xsl:call-template name="standardAttributes">
|
||||
<xsl:with-param name="class">ds-div-head</xsl:with-param>
|
||||
</xsl:call-template>
|
||||
<xsl:apply-templates />
|
||||
</xsl:element>
|
||||
</xsl:template>
|
||||
|
||||
<!-- The second case is the header on tables, which always creates an HTML h3 element -->
|
||||
<xsl:template match="dri:table/dri:head" priority="2">
|
||||
<h3>
|
||||
<xsl:call-template name="standardAttributes">
|
||||
<xsl:with-param name="class">ds-table-head</xsl:with-param>
|
||||
</xsl:call-template>
|
||||
<xsl:apply-templates />
|
||||
</h3>
|
||||
</xsl:template>
|
||||
|
||||
<!-- The third case is the header on lists, which creates an HTML h3 element for top level lists and
|
||||
and h4 elements for all sublists. -->
|
||||
<xsl:template match="dri:list/dri:head" priority="2" mode="nested">
|
||||
<h3>
|
||||
<xsl:call-template name="standardAttributes">
|
||||
<xsl:with-param name="class">ds-list-head</xsl:with-param>
|
||||
</xsl:call-template>
|
||||
<xsl:apply-templates />
|
||||
</h3>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="dri:list/dri:list/dri:head" priority="3" mode="nested">
|
||||
<h4>
|
||||
<xsl:call-template name="standardAttributes">
|
||||
<xsl:with-param name="class">ds-sublist-head</xsl:with-param>
|
||||
</xsl:call-template>
|
||||
<xsl:apply-templates />
|
||||
</h4>
|
||||
</xsl:template>
|
||||
|
||||
<!-- The fourth case is the header on referenceSets, to be discussed below, which creates an HTML h2 element
|
||||
for all cases. The reason for this simplistic approach has to do with referenceSets being handled
|
||||
differently in many cases, making it difficult to treat them as either divs (with scaling headers) or
|
||||
lists (with static ones). In this case, the simplest solution was chosen, although it is subject to
|
||||
change in the future. -->
|
||||
<xsl:template match="dri:referenceSet/dri:head" priority="2">
|
||||
<h3>
|
||||
<xsl:call-template name="standardAttributes">
|
||||
<xsl:with-param name="class">ds-list-head</xsl:with-param>
|
||||
</xsl:call-template>
|
||||
<xsl:apply-templates />
|
||||
</h3>
|
||||
</xsl:template>
|
||||
|
||||
<!-- Finally, the generic header element template, given the lowest priority, is there for cases not
|
||||
covered above. It assumes nothing about the parent element and simply generates an HTML h3 tag -->
|
||||
<xsl:template match="dri:head" priority="1">
|
||||
<h3>
|
||||
<xsl:call-template name="standardAttributes">
|
||||
<xsl:with-param name="class">ds-head</xsl:with-param>
|
||||
</xsl:call-template>
|
||||
<xsl:apply-templates />
|
||||
</h3>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- Next come the components of rich text containers, namely: hi, xref, figure and, in case of interactive
|
||||
divs, field. All these can mix freely with text as well as contain text of their own. The templates for
|
||||
the first three elements are fairly straightforward, as they simply create HTML span, a, and img tags,
|
||||
respectively. -->
|
||||
|
||||
<xsl:template match="dri:hi">
|
||||
<span>
|
||||
<xsl:attribute name="class">emphasis</xsl:attribute>
|
||||
<xsl:if test="@rend">
|
||||
<xsl:attribute name="class"><xsl:value-of select="@rend"/></xsl:attribute>
|
||||
</xsl:if>
|
||||
<xsl:apply-templates />
|
||||
</span>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="dri:xref">
|
||||
<a>
|
||||
<xsl:if test="@target">
|
||||
<xsl:attribute name="href"><xsl:value-of select="@target"/></xsl:attribute>
|
||||
</xsl:if>
|
||||
|
||||
<xsl:if test="@rend">
|
||||
<xsl:attribute name="class"><xsl:value-of select="@rend"/></xsl:attribute>
|
||||
</xsl:if>
|
||||
|
||||
<xsl:if test="@n">
|
||||
<xsl:attribute name="name"><xsl:value-of select="@n"/></xsl:attribute>
|
||||
</xsl:if>
|
||||
|
||||
<xsl:apply-templates />
|
||||
</a>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="dri:figure">
|
||||
<xsl:if test="@target">
|
||||
<a>
|
||||
<xsl:attribute name="href"><xsl:value-of select="@target"/></xsl:attribute>
|
||||
<img>
|
||||
<xsl:attribute name="src"><xsl:value-of select="@source"/></xsl:attribute>
|
||||
<xsl:attribute name="alt"><xsl:apply-templates /></xsl:attribute>
|
||||
</img>
|
||||
</a>
|
||||
</xsl:if>
|
||||
<xsl:if test="not(@target)">
|
||||
<img>
|
||||
<xsl:attribute name="src"><xsl:value-of select="@source"/></xsl:attribute>
|
||||
<xsl:attribute name="alt"><xsl:apply-templates /></xsl:attribute>
|
||||
</img>
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,84 @@
|
||||
<!--
|
||||
global-variables.xsl
|
||||
|
||||
Version: $Revision: 3705 $
|
||||
|
||||
Date: $Date: 2009-04-11 17:02:24 +0000 (Sat, 11 Apr 2009) $
|
||||
|
||||
Copyright (c) 2002-2005, Hewlett-Packard Company and Massachusetts
|
||||
Institute of Technology. All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
- Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
- Neither the name of the Hewlett-Packard Company nor the name of the
|
||||
Massachusetts Institute of Technology nor the names of their
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
|
||||
TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
|
||||
USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
|
||||
DAMAGE.
|
||||
-->
|
||||
|
||||
<!--
|
||||
Global variables accessible from other templates
|
||||
|
||||
Author: art.lowel at atmire.com
|
||||
Author: lieven.droogmans at atmire.com
|
||||
Author: ben at atmire.com
|
||||
Author: Alexey Maslov
|
||||
|
||||
-->
|
||||
|
||||
<xsl:stylesheet xmlns:i18n="http://apache.org/cocoon/i18n/2.1"
|
||||
xmlns:dri="http://di.tamu.edu/DRI/1.0/"
|
||||
xmlns:mets="http://www.loc.gov/METS/"
|
||||
xmlns:xlink="http://www.w3.org/TR/xlink/"
|
||||
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
|
||||
xmlns:dim="http://www.dspace.org/xmlns/dspace/dim"
|
||||
xmlns:xhtml="http://www.w3.org/1999/xhtml"
|
||||
xmlns:mods="http://www.loc.gov/mods/v3"
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns="http://www.w3.org/1999/xhtml"
|
||||
exclude-result-prefixes="i18n dri mets xlink xsl dim xhtml mods dc">
|
||||
|
||||
<xsl:output indent="yes"/>
|
||||
|
||||
<!-- Global variables -->
|
||||
|
||||
<!--
|
||||
Context path provides easy access to the context-path parameter. This is
|
||||
used when building urls back to the site, they all must include the
|
||||
context-path paramater.
|
||||
-->
|
||||
<xsl:variable name="context-path" select="/dri:document/dri:meta/dri:pageMeta/dri:metadata[@element='contextPath'][not(@qualifier)]"/>
|
||||
|
||||
<!--
|
||||
Theme path represents the full path back to theme. This is usefull for
|
||||
accessing static resources such as images or javascript files. Simply
|
||||
prepend this variable and then add the file name, thus
|
||||
{$theme-path}/images/myimage.jpg will result in the full path from the
|
||||
HTTP root down to myimage.jpg. The theme path is composed of the
|
||||
"[context-path]/themes/[theme-dir]/".
|
||||
-->
|
||||
<xsl:variable name="theme-path" select="concat($context-path,'/themes/',/dri:document/dri:meta/dri:pageMeta/dri:metadata[@element='theme'][@qualifier='path'])"/>
|
||||
|
||||
</xsl:stylesheet>
|
@@ -0,0 +1,207 @@
|
||||
<!--
|
||||
navigation.xsl
|
||||
|
||||
Version: $Revision: 3705 $
|
||||
|
||||
Date: $Date: 2009-04-11 17:02:24 +0000 (Sat, 11 Apr 2009) $
|
||||
|
||||
Copyright (c) 2002-2005, Hewlett-Packard Company and Massachusetts
|
||||
Institute of Technology. All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
- Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
- Neither the name of the Hewlett-Packard Company nor the name of the
|
||||
Massachusetts Institute of Technology nor the names of their
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
|
||||
TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
|
||||
USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
|
||||
DAMAGE.
|
||||
-->
|
||||
|
||||
<!--
|
||||
Rendering specific to the navigation (options)
|
||||
|
||||
Author: art.lowel at atmire.com
|
||||
Author: lieven.droogmans at atmire.com
|
||||
Author: ben at atmire.com
|
||||
Author: Alexey Maslov
|
||||
|
||||
-->
|
||||
|
||||
<xsl:stylesheet xmlns:i18n="http://apache.org/cocoon/i18n/2.1"
|
||||
xmlns:dri="http://di.tamu.edu/DRI/1.0/"
|
||||
xmlns:mets="http://www.loc.gov/METS/"
|
||||
xmlns:xlink="http://www.w3.org/TR/xlink/"
|
||||
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
|
||||
xmlns:dim="http://www.dspace.org/xmlns/dspace/dim"
|
||||
xmlns:xhtml="http://www.w3.org/1999/xhtml"
|
||||
xmlns:mods="http://www.loc.gov/mods/v3"
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns="http://www.w3.org/1999/xhtml"
|
||||
exclude-result-prefixes="i18n dri mets xlink xsl dim xhtml mods dc">
|
||||
|
||||
<xsl:output indent="yes"/>
|
||||
|
||||
<!--
|
||||
The template to handle dri:options. Since it contains only dri:list tags (which carry the actual
|
||||
information), the only things than need to be done is creating the ds-options div and applying
|
||||
the templates inside it.
|
||||
|
||||
In fact, the only bit of real work this template does is add the search box, which has to be
|
||||
handled specially in that it is not actually included in the options div, and is instead built
|
||||
from metadata available under pageMeta.
|
||||
-->
|
||||
<!-- TODO: figure out why i18n tags break the go button -->
|
||||
<xsl:template match="dri:options">
|
||||
<div id="ds-options">
|
||||
<h3 id="ds-search-option-head" class="ds-option-set-head"><i18n:text>xmlui.dri2xhtml.structural.search</i18n:text></h3>
|
||||
<div id="ds-search-option" class="ds-option-set">
|
||||
<!-- The form, complete with a text box and a button, all built from attributes referenced
|
||||
from under pageMeta. -->
|
||||
<form id="ds-search-form" method="post">
|
||||
<xsl:attribute name="action">
|
||||
<xsl:value-of select="/dri:document/dri:meta/dri:pageMeta/dri:metadata[@element='search'][@qualifier='simpleURL']"/>
|
||||
</xsl:attribute>
|
||||
<fieldset>
|
||||
<input class="ds-text-field " type="text">
|
||||
<xsl:attribute name="name">
|
||||
<xsl:value-of select="/dri:document/dri:meta/dri:pageMeta/dri:metadata[@element='search'][@qualifier='queryField']"/>
|
||||
</xsl:attribute>
|
||||
</input>
|
||||
<input class="ds-button-field " name="submit" type="submit" i18n:attr="value" value="xmlui.general.go" >
|
||||
<xsl:attribute name="onclick">
|
||||
<xsl:text>
|
||||
var radio = document.getElementById("ds-search-form-scope-container");
|
||||
if (radio != undefined && radio.checked)
|
||||
{
|
||||
var form = document.getElementById("ds-search-form");
|
||||
form.action=
|
||||
</xsl:text>
|
||||
<xsl:text>"</xsl:text>
|
||||
<xsl:value-of select="/dri:document/dri:meta/dri:pageMeta/dri:metadata[@element='contextPath']"/>
|
||||
<xsl:text>/handle/" + radio.value + "/search" ; </xsl:text>
|
||||
<xsl:text>
|
||||
}
|
||||
</xsl:text>
|
||||
</xsl:attribute>
|
||||
</input>
|
||||
<xsl:if test="/dri:document/dri:meta/dri:pageMeta/dri:metadata[@element='focus'][@qualifier='container']">
|
||||
<label>
|
||||
<input id="ds-search-form-scope-all" type="radio" name="scope" value="" checked="checked"/>
|
||||
<i18n:text>xmlui.dri2xhtml.structural.search</i18n:text>
|
||||
</label>
|
||||
<br/>
|
||||
<label>
|
||||
<input id="ds-search-form-scope-container" type="radio" name="scope">
|
||||
<xsl:attribute name="value">
|
||||
<xsl:value-of select="substring-after(/dri:document/dri:meta/dri:pageMeta/dri:metadata[@element='focus'][@qualifier='container'],':')"/>
|
||||
</xsl:attribute>
|
||||
</input>
|
||||
<xsl:choose>
|
||||
<xsl:when test="/dri:document/dri:meta/dri:pageMeta/dri:metadata[@element='focus'][@qualifier='containerType']/text() = 'type:community'">
|
||||
<i18n:text>xmlui.dri2xhtml.structural.search-in-community</i18n:text>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<i18n:text>xmlui.dri2xhtml.structural.search-in-collection</i18n:text>
|
||||
</xsl:otherwise>
|
||||
|
||||
</xsl:choose>
|
||||
</label>
|
||||
</xsl:if>
|
||||
</fieldset>
|
||||
</form>
|
||||
<!-- The "Advanced search" link, to be perched underneath the search box -->
|
||||
<a>
|
||||
<xsl:attribute name="href">
|
||||
<xsl:value-of select="/dri:document/dri:meta/dri:pageMeta/dri:metadata[@element='search'][@qualifier='advancedURL']"/>
|
||||
</xsl:attribute>
|
||||
<i18n:text>xmlui.dri2xhtml.structural.search-advanced</i18n:text>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<!-- Once the search box is built, the other parts of the options are added -->
|
||||
<xsl:apply-templates />
|
||||
</div>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<!-- The template that applies to lists directly under the options tag that have other lists underneath
|
||||
them. Each list underneath the matched one becomes an option-set and is handled by the appropriate
|
||||
list templates. -->
|
||||
<xsl:template match="dri:options/dri:list[dri:list]" priority="4">
|
||||
<xsl:apply-templates select="dri:head"/>
|
||||
<div>
|
||||
<xsl:call-template name="standardAttributes">
|
||||
<xsl:with-param name="class">ds-option-set</xsl:with-param>
|
||||
</xsl:call-template>
|
||||
<ul class="ds-options-list">
|
||||
<xsl:apply-templates select="*[not(name()='head')]" mode="nested"/>
|
||||
</ul>
|
||||
</div>
|
||||
</xsl:template>
|
||||
|
||||
<!-- Special case for nested options lists -->
|
||||
<xsl:template match="dri:options/dri:list/dri:list" priority="3" mode="nested">
|
||||
<li>
|
||||
<xsl:apply-templates select="dri:head" mode="nested"/>
|
||||
<ul class="ds-simple-list">
|
||||
<xsl:apply-templates select="dri:item" mode="nested"/>
|
||||
</ul>
|
||||
</li>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="dri:options/dri:list" priority="3">
|
||||
<xsl:apply-templates select="dri:head"/>
|
||||
<div>
|
||||
<xsl:call-template name="standardAttributes">
|
||||
<xsl:with-param name="class">ds-option-set</xsl:with-param>
|
||||
</xsl:call-template>
|
||||
<ul class="ds-simple-list">
|
||||
<xsl:apply-templates select="dri:item" mode="nested"/>
|
||||
</ul>
|
||||
</div>
|
||||
</xsl:template>
|
||||
|
||||
<!-- Quick patch to remove empty lists from options -->
|
||||
<xsl:template match="dri:options//dri:list[count(child::*)=0]" priority="5" mode="nested">
|
||||
</xsl:template>
|
||||
<xsl:template match="dri:options//dri:list[count(child::*)=0]" priority="5">
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<xsl:template match="dri:options/dri:list/dri:head" priority="3">
|
||||
<h3>
|
||||
<xsl:call-template name="standardAttributes">
|
||||
<xsl:with-param name="class">ds-option-set-head</xsl:with-param>
|
||||
</xsl:call-template>
|
||||
<xsl:apply-templates />
|
||||
</h3>
|
||||
</xsl:template>
|
||||
|
||||
<!-- Items inside option lists are excluded from the "orphan roundup" mechanism -->
|
||||
<xsl:template match="dri:options//dri:item" mode="nested" priority="3">
|
||||
<li>
|
||||
<xsl:apply-templates />
|
||||
</li>
|
||||
</xsl:template>
|
||||
</xsl:stylesheet>
|
@@ -0,0 +1,486 @@
|
||||
<!--
|
||||
page-structure.xsl
|
||||
|
||||
Version: $Revision: 3705 $
|
||||
|
||||
Date: $Date: 2009-04-11 17:02:24 +0000 (Sat, 11 Apr 2009) $
|
||||
|
||||
Copyright (c) 2002-2005, Hewlett-Packard Company and Massachusetts
|
||||
Institute of Technology. All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
- Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
- Neither the name of the Hewlett-Packard Company nor the name of the
|
||||
Massachusetts Institute of Technology nor the names of their
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
|
||||
TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
|
||||
USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
|
||||
DAMAGE.
|
||||
-->
|
||||
|
||||
<!--
|
||||
Main structure of the page, determines where
|
||||
header, footer, body, navigation are structurally rendered.
|
||||
Rendering of the header, footer, trail and alerts
|
||||
|
||||
Author: art.lowel at atmire.com
|
||||
Author: lieven.droogmans at atmire.com
|
||||
Author: ben at atmire.com
|
||||
Author: Alexey Maslov
|
||||
|
||||
-->
|
||||
|
||||
<xsl:stylesheet xmlns:i18n="http://apache.org/cocoon/i18n/2.1"
|
||||
xmlns:dri="http://di.tamu.edu/DRI/1.0/"
|
||||
xmlns:mets="http://www.loc.gov/METS/"
|
||||
xmlns:xlink="http://www.w3.org/TR/xlink/"
|
||||
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
|
||||
xmlns:dim="http://www.dspace.org/xmlns/dspace/dim"
|
||||
xmlns:xhtml="http://www.w3.org/1999/xhtml"
|
||||
xmlns:mods="http://www.loc.gov/mods/v3"
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns="http://www.w3.org/1999/xhtml"
|
||||
exclude-result-prefixes="i18n dri mets xlink xsl dim xhtml mods dc">
|
||||
|
||||
<xsl:output indent="yes"/>
|
||||
|
||||
<!--
|
||||
The starting point of any XSL processing is matching the root element. In DRI the root element is document,
|
||||
which contains a version attribute and three top level elements: body, options, meta (in that order).
|
||||
|
||||
This template creates the html document, giving it a head and body. A title and the CSS style reference
|
||||
are placed in the html head, while the body is further split into several divs. The top-level div
|
||||
directly under html body is called "ds-main". It is further subdivided into:
|
||||
"ds-header" - the header div containing title, subtitle, trail and other front matter
|
||||
"ds-body" - the div containing all the content of the page; built from the contents of dri:body
|
||||
"ds-options" - the div with all the navigation and actions; built from the contents of dri:options
|
||||
"ds-footer" - optional footer div, containing misc information
|
||||
|
||||
The order in which the top level divisions appear may have some impact on the design of CSS and the
|
||||
final appearance of the DSpace page. While the layout of the DRI schema does favor the above div
|
||||
arrangement, nothing is preventing the designer from changing them around or adding new ones by
|
||||
overriding the dri:document template.
|
||||
-->
|
||||
<xsl:template match="dri:document">
|
||||
<html>
|
||||
<!-- First of all, build the HTML head element -->
|
||||
<xsl:call-template name="buildHead"/>
|
||||
<!-- Then proceed to the body -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="/dri:document/dri:meta/dri:pageMeta/dri:metadata[@element='framing'][@qualifier='popup']">
|
||||
<xsl:apply-templates select="dri:body/*"/>
|
||||
<!-- add setup JS code if this is a choices lookup page -->
|
||||
<xsl:if test="dri:body/dri:div[@n='lookup']">
|
||||
<xsl:call-template name="choiceLookupPopUpSetup"/>
|
||||
</xsl:if>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<body>
|
||||
|
||||
<div id="ds-main">
|
||||
<!--
|
||||
The header div, complete with title, subtitle, trail and other junk. The trail is
|
||||
built by applying a template over pageMeta's trail children. -->
|
||||
<xsl:call-template name="buildHeader"/>
|
||||
|
||||
<!--
|
||||
Goes over the document tag's children elements: body, options, meta. The body template
|
||||
generates the ds-body div that contains all the content. The options template generates
|
||||
the ds-options div that contains the navigation and action options available to the
|
||||
user. The meta element is ignored since its contents are not processed directly, but
|
||||
instead referenced from the different points in the document. -->
|
||||
<xsl:apply-templates />
|
||||
|
||||
<!--
|
||||
The footer div, dropping whatever extra information is needed on the page. It will
|
||||
most likely be something similar in structure to the currently given example. -->
|
||||
<xsl:call-template name="buildFooter"/>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</html>
|
||||
</xsl:template>
|
||||
|
||||
<!-- The HTML head element contains references to CSS as well as embedded JavaScript code. Most of this
|
||||
information is either user-provided bits of post-processing (as in the case of the JavaScript), or
|
||||
references to stylesheets pulled directly from the pageMeta element. -->
|
||||
<xsl:template name="buildHead">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<meta name="Generator">
|
||||
<xsl:attribute name="content">
|
||||
<xsl:text>DSpace</xsl:text>
|
||||
<xsl:if test="/dri:document/dri:meta/dri:pageMeta/dri:metadata[@element='dspace'][@qualifier='version']">
|
||||
<xsl:text> </xsl:text>
|
||||
<xsl:value-of select="/dri:document/dri:meta/dri:pageMeta/dri:metadata[@element='dspace'][@qualifier='version']"/>
|
||||
</xsl:if>
|
||||
</xsl:attribute>
|
||||
</meta>
|
||||
<!-- Add stylsheets -->
|
||||
<xsl:for-each select="/dri:document/dri:meta/dri:pageMeta/dri:metadata[@element='stylesheet']">
|
||||
<link rel="stylesheet" type="text/css">
|
||||
<xsl:attribute name="media">
|
||||
<xsl:value-of select="@qualifier"/>
|
||||
</xsl:attribute>
|
||||
<xsl:attribute name="href">
|
||||
<xsl:value-of select="/dri:document/dri:meta/dri:pageMeta/dri:metadata[@element='contextPath'][not(@qualifier)]"/>
|
||||
<xsl:text>/themes/</xsl:text>
|
||||
<xsl:value-of select="/dri:document/dri:meta/dri:pageMeta/dri:metadata[@element='theme'][@qualifier='path']"/>
|
||||
<xsl:text>/</xsl:text>
|
||||
<xsl:value-of select="."/>
|
||||
</xsl:attribute>
|
||||
</link>
|
||||
</xsl:for-each>
|
||||
|
||||
<!-- Add syndication feeds -->
|
||||
<xsl:for-each select="/dri:document/dri:meta/dri:pageMeta/dri:metadata[@element='feed']">
|
||||
<link rel="alternate" type="application">
|
||||
<xsl:attribute name="type">
|
||||
<xsl:text>application/</xsl:text>
|
||||
<xsl:value-of select="@qualifier"/>
|
||||
</xsl:attribute>
|
||||
<xsl:attribute name="href">
|
||||
<xsl:value-of select="."/>
|
||||
</xsl:attribute>
|
||||
</link>
|
||||
</xsl:for-each>
|
||||
|
||||
<!-- Add OpenSearch auto-discovery link -->
|
||||
<xsl:if test="/dri:document/dri:meta/dri:pageMeta/dri:metadata[@element='opensearch'][@qualifier='shortName']">
|
||||
<link rel="search" type="application/opensearchdescription+xml">
|
||||
<xsl:attribute name="href">
|
||||
<xsl:value-of select="/dri:document/dri:meta/dri:pageMeta/dri:metadata[@element='request'][@qualifier='scheme']"/>
|
||||
<xsl:text>://</xsl:text>
|
||||
<xsl:value-of select="/dri:document/dri:meta/dri:pageMeta/dri:metadata[@element='request'][@qualifier='serverName']"/>
|
||||
<xsl:text>:</xsl:text>
|
||||
<xsl:value-of select="/dri:document/dri:meta/dri:pageMeta/dri:metadata[@element='request'][@qualifier='serverPort']"/>
|
||||
<xsl:value-of select="$context-path"/>
|
||||
<xsl:text>/</xsl:text>
|
||||
<xsl:value-of select="/dri:document/dri:meta/dri:pageMeta/dri:metadata[@element='opensearch'][@qualifier='context']"/>
|
||||
<xsl:text>description.xml</xsl:text>
|
||||
</xsl:attribute>
|
||||
<xsl:attribute name="title" >
|
||||
<xsl:value-of select="/dri:document/dri:meta/dri:pageMeta/dri:metadata[@element='opensearch'][@qualifier='shortName']"/>
|
||||
</xsl:attribute>
|
||||
</link>
|
||||
</xsl:if>
|
||||
|
||||
<!-- The following javascript removes the default text of empty text areas when they are focused on or submitted -->
|
||||
<!-- There is also javascript to disable submitting a form when the 'enter' key is pressed. -->
|
||||
<script type="text/javascript">
|
||||
//Clear default text of emty text areas on focus
|
||||
function tFocus(element)
|
||||
{
|
||||
if (element.value == '<i18n:text>xmlui.dri2xhtml.default.textarea.value</i18n:text>'){element.value='';}
|
||||
}
|
||||
//Clear default text of emty text areas on submit
|
||||
function tSubmit(form)
|
||||
{
|
||||
var defaultedElements = document.getElementsByTagName("textarea");
|
||||
for (var i=0; i != defaultedElements.length; i++){
|
||||
if (defaultedElements[i].value == '<i18n:text>xmlui.dri2xhtml.default.textarea.value</i18n:text>'){
|
||||
defaultedElements[i].value='';}}
|
||||
}
|
||||
//Disable pressing 'enter' key to submit a form (otherwise pressing 'enter' causes a submission to start over)
|
||||
function disableEnterKey(e)
|
||||
{
|
||||
var key;
|
||||
|
||||
if(window.event)
|
||||
key = window.event.keyCode; //Internet Explorer
|
||||
else
|
||||
key = e.which; //Firefox and Netscape
|
||||
|
||||
if(key == 13) //if "Enter" pressed, then disable!
|
||||
return false;
|
||||
else
|
||||
return true;
|
||||
}
|
||||
</script>
|
||||
|
||||
<!-- Add theme javascipt -->
|
||||
<xsl:for-each select="/dri:document/dri:meta/dri:pageMeta/dri:metadata[@element='javascript'][not(@qualifier)]">
|
||||
<script type="text/javascript">
|
||||
<xsl:attribute name="src">
|
||||
<xsl:value-of select="/dri:document/dri:meta/dri:pageMeta/dri:metadata[@element='contextPath'][not(@qualifier)]"/>
|
||||
<xsl:text>/themes/</xsl:text>
|
||||
<xsl:value-of select="/dri:document/dri:meta/dri:pageMeta/dri:metadata[@element='theme'][@qualifier='path']"/>
|
||||
<xsl:text>/</xsl:text>
|
||||
<xsl:value-of select="."/>
|
||||
</xsl:attribute> </script>
|
||||
</xsl:for-each>
|
||||
|
||||
<!-- add "shared" javascript from static, path is relative to webapp root-->
|
||||
<xsl:for-each select="/dri:document/dri:meta/dri:pageMeta/dri:metadata[@element='javascript'][@qualifier='static']">
|
||||
<script type="text/javascript">
|
||||
<xsl:attribute name="src">
|
||||
<xsl:value-of select="/dri:document/dri:meta/dri:pageMeta/dri:metadata[@element='contextPath'][not(@qualifier)]"/>
|
||||
<xsl:text>/</xsl:text>
|
||||
<xsl:value-of select="."/>
|
||||
</xsl:attribute> </script>
|
||||
</xsl:for-each>
|
||||
|
||||
|
||||
<!-- Add a google analytics script if the key is present -->
|
||||
<xsl:if test="/dri:document/dri:meta/dri:pageMeta/dri:metadata[@element='google'][@qualifier='analytics']">
|
||||
<script type="text/javascript"><xsl:text>
|
||||
var _gaq = _gaq || [];
|
||||
_gaq.push(['_setAccount', '</xsl:text><xsl:value-of select="/dri:document/dri:meta/dri:pageMeta/dri:metadata[@element='google'][@qualifier='analytics']"/><xsl:text>']);
|
||||
_gaq.push(['_trackPageview']);
|
||||
|
||||
(function() {
|
||||
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
|
||||
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
|
||||
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
|
||||
})();
|
||||
</xsl:text></script>
|
||||
</xsl:if>
|
||||
|
||||
|
||||
<!-- Add the title in -->
|
||||
<xsl:variable name="page_title" select="/dri:document/dri:meta/dri:pageMeta/dri:metadata[@element='title']" />
|
||||
<title>
|
||||
<xsl:choose>
|
||||
<xsl:when test="not($page_title)">
|
||||
<xsl:text> </xsl:text>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:copy-of select="$page_title/node()" />
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</title>
|
||||
|
||||
<!-- Head metadata in item pages -->
|
||||
<xsl:if test="/dri:document/dri:meta/dri:pageMeta/dri:metadata[@element='xhtml_head_item']">
|
||||
<xsl:value-of select="/dri:document/dri:meta/dri:pageMeta/dri:metadata[@element='xhtml_head_item']"
|
||||
disable-output-escaping="yes"/>
|
||||
</xsl:if>
|
||||
|
||||
</head>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<!-- The header (distinct from the HTML head element) contains the title, subtitle, login box and various
|
||||
placeholders for header images -->
|
||||
<xsl:template name="buildHeader">
|
||||
<div id="ds-header">
|
||||
<a>
|
||||
<xsl:attribute name="href">
|
||||
<xsl:value-of select="/dri:document/dri:meta/dri:pageMeta/dri:metadata[@element='contextPath'][not(@qualifier)]"/>
|
||||
<xsl:text>/</xsl:text>
|
||||
</xsl:attribute>
|
||||
<span id="ds-header-logo"> </span>
|
||||
</a>
|
||||
<h1 class="pagetitle">
|
||||
<xsl:choose>
|
||||
<!-- protectiotion against an empty page title -->
|
||||
<xsl:when test="not(/dri:document/dri:meta/dri:pageMeta/dri:metadata[@element='title'])">
|
||||
<xsl:text> </xsl:text>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:copy-of select="/dri:document/dri:meta/dri:pageMeta/dri:metadata[@element='title']/node()"/>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
|
||||
</h1>
|
||||
<h2 class="static-pagetitle"><i18n:text>xmlui.dri2xhtml.structural.head-subtitle</i18n:text></h2>
|
||||
|
||||
|
||||
<ul id="ds-trail">
|
||||
<xsl:choose>
|
||||
<xsl:when test="count(/dri:document/dri:meta/dri:pageMeta/dri:trail) = 0">
|
||||
<li class="ds-trail-link first-link"> - </li>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:apply-templates select="/dri:document/dri:meta/dri:pageMeta/dri:trail"/>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</ul>
|
||||
|
||||
|
||||
<xsl:choose>
|
||||
<xsl:when test="/dri:document/dri:meta/dri:userMeta/@authenticated = 'yes'">
|
||||
<div id="ds-user-box">
|
||||
<p>
|
||||
<a>
|
||||
<xsl:attribute name="href">
|
||||
<xsl:value-of select="/dri:document/dri:meta/dri:userMeta/
|
||||
dri:metadata[@element='identifier' and @qualifier='url']"/>
|
||||
</xsl:attribute>
|
||||
<i18n:text>xmlui.dri2xhtml.structural.profile</i18n:text>
|
||||
<xsl:value-of select="/dri:document/dri:meta/dri:userMeta/
|
||||
dri:metadata[@element='identifier' and @qualifier='firstName']"/>
|
||||
<xsl:text> </xsl:text>
|
||||
<xsl:value-of select="/dri:document/dri:meta/dri:userMeta/
|
||||
dri:metadata[@element='identifier' and @qualifier='lastName']"/>
|
||||
</a>
|
||||
<xsl:text> | </xsl:text>
|
||||
<a>
|
||||
<xsl:attribute name="href">
|
||||
<xsl:value-of select="/dri:document/dri:meta/dri:userMeta/
|
||||
dri:metadata[@element='identifier' and @qualifier='logoutURL']"/>
|
||||
</xsl:attribute>
|
||||
<i18n:text>xmlui.dri2xhtml.structural.logout</i18n:text>
|
||||
</a>
|
||||
</p>
|
||||
</div>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<div id="ds-user-box">
|
||||
<p>
|
||||
<a>
|
||||
<xsl:attribute name="href">
|
||||
<xsl:value-of select="/dri:document/dri:meta/dri:userMeta/
|
||||
dri:metadata[@element='identifier' and @qualifier='loginURL']"/>
|
||||
</xsl:attribute>
|
||||
<i18n:text>xmlui.dri2xhtml.structural.login</i18n:text>
|
||||
</a>
|
||||
</p>
|
||||
</div>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
|
||||
</div>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<!-- Like the header, the footer contains various miscellanious text, links, and image placeholders -->
|
||||
<xsl:template name="buildFooter">
|
||||
<div id="ds-footer">
|
||||
<i18n:text>xmlui.dri2xhtml.structural.footer-promotional</i18n:text>
|
||||
<div id="ds-footer-links">
|
||||
<a>
|
||||
<xsl:attribute name="href">
|
||||
<xsl:value-of select="/dri:document/dri:meta/dri:pageMeta/dri:metadata[@element='contextPath'][not(@qualifier)]"/>
|
||||
<xsl:text>/contact</xsl:text>
|
||||
</xsl:attribute>
|
||||
<i18n:text>xmlui.dri2xhtml.structural.contact-link</i18n:text>
|
||||
</a>
|
||||
<xsl:text> | </xsl:text>
|
||||
<a>
|
||||
<xsl:attribute name="href">
|
||||
<xsl:value-of select="/dri:document/dri:meta/dri:pageMeta/dri:metadata[@element='contextPath'][not(@qualifier)]"/>
|
||||
<xsl:text>/feedback</xsl:text>
|
||||
</xsl:attribute>
|
||||
<i18n:text>xmlui.dri2xhtml.structural.feedback-link</i18n:text>
|
||||
</a>
|
||||
</div>
|
||||
<!--Invisible link to HTML sitemap (for search engines) -->
|
||||
<a>
|
||||
<xsl:attribute name="href">
|
||||
<xsl:value-of select="/dri:document/dri:meta/dri:pageMeta/dri:metadata[@element='contextPath'][not(@qualifier)]"/>
|
||||
<xsl:text>/htmlmap</xsl:text>
|
||||
</xsl:attribute>
|
||||
</a>
|
||||
</div>
|
||||
<!--
|
||||
<a href="http://di.tamu.edu">
|
||||
<div id="ds-footer-logo"></div>
|
||||
</a>
|
||||
<p>
|
||||
This website is using Manakin, a new front end for DSpace created by Texas A&M University
|
||||
Libraries. The interface can be extensively modified through Manakin Aspects and XSL based Themes.
|
||||
For more information visit
|
||||
<a href="http://di.tamu.edu">http://di.tamu.edu</a> and
|
||||
<a href="http://dspace.org">http://dspace.org</a>
|
||||
</p>
|
||||
-->
|
||||
</xsl:template>
|
||||
|
||||
|
||||
|
||||
<!--
|
||||
The trail is built one link at a time. Each link is given the ds-trail-link class, with the first and
|
||||
the last links given an additional descriptor.
|
||||
-->
|
||||
<xsl:template match="dri:trail">
|
||||
<li>
|
||||
<xsl:attribute name="class">
|
||||
<xsl:text>ds-trail-link </xsl:text>
|
||||
<xsl:if test="position()=1">
|
||||
<xsl:text>first-link </xsl:text>
|
||||
</xsl:if>
|
||||
<xsl:if test="position()=last()">
|
||||
<xsl:text>last-link</xsl:text>
|
||||
</xsl:if>
|
||||
</xsl:attribute>
|
||||
<!-- Determine whether we are dealing with a link or plain text trail link -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="./@target">
|
||||
<a>
|
||||
<xsl:attribute name="href">
|
||||
<xsl:value-of select="./@target"/>
|
||||
</xsl:attribute>
|
||||
<xsl:apply-templates />
|
||||
</a>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:apply-templates />
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</li>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
|
||||
|
||||
<!--
|
||||
The meta, body, options elements; the three top-level elements in the schema
|
||||
-->
|
||||
|
||||
|
||||
|
||||
|
||||
<!--
|
||||
The template to handle the dri:body element. It simply creates the ds-body div and applies
|
||||
templates of the body's child elements (which consists entirely of dri:div tags).
|
||||
-->
|
||||
<xsl:template match="dri:body">
|
||||
<div id="ds-body">
|
||||
<xsl:if test="/dri:document/dri:meta/dri:pageMeta/dri:metadata[@element='alert'][@qualifier='message']">
|
||||
<div id="ds-system-wide-alert">
|
||||
<p>
|
||||
<xsl:copy-of select="/dri:document/dri:meta/dri:pageMeta/dri:metadata[@element='alert'][@qualifier='message']/node()"/>
|
||||
</p>
|
||||
</div>
|
||||
</xsl:if>
|
||||
<xsl:apply-templates />
|
||||
</div>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<!-- Currently the dri:meta element is not parsed directly. Instead, parts of it are referenced from inside
|
||||
other elements (like reference). The blank template below ends the execution of the meta branch -->
|
||||
<xsl:template match="dri:meta">
|
||||
</xsl:template>
|
||||
|
||||
<!-- Meta's children: userMeta, pageMeta, objectMeta and repositoryMeta may or may not have templates of
|
||||
their own. This depends on the meta template implementation, which currently does not go this deep.
|
||||
<xsl:template match="dri:userMeta" />
|
||||
<xsl:template match="dri:pageMeta" />
|
||||
<xsl:template match="dri:objectMeta" />
|
||||
<xsl:template match="dri:repositoryMeta" />
|
||||
-->
|
||||
</xsl:stylesheet>
|
@@ -0,0 +1,285 @@
|
||||
<!--
|
||||
utils.xsl
|
||||
|
||||
Version: $Revision: 3705 $
|
||||
|
||||
Date: $Date: 2009-04-11 17:02:24 +0000 (Sat, 11 Apr 2009) $
|
||||
|
||||
Copyright (c) 2002-2005, Hewlett-Packard Company and Massachusetts
|
||||
Institute of Technology. All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
- Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
- Neither the name of the Hewlett-Packard Company nor the name of the
|
||||
Massachusetts Institute of Technology nor the names of their
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
|
||||
TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
|
||||
USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
|
||||
DAMAGE.
|
||||
-->
|
||||
|
||||
<!--
|
||||
These templates are devoted to handling the
|
||||
referenceSet and reference elements.
|
||||
|
||||
Author: art.lowel at atmire.com
|
||||
Author: lieven.droogmans at atmire.com
|
||||
Author: ben at atmire.com
|
||||
Author: Alexey Maslov
|
||||
|
||||
-->
|
||||
|
||||
<xsl:stylesheet xmlns:i18n="http://apache.org/cocoon/i18n/2.1"
|
||||
xmlns:dri="http://di.tamu.edu/DRI/1.0/"
|
||||
xmlns:mets="http://www.loc.gov/METS/"
|
||||
xmlns:xlink="http://www.w3.org/TR/xlink/"
|
||||
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
|
||||
xmlns:dim="http://www.dspace.org/xmlns/dspace/dim"
|
||||
xmlns:xhtml="http://www.w3.org/1999/xhtml"
|
||||
xmlns:mods="http://www.loc.gov/mods/v3"
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns="http://www.w3.org/1999/xhtml"
|
||||
exclude-result-prefixes="i18n dri mets xlink xsl dim xhtml mods dc">
|
||||
|
||||
<xsl:output indent="yes"/>
|
||||
|
||||
<!-- These templates are devoted to handling the referenceSet and reference elements. Although they are considered
|
||||
structural elements, neither of the two contains actual content. Instead, references contain references
|
||||
to object metadata under objectMeta, while referenceSets group references together.
|
||||
-->
|
||||
|
||||
|
||||
<!-- Starting off easy here, with a summaryList -->
|
||||
|
||||
<!-- Current issues:
|
||||
|
||||
1. There is no check for the repository identifier. Need to fix that by concatenating it with the
|
||||
object identifier and using the resulting string as the key on items and reps.
|
||||
2. The use of a key index across the object store is cryptic and counterintuitive and most likely
|
||||
could benefit from better documentation.
|
||||
-->
|
||||
|
||||
<!-- When you come to an referenceSet you have to make a decision. Since it contains objects, and each
|
||||
object is its own entity (and handled in its own template) the decision of the overall structure
|
||||
would logically (and traditionally) lie with this template. However, to accomplish this we would
|
||||
have to look ahead and check what objects are included in the set, which involves resolving the
|
||||
references ahead of time and getting the information from their METS profiles directly.
|
||||
|
||||
Since this approach creates strong coupling between the set and the objects it contains, and we
|
||||
have tried to avoid that, we use the "pioneer" method. -->
|
||||
|
||||
<!-- Summarylist case. This template used to apply templates to the "pioneer" object (the first object
|
||||
in the set) and let it figure out what to do. This is no longer the case, as everything has been
|
||||
moved to the list model. A special theme, called TableTheme, has beeen created for the purpose of
|
||||
preserving the pioneer model. -->
|
||||
<xsl:template match="dri:referenceSet[@type = 'summaryList']" priority="2">
|
||||
<xsl:apply-templates select="dri:head"/>
|
||||
<!-- Here we decide whether we have a hierarchical list or a flat one -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="descendant-or-self::dri:referenceSet/@rend='hierarchy' or ancestor::dri:referenceSet/@rend='hierarchy'">
|
||||
<ul>
|
||||
<xsl:apply-templates select="*[not(name()='head')]" mode="summaryList"/>
|
||||
</ul>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<ul class="ds-artifact-list">
|
||||
<xsl:apply-templates select="*[not(name()='head')]" mode="summaryList"/>
|
||||
</ul>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
|
||||
<!-- First, the detail list case -->
|
||||
<xsl:template match="dri:referenceSet[@type = 'detailList']" priority="2">
|
||||
<xsl:apply-templates select="dri:head"/>
|
||||
<ul class="ds-referenceSet-list">
|
||||
<xsl:apply-templates select="*[not(name()='head')]" mode="detailList"/>
|
||||
</ul>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<!-- Next up is the summary view case that at this point applies only to items, since communities and
|
||||
collections do not have two separate views. -->
|
||||
<xsl:template match="dri:referenceSet[@type = 'summaryView']" priority="2">
|
||||
<xsl:apply-templates select="dri:head"/>
|
||||
<xsl:apply-templates select="*[not(name()='head')]" mode="summaryView"/>
|
||||
</xsl:template>
|
||||
|
||||
<!-- Finally, we have the detailed view case that is applicable to items, communities and collections.
|
||||
In DRI it constitutes a standard view of collections/communities and a complete metadata listing
|
||||
view of items. -->
|
||||
<xsl:template match="dri:referenceSet[@type = 'detailView']" priority="2">
|
||||
<xsl:apply-templates select="dri:head"/>
|
||||
<xsl:apply-templates select="*[not(name()='head')]" mode="detailView"/>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- The following options can be appended to the external metadata URL to request specific
|
||||
sections of the METS document:
|
||||
|
||||
sections:
|
||||
|
||||
A comma seperated list of METS sections to included. The possible values are: "metsHdr", "dmdSec",
|
||||
"amdSec", "fileSec", "structMap", "structLink", "behaviorSec", and "extraSec". If no list is provided then *ALL*
|
||||
sections are rendered.
|
||||
|
||||
|
||||
dmdTypes:
|
||||
|
||||
A comma seperated list of metadata formats to provide as descriptive metadata. The list of avaialable metadata
|
||||
types is defined in the dspace.cfg, disseminationcrosswalks. If no formats are provided them DIM - DSpace
|
||||
Intermediate Format - is used.
|
||||
|
||||
|
||||
amdTypes:
|
||||
|
||||
A comma seperated list of metadata formats to provide administative metadata. DSpace does not currently
|
||||
support this type of metadata.
|
||||
|
||||
|
||||
fileGrpTypes:
|
||||
|
||||
A comma seperated list of file groups to render. For DSpace a bundle is translated into a METS fileGrp, so
|
||||
possible values are "THUMBNAIL","CONTENT", "METADATA", etc... If no list is provided then all groups are
|
||||
rendered.
|
||||
|
||||
|
||||
structTypes:
|
||||
|
||||
A comma seperated list of structure types to render. For DSpace there is only one structType: LOGICAL. If this
|
||||
is provided then the logical structType will be rendered, otherwise none will. The default operation is to
|
||||
render all structure types.
|
||||
-->
|
||||
|
||||
<!-- Then we resolve the reference tag to an external mets object -->
|
||||
<xsl:template match="dri:reference" mode="summaryList">
|
||||
<xsl:variable name="externalMetadataURL">
|
||||
<xsl:text>cocoon:/</xsl:text>
|
||||
<xsl:value-of select="@url"/>
|
||||
<!-- Since this is a summary only grab the descriptive metadata, and the thumbnails -->
|
||||
<xsl:text>?sections=dmdSec,fileSec&fileGrpTypes=THUMBNAIL</xsl:text>
|
||||
<!-- An example of requesting a specific metadata standard (MODS and QDC crosswalks only work for items)->
|
||||
<xsl:if test="@type='DSpace Item'">
|
||||
<xsl:text>&dmdTypes=DC</xsl:text>
|
||||
</xsl:if>-->
|
||||
</xsl:variable>
|
||||
<xsl:comment> External Metadata URL: <xsl:value-of select="$externalMetadataURL"/> </xsl:comment>
|
||||
<li>
|
||||
<xsl:attribute name="class">
|
||||
<xsl:text>ds-artifact-item </xsl:text>
|
||||
<xsl:choose>
|
||||
<xsl:when test="position() mod 2 = 0">even</xsl:when>
|
||||
<xsl:otherwise>odd</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:attribute>
|
||||
<xsl:apply-templates select="document($externalMetadataURL)" mode="summaryList"/>
|
||||
<xsl:apply-templates />
|
||||
</li>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="dri:reference" mode="detailList">
|
||||
<xsl:variable name="externalMetadataURL">
|
||||
<xsl:text>cocoon:/</xsl:text>
|
||||
<xsl:value-of select="@url"/>
|
||||
<!-- No options selected, render the full METS document -->
|
||||
</xsl:variable>
|
||||
<xsl:comment> External Metadata URL: <xsl:value-of select="$externalMetadataURL"/> </xsl:comment>
|
||||
<li>
|
||||
<xsl:apply-templates select="document($externalMetadataURL)" mode="detailList"/>
|
||||
<xsl:apply-templates />
|
||||
</li>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="dri:reference" mode="summaryView">
|
||||
<xsl:variable name="externalMetadataURL">
|
||||
<xsl:text>cocoon:/</xsl:text>
|
||||
<xsl:value-of select="@url"/>
|
||||
<!-- No options selected, render the full METS document -->
|
||||
</xsl:variable>
|
||||
<xsl:comment> External Metadata URL: <xsl:value-of select="$externalMetadataURL"/> </xsl:comment>
|
||||
<xsl:apply-templates select="document($externalMetadataURL)" mode="summaryView"/>
|
||||
<xsl:apply-templates />
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="dri:reference" mode="detailView">
|
||||
<xsl:variable name="externalMetadataURL">
|
||||
<xsl:text>cocoon:/</xsl:text>
|
||||
<xsl:value-of select="@url"/>
|
||||
<!-- No options selected, render the full METS document -->
|
||||
</xsl:variable>
|
||||
<xsl:comment> External Metadata URL: <xsl:value-of select="$externalMetadataURL"/> </xsl:comment>
|
||||
<xsl:apply-templates select="document($externalMetadataURL)" mode="detailView"/>
|
||||
<xsl:apply-templates />
|
||||
</xsl:template>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- The standard attributes template -->
|
||||
<!-- TODO: should probably be moved up some, since it is commonly called -->
|
||||
<xsl:template name="standardAttributes">
|
||||
<xsl:param name="class"/>
|
||||
<xsl:if test="@id">
|
||||
<xsl:attribute name="id"><xsl:value-of select="translate(@id,'.','_')"/></xsl:attribute>
|
||||
</xsl:if>
|
||||
<xsl:attribute name="class">
|
||||
<xsl:value-of select="normalize-space($class)"/>
|
||||
<xsl:if test="@rend">
|
||||
<xsl:text> </xsl:text>
|
||||
<xsl:value-of select="@rend"/>
|
||||
</xsl:if>
|
||||
</xsl:attribute>
|
||||
|
||||
</xsl:template>
|
||||
|
||||
<!-- templates for required textarea attributes used if not found in DRI document -->
|
||||
<xsl:template name="textAreaCols">
|
||||
<xsl:attribute name="cols">20</xsl:attribute>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="textAreaRows">
|
||||
<xsl:attribute name="rows">5</xsl:attribute>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
|
||||
<!-- This does it for all the DRI elements. The only thing left to do is to handle Cocoon's i18n
|
||||
transformer tags that are used for text translation. The templates below simply push through
|
||||
the i18n elements so that they can translated after the XSL step. -->
|
||||
<xsl:template match="i18n:text">
|
||||
<xsl:copy-of select="."/>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="i18n:translate">
|
||||
<xsl:copy-of select="."/>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="i18n:param">
|
||||
<xsl:copy-of select="."/>
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
@@ -0,0 +1,80 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<!--
|
||||
dri2xhtml.xsl
|
||||
|
||||
Version: $Revision: 3705 $
|
||||
|
||||
Date: $Date: 2009-04-11 17:02:24 +0000 (Sat, 11 Apr 2009) $
|
||||
|
||||
Copyright (c) 2002-2005, Hewlett-Packard Company and Massachusetts
|
||||
Institute of Technology. All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
- Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
- Neither the name of the Hewlett-Packard Company nor the name of the
|
||||
Massachusetts Institute of Technology nor the names of their
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
|
||||
TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
|
||||
USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
|
||||
DAMAGE.
|
||||
-->
|
||||
|
||||
<!--
|
||||
Starting point of the dri2xhtml transformation.
|
||||
This xsl references all dependencies.
|
||||
|
||||
Author: art.lowel at atmire.com
|
||||
Author: lieven.droogmans at atmire.com
|
||||
Author: ben at atmire.com
|
||||
Author: Alexey Maslov
|
||||
|
||||
-->
|
||||
|
||||
<xsl:stylesheet xmlns:i18n="http://apache.org/cocoon/i18n/2.1"
|
||||
xmlns:dri="http://di.tamu.edu/DRI/1.0/"
|
||||
xmlns:mets="http://www.loc.gov/METS/"
|
||||
xmlns:xlink="http://www.w3.org/TR/xlink/"
|
||||
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
|
||||
xmlns:dim="http://www.dspace.org/xmlns/dspace/dim"
|
||||
xmlns:xhtml="http://www.w3.org/1999/xhtml"
|
||||
xmlns:mods="http://www.loc.gov/mods/v3"
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns="http://www.w3.org/1999/xhtml"
|
||||
exclude-result-prefixes="i18n dri mets xlink xsl dim xhtml mods dc">
|
||||
|
||||
<xsl:import href="core/global-variables.xsl"/>
|
||||
<xsl:import href="core/page-structure.xsl"/>
|
||||
<xsl:import href="core/elements.xsl"/>
|
||||
<xsl:import href="core/navigation.xsl"/>
|
||||
<xsl:import href="core/forms.xsl"/>
|
||||
<xsl:import href="core/attribute-handlers.xsl"/>
|
||||
<xsl:import href="core/utils.xsl"/>
|
||||
<xsl:import href="aspect/general/choice-authority-control.xsl"/>
|
||||
<xsl:import href="aspect/administrative/harvesting.xsl"/>
|
||||
<xsl:import href="aspect/artifactbrowser/artifactbrowser.xsl"/>
|
||||
<xsl:output indent="yes"/>
|
||||
|
||||
<!--Duplicate changes from the respective xsl to adjust them-->
|
||||
|
||||
</xsl:stylesheet>
|
@@ -55,6 +55,7 @@
|
||||
- [DS-703] Making the OAI max amount of records configurable
|
||||
- [DS-603] Including a most used item list on the home page
|
||||
- [DS-615] Optimize solr performance with solr.optimize and autocommit
|
||||
- [DS-706] Alternative to dri2xhtml, with the goal to be more developer-friendly
|
||||
|
||||
1.6.2
|
||||
=====
|
||||
|
Reference in New Issue
Block a user