Skip to content

Conversation

@eduardojst10
Copy link
Contributor

fixed broken downloads and filled missing v2 API endpoints by cleanly separating preview vs download for Files and DIPFiles. It updated controllers/services, aligned UI helpers with the new endpoints, and introduced a dynamic toolbar in order to assign the correct actions. Fixes #3516

RodaConstants

added API_REST_V2_DIPFILES constant for the new DIPFiles endpoints.

DIPController

fixed /api/v2/dips/{uuid}/download to use requestContext.getIndexService() (correct index access) and streamed the response.

DIPFileController and DIPFileService

added v2 endpoints:

  • GET /api/v2/dip-files/{uuid}/preview — range preview of a DIPFile (retrieveDIPFileRangeStream)
  • GET /api/v2/dip-files/{uuid}/download — export/stream a DIPFile (retrieveDIPFileStreamResponse)

roda-roles.properties

added new roda-roles properties permissions for DIPFileController endpoint methods previewBinary and downloadBinary (aip.read)

FilesService

fixed representation file download by building the full path from IndexedFile metadata and using it to resolve (stream file vs export directory if folder)

BrowseDIP

replaced @UIField BrowseDIPActionsToolbar with provided ActionsToolbar for dynamic toolbar
created a new BrowseDIPFileActionsToolbar.java class specific for download, uses DisseminationFileActions.java
updated BrowseDIP.ui.xml with ActionsToolbar binding

BrowseDIPTabs

fixed view tab for dissemination preview

RestUtils

Files (representation files):

  • added createRepresentationFilePreviewUri(String fileUuid, boolean inline) → built GET /api/v2/files/{uuid}/preview (inline preview; HTTP Range–friendly).
  • added createRepresentationFileDownloadUri(String fileUuid) → built GET /api/v2/files/{uuid}/download (explicit download).

DIPFiles:

  • added createDipFilePreviewUri(String dipFileUUID, boolean inline) → built GET /api/v2/dip-files/{uuid}/preview?inline={inline} (inline preview; range-enabled).
  • added createDipFileDownloadUri(String dipFileUUID) → built GET /api/v2/dip-files/{uuid}/download (explicit download/export).

DipFilePreview

switched preview source to /api/v2/dip-files/{uuid}/preview via RestUtils.createDipFilePreviewUri (was using download).
removed unused constructor and minor cleanup.

IndexedFilePreview

Use RestUtils.createRepresentationFilePreviewUri instead of download helper.

@eduardojst10 eduardojst10 added this to the 6.1.0 milestone Sep 29, 2025
@eduardojst10 eduardojst10 changed the base branch from master to staging October 1, 2025 12:45
@eduardojst10 eduardojst10 merged commit 0f11d6e into staging Oct 1, 2025
8 of 9 checks passed
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.

Fail when loading Dissemination File in RODA 6 UI

2 participants