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

Usage of local.bitstream.redirectToURL #1094

Open
kosarko opened this issue Dec 7, 2023 · 4 comments
Open

Usage of local.bitstream.redirectToURL #1094

kosarko opened this issue Dec 7, 2023 · 4 comments

Comments

@kosarko
Copy link
Member

kosarko commented Dec 7, 2023

@milanmajchrak @vidiecan
This field (local.bitstream.redirectToURL) was originally used to provide an alternative/faster way to provide files to users. The need for that was mostly replaced by using X-Sendfile (https://www.nginx.com/resources/wiki/start/topics/examples/x-accel/).

In

Metadatum[] mds = bitstream.getMetadataByMetadataString("local.bitstream.redirectToURL");
if(mds != null && mds.length == 1){
if(org.apache.commons.lang3.StringUtils.isNotBlank(mds[0].value)){
this.redirectToURL = mds[0].value;
when a bitstream is accessed we check for this md field. If it is there then
}
else if(org.apache.commons.lang3.StringUtils.isNotBlank(this.redirectToURL)){
response.sendRedirect(this.redirectToURL);
}else {
if (byteRange != null) {

a redirect is sent (instead of dspace sending bytes read from storage).

In v7 this field is used differently (https://github.com/dataquest-dev/DSpace/wiki/Developing-backend#configure-big-file-limit); so:

  • pingback Metadata changes #1045 (which tries to list these sort of changes)
  • what does the data pump do with the existing values (this is bitstream metadata in v5)
  • is it kept after the file has been uploaded? What happens if I upload multiple files this way; does the item keep only the latest path? From the wiki it seems this is now item level metadata?
@milanmajchrak
Copy link
Collaborator

milanmajchrak commented Apr 30, 2024

  1. The data pump just copy that metadata value from v5 to v7
  2. Some refactoring is needed, after refactoring the big upload file will looks like this:
  • bigfile input field will be moved to the Upload step (file path, file description; with upload button)
  • bigfile Item's metadata won't be deleted after upload
  • this input field will be allowed only for admin
  • this approach allows the admin to upload more big files
  • redirectToURL metadata is bitstream's level metadata, not item's

After update:

  • The Item's redirectToUrl metadata is removed after every upload, that means you can upload whatever file you want
  • The cfg property which determines whether the file is removed after upload, was set to false, meaning "do not delete that file."

@kosarko
Copy link
Member Author

kosarko commented Oct 10, 2024

The data pump just copy that metadata value from v5 to v7

@milanmajchrak Can the pump drop the values and issue some sort of NOTICE? I mean if the functionality (the actual redirect) is no longer there why keep it?

@milanmajchrak
Copy link
Collaborator

The data pump just copy that metadata value from v5 to v7
@milanmajchrak Can the pump drop the values and issue some sort of NOTICE? I mean if the functionality (the actual redirect) is no longer there why keep it?

Of course, the pump can ignore updating specific metadata values and add a WARN message to the logs.

@kosarko
Copy link
Member Author

kosarko commented Oct 30, 2024

yes, ignore these metadata...

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

No branches or pull requests

2 participants