Skip to content

munir-abbasi/dummyDataGenerator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dummy Data Generator Plugin for Open Journal Systems 3.5+

A generic plugin that extends the OJS API to generate dummy users, submissions, and published issues. This tool programmatically applies editorial decisions to rapidly simulate an active journal state, making it ideal for testing, development, and demonstration environments.


Key Features

  • Generate users automatically assigned with the Author role in the current journal context.
  • Generate populated submissions (including metadata and placeholder manuscript files).
  • Programmatically apply editorial decisions to simulate workflow progression from submission to production.
  • Create and publish standalone issues populated with generated submissions.
  • Automatically track all generated data for safe, reversible cleanup.

Requirements

  • Open Journal Systems (OJS) 3.5.x or newer
  • PHP 8.2+
  • Journal Manager or Site Administrator access

Installation

  1. Copy or clone this plugin directory into your OJS installation:
    /plugins/generic/dummyDataGenerator
  2. Clear the application cache (e.g., via the Administrator backend or php tools/clearCache.php).
  3. Enable the plugin via Website Administration → Plugins.

API Usage

This plugin extends the OJS API by adding custom routes to the existing /api/v1/users entity.

All plugin-defined routes are available under:

/index.php/{journal_path}/api/v1/users/

Endpoints

1. Generate Users

POST /api/v1/users/generate-users

(Accepts a count integer parameter. Defaults to 10.)

2. Generate Submissions

POST /api/v1/users/generate-submissions

(Accepts a count integer parameter. Defaults to 20. Requires existing dummy users.)

3. Generate Issue

POST /api/v1/users/generate-issue

(Packages previously generated submissions into a newly published issue.)

4. Cleanup

DELETE /api/v1/users/cleanup?confirm=DELETE_ALL_DUMMY_DATA

(Deletes only the dummy users, submissions, and issues generated by this plugin within the current journal context. Requires the explicit confirmation string.)

📌 Note: These endpoints are plugin-defined extensions. They are not part of the core OJS REST API. Full details and JSON response shapes are available in API_DOCUMENTATION.md.


Authentication

Authentication and authorization are inherited from and handled natively by the OJS API layer. The plugin does not implement its own token or authentication system.

  • Requests must satisfy standard OJS API authentication.
  • Typically, requests must include an API key via the Authorization header:
    Authorization: Bearer <API_KEY>
  • Access to all plugin endpoints is strictly restricted to users with the following roles:
    • Site Administrator (ROLE_ID_SITE_ADMIN)
    • Journal Manager (ROLE_ID_MANAGER)

Typical Workflow

A standard generation sequence follows this pattern:

generate-users → generate-submissions → generate-issue → cleanup

Tip: Start with small batch counts before running large-scale data generation.


Important Notes

Development Use Only

This plugin creates real database records in the configured database. It is not intended for production editorial workflows.

Workflow Behavior

This plugin does not execute the full interactive editorial workflow as a human editor would. Instead, the plugin applies editorial decisions programmatically to simulate progression (e.g., bypassing standard peer review assignments). Note that this is strictly for testing and development, and does not claim full parity with the normal editorial UI flow.

Cleanup Safety

The cleanup endpoint specifically targets and deletes only the data tracked by this plugin within the current journal context. It employs a strict confirmation query parameter for safety.


Testing

The plugin includes PHPUnit tests ensuring that the custom API handler and tracking logic behave as expected.

To run tests locally within the plugin directory:

composer install --dev
composer test

(Coverage includes the route handlers, submission/issue generators, and data persistence layers.)


License

This plugin is distributed under the GNU GPL v3 license. See LICENSE for more details.

About

No description, website, or topics provided.

Resources

License

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages