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

fix: update docx4j version and add required maven deps so that pdf export works #148

Merged
merged 1 commit into from
Oct 15, 2024

Conversation

drewharvey
Copy link
Contributor

@drewharvey drewharvey commented Oct 4, 2024

Fixes #136

  • Updated docx4j maven deps to latest version which adds support for java 11
  • Added updated versions of apache commons-compress and commons-io which was required

Summary by CodeRabbit

  • New Features

    • Enhanced document processing capabilities with updated dependencies for better performance and functionality.
    • Added support for additional libraries to improve file handling and compression.
  • Bug Fixes

    • Removed obsolete dependency to streamline the application and reduce potential conflicts.

Copy link

coderabbitai bot commented Oct 4, 2024

Walkthrough

The changes in this pull request primarily involve updates to the pom.xml file, focusing on dependency management. Key modifications include upgrading the org.docx4j dependencies from version 8.3.8 to 11.5.0 for several artifacts, adding new dependencies for commons-compress and commons-io, and removing the obsolete docx4j-JAXB-Internal dependency. Additionally, minor formatting adjustments were made to enhance clarity in the maven-javadoc-plugin configuration.

Changes

File Change Summary
pom.xml - Updated org.docx4j dependencies from 8.3.8 to 11.5.0 for multiple artifacts.
- Added commons-compress version 1.27.1 and commons-io version 2.16.1.
- Removed docx4j-JAXB-Internal dependency.
- Minor formatting adjustments in maven-javadoc-plugin.

Assessment against linked issues

Objective Addressed Explanation
PDF should have content and open as expected (#136) The PR does not address the issue of PDF export being 0 bytes.

Possibly related PRs

  • fix: simplify exception handling #132: This PR involves changes to the DocxStreamResourceWriter class, which is related to document generation, similar to the updates in the pom.xml for the org.docx4j dependencies.
  • deprecate: deprecate a public attribute #144: This PR includes modifications to the DocxStreamResourceWriter and the GridExporter class, which are relevant to the document export functionality, aligning with the dependency updates in the main PR.

Suggested reviewers

  • mlopezFC
  • paodb

📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 55391b5 and dfcf61c.

📒 Files selected for processing (1)
  • pom.xml (4 hunks)
🔇 Additional comments (7)
pom.xml (7)

145-145: Approve docx4j-JAXB-MOXy version update

The update to version 11.5.0 of docx4j-JAXB-MOXy is consistent with the other docx4j dependency updates. This consistency is good practice and helps maintain compatibility between the docx4j components.


152-156: Approve addition of commons-compress dependency

The addition of org.apache.commons:commons-compress version 1.27.1 is likely beneficial for the project. This library provides robust compression and decompression functionality which could be useful for PDF export operations.

Could you please clarify if this dependency is now required by the updated docx4j libraries or if it's being used directly in the project for PDF export improvements? This information would help in understanding the necessity of this addition.


157-160: Approve addition of commons-io dependency

The addition of commons-io:commons-io version 2.16.1 is a positive change. This library provides useful utility classes for input/output operations which could enhance file handling in the PDF export process.

Similar to the commons-compress dependency, could you please clarify if this is a new requirement from the updated docx4j libraries or if it's being used directly in the project for PDF export improvements? This information would help in understanding the necessity of this addition.


373-373: Approve addition of Vaadin javadoc link

The addition of the Vaadin platform javadoc link in the maven-javadoc-plugin configuration is a good practice. This improves the project's documentation by providing easy access to the Vaadin API documentation.


Line range hint 1-559: Overall approval of POM changes

The changes made to the POM file align well with the PR objectives to fix the PDF export functionality. The updates to docx4j libraries (to version 11.5.0) and the addition of commons-compress and commons-io dependencies should address the reported issue of 0-byte PDF files.

Key points:

  1. Consistent version updates across docx4j dependencies.
  2. Addition of potentially necessary compression and I/O libraries.
  3. Improvement in documentation with the addition of Vaadin javadoc link.

These changes appear well-considered and should resolve the PDF export issue. However, please ensure thorough testing of the PDF export functionality to confirm the fix and to catch any potential issues introduced by the significant version updates.

To verify that these changes resolve the issue, please run a comprehensive test suite focusing on PDF export functionality. This should include generating PDFs of various sizes and complexities. You can use the following command to run all tests related to PDF export:

#!/bin/bash
# Run all tests related to PDF export
mvn test -Dtest=*PDFExport*

# Check the size of generated PDF files
find . -name "*.pdf" -type f -size +0c

This will help ensure that the changes have successfully addressed the 0-byte PDF issue across different scenarios.


140-140: Approve docx4j-JAXB-ReferenceImpl version update

The update to version 11.5.0 of docx4j-JAXB-ReferenceImpl is a significant change that aligns with the PR objective to fix PDF export functionality. This update likely includes improvements and bug fixes that could resolve the issue.

Given the substantial version jump, please ensure thorough testing of the PDF export feature to confirm that it resolves the issue and doesn't introduce any new problems. Consider running the following command to check for any breaking changes or deprecations:


150-151: Approve docx4j-export-fo version update

The update to version 11.5.0 of docx4j-export-fo is crucial for addressing the PDF export issue mentioned in the PR objectives. This library is directly responsible for PDF export functionality, and the update likely contains specific improvements that could resolve the reported 0-byte PDF file issue.

To ensure the update resolves the specific issue, please run a test that generates a PDF file and verify its content and file size. You can use the following command to check the file size:


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

sonarqubecloud bot commented Oct 4, 2024

@javier-godoy javier-godoy requested a review from mlopezFC October 4, 2024 18:20
Copy link
Member

@mlopezFC mlopezFC left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mlopezFC mlopezFC merged commit c833f4a into FlowingCode:master Oct 15, 2024
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Pending release
Development

Successfully merging this pull request may close these issues.

Exported pdf is 0 bytes
2 participants