Skip to content

Commit

Permalink
pkp/pkp-lib#822 fix wrong URL for CLI DOI export and registration
Browse files Browse the repository at this point in the history
  • Loading branch information
bozana committed Oct 15, 2015
1 parent 787a679 commit 8f3ee8e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -451,8 +451,8 @@ function &_generateComponentListDom(&$doc, &$journal, &$article) {
* @param $galleys array
*/
function &_generateDOIdataDom(&$doc, $DOI, $url, $galleys = null) {
$journal =& $this->getJournal();
$request = Application::getRequest();
$journal = $request->getJournal();
$DOIdataNode =& XMLCustomWriter::createElement($doc, 'doi_data');
XMLCustomWriter::createChildWithText($doc, $DOIdataNode, 'doi', $DOI);
XMLCustomWriter::createChildWithText($doc, $DOIdataNode, 'resource', $url);
Expand All @@ -469,7 +469,7 @@ function &_generateDOIdataDom(&$doc, $DOI, $url, $galleys = null) {
XMLCustomWriter::appendChild($collectionNode, $itemNode);
$resourceNode = XMLCustomWriter::createElement($doc, 'resource');
XMLCustomWriter::appendChild($itemNode, $resourceNode);
$urlNode = XMLCustomWriter::createTextNode($doc, $request->url(null, 'article', 'viewFile', array($galley->getArticleId(), $galley->getBestGalleyId($journal))));
$urlNode = XMLCustomWriter::createTextNode($doc, $request->url($journal->getPath(), 'article', 'viewFile', array($galley->getArticleId(), $galley->getBestGalleyId($journal))));
XMLCustomWriter::appendChild($resourceNode, $urlNode);
}
// end iParadigms
Expand All @@ -484,7 +484,7 @@ function &_generateDOIdataDom(&$doc, $DOI, $url, $galleys = null) {
$resourceNode = XMLCustomWriter::createElement($doc, 'resource');
XMLCustomWriter::appendChild($itemNode, $resourceNode);
XMLCustomWriter::setAttribute($resourceNode, 'mime_type', $galley->getFileType());
$urlNode = XMLCustomWriter::createTextNode($doc, $request->url(null, 'article', 'viewFile', array($galley->getArticleId(), $galley->getBestGalleyId($journal))));
$urlNode = XMLCustomWriter::createTextNode($doc, $request->url($journal->getPath(), 'article', 'viewFile', array($galley->getArticleId(), $galley->getBestGalleyId($journal))));
XMLCustomWriter::appendChild($resourceNode, $urlNode);
}
// end text-mining
Expand Down
8 changes: 4 additions & 4 deletions plugins/importexport/datacite/DataciteExportPlugin.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -383,19 +383,19 @@ function _getObjectUrl(&$request, &$journal, &$object) {
$url = null;
switch (true) {
case is_a($object, 'Issue'):
$url = $router->url($request, null, 'issue', 'view', $object->getBestIssueId($journal));
$url = $router->url($request, $journal->getPath(), 'issue', 'view', $object->getBestIssueId($journal));
break;

case is_a($object, 'PublishedArticle'):
$url = $router->url($request, null, 'article', 'view', $object->getBestArticleId($journal));
$url = $router->url($request, $journal->getPath(), 'article', 'view', $object->getBestArticleId($journal));
break;

case is_a($object, 'ArticleGalley'):
$url = $router->url($request, null, 'article', 'view', array($article->getBestArticleId($journal), $object->getBestGalleyId($journal)));
$url = $router->url($request, $journal->getPath(), 'article', 'view', array($article->getBestArticleId($journal), $object->getBestGalleyId($journal)));
break;

case is_a($object, 'SuppFile'):
$url = $router->url($request, null, 'article', 'downloadSuppFile', array($article->getBestArticleId($journal), $object->getBestSuppFileId($journal)));
$url = $router->url($request, $journal->getPath(), 'article', 'downloadSuppFile', array($article->getBestArticleId($journal), $object->getBestSuppFileId($journal)));
break;
}

Expand Down
6 changes: 3 additions & 3 deletions plugins/importexport/medra/classes/O4DOIExportDom.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -447,15 +447,15 @@ function &_objectElement(&$object) {
switch ($this->_getSchema()) {
case O4DOI_ISSUE_AS_WORK:
case O4DOI_ISSUE_AS_MANIFESTATION:
$url = $router->url($request, null, 'issue', 'view', $issue->getBestIssueId($journal));
$url = $router->url($request, $journal->getPath(), 'issue', 'view', $issue->getBestIssueId($journal));
break;

case O4DOI_ARTICLE_AS_WORK:
$url = $router->url($request, null, 'article', 'view', $article->getBestArticleId($journal));
$url = $router->url($request, $journal->getPath(), 'article', 'view', $article->getBestArticleId($journal));
break;

case O4DOI_ARTICLE_AS_MANIFESTATION:
$url = $router->url($request, null, 'article', 'view', array($article->getBestArticleId($journal), $galley->getBestGalleyId($journal)));
$url = $router->url($request, $journal->getPath(), 'article', 'view', array($article->getBestArticleId($journal), $galley->getBestGalleyId($journal)));
break;
}
assert(!empty($url));
Expand Down

0 comments on commit 8f3ee8e

Please sign in to comment.