Hi Jamie, I recently did this. In my item-list.xsl:
In this section <xsl:template match="dim:dim"
mode="itemSummaryList-DIM-metadata">, I put <xsl:param name="mimetype"
select="//mets:fileGrp[@USE='CONTENT']/mets:file/@MIMETYPE"/> to get the mime
type and here is my if statement a few lines down:
<xsl:when test="$mimetype = 'application/flv'">
<img alt="[PDF]" src="{concat($theme-path,
'/images/mime/application-x-shockwave-flash.png')}" style="height: 40px;"
height="40" title="Flash Application"/>
</xsl:when>
I got a dozen of those, one for each of the main types I host.
This will only work if your item has a thumbnail already (not the mime icon).
To expose the actual bitstream's mimetype you need to edit
\dspace-3.0-src-release\dspace-xmlui\src\main\webapp\themes\Mirage\lib\xsl\core\utils.xsl
replacing this line:
<xsl:text>?sections=dmdSec,fileSec&fileGrpTypes=THUMBNAIL</xsl:text> with
this: <xsl:text>?sections=dmdSec,fileSec</xsl:text> otherwise you will not get
the bitstream information.
Sorry for the colors, copy/paste into outlook is terrible.
Hope this helps.
Matthew Drover
Programmer Consultant
Immersive Technology
Distance Education, Learning and Teaching Support
Memorial University of Newfoundland
From: Denman, Jamie [mailto:[email protected]]
Sent: Tuesday, May 28, 2013 12:09 PM
To: '[email protected]'
Cc: [email protected]
Subject: Re: [Dspace-tech] MIMETYPE in item-list
Thanks for input
When I insert this code I get:
<img style="height: 80px;" src="/xmlui/themes/Falmouth/images/.png
<view-source:http://viewfinder.falmouth.ac.uk:8080/xmlui/themes/Falmouth/images/.png>
" alt="Icon" /> so it seems to ‘ignore’ the
“mets:fileGrp[@USE='CONTENT']/mets:file/@MIMETYPE” part.
Would I have to ‘lift’ the item-view part that gets the bitstreams for each
item, as item-list only uses the primary bitstream and if not a thumbnail then
shows mime.png (I think this may put too much load on server though) or would
it be better to look for the code that creates the thumbnails (dspace
filter-media) and alter that to create a (e.g.) PDF icon for that record if
primary bitstream is not image?
Regards
Jamie
From: [email protected] [mailto:[email protected]] On Behalf Of helix84
Sent: 28 May 2013 14:53
To: Denman, Jamie
Cc: [email protected]
Subject: Re: [Dspace-tech] MIMETYPE in item-list
On Tue, May 28, 2013 at 3:44 PM, helix84 <[email protected]> wrote:
https://github.com/DSpace/DSpace/blob/dspace-3.1/dspace-xmlui/src/main/webapp/themes/Mirage/lib/xsl/aspect/artifactbrowser/item-list.xsl#L259
Here's an example what you could put on that line:
<img alt="Icon" src="{concat($theme-path, '/images/',
mets:fileGrp[@USE='CONTENT']/mets:file/@MIMETYPE, '.png')}" style="height:
{$thumbnail.maxheight}px;"/>
It's really the same thing as in the itemSummaryView-DIM template in
item-view.xsl, just remove the "./mets:fileSec/" part.
Regards,
~~helix84
Compulsory reading: DSpace Mailing List Etiquette
https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette
This electronic communication is governed by the terms and conditions at
http://www.mun.ca/cc/policies/electronic_communications_disclaimer_2012.php
------------------------------------------------------------------------------
Introducing AppDynamics Lite, a free troubleshooting tool for Java/.NET
Get 100% visibility into your production application - at no cost.
Code-level diagnostics for performance bottlenecks with <2% overhead
Download for free and get started troubleshooting in minutes.
http://p.sf.net/sfu/appdyn_d2d_ap1
_______________________________________________
DSpace-tech mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dspace-tech
List Etiquette: https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette