active-fedora 1.1.1 → 1.1.2
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/History.txt +6 -0
- data/VERSION +1 -1
- data/active-fedora.gemspec +2 -2
- data/config/fedora.yml +5 -5
- data/lib/active_fedora/datastream.rb +0 -1
- data/lib/active_fedora/model.rb +2 -2
- data/spec/integration/datastream_spec.rb +0 -1
- data/spec/integration/full_featured_model_spec.rb +7 -1
- data/spec/integration/rf_fedora_object_spec.rb +1 -1
- data/spec/integration/solr_service_spec.rb +2 -5
- data/spec/spec_helper.rb +2 -0
- data/spec/unit/base_spec.rb +0 -1
- data/spec/unit/rels_ext_datastream_spec.rb +0 -1
- data/spec/unit/rf_datastream_spec.rb +1 -1
- data/spec/unit/semantic_node_spec.rb +0 -3
- metadata +3 -3
data/History.txt
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
1.1.2
|
2
|
+
|
3
|
+
Bug: Model.find_by_solr fails when you pass it an argument of :all
|
4
|
+
Testing: Updated RSpec tests to run against localhost:8983 with Fedora 3.3 (instead of localhost:8080 with Fedora 3.2). This means you can use a copy of hydra-jetty from http://github.com/hydraproject/hydra-jetty
|
5
|
+
Testing: Reduced the amount of noise output to the shell during tests
|
6
|
+
|
1
7
|
1.1.1 2010-03-22
|
2
8
|
|
3
9
|
Bug: .load_objects wipes out datastream attributes from model-defined datastreams (ie. label and mimeType)
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.1.
|
1
|
+
1.1.2
|
data/active-fedora.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{active-fedora}
|
8
|
-
s.version = "1.1.
|
8
|
+
s.version = "1.1.2"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Matt Zumwalt", "McClain Looney"]
|
12
|
-
s.date = %q{2010-03-
|
12
|
+
s.date = %q{2010-03-31}
|
13
13
|
s.description = %q{ActiveFedora provides for creating and managing objects in the Fedora Repository Architecture.}
|
14
14
|
s.email = %q{matt.zumwalt@yourmediashelf.com}
|
15
15
|
s.extra_rdoc_files = [
|
data/config/fedora.yml
CHANGED
@@ -1,16 +1,16 @@
|
|
1
1
|
development:
|
2
2
|
fedora:
|
3
|
-
url: http://fedoraAdmin:fedoraAdmin@127.0.0.1:
|
3
|
+
url: http://fedoraAdmin:fedoraAdmin@127.0.0.1:8983/fedora
|
4
4
|
solr:
|
5
|
-
url: http://127.0.0.1:
|
5
|
+
url: http://127.0.0.1:8983/solr/development
|
6
6
|
test:
|
7
7
|
fedora:
|
8
|
-
url: http://fedoraAdmin:fedoraAdmin@127.0.0.1:
|
8
|
+
url: http://fedoraAdmin:fedoraAdmin@127.0.0.1:8983/fedora
|
9
9
|
solr:
|
10
|
-
url: http://127.0.0.1:
|
10
|
+
url: http://127.0.0.1:8983/solr/test
|
11
11
|
production:
|
12
12
|
fedora:
|
13
13
|
url: http://fedoraAdmin:fedoraAdmin@127.0.0.1:8080/fedora
|
14
14
|
solr:
|
15
|
-
url: http://
|
15
|
+
url: http://127.0.0.1:8080/solr
|
16
16
|
|
@@ -94,7 +94,6 @@ module ActiveFedora
|
|
94
94
|
object_xml = Fedora::FedoraObject.object_xml(self.pid).gsub("\n ","")
|
95
95
|
datastream_xml = REXML::Document.new(object_xml).root.elements["foxml:datastream[@ID='#{self.dsid}']"]
|
96
96
|
|
97
|
-
puts datastream_xml.length
|
98
97
|
if datastream_xml.length > 3
|
99
98
|
datastream_xml.elements.each do |el|
|
100
99
|
puts el.inspect
|
data/lib/active_fedora/model.rb
CHANGED
@@ -56,7 +56,7 @@ module ActiveFedora
|
|
56
56
|
def find(args)
|
57
57
|
if args == :all
|
58
58
|
escaped_class_name = self.name.gsub(/(:)/, '\\:')
|
59
|
-
q = "#{solr_name(:active_fedora_model, :symbol)}:#{escaped_class_name}"
|
59
|
+
q = "#{SolrMapper.solr_name(:active_fedora_model, :symbol)}:#{escaped_class_name}"
|
60
60
|
elsif args.class == String
|
61
61
|
escaped_id = args.gsub(/(:)/, '\\:')
|
62
62
|
q = "#{SOLR_DOCUMENT_ID}:#{escaped_id}"
|
@@ -89,7 +89,7 @@ module ActiveFedora
|
|
89
89
|
def find_by_solr(query, args={})
|
90
90
|
if query == :all
|
91
91
|
escaped_class_name = self.name.gsub(/(:)/, '\\:')
|
92
|
-
SolrService.instance.conn.query("#{solr_name(:active_fedora_model, :symbol)}:#{escaped_class_name}", args)
|
92
|
+
SolrService.instance.conn.query("#{SolrMapper.solr_name(:active_fedora_model, :symbol)}:#{escaped_class_name}", args)
|
93
93
|
elsif query.class == String
|
94
94
|
escaped_id = query.gsub(/(:)/, '\\:')
|
95
95
|
SolrService.instance.conn.query("#{SOLR_DOCUMENT_ID}:#{escaped_id}", args)
|
@@ -174,7 +174,6 @@ describe ActiveFedora::Base do
|
|
174
174
|
@test_history.save
|
175
175
|
|
176
176
|
@solr_result = OralHistory.find_by_solr(@test_history.pid).hits[0]
|
177
|
-
puts @solr_result.inspect
|
178
177
|
@properties_sample_values.each_pair do |field, value|
|
179
178
|
(@solr_result["#{field.to_s}_t"] || @solr_result["#{field.to_s}_dt"]).should == [value]
|
180
179
|
end
|
@@ -197,6 +196,11 @@ describe ActiveFedora::Base do
|
|
197
196
|
|
198
197
|
end
|
199
198
|
|
199
|
+
it "should support #find_by_solr" do
|
200
|
+
solr_result = OralHistory.find(:all)
|
201
|
+
solr_result.should_not be_nil
|
202
|
+
end
|
203
|
+
|
200
204
|
describe '#new' do
|
201
205
|
it "should support custom pids" do
|
202
206
|
oh = OralHistory.new(:pid=>"uuid:blah-blah-blah")
|
@@ -204,4 +208,6 @@ describe ActiveFedora::Base do
|
|
204
208
|
end
|
205
209
|
end
|
206
210
|
|
211
|
+
|
212
|
+
|
207
213
|
end
|
@@ -68,7 +68,7 @@ describe Fedora::FedoraObject do
|
|
68
68
|
it "should not set :label if it is not there in the object_xml" do
|
69
69
|
object_rexml = REXML::Document.new(@test_object.object_xml)
|
70
70
|
# The label node will be missing from the FOXML because label was never set.
|
71
|
-
object_rexml.root.elements["//foxml:property[@NAME='info:fedora/fedora-system:def/model#label']"].should ==
|
71
|
+
object_rexml.root.elements["//foxml:property[@NAME='info:fedora/fedora-system:def/model#label']"].attributes["VALUE"].should == ""
|
72
72
|
properties = @test_object.properties_from_fedora
|
73
73
|
properties[:label].should == nil
|
74
74
|
end
|
@@ -2,9 +2,6 @@ require File.join( File.dirname(__FILE__), "../spec_helper" )
|
|
2
2
|
|
3
3
|
require 'active_fedora'
|
4
4
|
|
5
|
-
include ActiveFedora
|
6
|
-
|
7
|
-
|
8
5
|
describe ActiveFedora::SolrService do
|
9
6
|
describe "#reify_solr_results" do
|
10
7
|
before(:all) do
|
@@ -20,8 +17,8 @@ describe ActiveFedora::SolrService do
|
|
20
17
|
@foo_object.delete
|
21
18
|
end
|
22
19
|
it "should return an array of objects that are of the class stored in active_fedora_model_s" do
|
23
|
-
query = "id\:#{SolrService.escape_uri_for_query(@test_object.pid)} OR id\:#{SolrService.escape_uri_for_query(@foo_object.pid)}"
|
24
|
-
solr_result = SolrService.instance.conn.query(query)
|
20
|
+
query = "id\:#{ActiveFedora::SolrService.escape_uri_for_query(@test_object.pid)} OR id\:#{ActiveFedora::SolrService.escape_uri_for_query(@foo_object.pid)}"
|
21
|
+
solr_result = ActiveFedora::SolrService.instance.conn.query(query)
|
25
22
|
result = ActiveFedora::SolrService.reify_solr_results(solr_result)
|
26
23
|
result.length.should == 2
|
27
24
|
result.each do |r|
|
data/spec/spec_helper.rb
CHANGED
data/spec/unit/base_spec.rb
CHANGED
@@ -313,7 +313,6 @@ describe ActiveFedora::Base do
|
|
313
313
|
@test_object.expects(:create_date).returns("cDate")
|
314
314
|
@test_object.expects(:modified_date).returns("mDate")
|
315
315
|
solr_doc = @test_object.to_solr
|
316
|
-
puts solr_doc.inspect
|
317
316
|
solr_doc[:system_create_dt].should eql("cDate")
|
318
317
|
solr_doc[:system_modified_dt].should eql("mDate")
|
319
318
|
solr_doc[:id].should eql(@test_object.pid)
|
@@ -55,7 +55,6 @@ describe ActiveFedora::RelsExtDatastream do
|
|
55
55
|
|
56
56
|
describe "#from_xml" do
|
57
57
|
before(:all) do
|
58
|
-
ActiveFedora::SolrService.register
|
59
58
|
@test_obj = ActiveFedora::Base.new
|
60
59
|
@test_obj.add_relationship(:is_member_of, "demo:10")
|
61
60
|
@test_obj.add_relationship(:is_part_of, "demo:11")
|
@@ -18,7 +18,7 @@ describe Fedora::Datastream do
|
|
18
18
|
it "should provide .url" do
|
19
19
|
@test_datastream.should respond_to(:url)
|
20
20
|
@test_datastream.expects(:pid).returns("_foo_")
|
21
|
-
@test_datastream.url.should == 'http://localhost:
|
21
|
+
@test_datastream.url.should == 'http://localhost:8983/fedora/objects/_foo_/datastreams/'
|
22
22
|
end
|
23
23
|
|
24
24
|
describe ".url" do
|
@@ -237,9 +237,6 @@ describe ActiveFedora::SemanticNode do
|
|
237
237
|
local_node = SpecNode.new
|
238
238
|
local_node.add_relationship(@test_relationship1)
|
239
239
|
result = local_node.containers_ids
|
240
|
-
puts local_node.relationships.inspect
|
241
|
-
#puts local_node.outbound_relationships.inspect
|
242
|
-
puts local_node.internal_uri
|
243
240
|
result.should be_instance_of(Array)
|
244
241
|
result.should include("demo:10")
|
245
242
|
end
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 1
|
7
7
|
- 1
|
8
|
-
-
|
9
|
-
version: 1.1.
|
8
|
+
- 2
|
9
|
+
version: 1.1.2
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Matt Zumwalt
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-03-
|
18
|
+
date: 2010-03-31 00:00:00 -05:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|