Class: IIIFManifest::ManifestServiceLocator

Inherits:
Object
  • Object
show all
Defined in:
lib/iiif_manifest/manifest_service_locator.rb

Direct Known Subclasses

V3::ManifestServiceLocator

Defined Under Namespace

Classes: InjectedFactory

Class Method Summary collapse

Class Method Details

.canvas_builderObject



132
133
134
135
136
137
138
# File 'lib/iiif_manifest/manifest_service_locator.rb', line 132

def canvas_builder
  InjectedFactory.new(
    ManifestBuilder::CanvasBuilder,
    iiif_canvas_factory: iiif_canvas_factory,
    image_builder: image_builder
  )
end

.canvas_builder_factoryObject



118
119
120
121
122
123
# File 'lib/iiif_manifest/manifest_service_locator.rb', line 118

def canvas_builder_factory
  ManifestBuilder::CanvasBuilderFactory.new(
    composite_builder: composite_builder,
    canvas_builder_factory: canvas_builder
  )
end

.child_manifest_builderObject



20
21
22
23
24
25
26
# File 'lib/iiif_manifest/manifest_service_locator.rb', line 20

def child_manifest_builder
  InjectedFactory.new(
    ManifestBuilder,
    builders: record_property_builder,
    top_record_factory: iiif_manifest_factory
  )
end

.child_manifest_builder_factoryObject



63
64
65
66
67
68
# File 'lib/iiif_manifest/manifest_service_locator.rb', line 63

def child_manifest_builder_factory
  ManifestBuilder::ChildManifestBuilderFactory.new(
    composite_builder: composite_builder,
    child_manifest_builder: child_manifest_builder
  )
end

.collection_manifest_builderObject



4
5
6
7
8
9
10
# File 'lib/iiif_manifest/manifest_service_locator.rb', line 4

def collection_manifest_builder
  InjectedFactory.new(
    ManifestBuilder,
    builders: collection_manifest_builders,
    top_record_factory: iiif_collection_factory
  )
end

.collection_manifest_buildersObject



55
56
57
58
59
60
61
# File 'lib/iiif_manifest/manifest_service_locator.rb', line 55

def collection_manifest_builders
  composite_builder_factory.new(
    record_property_builder,
    child_manifest_builder_factory,
    composite_builder: composite_builder
  )
end

.composite_builderObject



74
75
76
# File 'lib/iiif_manifest/manifest_service_locator.rb', line 74

def composite_builder
  ManifestBuilder::CompositeBuilder
end

.composite_builder_factoryObject



78
79
80
# File 'lib/iiif_manifest/manifest_service_locator.rb', line 78

def composite_builder_factory
  ManifestBuilder::CompositeBuilderFactory
end

.deep_canvas_builder_factoryObject



125
126
127
128
129
130
# File 'lib/iiif_manifest/manifest_service_locator.rb', line 125

def deep_canvas_builder_factory
  ManifestBuilder::DeepCanvasBuilderFactory.new(
    composite_builder: composite_builder,
    canvas_builder_factory: canvas_builder
  )
end

.iiif_annotation_factoryObject



171
172
173
# File 'lib/iiif_manifest/manifest_service_locator.rb', line 171

def iiif_annotation_factory
  IIIFManifest::ManifestBuilder::IIIFManifest::Annotation
end

.iiif_autocomplete_service_factoryObject



191
192
193
# File 'lib/iiif_manifest/manifest_service_locator.rb', line 191

def iiif_autocomplete_service_factory
  IIIFManifest::ManifestBuilder::IIIFManifest::AutocompleteService
end

.iiif_canvas_factoryObject



179
180
181
# File 'lib/iiif_manifest/manifest_service_locator.rb', line 179

def iiif_canvas_factory
  IIIFManifest::ManifestBuilder::IIIFManifest::Canvas
end

.iiif_collection_factoryObject



70
71
72
# File 'lib/iiif_manifest/manifest_service_locator.rb', line 70

def iiif_collection_factory
  IIIFManifest::ManifestBuilder::IIIFManifest::Collection
end

.iiif_manifest_factoryObject



175
176
177
# File 'lib/iiif_manifest/manifest_service_locator.rb', line 175

def iiif_manifest_factory
  IIIFManifest::ManifestBuilder::IIIFManifest
end

.iiif_range_factoryObject



183
184
185
# File 'lib/iiif_manifest/manifest_service_locator.rb', line 183

def iiif_range_factory
  IIIFManifest::ManifestBuilder::IIIFManifest::Range
end

.iiif_resource_factoryObject



167
168
169
# File 'lib/iiif_manifest/manifest_service_locator.rb', line 167

def iiif_resource_factory
  IIIFManifest::ManifestBuilder::IIIFManifest::Resource
end

.iiif_search_service_factoryObject



187
188
189
# File 'lib/iiif_manifest/manifest_service_locator.rb', line 187

def iiif_search_service_factory
  IIIFManifest::ManifestBuilder::IIIFManifest::SearchService
end

.iiif_service_factoryObject



163
164
165
# File 'lib/iiif_manifest/manifest_service_locator.rb', line 163

def iiif_service_factory
  IIIFManifest::ManifestBuilder::IIIFService
end

.image_builderObject



140
141
142
143
144
145
146
# File 'lib/iiif_manifest/manifest_service_locator.rb', line 140

def image_builder
  InjectedFactory.new(
    ManifestBuilder::ImageBuilder,
    iiif_annotation_factory: iiif_annotation_factory,
    resource_builder_factory: resource_builder_factory
  )
end

.image_service_builder_factoryObject



156
157
158
159
160
161
# File 'lib/iiif_manifest/manifest_service_locator.rb', line 156

def image_service_builder_factory
  InjectedFactory.new(
    ManifestBuilder::ImageServiceBuilder,
    iiif_service_factory: iiif_service_factory
  )
end

.manifest_builderObject



12
13
14
15
16
17
18
# File 'lib/iiif_manifest/manifest_service_locator.rb', line 12

def manifest_builder
  InjectedFactory.new(
    ManifestBuilder,
    builders: manifest_builders,
    top_record_factory: iiif_manifest_factory
  )
end

.manifest_buildersObject

Builders which receive a work as an argument to .new and return objects

that respond to #apply.


38
39
40
41
42
43
44
45
# File 'lib/iiif_manifest/manifest_service_locator.rb', line 38

def manifest_builders
  composite_builder_factory.new(
    record_property_builder,
    sequence_builder,
    structure_builder,
    composite_builder: composite_builder
  )
end

.record_property_builderObject



82
83
84
85
86
87
88
# File 'lib/iiif_manifest/manifest_service_locator.rb', line 82

def record_property_builder
  InjectedFactory.new(
    ManifestBuilder::RecordPropertyBuilder,
    iiif_search_service_factory: iiif_search_service_factory,
    iiif_autocomplete_service_factory: iiif_autocomplete_service_factory
  )
end

.resource_builder_factoryObject



148
149
150
151
152
153
154
# File 'lib/iiif_manifest/manifest_service_locator.rb', line 148

def resource_builder_factory
  InjectedFactory.new(
    ManifestBuilder::ResourceBuilder,
    iiif_resource_factory: iiif_resource_factory,
    image_service_builder_factory: image_service_builder_factory
  )
end

.sammelband_manifest_builderObject



28
29
30
31
32
33
34
# File 'lib/iiif_manifest/manifest_service_locator.rb', line 28

def sammelband_manifest_builder
  InjectedFactory.new(
    ManifestBuilder,
    builders: sammelband_manifest_builders,
    top_record_factory: iiif_manifest_factory
  )
end

.sammelband_manifest_buildersObject



47
48
49
50
51
52
53
# File 'lib/iiif_manifest/manifest_service_locator.rb', line 47

def sammelband_manifest_builders
  composite_builder_factory.new(
    record_property_builder,
    sammelband_sequence_builder,
    composite_builder: composite_builder
  )
end

.sammelband_sequence_builderObject



106
107
108
109
110
111
112
# File 'lib/iiif_manifest/manifest_service_locator.rb', line 106

def sammelband_sequence_builder
  InjectedFactory.new(
    ManifestBuilder::SequenceBuilder,
    canvas_builder_factory: deep_canvas_builder_factory,
    sequence_factory: sequence_factory
  )
end

.sequence_builderObject



98
99
100
101
102
103
104
# File 'lib/iiif_manifest/manifest_service_locator.rb', line 98

def sequence_builder
  InjectedFactory.new(
    ManifestBuilder::SequenceBuilder,
    canvas_builder_factory: canvas_builder_factory,
    sequence_factory: sequence_factory
  )
end

.sequence_factoryObject



114
115
116
# File 'lib/iiif_manifest/manifest_service_locator.rb', line 114

def sequence_factory
  IIIFManifest::ManifestBuilder::IIIFManifest::Sequence
end

.structure_builderObject



90
91
92
93
94
95
96
# File 'lib/iiif_manifest/manifest_service_locator.rb', line 90

def structure_builder
  InjectedFactory.new(
    ManifestBuilder::StructureBuilder,
    canvas_builder_factory: canvas_builder,
    iiif_range_factory: iiif_range_factory
  )
end