Skip to content

Conversation

@hextraza
Copy link
Contributor

This PR adds a new CSV export endpoint at /luceneCSVExport.api and a client-side button to trigger it using the current query stored in the VariantSearch table. The file is streamed and downloaded by the browser using HttpServletResponse. The file contains a column for every field in JBrowseFieldUtils.getIndexedFields(). It performs the same full-text search as the normal JSON endpoint, but doesn't do any pagination, so it returns the whole set of documents that match the specified query from the table when the "Export CSV" button is pressed. This branch may still need to be rebased on the new jbrowse version depending on what order we want to do things. Two questions before this is ready to merge:

  1. Are the column names ok? They're using the actual index field names for simplicity, but I could also make the columns use some lowercase/underscored version of the readable labels from JBrowseFieldDescriptor.
  2. In terms of testing this, I could either try to do a JUnit test on the search class, or another Selenium test. JUnit seems better to me, but I'm not sure what the best way of mocking everything doSearchCSV() needs is (i.e. the User, the index, etc). And if it's just easier/better to do another Selenium test the main issue is that this endpoint downloads a file directly from the browser. I can parse it and run a suite very similar to the existing JSON endpoint suite, but I'm not sure if there's a good way of getting the downloaded file.

@hextraza
Copy link
Contributor Author

hextraza commented Apr 7, 2025

Assuming these pass this should be good to merge.

@hextraza hextraza marked this pull request as ready for review April 7, 2025 19:25
Copy link
Contributor

@bbimber bbimber left a comment

Choose a reason for hiding this comment

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

One minor suggestion. Otherwise seems good, though we need to do a bunch of user testing once we update all this

@hextraza hextraza force-pushed the 25.3_fb_newExport branch from 9f13f7e to 6e37a41 Compare April 9, 2025 17:05
@hextraza hextraza merged commit 350d81e into discvr-25.3 Apr 11, 2025
2 of 4 checks passed
@hextraza hextraza deleted the 25.3_fb_newExport branch April 11, 2025 22:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants