Skip to content

Commit

Permalink
Copied fixes from the lindat branch (#770)
Browse files Browse the repository at this point in the history
* Copied PR 769

* Used root URL to compose download URL with namespace (#768)

* Cherry-picked docker compose rest
  • Loading branch information
milanmajchrak authored Dec 17, 2024
1 parent 9e9d86f commit c90b1cc
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
8 changes: 6 additions & 2 deletions docker/docker-compose-rest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,16 @@ services:
- /bin/bash
- '-c'
# When customizing the namespace, add the following command to the entrypoint command below (after `while ...`):
# `pushd ../webapps && unlink server && ln -s /dspace/webapps/server/ 'repository#server' && popd`
# `pushd ../webapps && (unlink server || true) && (ln -s /dspace/webapps/server/ 'repository#server' || true) &&
# popd`
# The `(... || true)` condition is necessary to ensure the `popd` command runs at the end.
# It used to fail when the `server` folder did not exist in `/webapps`.
# This will create a symlink from the webapps directory to the server directory with the custom namespace
# (e.g. /dspace/webapps/server -> /dspace/webapps/repository#server)
- |
while (!</dev/tcp/dspacedb/543${INSTANCE}) > /dev/null 2>&1; do sleep 1; done;
/dspace/bin/dspace database migrate force
custom_run.sh
./custom_run.sh
/dspace/bin/start-handle-server
# DSpace database container
dspacedb:
Expand Down Expand Up @@ -168,6 +171,7 @@ services:
cp -r -u /opt/solr/server/solr/configsets/dspace/statistics/* statistics
exec solr -p 898${INSTANCE} -f -m 4g
volumes:
# Commented out because there are a lot of files in the assetstore
assetstore:
pgdata:
solr_data:
Expand Down
5 changes: 5 additions & 0 deletions src/app/app-routing-paths.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ export function getBitstreamModuleRoute() {
export function getBitstreamDownloadRoute(bitstream): string {
return new URLCombiner(getBitstreamModuleRoute(), bitstream.uuid, 'download').toString();
}

export function getBitstreamContentRoute(bitstream): string {
return new URLCombiner(getBitstreamModuleRoute(), bitstream.uuid, 'content').toString();
}

export function getBitstreamRequestACopyRoute(item, bitstream): { routerLink: string, queryParams: any } {
const url = new URLCombiner(getItemModuleRoute(), item.uuid, 'request-a-copy').toString();
return {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import { RemoteDataBuildService } from '../../core/cache/builders/remote-data-bu
import { HttpOptions } from '../../core/dspace-rest/dspace-rest.service';
import { Router } from '@angular/router';
import { getItemPageRoute } from '../../item-page/item-page-routing-paths';
import { getBitstreamDownloadRoute } from '../../app-routing-paths';
import { getBitstreamContentRoute } from '../../app-routing-paths';
import { hasFailed } from 'src/app/core/data/request-entry-state.model';
import { FindListOptions } from '../../core/data/find-list-options.model';
import isEqual from 'lodash/isEqual';
Expand Down Expand Up @@ -255,10 +255,12 @@ export class ClarinLicenseAgreementPageComponent implements OnInit {
.subscribe(bitstream$ => {
bitstream = bitstream$;
});
let bitstreamDownloadPath = getBitstreamDownloadRoute(bitstream);
let bitstreamDownloadPath = getBitstreamContentRoute(bitstream);
if (isNotEmpty(downloadToken)) {
bitstreamDownloadPath = bitstreamDownloadPath + '?dtoken=' + downloadToken;
bitstreamDownloadPath = this.halService.getRootHref() + '/core' + bitstreamDownloadPath +
'?dtoken=' + downloadToken;
}

this.hardRedirectService.redirect(bitstreamDownloadPath);
}

Expand Down

0 comments on commit c90b1cc

Please sign in to comment.