/** * Create and return a submission node. * @param $doc DOMDocument * @param $submission Submission * @return DOMElement */ function createSubmissionNode($doc, $submission) { $deployment = $this->getDeployment(); $submissionNode = parent::createSubmissionNode($doc, $submission); // Add the series, if one is designated. if ($sectionId = $submission->getSectionId()) { $sectionDao = DAORegistry::getDAO('SectionDAO'); $section = $sectionDao->getById($sectionId, $submission->getContextId()); assert(isset($section)); $submissionNode->setAttribute('section_ref', $section->getLocalizedAbbrev()); } $publishedArticleDao = DAORegistry::getDAO('PublishedArticleDAO'); $publishedArticle = $publishedArticleDao->getPublishedArticleByArticleId($submission->getId()); $publishedArticle ? $submissionNode->setAttribute('seq', $publishedArticle->getSequence()) : $submissionNode->setAttribute('seq', '0'); $publishedArticle ? $submissionNode->setAttribute('access_status', $publishedArticle->getAccessStatus()) : $submissionNode->setAttribute('access_status', '0'); // if this is a published article and not part/subelement of an issue element // add issue identification element if ($publishedArticle && !$deployment->getIssue()) { $issueDao = DAORegistry::getDAO('IssueDAO'); $issue = $issueDao->getById($publishedArticle->getIssueId()); import('plugins.importexport.native.filter.NativeFilterHelper'); $nativeFilterHelper = new NativeFilterHelper(); $submissionNode->appendChild($nativeFilterHelper->createIssueIdentificationNode($this, $doc, $issue)); } $pages = $submission->getPages(); if (!empty($pages)) { $submissionNode->appendChild($node = $doc->createElementNS($deployment->getNamespace(), 'pages', htmlspecialchars($pages, ENT_COMPAT, 'UTF-8'))); } return $submissionNode; }
/** * Create and return an issue node. * @param $doc DOMDocument * @param $issue Issue * @return DOMElement */ function createIssueNode($doc, $issue) { // Create the root node and attributes $deployment = $this->getDeployment(); $deployment->setIssue($issue); $issueNode = $doc->createElementNS($deployment->getNamespace(), 'issue'); $this->addIdentifiers($doc, $issueNode, $issue); $issueNode->setAttribute('published', $issue->getPublished()); $issueNode->setAttribute('current', $issue->getCurrent()); $issueNode->setAttribute('access_status', $issue->getAccessStatus()); $this->createLocalizedNodes($doc, $issueNode, 'description', $issue->getDescription(null)); import('plugins.importexport.native.filter.NativeFilterHelper'); $nativeFilterHelper = new NativeFilterHelper(); $issueNode->appendChild($nativeFilterHelper->createIssueIdentificationNode($this, $doc, $issue)); $this->addDates($doc, $issueNode, $issue); $this->addSections($doc, $issueNode, $issue); $this->addCoverImages($doc, $issueNode, $issue); $this->addIssueGalleys($doc, $issueNode, $issue); $this->addArticles($doc, $issueNode, $issue); return $issueNode; }