This repository has been archived by the owner on May 11, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
dor-services.rb
135 lines (117 loc) · 3.26 KB
/
dor-services.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
# frozen_string_literal: true
require 'active_fedora'
require 'active_fedora/version'
require 'active_support/core_ext/module/attribute_accessors'
require 'active_support/core_ext/object/blank'
require 'deprecation'
require 'retries' # Used by Dor::ReleaseTagService
module Dor
extend ActiveSupport::Autoload
@@registered_classes = {}
mattr_reader :registered_classes
class << self
def configure(*args, &block)
Dor::Config.configure *args, &block
end
# Load an object and inspect its identityMetadata to figure out what class
# to adapt it to.
# @param [String] pid The object's PID
# @return [Object] the ActiveFedora-modeled object
def find(pid, _opts = {})
Dor::Abstract.find pid, cast: true
end
def logger
require 'logger'
@logger ||= if defined?(::Rails) && ::Rails.respond_to?(:logger)
Rails.logger
else
Logger.new(STDOUT)
end
end
end
require 'dor/version'
require 'dor/static_config'
require 'dor/config'
require 'dor/exceptions'
# patches, utilities and helpers
require 'dor/utils/ng_tidy'
require 'dor/utils/solr_doc_helper'
require 'dor/utils/predicate_patch'
require 'dor/utils/pid_utils'
require 'dor/datastreams/datastream_spec_solrizer'
require 'druid-tools'
autoload_under 'indexers' do
autoload :CompositeIndexer
autoload :DataIndexer
autoload :DescribableIndexer
autoload :EditableIndexer
autoload :IdentifiableIndexer
autoload :ProcessableIndexer
autoload :ReleasableIndexer
autoload :WorkflowIndexer
autoload :WorkflowsIndexer
end
# datastreams
autoload_under 'datastreams' do
autoload :AdministrativeMetadataDS
autoload :ContentMetadataDS
autoload :DefaultObjectRightsDS
autoload :DescMetadataDS
autoload :EmbargoMetadataDS
autoload :EventsDS
autoload :GeoMetadataDS
autoload :IdentityMetadataDS
autoload :ProvenanceMetadataDS
autoload :RightsMetadataDS
autoload :RoleMetadataDS
autoload :SimpleDublinCoreDs
autoload :TechnicalMetadataDS
autoload :VersionMetadataDS
autoload :WorkflowDefinitionDs
autoload :WorkflowDs
end
# DOR Concerns
autoload_under 'models/concerns' do
autoload :Embargoable
end
eager_autoload do
autoload :ReleaseTags
# ActiveFedora Classes
autoload_under 'models' do
autoload :Abstract
autoload :AdminPolicyObject
autoload :Agreement
autoload :Collection
autoload :Etd
autoload :Item
autoload :Part
autoload :Set
autoload :WorkflowObject
autoload :WorkflowSolrDocument
end
end
# Services
autoload_under 'services' do
autoload :CollectionService
autoload :CreativeCommonsLicenseService
autoload :EmbargoService
autoload :IdentityMetadataTagService
autoload :Ontology
autoload :OpenDataLicenseService
autoload :PurlTagService
autoload :ReleaseTagService
autoload :SearchService
autoload :StatusService
autoload :SuriService
autoload :TagService
end
# Workflow Classes
module Workflow
extend ActiveSupport::Autoload
autoload :Process
autoload :Document
end
eager_load!
require 'dor/utils/hydrus_shims'
require 'dor/workflow/client'
end