Well , Thank you so much !! It worked fine !!

I have 2 more questions though.

1) Is it possible to pass (in our example) the :  http://yourapp.com/path/
as a parameter  into a variable ,so to run instantly, when running the script  
on other servers without having to change each time that  value ? (something 
like "reading" each server's url name  and storing it )

2) How can it be, when passing the file as a parameter to my app , not to 
display the file name on the url  but just the 
http://yourapp.com/path/script.php?  ?



Again thank you so much for your instructions 


________________________________
 Απο: helix84 <[email protected]>
Προς: Μάριος Πετρόπουλος <[email protected]> 
Κοιν.: "[email protected]" <[email protected]> 
Στάλθηκε: 2:22 π.μ. Τρίτη, 25 Ιουνίου 2013
Θέμα: Re: Σχετ: [Dspace-tech] url redirection on view/open for an item
 


Thanks, it's clear now. Instead of the <xsl:template 
match="mets:fileGrp[@USE='CONTENT']">  template, you should override the 
<xsl:template match="mets:file"> template. The only thing you need to change in 
that template is the value of href attribute as you can see below. For clarity, 
I added the $baseurl variable separately.



<xsl:variable name="baseurl" 
select="concat(/dri:document/dri:meta/dri:pageMeta/dri:metadata[@element='request'][@qualifier='scheme'],
 '://', 
/dri:document/dri:meta/dri:pageMeta/dri:metadata[@element='request'][@qualifier='serverName'],
 ':', 
/dri:document/dri:meta/dri:pageMeta/dri:metadata[@element='request'][@qualifier='serverPort'])"/>
 <!-- Build a single row in the bitstreams 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="concat('http://yourapp.com/path/script.php?file=', 
$baseurl, mets:FLocat[@LOCTYPE='URL']/@xlink:href)"/> </xsl:attribute>
...
Regards,
~~helix84

Compulsory reading: DSpace Mailing List Etiquette
https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette
------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
_______________________________________________
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

Reply via email to