-
Notifications
You must be signed in to change notification settings - Fork 1
/
PidManagerPlugin.php
executable file
·99 lines (84 loc) · 3.68 KB
/
PidManagerPlugin.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
<?php
/**
* @file PidManagerPlugin.php
*
* @copyright (c) 2021+ TIB Hannover
* @copyright (c) 2021+ Gazi Yücel
* @license Distributed under the GNU GPL v3. For full terms see the file docs/COPYING.
*
* @class PidManagerPlugin
* @brief Plugin for managing Persistent Identifiers (PIDs) and depositing to external services.
*/
namespace APP\plugins\generic\pidManager;
define('PID_MANAGER_PLUGIN_NAME', basename(__FILE__, '.php'));
use APP\core\Application;
use APP\plugins\generic\pidManager\classes\Settings\Actions;
use APP\plugins\generic\pidManager\classes\Igsn\IgsnArticleDetails;
use APP\plugins\generic\pidManager\classes\Igsn\IgsnSchema;
use APP\plugins\generic\pidManager\classes\Igsn\IgsnSchemaMigration;
use APP\plugins\generic\pidManager\classes\Igsn\IgsnSubmissionWizard;
use APP\plugins\generic\pidManager\classes\Igsn\IgsnPublicationTab;
use APP\plugins\generic\pidManager\classes\Settings\Manage;
use PKP\core\JSONMessage;
use PKP\plugins\GenericPlugin;
use PKP\plugins\Hook;
class PidManagerPlugin extends GenericPlugin
{
/** @copydoc Plugin::register */
public function register($category, $path, $mainContextId = null): bool
{
if (parent::register($category, $path, $mainContextId)) {
if (Application::isUnderMaintenance()) return true;
if ($this->getEnabled()) {
// IGSN
$igsnSchema = new IgsnSchema();
$igsnWorkflowTab = new IgsnPublicationTab($this);
$igsnArticleView = new IgsnArticleDetails($this);
Hook::add('Schema::get::publication', [$igsnSchema, 'addToSchemaPublication']);
Hook::add('Template::Workflow::Publication', [$igsnWorkflowTab, 'execute']);
Hook::add('Templates::Article::Main', [$igsnArticleView, 'execute']);
$igsnSubmissionWizard = new IgsnSubmissionWizard($this);
// Hook::add('LoadComponentHandler', [$igsnSubmissionWizard, 'setupGridHandler']);
Hook::add('TemplateManager::display', [$igsnSubmissionWizard, 'addToSubmissionWizardSteps']);
Hook::add('Template::SubmissionWizard::Section', [$igsnSubmissionWizard, 'addToSubmissionWizardTemplate']);
Hook::add('Template::SubmissionWizard::Section::Review', [$igsnSubmissionWizard, 'addToSubmissionWizardReviewTemplate']);
// PIDINST
// $pidinstSchema = new PidinstSchema();
// Hook::add('Schema::get::publication', [$pidinstSchema, 'addToSchemaPublication']);
}
return true;
}
return false;
}
/** @copydoc PKPPlugin::getDescription */
public function getDescription(): string
{
return __('plugins.generic.pidManager.description');
}
/** @copydoc PKPPlugin::getDisplayName */
public function getDisplayName(): string
{
return __('plugins.generic.pidManager.displayName');
}
/** @copydoc Plugin::getActions() */
public function getActions($request, $actionArgs): array
{
$actions = new Actions($this);
return $actions->execute($request, $actionArgs, parent::getActions($request, $actionArgs));
}
/** @copydoc Plugin::manage() */
public function manage($args, $request): JSONMessage
{
$manage = new Manage($this);
return $manage->execute($args, $request);
}
/** @copydoc Plugin::getInstallMigration() */
function getInstallMigration(): IgsnSchemaMigration
{
return new IgsnSchemaMigration();
}
}
// For backwards compatibility -- expect this to be removed approx. OJS/OMP/OPS 3.6
if (!PKP_STRICT_MODE) {
class_alias('\APP\plugins\generic\pidManager\PidManagerPlugin', '\PidManagerPlugin');
}