18 public function register($category, $path, $mainContextId = NULL) {
19 $success = parent::register($category, $path);
30 return __(
'plugins.generic.crossrefDeposit.name');
37 return __(
'plugins.generic.crossrefDeposit.description');
53 $newPublication = $args[0];
54 $objects[] =
Services::get(
'submission')->get($newPublication->getData(
'submissionId'));
57 $filter = $crossrefExportPlugin->getSubmissionFilter();
58 $objectsFileNamePart =
'preprints';
61 import(
'lib.pkp.classes.file.FileManager');
63 $resultErrors = array();
64 $errorsOccured =
false;
66 foreach ($objects as $object) {
67 $exportXml = $crossrefExportPlugin->exportXML(array($object), $filter, $context, $noValidation);
68 $objectsFileNamePart = $objectsFileNamePart .
'-' . $object->getId();
69 $exportFileName = $crossrefExportPlugin->getExportFileName($crossrefExportPlugin->getExportPath(), $objectsFileNamePart, $context,
'.xml');
70 $fileManager->writeFile($exportFileName, $exportXml);
71 $result = $crossrefExportPlugin->depositXML($object, $context, $exportFileName);
73 $errorsOccured =
true;
75 if (is_array($result)) {
76 $resultErrors[] = $result;
78 $fileManager->deleteByPath($exportFileName);