active-fedora 4.0.0.rc17 → 4.0.0.rc18
Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile.lock
CHANGED
data/History.txt
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
4.0.0.
|
1
|
+
4.0.0.rc18
|
2
2
|
Removed deprecations
|
3
3
|
* allowing :fedora level in fedora.yml
|
4
4
|
* automatic includes of Relationships and FileMethods is removed
|
@@ -24,6 +24,7 @@ Lazily load solr config
|
|
24
24
|
HYDRA-766 Model#classname_from_uri singularizes terms, but it shouldn't change them.
|
25
25
|
HYDRA-767 Remove Model::DEFAULT_NS
|
26
26
|
Upgrade Om to 1.6.0
|
27
|
+
QualifiedDublinCore now extends immediately from NokogiriDatastream
|
27
28
|
|
28
29
|
3.3.2
|
29
30
|
HYDRA-745 No need to require :url be present on external datastreams
|
@@ -12,27 +12,9 @@ module ActiveFedora
|
|
12
12
|
attr_accessor :fields # TODO this can be removed when Model.find_by_fields_by_solr has been removed.
|
13
13
|
|
14
14
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
t.coverage(:xmlns=>"http://purl.org/dc/terms/", :namespace_prefix => "dcterms")
|
19
|
-
t.creator(:xmlns=>"http://purl.org/dc/terms/", :namespace_prefix => "dcterms")
|
20
|
-
t.date(:xmlns=>"http://purl.org/dc/terms/", :namespace_prefix => "dcterms")
|
21
|
-
t.description(:xmlns=>"http://purl.org/dc/terms/", :namespace_prefix => "dcterms")
|
22
|
-
t.format(:xmlns=>"http://purl.org/dc/terms/", :namespace_prefix => "dcterms")
|
23
|
-
t.identifier(:xmlns=>"http://purl.org/dc/terms/", :namespace_prefix => "dcterms")
|
24
|
-
t.language(:xmlns=>"http://purl.org/dc/terms/", :namespace_prefix => "dcterms")
|
25
|
-
t.publisher(:xmlns=>"http://purl.org/dc/terms/", :namespace_prefix => "dcterms")
|
26
|
-
t.relation(:xmlns=>"http://purl.org/dc/terms/", :namespace_prefix => "dcterms")
|
27
|
-
t.rights(:xmlns=>"http://purl.org/dc/terms/", :namespace_prefix => "dcterms")
|
28
|
-
t.source(:xmlns=>"http://purl.org/dc/terms/", :namespace_prefix => "dcterms")
|
29
|
-
t.spatial(:xmlns=>"http://purl.org/dc/terms/", :namespace_prefix => "dcterms")
|
30
|
-
t.type_(:xmlns=>"http://purl.org/dc/terms/", :namespace_prefix => "dcterms")
|
31
|
-
t.medium(:xmlns=>"http://purl.org/dc/terms/", :namespace_prefix => "dcterms")
|
32
|
-
t.rights(:xmlns=>"http://purl.org/dc/terms/", :namespace_prefix => "dcterms")
|
33
|
-
t.subject(:xmlns=>"http://purl.org/dc/terms/", :namespace_prefix => "dcterms")
|
34
|
-
t.title(:xmlns=>"http://purl.org/dc/terms/", :namespace_prefix => "dcterms")
|
35
|
-
end
|
15
|
+
set_terminology do |t|
|
16
|
+
t.root(:path=>"dc", :xmlns=>"http://purl.org/dc/terms/")
|
17
|
+
end
|
36
18
|
|
37
19
|
define_template :creator do |xml,name|
|
38
20
|
xml.creator() do
|
@@ -42,15 +24,23 @@ module ActiveFedora
|
|
42
24
|
|
43
25
|
#A frozen array of Dublincore Terms.
|
44
26
|
DCTERMS = [
|
45
|
-
:contributor, :coverage, :creator, :description, :
|
46
|
-
]
|
27
|
+
:contributor, :coverage, :creator, :description, :identifier, :language, :publisher, :relation, :source, :title, :abstract, :accessRights, :accrualMethod, :accrualPeriodicity, :accrualPolicy, :alternative, :audience, :available, :bibliographicCitation, :conformsTo, :contributor, :coverage, :created, :creator, :date, :dateAccepted, :dateCopyrighted, :dateSubmitted, :description, :educationLevel, :extent, :hasFormat, :hasPart, :hasVersion, :identifier, :instructionalMethod, :isFormatOf, :isPartOf, :isReferencedBy, :isReplacedBy, :isRequiredBy, :issued, :isVersionOf, :language, :license, :mediator, :medium, :modified, :provenance, :publisher, :references, :relation, :replaces, :requires, :rights, :rightsHolder, :source, :spatial, :subject, :tableOfContents, :temporal, :valid
|
28
|
+
] # removed :type, :format
|
47
29
|
DCTERMS.freeze
|
48
30
|
|
31
|
+
#Constructor. this class will call self.field for each DCTERM. In short, all DCTERMS fields will already exist
|
32
|
+
#when this method returns. Each term is marked as a multivalue string.
|
33
|
+
def initialize(digital_object, dsid )
|
34
|
+
super(digital_object, dsid)
|
35
|
+
DCTERMS.each do |el|
|
36
|
+
field el, :string, :multiple=>true
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
49
40
|
# This method generates the various accessor and mutator methods on self for the datastream metadata attributes.
|
50
|
-
# each field will have the
|
51
|
-
#
|
52
|
-
#
|
53
|
-
# name_append(arg)
|
41
|
+
# each field will have the 2 magic methods:
|
42
|
+
# name=(arg)
|
43
|
+
# name
|
54
44
|
#
|
55
45
|
#
|
56
46
|
# Calling any of the generated methods marks self as dirty.
|
@@ -141,6 +141,7 @@ describe ActiveFedora::Base do
|
|
141
141
|
end
|
142
142
|
|
143
143
|
@dublin_core_sample_values.each_pair do |field, value|
|
144
|
+
next if [:format, :type].include?(field) #format and type are methods declared on Object
|
144
145
|
dublin_core_ds.send("#{field.to_s}=", [value])
|
145
146
|
end
|
146
147
|
|
@@ -45,7 +45,7 @@ describe ActiveFedora::QualifiedDublinCoreDatastream do
|
|
45
45
|
end
|
46
46
|
|
47
47
|
it "should create the right number of fields" do
|
48
|
-
ActiveFedora::QualifiedDublinCoreDatastream::DCTERMS.size.should ==
|
48
|
+
ActiveFedora::QualifiedDublinCoreDatastream::DCTERMS.size.should == 62
|
49
49
|
end
|
50
50
|
|
51
51
|
it "should have unmodifiable constants" do
|
@@ -91,11 +91,9 @@ describe ActiveFedora::QualifiedDublinCoreDatastream do
|
|
91
91
|
end
|
92
92
|
end
|
93
93
|
end
|
94
|
-
|
95
94
|
end
|
96
95
|
|
97
96
|
describe '.to_xml' do
|
98
|
-
|
99
97
|
it 'should output the fields hash as Qualified Dublin Core XML' do
|
100
98
|
#@test_ds.expects(:new?).returns(true).twice
|
101
99
|
sample_xml = "<dc xmlns:dcterms='http://purl.org/dc/terms/' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'><dcterms:title>title1</dcterms:title><dcterms:publisher>publisher1</dcterms:publisher><dcterms:creator>creator1</dcterms:creator><dcterms:creator>creator2</dcterms:creator></dc>"
|
@@ -117,7 +115,15 @@ describe ActiveFedora::QualifiedDublinCoreDatastream do
|
|
117
115
|
<dcterms:title>title1</dcterms:title>
|
118
116
|
</dc>')
|
119
117
|
end
|
118
|
+
end
|
120
119
|
|
120
|
+
describe "#to_solr" do
|
121
|
+
it "should have title" do
|
122
|
+
@test_ds = ActiveFedora::QualifiedDublinCoreDatastream.new(nil, 'qdc' )
|
123
|
+
@test_ds.title = "War and Peace"
|
124
|
+
solr = @test_ds.to_solr
|
125
|
+
solr["title_t"].should == ["War and Peace"]
|
126
|
+
end
|
121
127
|
|
122
128
|
end
|
123
129
|
|
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active-fedora
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 15424177
|
5
5
|
prerelease: 6
|
6
6
|
segments:
|
7
7
|
- 4
|
8
8
|
- 0
|
9
9
|
- 0
|
10
10
|
- rc
|
11
|
-
-
|
12
|
-
version: 4.0.0.
|
11
|
+
- 18
|
12
|
+
version: 4.0.0.rc18
|
13
13
|
platform: ruby
|
14
14
|
authors:
|
15
15
|
- Matt Zumwalt
|