Re: [Dspace-tech] Scopus Citations Count Integration
Hello Solomon, I'm sorry if I can't pinpoint what's causing that error but here's what I did in our repository. In your item-view.xsl, locate this line of code: xsl:template name=itemSummaryView-DIM !-- Generate the info about the item from the metadata section -- xsl:apply-templates select=./mets:dmdSec/mets:mdWrap[@OTHERMDTYPE='DIM']/mets:xmlData/dim:dim mode=itemSummaryView-DIM/ After that piece of code, copy paste these javascript code: script type=text/javascript xsl:text disable-output-escaping=yes document.write('lt;script type=text/javascript src= http://api.elsevier.com/javascript/scopussearch.jspgt; lt;/' + 'scriptgt;'); callbackCitedbycount = function(){ if (sciverse.areSearchResultsValid()) { var resultObj = sciverse.getSearchResults(); if (resultObj.returnedResults gt;0) { citedbycount = resultObj.results[0].citedbycount; eid = resultObj.results[0].eid; if (citedbycount gt; 0) { citeHtml = 'lt;span class=boldgt;Cited:lt;/spangt; '; if (eid != null) { citeHtml += 'lt;a href= http://www.scopus.com/scopus/search/submit/citedby.url?src=samp;origin=recordpageamp;eid= '; citeHtml += eid; citeHtml += ' class=citing-link target=_new title=View citing articles in Scopusgt;'; citeHtml += citedbycount; citeHtml += 'lt;/agt;#160;times in lt;span class=boldgt;Scopuslt;/spangt;'; } articleLink = resultObj.results[0].inwardurl; if (articleLink != null) { citeHtml += '#160;#160;lt;smallgt;(lt;a href='; citeHtml += articleLink; citeHtml += ' class=article-link target=_new title=View record in Scopus gt;'; citeHtml += 'View record in Scopus'; citeHtml += 'lt;/agt;)lt;/smallgt;'; } /xsl:text var citecountsScopus = $(#citecounts-scopus); citecountsScopus.html(citeHtml); citecountsScopus.removeClass('hidden'); citecountsScopus.show('blind'); $(#citecounts-scopus a.citing-link).click(function(){ if (_gaq != null) { _gaq.push(['_trackEvent', 'Citecount links','Scopus citing items','xsl:value-of select=./mets:dmdSec/mets:mdWrap[@OTHERMDTYPE='DIM']/mets:xmlData/dim:dim/dim:field[@element='identifier' and @qualifier='uri']/']); } }); $(#citecounts-scopus a.article-link).click(function(){ if (_gaq) { _gaq.push(['_trackEvent','Citecount links','Scopus article','xsl:value-of select=./mets:dmdSec/mets:mdWrap[@OTHERMDTYPE='DIM']/mets:xmlData/dim:dim/dim:field[@element='identifier' and @qualifier='uri']/']); } }); } } } } runSearch = function() { //setting defaults sciverse.setApiKey(*REPLACE-THIS-WITH-YOUR-SCOPUS-API-KEY*); sciverse.setCallback(callbackCitedbycount); //setting search query xsl:text disable-output-escaping=yesvar strQuery = DOI(/xsl:textxsl:value-of select=./mets:dmdSec/mets:mdWrap[@OTHERMDTYPE='DIM']/mets:xmlData/dim:dim/dim:field[@element='identifier' and @qualifier='doi']/xsl:text disable-output-escaping=yes); var varSearchObj = new searchObj(); varSearchObj.setSearch(strQuery); varSearchObj.setNumResults('1'); //launching search try { sciverse.runSearch(varSearchObj); } catch(err) { } }; runAfterJSImports.add(runSearch); /xsl:text /script And then paste the code in *bold* where you want the scopus citation count to appear. In our case, I put it under the citation field (I assumed that you already knew how to customize what fields to display in simple item view): !-- Citation row -- xsl:when test=$clause = 9 and (dim:field[@element='identifier' and @qualifier='citation' and descendant::text()]) *div id=citecounts-scopus class=simple-item-view-other citecounts hidden#160;/div* Hoped this helps, P.S. Please take note that I have created a custom tag, dc.identifier.doi that holds the value for the item's DOI (without the http://dx.doi.org/).
Re: [Dspace-tech] Scopus Citations Count Integration
Hi Nemiz Thanks very much for sharing your code, it's working now. Regards Solomon Nemiz, Elvi esne...@seafdec.org.ph 2014/02/13 03:59 PM Hello Solomon, I'm sorry if I can't pinpoint what's causing that error but here's what I did in our repository. In your item-view.xsl, locate this line of code: xsl:template name=itemSummaryView-DIM !-- Generate the info about the item from the metadata section -- xsl:apply-templates select=./mets:dmdSec/mets:mdWrap[@OTHERMDTYPE='DIM']/mets:xmlData/dim:dim mode=itemSummaryView-DIM/ After that piece of code, copy paste these javascript code: script type=text/javascript xsl:text disable-output-escaping=yes document.write('lt;script type=text/javascript src=http://api.elsevier.com/javascript/scopussearch.jspgt; lt;/' + 'scriptgt;'); callbackCitedbycount = function(){ if (sciverse.areSearchResultsValid()) { var resultObj = sciverse.getSearchResults(); if (resultObj.returnedResults gt;0) { citedbycount = resultObj.results[0].citedbycount; eid = resultObj.results[0].eid; if (citedbycount gt; 0) { citeHtml = 'lt;span class=boldgt;Cited:lt;/spangt; '; if (eid != null) { citeHtml += 'lt;a href=http://www.scopus.com/scopus/search/submit/citedby.url?src=samp;origin=recordpageamp;eid= ( http://www.scopus.com/scopus/search/submit/citedby.url?src=samp;origin=recordpageamp;eid= )'; citeHtml += eid; citeHtml += ' class=citing-link target=_new title=View citing articles in Scopusgt;'; citeHtml += citedbycount; citeHtml += 'lt;/agt;#160;times in lt;span class=boldgt;Scopuslt;/spangt;'; } articleLink = resultObj.results[0].inwardurl; if (articleLink != null) { citeHtml += '#160;#160;lt;smallgt;(lt;a href='; citeHtml += articleLink; citeHtml += ' class=article-link target=_new title=View record in Scopus gt;'; citeHtml += 'View record in Scopus'; citeHtml += 'lt;/agt;)lt;/smallgt;'; } /xsl:text var citecountsScopus = $(#citecounts-scopus); citecountsScopus.html(citeHtml); citecountsScopus.removeClass('hidden'); citecountsScopus.show('blind'); $(#citecounts-scopus a.citing-link).click(function(){ if (_gaq != null) { _gaq.push(['_trackEvent', 'Citecount links','Scopus citing items','xsl:value-of select=./mets:dmdSec/mets:mdWrap[@OTHERMDTYPE='DIM']/mets:xmlData/dim:dim/dim:field[@element='identifier' and @qualifier='uri']/']); } }); $(#citecounts-scopus a.article-link).click(function(){ if (_gaq) { _gaq.push(['_trackEvent','Citecount links','Scopus article','xsl:value-of select=./mets:dmdSec/mets:mdWrap[@OTHERMDTYPE='DIM']/mets:xmlData/dim:dim/dim:field[@element='identifier' and @qualifier='uri']/']); } }); } } } } runSearch = function() { //setting defaults sciverse.setApiKey(REPLACE-THIS-WITH-YOUR-SCOPUS-API-KEY); sciverse.setCallback(callbackCitedbycount); //setting search query xsl:text disable-output-escaping=yesvar strQuery = DOI(/xsl:textxsl:value-of select=./mets:dmdSec/mets:mdWrap[@OTHERMDTYPE='DIM']/mets:xmlData/dim:dim/dim:field[@element='identifier' and @qualifier='doi']/xsl:text disable-output-escaping=yes); var varSearchObj = new searchObj(); varSearchObj.setSearch(strQuery); varSearchObj.setNumResults('1'); //launching search try { sciverse.runSearch(varSearchObj); } catch(err) { } }; runAfterJSImports.add(runSearch); /xsl:text /script And then paste the code in bold where you want the scopus citation count to appear. In our case, I put it under the citation field (I assumed that you already knew how to customize what fields to display in simple item view): !-- Citation row -- xsl:when test=$clause = 9 and (dim:field[@element='identifier' and @qualifier='citation' and descendant::text()]) div id=citecounts-scopus class=simple-item-view-other citecounts hidden#160;/div Hoped this helps, P.S. Please take note that I have created a custom tag, dc.identifier.doi that holds the value for the item's DOI (without the http://dx.doi.org/). Feel free to 'view page source' items in our repository that have DOIs for example: http://repository.seafdec.org.ph/handle/10862/1737 for your reference. Regards, Elvi On Thu, Feb 13, 2014 at 9:07 PM, Solomon Kapfunde skapfu...@uwc.ac.za wrote: Hi Elvi This is out of the discussion forum, I have copied the code as you say in the link but I can't get it to run as it give me errors on all hyerplink tags in the script as stated in the error below. When I add the code in item-view.xml, mirage theme, xmlui i get an error 'javax.xml.transform.TransformerException: a is not allowed in this position in the stylesheet! Can you help? Regards Solomon Nemiz, Elvi esne...@seafdec.org.ph 2014/02/12 03:48 PM Hello Solomon, Perhaps this thread might help you. http://dspace.2283337.n4.nabble.com/Scopus-Integration-Cited-By-Count-API-td4667632.html. Regards, Elvi -- Android apps run on BlackBerry 10 Introducing the new BlackBerry 10.2.1 Runtime for Android apps. Now with support for Jelly Bean, Bluetooth, Mapview
[Dspace-tech] Scopus Citations Count Integration
Hi Colleagues I am trying to display scopus citation counts in our repository and found the following code to begin with: https://gist.github.com/aschweer/6772579 When I add the code in item-view.xml, mirage theme, xmlui i get an error 'javax.xml.transform.TransformerException: a is not allowed in this position in the stylesheet!' Here is a snippet of my snippet of the code I am testing with, has anyone ever deployed it in their server: script type=text/javascript src=http://api.elsevier.com/javascript/scopussearch.jsp; /script script type=text/javascript xsl:text var strQuery = DOI(/xsl:textxsl:value-of select=dim:field[@element='identifier' and @qualifier='doi']/xsl:text disable-output-escaping=yes); callbackCitedbycount = function(){ if (sciverse.areSearchResultsValid()) { var resultObj = sciverse.getSearchResults(); if (resultObj.returnedResults 0) { citedbycount = resultObj.results[0].citedbycount; eid = resultObj.results[0].eid; if (citedbycount 0) { citeHtml = 'Scopus times cited'; if (eid != null) { citeHtml += 'a href=http://www.scopus.com/scopus/search/submit/citedby.url?src=sorigin=recordpageeid=' ( http://www.scopus.com/scopus/search/submit/citedby.url?src=sorigin=recordpageeid=' ); citeHtml += eid; citeHtml += ' class=citing-link target=_new title=View citing articles in Scopus'; citeHtml += citedbycount; citeHtml += '/a'; } articleLink = resultObj.results[0].inwardurl; if (articleLink != null) { citeHtml += ' small(a href='; citeHtml += articleLink; citeHtml += ' class=article-link target=_new title=View record in Scopus '; citeHtml += 'View record in Scopus'; citeHtml += '/a)/small'; } $(#citecounts-scopus).html(citeHtml); $(#citecounts-scopus).removeClass('hidden'); $(#citecounts-scopus).show('blind'); $(#citecounts-scopus a.citing-link).click(function(){ if (_gaq != null) { _gaq.push(['_trackEvent', 'Citecount links', 'Scopus citing items', 'http://hdl.handle.net/10566/707']); } }); $(#citecounts-scopus a.article-link).click(function(){ if (_gaq) { _gaq.push(['_trackEvent', 'Citecount links', 'Scopus article', 'http://hdl.handle.net/10566/707']); } }); } } } }; runSearch = function() { //setting defaults sciverse.setApiKey([MfNDmWCAIjZPVC2tStf8OOlrAGWO3N]); sciverse.setCallback(callbackCitedbycount); //setting search query // var strQuery = DOI(10.1002/rra.2609); var varSearchObj = new searchObj(); varSearchObj.setSearch(strQuery); varSearchObj.setNumResults('1'); //launching search try { sciverse.runSearch(varSearchObj); } catch(err) { } }; runAfterJSImports.add(runSearch);]] /xsl:text /script Regards Solomon -- Android apps run on BlackBerry 10 Introducing the new BlackBerry 10.2.1 Runtime for Android apps. Now with support for Jelly Bean, Bluetooth, Mapview and more. Get your Android app in front of a whole new audience. Start now. http://pubads.g.doubleclick.net/gampad/clk?id=124407151iu=/4140/ostg.clktrk___ 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] Scopus Citations Count Integration
Hello Solomon, Perhaps this thread might help you. http://dspace.2283337.n4.nabble.com/Scopus-Integration-Cited-By-Count-API-td4667632.html . Regards, Elvi -- Android apps run on BlackBerry 10 Introducing the new BlackBerry 10.2.1 Runtime for Android apps. Now with support for Jelly Bean, Bluetooth, Mapview and more. Get your Android app in front of a whole new audience. Start now. http://pubads.g.doubleclick.net/gampad/clk?id=124407151iu=/4140/ostg.clktrk___ 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