class CurationConcerns::Configuration

Attributes

analytic_start_date[RW]
analytics[RW]
binaries_directory[W]

@!attribute [w] binaries_directory

Location where binary files are exported
characterization_runner[RW]

Override characterization runner

dashboard_configuration[W]

@!attribute [w] dashboard_configuration

Configuration for dashboard rendering.
default_antivirus_instance[W]

An anonymous function that receives a path to a file and returns AntiVirusScanner::NO_VIRUS_FOUND_RETURN_VALUE if no virus is found; Any other returned value means a virus was found

derivatives_path[W]

Path on the local file system where derivatives will be stored

descriptions_directory[W]

@!attribute [w] descriptions_directory

Location where description files are exported
display_microdata[W]
enable_ffmpeg[W]
enable_local_ingest[RW]
enable_noids[W]
ffmpeg_path[W]
fits_message_length[W]
fits_path[W]
import_export_jar_file_path[W]

@!attribute [w] import_export_jar_file_path

Path to the jar file for the Fedora import/export tool
ingest_queue_name[W]

@!attribute [w] ingest_queue_name

ActiveJob queue to handle ingest-like jobs.
license_service_class[W]

A configuration point for changing the behavior of the license service.

@!attribute [w] license_service_class

A configuration point for changing the behavior of the license service.

@see CurationConcerns::LicenseService for implementation details
@see https://github.com/projecthydra/curation_concerns/pull/1047
lock_retry_count[W]

Attributes for the lock manager which ensures a single process/thread is mutating a ore:Aggregation at once. @!attribute [w] lock_retry_count

How many times to retry to acquire the lock before raising UnableToAcquireLockError
lock_retry_delay[W]

@!attribute [w] lock_retry_delay

Maximum wait time in milliseconds before retrying. Wait time is a random value between 0 and retry_delay.
lock_time_to_live[W]

@!attribute [w] lock_time_to_live

How long to hold the lock in milliseconds
max_days_between_audits[W]
microdata_default_type[W]
minter_statefile[W]
noid_template[W]
temp_file_base[RW]
translate_id_to_uri[W]
translate_uri_to_id[W]
working_path[W]

Path on the local file system where originals will be staged before being ingested into Fedora.

Public Class Methods

new() click to toggle source
# File lib/curation_concerns/configuration.rb, line 16
def initialize
  @registered_concerns = []
end

Public Instance Methods

binaries_directory() click to toggle source
# File lib/curation_concerns/configuration.rb, line 163
def binaries_directory
  @binaries_directory ||= "tmp/binaries"
end
curation_concerns() click to toggle source

@return [Array<Class>] the registered curation concerns

# File lib/curation_concerns/configuration.rb, line 227
def curation_concerns
  registered_curation_concern_types.map(&:constantize)
end
dashboard_configuration() click to toggle source
# File lib/curation_concerns/configuration.rb, line 170
def dashboard_configuration
  @dashboard_configuration ||= {
    menu: {
      index: {},
      resource_details: {},
      workflow: {},
      workflow_roles: {}
    },
    actions: {
      index: {
        partials: [
          "total_objects_charts",
          "total_embargo_visibility"
        ]
      },
      resource_details: {
        partials: [
          "total_objects"
        ]
      },
      workflow: {
        partials: [
          "workflow"
        ]
      }
    },
    data_sources: {
      resource_stats: CurationConcerns::ResourceStatisticsSource
    }
  }
end
default_antivirus_instance() click to toggle source
# File lib/curation_concerns/configuration.rb, line 24
def default_antivirus_instance
  @default_antivirus_instance ||= lambda do |_file_path|
    AntiVirusScanner::NO_VIRUS_FOUND_RETURN_VALUE
  end
end
derivatives_path() click to toggle source
# File lib/curation_concerns/configuration.rb, line 32
def derivatives_path
  @derivatives_path ||= File.join(Rails.root, 'tmp', 'derivatives')
end
descriptions_directory() click to toggle source
# File lib/curation_concerns/configuration.rb, line 156
def descriptions_directory
  @descriptions_directory ||= "tmp/descriptions"
end
display_microdata() click to toggle source
# File lib/curation_concerns/configuration.rb, line 62
def display_microdata
  return @display_microdata unless @display_microdata.nil?
  @display_microdata = true
end
enable_ffmpeg() click to toggle source
# File lib/curation_concerns/configuration.rb, line 43
def enable_ffmpeg
  return @enable_ffmpeg unless @enable_ffmpeg.nil?
  @enable_ffmpeg = false
end
enable_noids() click to toggle source
# File lib/curation_concerns/configuration.rb, line 78
def enable_noids
  return @enable_noids unless @enable_noids.nil?
  @enable_noids = true
end
ffmpeg_path() click to toggle source
# File lib/curation_concerns/configuration.rb, line 49
def ffmpeg_path
  @ffmpeg_path ||= 'ffmpeg'
end
fits_message_length() click to toggle source
# File lib/curation_concerns/configuration.rb, line 54
def fits_message_length
  @fits_message_length ||= 5
end
fits_path() click to toggle source
# File lib/curation_concerns/configuration.rb, line 110
def fits_path
  @fits_path ||= 'fits.sh'
end
import_export_jar_file_path() click to toggle source
# File lib/curation_concerns/configuration.rb, line 149
def import_export_jar_file_path
  @import_export_jar_file_path ||= "tmp/fcrepo-import-export.jar"
end
ingest_queue_name() click to toggle source
# File lib/curation_concerns/configuration.rb, line 142
def ingest_queue_name
  @ingest_queue_name ||= :default
end
license_service_class() click to toggle source
# File lib/curation_concerns/configuration.rb, line 239
def license_service_class
  @license_service_class ||= CurationConcerns::LicenseService
end
lock_retry_count() click to toggle source
# File lib/curation_concerns/configuration.rb, line 121
def lock_retry_count
  @lock_retry_count ||= 600 # Up to 2 minutes of trying at intervals up to 200ms
end
lock_retry_delay() click to toggle source
# File lib/curation_concerns/configuration.rb, line 135
def lock_retry_delay
  @lock_retry_delay ||= 200 # milliseconds
end
lock_time_to_live() click to toggle source
# File lib/curation_concerns/configuration.rb, line 128
def lock_time_to_live
  @lock_time_to_live ||= 60_000 # milliseconds
end
max_days_between_audits() click to toggle source
# File lib/curation_concerns/configuration.rb, line 73
def max_days_between_audits
  @max_days_between_audits ||= 7
end
microdata_default_type() click to toggle source
# File lib/curation_concerns/configuration.rb, line 68
def microdata_default_type
  @microdata_default_type ||= 'http://schema.org/CreativeWork'
end
minter_statefile() click to toggle source
# File lib/curation_concerns/configuration.rb, line 99
def minter_statefile
  @minter_statefile ||= '/tmp/minter-state'
end
noid_template() click to toggle source
# File lib/curation_concerns/configuration.rb, line 94
def noid_template
  @noid_template ||= '.reeddeeddk'
end
register_curation_concern(*curation_concern_types) click to toggle source

Registers the given curation concern model in the configuration @param [Array<Symbol>,Symbol] curation_concern_types

# File lib/curation_concerns/configuration.rb, line 211
def register_curation_concern(*curation_concern_types)
  Array.wrap(curation_concern_types).flatten.compact.each do |cc_type|
    unless @registered_concerns.include?(cc_type)
      @registered_concerns << cc_type
    end
  end
end
registered_curation_concern_types() click to toggle source

The normalization done by this method must occur after the initialization process so it can take advantage of irregular inflections from config/initializers/inflections.rb @return [Array<String>] the class names of the registered curation concerns

# File lib/curation_concerns/configuration.rb, line 222
def registered_curation_concern_types
  @registered_concerns.map { |cc_type| normalize_concern_name(cc_type) }
end
translate_id_to_uri() click to toggle source
# File lib/curation_concerns/configuration.rb, line 89
def translate_id_to_uri
  @translate_id_to_uri ||= ActiveFedora::Noid.config.translate_id_to_uri
end
translate_uri_to_id() click to toggle source
# File lib/curation_concerns/configuration.rb, line 84
def translate_uri_to_id
  @translate_uri_to_id ||= ActiveFedora::Noid.config.translate_uri_to_id
end
working_path() click to toggle source
# File lib/curation_concerns/configuration.rb, line 38
def working_path
  @working_path ||= File.join(Rails.root, 'tmp', 'uploads')
end

Private Instance Methods

normalize_concern_name(c) click to toggle source

@param [Symbol] the symbol representing the model @return [String] the class name for the model

# File lib/curation_concerns/configuration.rb, line 247
def normalize_concern_name(c)
  c.to_s.camelize
end