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

Bulk import enhancements #144

Closed
apexdodge opened this issue Aug 26, 2023 · 6 comments
Closed

Bulk import enhancements #144

apexdodge opened this issue Aug 26, 2023 · 6 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@apexdodge
Copy link
Contributor

We want to build the following enhancements to our Import from CSV feature.

  • Validate each content item before inserting. If it fails validation, add it to a list of errors. This list then is turned into a CSV file that is downloaded at the end of the bulk import process so the user knows which records failed to import successfully.
  • Swap out the CSV reader with one that is MIT licensed instead of Apache 2.0.
  • Support for attachment field type.
@smd-11
Copy link
Contributor

smd-11 commented Aug 28, 2023

@apexdodge ,would like to work on this.

  • Is it fine if this https://github.com/drcolombo/CsvReader (MIT License) is used.
  • Need your inputs on how support for attachment field type can be implemented(for Image we can have base64 string of that image in csv but for pdf's and other file formats not sure)

@apexdodge
Copy link
Contributor Author

@smd-11, yes, this is a good task, thank you.

  • Yes, that library looks good. Go for it.
  • I'm thinking the user must provide a URL to a file. If the URL is valid, download the file into memory, upload using IFileStorageProvider, then save a MediaItem to the db table, and finally the Guid from the MediaItem that was just saved can be used as the value to save to the attachment field type.

Helpful example of file storage provider:

var objectKey = FileStorageUtility.CreateObjectKeyFromIdAndFileName(idForKey, file.FileName);

Helpful example of validation of fields:

foreach (var field in request.Content as IDictionary<string, dynamic>)

You may want to rebase your fork from dev.

Let me know if you have any questions from that.

Thanks!

@apexdodge apexdodge added this to the v1.1.3 milestone Aug 28, 2023
@apexdodge apexdodge added the enhancement New feature or request label Aug 29, 2023
@smd-11
Copy link
Contributor

smd-11 commented Sep 7, 2023

@apexdodge created PR for merging.

@apexdodge
Copy link
Contributor Author

PR merged, moving to testing. Big thanks @smd-11

@apexdodge
Copy link
Contributor Author

Fixed a blocker that was discovered during testing.

When choosing to use local storage instead of cloud storage, a crash occurs due to missing httpcontext in background task. This is now resolved and testing can be resumed.

@apexdodge
Copy link
Contributor Author

Released with v1.1.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants