-
Notifications
You must be signed in to change notification settings - Fork 7
1.6 Cantaloupe Configuration
Andy Smith edited this page Mar 5, 2020
·
8 revisions
Example settings in cantaloupe.properties
for development
DELEGATE SCRIPT
delegate_script.enabled = true
delegate_script.pathname = delegates.rb
SOURCES
source.static = HttpSource
source.delegate = false
HttpSource
HttpSource.lookup_strategy = ScriptLookupStrategy
Example delegates.rb
method for development
def httpsource_resource_info(_options = {})
# Code from https://slides.com/ksclarke/integrating-cantaloupe/fullscreen#/3
file_id = context['identifier']
# Split the parts into Fedora's pseudo-pairtree (only first four pairs)
paths = file_id.split(/(.{0,2})/).reject!(&:empty?)[0, 4]
fedora_base = 'http://localhost:8984'
fedora_path = '/rest/dev'
fedora_base_url = fedora_base + fedora_path
url = fedora_base_url + '/' + paths.join('/') + '/' + file_id
puts "Delegated URL: #{url}"
url
end