active-fedora 4.0.0.rc4 → 4.0.0.rc5
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +1 -1
- data/History.txt +1 -1
- data/NOKOGIRI_DATASTREAMS.textile +4 -4
- data/lib/active_fedora/model.rb +1 -1
- data/lib/active_fedora/solr_service.rb +1 -1
- data/lib/active_fedora/version.rb +1 -1
- data/spec/unit/solr_service_spec.rb +10 -0
- metadata +3 -3
data/Gemfile.lock
CHANGED
data/History.txt
CHANGED
@@ -20,13 +20,13 @@ h2. Setup
|
|
20
20
|
|
21
21
|
This tutorial assumes that you've run script/console from the root of ActiveFedora and have imported the hydrangea:fixture_mods_article1 object. If you haven't done that, see "CONSOLE_GETTING_STARTED":http://hudson.projecthydra.org/job/active_fedora/Documentation/file.CONSOLE_GETTING_STARTED.html for instructions.
|
22
22
|
|
23
|
-
The model definition we're using in this tutorial is
|
23
|
+
The model definition we're using in this tutorial is SpecialThing ( "see the code":https://github.com/mediashelf/active_fedora/blob/master/spec/samples/special_thing.rb )
|
24
24
|
|
25
25
|
|
26
26
|
Look in these datastream definitions to see the OM Terminologies they define. They have extra comments in the code:
|
27
|
-
*
|
28
|
-
*
|
29
|
-
*
|
27
|
+
* Hydra::ModsArticleDatastream ( "see the code":https://github.com/mediashelf/active_fedora/blob/master/spec/samples/hydra-mods_article_datastream.rb )
|
28
|
+
* Hydra::RightsMetadataDatastream ( "see the code":https://github.com/mediashelf/active_fedora/blob/master/spec/samples/hydra-rights_metadata_datastream.rb }
|
29
|
+
* Marpa::DcDatastream ( "see the code":https://github.com/mediashelf/active_fedora/blob/master/spec/samples/marpa-dc_datastream.rb )
|
30
30
|
|
31
31
|
|
32
32
|
h2. Using Existing OM Terminology
|
data/lib/active_fedora/model.rb
CHANGED
@@ -262,7 +262,7 @@ module ActiveFedora
|
|
262
262
|
|
263
263
|
private
|
264
264
|
# Retrieve the Fedora object with te given pid, explore the returned object, determine its model
|
265
|
-
# using #{known_models_for} and cast to that class.
|
265
|
+
# using #{ActiveFedora::ContentModel.known_models_for} and cast to that class.
|
266
266
|
# @param [String] pid of the object to load
|
267
267
|
#
|
268
268
|
# @example because the object hydra:dataset1 asserts it is a Dataset (hasModel info:fedora/afmodel:Dataset), return a Dataset object (not a Book).
|
@@ -72,7 +72,7 @@ module ActiveFedora
|
|
72
72
|
|
73
73
|
def self.query(query, args={})
|
74
74
|
raw = args.delete(:raw)
|
75
|
-
args = args.merge(:q=>query)
|
75
|
+
args = args.merge(:q=>query, :qt=>'standard')
|
76
76
|
result = SolrService.instance.conn.get('select', :params=>args)
|
77
77
|
return result if raw
|
78
78
|
result['response']['docs']
|
@@ -74,5 +74,15 @@ describe ActiveFedora::SolrService do
|
|
74
74
|
ActiveFedora::SolrService.escape_uri_for_query("my:pid").should == 'my\:pid'
|
75
75
|
end
|
76
76
|
end
|
77
|
+
|
78
|
+
describe ".query" do
|
79
|
+
it "should call rubydora" do
|
80
|
+
mock_conn = mock("Connection")
|
81
|
+
stub_result = stub("Result")
|
82
|
+
mock_conn.expects(:get).with('select', :params=>{:q=>'querytext', :qt=>'standard'}).returns(stub_result)
|
83
|
+
ActiveFedora::SolrService.stubs(:instance =>stub("instance", :conn=>mock_conn))
|
84
|
+
ActiveFedora::SolrService.query('querytext', :raw=>true).should == stub_result
|
85
|
+
end
|
86
|
+
end
|
77
87
|
|
78
88
|
end
|
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: 15424159
|
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
|
+
- 5
|
12
|
+
version: 4.0.0.rc5
|
13
13
|
platform: ruby
|
14
14
|
authors:
|
15
15
|
- Matt Zumwalt
|