hydra-collections 5.0.1 → 5.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Changelog.md +4 -0
- data/README.md +1 -1
- data/app/search_builders/hydra/collections/search_builder.rb +1 -27
- data/hydra-collections.gemspec +1 -1
- data/lib/hydra-collections.rb +1 -0
- data/lib/hydra/collections/search_behaviors.rb +30 -0
- data/lib/hydra/collections/version.rb +1 -1
- data/spec/controllers/catalog_controller_spec.rb +0 -2
- data/spec/test_app_templates/lib/generators/test_app_generator.rb +1 -1
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f5ab9c82d9c2b45b6c93d58bb9629d142104cb77
|
4
|
+
data.tar.gz: df870186ca05040cc5f4e07e38f29a03bcfb0900
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d04a46fe91e9f572556e689bf0a7c759d5466f91bbcc8df17aebd68d5489f58629f2e1eeb1d9fdae8742d6ea0e2e497a89d70f0ed72fed7f5b4735cd46c28b31
|
7
|
+
data.tar.gz: b18035284b01b0439912b716346eead6fdabbc6cad9aa8cec7d4ea2123c3c45f80d235ab9ad5b9cf25ba78fca2894b8b92c7843aba23e56ad420e84f81d0339d
|
data/Changelog.md
CHANGED
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Hydra::Collections [![Version](https://badge.fury.io/rb/hydra-collections.png)](http://badge.fury.io/rb/hydra-collections) [![Build Status](https://travis-ci.org/projecthydra
|
1
|
+
# Hydra::Collections [![Version](https://badge.fury.io/rb/hydra-collections.png)](http://badge.fury.io/rb/hydra-collections) [![Build Status](https://travis-ci.org/projecthydra/hydra-collections.png?branch=master)](https://travis-ci.org/projecthydra/hydra-collections) [![Dependency Status](https://gemnasium.com/projecthydra/hydra-collections.png)](https://gemnasium.com/projecthydra/hydra-collections)
|
2
2
|
|
3
3
|
Add collections to your Hydra application. These collections are typically created by depositors (instead of librarians or curators). Any collectible item can belong to many different collections. The collection does not confer access rights onto any of the members of the collections.
|
4
4
|
|
@@ -1,31 +1,5 @@
|
|
1
1
|
module Hydra::Collections
|
2
2
|
class SearchBuilder < Hydra::SearchBuilder
|
3
|
-
|
4
|
-
def collection
|
5
|
-
scope.collection
|
6
|
-
end
|
7
|
-
|
8
|
-
# include filters into the query to only include the collection memebers
|
9
|
-
def include_collection_ids(solr_parameters)
|
10
|
-
solr_parameters[:fq] ||= []
|
11
|
-
solr_parameters[:fq] << "{!join from=hasCollectionMember_ssim to=id}id:#{collection.id}"
|
12
|
-
end
|
13
|
-
|
14
|
-
def some_rows(solr_parameters)
|
15
|
-
solr_parameters[:rows] = '100'
|
16
|
-
end
|
17
|
-
|
18
|
-
def add_collection_filter(solr_parameters)
|
19
|
-
solr_parameters[:fq] ||= []
|
20
|
-
solr_parameters[:fq] << ActiveFedora::SolrQueryBuilder.construct_query_for_rel(has_model: ::Collection.to_class_uri)
|
21
|
-
end
|
22
|
-
|
23
|
-
def discovery_perms= perms
|
24
|
-
@discovery_perms = perms
|
25
|
-
end
|
26
|
-
|
27
|
-
def discovery_permissions
|
28
|
-
@discovery_perms || super
|
29
|
-
end
|
3
|
+
include Hydra::Collections::SearchBehaviors
|
30
4
|
end
|
31
5
|
end
|
data/hydra-collections.gemspec
CHANGED
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
|
|
10
10
|
spec.email = ["cam156@psu.edu"]
|
11
11
|
spec.description = "A rails engine for managing Hydra Collections"
|
12
12
|
spec.summary = "A rails engine for managing Hydra Collections"
|
13
|
-
spec.homepage = "https://github.com/projecthydra
|
13
|
+
spec.homepage = "https://github.com/projecthydra/hydra-collections"
|
14
14
|
spec.license = "APACHE2"
|
15
15
|
|
16
16
|
spec.files = `git ls-files`.split($/)
|
data/lib/hydra-collections.rb
CHANGED
@@ -0,0 +1,30 @@
|
|
1
|
+
module Hydra::Collections::SearchBehaviors
|
2
|
+
|
3
|
+
def collection
|
4
|
+
scope.collection
|
5
|
+
end
|
6
|
+
|
7
|
+
# include filters into the query to only include the collection memebers
|
8
|
+
def include_collection_ids(solr_parameters)
|
9
|
+
solr_parameters[:fq] ||= []
|
10
|
+
solr_parameters[:fq] << "{!join from=hasCollectionMember_ssim to=id}id:#{collection.id}"
|
11
|
+
end
|
12
|
+
|
13
|
+
def some_rows(solr_parameters)
|
14
|
+
solr_parameters[:rows] = '100'
|
15
|
+
end
|
16
|
+
|
17
|
+
def add_collection_filter(solr_parameters)
|
18
|
+
solr_parameters[:fq] ||= []
|
19
|
+
solr_parameters[:fq] << ActiveFedora::SolrQueryBuilder.construct_query_for_rel(has_model: ::Collection.to_class_uri)
|
20
|
+
end
|
21
|
+
|
22
|
+
def discovery_perms= perms
|
23
|
+
@discovery_perms = perms
|
24
|
+
end
|
25
|
+
|
26
|
+
def discovery_permissions
|
27
|
+
@discovery_perms || super
|
28
|
+
end
|
29
|
+
|
30
|
+
end
|
@@ -71,7 +71,7 @@ class TestAppGenerator < Rails::Generators::Base
|
|
71
71
|
|
72
72
|
# Inject collections call into balacklight catalog
|
73
73
|
def inject_collections
|
74
|
-
insert_into_file "app/controllers/catalog_controller.rb", :after => 'Hydra::
|
74
|
+
insert_into_file "app/controllers/catalog_controller.rb", :after => 'Hydra::Catalog' do
|
75
75
|
"\n include Hydra::Collections::SelectsCollections\n before_filter :find_collections, :only=>:index"
|
76
76
|
end
|
77
77
|
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: 5.0.
|
4
|
+
version: 5.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Carolyn Cole
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-03-
|
11
|
+
date: 2015-03-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: hydra-head
|
@@ -150,6 +150,7 @@ files:
|
|
150
150
|
- lib/hydra-collections.rb
|
151
151
|
- lib/hydra/collections/accepts_batches.rb
|
152
152
|
- lib/hydra/collections/collectible.rb
|
153
|
+
- lib/hydra/collections/search_behaviors.rb
|
153
154
|
- lib/hydra/collections/search_service.rb
|
154
155
|
- lib/hydra/collections/solr_document_behavior.rb
|
155
156
|
- lib/hydra/collections/version.rb
|
@@ -184,7 +185,7 @@ files:
|
|
184
185
|
- spec/views/collections/show.html.erb_spec.rb
|
185
186
|
- tasks/hydra-collections-dev.rake
|
186
187
|
- tasks/jetty.rake
|
187
|
-
homepage: https://github.com/projecthydra
|
188
|
+
homepage: https://github.com/projecthydra/hydra-collections
|
188
189
|
licenses:
|
189
190
|
- APACHE2
|
190
191
|
metadata: {}
|
@@ -204,7 +205,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
204
205
|
version: '0'
|
205
206
|
requirements: []
|
206
207
|
rubyforge_project:
|
207
|
-
rubygems_version: 2.4.
|
208
|
+
rubygems_version: 2.4.6
|
208
209
|
signing_key:
|
209
210
|
specification_version: 4
|
210
211
|
summary: A rails engine for managing Hydra Collections
|