Add PlumX

This commit is contained in:
Ivan Masár
2014-10-21 14:26:55 +02:00
parent 25166c8cf5
commit fd1f914ec1
5 changed files with 150 additions and 28 deletions

View File

@@ -1456,4 +1456,13 @@ table.discovery-filters th.new-filter-header
float:left;
border: 1px solid #cccccc;
margin-right: 3px;
}
}
#impact-altmetric {
float:right;
margin:0 30px 0 30px;
}
#impact-plumx {
float:right;
}

View File

@@ -39,12 +39,18 @@
<xsl:output indent="yes"/>
<xsl:template name="itemSummaryView-DIM">
<!-- optional: Altmeric.com badge and PlumX widget -->
<xsl:if test='confman:getProperty("altmetrics", "altmetric.enabled") and ($identifier_doi or $identifier_handle)'>
<xsl:call-template name='impact-altmetric'/>
</xsl:if>
<xsl:if test='confman:getProperty("altmetrics", "plumx.enabled") and $identifier_doi'>
<xsl:call-template name='impact-plumx'/>
</xsl:if>
<!-- 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"/>
<xsl:call-template name='impact-metrics'/>
<xsl:copy-of select="$SFXLink" />
<!-- Generate the bitstream information from the file section -->
<xsl:choose>
@@ -560,11 +566,10 @@
</xsl:choose>
</xsl:template>
<xsl:template name='impact-metrics'>
<div id='impact-metrics'>
<xsl:template name='impact-altmetric'>
<div id='impact-altmetric'>
<!-- Altmetric.com -->
<script type='text/javascript'
src='https://d1bxh8uas1mnw7.cloudfront.net/assets/embed.js'>&#xFEFF;
<script type="text/javascript" src="{concat($scheme, 'd1bxh8uas1mnw7.cloudfront.net/assets/embed.js')}">&#xFEFF;
</script>
<div id='altmetric'
class='altmetric-embed'>
@@ -607,7 +612,70 @@
</xsl:choose>
&#xFEFF;
</div>
<div style='clear: both;'>&#xFEFF;</div>
</div>
</xsl:template>
<xsl:template name="impact-plumx">
<div id="impact-plumx" style="clear:right">
<!-- PlumX <http://plu.mx> -->
<xsl:variable name="plumx_type" select="confman:getProperty('altmetrics', 'plumx.widget-type')"/>
<xsl:variable name="plumx-script-url">
<xsl:choose>
<xsl:when test="boolean($plumx_type)">
<xsl:value-of select="concat($scheme, 'd39af2mgp1pqhg.cloudfront.net/widget-', $plumx_type, '.js')"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="concat($scheme, 'd39af2mgp1pqhg.cloudfront.net/widget-popup.js')"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<script type="text/javascript" src="{$plumx-script-url}">&#xFEFF;
</script>
<xsl:variable name="plumx-class">
<xsl:choose>
<xsl:when test="boolean($plumx_type) and ($plumx_type != 'popup')">
<xsl:value-of select="concat('plumx-', $plumx_type)"/>
</xsl:when>
<xsl:otherwise>plumx-plum-print-popup</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<a>
<xsl:attribute name="id">plumx</xsl:attribute>
<xsl:attribute name="class"><xsl:value-of select="$plumx-class"/></xsl:attribute>
<xsl:attribute name="href">https://plu.mx/pitt/a/?doi=<xsl:value-of select="$identifier_doi"/></xsl:attribute>
<xsl:variable name="plumx_data-popup" select="confman:getProperty('altmetrics', 'plumx.data-popup')"/>
<xsl:if test="$plumx_data-popup">
<xsl:attribute name="data-popup"><xsl:value-of select="$plumx_data-popup"/></xsl:attribute>
</xsl:if>
<xsl:if test="confman:getProperty('altmetrics', 'plumx.data-hide-when-empty')">
<xsl:attribute name="data-hide-when-empty">true</xsl:attribute>
</xsl:if>
<xsl:if test="confman:getProperty('altmetrics', 'plumx.data-hide-print')">
<xsl:attribute name="data-hide-print">true</xsl:attribute>
</xsl:if>
<xsl:variable name="plumx_data-orientation" select="confman:getProperty('altmetrics', 'plumx.data-orientation')"/>
<xsl:if test="$plumx_data-orientation">
<xsl:attribute name="data-orientation"><xsl:value-of select="$plumx_data-orientation"/></xsl:attribute>
</xsl:if>
<xsl:variable name="plumx_data-width" select="confman:getProperty('altmetrics', 'plumx.data-width')"/>
<xsl:if test="$plumx_data-width">
<xsl:attribute name="data-width"><xsl:value-of select="$plumx_data-width"/></xsl:attribute>
</xsl:if>
<xsl:if test="confman:getProperty('altmetrics', 'plumx.data-border')">
<xsl:attribute name="data-border">true</xsl:attribute>
</xsl:if>
&#xFEFF;
</a>
</div>
</xsl:template>

View File

@@ -39,6 +39,18 @@
<xsl:variable name="ds_item_view_toggle_url" select="//dri:p[contains(@rend , 'item-view-toggle') and
(preceding-sibling::dri:referenceSet[@type = 'summaryView'] or following-sibling::dri:referenceSet[@type = 'summaryView'])]/dri:xref/@target"/>
<!-- render linked resources using the http:// or https:// scheme depending on dspace.baseUrl -->
<xsl:variable name="scheme">
<xsl:choose>
<xsl:when test="starts-with(confman:getProperty('dspace.baseUrl'), 'https://')">
<xsl:text>https://</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>http://</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<!-- item metadata reference -->
<xsl:variable name='identifier_doi'
select='//dri:meta/dri:pageMeta/dri:metadata[@element="identifier" and @qualifier="doi"]'/>

View File

@@ -695,17 +695,7 @@
<xsl:text>1.6.2</xsl:text>
</xsl:variable>
<xsl:variable name="protocol">
<xsl:choose>
<xsl:when test="starts-with(confman:getProperty('dspace.baseUrl'), 'https://')">
<xsl:text>https://</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>http://</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<script type="text/javascript" src="{concat($protocol, 'ajax.googleapis.com/ajax/libs/jquery/', $jqueryVersion ,'/jquery.min.js')}">&#160;</script>
<script type="text/javascript" src="{concat($scheme, 'ajax.googleapis.com/ajax/libs/jquery/', $jqueryVersion ,'/jquery.min.js')}">&#160;</script>
<xsl:variable name="localJQuerySrc">
<xsl:value-of select="/dri:document/dri:meta/dri:pageMeta/dri:metadata[@element='contextPath'][not(@qualifier)]"/>

View File

@@ -3,26 +3,69 @@
#---------------------------------------------------------------#
# Configuration properties used by impact metrics badges #
#---------------------------------------------------------------#
# Metadata field which contains the interesting identifiers
#altmetrics.field = dc.identifier.uri
# Configure altmetric.com badges. See http://api.altmetric.com/embeds.html
#---------------------------------------------------------------#
# Configure altmetric.com badges. #
# See http://api.altmetric.com/embeds.html #
#---------------------------------------------------------------#
# donut medium-donut large-donut 1 4
#altmetric.badgeType =
# Is the Altmetric.com badge enabled?
#altmetric.enabled = false
# left right top bottom
# Possible values: donut medium-donut large-donut 1 4
altmetric.badgeType = donut
# Possible values: left right top bottom
#altmetric.popover =
# right
# Possible values: right
#altmetric.details =
# true
#altmetric.noScore =
# Possible values: true
#altmetric.noScore =
# true
# Possible values: true
#altmetric.hideNoMentions =
# e.g. _blank
#altmetric.linkTarget =
#---------------------------------------------------------------#
# Configure PlumX Artifact widgets. #
# See https://plu.mx/pitt/developers/widgets #
#---------------------------------------------------------------#
# Is the PlumX Artifact widget enabled?
#plumx.enabled = false
# Possible values: popup summary details
#plumx.widget-type = popup
# Used with widget types: popup
# Possible values: top bottom left right
#plumx.data-popup = left
# Used with widget types: popup summary details
# Possible values: true false
#plumx.data-hide-when-empty = true
# Used with widget types: summary details
# Possible values: true false
#plumx.data-hide-print = false
# Used with widget types: summary
# Possible values: vertical horizontal
#plumx.data-orientation = vertical
# Used with widget types: details
# Possible values: any positive integer
#plumx.data-width =
# Used with widget types: details
# Possible values: true false
#plumx.data-border = false