hydra-pbcore 2.1.0 → 2.2.0rc1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/hydra_pbcore/datastream/deprecated/digital_document.rb +5 -1
- data/lib/hydra_pbcore/datastream/deprecated/document.rb +10 -6
- data/lib/hydra_pbcore/datastream/deprecated/instantiation.rb +7 -4
- data/lib/hydra_pbcore/datastream/document.rb +8 -4
- data/lib/hydra_pbcore/datastream/instantiation.rb +7 -3
- data/lib/hydra_pbcore/templates.rb +6 -6
- data/lib/hydra_pbcore/version.rb +1 -1
- data/spec/templates_spec.rb +5 -0
- metadata +5 -8
@@ -1,6 +1,10 @@
|
|
1
1
|
module HydraPbcore::Datastream::Deprecated
|
2
2
|
class DigitalDocument < ActiveFedora::NokogiriDatastream
|
3
3
|
|
4
|
+
class_attribute :institution, :relator
|
5
|
+
self.institution = "Rock and Roll Hall of Fame and Museum"
|
6
|
+
self.relator = "MARC relator terms"
|
7
|
+
|
4
8
|
include HydraPbcore::Methods
|
5
9
|
include HydraPbcore::Templates
|
6
10
|
include HydraPbcore::Conversions
|
@@ -13,7 +17,7 @@ class DigitalDocument < ActiveFedora::NokogiriDatastream
|
|
13
17
|
xml.pbcoreDescriptionDocument("xmlns:xsi"=>"http://www.w3.org/2001/XMLSchema-instance",
|
14
18
|
"xsi:schemaLocation"=>"http://www.pbcore.org/PBCore/PBCoreNamespace.html") {
|
15
19
|
|
16
|
-
xml.pbcoreIdentifier(:source=>
|
20
|
+
xml.pbcoreIdentifier(:source=>self.institution, :annotation=>"PID")
|
17
21
|
xml.pbcoreTitle(:titleType=>"Main")
|
18
22
|
xml.pbcoreDescription(:descriptionType=>"Description",
|
19
23
|
:descriptionTypeSource=>"pbcoreDescription/descriptionType",
|
@@ -1,6 +1,10 @@
|
|
1
1
|
module HydraPbcore::Datastream::Deprecated
|
2
2
|
class Document < ActiveFedora::NokogiriDatastream
|
3
3
|
|
4
|
+
class_attribute :institution, :relator
|
5
|
+
self.institution = "Rock and Roll Hall of Fame and Museum"
|
6
|
+
self.relator = "MARC relator terms"
|
7
|
+
|
4
8
|
include HydraPbcore::Methods
|
5
9
|
include HydraPbcore::Templates
|
6
10
|
include HydraPbcore::Conversions
|
@@ -9,7 +13,7 @@ class Document < ActiveFedora::NokogiriDatastream
|
|
9
13
|
t.root(:path=>"pbcoreDescriptionDocument")
|
10
14
|
|
11
15
|
t.pbc_id(:path=>"pbcoreIdentifier",
|
12
|
-
:attributes=>{ :source=>
|
16
|
+
:attributes=>{ :source=>self.institution, :annotation=>"PID" }
|
13
17
|
)
|
14
18
|
|
15
19
|
t.title(:path=>"pbcoreTitle", :attributes=>{ :titleType=>"Main" }, :index_as => [:searchable, :displayable])
|
@@ -42,7 +46,7 @@ class Document < ActiveFedora::NokogiriDatastream
|
|
42
46
|
:index_as => [:displayable]
|
43
47
|
)
|
44
48
|
t.rh_subject(:path=>"pbcoreSubject",
|
45
|
-
:attributes=>{ :source=>
|
49
|
+
:attributes=>{ :source=>self.institution },
|
46
50
|
:index_as => [:displayable]
|
47
51
|
)
|
48
52
|
|
@@ -113,7 +117,7 @@ class Document < ActiveFedora::NokogiriDatastream
|
|
113
117
|
t.contributor(:path=>"pbcoreContributor") do
|
114
118
|
t.name_(:path=>"contributor")
|
115
119
|
t.role_(:path=>"contributorRole",
|
116
|
-
:attributes=>{ :source=>
|
120
|
+
:attributes=>{ :source=>self.relator }
|
117
121
|
)
|
118
122
|
end
|
119
123
|
t.contributor_name(:proxy=>[:contributor, :name], :index_as => [:searchable, :facetable])
|
@@ -135,7 +139,7 @@ class Document < ActiveFedora::NokogiriDatastream
|
|
135
139
|
t.pbcoreInstantiation do
|
136
140
|
t.instantiationIdentifier(:attributes=>{
|
137
141
|
:annotation=>"Barcode",
|
138
|
-
:source=>
|
142
|
+
:source=>self.institution
|
139
143
|
})
|
140
144
|
t.instantiationDate(:attributes=>{ :dateType=>"created" })
|
141
145
|
t.instantiationPhysical(:attributes=>{ :source=>"PBCore instantiationPhysical" })
|
@@ -209,7 +213,7 @@ class Document < ActiveFedora::NokogiriDatastream
|
|
209
213
|
xml.pbcoreDescriptionDocument("xmlns:xsi"=>"http://www.w3.org/2001/XMLSchema-instance",
|
210
214
|
"xsi:schemaLocation"=>"http://www.pbcore.org/PBCore/PBCoreNamespace.html") {
|
211
215
|
|
212
|
-
xml.pbcoreIdentifier(:source=>
|
216
|
+
xml.pbcoreIdentifier(:source=>self.institution, :annotation=>"PID")
|
213
217
|
xml.pbcoreTitle(:titleType=>"Main")
|
214
218
|
xml.pbcoreDescription(:descriptionType=>"Description",
|
215
219
|
:descriptionTypeSource=>"pbcoreDescription/descriptionType",
|
@@ -247,7 +251,7 @@ class Document < ActiveFedora::NokogiriDatastream
|
|
247
251
|
xml.pbcoreInstantiation {
|
248
252
|
|
249
253
|
# Item details
|
250
|
-
xml.instantiationIdentifier(:annotation=>"Barcode", :source=>
|
254
|
+
xml.instantiationIdentifier(:annotation=>"Barcode", :source=>self.institution)
|
251
255
|
xml.instantiationDate(:dateType=>"created")
|
252
256
|
xml.instantiationPhysical(:source=>"PBCore instantiationPhysical")
|
253
257
|
xml.instantiationStandard
|
@@ -1,6 +1,9 @@
|
|
1
1
|
module HydraPbcore::Datastream::Deprecated
|
2
2
|
class Instantiation < ActiveFedora::NokogiriDatastream
|
3
3
|
|
4
|
+
class_attribute :institution
|
5
|
+
self.institution = "Rock and Roll Hall of Fame and Museum"
|
6
|
+
|
4
7
|
include HydraPbcore::Methods
|
5
8
|
include HydraPbcore::Templates
|
6
9
|
include HydraPbcore::Conversions
|
@@ -14,7 +17,7 @@ class Instantiation < ActiveFedora::NokogiriDatastream
|
|
14
17
|
t.instantiationIdentifier(
|
15
18
|
:attributes=>{
|
16
19
|
:annotation=>"Filename",
|
17
|
-
:source=>
|
20
|
+
:source=>self.institution
|
18
21
|
},
|
19
22
|
:index_as => [:displayable]
|
20
23
|
)
|
@@ -80,7 +83,7 @@ class Instantiation < ActiveFedora::NokogiriDatastream
|
|
80
83
|
)
|
81
84
|
|
82
85
|
t.instantiationRelation do
|
83
|
-
t.instantiationRelationIdentifier(:attributes=>{ :source=>
|
86
|
+
t.instantiationRelationIdentifier(:attributes=>{ :source=>self.institution })
|
84
87
|
end
|
85
88
|
# The file we're describing at the root of this document preceeds the file marked "next"
|
86
89
|
t.next_inst(:ref => [:pbcoreInstantiation, :instantiationRelation],
|
@@ -199,13 +202,13 @@ class Instantiation < ActiveFedora::NokogiriDatastream
|
|
199
202
|
|
200
203
|
# These fields are only added so that this document will be validated. However, they
|
201
204
|
# shouldn't be used for anything else here because they're in the parent Fedora object
|
202
|
-
xml.pbcoreIdentifier(:annotation=>"PID", :source=>
|
205
|
+
xml.pbcoreIdentifier(:annotation=>"PID", :source=>self.institution)
|
203
206
|
xml.pbcoreTitle
|
204
207
|
xml.pbcoreDescription
|
205
208
|
|
206
209
|
xml.pbcoreInstantiation {
|
207
210
|
|
208
|
-
xml.instantiationIdentifier(:annotation=>"Filename", :source=>
|
211
|
+
xml.instantiationIdentifier(:annotation=>"Filename", :source=>self.institution)
|
209
212
|
xml.instantiationDate(:dateType=>"created")
|
210
213
|
xml.instantiationDigital(:source=>"EBU file formats")
|
211
214
|
xml.instantiationLocation
|
@@ -1,6 +1,10 @@
|
|
1
1
|
module HydraPbcore::Datastream
|
2
2
|
class Document < ActiveFedora::OmDatastream
|
3
3
|
|
4
|
+
class_attribute :institution, :relator
|
5
|
+
self.institution = "Rock and Roll Hall of Fame and Museum"
|
6
|
+
self.relator = "MARC relator terms"
|
7
|
+
|
4
8
|
include HydraPbcore::Methods
|
5
9
|
include HydraPbcore::Templates
|
6
10
|
include HydraPbcore::Conversions
|
@@ -9,7 +13,7 @@ class Document < ActiveFedora::OmDatastream
|
|
9
13
|
t.root(:path=>"pbcoreDescriptionDocument")
|
10
14
|
|
11
15
|
t.pbc_id(:path=>"pbcoreIdentifier",
|
12
|
-
:attributes=>{ :source=>
|
16
|
+
:attributes=>{ :source=>self.institution, :annotation=>"PID" }
|
13
17
|
)
|
14
18
|
|
15
19
|
t.title(:path=>"pbcoreTitle", :attributes=>{ :titleType=>"Main" }, :index_as => [:searchable, :displayable])
|
@@ -42,7 +46,7 @@ class Document < ActiveFedora::OmDatastream
|
|
42
46
|
:index_as => [:displayable]
|
43
47
|
)
|
44
48
|
t.rh_subject(:path=>"pbcoreSubject",
|
45
|
-
:attributes=>{ :source=>
|
49
|
+
:attributes=>{ :source=>self.institution },
|
46
50
|
:index_as => [:displayable]
|
47
51
|
)
|
48
52
|
|
@@ -134,7 +138,7 @@ class Document < ActiveFedora::OmDatastream
|
|
134
138
|
t.contributor(:path=>"pbcoreContributor") do
|
135
139
|
t.name_(:path=>"contributor", :index_as => [:searchable, :facetable])
|
136
140
|
t.role_(:path=>"contributorRole",
|
137
|
-
:attributes=>{ :source=>
|
141
|
+
:attributes=>{ :source=>self.relator },
|
138
142
|
:index_as => [:searchable, :displayable]
|
139
143
|
)
|
140
144
|
end
|
@@ -164,7 +168,7 @@ class Document < ActiveFedora::OmDatastream
|
|
164
168
|
xml.pbcoreDescriptionDocument("xmlns:xsi"=>"http://www.w3.org/2001/XMLSchema-instance",
|
165
169
|
"xsi:schemaLocation"=>"http://www.pbcore.org/PBCore/PBCoreNamespace.html") {
|
166
170
|
|
167
|
-
xml.pbcoreIdentifier(:source=>
|
171
|
+
xml.pbcoreIdentifier(:source=>self.institution, :annotation=>"PID")
|
168
172
|
xml.pbcoreTitle(:titleType=>"Main")
|
169
173
|
xml.pbcoreDescription(:descriptionType=>"Description",
|
170
174
|
:descriptionTypeSource=>"pbcoreDescription/descriptionType",
|
@@ -1,6 +1,10 @@
|
|
1
1
|
module HydraPbcore::Datastream
|
2
2
|
class Instantiation < ActiveFedora::OmDatastream
|
3
3
|
|
4
|
+
class_attribute :institution, :address
|
5
|
+
self.institution = "Rock and Roll Hall of Fame and Museum"
|
6
|
+
self.address = "Rock and Roll Hall of Fame and Museum,\n2809 Woodland Ave.,\nCleveland, OH, 44115\n216-515-1956\nlibrary@rockhall.org"
|
7
|
+
|
4
8
|
include HydraPbcore::Methods
|
5
9
|
include HydraPbcore::Templates
|
6
10
|
include HydraPbcore::Conversions
|
@@ -13,7 +17,7 @@ class Instantiation < ActiveFedora::OmDatastream
|
|
13
17
|
:path => "instantiationIdentifier",
|
14
18
|
:attributes=>{
|
15
19
|
:annotation=>"Filename",
|
16
|
-
:source=>
|
20
|
+
:source=>self.institution
|
17
21
|
},
|
18
22
|
:index_as => [:displayable]
|
19
23
|
)
|
@@ -21,7 +25,7 @@ class Instantiation < ActiveFedora::OmDatastream
|
|
21
25
|
:path => "instantiationIdentifier",
|
22
26
|
:attributes=>{
|
23
27
|
:annotation=>"Barcode",
|
24
|
-
:source=>
|
28
|
+
:source=>self.institution
|
25
29
|
},
|
26
30
|
:index_as => [:displayable]
|
27
31
|
)
|
@@ -90,7 +94,7 @@ class Instantiation < ActiveFedora::OmDatastream
|
|
90
94
|
)
|
91
95
|
|
92
96
|
t.instantiationRelation do
|
93
|
-
t.instantiationRelationIdentifier(:attributes=>{ :source=>
|
97
|
+
t.instantiationRelationIdentifier(:attributes=>{ :source=>self.institution })
|
94
98
|
end
|
95
99
|
# The file we're describing at the root of this document preceeds the file marked "next"
|
96
100
|
t.next_inst(:ref => [:pbcoreInstantiation, :instantiationRelation],
|
@@ -21,7 +21,7 @@ module HydraPbcore::Templates
|
|
21
21
|
define_template :contributor do |xml, author, role|
|
22
22
|
xml.pbcoreContributor {
|
23
23
|
xml.contributor(author)
|
24
|
-
xml.contributorRole(role, :source=>
|
24
|
+
xml.contributorRole(role, :source=>self.relator)
|
25
25
|
}
|
26
26
|
end
|
27
27
|
|
@@ -30,7 +30,7 @@ module HydraPbcore::Templates
|
|
30
30
|
xml.instantiationRelationType(:annotation=>"One of a multi-part instantiation") {
|
31
31
|
xml.text "Follows in Sequence"
|
32
32
|
}
|
33
|
-
xml.instantiationRelationIdentifier(file, :source=>
|
33
|
+
xml.instantiationRelationIdentifier(file, :source=>self.institution)
|
34
34
|
}
|
35
35
|
end
|
36
36
|
|
@@ -39,7 +39,7 @@ module HydraPbcore::Templates
|
|
39
39
|
xml.instantiationRelationType(:annotation=>"One of a multi-part instantiation") {
|
40
40
|
xml.text "Precedes in Sequence"
|
41
41
|
}
|
42
|
-
xml.instantiationRelationIdentifier(file, :source=>
|
42
|
+
xml.instantiationRelationIdentifier(file, :source=>self.institution)
|
43
43
|
}
|
44
44
|
end
|
45
45
|
|
@@ -108,7 +108,7 @@ module HydraPbcore::Templates
|
|
108
108
|
|
109
109
|
xml.pbcoreInstantiation {
|
110
110
|
|
111
|
-
xml.instantiationIdentifier(:annotation=>"Filename", :source=>
|
111
|
+
xml.instantiationIdentifier(:annotation=>"Filename", :source=>self.institution)
|
112
112
|
xml.instantiationDate(:dateType=>"created")
|
113
113
|
xml.instantiationDigital(:source=>"EBU file formats")
|
114
114
|
xml.instantiationLocation
|
@@ -163,12 +163,12 @@ module HydraPbcore::Templates
|
|
163
163
|
xml.pbcoreInstantiation {
|
164
164
|
|
165
165
|
# Item details
|
166
|
-
xml.instantiationIdentifier(:annotation=>"Barcode", :source=>
|
166
|
+
xml.instantiationIdentifier(:annotation=>"Barcode", :source=>self.institution)
|
167
167
|
xml.instantiationDate(:dateType=>"created")
|
168
168
|
xml.instantiationPhysical(:source=>"PBCore instantiationPhysical")
|
169
169
|
xml.instantiationStandard
|
170
170
|
xml.instantiationLocation {
|
171
|
-
xml.text
|
171
|
+
xml.text self.address
|
172
172
|
}
|
173
173
|
xml.instantiationMediaType(:source=>"PBCore instantiationMediaType") {
|
174
174
|
xml.text "Moving image"
|
data/lib/hydra_pbcore/version.rb
CHANGED
data/spec/templates_spec.rb
CHANGED
@@ -4,6 +4,11 @@ describe HydraPbcore::Templates do
|
|
4
4
|
|
5
5
|
before :each do
|
6
6
|
class TestClass
|
7
|
+
|
8
|
+
class_attribute :institution, :relator, :address
|
9
|
+
self.institution = "Rock and Roll Hall of Fame and Museum"
|
10
|
+
self.relator = "MARC relator terms"
|
11
|
+
self.address = "Rock and Roll Hall of Fame and Museum,\n2809 Woodland Ave.,\nCleveland, OH, 44115\n216-515-1956\nlibrary@rockhall.org"
|
7
12
|
|
8
13
|
def self.define_template arg
|
9
14
|
end
|
metadata
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hydra-pbcore
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
5
|
-
prerelease:
|
4
|
+
version: 2.2.0rc1
|
5
|
+
prerelease: 5
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Adam Wead
|
@@ -202,16 +202,13 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
202
202
|
version: '0'
|
203
203
|
segments:
|
204
204
|
- 0
|
205
|
-
hash:
|
205
|
+
hash: 3789772575956433522
|
206
206
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
207
207
|
none: false
|
208
208
|
requirements:
|
209
|
-
- - ! '
|
209
|
+
- - ! '>'
|
210
210
|
- !ruby/object:Gem::Version
|
211
|
-
version:
|
212
|
-
segments:
|
213
|
-
- 0
|
214
|
-
hash: 3521105165021581431
|
211
|
+
version: 1.3.1
|
215
212
|
requirements: []
|
216
213
|
rubyforge_project:
|
217
214
|
rubygems_version: 1.8.24
|