hydra-pbcore 0.1.0 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.md +26 -2
- data/lib/hydra-pbcore/templates.rb +8 -8
- data/lib/hydra-pbcore/version.rb +1 -1
- metadata +2 -2
data/README.md
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# HydraPbcore
|
2
2
|
|
3
3
|
A Hydra gem that offers PBCore datastream definitions using OM, as well as some other convenience
|
4
|
-
methods such as inserting xml templates into existing
|
4
|
+
methods such as inserting xml templates into existing documents and reordering your PBCore xml
|
5
5
|
elements so that you can export complete, valid PBCore documents.
|
6
6
|
|
7
7
|
## Installation
|
@@ -20,7 +20,31 @@ Or install it yourself as:
|
|
20
20
|
|
21
21
|
## Usage
|
22
22
|
|
23
|
-
Use this with your hydra head.
|
23
|
+
Use this with your hydra head to define a datastream in Fedora that will contain Pbcore xml. Ex:
|
24
|
+
|
25
|
+
MyModel < ActiveFedora::Base
|
26
|
+
|
27
|
+
has_metadata :name => "descMetadata", :type => HydraPbcore::Datastream::Document
|
28
|
+
|
29
|
+
end
|
30
|
+
|
31
|
+
Your descMetadata datastream will now have all the pbcore terms defined in HydraPbcore::Datastream::Document.
|
32
|
+
There are also two additional datastream definitions:
|
33
|
+
|
34
|
+
* HydraPbcore::Datastream::DigitalDocument
|
35
|
+
* HydraPbcore::Datastream::Instantiation
|
36
|
+
|
37
|
+
DigitalDocument datastreams have the exact same terms as Document, except that there is no default physical
|
38
|
+
pbcoreInstantiation. The Document datastreams comes with a single instantiation that represents a tape
|
39
|
+
or other physical entity. DigitalDocument datastreams assume born-digital content and must have added
|
40
|
+
instantiations. These instantiations are defined in the Instantiation datastream.
|
41
|
+
|
42
|
+
### Additional Methods
|
43
|
+
|
44
|
+
HydraPbcore comes with a couple of additional features such as ordering your xml nodes so that your xml will
|
45
|
+
validate against the PBCore XML v.2 schema. Additionally, there are several template methods that can be used
|
46
|
+
to insert additional terms into your xml documents, such as contributors, publishers, as well as next and previous
|
47
|
+
fields that specify which files come before and after one another in a multi-part born-digital video.
|
24
48
|
|
25
49
|
## Contributing
|
26
50
|
|
@@ -18,21 +18,21 @@ module HydraPbcore::Templates
|
|
18
18
|
}
|
19
19
|
end
|
20
20
|
|
21
|
-
define_template :previous do |xml,
|
21
|
+
define_template :previous do |xml, file|
|
22
22
|
xml.instantiationRelation {
|
23
23
|
xml.instantiationRelationType(:annotation=>"One of a multi-part instantiation") {
|
24
24
|
xml.text "Follows in Sequence"
|
25
25
|
}
|
26
|
-
xml.instantiationRelationIdentifier(
|
26
|
+
xml.instantiationRelationIdentifier(file, :source=>"Rock and Roll Hall of Fame and Museum")
|
27
27
|
}
|
28
28
|
end
|
29
29
|
|
30
|
-
define_template :next do |xml,
|
30
|
+
define_template :next do |xml, file|
|
31
31
|
xml.instantiationRelation {
|
32
32
|
xml.instantiationRelationType(:annotation=>"One of a multi-part instantiation") {
|
33
33
|
xml.text "Precedes in Sequence"
|
34
34
|
}
|
35
|
-
xml.instantiationRelationIdentifier(
|
35
|
+
xml.instantiationRelationIdentifier(file, :source=>"Rock and Roll Hall of Fame and Museum")
|
36
36
|
}
|
37
37
|
end
|
38
38
|
|
@@ -47,12 +47,12 @@ module HydraPbcore::Templates
|
|
47
47
|
add_child_node(ng_xml.root, :publisher, publisher, role)
|
48
48
|
end
|
49
49
|
|
50
|
-
def insert_next(
|
51
|
-
add_child_node(find_by_terms(:pbcoreInstantiation).first, :next,
|
50
|
+
def insert_next(file)
|
51
|
+
add_child_node(find_by_terms(:pbcoreInstantiation).first, :next, file)
|
52
52
|
end
|
53
53
|
|
54
|
-
def insert_previous(
|
55
|
-
add_child_node(find_by_terms(:pbcoreInstantiation).first, :previous,
|
54
|
+
def insert_previous(file)
|
55
|
+
add_child_node(find_by_terms(:pbcoreInstantiation).first, :previous, file)
|
56
56
|
end
|
57
57
|
|
58
58
|
end
|
data/lib/hydra-pbcore/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hydra-pbcore
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 1.0.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-11-
|
12
|
+
date: 2012-11-20 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: nokogiri
|