diff --git a/.gitignore b/.gitignore index a8941bc..c6ddcdb 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ .DS_Store .DS_Store? +.vscode environment/data environment/config.inc.php diff --git a/docs/Sphinx-guides/source/developerGuide/debugging.md b/docs/Sphinx-guides/source/developerGuide/debugging.md new file mode 100644 index 0000000..b3c6975 --- /dev/null +++ b/docs/Sphinx-guides/source/developerGuide/debugging.md @@ -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" + } +} +``` \ No newline at end of file diff --git a/docs/Sphinx-guides/source/developerGuide/devGuidance.md b/docs/Sphinx-guides/source/developerGuide/devGuidance.md index 09ee2c7..9246808 100644 --- a/docs/Sphinx-guides/source/developerGuide/devGuidance.md +++ b/docs/Sphinx-guides/source/developerGuide/devGuidance.md @@ -1,40 +1,30 @@ # 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 ``/templates`` or the ``/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 `/templates` or the `/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. @@ -42,36 +32,36 @@ We have created a custom CSS file to style the forms and hide some of the fields 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 \ No newline at end of file + * `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 \ No newline at end of file diff --git a/docs/Sphinx-guides/source/developerGuide/index.md b/docs/Sphinx-guides/source/developerGuide/index.md index d5447dc..145a922 100644 --- a/docs/Sphinx-guides/source/developerGuide/index.md +++ b/docs/Sphinx-guides/source/developerGuide/index.md @@ -9,4 +9,6 @@ deployment devGuidance testing guides -useCases/index \ No newline at end of file +useCases/index +scheduledTasks +debugging \ No newline at end of file diff --git a/docs/Sphinx-guides/source/developerGuide/scheduledTasks.md b/docs/Sphinx-guides/source/developerGuide/scheduledTasks.md new file mode 100644 index 0000000..cc2426f --- /dev/null +++ b/docs/Sphinx-guides/source/developerGuide/scheduledTasks.md @@ -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** \ No newline at end of file diff --git a/docs/Sphinx-guides/source/userGuide/researchDocumentTypes.md b/docs/Sphinx-guides/source/userGuide/researchDocumentTypes.md index 195d8a3..ddb79d3 100644 --- a/docs/Sphinx-guides/source/userGuide/researchDocumentTypes.md +++ b/docs/Sphinx-guides/source/userGuide/researchDocumentTypes.md @@ -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. \ No newline at end of file