DS-820: SFX button + SFX in Mirage

This commit is contained in:
Ivan Masár
2012-05-23 10:31:19 +02:00
parent 400dbbd4e9
commit 959f9abedc
6 changed files with 78 additions and 9 deletions

View File

@@ -221,9 +221,14 @@
<%
if (ConfigurationManager.getProperty("sfx.server.url") != null)
{
String sfximage = ConfigurationManager.getProperty("sfx.server.image_url");
if (sfximage == null)
{
sfximage = request.getContextPath() + "/image/sfx-link.gif";
}
%>
<p align="center">
<a href="<dspace:sfxlink item="<%= item %>"/>" /><img src="<%= request.getContextPath() %>/image/sfx-link.gif" border="0" alt="SFX Query" /></a>
<a href="<dspace:sfxlink item="<%= item %>"/>" /><img src="<%= sfximage %>" border="0" alt="SFX Query" /></a>
</p>
<%
}

View File

@@ -185,6 +185,12 @@ public class ItemViewer extends AbstractDSpaceTransformer implements CacheablePr
sfxserverUrl = sfxserverUrl.trim() +"&" + sfxQuery.trim();
pageMeta.addMetadata("sfx","server").addContent(sfxserverUrl);
}
String sfxserverImg = ConfigurationManager.getProperty("sfx.server.image_url");
if (sfxserverImg != null && sfxserverImg.length() > 0)
{
pageMeta.addMetadata("sfx","image_url").addContent(sfxserverImg);
}
boolean googleEnabled = ConfigurationManager.getBooleanProperty(
"google-metadata.enable", false);

View File

@@ -40,6 +40,7 @@
<xsl:apply-templates select="./mets:dmdSec/mets:mdWrap[@OTHERMDTYPE='DIM']/mets:xmlData/dim:dim"
mode="itemSummaryView-DIM"/>
<xsl:copy-of select="$SFXLink" />
<!-- Generate the bitstream information from the file section -->
<xsl:choose>
<xsl:when test="./mets:fileSec/mets:fileGrp[@USE='CONTENT' or @USE='ORIGINAL']">
@@ -316,6 +317,7 @@
</xsl:attribute>
&#xFEFF; <!-- non-breaking space to force separating the end tag -->
</span>
<xsl:copy-of select="$SFXLink" />
</xsl:template>
<xsl:template match="dim:field" mode="itemDetailView-DIM">

View File

@@ -547,4 +547,34 @@
<xsl:template match="dri:objectMeta" />
<xsl:template match="dri:repositoryMeta" />
-->
<!--
This variable contains a link to SFX or a SFX button (link with an image).
Relies on sfx.server.url and sfx.server.image_url in the config file, which are transferred in dri:pageMeta.
-->
<xsl:variable name="SFXLink">
<xsl:if test="/dri:document/dri:meta/dri:pageMeta/dri:metadata[@element='sfx'][@qualifier='server']">
<a>
<xsl:attribute name="href">
<xsl:value-of select="/dri:document/dri:meta/dri:pageMeta/dri:metadata[@element='sfx'][@qualifier='server']"/>
</xsl:attribute>
<xsl:choose>
<xsl:when test="/dri:document/dri:meta/dri:pageMeta/dri:metadata[@element='sfx'][@qualifier='image_url']">
<img>
<xsl:attribute name="src">
<xsl:value-of select="/dri:document/dri:meta/dri:pageMeta/dri:metadata[@element='sfx'][@qualifier='image_url']"/>
</xsl:attribute>
<xsl:attribute name="alt">
<xsl:text>Find Full text</xsl:text>
</xsl:attribute>
</img>
</xsl:when>
<xsl:otherwise>
<xsl:text>Find Full text</xsl:text>
</xsl:otherwise>
</xsl:choose>
</a>
</xsl:if>
</xsl:variable>
</xsl:stylesheet>

View File

@@ -568,17 +568,39 @@
</xsl:choose>
<xsl:if test="/dri:document/dri:meta/dri:pageMeta/dri:metadata[@element='sfx'][@qualifier='server']">
<a>
<xsl:attribute name="href">
<xsl:value-of select="/dri:document/dri:meta/dri:pageMeta/dri:metadata[@element='sfx'][@qualifier='server']"/>
</xsl:attribute>
<xsl:text>Find Full text</xsl:text>
</a>
</xsl:if>
<xsl:copy-of select="$SFXLink"/>
</div>
</xsl:template>
<!--
This variable contains a link to SFX or a SFX button (link with an image).
Relies on sfx.server.url and sfx.server.image_url in the config file, which are transferred in dri:pageMeta.
-->
<xsl:variable name="SFXLink">
<xsl:if test="/dri:document/dri:meta/dri:pageMeta/dri:metadata[@element='sfx'][@qualifier='server']">
<a>
<xsl:attribute name="href">
<xsl:value-of select="/dri:document/dri:meta/dri:pageMeta/dri:metadata[@element='sfx'][@qualifier='server']"/>
</xsl:attribute>
<xsl:choose>
<xsl:when test="/dri:document/dri:meta/dri:pageMeta/dri:metadata[@element='sfx'][@qualifier='image_url']">
<img>
<xsl:attribute name="src">
<xsl:value-of select="/dri:document/dri:meta/dri:pageMeta/dri:metadata[@element='sfx'][@qualifier='image_url']"/>
</xsl:attribute>
<xsl:attribute name="alt">
<xsl:text>Find Full text</xsl:text>
</xsl:attribute>
</img>
</xsl:when>
<xsl:otherwise>
<xsl:text>Find Full text</xsl:text>
</xsl:otherwise>
</xsl:choose>
</a>
</xsl:if>
</xsl:variable>
<!--
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

View File

@@ -1528,6 +1528,10 @@ itemmap.author.index = author
# omitted, SFX support is switched off.
# sfx.server.url = http://sfx.myu.edu:8888/sfx?
# This image will be displayed in the SFX link. If commented out, the SFX link will be only a text link.
# This customization usually contains an institution-branded SFX button.
# sfx.server.image_url = http://sfx.my.edu:8888/sfx.gif
#### Item Recommendation Settings #####