feat: add JSON data export functionality closes #340#407
Open
Tonixhymshiti wants to merge 10 commits intoMcPringle:mainfrom
Open
feat: add JSON data export functionality closes #340#407Tonixhymshiti wants to merge 10 commits intoMcPringle:mainfrom
Tonixhymshiti wants to merge 10 commits intoMcPringle:mainfrom
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements JSON export functionality for Komunumo, complementing the existing import feature.
Changes
ConfigurationValuerecord for storing configuration valuesgetAllConfigurations()method to ConfigurationServicegetAllMailTemplates()method to MailServicegetAllImages()method to ImageServiceJSONExporterclass for complete data exportExporterViewUI at/admin/export(admin-only)Exported Data
The JSON export includes:
Closes #340