16 import(
'lib.pkp.plugins.importexport.native.filter.NativeExportFilter');
25 parent::__construct($filterGroup);
36 return 'lib.pkp.plugins.importexport.native.filter.RepresentationNativeXmlFilter';
50 $doc =
new DOMDocument(
'1.0');
51 $doc->preserveWhiteSpace =
false;
52 $doc->formatOutput =
true;
55 $doc->appendChild($rootNode);
56 $rootNode->setAttributeNS(
'http://www.w3.org/2000/xmlns/',
'xmlns:xsi',
'http://www.w3.org/2001/XMLSchema-instance');
57 $rootNode->setAttribute(
'xsi:schemaLocation', $deployment->getNamespace() .
' ' . $deployment->getSchemaFilename());
73 $context = $deployment->getContext();
76 $representationNode = $doc->createElementNS($deployment->getNamespace(), $deployment->getRepresentationNodeName());
78 $representationNode->setAttribute(
'locale', $representation->getData(
'locale'));
84 $sequenceNode = $doc->createElementNS($deployment->getNamespace(),
'seq');
85 $sequenceNode->appendChild($doc->createTextNode((
int) $representation->getSequence()));
86 $representationNode->appendChild($sequenceNode);
88 $urlRemote = $representation->getData(
'urlRemote');
90 $remoteNode = $doc->createElementNS($deployment->getNamespace(),
'remote');
91 $remoteNode->setAttribute(
'src', $urlRemote);
92 $representationNode->appendChild($remoteNode);
95 foreach ($this->
getFiles($representation) as $submissionFile) {
96 $fileRefNode = $doc->createElementNS($deployment->getNamespace(),
'submission_file_ref');
97 $fileRefNode->setAttribute(
'id', $submissionFile->getFileId());
98 $fileRefNode->setAttribute(
'revision', $submissionFile->getRevision());
99 $representationNode->appendChild($fileRefNode);
103 return $representationNode;
116 $representationNode->appendChild($node = $doc->createElementNS($deployment->getNamespace(),
'id', $representation->getId()));
117 $node->setAttribute(
'type',
'internal');
118 $node->setAttribute(
'advice',
'ignore');
121 if ($pubId = $representation->getStoredPubId(
'publisher-id')) {
122 $representationNode->appendChild($node = $doc->createElementNS($deployment->getNamespace(),
'id', htmlspecialchars($pubId, ENT_COMPAT,
'UTF-8')));
123 $node->setAttribute(
'type',
'public');
124 $node->setAttribute(
'advice',
'update');
129 foreach ($pubIdPlugins as $pubIdPlugin) {
130 $this->
addPubIdentifier($doc, $representationNode, $representation, $pubIdPlugin);
143 $pubId = $representation->getStoredPubId($pubIdPlugin->getPubIdType());
146 $representationNode->appendChild($node = $doc->createElementNS($deployment->getNamespace(),
'id', htmlspecialchars($pubId, ENT_COMPAT,
'UTF-8')));
147 $node->setAttribute(
'type', $pubIdPlugin->getPubIdType());
148 $node->setAttribute(
'advice',
'update');