To map a URL to the code, look in the “pages” folder for the RESTful object, here “articles”. The index.php there indicates that all of the article operations (including viewFile and download) are resolved by the ArticleHandler:
Looking at the ArticleHandler, you’ll find a method for each of these operations:
function viewArticle($args, &$request) {
// This function is deprecated since the Reading Tools frameset was removed.
return $this->view($args, $request);
}
/**
* View a file (inlines file).
* @param $args array ($articleId, $galleyId, $fileId [optional])
* @param $request Request
*/
function viewFile($args, &$request) {
$articleId = isset($args[0]) ? $args[0] : 0;
$galleyId = isset($args[1]) ? $args[1] : 0;
$fileId = isset($args[2]) ? (int) $args[2] : 0;
$this->validate($request, $articleId, $galleyId);
$journal =& $this->journal;
$issue =& $this->issue;
$article =& $this->article;
$galleyDao =& DAORegistry::getDAO('ArticleGalleyDAO');
import('classes.submission.common.Action');
Action::viewFile($article->getId(), $fileId);
}
}
/**
* Downloads the document
* @param $args array
* @param $request Request
*/
function download($args, &$request) {
$articleId = isset($args[0]) ? $args[0] : 0;
$galleyId = isset($args[1]) ? $args[1] : 0;
$this->validate($request, $articleId, $galleyId);
$journal =& $this->journal;
$issue =& $this->issue;
$article =& $this->article;
$galleyDao =& DAORegistry::getDAO('ArticleGalleyDAO');
if ($journal->getSetting('enablePublicGalleyId')) {
$galley =& $galleyDao->getGalleyByBestGalleyId($galleyId, $article->getId());
The first parameter, as you note, is the $articleId. The second is the $galleyId.
1 Like