-
Notifications
You must be signed in to change notification settings - Fork 7
/
MedraExportDeployment.php
101 lines (88 loc) · 2.36 KB
/
MedraExportDeployment.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
<?php
/**
* @file plugins/generic/medra/MedraExportDeployment.php
*
* Copyright (c) 2014-2024 Simon Fraser University
* Copyright (c) 2000-2024 John Willinsky
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING.
*
* @class MedraExportDeployment
*
* @brief Base class configuring the mEDRA export process to an
* application's specifics.
*/
namespace APP\plugins\generic\medra;
use APP\plugins\PubObjectCache;
use APP\plugins\generic\medra\MedraExportPlugin;
use PKP\context\Context;
class MedraExportDeployment
{
public const MEDRA_XMLNS = 'http://www.editeur.org/onix/DOIMetadata/2.0';
public const MEDRA_XMLNS_XSI = 'http://www.w3.org/2001/XMLSchema-instance';
public const MEDRA_XSI_SCHEMAVERSION = '2.0';
public const MEDRA_XSI_SCHEMALOCATION = 'http://www.medra.org/schema/onix/DOIMetadata/2.0/ONIX_DOIMetadata_2.0.xsd';
public const MEDRA_XSI_SCHEMALOCATION_DEV = 'http://www-medra-dev.medra.org/schema/onix/DOIMetadata/2.0/ONIX_DOIMetadata_2.0.xsd';
/**
* Get the plugin cache
*/
function getCache(): PubObjectCache
{
return $this->plugin->getCache();
}
function __construct(
public Context $context,
public MedraExportPlugin $plugin
) {}
//
// Deployment items for subclasses to override
//
/**
* Get the namespace URN
*/
function getNamespace(): string
{
return self::MEDRA_XMLNS;
}
/**
* Get the schema instance URN
*/
function getXmlSchemaInstance(): string
{
return self::MEDRA_XMLNS_XSI;
}
/**
* Get the schema version
*/
function getXmlSchemaVersion(): string
{
return self::MEDRA_XSI_SCHEMAVERSION;
}
/**
* Get the schema location URL
*/
function getXmlSchemaLocation(): string
{
return $this->plugin->isTestMode($this->context) ? self::MEDRA_XSI_SCHEMALOCATION_DEV : self::MEDRA_XSI_SCHEMALOCATION;
}
/**
* Get the schema filename.
*/
function getSchemaFilename(): string
{
return $this->getXmlSchemaLocation();
}
/**
* Get the import/export context.
*/
function getContext(): Context
{
return $this->context;
}
/**
* Get the import/export plugin.
*/
function getPlugin(): MedraExportPlugin
{
return $this->plugin;
}
}