This project contains multiple tools that help generate OJS native xml files.
conda env create -f environment.yaml
conda activate ojs-tools
┌───────────┐ ┌─────────────┐ ┌────────────────┐ ┌────────────────────┐ ┌────────────────┐
│source data├───►│csv processor├───►│intermediate.csv├───►│ojs_xml_processor.py├───►│ojs native xml's│
└───────────┘ └─────────────┘ └────────────────┘ └────────────────────┘ └────────────────┘
- The
source data
can be in every format. - The
CSV processor
should convert the data to theintermediate.csv
-format. - The
ojs_xml_processor.py
will process the intermediate-format to severalojs native xml's
. An xml-file is created for each issue described in theintermediate.csv
.
For each archive a custom CSV processor should be created.
This processor should be found valid by output_csv_validator.py
.
Is a custom csv processor for the tvho project.
It will create input for ojs-xml-generator
.
python tvho_csv_processor.py --input_csv /path/to/input.csv --output_csv /path/to/output.csv --files_path /path/to/documents
files_path
, a folder that should contain all the files mentioned in thecsv_file
-file.
Opening the output of this processor might alter its contents, causing errors when using the 'OJS XML Generator'.
Makes sure the output from CSV processors complies to all the requirements of the OJS XML Generator.
It contains a method validate_csv
that can be used in your CSV processor.
python output_csv_validator.py --csv /path/to/data.csv
Field | Contents | Required? |
---|---|---|
id | A numberical ID, from 1 to X | Yes |
title | The title of the article | Yes |
publication | The title of the issue, if it has one (e.g. themed issues) | Yes |
abstract | The abstract of the article | Yes |
file | A full path to the file corresponding with the article text | Yes |
publication_date | the date of publication, structured as yyyy-mm-dd | Yes |
volume | the volume number | Yes |
year | year of the issue | Yes |
issue | the issue number, as a string | Yes |
page_number | the page numbers | Yes |
section_title | the title of the section | Yes |
section_policy | the section policy (won't be shown) | Yes |
section_reference | the short code for the section (won't be shown, but should be the same for every instance of section title x) | Yes |
doi | the full DOI | no |
author_given_name_x | first name of the author. Make sure they're empty if there is no author x. | Yes |
author_family_name_x | last name of the author. Make sure they're empty if there is no author x. | Yes |
Creates XML-files for the OJS NativeImportExportPlugin
.
The XML-files are self-contained.
python ojs-xml-generator.py --csv_file /path/to/data.csv --output_path /path/to/output/folder --journal_name "name of journal"
csv_file
should be in the structure created byojs-csv-processor
.output_path
should point an existing folder.journal_name
is included in the XML as '<title>' element and should be the full title of the journal. This is where the XMLs are stored. Optional parametersauthor_group
describes the group within the system the authors of the articles are part of. This property has a default valueAuthor
. This default value is the English variant each language has its own. The Dutch variant isAuteur
.submission_file_genre
is used for thegenre
-field of thesubmission_file
-element The default value isArticle Text
, the English variant. The Dutch variant isArtikeltekst
.locale
the locale used when importing, default value is 'en'. Make sure thelocale
,author_group
andsubmission_file_genre
are the same language.
A call for a Dutch-language journal would then look like this:
python ojs-xml-generator.py --csv_file /path/to/data.csv --output_path /path/to/output/folder --journal_name "name of journal" --author_group Auteur --submission_file_genre Artikeltekst --locale nl
Uploads the xml's to a journal. Place the script in the root-folder of your OJS installation.
./ojs_import.sh /path/to/folder/of/xmls path_of_journal
/path/to/folder/of/xmls
contains the OJS native xml files.path_of_journal
the path property of the magazine configured in OJS.