Skip to content

Commit 747a74d

Browse files
abolliniatarix83
authored andcommitted
Merged in DSC-1619 (pull request DSpace#2224)
DSC-1619 Approved-by: Giuseppe Digilio
2 parents 1cc78a8 + 06e6199 commit 747a74d

File tree

12 files changed

+267
-22
lines changed

12 files changed

+267
-22
lines changed

dspace-api/src/main/java/org/dspace/iiif/consumer/IIIFCacheEventConsumer.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
import org.dspace.core.Context;
2020
import org.dspace.event.Consumer;
2121
import org.dspace.event.Event;
22+
import org.dspace.services.ConfigurationService;
23+
import org.dspace.utils.DSpace;
2224

2325

2426
/**
@@ -37,12 +39,18 @@ public class IIIFCacheEventConsumer implements Consumer {
3739
// Collects modified bitstreams for individual removal from canvas dimension cache.
3840
private final Set<DSpaceObject> toEvictFromCanvasCache = new HashSet<>();
3941

42+
private ConfigurationService configurationService;
43+
4044
@Override
4145
public void initialize() throws Exception {
46+
configurationService = new DSpace().getConfigurationService();
4247
}
4348

4449
@Override
4550
public void consume(Context ctx, Event event) throws Exception {
51+
if (!configurationService.getBooleanProperty("iiif.enabled", false)) {
52+
return;
53+
}
4654
int st = event.getSubjectType();
4755
if (!(st == Constants.BUNDLE || st == Constants.ITEM || st == Constants.BITSTREAM)) {
4856
return;
@@ -136,6 +144,9 @@ private void addToCacheEviction(DSpaceObject subject, DSpaceObject subject2, int
136144

137145
@Override
138146
public void end(Context ctx) throws Exception {
147+
if (!configurationService.getBooleanProperty("iiif.enabled", false)) {
148+
return;
149+
}
139150
// Get the eviction service beans.
140151
ManifestsCacheEvictService manifestsCacheEvictService = CacheEvictBeanLocator.getManifestsCacheEvictService();
141152
CanvasCacheEvictService canvasCacheEvictService = CacheEvictBeanLocator.getCanvasCacheEvictService();

dspace-server-webapp/src/test/java/org/dspace/app/rest/iiif/IIIFControllerIT.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ public void findOneIIIFSearchableItemWithDefaultDimensionsIT() throws Exception
131131
.andExpect(status().isOk())
132132
.andExpect(jsonPath("$.@context", is("http://iiif.io/api/presentation/2/context.json")))
133133
.andExpect(jsonPath("$.service.profile", is("http://iiif.io/api/search/0/search")))
134-
.andExpect(jsonPath("$.thumbnail.@id", containsString("/iiif/2/"
134+
.andExpect(jsonPath("$.thumbnail.@id", containsString("/iiif-server/"
135135
+ bitstream1.getID())))
136136
.andExpect(jsonPath("$.metadata[0].label", is("Title")))
137137
.andExpect(jsonPath("$.metadata[0].value", is("Public item 1")))

dspace/config/dspace.cfg

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -508,6 +508,8 @@ filter.org.dspace.app.mediafilter.TikaTextExtractionFilter.inputFormats = OpenDo
508508
filter.org.dspace.app.mediafilter.TikaTextExtractionFilter.inputFormats = OpenDocument Text
509509
filter.org.dspace.app.mediafilter.TikaTextExtractionFilter.inputFormats = RTF
510510
filter.org.dspace.app.mediafilter.TikaTextExtractionFilter.inputFormats = Text
511+
filter.org.dspace.app.mediafilter.TikaTextExtractionFilter.inputFormats = TTML
512+
filter.org.dspace.app.mediafilter.TikaTextExtractionFilter.inputFormats = WebVTT
511513
filter.org.dspace.app.mediafilter.JPEGFilter.inputFormats = BMP, GIF, JPEG, PNG
512514
filter.org.dspace.app.mediafilter.BrandedPreviewJPEGFilter.inputFormats = BMP, GIF, JPEG, PNG
513515
filter.org.dspace.app.mediafilter.ImageMagickImageThumbnailFilter.inputFormats = BMP, GIF, PNG, JPG, TIFF, JPEG, JPEG 2000
@@ -802,7 +804,7 @@ event.dispatcher.default.class = org.dspace.event.BasicDispatcher
802804
# Add rdf here, if you are using dspace-rdf to export your repository content as RDF.
803805
# Add iiif here, if you are using dspace-iiif.
804806
# Add orcidqueue here, if the integration with ORCID is configured and wish to enable the synchronization queue functionality
805-
event.dispatcher.default.consumers = versioning, discovery, eperson, dedup, crisconsumer, orcidqueue, audit, nbeventsdelete, referenceresolver, orcidwebhook, itemenhancer, customurl, reciprocal, filetypemetadataenhancer, authoritylink
807+
event.dispatcher.default.consumers = versioning, discovery, eperson, dedup, crisconsumer, orcidqueue, audit, nbeventsdelete, referenceresolver, orcidwebhook, itemenhancer, customurl, iiif, reciprocal, filetypemetadataenhancer, authoritylink
806808

807809
# enable the item enhancer poller
808810
related-item-enhancer-poller.enabled = true
@@ -1018,6 +1020,7 @@ registry.metadata.load = workflow-types.xml
10181020
registry.metadata.load = openaire4-types.xml
10191021
registry.metadata.load = dspace-types.xml
10201022
registry.metadata.load = iiif-types.xml
1023+
registry.metadata.load = av-types.xml
10211024
registry.metadata.load = bitstream-types.xml
10221025
registry.metadata.load = dataquality-types.xml
10231026

@@ -1962,6 +1965,7 @@ include = ${module_dir}/authentication-shibboleth.cfg
19621965
include = ${module_dir}/authentication-x509.cfg
19631966
include = ${module_dir}/authentication-orcid.cfg
19641967
include = ${module_dir}/authority.cfg
1968+
include = ${module_dir}/av-stream.cfg
19651969
include = ${module_dir}/bulkedit.cfg
19661970
include = ${module_dir}/citation-page.cfg
19671971
include = ${module_dir}/clamav.cfg
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# EXAMPLE "local-orchestrator-<env>.cfg" for the 4Science DSpace Orchestrator Addon.
2+
3+
solr-database-resync.cron = -
4+
related-item-enhancer-poller.enabled = false

dspace/config/local.cfg.EXAMPLE

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -326,14 +326,8 @@ usage-statistics.dbfile=/var/lib/GeoIP/GeoLite2-City.mmdb
326326
# IIIF and OCR Integration #
327327
############################
328328

329-
## IIIF configuration
330-
iiif.enabled = false
331-
# iiif.image.server =
332-
333-
## OCR configuration
334-
# iiif.search.url = ${solr.server}/${solr.multicorePrefix}ocr
335-
# iiif.search.plugin = org.dspace.app.iiif.service.WordHighlightSolrSearch
336-
# ocr.tesseract.path =
329+
## IIIF configuration (see modules/iiif.cfg)
330+
#iiif.enabled = true
337331

338332
#########################################################
339333
### LOGIN MIUR configuration ###
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
#---------------------------------------------------------------#
2+
#-------------AV STREAMING CONFIGURATIONS-----------------------#
3+
#---------------------------------------------------------------#
4+
# Configuration properties used by the AV Streaming viewer #
5+
# This configuration file is related to the 4Science AV addon #
6+
# for more information see https://4science.com/dspace-add-ons/ #
7+
#---------------------------------------------------------------#
8+
9+
video.valid-mimetype = video/webm, video/x-matroska, video/mpeg, video/quicktime,\
10+
video/mp4, video/x-msvideo, video/x-flv, video/divx, video/3gpp, video/avi
11+
12+
audio.valid-mimetype = audio/x-mpeg, audio/x-pn-realaudio, audio/mpeg, audio/x-aiff,\
13+
audio/basic, audio/x-wav, audio/mp4, audio/ogg, audio/flac,\
14+
audio/aac, audio/ac3, audio/x-ms-wma, audio/vnd.wave, audio/mp3,\
15+
video/ogg
16+
17+
18+
# Only subtitles in VTT format are supported by the Video JS Player
19+
subtitles.supported.mimetypes = text/vtt
20+
21+
audiowaveform.path = /usr/bin/audiowaveform
22+
ffmpeg.path = /usr/bin/ffmpeg
23+
ffprobe.path = /usr/bin/ffprobe
24+
m4box.path = /usr/bin/MP4Box
25+
26+
stream-hq.height = 720
27+
stream-hq.width = 1280
28+
stream-mq.height = 480
29+
stream-mq.width = 640
30+
stream-lq.height = 180
31+
stream-lq.width = 320
32+
stream-original.enabled = true
33+
34+
# use the follow configuration when the curation task have to work only on a certain bundle name
35+
#input-audio-bundle-name = ORIGINAL
36+
#input-video-bundle-name = ORIGINAL
37+
38+
# use the following to edit the max width for a thumbnail (Default is 500px)
39+
# Height is set to keep the aspect ratio so it cannot be edited
40+
41+
filter-media.video.thumbnail.max-width = 500
42+
filter-media.audio.thumbnail.max-width = 200
43+
filter-media.audio.thumbnail.max-height = 100
44+
45+
# The following configuration allows to skip the retrieval
46+
# of several scenes in a specified time period (seconds)
47+
#scene.discading.interval = 30
48+
49+
scene.thumbnail.max-width = 500
50+
video.thumbnail.max-number = 20
51+
52+
### Configure the transcribe service ###
53+
54+
# Choose the correct service plugin
55+
av-stream.transcribe-service.plugin = whisper-service
56+
#av-stream.transcribe-service.plugin = aws-transcribe-service
57+
58+
59+
### WHISPER Transcribe Configuration ###
60+
61+
whisper.fullpath = ~/.local/bin/whisper
62+
63+
### Whisper models are: tiny - base - small - medium - large
64+
whisper.default.transcription-model = base
65+
66+
whisper.transcription-format = vtt

dspace/config/modules/deduplication.cfg

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,9 @@ deduplication.facet-limit = 150
3535
#------------DEDUPLICATION / DATAQUALITY CONFIGURATIONS------------#
3636
#------------------------------------------------------------------#
3737
# #
38-
# Configurations for the Deduplication / DataQuality features #
39-
# #
38+
# The configurations below are related to the extra #
39+
# functionalities provided by the 4Science Data Quality addon #
40+
# for more information see https://4science.com/dspace-add-ons/ #
4041
#------------------------------------------------------------------#
4142
# metadata here listed will be excluded by merge tool logic
4243
merge.excluded-metadata = dc.description.provenance, datacite.rights, dc.date.accessioned, dc.date.modified, dc.date.available, dspace.entity.type

dspace/config/modules/iiif.cfg

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ iiif.enabled = false
55

66
# Public base url of a iiif server able to serve DSpace images. The bitstream
77
# uuid is appended to this URL
8-
iiif.image.server = http://localhost:8182/iiif/2/
8+
iiif.image.server = ${dspace.ui.url}/iiif-server/
99

1010
# Base URL of the search service used to support the (experimental) IIIF Search
1111
# capability. The actual path will depend on how search is being supported.
@@ -110,6 +110,15 @@ iiif.search.rows = 120
110110
# If you choose to encode utf8 for solr indexing, set this property to true.
111111
iiif.search.index.xml.encode = false
112112

113+
#------------------------------------------------------------------#
114+
#------------ IIIF Plus CONFIGURATIONS ------------#
115+
#------------------------------------------------------------------#
116+
# #
117+
# The configurations below are related to the extra #
118+
# functionalities provided by the 4Science IIIF Plus addon #
119+
# for more information see https://4science.com/dspace-add-ons/ #
120+
#------------------------------------------------------------------#
121+
113122
# Valid formats
114123
iiif.valid-formats = JPEG
115124
iiif.valid-formats = GIF

dspace/config/modules/networklab.cfg

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
#---------------------------------------------------------------------#
22
#-------------------Networklab Addon CONFIGURATIONS-------------------#
33
#---------------------------------------------------------------------#
4-
# Configuration properties used by the addon module #
4+
# This configuration file is related to the 4Science #
5+
# Network Labs addon #
6+
# for more information see https://4science.com/dspace-add-ons/ #
57
#---------------------------------------------------------------------#
68

79
# Url of the neo4j instance

dspace/config/modules/ocr.cfg

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
#### OCR CONFIGURATION ####
2+
# This configuration file is related to the 4Science OCR addon
3+
# for more information see https://4science.com/dspace-add-ons/
24

35
# IIIF Search settings are defined in iiif module file, so see the iiif.cfg file
46

0 commit comments

Comments
 (0)