Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion dspace-api/src/test/data/dspaceFolder/config/local.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,8 @@ featured.service.teitok.description = A web-based platform for viewing, creating


##### Shibboleth #####
# Turn off the discofeed, it is allowed by default
shibboleth.discofeed.allowed = true
# File where is DiscoJuiceFeed response
shibboleth.discofeed.url = TEST:/org/dspace/app/rest/discofeedResponse.json

Expand Down Expand Up @@ -258,4 +260,4 @@ authority.controlled.dspace.object.owner = true

# Configuration required for thorough testing of browse links
webui.browse.link.1 = author:dc.contributor.*
webui.browse.link.2 = subject:dc.subject.*
webui.browse.link.2 = subject:dc.subject.*
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,11 @@ public void afterPropertiesSet() throws Exception {
service = new DatabaseReader.Builder(
new BufferedInputStream(Files.newInputStream(Paths.get(dbfile)))).build();
} catch (IOException e) {
log.error("Unable to load GeoLite Database file (" + dbfile + ")! " +
log.debug("ERROR: Unable to load GeoLite Database file (" + dbfile + ")! " +
"You may need to reinstall it. See the DSpace installation instructions for more details.", e);
}
} else {
log.error("The required 'dbfile' configuration is missing in solr-statistics.cfg!");
log.debug("ERROR: The required 'dbfile' configuration is missing in solr-statistics.cfg!");
}
locationService = service;

Expand All @@ -100,7 +100,7 @@ public void afterPropertiesSet() throws Exception {
}

public String createFeedsContent() {
log.info("Going to create feeds content.");
log.debug("Going to create feeds content.");
String[] feedsConfig = configurationService.getArrayProperty("discojuice.feeds");
String shibbolethDiscoFeedUrl = configurationService.getProperty("shibboleth.discofeed.url");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import static org.apache.commons.lang.StringUtils.isNotBlank;

import org.apache.logging.log4j.Logger;
import org.dspace.services.ConfigurationService;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
Expand All @@ -31,6 +32,9 @@ public class ClarinDiscoJuiceFeedsUpdateScheduler implements InitializingBean {
@Autowired
ClarinDiscoJuiceFeedsDownloadService clarinDiscoJuiceFeedsDownloadService;

@Autowired
private ConfigurationService configurationService;

/**
* Instead of static {} method.
*/
Expand All @@ -45,7 +49,12 @@ public void afterPropertiesSet() throws Exception {
*/
@Scheduled(cron = "${discojuice.refresh:-}")
public void cronJobSch() {
log.info("CRON Job - going to download the discojuice feeds.");
boolean isAllowed = configurationService.getBooleanProperty("shibboleth.discofeed.allowed", true);
if (!isAllowed) {
return;
}

log.debug("CRON Job - going to download the discojuice feeds.");
String newFeedsContent = clarinDiscoJuiceFeedsDownloadService.createFeedsContent();
if (isNotBlank(newFeedsContent)) {
feedsContent = newFeedsContent;
Expand Down
4 changes: 3 additions & 1 deletion dspace/config/clarin-dspace.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -124,13 +124,15 @@ featured.service.teitok.description = A web-based platform for viewing, creating


##### Shibboleth #####
# Turn off the discofeed, it is allowed by default
# shibboleth.discofeed.allowed = false
# File where is DiscoJuiceFeed response
shibboleth.discofeed.url = https://lindat.mff.cuni.cz/Shibboleth.sso/DiscoFeed

# Configuration properties for DiscoJuice
discojuice.feeds = edugain, dfn, cesnet, surfnet2, haka, kalmar
# CRON job refresh time definition - default is refresh in every 2 hours.
discojuice.refresh = 0 */2 * * * ?
discojuice.refresh = 0 0 */2 * * ?
# Comma separated list of entityIDs; we try to guess country on these
discojuice.rewriteCountries = https://idp.scc.kit.edu/idp/shibboleth, https://fedauth.london.edu/oala/metadata, https://youidlite.youid.net/idp/shibboleth, https://cavle.org/shibboleth

Expand Down