[Dspace-tech] Manakin, collection name
Dear all, I was hoping you could help me with something. We are trying to change the item view page in our DSpace. We have been rearranging the page by changing the order of dc metadata fields and it worked wonderfully. But now we have come to a moment where we need to use the name of the collection and sometimes even the name of the subcommunity (that the item belongs to). Is there a way to access the appropriate collection name from XSL page? I see this name that I need in head trail (breadcrumbs) but that component is being made in some of the aspects. I also see the name of the collection in the bottom part (this item appears in the following collection). The code looks something like this: xsl:variable name=data select=./mets:dmdSec/mets:mdWrap/mets:xmlData/dim:dim/ a href={@OBJID} xsl:choose xsl:when test=string-length($data/dim:field[@element='title'][1]) gt; 0 xsl:value-of select=$data/dim:field[@element='title'][1]/ /xsl:when xsl:otherwise i18n:textxmlui.dri2xhtml.METS-1.0.no-title/i18n:text /xsl:otherwise /xsl:choose /a When I try to use that code snippet in item view page it doesn't show the collection name. It says Untitled. Is there something I need to change in order for this to work? Thanks ahead, Anja smime.p7s Description: S/MIME Cryptographic Signature -- Dive into the World of Parallel Programming The Go Parallel Website, sponsored by Intel and developed in partnership with Slashdot Media, is your hub for all things parallel software development, from weekly thought leadership blogs to news, videos, case studies, tutorials and more. Take a look and join the conversation now. http://goparallel.sourceforge.net/___ DSpace-tech mailing list DSpace-tech@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/dspace-tech List Etiquette: https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette
Re: [Dspace-tech] Manakin, collection name
Hi Anja :) I think you are right. Can you please give me an example how to access trail part from item-view.xsl. Until now I have only been accessing metadata fields and it was through dim:field. For example, I was using: xsl:value-of select=dim:field[@element='description'][@qualifier='tableofcontents']/child::node() /. Is there a way to access trail element in similar fashion? Thank you very much ahead, Anja On 2/26/2015 12:23 PM, Anja Le Blanc wrote: Hi Anja If you go to your item page and add '?XML' (http://[URL]/xmlui/[handle]?XML) to the URL you can see which data you can access. The content of trail... might be what you are after. Best regards, Anja smime.p7s Description: S/MIME Cryptographic Signature -- Dive into the World of Parallel Programming The Go Parallel Website, sponsored by Intel and developed in partnership with Slashdot Media, is your hub for all things parallel software development, from weekly thought leadership blogs to news, videos, case studies, tutorials and more. Take a look and join the conversation now. http://goparallel.sourceforge.net/___ DSpace-tech mailing list DSpace-tech@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/dspace-tech List Etiquette: https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette
Re: [Dspace-tech] Manakin, collection name
Hi Anja I don't know a lot about XLST ... I think the path to the data should be something like /dri:document/dri:meta/dri:pageMeta/dri:trail But I am sure there are other people on this list who can help you further. Best regards Anja -- Anja Le Blanc Software Developer University of Manchester Library On 26/02/2015 11:42, Anja Radoicic wrote: Hi Anja :) I think you are right. Can you please give me an example how to access trail part from item-view.xsl. Until now I have only been accessing metadata fields and it was through dim:field. For example, I was using: xsl:value-of select=dim:field[@element='description'][@qualifier='tableofcontents']/child::node() /. Is there a way to access trail element in similar fashion? Thank you very much ahead, Anja On 2/26/2015 12:23 PM, Anja Le Blanc wrote: Hi Anja If you go to your item page and add '?XML' (http://[URL]/xmlui/[handle]?XML) to the URL you can see which data you can access. The content of trail... might be what you are after. Best regards, Anja -- Dive into the World of Parallel Programming The Go Parallel Website, sponsored by Intel and developed in partnership with Slashdot Media, is your hub for all things parallel software development, from weekly thought leadership blogs to news, videos, case studies, tutorials and more. Take a look and join the conversation now. http://goparallel.sourceforge.net/ ___ DSpace-tech mailing list DSpace-tech@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/dspace-tech List Etiquette: https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette -- Dive into the World of Parallel Programming The Go Parallel Website, sponsored by Intel and developed in partnership with Slashdot Media, is your hub for all things parallel software development, from weekly thought leadership blogs to news, videos, case studies, tutorials and more. Take a look and join the conversation now. http://goparallel.sourceforge.net/ ___ DSpace-tech mailing list DSpace-tech@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/dspace-tech List Etiquette: https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette
Re: [Dspace-tech] Manakin, collection name
Hi Anja, save it in a variable outside any template, then you can use it even in any dim template. xsl:variable name='trail'xsl:copy-of select=/dri:document/dri:meta/dri:pageMeta/dri:trail//xsl:variable Regards, ~~helix84 Compulsory reading: DSpace Mailing List Etiquette https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette -- Dive into the World of Parallel Programming The Go Parallel Website, sponsored by Intel and developed in partnership with Slashdot Media, is your hub for all things parallel software development, from weekly thought leadership blogs to news, videos, case studies, tutorials and more. Take a look and join the conversation now. http://goparallel.sourceforge.net/___ DSpace-tech mailing list DSpace-tech@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/dspace-tech List Etiquette: https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette
Re: [Dspace-tech] Manakin, collection name
Hi helix84 :) This helps me save the trail variable. Now I have to somehow acces the fourth or fifth element of the trail. Is there a way to do that? Also, this is just a workaround to access the collection name. Is there another way that you would suggest to get to a collection name or community name from xsl file? We are new to DSpace so your help is very much appreciated, thanks once more, Anja On 2/26/2015 12:59 PM, helix84 wrote: Hi Anja, save it in a variable outside any template, then you can use it even in any dim template. xsl:variable name='trail'xsl:copy-of select=/dri:document/dri:meta/dri:pageMeta/dri:trail//xsl:variable Regards, ~~helix84 Compulsory reading: DSpace Mailing List Etiquette https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette smime.p7s Description: S/MIME Cryptographic Signature -- Dive into the World of Parallel Programming The Go Parallel Website, sponsored by Intel and developed in partnership with Slashdot Media, is your hub for all things parallel software development, from weekly thought leadership blogs to news, videos, case studies, tutorials and more. Take a look and join the conversation now. http://goparallel.sourceforge.net/___ DSpace-tech mailing list DSpace-tech@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/dspace-tech List Etiquette: https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette
Re: [Dspace-tech] Manakin, collection name
Hi, On 27/02/15 01:16, Anja Radoicic wrote: This helps me save the trail variable. Now I have to somehow acces the fourth or fifth element of the trail. Is there a way to do that? Also, this is just a workaround to access the collection name. Is there another way that you would suggest to get to a collection name or community name from xsl file? There is, it's just one more step. Look at this item here, on the demo server: http://demo.dspace.org/xmlui/handle/10673/93 Add ?XML to look at the XML, like you did for the trail: http://demo.dspace.org/xmlui/handle/10673/93?XML Then look at this section here: referenceSet id="aspect.artifactbrowser.ItemViewer.referenceSet.collection-viewer" type="summaryView" n="collection-viewer" reference repositoryID="10673" type="DSpace Item" url="" referenceSet type="itemPageSummaryList" rend="hierarchy" reference repositoryID="10673" type="DSpace Collection" url=""/ /referenceSet /reference /referenceSet The hierarchy tells you which collection this item is in. It gives you the link to the collection's mets.xml. So have a look at that one http://demo.dspace.org/xmlui//metadata/handle/10673/22/mets.xml and you will see the title here: dim:field mdschema="dc" element="title"The scramble for and Partition of Africa/dim:field Now, to put this all together -- in the same spot where you are assigning the trail to a variable, instead do this: obtain the URL of the collection's mets.xml file from the snippet above load that mets file via the XSL document function (http://www.w3schools.com/xsl/func_document.asp) from the loaded document, select the title metadata (and/or whatever else you want, eg identifier for the link). then assign _that_ to a variable and pass it into item-view.xsl I hope this makes sense, I don't have time to go into more detail right now, sorry. cheers, Andrea -- Dr Andrea Schweer IRR Technical Specialist, ITS Information Systems The University of Waikato, Hamilton, New Zealand -- Dive into the World of Parallel Programming The Go Parallel Website, sponsored by Intel and developed in partnership with Slashdot Media, is your hub for all things parallel software development, from weekly thought leadership blogs to news, videos, case studies, tutorials and more. Take a look and join the conversation now. http://goparallel.sourceforge.net/___ DSpace-tech mailing list DSpace-tech@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/dspace-tech List Etiquette: https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette