hydra-collections 1.3.2 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/concerns/hydra/collections_controller_behavior.rb +2 -7
- data/app/models/datastreams/hydra/collection_rdf_datastream.rb +4 -0
- data/app/views/collections/_search_form.html.erb +1 -1
- data/hydra-collections.gemspec +1 -1
- data/lib/hydra/collections/version.rb +1 -1
- data/spec/controllers/collections_controller_spec.rb +6 -6
- data/spec/controllers/selects_collections_spec.rb +0 -2
- data/spec/support/lib/generators/test_app_generator.rb +6 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bd41a2217ea7401629be851956099428aebe6fff
|
4
|
+
data.tar.gz: affc685ac79e5b4ac9234f5a67b85d63e676aff6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3ec6260a0153978aac853ba6dd77b9f5f21dfb49685493e03987e8530ef223ff9a465f1087812efbd50ede1779a1b6d469cbbdb4795817236b097d5a5b1950c6
|
7
|
+
data.tar.gz: 29fe2010e53ea5e75decb713dea95530f261c07412c890af48497c56cfa20d3c5acc10f4f58e59b232b5b0e6d42c008cf3cd4c9f317b7ff5702640f5328895ba
|
@@ -122,7 +122,7 @@ module Hydra
|
|
122
122
|
end
|
123
123
|
|
124
124
|
protected
|
125
|
-
|
125
|
+
|
126
126
|
# Queries Solr for members of the collection.
|
127
127
|
# Populates @response and @member_docs similar to Blacklight Catalog#index populating @response and @documents
|
128
128
|
def query_collection_members
|
@@ -134,7 +134,7 @@ module Hydra
|
|
134
134
|
# run the solr query to find the collections
|
135
135
|
(@response, @member_docs) = get_search_results(solr_params)
|
136
136
|
end
|
137
|
-
|
137
|
+
|
138
138
|
def process_member_changes
|
139
139
|
unless params[:collection].nil?
|
140
140
|
change_members = []
|
@@ -170,11 +170,6 @@ module Hydra
|
|
170
170
|
end
|
171
171
|
end
|
172
172
|
|
173
|
-
# this is only needed until the version of balcklight that we are using this include it in it's solr helper
|
174
|
-
def blacklight_solr
|
175
|
-
Blacklight.solr
|
176
|
-
end
|
177
|
-
|
178
173
|
# include filters into the query to only include the collection memebers
|
179
174
|
def include_collection_ids(solr_parameters, user_parameters)
|
180
175
|
solr_parameters[:fq] ||= []
|
@@ -20,7 +20,7 @@ limitations under the License.
|
|
20
20
|
<label class="accessible-hidden">Search Collection <%=@collection.title %></label>
|
21
21
|
<%= text_field_tag :cq, params[:cq], :class => "collection-query", :placeholder => "Search Collection", :size => '30', :type => "search", :id => "collection_search" %>
|
22
22
|
<%= hidden_field_tag :sort, params[:sort], :id => 'collection_sort' %>
|
23
|
-
<%=
|
23
|
+
<%= render_hash_as_hidden_fields(params_for_search.except(:cq, :sort, :qt, :page)).html_safe %>
|
24
24
|
<button type="submit" class="btn btn-primary" id="collection_submit"><i class="icon-search"></i> Go</button>
|
25
25
|
<% end %>
|
26
26
|
</div>
|
data/hydra-collections.gemspec
CHANGED
@@ -19,7 +19,7 @@ Gem::Specification.new do |spec|
|
|
19
19
|
spec.require_paths = ["lib"]
|
20
20
|
|
21
21
|
spec.add_dependency "blacklight"
|
22
|
-
spec.add_dependency "hydra-head", "~>
|
22
|
+
spec.add_dependency "hydra-head", "~> 7.0.1"
|
23
23
|
spec.add_dependency "active-fedora", ">= 6.7.0"
|
24
24
|
|
25
25
|
spec.add_development_dependency "bundler", "~> 1.3"
|
@@ -70,7 +70,7 @@ describe CollectionsController do
|
|
70
70
|
@asset1 = GenericFile.create!
|
71
71
|
post :create, batch_document_ids: [@asset1], collection: {title: "My Secong Collection ", description: "The Description\r\n\r\nand more"}
|
72
72
|
assigns[:collection].members.should == [@asset1]
|
73
|
-
asset_results =
|
73
|
+
asset_results = blacklight_solr.get "select", params:{fq:["id:\"#{@asset1.pid}\""],fl:['id',Solrizer.solr_name(:collection)]}
|
74
74
|
asset_results["response"]["numFound"].should == 1
|
75
75
|
doc = asset_results["response"]["docs"].first
|
76
76
|
doc["id"].should == @asset1.pid
|
@@ -82,7 +82,7 @@ describe CollectionsController do
|
|
82
82
|
@asset2 = GenericFile.create!
|
83
83
|
post :create, batch_document_ids: [@asset1,@asset2], collection: {title: "My Secong Collection ", description: "The Description\r\n\r\nand more"}
|
84
84
|
assigns[:collection].members.should == [@asset1,@asset2]
|
85
|
-
asset_results =
|
85
|
+
asset_results = blacklight_solr.get "select", params:{fq:["id:\"#{@asset1.pid}\""],fl:['id',Solrizer.solr_name(:collection)]}
|
86
86
|
asset_results["response"]["numFound"].should == 1
|
87
87
|
doc = asset_results["response"]["docs"].first
|
88
88
|
doc["id"].should == @asset1.pid
|
@@ -145,7 +145,7 @@ describe CollectionsController do
|
|
145
145
|
@asset2.reload
|
146
146
|
@asset2.to_solr[Solrizer.solr_name(:collection)].should == [@collection.pid]
|
147
147
|
## Check that member was re-indexed with collection info
|
148
|
-
asset_results =
|
148
|
+
asset_results = blacklight_solr.get "select", params:{fq:["id:\"#{@asset2.pid}\""],fl:['id',Solrizer.solr_name(:collection)]}
|
149
149
|
doc = asset_results["response"]["docs"].first
|
150
150
|
doc["id"].should == @asset2.pid
|
151
151
|
doc[Solrizer.solr_name(:collection)].should == [@collection.pid]
|
@@ -157,7 +157,7 @@ describe CollectionsController do
|
|
157
157
|
@asset2.reload
|
158
158
|
@asset2.to_solr[Solrizer.solr_name(:collection)].should == []
|
159
159
|
## Check that member was re-indexed without collection info
|
160
|
-
asset_results =
|
160
|
+
asset_results = blacklight_solr.get "select", params:{fq:["id:\"#{@asset2.pid}\""],fl:['id',Solrizer.solr_name(:collection)]}
|
161
161
|
doc = asset_results["response"]["docs"].first
|
162
162
|
doc["id"].should == @asset2.pid
|
163
163
|
doc[Solrizer.solr_name(:collection)].should be_nil
|
@@ -200,14 +200,14 @@ describe CollectionsController do
|
|
200
200
|
@asset1 = @asset1.reload
|
201
201
|
@asset1.update_index
|
202
202
|
@asset1.collections.should == [@collection]
|
203
|
-
asset_results =
|
203
|
+
asset_results = blacklight_solr.get "select", params:{fq:["id:\"#{@asset1.pid}\""],fl:['id',Solrizer.solr_name(:collection)]}
|
204
204
|
asset_results["response"]["numFound"].should == 1
|
205
205
|
doc = asset_results["response"]["docs"].first
|
206
206
|
doc[Solrizer.solr_name(:collection)].should == [@collection.pid]
|
207
207
|
|
208
208
|
delete :destroy, id: @collection.id
|
209
209
|
@asset1.reload.collections.should == []
|
210
|
-
asset_results =
|
210
|
+
asset_results = blacklight_solr.get "select", params:{fq:["id:\"#{@asset1.pid}\""],fl:['id',Solrizer.solr_name(:collection)]}
|
211
211
|
asset_results["response"]["numFound"].should == 1
|
212
212
|
doc = asset_results["response"]["docs"].first
|
213
213
|
doc[Solrizer.solr_name(:collection)].should be_nil
|
@@ -6,8 +6,6 @@ class SelectsCollectionsController < ApplicationController
|
|
6
6
|
include Hydra::Collections::SelectsCollections
|
7
7
|
|
8
8
|
SelectsCollectionsController.solr_search_params_logic += [:add_access_controls_to_solr_params]
|
9
|
-
# This filters out objects that you want to exclude from search results, like FileAssets
|
10
|
-
SelectsCollectionsController.solr_search_params_logic += [:exclude_unwanted_models]
|
11
9
|
|
12
10
|
end
|
13
11
|
|
@@ -6,7 +6,7 @@ class TestAppGenerator < Rails::Generators::Base
|
|
6
6
|
def run_blacklight_generator
|
7
7
|
say_status("warning", "GENERATING BL", :yellow)
|
8
8
|
|
9
|
-
generate
|
9
|
+
generate "blacklight:install", '--devise'
|
10
10
|
end
|
11
11
|
|
12
12
|
def run_hydra_head_generator
|
@@ -68,4 +68,9 @@ class TestAppGenerator < Rails::Generators::Base
|
|
68
68
|
end
|
69
69
|
end
|
70
70
|
|
71
|
+
def add_create_permissions
|
72
|
+
insert_into_file 'app/models/ability.rb', after: 'custom_permissions' do
|
73
|
+
"\n can :create, :all if user_groups.include? 'registered'\n"
|
74
|
+
end
|
75
|
+
end
|
71
76
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hydra-collections
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Carolyn Cole
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2014-04-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: blacklight
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - ~>
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: 7.0.1
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - ~>
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
40
|
+
version: 7.0.1
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: active-fedora
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -223,7 +223,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
223
223
|
version: '0'
|
224
224
|
requirements: []
|
225
225
|
rubyforge_project:
|
226
|
-
rubygems_version: 2.
|
226
|
+
rubygems_version: 2.0.3
|
227
227
|
signing_key:
|
228
228
|
specification_version: 4
|
229
229
|
summary: A rails engine for managing Hydra Collections
|