Skip to content

feat: add JSON data export functionality closes #340#407

Open
Tonixhymshiti wants to merge 10 commits intoMcPringle:mainfrom
Tonixhymshiti:feat/json-export-340
Open

feat: add JSON data export functionality closes #340#407
Tonixhymshiti wants to merge 10 commits intoMcPringle:mainfrom
Tonixhymshiti:feat/json-export-340

Conversation

@Tonixhymshiti
Copy link

Summary

Implements JSON export functionality for Komunumo, complementing the existing import feature.

Changes

  • Add ConfigurationValue record for storing configuration values
  • Add getAllConfigurations() method to ConfigurationService
  • Add getAllMailTemplates() method to MailService
  • Add getAllImages() method to ImageService
  • Implement JSONExporter class for complete data export
  • Add ExporterView UI at /admin/export (admin-only)
  • Add export link to admin navigation menu
  • Add comprehensive unit tests for JSONExporter

Exported Data

The JSON export includes:

  • Instance settings/configuration
  • Images (with base64 encoded data)
  • Users
  • Communities
  • Community memberships
  • Events
  • Event participants
  • Global pages
  • Mail templates

Closes #340

Tonixhymshiti and others added 10 commits February 1, 2026 21:50
Add a new record entity to represent stored configuration values
from the database. This record is used for exporting configuration
data and contains the setting key, language code, and value.

Part of McPringle#340

Signed-off-by: meritonx <meritonii1998@gmail.com>
Add method to retrieve all configuration values from the database
including language-specific values. This is used for exporting
the instance configuration.

Part of McPringle#340

Signed-off-by: meritonx <meritonii1998@gmail.com>
Add method to retrieve all mail templates from the database
including all language variants. This is used for exporting
the instance mail templates.

Part of McPringle#340

Signed-off-by: meritonx <meritonii1998@gmail.com>
Add method to retrieve all images from the database.
This is used for exporting the instance images with
their base64-encoded data.

Part of McPringle#340

Signed-off-by: meritonx <meritonii1998@gmail.com>
Add JSONExporter class that exports all Komunumo instance data
as a JSON file compatible with JSONImporter. Exports:
- Settings (configurations)
- Images (with base64-encoded data)
- Users
- Communities
- Events
- Members
- Participants
- Global pages
- Mail templates

The export format matches the import format to allow backup
and transfer of instance configurations and content.

Part of McPringle#340

Signed-off-by: meritonx <meritonii1998@gmail.com>
Add admin view at /admin/export that allows administrators to
export all instance data as a downloadable JSON file.

Features:
- Accessible only to users with ADMIN role (@RolesAllowed)
- Export button triggers JSON generation
- Download link appears after successful export
- Export log shows progress and status
- Timestamped filename (komunumo-export-YYYYMMDD_HHmmss.json)

Add corresponding i18n translations for the view.

Part of McPringle#340

Signed-off-by: meritonx <meritonii1998@gmail.com>
Add 'Export Data' menu item to the admin dropdown in the
navigation bar, linking to the new ExporterView.

Closes McPringle#340

Signed-off-by: meritonx <meritonii1998@gmail.com>
Add comprehensive unit tests for the JSONExporter class covering:
- Export of empty data
- Settings export (with and without language)
- Users export
- Communities export
- Events export
- Members export
- Participants export
- Global pages export
- Mail templates export
- Images export (with content type)

Uses Mockito to mock all service dependencies.

Part of McPringle#340

Signed-off-by: meritonx <meritonii1998@gmail.com>
Signed-off-by: meritonx <meritonii1998@gmail.com>
@McPringle McPringle self-requested a review February 26, 2026 13:24
@McPringle McPringle self-assigned this Feb 26, 2026
@McPringle McPringle moved this to In Progress in Komunumo Project Board Feb 26, 2026
@McPringle McPringle added this to the v1 milestone Feb 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

feat(export): implement JSON export for all instance data

2 participants