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

Confirm that cmdi file is returned when the HTTP-accept header has “application/x-cmdi+xml” #611

Closed
milanmajchrak opened this issue Apr 8, 2024 · 9 comments
Assignees
Labels

Comments

@milanmajchrak
Copy link
Collaborator

TODO:

  • we need to have some Item with CMDI file - maybe it could be added into python import script?

7. Persistent Identifiers - Centres need to associate PIDs (handles or DOIs) with their metadata records.

  • it redirects to a CMDI file for the HTTP-accept header “application/x-cmdi+xml”
  • it redirects to an HTML file when accessing it from a browser
    Individual files (e.g. a text, zip or sound file) can be referred to with either the handle of
    the describing metadata record in combination with a part identifier11 or with another
    handle.
@MajoBerger
Copy link

Works on port 88 with good nginx
curl -k http://dev-5.pc:88/handle/11234/1-5438 -L -H "Accept: application/x-cmdi+xml"

does not work on bad nginx
curl -k https://dev-5.pc:8443/handle/11234/1-5438 -L -H "Accept: application/x-cmdi+xml"

It is because of nginx directive

if ($query_string ~* "format=cmdi"){
                rewrite ^/(.*)handle/(.*)$ http://$http_host/server/cmdi/oai-metadata?metadataPrefix=cmdi&handle=$2? redirect;
            }
            if ($http_accept ~ "(.*cmdi.xml*)"){
                rewrite ^/(.*)handle/(.*)$ http://$http_host/server/cmdi/oai-metadata?metadataPrefix=cmdi&handle=$2? redirect;
            }

which IS in wiki. (and enables other header values, since regex is used, and other kind of links as well
curl -k http://dev-5.pc:88/handle/11234/1-5438?format=cmdi -L
)

@MajoBerger
Copy link

add commands to check to Wiki

@MajoBerger
Copy link

add to 8443 nginx as well

@milanmajchrak
Copy link
Collaborator Author

Some Item could have specific CMDI file - during creation the admin upload a cmdi file which will be returned. He need to click on Has CMDI checkbox. Confirm that specific cmdi file is returned.

@milanmajchrak
Copy link
Collaborator Author

milanmajchrak commented Apr 11, 2024

@MajoBerger
https://github.com/dataquest-dev/DSpace/blob/dtq-dev/dspace-server-webapp/src/main/java/org/dspace/app/rest/CMDIRestController.java

  • Return uploaded CMDI file from the CMDI bundle if:
  1. The Item has metadata local.hasCMDI = yes
  2. The Item has file in the CMDI bundle
  • Create a test for that

@MajoBerger
Copy link

MajoBerger commented Apr 11, 2024

waiting for tests and then review
#629

@MajoBerger
Copy link

Done, works, added to wiki etc.

@milanmajchrak
Copy link
Collaborator Author

Where in the wiki? Post a link here pls

@MajoBerger
Copy link

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

No branches or pull requests

2 participants