diff --git a/plugins/importexport/csv/CSVImportExportPlugin.inc.php b/plugins/importexport/csv/CSVImportExportPlugin.inc.php index 13abdf7dcab..d0d82cb07ff 100644 --- a/plugins/importexport/csv/CSVImportExportPlugin.inc.php +++ b/plugins/importexport/csv/CSVImportExportPlugin.inc.php @@ -53,7 +53,7 @@ function getDescription() { * @copydoc Plugin::getActions() */ function getActions($request, $actionArgs) { - return array(); // Not available via the web interface + return []; // Not available via the web interface } /** @@ -82,6 +82,7 @@ function executeCLI($scriptName, &$args) { $filename = array_shift($args); $username = array_shift($args); + $basePath = dirname($filename); if (!$filename || !$username) { $this->usage($scriptName); @@ -89,170 +90,326 @@ function executeCLI($scriptName, &$args) { } if (!file_exists($filename)) { - echo __('plugins.importexport.csv.fileDoesNotExist', array('filename' => $filename)) . "\n"; + echo __('plugins.importexport.csv.fileDoesNotExist', ['filename' => $filename]) . "\n"; exit(); } - $data = file($filename); + $data = file($filename, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES); + if ($data === false) { + echo __('plugins.importexport.csv.fileDoesNotExist', ['filename' => $filename]) . "\n"; + exit(); + } + str_getcsv(array_shift($data)); // Remove column headers in first row if (is_array($data) && count($data) > 0) { - $userDao = DAORegistry::getDAO('UserDAO'); /* @var $userDao UserDAO */ - $user = $userDao->getByUsername($username); - if (!$user) { - echo __('plugins.importexport.csv.unknownUser', array('username' => $username)) . "\n"; - exit(); - } - - $submissionDao = DAORegistry::getDAO('SubmissionDAO'); /* @var $submissionDao SubmissionDAO */ - $authorDao = DAORegistry::getDAO('AuthorDAO'); /* @var $authorDao AuthorDAO */ $pressDao = Application::getContextDAO(); + $genreDao = DAORegistry::getDAO('GenreDAO'); /* @var $genreDao GenreDAO */ $userGroupDao = DAORegistry::getDAO('UserGroupDAO'); /* @var $userGroupDao UserGroupDAO */ + $submissionDao = DAORegistry::getDAO('SubmissionDAO'); /* @var $submissionDao SubmissionDAO */ + $publicationDao = DAORegistry::getDAO('PublicationDAO'); /* @var $publicationDao PublicationDAO */ $seriesDao = DAORegistry::getDAO('SeriesDAO'); /* @var $seriesDao SeriesDAO */ + $authorDao = DAORegistry::getDAO('AuthorDAO'); /* @var $authorDao AuthorDAO */ $publicationFormatDao = DAORegistry::getDAO('PublicationFormatDAO'); /* @var $publicationFormatDao PublicationFormatDAO */ - $submissionFileDao = DAORegistry::getDAO('SubmissionFileDAO'); /* @var $submissionFileDao SubmissionFileDAO */ import('lib.pkp.classes.submission.SubmissionFile'); // constants. - $genreDao = DAORegistry::getDAO('GenreDAO'); /* @var $genreDao GenreDAO */ $publicationDateDao = DAORegistry::getDAO('PublicationDateDAO'); /* @var $publicationDateDao PublicationDateDAO */ + $submissionFileDao = DAORegistry::getDAO('SubmissionFileDAO'); /* @var $submissionFileDao SubmissionFileDAO */ + $userDao = DAORegistry::getDAO('UserDAO'); /* @var $userDao UserDAO */ - foreach ($data as $csvLine) { + $user = $userDao->getByUsername($username); + if (!$user) { + echo __('plugins.importexport.csv.unknownUser', ['username' => $username]) . "\n"; + exit(); + } + + foreach ($data as $line) { + $fields = str_getcsv($line); // Format is: - // Press Path, Author string, title, series path, year, is_edited_volume, locale, URL to PDF, doi (optional) - list($pressPath, $authorString, $title, $seriesPath, $year, $isEditedVolume, $locale, $pdfUrl, $doi) = preg_split('/\t/', $csvLine); + // Press Path, Author string, title, abstract, series path, year, is_edited_volume, locale, URL to PDF, doi (optional), keywords list, subjects list, book cover image path, book cover image alt text, categories list + list( + $pressPath, + $authorString, + $title, + $abstract, + $seriesPath, + $year, + $isEditedVolume, + $locale, + $pdfUrl, + $doi, + $keywords, + $subjects, + $bookCoverImageName, + $bookCoverImageAltText, + $categories + ) = $fields; $press = $pressDao->getByPath($pressPath); - if ($press) { + if (!$press) { + echo __('plugins.importexport.csv.unknownPress', ['pressPath' => $pressPath]) . "\n"; + continue; + } - $supportedLocales = $press->getSupportedSubmissionLocales(); - if (!is_array($supportedLocales) || count($supportedLocales) < 1) $supportedLocales = array($press->getPrimaryLocale()); - $authorGroup = $userGroupDao->getDefaultByRoleId($press->getId(), ROLE_ID_AUTHOR); + $supportedLocales = $press->getSupportedSubmissionLocales(); + if (!is_array($supportedLocales) || count($supportedLocales) < 1) { + $supportedLocales = [$press->getPrimaryLocale()]; + } - // we need a Genre for the files. Assume a key of MANUSCRIPT as a default. - $genre = $genreDao->getByKey('MANUSCRIPT', $press->getId()); + if (!in_array($locale, $supportedLocales)) { + echo __('plugins.importexport.csv.unknownLocale', ['locale' => $locale]) . "\n"; + continue; + } - if (!$genre) { - echo __('plugins.importexport.csv.noGenre') . "\n"; - exit(); - } - if (!$authorGroup) { - echo __('plugins.importexport.csv.noAuthorGroup', array('press' => $pressPath)) . "\n"; - continue; - } - if (in_array($locale, $supportedLocales)) { - $submission = $submissionDao->newDataObject(); - $submission->setContextId($press->getId()); - $submission->setUserId($user->getId()); - $submission->stampLastActivity(); - $submission->setStatus(STATUS_PUBLISHED); - $submission->setWorkType($isEditedVolume == 1?WORK_TYPE_EDITED_VOLUME:WORK_TYPE_AUTHORED_WORK); - $submission->setCopyrightNotice($press->getLocalizedSetting('copyrightNotice'), $locale); - $submission->setLocale($locale); - - $series = $seriesDao->getByPath($seriesPath, $press->getId()); - if ($series) { - $submission->setSeriesId($series->getId()); + // we need a Genre for the files. Assume a key of MANUSCRIPT as a default. + $genre = $genreDao->getByKey('MANUSCRIPT', $press->getId()); + if (!$genre) { + echo __('plugins.importexport.csv.noGenre') . "\n"; + exit(); + } + + $authorGroup = $userGroupDao->getDefaultByRoleId($press->getId(), ROLE_ID_AUTHOR); + + if (!$authorGroup) { + echo __('plugins.importexport.csv.noAuthorGroup', ['press' => $pressPath]) . "\n"; + continue; + } + + $submission = $submissionDao->newDataObject(); + $submission->setContextId($press->getId()); + $submission->stampLastActivity(); + $submission->stampModified(); + $submission->setStatus(STATUS_PUBLISHED); + $submission->setWorkType($isEditedVolume == 1 ? WORK_TYPE_EDITED_VOLUME : WORK_TYPE_AUTHORED_WORK); + $submission->setCopyrightNotice($press->getLocalizedSetting('copyrightNotice'), $locale); + $submission->setLocale($locale); + $submission->setStageId(WORKFLOW_STAGE_ID_PRODUCTION); + $submission->setSubmissionProgress(0); + $submission->setData('abstract', $abstract, $locale); + + $series = $seriesPath ? $seriesDao->getByPath($seriesPath, $press->getId()) : null; + if ($series) { + $submission->setSeriesId($series->getId()); + } + + $submissionId = $submissionDao->insertObject($submission); + + $publication = $publicationDao->newDataObject(); + $publication->setData('submissionId', $submissionId); + $publication->setData('version', 1); + $publication->setData('status', STATUS_PUBLISHED); + $publication->setData('datePublished', Core::getCurrentDate()); + $publicationId = $publicationDao->insertObject($publication); + + $submission->setData('currentPublicationId', $publicationId); + $submissionDao->updateObject($submission); + + $contactEmail = $press->getContactEmail(); + $authorsString = trim($authorString, '"'); // remove double quotes if present. + $authors = preg_split('/;/', $authorsString); + $firstAuthor = true; + + foreach ($authors as $authorString) { + // Examine the author string. Best case is: Given1 Family1 , Given2 Family2 , etc + // But default to press email address based on press path if not present. + $givenName = $familyName = $emailAddress = null; + $authorString = trim($authorString); // whitespace. + if (preg_match('/^([\w.\s]+)\s+([\w\s-]+)?\s*(<([^>]+)>)?$/', $authorString, $matches)) { + $givenName = $matches[1]; // Mandatory + if (count($matches) > 2) { + $familyName = $matches[2]; + } + if (count($matches) == 5) { + $emailAddress = $matches[4]; } else { - echo __('plugins.importexport.csv.noSeries', array('seriesPath' => $seriesPath)) . "\n"; + $emailAddress = $contactEmail; } + } + $author = $authorDao->newDataObject(); + $author->setSubmissionId($submissionId); + $author->setUserGroupId($authorGroup->getId()); + $author->setGivenName($givenName, $locale); + $author->setFamilyName($familyName, $locale); + $author->setEmail($emailAddress); + $insertPrimaryContactId = false; + + if ($firstAuthor) { + $author->setPrimaryContact(true); + $firstAuthor = false; + $insertPrimaryContactId = true; + } + + + $author->setData('publicationId', $publicationId); + $authorDao->insertObject($author); + + if ($insertPrimaryContactId) { + $publication->setData('primaryContactId', $author->getId()); + } + } // Authors done. + + $publication->setData('abstract', $abstract, $locale); + $publication->setData('title', $title, $locale); + $publicationDao->updateObject($publication); + + // Submission is done. Create a publication format for it. + $publicationFormat = $publicationFormatDao->newDataObject(); + $publicationFormat->setData('submissionId', $submissionId); + $publicationFormat->setData('publicationId', $publicationId); + $publicationFormat->setPhysicalFormat(false); + $publicationFormat->setIsApproved(true); + $publicationFormat->setIsAvailable(true); + $publicationFormat->setProductAvailabilityCode('20'); // ONIX code for Available. + $publicationFormat->setEntryKey('DA'); // ONIX code for Digital + $publicationFormat->setData('name', 'PDF', $submission->getLocale()); + $publicationFormat->setSequence(REALLY_BIG_NUMBER); + + $publicationFormatId = $publicationFormatDao->insertObject($publicationFormat); + + if ($doi) { + $publicationFormatDao->changePubId($publicationFormatId, 'doi', $doi); + } + + + // Create a publication format date for this publication format. + $publicationDate = $publicationDateDao->newDataObject(); + $publicationDate->setDateFormat('05'); // List55, YYYY + $publicationDate->setRole('01'); // List163, Publication Date + $publicationDate->setDate($year); + $publicationDate->setPublicationFormatId($publicationFormatId); + $publicationDateDao->insertObject($publicationDate); + + // Submission File. + import('lib.pkp.classes.file.FileManager'); + import('lib.pkp.classes.core.Core'); + import('classes.file.PublicFileManager'); + + // Submission File. + $fileManager = new FileManager(); + $publicFileManager = new PublicFileManager(); + $extension = $fileManager->parseFileExtension($pdfUrl); + $dirNames = Application::getFileDirectories(); + $submissionDir = sprintf( + '%s/%d/%s/%d', + str_replace('/', '', $dirNames['context']), + $press->getId(), + str_replace('/', '', $dirNames['submission']), + $submissionId + ); + + $filePath = $basePath . '/' . 'submissionPdfs/' . $pdfUrl; + + if (!file_exists($filePath) || !is_readable($filePath)) { + echo __('plugins.importexport.csv.invalidPdfFilename', ['title' => $title]) . "\n"; + exit(); + } + + $mimeType = mime_content_type($filePath); + + /** @var \PKP\services\PKPFileService */ + $fileService = Services::get('file'); + $fileId = $fileService->add( + $filePath, + $submissionDir . '/' . uniqid() . '.' . $extension + ); + + $submissionFile = $submissionFileDao->newDataObject(); + $submissionFile->setData('submissionId', $submissionId); + $submissionFile->setData('uploaderUserId', $user->getId()); + $submissionFile->setSubmissionLocale($submission->getLocale()); + $submissionFile->setGenreId($genre->getId()); + $submissionFile->setFileStage(SUBMISSION_FILE_PROOF); + $submissionFile->setAssocType(ASSOC_TYPE_REPRESENTATION); + $submissionFile->setData('assocId', $publicationFormatId); + $submissionFile->setData('createdAt', Core::getCurrentDate()); + $submissionFile->setDateModified(Core::getCurrentDate()); + $submissionFile->setData('mimetype', $mimeType); + $submissionFile->setData('fileId', $fileId); + $submissionFile->setData('name', pathinfo($filePath, PATHINFO_FILENAME)); + + // Assume open access, no price. + $submissionFile->setDirectSalesPrice(0); + $submissionFile->setSalesType('openAccess'); + + $submissionFileDao->insertObject($submissionFile); + + // Keywords + $keywordsList = [$locale => explode(';', $keywords)]; + if (count($keywordsList[$locale]) > 0) { + $submissionKeywordDao = DAORegistry::getDAO('SubmissionKeywordDAO'); /* @var $submissionKeywordDao SubmissionKeywordDAO */ + $submissionKeywordDao->insertKeywords($keywordsList, $publicationId); + } + + //Subjects + $subjectsList = [$locale => explode(";", $subjects)]; + if (count($subjectsList[$locale]) > 0) { + $submissionSubjectDao = DAORegistry::getDAO('SubmissionSubjectDAO'); /* @var $submissionKeywordDao SubmissionKeywordDAO */ + $submissionSubjectDao->insertSubjects($subjectsList, $publicationId); + } + + // Book Cover Image + $allowedFileTypes = ['gif', 'jpg', 'png', 'webp']; + $coverImgExtension = pathinfo(strtolower($bookCoverImageName), PATHINFO_EXTENSION); + + if (!in_array($coverImgExtension, $allowedFileTypes)) { + echo __('plugins.importexport.common.error.invalidFileExtension'); + exit(); + } - $submissionId = $submissionDao->insertObject($submission); - - $contactEmail = $press->getContactEmail(); - $authorString = trim($authorString, '"'); // remove double quotes if present. - $authors = preg_split('/,\s*/', $authorString); - $firstAuthor = true; - foreach ($authors as $authorString) { - // Examine the author string. Best case is: Given1 Family1 , Given2 Family2 , etc - // But default to press email address based on press path if not present. - $givenName = $familyName = $emailAddress = null; - $authorString = trim($authorString); // whitespace. - if (preg_match('/^(\w+)(\s+\w+)?\s*(<([^>]+)>)?$/', $authorString, $matches)) { - $givenName = $matches[1]; // Mandatory - if (count($matches) > 2) { - $familyName = $matches[2]; - } - if (count($matches) == 5) { - $emailAddress = $matches[4]; - } else { - $emailAddress = $contactEmail; - } - } - $author = $authorDao->newDataObject(); - $author->setSubmissionId($submissionId); - $author->setUserGroupId($authorGroup->getId()); - $author->setGivenName($givenName, $locale); - $author->setFamilyName($familyName, $locale); - $author->setEmail($emailAddress); - if ($firstAuthor) { - $author->setPrimaryContact(1); - $firstAuthor = false; - } - $authorDao->insertObject($author); - } // Authors done. - - $submission->setTitle($title, $locale); - $submissionDao->updateObject($submission); - - // Submission is done. Create a publication format for it. - $publicationFormat = $publicationFormatDao->newDataObject(); - $publicationFormat->setPhysicalFormat(false); - $publicationFormat->setIsApproved(true); - $publicationFormat->setIsAvailable(true); - $publicationFormat->setSubmissionId($submissionId); - $publicationFormat->setProductAvailabilityCode('20'); // ONIX code for Available. - $publicationFormat->setEntryKey('DA'); // ONIX code for Digital - $publicationFormat->setData('name', 'PDF', $submission->getLocale()); - $publicationFormat->setSequence(REALLY_BIG_NUMBER); - $publicationFormatId = $publicationFormatDao->insertObject($publicationFormat); - - if ($doi) { - $publicationFormat->setStoredPubId('doi', $doi); + $coverImagelocale = []; + $coverImage = []; + + if ($bookCoverImageName) { + $sanitizedCoverImageName = str_replace([' ', '_', ':'], '-', strtolower($bookCoverImageName)); + $sanitizedCoverImageName = preg_replace("/[^a-z0-9\.\-]+/", '', $sanitizedCoverImageName); + $sanitizedCoverImageName = basename($sanitizedCoverImageName); + + $coverImage['uploadName'] = uniqid() . '-' . $sanitizedCoverImageName; + $coverImage['altText'] = $bookCoverImageAltText ?? ''; + + $srcFilePath = $basePath . '/' . 'coverImages/' . $bookCoverImageName; + + if (!file_exists($srcFilePath) || !is_readable($srcFilePath)) { + echo __('plugins.importexport.csv.invalidCoverImageFilename', ['title' => $title]) . "\n"; + exit(); + } + + $coverImageData = file_get_contents($srcFilePath); + $coverImageBase64 = base64_encode($coverImageData); + $destFilePath = $publicFileManager->getContextFilesPath($press->getId()) . '/' . $coverImage['uploadName']; + file_put_contents($destFilePath, base64_decode($coverImageBase64)); + + Services::get('publication')->makeThumbnail( + $destFilePath, + Services::get('publication')->getThumbnailFileName($coverImage['uploadName']), + $press->getData('coverThumbnailsMaxWidth'), + $press->getData('coverThumbnailsMaxHeight') + ); + + $coverImagelocale[$locale] = $coverImage; + + $publication->setData('coverImage', $coverImagelocale); + $publicationDao->updateObject($publication); + } + + // Categories + $categoriesList = explode(';', $categories); + if (!empty($categoriesList)) { + $categoryDao = DAORegistry::getDAO('CategoryDAO'); /* @var $categoryDao CategoryDAO */ + + foreach ($categoriesList as $categoryTitle) { + $category = $categoryDao->getByTitle(trim($categoryTitle), $press->getId(), $locale); + + if (!$category) { + echo __('plugins.importexport.csv.noCategorySelected', ['category' => trim($categoryTitle)]) . "\n"; + exit(); } - $publicationFormatDao->updateObject($publicationFormat); - - // Create a publication format date for this publication format. - $publicationDate = $publicationDateDao->newDataObject(); - $publicationDate->setDateFormat('05'); // List55, YYYY - $publicationDate->setRole('01'); // List163, Publication Date - $publicationDate->setDate($year); - $publicationDate->setPublicationFormatId($publicationFormatId); - $publicationDateDao->insertObject($publicationDate); - - // Submission File. - import('lib.pkp.classes.file.TemporaryFileManager'); - import('lib.pkp.classes.file.FileManager'); - - $temporaryFileManager = new TemporaryFileManager(); - $temporaryFilename = tempnam($temporaryFileManager->getBasePath(), 'remote'); - $temporaryFileManager->copyFile($pdfUrl, $temporaryFilename); - $submissionFile = $submissionFileDao->newDataObject(); - $submissionFile->setSubmissionId($submissionId); - $submissionFile->setSubmissionLocale($submission->getLocale()); - $submissionFile->setGenreId($genre->getId()); - $submissionFile->setFileStage(SUBMISSION_FILE_PROOF); - $submissionFile->setDateUploaded(Core::getCurrentDate()); - $submissionFile->setDateModified(Core::getCurrentDate()); - $submissionFile->setAssocType(ASSOC_TYPE_REPRESENTATION); - $submissionFile->setAssocId($publicationFormatId); - $submissionFile->setFileType('application/pdf'); - - // Assume open access, no price. - $submissionFile->setDirectSalesPrice(0); - $submissionFile->setSalesType('openAccess'); - - $submissionFileDao->insertObject($submissionFile, $temporaryFilename); - $fileManager = new FileManager(); - $fileManager->deleteByPath($temporaryFilename); - - echo __('plugins.importexport.csv.import.submission', array('title' => $title)) . "\n"; - } else { - echo __('plugins.importexport.csv.unknownLocale', array('locale' => $locale)) . "\n"; + $categoryDao->insertPublicationAssignment($category->getId(), $publicationId); } - } else { - echo __('plugins.importexport.csv.unknownPress', array('pressPath' => $pressPath)) . "\n"; } + + echo __('plugins.importexport.csv.import.submission', ['title' => $title]) . "\n"; } } } @@ -261,11 +418,9 @@ function executeCLI($scriptName, &$args) { * Display the command-line usage information */ function usage($scriptName) { - echo __('plugins.importexport.csv.cliUsage', array( + echo __('plugins.importexport.csv.cliUsage', [ 'scriptName' => $scriptName, 'pluginName' => $this->getName() - )) . "\n"; + ]) . "\n"; } } - - diff --git a/plugins/importexport/csv/README.md b/plugins/importexport/csv/README.md new file mode 100644 index 00000000000..239784c74e7 --- /dev/null +++ b/plugins/importexport/csv/README.md @@ -0,0 +1,47 @@ +# CSV Import Plugin for OMP +This application will convert a CSV file into a list of OMP publications/submissions. If the user has book cover images, as well as submission PDFs, these files should be stored in the `coverImages` and `submissionPdfs`, respectively, for your correct usage. + +> Note: This is NOT a comprehensive CSV converter, and many fields are left out. + +## 1. How to Use +From the CLI command, you should use this way, starting on the OMP root directory: + +``` +php tools/importExport.php CSVImportExportPlugin /.csv +``` + +, where `` is where the CSV file is located, `` is the name of the CSV file you want to add the books and `` is a valid OMP username registered. + +> Note: The `` will be used also to get the assets (the Book PDF and the cover image). It'll be explained later. + +## 2. About the CSV file + +### 2.1. Description +The CSV must be in this format: + +`pressPath,authorString,title,abstract,seriesPath,year,isEditedVolume,locale,filename,doi,keywords,subjects,bookCoverImage,bookCoverImageAltText,categories` + +1. **pressPath**: **(required)** is the path for the press the user wants to insert a publication. If this field is not present, the tool will jump for the other line of CSV file. +2. **authorString**: is the list of authors presents on the submission. For each author, it contains the Surname, the given name and the email address. For each author, the string format must be on the following format: `Author1 Surname1`. Each author must be separated by a semicolon (e.g. `Author1 Surname1;Author2 Surname2`). +3. **title**: **(required)** the submission's title. +4. **abstract**: **(required)** the submission's abstract. +5. **seriesPath**: the path for the series this submission is included. +6. **year**: the submission's year. +7. **isEditedVolume**: sets the `work_type` for the submission. +8. **locale**: **(required)** the submission's locale. Must be one of the supported locales for this press. If it's not present, the tool will jump for the next CSV line and will not include this submission. +9. **filename**: **(required)** the PDF file name that must be present on the `submissionPdfs` directory for this submission. +10. **doi**: the submission's DOI link. +11. **keywords**: the submission's keywords. If the submission presents more than one keyword, they need to be separated by a semicolon (e.g. `keyword1;keyword2`); +12. **subjects**: the submission's subjects. If the submission presents more than one subject, they need to be separated by a semicolon (e.g. `subject1;subject2`); +13. **bookCoverImage**: the book cover image filename. This file must be on the directory `coverImages` and ought to be in one of these formats: *gif, jpg, png or webp*. If the image isn't in one of these formats, it won't be added to the submission. +14. **bookCoverImageAltText**: the alt text for the book cover image. It'll only work if the bookCoverImage is present. +15. **categories**: the submission's categories. All categories present here must be already added to the Press to work correctly. If the submission presents more than one category, they must be separated by a semicolon (e.g. `Category 1;Category 2`). + +## 3. Instructions +1. Fill the CSV file correctly. You can use the `sample.csv` file as an example. +2. Place your CSV file in a place of your preference. +3. If there's any Book PDF or Cover Images, starting on the same directory where the CSV file is located, create the directory `submissionPdfs` and the directory `coverImages`. +4. Place the Submission PDFs on the `submissionPdfs` directory and the cover images on the `coverImages` directory, respectively. + > Note: the Submission PDFs and the cover images must have the same name as in the CSV file. +5. Run the command present on the [How to Use](#1-how-to-use) section. +6. The commands should run correctly and add all the submissions present on it. diff --git a/plugins/importexport/csv/index.php b/plugins/importexport/csv/index.php index 1795161cceb..9328bdc0729 100644 --- a/plugins/importexport/csv/index.php +++ b/plugins/importexport/csv/index.php @@ -12,7 +12,7 @@ * Distributed under the GNU GPL v3. For full terms see the file docs/COPYING. * * @ingroup plugins_importexport_csv - * @brief Wrapper for tab delimited data import/export plugin. + * @brief Wrapper for CSV data import/export plugin. * */ diff --git a/plugins/importexport/csv/locale/en_US/locale.po b/plugins/importexport/csv/locale/en_US/locale.po index 33680cc915c..80f59e9d3cd 100644 --- a/plugins/importexport/csv/locale/en_US/locale.po +++ b/plugins/importexport/csv/locale/en_US/locale.po @@ -65,3 +65,12 @@ msgstr "Submission: '{$title}' successfully imported." msgid "plugins.importexport.csv.import.success.description" msgstr "" "The import was successful. Successfully-imported items are listed below." + +msgid "plugins.importexport.csv.noCategorySelected" +msgstr "Category '{$category}' does not exist. Unable to add it to this. Exiting." + +msgid "plugins.importexport.csv.invalidPdfFilename" +msgstr "Invalid PDF name for submission '{$title}'." + +msgid "plugins.importexport.csv.invalidCoverImageFilename" +msgstr "Invalid cover image filename for submission '{$title}'" diff --git a/plugins/importexport/csv/sample.csv b/plugins/importexport/csv/sample.csv new file mode 100644 index 00000000000..f9b8dc8a828 --- /dev/null +++ b/plugins/importexport/csv/sample.csv @@ -0,0 +1,2 @@ +pressPath,authorString,title,abstract,seriesPath,year,isEditedVolume,locale,filename,doi,keywords,subjects,bookCoverImage,bookCoverImageAltText,categories +leo,Author1 Surname1;Author2 Surname2,Title text,Abstract text,,2024,1,en_US,submission.pdf,10.1111/hex.12487,keyword1;keyword2;keyword3,subject1;subject2,coverImage.png,"Alt text, with commas",Category 1;Category 2;Category 3 diff --git a/plugins/importexport/csv/version.xml b/plugins/importexport/csv/version.xml index b0cc8f90cf8..6aba51b6cd3 100644 --- a/plugins/importexport/csv/version.xml +++ b/plugins/importexport/csv/version.xml @@ -13,6 +13,6 @@ csv plugins.importexport - 1.0.0.0 + 1.0.1.0 2014-07-25