Skip to content

feat(webportal): Add export to Web Portal function#7994

Draft
grantfitzsimmons wants to merge 10 commits intomainfrom
issue-7606
Draft

feat(webportal): Add export to Web Portal function#7994
grantfitzsimmons wants to merge 10 commits intomainfrom
issue-7606

Conversation

@grantfitzsimmons
Copy link
Copy Markdown
Member

@grantfitzsimmons grantfitzsimmons commented Apr 18, 2026

Fixes #7606

This PR adds support for exporting query results as a Web Portal package (ZIP) for import into the Specify Web Portal. It introduces backend endpoints and logic for generating the export, updates frontend components to allow users to trigger and download the export, and adds appropriate permission checks and notifications. It even includes tests and validation improvements for tree-related queries.

At this time, exports using this tool require no changes on the Web Portal side of things.

Button in Query Builder Notification when complete
image image
Policy Note
image Users need to be given specific permission to be able to export to the web portal.

Web Portal Export Feature:

  • Added backend support for exporting queries as a Web Portal ZIP package via a new endpoint (exportwebportal/), including a new query_to_web_portal_zip function and integration with the export workflow.
  • Implemented frontend UI to trigger the Web Portal export from the query builder, including permission checks, export button, and download link in notifications.

Testing and Validation:

  • Added backend tests for the new export endpoint and attachment mapping logic.

Example

Specify Query

image

Portal

image

Attachments

image

Map

image

Checklist

  • Self-review the PR after opening it to make sure the changes look good and
    self-explanatory (or properly documented)
  • Add relevant issue to release milestone
  • Add automated tests

Testing instructions

  • Confirm the new Export to Web Portal button appears in the query export controls (when you have permission).
  • Confirm the new Export to Web Portal button does not appear in the query export controls if you do not have permission to that tool (Querybuilder → Query → Export To Web Portal).
  • Start the export and wait for the completion notification.
  • Use the notification or download link to retrieve the generated ZIP package.
  • Open the ZIP and confirm it contains:
    • PortalFiles/PortalData.csv
    • PortalFiles/flds.json
    • PortalFiles/PortalInstanceSetting.json
    • PortalFiles/SolrFldSchema.xml
  • Inspect PortalFiles/flds.json and verify:
    • the spid and img rows are present
    • attachment metadata is emitted correctly (if there are attachments)
    • attachment Title is derived from attachment.title when available
  • Verify existing query export behavior still works for normal CSV exports.
  • Confirm tree-related query validation still passes after the new tree parsing validation changes.

DEVELOPERS: To really make sure this works, we need to import this into the Web Portal. To really make sure it is an adequate replacement for the Specify 6 exporter, it is a good idea to test the same export query in both versions. All KU databases have a mapping setup in them, which can be compared easily.

  • Import the ZIP into a Specify Web Portal instance to confirm the package can be ingested.
  • Verify that the rows in the query are the same count as the rows in the portal
  • Verify that all visible fields (within the 7 query itself) are searchable in the portal when using 'advanced' search
  • Verify that all attachments marked as public (via attachment.ispublic) are visible in the portal
  • Verify that the asset server URL and collection are set correctly (based on the docker environment for the Specify installation)
  • Verify that the map plots all points (as long as longitude1, latitude1, longitude2, or latitude2 are present, but keep If second set of coordinates fields are present, they are required for Geo Coords webportal-installer#64 in mind), and make sure they are clickable (so a dialog appears)
  • Check that the attachment 'Title' is shown in the dialog header when viewing an attachment
  • Verify that no unexpected console errors are logged in the web portal (no more than before, comparing against a standard Specify 6-exported data set in the portal)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 📋Back Log

Development

Successfully merging this pull request may close these issues.

Export to Web Portal

1 participant