16 import(
'lib.pkp.plugins.importexport.native.filter.NativeXmlRepresentationFilter');
24 parent::__construct($filterGroup);
35 return 'article_galleys';
43 return 'article_galley';
53 return 'plugins.importexport.native.filter.NativeXmlArticleGalleyFilter';
64 $context = $deployment->getContext();
65 $submission = $deployment->getSubmission();
66 assert(is_a($submission,
'Submission'));
68 $submissionFileRefNodes = $node->getElementsByTagName(
'submission_file_ref');
69 assert($submissionFileRefNodes->length <= 1);
70 $addSubmissionFile =
false;
71 if ($submissionFileRefNodes->length == 1) {
72 $fileNode = $submissionFileRefNodes->item(0);
73 $fileId = $fileNode->getAttribute(
'id');
74 $revisionId = $fileNode->getAttribute(
'revision');
75 $dbFileId = $deployment->getFileDBId($fileId, $revisionId);
76 if ($dbFileId) $addSubmissionFile =
true;
78 $representation = parent::handleElement($node);
80 for ($n = $node->firstChild; $n !==
null; $n=$n->nextSibling)
if (is_a($n,
'DOMElement'))
switch($n->tagName) {
83 $locale = $n->getAttribute(
'locale');
84 if (empty($locale)) $locale = $submission->getLocale();
85 $representation->setLabel($n->textContent);
86 $representation->setLocale($locale);
91 if ($addSubmissionFile) $representation->setFileId($dbFileId);
92 $representationDao->insertObject($representation);
94 if ($addSubmissionFile) {
97 $submissionFile = $submissionFileDao->getRevision($dbFileId, $revisionId);
98 $submissionFile->setAssocType(ASSOC_TYPE_REPRESENTATION);
99 $submissionFile->setAssocId($representation->getId());
100 $submissionFileDao->updateObject($submissionFile);
104 return $representation;