Skip to content

Commit 276c9c8

Browse files
committed
pkp#8845 Added missing methods
1 parent 1ae2885 commit 276c9c8

File tree

11 files changed

+148
-0
lines changed

11 files changed

+148
-0
lines changed

classes/controllers/grid/GridColumn.php

+12
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,18 @@ public function getCellActions($request, $row, $position = GridHandler::GRID_ACT
161161
// The default implementation returns an empty array
162162
return [];
163163
}
164+
165+
/**
166+
* Method expected by ColumnBasedGridCellProvider
167+
* to render a cell in this column.
168+
* @param \PKP\controllers\grid\GridRow $row
169+
*
170+
* @copydoc ColumnBasedGridCellProvider::getTemplateVarsFromRowColumn()
171+
*/
172+
public function getTemplateVarsFromRow($row)
173+
{
174+
return [];
175+
}
164176
}
165177

166178
if (!PKP_STRICT_MODE) {

classes/controllers/grid/GridRow.php

+9
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,15 @@ public function initialize($request, $template = null)
230230
// Set the template.
231231
$this->setTemplate($template);
232232
}
233+
234+
/**
235+
* Category rows only have one cell and one label. This is it.
236+
* return string
237+
*/
238+
public function getCategoryLabel()
239+
{
240+
return '';
241+
}
233242
}
234243

235244
if (!PKP_STRICT_MODE) {

classes/core/EntityDAO.php

+5
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,11 @@ public function __construct(PKPSchemaService $schemaService)
7676
$this->schemaService = $schemaService;
7777
}
7878

79+
/**
80+
* Retrieves a new instance of the entity
81+
*/
82+
abstract public function newDataObject();
83+
7984
/**
8085
* Convert a row from the database query into a DataObject
8186
*/

classes/oai/PKPOAIDAO.php

+11
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,17 @@ public function _doCommonOAIFromRowOperations($record, $row)
277277
* @return \Illuminate\Database\Query\Builder
278278
*/
279279
abstract public function _getRecordsRecordSetQuery($setIds, $from, $until, $set, $submissionId = null, $orderBy = 'journal_id, submission_id');
280+
281+
/**
282+
* Set the OAI data
283+
*
284+
* @param OAIRecord|OAIIdentifier $record
285+
* @param array $row
286+
* @param bool $isRecord
287+
*
288+
* @return OAIRecord|OAIIdentifier
289+
*/
290+
abstract public function setOAIData($record, $row, $isRecord = true);
280291
}
281292

282293
if (!PKP_STRICT_MODE) {

classes/plugins/ImportExportPlugin.php

+7
Original file line numberDiff line numberDiff line change
@@ -458,6 +458,13 @@ public function writeExportedFile(string $filename, string $fileContent, Context
458458

459459
return $exportFileName;
460460
}
461+
462+
/**
463+
* @param string $exportType
464+
*/
465+
public function getExportFilter($exportType) {
466+
throw new Exception('Not implemented');
467+
}
461468
}
462469

463470
if (!PKP_STRICT_MODE) {

classes/plugins/PaymethodPlugin.php

+13
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@
1515

1616
namespace PKP\plugins;
1717

18+
use Exception;
19+
use PKP\core\PKPRequest;
20+
1821
abstract class PaymethodPlugin extends LazyLoadPlugin
1922
{
2023
/**
@@ -52,6 +55,16 @@ public function saveSettings($params, $slimRequest, $request)
5255
{
5356
assert(false); // implement in child classes
5457
}
58+
59+
/**
60+
* Handle incoming requests/notifications
61+
*
62+
* @param array $args
63+
* @param PKPRequest $request
64+
*/
65+
public function handle($args, $request) {
66+
throw new Exception('Not implemented');
67+
}
5568
}
5669

5770
if (!PKP_STRICT_MODE) {

classes/plugins/importexport/PKPImportExportFilter.php

+12
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,18 @@ public static function getFilter($filter, $deployment, $opts = [])
8989

9090
return $currentFilter;
9191
}
92+
93+
/**
94+
* Get the import filter for a given element.
95+
*
96+
* @param string $elementName Name of XML element
97+
*
98+
* @return Filter
99+
*/
100+
public function getImportFilter($elementName)
101+
{
102+
return new Exception('Not implemented');
103+
}
92104
}
93105

94106
if (!PKP_STRICT_MODE) {

classes/publication/PKPPublication.php

+30
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
namespace PKP\publication;
1919

20+
use APP\facades\Repo;
2021
use PKP\core\Core;
2122

2223
use PKP\core\PKPString;
@@ -434,6 +435,35 @@ public function getStoredPubId($pubIdType)
434435
return $this->getData('pub-id::' . $pubIdType);
435436
}
436437
}
438+
439+
/**
440+
* Set stored public issue id.
441+
*
442+
* @param string $pubIdType One of the NLM pub-id-type values or
443+
* 'other::something' if not part of the official NLM list
444+
* (see <http://dtd.nlm.nih.gov/publishing/tag-library/n-4zh0.html>).
445+
* @param string $pubId
446+
*/
447+
public function setStoredPubId($pubIdType, $pubId)
448+
{
449+
if ($pubIdType == 'doi') {
450+
if ($doiObject = $this->getData('doiObject')) {
451+
Repo::doi()->edit($doiObject, ['doi' => $pubId]);
452+
} else {
453+
$newDoiObject = Repo::doi()->newDataObject(
454+
[
455+
'doi' => $pubId,
456+
'contextId' => Repo::submission()->get($this->getData('submissionId'))->getData('contextId')
457+
]
458+
);
459+
$doiId = Repo::doi()->add($newDoiObject);
460+
461+
$this->setData('doiId', $doiId);
462+
}
463+
} else {
464+
$this->setData('pub-id::' . $pubIdType, $pubId);
465+
}
466+
}
437467
}
438468
if (!PKP_STRICT_MODE) {
439469
class_alias('\PKP\publication\PKPPublication', '\PKPPublication');

classes/security/authorization/PolicySet.php

+12
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818

1919
namespace PKP\security\authorization;
2020

21+
use Exception;
22+
2123
class PolicySet
2224
{
2325
public const COMBINING_DENY_OVERRIDES = 1;
@@ -105,6 +107,16 @@ public function getEffectIfNoPolicyApplies()
105107
{
106108
return $this->_effectIfNoPolicyApplies;
107109
}
110+
111+
/**
112+
* This method must return a value of either AUTHORIZATION_DENY or AUTHORIZATION_PERMIT.
113+
*
114+
* @return int
115+
*/
116+
public function effect()
117+
{
118+
throw new Exception('Not implemented');
119+
}
108120
}
109121

110122
if (!PKP_STRICT_MODE) {

plugins/importexport/native/PKPNativeImportExportPlugin.php

+27
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,13 @@
1919
use APP\template\TemplateManager;
2020
use BadMethodCallException;
2121
use Exception;
22+
use PKP\context\Context;
2223
use PKP\core\JSONMessage;
2324
use PKP\file\TemporaryFileManager;
2425
use PKP\filter\Filter;
2526
use PKP\plugins\ImportExportPlugin;
2627
use PKP\plugins\PluginRegistry;
28+
use PKP\user\User;
2729

2830
abstract class PKPNativeImportExportPlugin extends ImportExportPlugin
2931
{
@@ -368,4 +370,29 @@ public function executeCLI($scriptName, &$args)
368370
return true;
369371
}
370372
}
373+
374+
/**
375+
* Custom deployment
376+
*
377+
* @param Context $context
378+
* @param ?User $user
379+
*
380+
* @return PKPNativeImportExportDeployment
381+
*/
382+
public function getAppSpecificDeployment($context, $user)
383+
{
384+
return new Exception('Not implemented');
385+
}
386+
387+
/**
388+
* Get the import filter for a given element.
389+
*
390+
* @param string $elementName Name of XML element
391+
*
392+
* @return Filter
393+
*/
394+
public function getImportFilter($elementName)
395+
{
396+
return new Exception('Not implemented');
397+
}
371398
}

plugins/importexport/native/filter/PKPPublicationNativeXmlFilter.php

+10
Original file line numberDiff line numberDiff line change
@@ -344,4 +344,14 @@ private function createCitationsNode($doc, $deployment, $publication)
344344

345345
return $nodeCitations;
346346
}
347+
348+
/**
349+
* Get the representation export filter group name
350+
*
351+
* @return string
352+
*/
353+
public function getRepresentationExportFilterGroupName()
354+
{
355+
throw new Exception('Not implemented');
356+
}
347357
}

0 commit comments

Comments
 (0)