Permalink
Browse files

Bumped to 1.2.0 Requires ActiveFedora 3.1.0

  • Loading branch information...
1 parent de19c85 commit b919f87d7528752924d5ef38881c4592c03b226a @jcoyne jcoyne committed Nov 23, 2011
View
@@ -2,8 +2,10 @@ PATH
remote: .
specs:
solrizer-fedora (1.1.3)
- active-fedora (>= 2.3.0)
+ active-fedora (~> 3.1.0)
+ activesupport
fastercsv
+ jettywrapper (~> 1.1.0)
rsolr
solr-ruby (>= 0.0.6)
solrizer (>= 1.0.0)
@@ -12,39 +14,53 @@ GEM
remote: http://rubygems.org/
specs:
RedCloth (4.2.8)
- active-fedora (2.3.5)
- activeresource
+ active-fedora (3.1.4)
+ activeresource (~> 3.0.0)
+ activesupport (~> 3.0.0)
equivalent-xml
facets
mediashelf-loggable
mime-types (>= 1.16)
multipart-post (= 1.1.2)
nokogiri
- om (>= 1.0)
+ om (>= 1.4.3)
+ rdf
+ rdf-rdfxml
+ rubydora (~> 0.2.6)
solr-ruby (>= 0.0.6)
solrizer (> 1.0.0)
xml-simple (>= 1.0.12)
- activemodel (3.1.0)
- activesupport (= 3.1.0)
- bcrypt-ruby (~> 3.0.0)
- builder (~> 3.0.0)
- i18n (~> 0.6)
- activeresource (3.1.0)
- activemodel (= 3.1.0)
- activesupport (= 3.1.0)
- activesupport (3.1.0)
- multi_json (~> 1.0)
- bcrypt-ruby (3.0.0)
- builder (3.0.0)
+ activemodel (3.0.11)
+ activesupport (= 3.0.11)
+ builder (~> 2.1.2)
+ i18n (~> 0.5.0)
+ activeresource (3.0.11)
+ activemodel (= 3.0.11)
+ activesupport (= 3.0.11)
+ activesupport (3.0.11)
+ addressable (2.2.6)
+ akami (1.0.0)
+ gyoku (>= 0.4.0)
+ builder (2.1.2)
+ childprocess (0.2.2)
+ ffi (~> 1.0.6)
columnize (0.3.4)
daemons (1.1.4)
- equivalent-xml (0.2.7)
+ equivalent-xml (0.2.8)
nokogiri (>= 1.4.3)
facets (2.9.2)
fastercsv (1.5.4)
+ ffi (1.0.11)
git (1.2.5)
- i18n (0.6.0)
- jettywrapper (0.0.10)
+ gyoku (0.4.4)
+ builder (>= 2.1.2)
+ httpi (0.9.5)
+ rack
+ i18n (0.5.0)
+ jettywrapper (1.1.0)
+ activesupport (>= 3.0.0)
+ childprocess
+ i18n
logger
mediashelf-loggable
jeweler (1.6.4)
@@ -55,17 +71,27 @@ GEM
rbx-require-relative (> 0.0.4)
logger (1.2.8)
mediashelf-loggable (0.4.7)
- mime-types (1.16)
- mocha (0.9.12)
- multi_json (1.0.3)
+ metaclass (0.0.1)
+ mime-types (1.17.2)
+ mocha (0.10.0)
+ metaclass (~> 0.0.1)
multipart-post (1.1.2)
nokogiri (1.5.0)
- om (1.4.0)
+ nori (1.0.2)
+ om (1.4.3)
mediashelf-loggable
nokogiri (>= 1.4.2)
- rake (0.9.2)
+ rack (1.3.5)
+ rake (0.9.2.2)
rbx-require-relative (0.0.5)
- rcov (0.9.10)
+ rcov (0.9.11)
+ rdf (0.3.4.1)
+ addressable (>= 2.2.6)
+ rdf-rdfxml (0.3.5)
+ nokogiri (>= 1.4.4)
+ rdf (>= 0.3.4)
+ rest-client (1.6.7)
+ mime-types (>= 1.16)
rsolr (1.0.2)
builder (>= 2.1.2)
rspec (1.3.2)
@@ -74,17 +100,35 @@ GEM
ruby-debug-base (~> 0.10.4.0)
ruby-debug-base (0.10.4)
linecache (>= 0.3)
+ rubydora (0.2.6)
+ activemodel
+ activesupport
+ fastercsv
+ mime-types
+ nokogiri
+ rest-client
+ savon
+ savon (0.9.7)
+ akami (~> 1.0)
+ builder (>= 2.1.2)
+ gyoku (>= 0.4.0)
+ httpi (~> 0.9)
+ nokogiri (>= 1.4.0)
+ nori (~> 1.0)
+ wasabi (~> 2.0)
solr-ruby (0.0.8)
- solrizer (1.1.0)
+ solrizer (1.1.2)
daemons
mediashelf-loggable
nokogiri
- om (>= 1.0.0)
+ om (>= 1.4.0)
stomp
xml-simple
- stomp (1.1.9)
- xml-simple (1.1.0)
- yard (0.7.2)
+ stomp (1.1.10)
+ wasabi (2.0.0)
+ nokogiri (>= 1.4.0)
+ xml-simple (1.1.1)
+ yard (0.7.3)
PLATFORMS
ruby
View
@@ -1,3 +1,6 @@
+h2. 1.2.0
+Now requires active-fedora 3.1.x.
+
h2. 1.1.3
Fixed a bug where we were doing two unnecessary queries against solr for each object passed in.
@@ -5,6 +5,7 @@
require 'solrizer/xml'
require 'solrizer/html'
+require 'active_support/core_ext/hash'
# Let people explicitly require xml support if they want it ...
# require 'solrizer/xml.rb'
@@ -14,6 +15,11 @@
module Solrizer::Fedora
class Solrizer
+ ALL_FIELDS = [
+ :pid, :label, :fType, :cModel, :state, :ownerId, :cDate, :mDate, :dcmDate,
+ :bMech, :title, :creator, :subject, :description, :contributor,
+ :date, :type, :format, :identifier, :source, :language, :relation, :coverage, :rights
+ ]
attr_accessor :indexer, :index_full_text
@@ -93,7 +99,7 @@ def solrize_objects(opts={})
if @@index_list == false
- objects = ::Fedora::Repository.instance.find_objects(:limit=>num_docs)
+ objects = find_objects(:limit=>num_docs)
puts "Shelving #{objects.length} Fedora objects"
objects.each do |object|
@@ -119,5 +125,19 @@ def solrize_objects(opts={})
end #if Index_LISTS
end #solrize_objects
+ def find_objects(*args)
+ raise ArgumentError, "Missing query string" unless args.length >= 1
+ options = args.last.is_a?(Hash) ? args.pop : {}
+
+ params = {}
+ params[:query] = ''
+ params[:maxResults] = options[:limit] if options[:limit]
+ params[:pid] = true
+ connection = ActiveFedora::RubydoraConnection.instance.connection
+ response = Hash.from_xml(connection.find_objects(params))
+ response["result"]["resultList"]["objectFields"].map{|x| x["pid"]}
+ end
+
+
end #class
end #module
@@ -1,5 +1,5 @@
module Solrizer
module Fedora
- VERSION = "1.1.3"
+ VERSION = "1.2.0"
end
end
@@ -1,3 +1,5 @@
+require 'jettywrapper'
+APP_ROOT = File.expand_path("../..",File.dirname(__FILE__))
desc "Task to execute builds on a Hudson Continuous Integration Server."
task :hudson do
if (ENV['RAILS_ENV'] == "test")
View
@@ -22,10 +22,12 @@ Gem::Specification.new do |s|
s.rubyforge_project = "solrizer-fedora"
s.add_dependency('solr-ruby', '>= 0.0.6')
- s.add_dependency('active-fedora', '>= 2.3.0')
+ s.add_dependency('active-fedora', '~> 3.1.0')
s.add_dependency('rsolr')
s.add_dependency('solrizer', '>=1.0.0')
s.add_dependency('fastercsv') # this is used by solrize_objects when you pass it a csv file of pids
+ s.add_dependency('jettywrapper', '~> 1.1.0')
+ s.add_dependency('activesupport')
s.files = `git ls-files`.split("\n")
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
@@ -13,7 +13,7 @@
@solrizer.solrize( sample_obj )
end
it "should work with Fedora::FedoraObject objects" do
- mock_object = Fedora::FedoraObject.new(:pid=>"my:pid", :label=>"my label")
+ mock_object = stub(:pid=>"my:pid", :label=>"my label")
ActiveFedora::Base.expects(:load_instance).with( mock_object.pid ).returns(mock_object)
@solrizer.indexer.expects(:index).with( mock_object )
@solrizer.solrize( mock_object )
@@ -32,17 +32,17 @@
end
describe "solrize_objects" do
+ before do
+ @objects = ["pid1", "pid2", "pid3"]
+ @solrizer.expects(:find_objects).returns(@objects)
+ end
it "should call solrize for each object returned by Fedora::Repository.find_objects" do
- objects = [["pid1"], ["pid2"], ["pid3"]]
- Fedora::Repository.any_instance.expects(:find_objects).returns(objects)
- objects.each {|object| @solrizer.expects(:solrize).with( object, {} ) }
+ @objects.each {|x| @solrizer.expects(:solrize).with( x, {}) }
@solrizer.solrize_objects
end
it "should pass optional suppress_errors argument into .solrize method" do
- objects = [["pid1"], ["pid2"], ["pid3"]]
- Fedora::Repository.any_instance.expects(:find_objects).returns(objects)
- objects.each {|object| @solrizer.expects(:solrize).with( object, :suppress_errors => true ) }
+ @objects.each {|x| @solrizer.expects(:solrize).with( x, :suppress_errors => true ) }
@solrizer.solrize_objects( :suppress_errors => true )
end
end
-end
+end

0 comments on commit b919f87

Please sign in to comment.