Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Guide content may 23 #9

Merged
merged 2 commits into from
May 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.DS_Store
.DS_Store?
.vscode

environment/data
environment/config.inc.php
Expand Down
19 changes: 19 additions & 0 deletions docs/Sphinx-guides/source/developerGuide/debugging.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Debugging

Depending on your IDE and environment debugging the application can have different configurations.

## VS Code & Docker

To enable debugging on VS Code you will need the [PHP Extension pack](https://marketplace.visualstudio.com/items?itemName=xdebug.php-pack), create a configuration file, and update this section:

```
{
"name": "Listen for Xdebug",
"type": "php",
"request": "launch",
"port": 9003,
"pathMappings": {
"/tmp/ojs-src": "${workspaceFolder}/environment/data/ojs/src"
}
}
```
66 changes: 28 additions & 38 deletions docs/Sphinx-guides/source/developerGuide/devGuidance.md
Original file line number Diff line number Diff line change
@@ -1,77 +1,67 @@
# Development guidance

## Plugin Development
When starting the local environment, the contents of the PPR plugin is mounted into the OJS ``plugins/generic`` directory and it will be ready to use.
When starting the local environment, the contents of the PPR plugin are mounted into the OJS `plugins/generic` directory and it will be ready to use.

The OJS code in the Docker container is mounted into the ``environment/data/ojs/src`` local folder for review and debugging.
The OJS code in the Docker container is mounted into the `environment/data/ojs/src` local folder for review and debugging.

The local Docker image has been created with PHP XDebug to allow local debugging.

## Template Override
OJS provides a mechanism for plugins to override templates. This is achieved by using an OJS Hook to intercept the template file lookup.
The ``services/PPRTemplateOverrideService`` is managing the templates that the PPR plugin overrides.

The overridden templates are located within the ``templates``, with the same path as original OJS template. This makes it easier to locate the original templates in case changes need to be added to our version.
The `services`/PPRTemplateOverrideService` manages the templates that the PPR plugin overrides.

In OJS, templates are located within the ``<root>/templates`` or the ``<root>/lib/pkp/templates`` folders
The overridden templates are located within the `templates`, with the same path as the original OJS template. This makes it easier to locate the original templates in case changes need to be added to our version.

In OJS, templates are located within the `<root>/templates` or the `<root>/lib/pkp/templates` folders

We have developed a mechanism to wrap existing templates and load the original template with the new wrapper.
This is achieved by using the OJS ``TemplateManager`` feature ``include`` and the template suffix ``.load_ojs``.
This is achieved by using the OJS `TemplateManager` feature `include` and the template suffix `.load_ojs`.

There is an example in ``templates/submission/submissionMetadataFormTitleFields.tpl``
There is an example in `templates/submission/submissionMetadataFormTitleFields.tpl`

## Component Handler Override
We have implemented an override for the OJS ``AuthorGridHandler`` in order to fulfill the PPR program requirements. Handler override is one of the features supported by the OJS plugin framework.

The ``services/PPRWorkflowService`` has an example of how to override a component handler.

## Scheduled Tasks
The recommendation from OJS to implement scheduled tasks was to use the OJS ``acron`` plugin.
This plugin allows other plugin to configure scheduled tasks.
The ``acron`` plugin does not use the OS crontab functionality to operate. Instead, it is executed in each OJS request and determines if any of the scheduled tasks need to be executed.

To configure the PPR plugin scheduled tasks, we need to reload the ``acron`` plugin. This needs to be requested to the PKP team.

The PPR plugin scheduled tasks are configured in the ``./scheduledTasks.xml`` file.
We have implemented an override for the OJS `AuthorGridHandler` to fulfill the PPR program requirements. Handler override is one of the features supported by the OJS plugin framework.

The code for all scheduled tasks are under the ``tasks`` folder.
The `services/PPRWorkflowService` has an example of how to override a component handler.

## CSS Updates
We have created a custom CSS file to style the forms and hide some of the fields in the OJS frontend and backend.

In OJS terminology, frontend is the reader's website, where the homepage, registration, and articles are displayed.
The backend is the admin interface where submissions, reviews, and the site administration are displayed.

The configuration for the custom CSS is in the ``PeerPreReviewProgramPlugin`` class and the file is under ``css/iqss.css``
The configuration for the custom CSS is in the `PeerPreReviewProgramPlugin` class and the file is under `css/iqss.css`

## Feature Flags
Most of the PPR features has been added to the plugin behind feature flags.
Most of the PPR features have been added to the plugin behind feature flags.
This has been implemented to reduce the risk of deployments as there is no test environment available.

The list of feature flags are configured in: ``pprOjsPlugin/settings/PPRPluginSettingsForm.inc.php``
The list of feature flags is configured in: `pprOjsPlugin/settings/PPRPluginSettingsForm.inc.php`

To follow how they are used, look at the usage of the settings class: ``pprOjsPlugin/settings/PPRPluginSettings.inc.php``
To follow how they are used, look at the usage of the settings class: `pprOjsPlugin/settings/PPRPluginSettings.inc.php`

## OJS reports
We can create custom reports and deploy them as plugins within the OJS plugins infrastructure.

Report plugins are very simple, we just need to create the report in a method called ``display`` within the plugin class.
Report plugins are very simple, we just need to create the report in a method called `display` within the plugin class.
This method will be executed when the report is launched within the user interface.

See the ``pprReportPlugin`` folder for more details on how to create a report plugin.
See the `pprReportPlugin` folder for more details on how to create a report plugin.

## Custom Email Templates
These are the custom email templates created for the PPR program.

* ``PPR_SUBMISSIONS_REPORT_TASK`` => pprReviewsReportPlugin/taks/PPREditorReportTask.inc.php
* ``PPR_REVIEW_DUE_DATE_EDITOR`` => pprOjsPlugin/tasks/PPRReviewDueDateEditorNotification.inc.php
* ``PPR_REVIEW_DUE_DATE_REVIEWER`` => pprOjsPlugin/tasks/PPRReviewReminder.inc.php
* ``PPR_REVIEW_REQUEST_DUE_DATE_REVIEWER`` => pprOjsPlugin/services/email/PPRReviewReminderEmailService.inc.php
* ``PPR_REQUESTED_REVIEWER_UNASSIGN`` => pprOjsPlugin/services/reviewer/PPRUnassignReviewerForm.inc.php
* ``PPR_CONFIRMED_REVIEWER_UNASSIGN`` => pprOjsPlugin/services/reviewer/PPRUnassignReviewerForm.inc.php
* ``PPR_SUBMISSION_APPROVED`` => pprOjsPlugin/services/submission/PPRSubmissionActionsService.inc.php
* ``PPR_REVIEW_ACCEPTED`` => pprOjsPlugin/services/reviewer/PPRReviewAcceptedService.inc.php
* ``PPR_REVIEW_SUBMITTED`` => pprOjsPlugin/services/reviewer/PPRReviewSubmittedService.inc.php
* ``PPR_REVIEW_DUE_DATE_WITH_FILES_REVIEWER`` => pprOjsPlugin/tasks/PPRReviewReminder.inc.php
* ``PPR_REVIEW_PENDING_WITH_FILES_REVIEWER`` => pprOjsPlugin/tasks/PPRReviewReminder.inc.php
* ``PPR_REVIEW_SENT_AUTHOR`` => pprOjsPlugin/tasks/PPRReviewSentAuthorNotification.inc.php
* `PPR_SUBMISSIONS_REPORT_TASK` => pprReviewsReportPlugin/taks/PPREditorReportTask.inc.php
* `PPR_REVIEW_DUE_DATE_EDITOR` => pprOjsPlugin/tasks/PPRReviewDueDateEditorNotification.inc.php
* `PPR_REVIEW_DUE_DATE_REVIEWER` => pprOjsPlugin/tasks/PPRReviewReminder.inc.php
* `PPR_REVIEW_REQUEST_DUE_DATE_REVIEWER` => pprOjsPlugin/services/email/PPRReviewReminderEmailService.inc.php
* `PPR_REQUESTED_REVIEWER_UNASSIGN` => pprOjsPlugin/services/reviewer/PPRUnassignReviewerForm.inc.php
* `PPR_CONFIRMED_REVIEWER_UNASSIGN` => pprOjsPlugin/services/reviewer/PPRUnassignReviewerForm.inc.php
* `PPR_SUBMISSION_APPROVED` => pprOjsPlugin/services/submission/PPRSubmissionActionsService.inc.php
* `PPR_REVIEW_ACCEPTED` => pprOjsPlugin/services/reviewer/PPRReviewAcceptedService.inc.php
* `PPR_REVIEW_SUBMITTED` => pprOjsPlugin/services/reviewer/PPRReviewSubmittedService.inc.php
* `PPR_REVIEW_DUE_DATE_WITH_FILES_REVIEWER` => pprOjsPlugin/tasks/PPRReviewReminder.inc.php
* `PPR_REVIEW_PENDING_WITH_FILES_REVIEWER` => pprOjsPlugin/tasks/PPRReviewReminder.inc.php
* `PPR_REVIEW_SENT_AUTHOR` => pprOjsPlugin/tasks/PPRReviewSentAuthorNotification.inc.php
4 changes: 3 additions & 1 deletion docs/Sphinx-guides/source/developerGuide/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,6 @@ deployment
devGuidance
testing
guides
useCases/index
useCases/index
scheduledTasks
debugging
16 changes: 16 additions & 0 deletions docs/Sphinx-guides/source/developerGuide/scheduledTasks.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Scheduled Tasks

For scheduled tasks, we use the [`Acron`](https://github.com/pkp/acron) plugin which is developed and recommended by OJS. It is important to note that this plugin relies on a request to execute the scheduled tasks, if the application is not used it won't be able to execute the scheduled tasks. This is not an issue in live environments since a web crawler or normal traffic normally triggers this functionality.


## Reloading scheduled tasks

Please note that this functionality is only available to administrators, the `Acron` plugin provides the option `Reload Scheduled Tasks` on:

```
Settings > Website > Plugins > Generic Plugins > Acron > Reload Scheduled Task
```

These tasks are configured on:
- **pprOjsPlugin/scheduledTasks.xml**
- **pprReviewsReportPlugin/scheduledTasks.xml**
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
To configure the Research Document Types the user can access the **IQSS Peer Pre-Review Program Plugin** configuration on:

```
Settings > Website > Plugins > IQSS Peer Pre-Review Program Plugin > Settings
Settings > Website > Plugins > Generic Plugins > IQSS Peer Pre-Review Program Plugin > Settings
```

Under the **Submissions** section, you will be able to change the values of this list on the *Research type* field.