diff --git a/dspace-api/src/main/java/org/dspace/handle/HandleClarinServiceImpl.java b/dspace-api/src/main/java/org/dspace/handle/HandleClarinServiceImpl.java index ebec91f7fd2f..d4e33939928a 100644 --- a/dspace-api/src/main/java/org/dspace/handle/HandleClarinServiceImpl.java +++ b/dspace-api/src/main/java/org/dspace/handle/HandleClarinServiceImpl.java @@ -268,8 +268,9 @@ public String resolveToURL(Context context, String handleStr) throws SQLExceptio if (isInternalResource(handle)) { // Internal handle // Create url for internal handle - url = configurationService.getProperty("dspace.ui.url") - + "/handle/" + handleStr; + String currentUiUrl = configurationService.getProperty("dspace.ui.url"); + url = currentUiUrl.endsWith("/") ? currentUiUrl : currentUiUrl + "/"; + url += "handle/" + handleStr; } else { // External handle url = handle.getUrl(); diff --git a/dspace-api/src/main/java/org/dspace/subscriptions/SubscriptionEmailNotificationServiceImpl.java b/dspace-api/src/main/java/org/dspace/subscriptions/SubscriptionEmailNotificationServiceImpl.java index 8fb01cd36e92..c803f1407e05 100644 --- a/dspace-api/src/main/java/org/dspace/subscriptions/SubscriptionEmailNotificationServiceImpl.java +++ b/dspace-api/src/main/java/org/dspace/subscriptions/SubscriptionEmailNotificationServiceImpl.java @@ -67,6 +67,7 @@ public SubscriptionEmailNotificationServiceImpl(Map public void perform(Context context, DSpaceRunnableHandler handler, String subscriptionType, String frequency) { List communityItems = new ArrayList<>(); List collectionsItems = new ArrayList<>(); + EPerson currentEperson = context.getCurrentUser(); try { List subscriptions = findAllSubscriptionsBySubscriptionTypeAndFrequency(context, subscriptionType, frequency); @@ -77,7 +78,10 @@ public void perform(Context context, DSpaceRunnableHandler handler, String subsc for (Subscription subscription : subscriptions) { DSpaceObject dSpaceObject = subscription.getDSpaceObject(); EPerson ePerson = subscription.getEPerson(); - + // Set the current user to the subscribed eperson because the Solr query checks + // the permissions of the current user in the ANONYMOUS group. + // If there is no user (i.e., `current user = null`), it will send an email with no new items. + context.setCurrentUser(ePerson); if (!authorizeService.authorizeActionBoolean(context, ePerson, dSpaceObject, READ, true)) { iterator++; continue; @@ -126,6 +130,8 @@ public void perform(Context context, DSpaceRunnableHandler handler, String subsc handler.handleException(e); context.abort(); } + // Reset the current user because it was changed to subscriber eperson + context.setCurrentUser(currentEperson); } @SuppressWarnings("rawtypes") diff --git a/dspace/bin/start-handle-server b/dspace/bin/start-handle-server index 6d5c9a4b4406..06c4fb5d90c9 100755 --- a/dspace/bin/start-handle-server +++ b/dspace/bin/start-handle-server @@ -23,9 +23,9 @@ HANDLEDIR=`$BINDIR/dspace dsprop --property handle.dir` LOGDIR=$DSPACEDIR/log #Allow user to specify java options through JAVA_OPTS variable -if [ "$JAVA_OPTS" = "" ]; then +if [ "$JAVA_OPTS_HANDLE" = "" ]; then #Default Java to use 256MB of memory - JAVA_OPTS=-Xmx256m + $JAVA_OPTS_HANDLE=-Xmx256m fi # Remove lock file, in case the old Handle server did not shut down properly @@ -34,7 +34,7 @@ rm -f $HANDLEDIR/txns/lock # Start the Handle server, with a special log4j properties file. # We cannot simply write to the same logs, since log4j # does not support more than one JVM writing to the same rolling log. -nohup java $JAVA_OPTS -classpath `$BINDIR/dspace classpath` \ +nohup java $JAVA_OPTS_HANDLE -classpath `$BINDIR/dspace classpath` \ -Ddspace.log.init.disable=true \ -Dlog4j.configuration=log4j-handle-plugin.properties \ net.handle.server.Main $HANDLEDIR \ diff --git a/dspace/config/modules/actuator.cfg b/dspace/config/modules/actuator.cfg index a14a3f1cac1f..b23ccc3424b0 100644 --- a/dspace/config/modules/actuator.cfg +++ b/dspace/config/modules/actuator.cfg @@ -12,7 +12,7 @@ management.endpoint.health.roles = ADMIN ## Configuration to establis management.endpoint.health.status.order= down, out-of-service, up-with-issues, up, unknown ## Configuration that enables only health and info endpoints -management.endpoints.web.exposure.include=health,info +management.endpoints.web.exposure.include=health,info,scheduledtasks ## Configuration to set 200 as status of health http response when it is DOWN or OUT_OF_SERVICE ## The DSpace UI requires these be set to 200 in order to support health status reports when services are down.