Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
b6128f6
Complete most aspects of the transfer service.
Aug 27, 2025
11af592
Most changes completed minus final task to create article page and in…
Aug 27, 2025
5d4c773
Update minor typos.
Aug 27, 2025
0141c61
Rewrites to exclude the need for a journal to be handed over.
Aug 27, 2025
4a6a413
Updates to create a singleton class service to be utilized easily.
Aug 27, 2025
b4a4cff
Updates to fix build issues during plugin installation.
Aug 28, 2025
6479000
Cleanup code and add simple testing.
Aug 28, 2025
38968b6
Update tests and code cleanup
Aug 29, 2025
59c9654
Added the settings manager page for the plugin.
Aug 29, 2025
dce160e
Complete all pending work.
Aug 29, 2025
31681bb
Update tests to add more complexity.
Sep 2, 2025
7ecfa36
Update testing for automatic runs.
Sep 2, 2025
31c0aae
Update django.yml
RoseReatherford Sep 2, 2025
408c874
Update django.yml
RoseReatherford Sep 2, 2025
f387555
Update django.yml
RoseReatherford Sep 2, 2025
565aed5
Update django.yml
RoseReatherford Sep 2, 2025
091571d
Update django.yml
RoseReatherford Sep 2, 2025
8a3c5c5
Add init.
Sep 2, 2025
e7a2065
Update django.yml
RoseReatherford Sep 2, 2025
8b58e73
Add src to python path. Add janeway settings module.
Sep 2, 2025
7f4eb39
Remove export.
Sep 2, 2025
2e80da1
Add working directory.
Sep 2, 2025
9dec926
Update environment variable.
Sep 2, 2025
a950b9c
Update shell.
Sep 2, 2025
938eb87
Add environment variable.
Sep 2, 2025
56a5978
Add Django Settings module to environment.
Sep 2, 2025
5c1e2a2
Use Django Test Runner
RoseReatherford Sep 3, 2025
2d18404
Update based on feedback
Sep 3, 2025
19d603b
Update mock.
Sep 3, 2025
b38261e
Add the journal code to calls for finding the article.
Sep 3, 2025
96b1f6c
Update readme to include instructions regarding the `PYTHONPATH` for …
Sep 4, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 23 additions & 7 deletions .github/workflows/django.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,25 +17,41 @@ jobs:

steps:
- name: Fetch Main Janeway Branch
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
repository: PLOS/janeway
ref: develop
path: /home/runner/work/editorial_manager_transfer_service/editorial_manager_transfer_service/janeway
- name: Fetch Editorial Manager Transfer Service
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
path: /home/runner/work/editorial_manager_transfer_service/editorial_manager_transfer_service/janeway/src/plugins/editorial_manager_transfer_service
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
path: /home/runner/work/editorial_manager_transfer_service/editorial_manager_transfer_service/janeway
- name: Cache pip dependencies
uses: actions/cache@v4
with:
path: ~/.cache/pip # Path to pip's cache directory
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }} # Unique cache key
restore-keys: |
${{ runner.os }}-pip-
- name: Install Dependencies
working-directory: /home/runner/work/editorial_manager_transfer_service/editorial_manager_transfer_service/janeway
run: |
python -m pip install --upgrade pip
sudo find . -name "*requirements.txt" -type f -exec pip3 install -r '{}' ';'
find . -name "*requirements.txt" -type f -exec pip install -r '{}' ';'
- name: Add `src` to Python Path
run: |
echo "PYTHONPATH=/home/runner/work/editorial_manager_transfer_service/editorial_manager_transfer_service/janeway/src" >> $GITHUB_ENV
shell: bash
- name: Import the Default Janeway Settings
run: |
cp /home/runner/work/editorial_manager_transfer_service/editorial_manager_transfer_service/janeway/src/core/dev_settings.py /home/runner/work/editorial_manager_transfer_service/editorial_manager_transfer_service/janeway/src/core/settings.py
- name: Run Tests
env:
JANEWAY_SETTINGS_MODULE: core.settings
DJANGO_SETTINGS_MODULE: core.settings
working-directory: /home/runner/work/editorial_manager_transfer_service/editorial_manager_transfer_service/janeway
run: |
pytest /home/runner/work/editorial_manager_transfer_service/editorial_manager_transfer_service/janeway/src/plugins/editorial_manager_transfer_service/
python src/manage.py test editorial_manager_transfer_service
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
/.venv/
/editorial_manager_transfer_service.iml
/.idea/
/.hypothesis/
80 changes: 80 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,83 @@ A plugin to provide information for Aries' Editorial Manager to enable automatic

## Requirements
This plugin depends on the Production Transporter plugin in order to work properly.

## Development Tips
This section contains guidance for developing this plugin.

For the purposes of this guide we'll refer to the Janeway installation folder as `[workspace]`.

The plugin's installation folder is assumed to be `[workspace]/src/plugins/editorial_manager_transfer_service`.

### Adding The Janeway SRC to the `PYTHONPATH`
Adding the Janeway SRC folder to the `PYTHONPATH` can help any type of IDE correctly identify imports while developing plugins.

#### Instructions for Python Virtual Environment (VENV)
First, open your `activate` file in a text editor. It is located at:
```text
[workspace]/.venv/bin/activate
```
Once open, scroll to find the following text section:
```bash
VIRTUAL_ENV="[workspace]/.venv"
if ([ "$OSTYPE" = "cygwin" ] || [ "$OSTYPE" = "msys" ]) && $(command -v cygpath &> /dev/null) ; then
VIRTUAL_ENV=$(cygpath -u "$VIRTUAL_ENV")
fi
export VIRTUAL_ENV


_OLD_VIRTUAL_PATH="$PATH"
PATH="$VIRTUAL_ENV/bin:$PATH"
export PATH
```
Please note and change the `[worksapce]` variable to your Janeway installation path.

You will modify this section to become the following:
```bash
_PYTHON_ENV_PKG='[workspace]'
VIRTUAL_ENV="$_PYTHON_ENV_PKG/.venv"
if ([ "$OSTYPE" = "cygwin" ] || [ "$OSTYPE" = "msys" ]) && $(command -v cygpath &> /dev/null) ; then
VIRTUAL_ENV=$(cygpath -u "$VIRTUAL_ENV")
fi
export VIRTUAL_ENV

_OLD_VIRTUAL_PATH="$PATH"
PATH="$VIRTUAL_ENV/bin:$PATH"
export PATH

_OLD_VIRTUAL_PYTHONPATH="$PYTHONPATH"
PYTHONPATH="$_PYTHON_ENV_PKG:$PYTHONPATH"
export PYTHONPATH
```
Next you will modify the `deactivate()` script. Scroll until you find this section of script:
```bash
deactivate () {
unset -f pydoc >/dev/null 2>&1 || true

# reset old environment variables
# ! [ -z ${VAR+_} ] returns true if VAR is declared at all
if ! [ -z "${_OLD_VIRTUAL_PATH:+_}" ] ; then
PATH="$_OLD_VIRTUAL_PATH"
export PATH
unset _OLD_VIRTUAL_PATH
fi
if ! [ -z "${_OLD_VIRTUAL_PYTHONHOME+_}" ] ; then
PYTHONHOME="$_OLD_VIRTUAL_PYTHONHOME"
export PYTHONHOME
unset _OLD_VIRTUAL_PYTHONHOME
fi
```
Modify it to add the `PYTHONPATH` deactivation:
```bash
...
unset _OLD_VIRTUAL_PATH
fi
if ! [ -z "${_OLD_VIRTUAL_PYTHONPATH:+_}" ] ; then
PYTHONPATH="$_OLD_VIRTUAL_PYTHONPATH"
export PYTHONPATH
unset _OLD_VIRTUAL_PYTHONPATH
fi
if ! [ -z "${_OLD_VIRTUAL_PYTHONHOME+_}" ] ; then
...
```
After restarting your IDE, you should see it properly detect the SRC folder.
48 changes: 48 additions & 0 deletions consts.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import os

from django.conf import settings

# Plugin Settings
PLUGIN_NAME = 'Editorial Manager Transfer Service Plugin'
DISPLAY_NAME = 'Editorial Manager Transfer Service'
DESCRIPTION = 'A plugin to provide information for Aries\' Editorial Manager to enable automatic transfers.'
AUTHOR = 'PLOS'
VERSION = '0.1'
SHORT_NAME = 'editorial_manager_transfer_service'
MANAGER_URL = 'editorial_manager_transfer_service_manager'
JANEWAY_VERSION = "1.8.0"

# Setting Configuration
PLUGIN_SETTINGS_GROUP_NAME = "plugin:editorial_manager_transfer_service"
PLUGIN_SETTINGS_LICENSE_CODE = "license_code"
PLUGIN_SETTINGS_JOURNAL_CODE = "journal_code"
PLUGIN_SETTINGS_SUBMISSION_PARTNER_CODE = "submission_partner_code"

# Import and export filepaths
EXPORT_FILE_PATH = os.path.join(settings.BASE_DIR, 'files', 'plugins', 'editorial-manager-transfer-service', 'export')
IMPORT_FILE_PATH = os.path.join(settings.BASE_DIR, 'files', 'plugins', 'editorial-manager-transfer-service', 'import')

# XML File
GO_FILE_ELEMENT_TAG_GO = "GO"
GO_FILE_GO_ELEMENT_ATTRIBUTE_XMLNS_XSI_KEY = "xmlns:xsi"
GO_FILE_GO_ELEMENT_ATTRIBUTE_XMLNS_XSI_VALUE = "http://www.w3.org/2001/XMLSchema-instance"
GO_FILE_GO_ELEMENT_ATTRIBUTE_SCHEMA_LOCATION_KEY = "xsi:noNamespaceSchemaLocation"
GO_FILE_GO_ELEMENT_ATTRIBUTE_SCHEMA_LOCATION_VALUE = "app://Aries.EditorialManager/Resources/XmlDefineTransformFiles/aries_import_go_file.xsd"
GO_FILE_ELEMENT_TAG_HEADER = "header"
GO_FILE_ELEMENT_TAG_VERSION = "version"
GO_FILE_VERSION_ELEMENT_ATTRIBUTE_NUMBER_KEY = "number"
GO_FILE_VERSION_ELEMENT_ATTRIBUTE_NUMBER_VALUE = "1.0"
GO_FILE_ELEMENT_TAG_JOURNAL = "journal"
GO_FILE_JOURNAL_ELEMENT_ATTRIBUTE_CODE_KEY = "code"
GO_FILE_ELEMENT_TAG_IMPORT_TYPE = "import-type"
GO_FILE_IMPORT_TYPE_ELEMENT_ATTRIBUTE_ID_KEY = "id"
GO_FILE_IMPORT_TYPE_ELEMENT_ATTRIBUTE_ID_VALUE = "2"
GO_FILE_ELEMENT_TAG_PARAMETERS = "parameters"
GO_FILE_ELEMENT_TAG_PARAMETER = "parameter"
GO_FILE_ATTRIBUTE_ELEMENT_NAME_KEY = "name"
GO_FILE_PARAMETER_ELEMENT_NAME_VALUE = "license-code"
GO_FILE_PARAMETER_ELEMENT_VALUE_KEY = "value"
GO_FILE_ELEMENT_TAG_ARCHIVE_FILE = "archive-file"
GO_FILE_ELEMENT_TAG_FILEGROUP = "filegroup"
GO_FILE_ELEMENT_TAG_FILE = "file"
GO_FILE_ELEMENT_TAG_METADATA_FILE = "metadata-file"
3 changes: 2 additions & 1 deletion dev-requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
pytest
hypothesis==6.138.7
pytest==8.4.1
Loading
Loading