-
Notifications
You must be signed in to change notification settings - Fork 8
/
DepositReceipt.inc.php
48 lines (41 loc) · 1.56 KB
/
DepositReceipt.inc.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?php
/**
* @file DepositReceipt.inc.php
*
* Copyright (c) 2014-2020 Simon Fraser University
* Copyright (c) 2003-2020 John Willinsky
* Distributed under the GNU GPL v3. For full terms see the file LICENSE.
*
* @class DepositReceipt
* @ingroup plugins_gateways_swordserver
*
* @brief Sword gateway plugin
*/
class DepositReceipt extends DOMDocument {
/**
* Constructor.
* @param $data array
*/
function __construct($data) {
parent::__construct();
$root = $this->createElementNS('http://www.w3.org/2005/Atom', 'entry');
$this->appendChild($root);
$root->setAttributeNS('http://www.w3.org/2000/xmlns/', 'xmlns:dcterms', 'http://purl.org/dc/terms/');
$root->setAttributeNS('http://www.w3.org/2000/xmlns/', 'xmlns:sword', 'http://purl.org/net/sword/terms/');
$root->appendChild($this->createElement('title', $data['title']));
$editIri = $this->createElement('link');
$root->appendChild($editIri);
$editIri->setAttribute('rel', "edit");
$editIri->setAttribute('href', $data['edit-iri']);
$swordEditIri = $this->createElement('link');
$root->appendChild($swordEditIri);
$swordEditIri->setAttribute('rel', "http://purl.org/net/sword/terms/add");
$swordEditIri->setAttribute('href', $data['edit-iri']);
$stmtIri = $this->createElement('link');
$root->appendChild($stmtIri);
$stmtIri->setAttribute('rel', "http://purl.org/net/sword/terms/statement");
$stmtIri->setAttribute('href', $data['stmt-iri']);
$swordTreatment = $this->createElement('sword:treatment', 'Posted to the Article Submission Queue');
$root->appendChild($swordTreatment);
}
}