16 import(
'lib.pkp.plugins.importexport.native.filter.NativeImportFilter');
25 parent::__construct($filterGroup);
54 return 'plugins.importexport.native.filter.NativeXmlChapterFilter';
65 $context = $deployment->getContext();
67 $publication = $deployment->getPublication();
68 assert(is_a($publication,
'Publication'));
73 $chapter = $chapterDao->newDataObject();
75 $chapter->setData(
'publicationId', $publication->getId());
76 $chapter->setSequence($node->getAttribute(
'seq'));
78 $chapterId = $chapterDao->insertChapter($chapter);
79 $chapter->setData(
'id', $chapterId);
82 for ($n = $node->firstChild; $n !==
null; $n=$n->nextSibling)
if (is_a($n,
'DOMElement'))
switch($n->tagName) {
84 $locale = $n->getAttribute(
'locale');
85 if (empty($locale)) $locale = $context->getLocale();
86 $chapter->setData(
'title', $n->textContent, $locale);
89 $locale = $n->getAttribute(
'locale');
90 if (empty($locale)) $locale = $context->getLocale();
91 $chapter->setData(
'abstract', $n->textContent, $locale);
94 $locale = $n->getAttribute(
'locale');
95 if (empty($locale)) $locale = $context->getLocale();
96 $chapter->setData(
'subtitle', $n->textContent, $locale);
99 $chapter->setData(
'pages', $n->textContent);
101 case 'chapterAuthor':
104 case 'submission_file_ref':
109 $chapterDao->updateObject($chapter);
124 $authorId = $deployment->getAuthorDBId($n->getAttribute(
'author_id'));
125 $primaryContact = $n->getAttribute(
'primary_contact');
126 $seq = $n->getAttribute(
'seq');
128 $chapterAuthorDao->insertChapterAuthor($authorId, $chapter->getId(), $primaryContact, $seq);
138 $context = $deployment->getContext();
140 $publication = $deployment->getPublication();
142 $fileId = $n->getAttribute(
'id');
143 $fileRevision = $n->getAttribute(
'revision');
145 $sourceFileId = $deployment->getFileDBId($fileId, $fileRevision);
148 $submissionFile = $submissionFileDao->getRevision($sourceFileId, $fileRevision);
150 if ($submissionFile) {
151 $submissionFile->setData(
'chapterId', $chapter->getId());
153 $submissionFileDao->updateObject($submissionFile);