getFileType()) { case 'application/pdf': case 'application/x-pdf': case 'text/pdf': case 'text/x-pdf': return true; default: return false; } } // // Get/set methods // /** * Get views count. * @return int */ function getViews() { $application = PKPApplication::getApplication(); return $application->getPrimaryMetricByAssoc(ASSOC_TYPE_ISSUE_GALLEY, $this->getId()); } /** * Get the localized value of the galley label. * @return $string */ function getGalleyLabel() { $label = $this->getLabel(); if ($this->getLocale() != AppLocale::getLocale()) { $locales = AppLocale::getAllLocales(); $label .= ' (' . $locales[$this->getLocale()] . ')'; } return $label; } /** * Get label/title. * @return string */ function getLabel() { return $this->getData('label'); } /** * Set label/title. * @param $label string */ function setLabel($label) { return $this->setData('label', $label); } /** * Get locale. * @return string */ function getLocale() { return $this->getData('locale'); } /** * Set locale. * @param $locale string */ function setLocale($locale) { return $this->setData('locale', $locale); } /** * Get sequence order. * @return float */ function getSequence() { return $this->getData('sequence'); } /** * Set sequence order. * @param $sequence float */ function setSequence($sequence) { return $this->setData('sequence', $sequence); } /** * Get file ID. * @return int */ function getFileId() { return $this->getData('fileId'); } /** * Set file ID. * @param $fileId */ function setFileId($fileId) { return $this->setData('fileId', $fileId); } /** * Get stored public ID of the galley. * @param $pubIdType string One of the NLM pub-id-type values or * 'other::something' if not part of the official NLM list * (see ). * @return string */ function getStoredPubId($pubIdType) { return $this->getData('pub-id::'.$pubIdType); } /** * Set stored public galley id. * @param $pubIdType string One of the NLM pub-id-type values or * 'other::something' if not part of the official NLM list * (see ). * @param $pubId string */ function setStoredPubId($pubIdType, $pubId) { return $this->setData('pub-id::'.$pubIdType, $pubId); } /** * Return the "best" issue galley ID -- If a public isue galley ID is set, * use it; otherwise use the internal article Id. * @return string */ function getBestGalleyId() { $publicGalleyId = $this->getStoredPubId('publisher-id'); if (!empty($publicGalleyId)) return $publicGalleyId; return $this->getId(); } /** * Get the file corresponding to this galley. * @return IssueFile */ function getFile() { if (!isset($this->_issueFile)) { $issueFileDao = DAORegistry::getDAO('IssueFileDAO'); $this->_issueFile = $issueFileDao->getById($this->getFileId()); } return $this->_issueFile; } } ?>