Skip to content

Commit e8fe2e3

Browse files
committed
DSC-1619 provide better default configuration for iiif, clarify which cfg are related to external addons
1 parent fadac09 commit e8fe2e3

File tree

9 files changed

+255
-15
lines changed

9 files changed

+255
-15
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/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

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: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,17 @@ 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.
1212
# This example uses the solr plugin https://dbmdz.github.io/solr-ocrhighlighting/
13-
# iiif.search.url = ${solr.server}/${solr.multicorePrefix}ocr
13+
iiif.search.url = ${solr.server}/${solr.multicorePrefix}ocr
1414

1515
# The search plugin used to support (experimental) IIIF Search.
1616
# This is the class used with https://dbmdz.github.io/solr-ocrhighlighting/
1717
# It is currently the only supported option.
18-
# iiif.search.plugin = org.dspace.app.iiif.service.WordHighlightSolrSearch
18+
iiif.search.plugin = org.dspace.app.iiif.service.WordHighlightSolrSearch
1919

2020
# Sets the viewing hint. Possible values: "paged" or "individuals".
2121
# Typically "paged" is preferred for multi-age documents. Use "individuals"
@@ -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

Lines changed: 151 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,151 @@
1+
<dspace-dc-types>
2+
3+
<dspace-header>
4+
<title>DSpace Audio/Video Addon Schema</title>
5+
<contributor.author>Stefano Maffei</contributor.author>
6+
</dspace-header>
7+
8+
<dc-schema>
9+
<name>bitstream</name>
10+
<namespace>https://4science.it/audiovideo</namespace>
11+
</dc-schema>
12+
13+
<dc-schema>
14+
<name>dash</name>
15+
<namespace>https://4science.it/dash</namespace>
16+
</dc-schema>
17+
18+
<dc-type>
19+
<schema>bitstream</schema>
20+
<element>video</element>
21+
<qualifier>dashbundle</qualifier>
22+
<scope_note></scope_note>
23+
</dc-type>
24+
25+
<dc-type>
26+
<schema>dash</schema>
27+
<element>manifest</element>
28+
<qualifier></qualifier>
29+
<scope_note></scope_note>
30+
</dc-type>
31+
32+
<dc-type>
33+
<schema>bitstream</schema>
34+
<element>video</element>
35+
<qualifier>height</qualifier>
36+
<scope_note></scope_note>
37+
</dc-type>
38+
39+
<dc-type>
40+
<schema>bitstream</schema>
41+
<element>video</element>
42+
<qualifier>width</qualifier>
43+
<scope_note></scope_note>
44+
</dc-type>
45+
46+
<dc-type>
47+
<schema>bitstream</schema>
48+
<element>video</element>
49+
<qualifier>duration</qualifier>
50+
<scope_note></scope_note>
51+
</dc-type>
52+
53+
<dc-type>
54+
<schema>bitstream</schema>
55+
<element>video</element>
56+
<qualifier>format</qualifier>
57+
<scope_note></scope_note>
58+
</dc-type>
59+
60+
<dc-type>
61+
<schema>bitstream</schema>
62+
<element>video</element>
63+
<qualifier>codec</qualifier>
64+
<scope_note></scope_note>
65+
</dc-type>
66+
67+
<dc-type>
68+
<schema>bitstream</schema>
69+
<element>video</element>
70+
<qualifier>fps</qualifier>
71+
<scope_note></scope_note>
72+
</dc-type>
73+
74+
<dc-type>
75+
<schema>bitstream</schema>
76+
<element>video</element>
77+
<qualifier>audioformat</qualifier>
78+
<scope_note></scope_note>
79+
</dc-type>
80+
81+
<dc-type>
82+
<schema>bitstream</schema>
83+
<element>video</element>
84+
<qualifier>audiocodec</qualifier>
85+
<scope_note></scope_note>
86+
</dc-type>
87+
88+
<dc-type>
89+
<schema>bitstream</schema>
90+
<element>audio</element>
91+
<qualifier>peaks</qualifier>
92+
<scope_note></scope_note>
93+
</dc-type>
94+
95+
<dc-type>
96+
<schema>bitstream</schema>
97+
<element>scene</element>
98+
<qualifier>timestamp</qualifier>
99+
<scope_note></scope_note>
100+
</dc-type>
101+
102+
<dc-type>
103+
<schema>bitstream</schema>
104+
<element>category</element>
105+
<qualifier></qualifier>
106+
<scope_note></scope_note>
107+
</dc-type>
108+
109+
<dc-type>
110+
<schema>bitstream</schema>
111+
<element>transcribe</element>
112+
<qualifier>request</qualifier>
113+
<scope_note></scope_note>
114+
</dc-type>
115+
116+
<dc-type>
117+
<schema>bitstream</schema>
118+
<element>transcribe</element>
119+
<qualifier>processed</qualifier>
120+
<scope_note></scope_note>
121+
</dc-type>
122+
123+
<dc-type>
124+
<schema>bitstream</schema>
125+
<element>whisper</element>
126+
<qualifier>model</qualifier>
127+
<scope_note></scope_note>
128+
</dc-type>
129+
130+
<dc-type>
131+
<schema>bitstream</schema>
132+
<element>transcribe</element>
133+
<qualifier>request</qualifier>
134+
<scope_note></scope_note>
135+
</dc-type>
136+
137+
<dc-type>
138+
<schema>bitstream</schema>
139+
<element>transcribe</element>
140+
<qualifier>processed</qualifier>
141+
<scope_note></scope_note>
142+
</dc-type>
143+
144+
<dc-type>
145+
<schema>bitstream</schema>
146+
<element>whisper</element>
147+
<qualifier>model</qualifier>
148+
<scope_note></scope_note>
149+
</dc-type>
150+
151+
</dspace-dc-types>

0 commit comments

Comments
 (0)