Bug 2800 - Google Scholar XML file has wrong links for pdf articles
Google Scholar XML file has wrong links for pdf articles
Status: RESOLVED FIXED
Product: OJS
Classification: Unclassified
Component: Plug-ins
2.2
All All
: P1 normal
Assigned To: PKP Support
http://pkp.sfu.ca/cvs/cvsweb.cgi/ojs2...
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2007-04-12 18:24 PDT by Martin J. Osborne
Modified: 2007-05-25 11:24 PDT (History)
0 users

See Also:
Version Reported In:
Also Affects:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin J. Osborne 2007-04-12 18:24:05 PDT
I *think* that the line

XMLCustomWriter::setAttribute($galleyUriNode, 'xlink:href', Request::url(null, 'article', 'viewArticle', array($publishedArticle->getArticleId(), $galley->getGalleyId())));

in GoogleScholarPlugin.inc.php should have 'view', not 'viewArticle'.  The earlier line, for the $canonicalUriNode, is correct, but 'viewArticle' is works only for an HTML file (if I understand correctly), whereas 'view' directs either to viewArticle or viewPDFInterstitial, as appropriate.  Alternatively the line could be

XMLCustomWriter::setAttribute($galleyUriNode, 'xlink:href', Request::url(null, 'article', 'viewFile', array($publishedArticle->getArticleId(), $galley->getFileId())));

if you want Google users to skip the interstitial.  (That's what I've done for TE, though perhaps it isn't consistent with the OJS philosophy; it just seems to me that given the millions of direct links to pdf files on Google Scholar there isn't much point in wasting a second of every user's time flashing up the interstitial page.)

In fact, I also use $publishedArticle->getPublicArticleId() (public article ids are enabled for TE) instead of $publishedArticle->getArticleId(), but from the code it seems that the ArticleId will work even when public article ids are enabled.
Comment 1 Alec Smecher 2007-04-13 09:36:22 PDT
Note to me: Double-check with Google Scholar how direct links to PDFs will be handled.
Comment 2 Martin J. Osborne 2007-04-13 09:51:48 PDT
As your message in the Support Forum points out, my claim that "Alternatively
the line could be

XMLCustomWriter::setAttribute($galleyUriNode, 'xlink:href', Request::url(null,
'article', 'viewFile', array($publishedArticle->getArticleId(),
$galley->getFileId())));"

is false---because this will work only for pdf files.
Comment 3 Alec Smecher 2007-05-25 11:24:38 PDT
Fixed.