16 import(
'lib.pkp.plugins.importexport.native.filter.NativeExportFilter');
25 parent::__construct($filterGroup);
36 return 'plugins.importexport.native.filter.ChapterNativeXmlFilter';
50 $doc =
new DOMDocument(
'1.0');
51 $doc->preserveWhiteSpace =
false;
52 $doc->formatOutput =
true;
56 $rootNode = $doc->createElementNS($deployment->getNamespace(),
'chapters');
57 foreach ($chapters as $chapter) {
60 $doc->appendChild($rootNode);
61 $rootNode->setAttributeNS(
'http://www.w3.org/2000/xmlns/',
'xmlns:xsi',
'http://www.w3.org/2001/XMLSchema-instance');
62 $rootNode->setAttribute(
'xsi:schemaLocation', $deployment->getNamespace() .
' ' . $deployment->getSchemaFilename());
78 $context = $deployment->getContext();
80 $publication = $deployment->getPublication();
83 $entityNode = $doc->createElementNS($deployment->getNamespace(),
'chapter');
84 $entityNode->setAttribute(
'seq', $chapter->getSequence());
85 $entityNode->setAttribute(
'id', $chapter->getId());
92 $entityNode->appendChild($doc->createElementNS($deployment->getNamespace(),
'pages', $chapter->getData(
'pages')));
96 $chapterAuthors = $chapterAuthorDao->getAuthors($chapter->getData(
'publicationId'), $chapter->getId())->toArray();
98 foreach ($chapterAuthors as $chapterAuthor) {
103 $submissionFiles = $submissionFileDao->getBySubmissionId($publication->getData(
'submissionId'));
104 foreach ($submissionFiles as $submissionFile) {
105 if ($submissionFile->getData(
'chapterId') == $chapter->getId()) {
106 $referenceFileNode = $doc->createElementNS($deployment->getNamespace(),
'submission_file_ref');
107 $referenceFileNode->setAttribute(
'id', $submissionFile->getId());
108 $referenceFileNode->setAttribute(
'revision', $submissionFile->getRevision());
109 $entityNode->appendChild($referenceFileNode);
124 $context = $deployment->getContext();
127 $entityNode = $doc->createElementNS($deployment->getNamespace(),
'chapterAuthor');
128 $entityNode->setAttribute(
'author_id', $chapterAuthor->getId());
129 $entityNode->setAttribute(
'primary_contact', $chapterAuthor->getData(
'primaryContact'));
130 $entityNode->setAttribute(
'seq', $chapterAuthor->getData(
'seq'));