Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor Line Processing in ImportUtil to Use Structured Response Format #31237

Closed
Tracked by #30882
jgambarios opened this issue Jan 27, 2025 · 1 comment · Fixed by #31294
Closed
Tracked by #30882

Refactor Line Processing in ImportUtil to Use Structured Response Format #31237

jgambarios opened this issue Jan 27, 2025 · 1 comment · Fixed by #31294

Comments

@jgambarios
Copy link
Contributor

jgambarios commented Jan 27, 2025

Parent Issue

#30882

Task

Refactor the line processing logic in ImportUtil.importLine() to use a structured response format while maintaining backward compatibility. This will improve error handling and make the import results more consistent and maintainable.

Technical Details:

  • Create new immutable model classes for line processing results
  • Implement class to encapsulate:
    • Content processing status
    • Field validation results
    • Relationship processing results
    • Validation messages
    • Content identifiers and metadata
  • Extract line processing logic into smaller, focused methods
  • Maintain backward compatibility with existing HashMap-based results
  • Add converter utility to transform between new and legacy formats

Proposed Objective

Core Features

Proposed Priority

Priority 2 - Important

Acceptance Criteria

  • Line processing logic refactored to use new model classes
  • All existing line processing functionality preserved
  • Converter utility implemented for legacy format compatibility
  • No breaking changes to existing API consumers
@jgambarios jgambarios self-assigned this Jan 27, 2025
@jgambarios jgambarios moved this from New to In Progress in dotCMS - Product Planning Jan 27, 2025
jgambarios added a commit that referenced this issue Jan 31, 2025
jgambarios added a commit that referenced this issue Feb 1, 2025
jgambarios added a commit that referenced this issue Feb 1, 2025
jgambarios added a commit that referenced this issue Feb 4, 2025
@rjvelazco rjvelazco moved this from In Progress to In Review in dotCMS - Product Planning Feb 7, 2025
github-merge-queue bot pushed a commit that referenced this issue Feb 10, 2025
…31294)

This PR is the second step in a larger effort to improve error handling
and response structures in the `ImportUtil` class. For this phase, we
focused specifically on line processing without modifying the existing
core logic.

### Changes Overview

* Added new structured validation response classes for better error
handling
* Introduced `LineImportResult` to encapsulate the import line results
* Created converter to maintain backward compatibility with existing
code
* Improved line importing validation code organization and readability
* Added comprehensive JavaDoc documentation

### What's Not Included
While working on this code, we identified several potential improvements
that were intentionally left for future iterations:

* Core import logic remains unchanged
* Legacy response format is still maintained for backward compatibility
* Existing error handling in other parts of the import process
* Performance optimizations opportunities
* Potential refactoring of data structures and helper classes

This PR is related to: #31237
@github-project-automation github-project-automation bot moved this from In Review to Done in dotCMS - Product Planning Feb 10, 2025
@jgambarios jgambarios reopened this Feb 10, 2025
@github-project-automation github-project-automation bot moved this from Done to Current Sprint Backlog in dotCMS - Product Planning Feb 10, 2025
@jgambarios jgambarios moved this from Current Sprint Backlog to Internal QA in dotCMS - Product Planning Feb 10, 2025
@jgambarios jgambarios removed their assignment Feb 10, 2025
@valentinogiardino valentinogiardino self-assigned this Feb 11, 2025
@valentinogiardino
Copy link
Contributor

IQA PASSED

Tested on dotcms/dotcms:trunk_c891857
A smoke test was performed using various content imports with different content types, fields, and data. The processing maintained its functionality, and no breaking changes were detected after the refactor.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants