Commit 7f494e0
Publish a download_url that actually downloads
XOAI's ItemUtils builds a bitstream URL as baseUrl + "/bitstream/" + handle + "/" + sid + "/" +
name, which is the DSpace 6 UI path. Under DSpace 7 the Angular application answers there, so an
anonymous GET returns the app shell rather than the file - measured on an OPEN record, 446 KB of
text/html instead of the 37-byte file. Every one of the 9125 distributions carried it, so a
harvester following download_url got a web page.
DSpace 7 serves the bytes at {server}/api/core/bitstreams/{uuid}/content, which is what the CMDI
crosswalk already does: it ignores the XOAI field and builds its own URL from dspace.server.url.
fn:getProperty is a Saxon extension the OAI runtime registers, but AbstractXSLTest builds a bare
Saxon factory with no extensions, so calling it here would break every unit test. The same value
is derivable from what XOAI already puts in the document - repository/@url + "/server" - and
every bitstream carries its uuid. A bitstream without one keeps the url XOAI supplied, which is
better than no url.
Verified against the live repository: 15 download_url values taken at random from the output all
return the file with its real content type, none returns HTML.
access_url is unchanged and stays the landing page, which is what its own scope note asks for.
The deeper fix belongs in ItemUtils, where it would correct the URL for every crosswalk at once.
Also in this commit, from checking that the access level is right rather than merely consistent:
121 bitstreams were fetched anonymously from the REST content endpoint, stratified over the cells
where the licence gate and others/access-status disagree. The licence gate matched what an
unauthenticated client actually receives on 121 of 121; access-status matched on 41. Every record
where they differ resolved in the licence gate's favour, so access_rights is left as it is - it
is not a proxy for authorisation, it tracks it exactly, while access-status does not because
DSpace computes it from the primary bitstream alone.
Measured after the change over all 2628 records: 2628 valid, every counter zero, 97 tests and
187 assertions green, 69 of 70 stylesheet mutants killed, 23 portability inputs clean. The
surviving mutant edits a FormatDate branch its callers make unreachable by pre-filtering.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>1 parent f97dada commit 7f494e0
3 files changed
Lines changed: 45 additions & 4 deletions
File tree
- dspace-oai/src/test
- java/org/dspace/xoai/tests/stylesheets
- resources
- dspace/config/crosswalks/oai/metadataFormats
Lines changed: 25 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
865 | 865 | | |
866 | 866 | | |
867 | 867 | | |
| 868 | + | |
| 869 | + | |
| 870 | + | |
| 871 | + | |
| 872 | + | |
| 873 | + | |
| 874 | + | |
| 875 | + | |
| 876 | + | |
| 877 | + | |
| 878 | + | |
| 879 | + | |
| 880 | + | |
| 881 | + | |
| 882 | + | |
| 883 | + | |
| 884 | + | |
| 885 | + | |
| 886 | + | |
| 887 | + | |
| 888 | + | |
| 889 | + | |
| 890 | + | |
868 | 891 | | |
869 | 892 | | |
870 | 893 | | |
| |||
1044 | 1067 | | |
1045 | 1068 | | |
1046 | 1069 | | |
1047 | | - | |
1048 | | - | |
1049 | | - | |
1050 | 1070 | | |
1051 | 1071 | | |
| 1072 | + | |
| 1073 | + | |
1052 | 1074 | | |
1053 | 1075 | | |
1054 | 1076 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
204 | 204 | | |
205 | 205 | | |
206 | 206 | | |
| 207 | + | |
| 208 | + | |
207 | 209 | | |
208 | 210 | | |
209 | 211 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
240 | 240 | | |
241 | 241 | | |
242 | 242 | | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
243 | 255 | | |
244 | 256 | | |
245 | 257 | | |
| |||
1775 | 1787 | | |
1776 | 1788 | | |
1777 | 1789 | | |
| 1790 | + | |
| 1791 | + | |
| 1792 | + | |
| 1793 | + | |
| 1794 | + | |
1778 | 1795 | | |
1779 | 1796 | | |
1780 | 1797 | | |
| |||
1789 | 1806 | | |
1790 | 1807 | | |
1791 | 1808 | | |
1792 | | - | |
| 1809 | + | |
1793 | 1810 | | |
1794 | 1811 | | |
1795 | 1812 | | |
| |||
0 commit comments