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

[CCAP-629][CCAP-575] Support for converting documents and images to pdfs #645

Merged
merged 33 commits into from
Feb 5, 2025

Conversation

cram-cfa
Copy link
Collaborator

Issue tracking number πŸ”—

https://codeforamerica.atlassian.net/browse/CCAP-629

Description of change ✍️

Priority πŸ₯‡

Effect on other applications using FFB 🌊

Testing

βœ… Checklist before requesting a review

  • Does the new code follow our preferred coding
    style
    ?
  • Does the code include javadocs, where necessary?
  • Have tests for this feature been added / updated?
  • Has the readme been updated?

@cram-cfa cram-cfa changed the title [CCAP-629] Support for converting images to pdfs DO NOT MERGE: [CCAP-629] Support for converting images to pdfs Jan 29, 2025
@cram-cfa cram-cfa changed the title DO NOT MERGE: [CCAP-629] Support for converting images to pdfs DO NOT MERGE: [CCAP-629][CCAP-575] Support for converting documents and images to pdfs Jan 31, 2025
src/main/java/formflow/library/FileController.java Outdated Show resolved Hide resolved
.conversionSourceFileId(userFileId)
.build();

uploadedConvertedFile = userFileRepositoryService.save(uploadedConvertedFile);
Copy link
Contributor

Choose a reason for hiding this comment

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

The only part that is still unclear to me is where the conversionSourceFileId is set.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is generated on line 191; It is the UUID of the entry for the file that was uploaded by the user. It has to be generated in the code -- and not by the database -- so we can properly set the path on the uploaded file. (This was actually a bug before, but since we don't really care what the path is, as long as it's set... it's not actually causing any issues in production, etc)

Once the uploaded file has a UUID, we want the new converted file to have a reference back to that uploaded file -- hence it being the "conversion source file's id".

The code to create the UUID previously was way up at the top of the method, I just moved it to line 191 where it is first ever needed.

Let me know if that explains it!

@cram-cfa cram-cfa changed the title DO NOT MERGE: [CCAP-629][CCAP-575] Support for converting documents and images to pdfs [CCAP-629][CCAP-575] Support for converting documents and images to pdfs Feb 3, 2025
@spokenbird spokenbird self-requested a review February 5, 2025 22:29
@cram-cfa cram-cfa merged commit 6eb8607 into main Feb 5, 2025
5 checks passed
@cram-cfa cram-cfa deleted the marc-CCAP-629 branch February 5, 2025 22:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants