Viewing an uploaded item in DSpace 4.2 xmluiHow to add additional attributes to a sitemap?How to use wildcard pattern in DSpace xmlui sitemap?Modifying dspace discover page in xmlui mirage themeOver-riding DRI Templates using xsl in DSpaceRetaining Search String in text box using javascript cookies in DSpace 4.2 Mirage ThemeAdding a new class to DSpace 4.2 xmluiHow to display the top 50 most viewed items in DSpace statisticsdspace error blank xmlui pageDSpace logo community - DSpace 6.2 XMLUIHow to display thumbnails from harvested items in DSpace?
Wired to Wireless Doorbell
Does Rayami, First of the Fallen exile it self?
Find all files in directories named foo
Pseudo Game of Cups in Python
Does battery condition have anything to do with macbook pro performance?
Is there a connection between IT and Ghostbusters?
How to influence manager to not schedule team meetings during lunch?
Manager manipulates my leaves, what's in it for him?
What is the origin of the "being immortal sucks" trope?
Why would a fighter use the afterburner and air brakes at the same time?
Norwegian refuses EU delay (4.7h) compensation because it turned out there was nothing wrong with the aircraft
Debussy as term for bathroom?
EU compensation - fire alarm at the Flight Crew's hotel
Simulate a 1D Game-of-Life-ish Model
Calibrated Esteps Causes Extruder Skipping
How to ask a man to not take up more than one seat on public transport while avoiding conflict?
Is the Necromancer's "Half-Formed Golem" pet available for all classes?
I feel like most of my characters are the same, what can I do?
Which museums have artworks of all four ninja turtles' namesakes?
Do liquid propellant rocket engines experience thrust oscillation?
Nanomachines exist that enable Axolotl-levels of regeneration - So how can crippling injuries exist as well?
Is this quote, "just ten trading days represent 63 per cent of the returns of the past 50 years" true?
Reaction of aqueous sodium carbonate with aluminum foil
As an employer, can I compel my employees to vote?
Viewing an uploaded item in DSpace 4.2 xmlui
How to add additional attributes to a sitemap?How to use wildcard pattern in DSpace xmlui sitemap?Modifying dspace discover page in xmlui mirage themeOver-riding DRI Templates using xsl in DSpaceRetaining Search String in text box using javascript cookies in DSpace 4.2 Mirage ThemeAdding a new class to DSpace 4.2 xmluiHow to display the top 50 most viewed items in DSpace statisticsdspace error blank xmlui pageDSpace logo community - DSpace 6.2 XMLUIHow to display thumbnails from harvested items in DSpace?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
This is how the my search results page of DSpace looks like :
On clicking the item a new page opens up showing its description:
The description page opens the file upon clicking View/Open. Is it possible to directly open the file upon clicking its title on the results page? I want to skip the item description page.
As per my understanding this is the Java
file which is called to render items. Do I need to make changes to this file? Or is it possible to achieve what I want by simply modifying the sitemap
and xsl
files?
xslt sitemap dspace apache-cocoon
|
show 4 more comments
This is how the my search results page of DSpace looks like :
On clicking the item a new page opens up showing its description:
The description page opens the file upon clicking View/Open. Is it possible to directly open the file upon clicking its title on the results page? I want to skip the item description page.
As per my understanding this is the Java
file which is called to render items. Do I need to make changes to this file? Or is it possible to achieve what I want by simply modifying the sitemap
and xsl
files?
xslt sitemap dspace apache-cocoon
What are you thinking to do if there is none or more than one file?
– Adán
Feb 19 '15 at 12:45
Currently we're only considering items containing a single file
– Poonam Anthony
Feb 19 '15 at 14:00
1
I believe you have to edititem-list.xsl
for browse anddiscovery.xsl
for search results.discover.xsl
by the way is found under thethemes/dri2xhtml-alt/aspect/artifactbrowser
. It will save you time during an upgrade if you'll just copy the relevant templates intoMirage.xsl
, preferably under themodules
directory mentioned here.
– euler
Feb 19 '15 at 15:21
@euler I commented out lines 183 to 192 in discovery.xsl. As a result the action upon clicking the Item name is suppressed. Then I copied lines 505 to 524 from item-view.xsl after line 182 indiscovery.xsl
. That didn't help. Could you tell me where I'm going wrong?
– Poonam Anthony
Feb 20 '15 at 6:49
You need to adjust the xpath inside the "view-open" template to apply it on the $metsDoc. There's an example right there in the code you commented out in discovery.xsl.
– Antoine Snyers
Feb 20 '15 at 15:21
|
show 4 more comments
This is how the my search results page of DSpace looks like :
On clicking the item a new page opens up showing its description:
The description page opens the file upon clicking View/Open. Is it possible to directly open the file upon clicking its title on the results page? I want to skip the item description page.
As per my understanding this is the Java
file which is called to render items. Do I need to make changes to this file? Or is it possible to achieve what I want by simply modifying the sitemap
and xsl
files?
xslt sitemap dspace apache-cocoon
This is how the my search results page of DSpace looks like :
On clicking the item a new page opens up showing its description:
The description page opens the file upon clicking View/Open. Is it possible to directly open the file upon clicking its title on the results page? I want to skip the item description page.
As per my understanding this is the Java
file which is called to render items. Do I need to make changes to this file? Or is it possible to achieve what I want by simply modifying the sitemap
and xsl
files?
xslt sitemap dspace apache-cocoon
xslt sitemap dspace apache-cocoon
asked Feb 19 '15 at 11:53
Poonam AnthonyPoonam Anthony
6731 gold badge7 silver badges24 bronze badges
6731 gold badge7 silver badges24 bronze badges
What are you thinking to do if there is none or more than one file?
– Adán
Feb 19 '15 at 12:45
Currently we're only considering items containing a single file
– Poonam Anthony
Feb 19 '15 at 14:00
1
I believe you have to edititem-list.xsl
for browse anddiscovery.xsl
for search results.discover.xsl
by the way is found under thethemes/dri2xhtml-alt/aspect/artifactbrowser
. It will save you time during an upgrade if you'll just copy the relevant templates intoMirage.xsl
, preferably under themodules
directory mentioned here.
– euler
Feb 19 '15 at 15:21
@euler I commented out lines 183 to 192 in discovery.xsl. As a result the action upon clicking the Item name is suppressed. Then I copied lines 505 to 524 from item-view.xsl after line 182 indiscovery.xsl
. That didn't help. Could you tell me where I'm going wrong?
– Poonam Anthony
Feb 20 '15 at 6:49
You need to adjust the xpath inside the "view-open" template to apply it on the $metsDoc. There's an example right there in the code you commented out in discovery.xsl.
– Antoine Snyers
Feb 20 '15 at 15:21
|
show 4 more comments
What are you thinking to do if there is none or more than one file?
– Adán
Feb 19 '15 at 12:45
Currently we're only considering items containing a single file
– Poonam Anthony
Feb 19 '15 at 14:00
1
I believe you have to edititem-list.xsl
for browse anddiscovery.xsl
for search results.discover.xsl
by the way is found under thethemes/dri2xhtml-alt/aspect/artifactbrowser
. It will save you time during an upgrade if you'll just copy the relevant templates intoMirage.xsl
, preferably under themodules
directory mentioned here.
– euler
Feb 19 '15 at 15:21
@euler I commented out lines 183 to 192 in discovery.xsl. As a result the action upon clicking the Item name is suppressed. Then I copied lines 505 to 524 from item-view.xsl after line 182 indiscovery.xsl
. That didn't help. Could you tell me where I'm going wrong?
– Poonam Anthony
Feb 20 '15 at 6:49
You need to adjust the xpath inside the "view-open" template to apply it on the $metsDoc. There's an example right there in the code you commented out in discovery.xsl.
– Antoine Snyers
Feb 20 '15 at 15:21
What are you thinking to do if there is none or more than one file?
– Adán
Feb 19 '15 at 12:45
What are you thinking to do if there is none or more than one file?
– Adán
Feb 19 '15 at 12:45
Currently we're only considering items containing a single file
– Poonam Anthony
Feb 19 '15 at 14:00
Currently we're only considering items containing a single file
– Poonam Anthony
Feb 19 '15 at 14:00
1
1
I believe you have to edit
item-list.xsl
for browse and discovery.xsl
for search results. discover.xsl
by the way is found under the themes/dri2xhtml-alt/aspect/artifactbrowser
. It will save you time during an upgrade if you'll just copy the relevant templates into Mirage.xsl
, preferably under the modules
directory mentioned here.– euler
Feb 19 '15 at 15:21
I believe you have to edit
item-list.xsl
for browse and discovery.xsl
for search results. discover.xsl
by the way is found under the themes/dri2xhtml-alt/aspect/artifactbrowser
. It will save you time during an upgrade if you'll just copy the relevant templates into Mirage.xsl
, preferably under the modules
directory mentioned here.– euler
Feb 19 '15 at 15:21
@euler I commented out lines 183 to 192 in discovery.xsl. As a result the action upon clicking the Item name is suppressed. Then I copied lines 505 to 524 from item-view.xsl after line 182 in
discovery.xsl
. That didn't help. Could you tell me where I'm going wrong?– Poonam Anthony
Feb 20 '15 at 6:49
@euler I commented out lines 183 to 192 in discovery.xsl. As a result the action upon clicking the Item name is suppressed. Then I copied lines 505 to 524 from item-view.xsl after line 182 in
discovery.xsl
. That didn't help. Could you tell me where I'm going wrong?– Poonam Anthony
Feb 20 '15 at 6:49
You need to adjust the xpath inside the "view-open" template to apply it on the $metsDoc. There's an example right there in the code you commented out in discovery.xsl.
– Antoine Snyers
Feb 20 '15 at 15:21
You need to adjust the xpath inside the "view-open" template to apply it on the $metsDoc. There's an example right there in the code you commented out in discovery.xsl.
– Antoine Snyers
Feb 20 '15 at 15:21
|
show 4 more comments
3 Answers
3
active
oldest
votes
The code that generates the thumbnail image is here.
https://github.com/DSpace/DSpace/blob/dspace-6_x/dspace-xmlui/src/main/webapp/themes/dri2xhtml/General-Handler.xsl#L34-L47
You could create similar logic to create an href to the original bitstream.
Look at the XML in /metadata/handle/xxx/yyy/mets.xml where xxx/yyy is your item handle. You should see the information that will point you to the original bitstream.
Hi thanks for your answer. But I didn't get Look at the XML in /metadata/handle/xxx/yyy/mets.xml where xxx/yyy is your item handle. Could you please explain. Where do I find/metadata/handle/xxx/yyy/mets.xml
– Poonam Anthony
Feb 20 '15 at 6:56
according to your screenshot, at 10.17.250.230:8080/xmlui/metadata/handle/123456789/3/mets.xml
– Antoine Snyers
Feb 20 '15 at 8:14
@AntoineSnyers what I understood is that these lines of code are used to open the file in view mode. Can these lines be of help?
– Poonam Anthony
Feb 20 '15 at 10:16
Dead link, kindly update.
– Ayuka
Mar 28 at 8:46
Link has been updated
– terrywb
Mar 28 at 14:42
add a comment
|
As was said in the comments, the xsl template to modify is the "itemSummaryList" in discovery.xsl
Replace that href value with $metsDoc//mets:FLocat[@LOCTYPE='URL']/@xlink:href"
<xsl:element name="a">
<xsl:attribute name="href">
<xsl:value-of select="$metsDoc//mets:FLocat[@LOCTYPE='URL']/@xlink:href"/>
</xsl:attribute>
<xsl:choose>
<xsl:when test="dri:list[@n=(concat($handle, ':dc.title')) and descendant::text()]">
<xsl:apply-templates select="dri:list[@n=(concat($handle, ':dc.title'))]/dri:item"/>
</xsl:when>
<xsl:otherwise>
<i18n:text>xmlui.dri2xhtml.METS-1.0.no-title</i18n:text>
</xsl:otherwise>
</xsl:choose>
</xsl:element>
I made the change which you suggested, but it didn't work. So I then replaced the href value in the corresponding line in items-list.xsl with"$metsDoc//mets:FLocat[@LOCTYPE='URL']/@xlink:href"
. Now upon clicking the file name, the same page i.e the /xmlui/discover page is getting reloaded. Maybe the link is not getting resolved properly.
– Poonam Anthony
Feb 25 '15 at 9:36
apparently the files discovery.xsl and items-list.xsl can only access the fileGrp=THUMBNAIL section of themetsDoc
. I changed this line in discovery.xsl to includefileGrpTypes=ORIGINAL,THUMBNAIL
and also made similar change to this line in common.xsl. But it still doesn't read the xpath. Any suggestions?
– Poonam Anthony
Mar 2 '15 at 11:52
that should be right, could you show us the contents of the $metsDoc? (in a pastebin or something) you can view it in your browser or by doing a copy-of and inspecting the HTML of the page.
– Antoine Snyers
Mar 2 '15 at 16:39
I was able to solve the problem :) I'm posting an answer
– Poonam Anthony
Mar 7 '15 at 4:27
add a comment
|
I was able to achieve what I wanted with help from Antoine Snyers, terrywb and this link. As pointed out by terrywb the information which I needed to read, i.e, the bitstream address of the uploaded file, was stored in the metsDoc
. Here's a screenshot of my metsDoc
with the fileSec
expanded:
To be able to access the fileSec
of the metsDoc
I changed this line in discovery.xsl and this line in common.xsl to <xsl:text>?sections=dmdSec,fileSec&fileGrpTypes=ORIGINAL,THUMBNAIL</xsl:text>
.
Then I added/modified the following code to the itemSummaryList
in discovery.xsl
so that the title hyperlink now points to the file bitstream.
<xsl:variable name="filetype">
<xsl:value-of select="$metsDoc/mets:METS/mets:fileSec/mets:fileGrp[@USE='CONTENT']"/>
</xsl:variable>
<xsl:variable name="fileurl">
<xsl:value-of select="$metsDoc/mets:METS/mets:fileSec/mets:fileGrp[@USE='CONTENT']/mets:file/mets:FLocat[@LOCTYPE='URL']/@xlink:href"/>
</xsl:variable>
<div class="artifact-title">
<xsl:element name="a">
<xsl:attribute name="href">
<xsl:choose>
<xsl:when test="$metsDoc/mets:METS/mets:dmdSec/mets:mdWrap/mets:xmlData/dim:dim/@withdrawn">
<xsl:value-of select="$metsDoc/mets:METS/@OBJEDIT"/>
</xsl:when>
<xsl:when test="$filetype">
<xsl:value-of select="$fileurl"/>
</xsl:when>
</xsl:choose>
</xsl:attribute>
Similarly, I also made changes to item-list.xsl
file, and added this line <xsl:apply-templates select="mets:fileSec/mets:fileGrp[@USE='CONTENT']"
to the template
mode="itemSummaryList-DIM"/>itemSummaryList-DIM
.
So finally I got my desired result:
As visible in the inspector, the href
attribute of the title now points to the original bitstream of the file :)
add a comment
|
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f28605712%2fviewing-an-uploaded-item-in-dspace-4-2-xmlui%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
The code that generates the thumbnail image is here.
https://github.com/DSpace/DSpace/blob/dspace-6_x/dspace-xmlui/src/main/webapp/themes/dri2xhtml/General-Handler.xsl#L34-L47
You could create similar logic to create an href to the original bitstream.
Look at the XML in /metadata/handle/xxx/yyy/mets.xml where xxx/yyy is your item handle. You should see the information that will point you to the original bitstream.
Hi thanks for your answer. But I didn't get Look at the XML in /metadata/handle/xxx/yyy/mets.xml where xxx/yyy is your item handle. Could you please explain. Where do I find/metadata/handle/xxx/yyy/mets.xml
– Poonam Anthony
Feb 20 '15 at 6:56
according to your screenshot, at 10.17.250.230:8080/xmlui/metadata/handle/123456789/3/mets.xml
– Antoine Snyers
Feb 20 '15 at 8:14
@AntoineSnyers what I understood is that these lines of code are used to open the file in view mode. Can these lines be of help?
– Poonam Anthony
Feb 20 '15 at 10:16
Dead link, kindly update.
– Ayuka
Mar 28 at 8:46
Link has been updated
– terrywb
Mar 28 at 14:42
add a comment
|
The code that generates the thumbnail image is here.
https://github.com/DSpace/DSpace/blob/dspace-6_x/dspace-xmlui/src/main/webapp/themes/dri2xhtml/General-Handler.xsl#L34-L47
You could create similar logic to create an href to the original bitstream.
Look at the XML in /metadata/handle/xxx/yyy/mets.xml where xxx/yyy is your item handle. You should see the information that will point you to the original bitstream.
Hi thanks for your answer. But I didn't get Look at the XML in /metadata/handle/xxx/yyy/mets.xml where xxx/yyy is your item handle. Could you please explain. Where do I find/metadata/handle/xxx/yyy/mets.xml
– Poonam Anthony
Feb 20 '15 at 6:56
according to your screenshot, at 10.17.250.230:8080/xmlui/metadata/handle/123456789/3/mets.xml
– Antoine Snyers
Feb 20 '15 at 8:14
@AntoineSnyers what I understood is that these lines of code are used to open the file in view mode. Can these lines be of help?
– Poonam Anthony
Feb 20 '15 at 10:16
Dead link, kindly update.
– Ayuka
Mar 28 at 8:46
Link has been updated
– terrywb
Mar 28 at 14:42
add a comment
|
The code that generates the thumbnail image is here.
https://github.com/DSpace/DSpace/blob/dspace-6_x/dspace-xmlui/src/main/webapp/themes/dri2xhtml/General-Handler.xsl#L34-L47
You could create similar logic to create an href to the original bitstream.
Look at the XML in /metadata/handle/xxx/yyy/mets.xml where xxx/yyy is your item handle. You should see the information that will point you to the original bitstream.
The code that generates the thumbnail image is here.
https://github.com/DSpace/DSpace/blob/dspace-6_x/dspace-xmlui/src/main/webapp/themes/dri2xhtml/General-Handler.xsl#L34-L47
You could create similar logic to create an href to the original bitstream.
Look at the XML in /metadata/handle/xxx/yyy/mets.xml where xxx/yyy is your item handle. You should see the information that will point you to the original bitstream.
edited Mar 28 at 14:41
answered Feb 19 '15 at 16:37
terrywbterrywb
2,5751 gold badge11 silver badges31 bronze badges
2,5751 gold badge11 silver badges31 bronze badges
Hi thanks for your answer. But I didn't get Look at the XML in /metadata/handle/xxx/yyy/mets.xml where xxx/yyy is your item handle. Could you please explain. Where do I find/metadata/handle/xxx/yyy/mets.xml
– Poonam Anthony
Feb 20 '15 at 6:56
according to your screenshot, at 10.17.250.230:8080/xmlui/metadata/handle/123456789/3/mets.xml
– Antoine Snyers
Feb 20 '15 at 8:14
@AntoineSnyers what I understood is that these lines of code are used to open the file in view mode. Can these lines be of help?
– Poonam Anthony
Feb 20 '15 at 10:16
Dead link, kindly update.
– Ayuka
Mar 28 at 8:46
Link has been updated
– terrywb
Mar 28 at 14:42
add a comment
|
Hi thanks for your answer. But I didn't get Look at the XML in /metadata/handle/xxx/yyy/mets.xml where xxx/yyy is your item handle. Could you please explain. Where do I find/metadata/handle/xxx/yyy/mets.xml
– Poonam Anthony
Feb 20 '15 at 6:56
according to your screenshot, at 10.17.250.230:8080/xmlui/metadata/handle/123456789/3/mets.xml
– Antoine Snyers
Feb 20 '15 at 8:14
@AntoineSnyers what I understood is that these lines of code are used to open the file in view mode. Can these lines be of help?
– Poonam Anthony
Feb 20 '15 at 10:16
Dead link, kindly update.
– Ayuka
Mar 28 at 8:46
Link has been updated
– terrywb
Mar 28 at 14:42
Hi thanks for your answer. But I didn't get Look at the XML in /metadata/handle/xxx/yyy/mets.xml where xxx/yyy is your item handle. Could you please explain. Where do I find
/metadata/handle/xxx/yyy/mets.xml
– Poonam Anthony
Feb 20 '15 at 6:56
Hi thanks for your answer. But I didn't get Look at the XML in /metadata/handle/xxx/yyy/mets.xml where xxx/yyy is your item handle. Could you please explain. Where do I find
/metadata/handle/xxx/yyy/mets.xml
– Poonam Anthony
Feb 20 '15 at 6:56
according to your screenshot, at 10.17.250.230:8080/xmlui/metadata/handle/123456789/3/mets.xml
– Antoine Snyers
Feb 20 '15 at 8:14
according to your screenshot, at 10.17.250.230:8080/xmlui/metadata/handle/123456789/3/mets.xml
– Antoine Snyers
Feb 20 '15 at 8:14
@AntoineSnyers what I understood is that these lines of code are used to open the file in view mode. Can these lines be of help?
– Poonam Anthony
Feb 20 '15 at 10:16
@AntoineSnyers what I understood is that these lines of code are used to open the file in view mode. Can these lines be of help?
– Poonam Anthony
Feb 20 '15 at 10:16
Dead link, kindly update.
– Ayuka
Mar 28 at 8:46
Dead link, kindly update.
– Ayuka
Mar 28 at 8:46
Link has been updated
– terrywb
Mar 28 at 14:42
Link has been updated
– terrywb
Mar 28 at 14:42
add a comment
|
As was said in the comments, the xsl template to modify is the "itemSummaryList" in discovery.xsl
Replace that href value with $metsDoc//mets:FLocat[@LOCTYPE='URL']/@xlink:href"
<xsl:element name="a">
<xsl:attribute name="href">
<xsl:value-of select="$metsDoc//mets:FLocat[@LOCTYPE='URL']/@xlink:href"/>
</xsl:attribute>
<xsl:choose>
<xsl:when test="dri:list[@n=(concat($handle, ':dc.title')) and descendant::text()]">
<xsl:apply-templates select="dri:list[@n=(concat($handle, ':dc.title'))]/dri:item"/>
</xsl:when>
<xsl:otherwise>
<i18n:text>xmlui.dri2xhtml.METS-1.0.no-title</i18n:text>
</xsl:otherwise>
</xsl:choose>
</xsl:element>
I made the change which you suggested, but it didn't work. So I then replaced the href value in the corresponding line in items-list.xsl with"$metsDoc//mets:FLocat[@LOCTYPE='URL']/@xlink:href"
. Now upon clicking the file name, the same page i.e the /xmlui/discover page is getting reloaded. Maybe the link is not getting resolved properly.
– Poonam Anthony
Feb 25 '15 at 9:36
apparently the files discovery.xsl and items-list.xsl can only access the fileGrp=THUMBNAIL section of themetsDoc
. I changed this line in discovery.xsl to includefileGrpTypes=ORIGINAL,THUMBNAIL
and also made similar change to this line in common.xsl. But it still doesn't read the xpath. Any suggestions?
– Poonam Anthony
Mar 2 '15 at 11:52
that should be right, could you show us the contents of the $metsDoc? (in a pastebin or something) you can view it in your browser or by doing a copy-of and inspecting the HTML of the page.
– Antoine Snyers
Mar 2 '15 at 16:39
I was able to solve the problem :) I'm posting an answer
– Poonam Anthony
Mar 7 '15 at 4:27
add a comment
|
As was said in the comments, the xsl template to modify is the "itemSummaryList" in discovery.xsl
Replace that href value with $metsDoc//mets:FLocat[@LOCTYPE='URL']/@xlink:href"
<xsl:element name="a">
<xsl:attribute name="href">
<xsl:value-of select="$metsDoc//mets:FLocat[@LOCTYPE='URL']/@xlink:href"/>
</xsl:attribute>
<xsl:choose>
<xsl:when test="dri:list[@n=(concat($handle, ':dc.title')) and descendant::text()]">
<xsl:apply-templates select="dri:list[@n=(concat($handle, ':dc.title'))]/dri:item"/>
</xsl:when>
<xsl:otherwise>
<i18n:text>xmlui.dri2xhtml.METS-1.0.no-title</i18n:text>
</xsl:otherwise>
</xsl:choose>
</xsl:element>
I made the change which you suggested, but it didn't work. So I then replaced the href value in the corresponding line in items-list.xsl with"$metsDoc//mets:FLocat[@LOCTYPE='URL']/@xlink:href"
. Now upon clicking the file name, the same page i.e the /xmlui/discover page is getting reloaded. Maybe the link is not getting resolved properly.
– Poonam Anthony
Feb 25 '15 at 9:36
apparently the files discovery.xsl and items-list.xsl can only access the fileGrp=THUMBNAIL section of themetsDoc
. I changed this line in discovery.xsl to includefileGrpTypes=ORIGINAL,THUMBNAIL
and also made similar change to this line in common.xsl. But it still doesn't read the xpath. Any suggestions?
– Poonam Anthony
Mar 2 '15 at 11:52
that should be right, could you show us the contents of the $metsDoc? (in a pastebin or something) you can view it in your browser or by doing a copy-of and inspecting the HTML of the page.
– Antoine Snyers
Mar 2 '15 at 16:39
I was able to solve the problem :) I'm posting an answer
– Poonam Anthony
Mar 7 '15 at 4:27
add a comment
|
As was said in the comments, the xsl template to modify is the "itemSummaryList" in discovery.xsl
Replace that href value with $metsDoc//mets:FLocat[@LOCTYPE='URL']/@xlink:href"
<xsl:element name="a">
<xsl:attribute name="href">
<xsl:value-of select="$metsDoc//mets:FLocat[@LOCTYPE='URL']/@xlink:href"/>
</xsl:attribute>
<xsl:choose>
<xsl:when test="dri:list[@n=(concat($handle, ':dc.title')) and descendant::text()]">
<xsl:apply-templates select="dri:list[@n=(concat($handle, ':dc.title'))]/dri:item"/>
</xsl:when>
<xsl:otherwise>
<i18n:text>xmlui.dri2xhtml.METS-1.0.no-title</i18n:text>
</xsl:otherwise>
</xsl:choose>
</xsl:element>
As was said in the comments, the xsl template to modify is the "itemSummaryList" in discovery.xsl
Replace that href value with $metsDoc//mets:FLocat[@LOCTYPE='URL']/@xlink:href"
<xsl:element name="a">
<xsl:attribute name="href">
<xsl:value-of select="$metsDoc//mets:FLocat[@LOCTYPE='URL']/@xlink:href"/>
</xsl:attribute>
<xsl:choose>
<xsl:when test="dri:list[@n=(concat($handle, ':dc.title')) and descendant::text()]">
<xsl:apply-templates select="dri:list[@n=(concat($handle, ':dc.title'))]/dri:item"/>
</xsl:when>
<xsl:otherwise>
<i18n:text>xmlui.dri2xhtml.METS-1.0.no-title</i18n:text>
</xsl:otherwise>
</xsl:choose>
</xsl:element>
answered Feb 24 '15 at 7:40
Antoine SnyersAntoine Snyers
6043 silver badges7 bronze badges
6043 silver badges7 bronze badges
I made the change which you suggested, but it didn't work. So I then replaced the href value in the corresponding line in items-list.xsl with"$metsDoc//mets:FLocat[@LOCTYPE='URL']/@xlink:href"
. Now upon clicking the file name, the same page i.e the /xmlui/discover page is getting reloaded. Maybe the link is not getting resolved properly.
– Poonam Anthony
Feb 25 '15 at 9:36
apparently the files discovery.xsl and items-list.xsl can only access the fileGrp=THUMBNAIL section of themetsDoc
. I changed this line in discovery.xsl to includefileGrpTypes=ORIGINAL,THUMBNAIL
and also made similar change to this line in common.xsl. But it still doesn't read the xpath. Any suggestions?
– Poonam Anthony
Mar 2 '15 at 11:52
that should be right, could you show us the contents of the $metsDoc? (in a pastebin or something) you can view it in your browser or by doing a copy-of and inspecting the HTML of the page.
– Antoine Snyers
Mar 2 '15 at 16:39
I was able to solve the problem :) I'm posting an answer
– Poonam Anthony
Mar 7 '15 at 4:27
add a comment
|
I made the change which you suggested, but it didn't work. So I then replaced the href value in the corresponding line in items-list.xsl with"$metsDoc//mets:FLocat[@LOCTYPE='URL']/@xlink:href"
. Now upon clicking the file name, the same page i.e the /xmlui/discover page is getting reloaded. Maybe the link is not getting resolved properly.
– Poonam Anthony
Feb 25 '15 at 9:36
apparently the files discovery.xsl and items-list.xsl can only access the fileGrp=THUMBNAIL section of themetsDoc
. I changed this line in discovery.xsl to includefileGrpTypes=ORIGINAL,THUMBNAIL
and also made similar change to this line in common.xsl. But it still doesn't read the xpath. Any suggestions?
– Poonam Anthony
Mar 2 '15 at 11:52
that should be right, could you show us the contents of the $metsDoc? (in a pastebin or something) you can view it in your browser or by doing a copy-of and inspecting the HTML of the page.
– Antoine Snyers
Mar 2 '15 at 16:39
I was able to solve the problem :) I'm posting an answer
– Poonam Anthony
Mar 7 '15 at 4:27
I made the change which you suggested, but it didn't work. So I then replaced the href value in the corresponding line in items-list.xsl with
"$metsDoc//mets:FLocat[@LOCTYPE='URL']/@xlink:href"
. Now upon clicking the file name, the same page i.e the /xmlui/discover page is getting reloaded. Maybe the link is not getting resolved properly.– Poonam Anthony
Feb 25 '15 at 9:36
I made the change which you suggested, but it didn't work. So I then replaced the href value in the corresponding line in items-list.xsl with
"$metsDoc//mets:FLocat[@LOCTYPE='URL']/@xlink:href"
. Now upon clicking the file name, the same page i.e the /xmlui/discover page is getting reloaded. Maybe the link is not getting resolved properly.– Poonam Anthony
Feb 25 '15 at 9:36
apparently the files discovery.xsl and items-list.xsl can only access the fileGrp=THUMBNAIL section of the
metsDoc
. I changed this line in discovery.xsl to include fileGrpTypes=ORIGINAL,THUMBNAIL
and also made similar change to this line in common.xsl. But it still doesn't read the xpath. Any suggestions?– Poonam Anthony
Mar 2 '15 at 11:52
apparently the files discovery.xsl and items-list.xsl can only access the fileGrp=THUMBNAIL section of the
metsDoc
. I changed this line in discovery.xsl to include fileGrpTypes=ORIGINAL,THUMBNAIL
and also made similar change to this line in common.xsl. But it still doesn't read the xpath. Any suggestions?– Poonam Anthony
Mar 2 '15 at 11:52
that should be right, could you show us the contents of the $metsDoc? (in a pastebin or something) you can view it in your browser or by doing a copy-of and inspecting the HTML of the page.
– Antoine Snyers
Mar 2 '15 at 16:39
that should be right, could you show us the contents of the $metsDoc? (in a pastebin or something) you can view it in your browser or by doing a copy-of and inspecting the HTML of the page.
– Antoine Snyers
Mar 2 '15 at 16:39
I was able to solve the problem :) I'm posting an answer
– Poonam Anthony
Mar 7 '15 at 4:27
I was able to solve the problem :) I'm posting an answer
– Poonam Anthony
Mar 7 '15 at 4:27
add a comment
|
I was able to achieve what I wanted with help from Antoine Snyers, terrywb and this link. As pointed out by terrywb the information which I needed to read, i.e, the bitstream address of the uploaded file, was stored in the metsDoc
. Here's a screenshot of my metsDoc
with the fileSec
expanded:
To be able to access the fileSec
of the metsDoc
I changed this line in discovery.xsl and this line in common.xsl to <xsl:text>?sections=dmdSec,fileSec&fileGrpTypes=ORIGINAL,THUMBNAIL</xsl:text>
.
Then I added/modified the following code to the itemSummaryList
in discovery.xsl
so that the title hyperlink now points to the file bitstream.
<xsl:variable name="filetype">
<xsl:value-of select="$metsDoc/mets:METS/mets:fileSec/mets:fileGrp[@USE='CONTENT']"/>
</xsl:variable>
<xsl:variable name="fileurl">
<xsl:value-of select="$metsDoc/mets:METS/mets:fileSec/mets:fileGrp[@USE='CONTENT']/mets:file/mets:FLocat[@LOCTYPE='URL']/@xlink:href"/>
</xsl:variable>
<div class="artifact-title">
<xsl:element name="a">
<xsl:attribute name="href">
<xsl:choose>
<xsl:when test="$metsDoc/mets:METS/mets:dmdSec/mets:mdWrap/mets:xmlData/dim:dim/@withdrawn">
<xsl:value-of select="$metsDoc/mets:METS/@OBJEDIT"/>
</xsl:when>
<xsl:when test="$filetype">
<xsl:value-of select="$fileurl"/>
</xsl:when>
</xsl:choose>
</xsl:attribute>
Similarly, I also made changes to item-list.xsl
file, and added this line <xsl:apply-templates select="mets:fileSec/mets:fileGrp[@USE='CONTENT']"
to the template
mode="itemSummaryList-DIM"/>itemSummaryList-DIM
.
So finally I got my desired result:
As visible in the inspector, the href
attribute of the title now points to the original bitstream of the file :)
add a comment
|
I was able to achieve what I wanted with help from Antoine Snyers, terrywb and this link. As pointed out by terrywb the information which I needed to read, i.e, the bitstream address of the uploaded file, was stored in the metsDoc
. Here's a screenshot of my metsDoc
with the fileSec
expanded:
To be able to access the fileSec
of the metsDoc
I changed this line in discovery.xsl and this line in common.xsl to <xsl:text>?sections=dmdSec,fileSec&fileGrpTypes=ORIGINAL,THUMBNAIL</xsl:text>
.
Then I added/modified the following code to the itemSummaryList
in discovery.xsl
so that the title hyperlink now points to the file bitstream.
<xsl:variable name="filetype">
<xsl:value-of select="$metsDoc/mets:METS/mets:fileSec/mets:fileGrp[@USE='CONTENT']"/>
</xsl:variable>
<xsl:variable name="fileurl">
<xsl:value-of select="$metsDoc/mets:METS/mets:fileSec/mets:fileGrp[@USE='CONTENT']/mets:file/mets:FLocat[@LOCTYPE='URL']/@xlink:href"/>
</xsl:variable>
<div class="artifact-title">
<xsl:element name="a">
<xsl:attribute name="href">
<xsl:choose>
<xsl:when test="$metsDoc/mets:METS/mets:dmdSec/mets:mdWrap/mets:xmlData/dim:dim/@withdrawn">
<xsl:value-of select="$metsDoc/mets:METS/@OBJEDIT"/>
</xsl:when>
<xsl:when test="$filetype">
<xsl:value-of select="$fileurl"/>
</xsl:when>
</xsl:choose>
</xsl:attribute>
Similarly, I also made changes to item-list.xsl
file, and added this line <xsl:apply-templates select="mets:fileSec/mets:fileGrp[@USE='CONTENT']"
to the template
mode="itemSummaryList-DIM"/>itemSummaryList-DIM
.
So finally I got my desired result:
As visible in the inspector, the href
attribute of the title now points to the original bitstream of the file :)
add a comment
|
I was able to achieve what I wanted with help from Antoine Snyers, terrywb and this link. As pointed out by terrywb the information which I needed to read, i.e, the bitstream address of the uploaded file, was stored in the metsDoc
. Here's a screenshot of my metsDoc
with the fileSec
expanded:
To be able to access the fileSec
of the metsDoc
I changed this line in discovery.xsl and this line in common.xsl to <xsl:text>?sections=dmdSec,fileSec&fileGrpTypes=ORIGINAL,THUMBNAIL</xsl:text>
.
Then I added/modified the following code to the itemSummaryList
in discovery.xsl
so that the title hyperlink now points to the file bitstream.
<xsl:variable name="filetype">
<xsl:value-of select="$metsDoc/mets:METS/mets:fileSec/mets:fileGrp[@USE='CONTENT']"/>
</xsl:variable>
<xsl:variable name="fileurl">
<xsl:value-of select="$metsDoc/mets:METS/mets:fileSec/mets:fileGrp[@USE='CONTENT']/mets:file/mets:FLocat[@LOCTYPE='URL']/@xlink:href"/>
</xsl:variable>
<div class="artifact-title">
<xsl:element name="a">
<xsl:attribute name="href">
<xsl:choose>
<xsl:when test="$metsDoc/mets:METS/mets:dmdSec/mets:mdWrap/mets:xmlData/dim:dim/@withdrawn">
<xsl:value-of select="$metsDoc/mets:METS/@OBJEDIT"/>
</xsl:when>
<xsl:when test="$filetype">
<xsl:value-of select="$fileurl"/>
</xsl:when>
</xsl:choose>
</xsl:attribute>
Similarly, I also made changes to item-list.xsl
file, and added this line <xsl:apply-templates select="mets:fileSec/mets:fileGrp[@USE='CONTENT']"
to the template
mode="itemSummaryList-DIM"/>itemSummaryList-DIM
.
So finally I got my desired result:
As visible in the inspector, the href
attribute of the title now points to the original bitstream of the file :)
I was able to achieve what I wanted with help from Antoine Snyers, terrywb and this link. As pointed out by terrywb the information which I needed to read, i.e, the bitstream address of the uploaded file, was stored in the metsDoc
. Here's a screenshot of my metsDoc
with the fileSec
expanded:
To be able to access the fileSec
of the metsDoc
I changed this line in discovery.xsl and this line in common.xsl to <xsl:text>?sections=dmdSec,fileSec&fileGrpTypes=ORIGINAL,THUMBNAIL</xsl:text>
.
Then I added/modified the following code to the itemSummaryList
in discovery.xsl
so that the title hyperlink now points to the file bitstream.
<xsl:variable name="filetype">
<xsl:value-of select="$metsDoc/mets:METS/mets:fileSec/mets:fileGrp[@USE='CONTENT']"/>
</xsl:variable>
<xsl:variable name="fileurl">
<xsl:value-of select="$metsDoc/mets:METS/mets:fileSec/mets:fileGrp[@USE='CONTENT']/mets:file/mets:FLocat[@LOCTYPE='URL']/@xlink:href"/>
</xsl:variable>
<div class="artifact-title">
<xsl:element name="a">
<xsl:attribute name="href">
<xsl:choose>
<xsl:when test="$metsDoc/mets:METS/mets:dmdSec/mets:mdWrap/mets:xmlData/dim:dim/@withdrawn">
<xsl:value-of select="$metsDoc/mets:METS/@OBJEDIT"/>
</xsl:when>
<xsl:when test="$filetype">
<xsl:value-of select="$fileurl"/>
</xsl:when>
</xsl:choose>
</xsl:attribute>
Similarly, I also made changes to item-list.xsl
file, and added this line <xsl:apply-templates select="mets:fileSec/mets:fileGrp[@USE='CONTENT']"
to the template
mode="itemSummaryList-DIM"/>itemSummaryList-DIM
.
So finally I got my desired result:
As visible in the inspector, the href
attribute of the title now points to the original bitstream of the file :)
answered Mar 7 '15 at 4:57
Poonam AnthonyPoonam Anthony
6731 gold badge7 silver badges24 bronze badges
6731 gold badge7 silver badges24 bronze badges
add a comment
|
add a comment
|
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f28605712%2fviewing-an-uploaded-item-in-dspace-4-2-xmlui%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
What are you thinking to do if there is none or more than one file?
– Adán
Feb 19 '15 at 12:45
Currently we're only considering items containing a single file
– Poonam Anthony
Feb 19 '15 at 14:00
1
I believe you have to edit
item-list.xsl
for browse anddiscovery.xsl
for search results.discover.xsl
by the way is found under thethemes/dri2xhtml-alt/aspect/artifactbrowser
. It will save you time during an upgrade if you'll just copy the relevant templates intoMirage.xsl
, preferably under themodules
directory mentioned here.– euler
Feb 19 '15 at 15:21
@euler I commented out lines 183 to 192 in discovery.xsl. As a result the action upon clicking the Item name is suppressed. Then I copied lines 505 to 524 from item-view.xsl after line 182 in
discovery.xsl
. That didn't help. Could you tell me where I'm going wrong?– Poonam Anthony
Feb 20 '15 at 6:49
You need to adjust the xpath inside the "view-open" template to apply it on the $metsDoc. There's an example right there in the code you commented out in discovery.xsl.
– Antoine Snyers
Feb 20 '15 at 15:21