-
Notifications
You must be signed in to change notification settings - Fork 7
/
FullJournalImportExportDeployment.inc.php
303 lines (250 loc) · 7.52 KB
/
FullJournalImportExportDeployment.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
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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
<?php
/**
* Copyright (c) 2014-2024 Lepidus Tecnologia
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING.
*/
import('plugins.importexport.native.NativeImportExportDeployment');
class FullJournalImportExportDeployment extends NativeImportExportDeployment
{
public $isTestEnv;
private $reviewForm;
private $reviewRound;
private $reviewAssignment;
private $note;
private $currentIssue;
private $navigationMenuItemDBIds;
private $reviewFormDBIds;
private $reviewFormElementDBIds;
private $representationDBIds;
private $issueDBIds;
private $issueGalleyDBIds;
private $submissionDBIds;
public function __construct($context, $user = null)
{
parent::__construct($context, $user);
$this->setNavigationMenuItemDBIds([]);
$this->setReviewFormDBIds([]);
$this->setReviewFormElementDBIds([]);
$this->setRepresentationDBIds([]);
$this->setIssueDBIds([]);
$this->setIssueGalleyDBIds([]);
$this->setSubmissionDBIds([]);
}
public function getSchemaFilename()
{
return 'fullJournal.xsd';
}
public function getSubmissionNodeName()
{
return 'extended_article';
}
public function getSubmissionsNodeName()
{
return 'extended_articles';
}
public function validateSubmission($submission)
{
$isComplete = 0;
if ($submission->getSubmissionProgress() != $isComplete) {
return false;
}
$publications = $submission->getData('publications');
if (empty($publications)) {
return false;
}
foreach ($publications as $publication) {
$titles = $publication->getData('title');
$authors = $publication->getData('authors');
if (empty($titles)) {
return false;
}
if (empty($authors)) {
return false;
}
foreach ($authors as $author) {
$givenNames = $author->getGivenName(null);
$userGroup = $author->getUserGroup();
if (is_null($givenNames)) {
return false;
}
if (!$userGroup) {
return false;
}
}
}
return true;
}
public function setReviewRound($reviewRound)
{
$this->reviewRound = $reviewRound;
}
public function getReviewRound()
{
return $this->reviewRound;
}
public function setReviewForm($reviewForm)
{
$this->reviewForm = $reviewForm;
}
public function getReviewForm()
{
return $this->reviewForm;
}
public function setReviewAssignment($reviewAssignment)
{
$this->reviewAssignment = $reviewAssignment;
}
public function getReviewAssignment()
{
return $this->reviewAssignment;
}
public function setNote($note)
{
$this->note = $note;
}
public function getNote()
{
return $this->note;
}
public function setCurrentIssue($currentIssue)
{
$this->currentIssue = $currentIssue;
}
public function getCurrentIssue()
{
return $this->currentIssue;
}
public function getNavigationMenuItemDBIds()
{
return $this->navigationMenuItemDBIds;
}
public function setNavigationMenuItemDBIds($navigationMenuItemDBIds)
{
return $this->navigationMenuItemDBIds = $navigationMenuItemDBIds;
}
public function getNavigationMenuItemDBId($navigationMenuItemDBId)
{
if (array_key_exists($navigationMenuItemDBId, $this->navigationMenuItemDBIds)) {
return $this->navigationMenuItemDBIds[$navigationMenuItemDBId];
}
return null;
}
public function setNavigationMenuItemDBId($navigationMenuItemDBId, $DBId)
{
return $this->navigationMenuItemDBIds[$navigationMenuItemDBId] = $DBId;
}
public function getReviewFormDBIds()
{
return $this->reviewFormDBIds;
}
public function setReviewFormDBIds($reviewFormDBIds)
{
return $this->reviewFormDBIds = $reviewFormDBIds;
}
public function getReviewFormDBId($reviewFormDBId)
{
if (array_key_exists($reviewFormDBId, $this->reviewFormDBIds)) {
return $this->reviewFormDBIds[$reviewFormDBId];
}
return null;
}
public function setReviewFormDBId($reviewFormDBId, $DBId)
{
return $this->reviewFormDBIds[$reviewFormDBId] = $DBId;
}
public function getReviewFormElementDBIds()
{
return $this->reviewFormElementDBIds;
}
public function setReviewFormElementDBIds($reviewFormElementDBIds)
{
return $this->reviewFormElementDBIds = $reviewFormElementDBIds;
}
public function getReviewFormElementDBId($reviewFormElementDBId)
{
if (array_key_exists($reviewFormElementDBId, $this->reviewFormElementDBIds)) {
return $this->reviewFormElementDBIds[$reviewFormElementDBId];
}
return null;
}
public function setReviewFormElementDBId($reviewFormElementDBId, $DBId)
{
return $this->reviewFormElementDBIds[$reviewFormElementDBId] = $DBId;
}
public function getRepresentationDBIds()
{
return $this->representationDBIds;
}
public function setRepresentationDBIds($representationDBIds)
{
return $this->representationDBIds = $representationDBIds;
}
public function getRepresentationDBId($representationDBId)
{
if (array_key_exists($representationDBId, $this->representationDBIds)) {
return $this->representationDBIds[$representationDBId];
}
return null;
}
public function setRepresentationDBId($representationDBId, $DBId)
{
return $this->representationDBIds[$representationDBId] = $DBId;
}
public function getIssueDBIds()
{
return $this->issueDBIds;
}
public function setIssueDBIds($issueDBIds)
{
return $this->issueDBIds = $issueDBIds;
}
public function getIssueDBId($issueDBId)
{
if (array_key_exists($issueDBId, $this->issueDBIds)) {
return $this->issueDBIds[$issueDBId];
}
return null;
}
public function setIssueDBId($issueDBId, $DBId)
{
return $this->issueDBIds[$issueDBId] = $DBId;
}
public function getIssueGalleyDBIds()
{
return $this->issueGalleyDBIds;
}
public function setIssueGalleyDBIds($issueGalleyDBIds)
{
return $this->issueGalleyDBIds = $issueGalleyDBIds;
}
public function getIssueGalleyDBId($issueGalleyDBId)
{
if (array_key_exists($issueGalleyDBId, $this->issueGalleyDBIds)) {
return $this->issueGalleyDBIds[$issueGalleyDBId];
}
return null;
}
public function setIssueGalleyDBId($issueGalleyDBId, $DBId)
{
return $this->issueGalleyDBIds[$issueGalleyDBId] = $DBId;
}
public function getSubmissionDBIds()
{
return $this->submissionDBIds;
}
public function setSubmissionDBIds($submissionDBIds)
{
return $this->submissionDBIds = $submissionDBIds;
}
public function getSubmissionDBId($submissionDBId)
{
if (array_key_exists($submissionDBId, $this->submissionDBIds)) {
return $this->submissionDBIds[$submissionDBId];
}
return null;
}
public function setSubmissionDBId($submissionDBId, $DBId)
{
return $this->submissionDBIds[$submissionDBId] = $DBId;
}
}