CSV data export: include multiple entities#201
Merged
Conversation
|
There was a problem hiding this comment.
Pull request overview
Adds support for exporting non-enumerable multiple entities as repeated column groups in CSV/XLSX exports, controlled by a new includeMultipleEntities export parameter. This extends the existing “enumerated entities” export behavior to handle multiple entities that can’t be expanded via code lists.
Changes:
- Introduces
MultipleEntityColumnProviderto generate repeated column sets for multiple entity instances (by index). - Adds
includeMultipleEntitiesflag toCSVDataExportParametersBase. - Wires the new provider into
AutomaticColumnProviderwhen encountering multiple (non-enumerable or non-included-enumerable) entities.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| collect-core/src/main/java/org/openforis/collect/io/data/csv/MultipleEntityColumnProvider.java | New column provider to expand multiple entities into repeated column groups. |
| collect-core/src/main/java/org/openforis/collect/io/data/csv/CSVDataExportParametersBase.java | Adds configuration flag to enable exporting multiple entities. |
| collect-core/src/main/java/org/openforis/collect/io/data/csv/columnProviders/AutomaticColumnProvider.java | Uses MultipleEntityColumnProvider when includeMultipleEntities is enabled. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+27
to
+39
| private static List<ColumnProvider> createProviders(CSVDataExportParameters config, EntityDefinition defn) { | ||
| List<ColumnProvider> providers = new ArrayList<ColumnProvider>(); | ||
| List<AttributeDefinition> keyDefs = defn.getKeyAttributeDefinitions(); | ||
| int maxEntities = defn.getFixedMaxCount() == null ? DEFAULT_MAX_ITEMS: defn.getFixedMaxCount(); | ||
| for (int entityIndex = 0; entityIndex < maxEntities; entityIndex ++) { | ||
| for (AttributeDefinition keyDef : keyDefs) { | ||
| String keyName = keyDef.getName(); | ||
| MultipleEntityKeyColumnProvider p = new MultipleEntityKeyColumnProvider(config, defn, entityIndex, keyName); | ||
| providers.add(p); | ||
| } | ||
| } | ||
| return providers; | ||
| } |
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.



No description provided.