hydra-collections 7.0.0 → 8.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (57) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -1
  3. data/Changelog.md +5 -4
  4. data/Gemfile +2 -1
  5. data/README.md +2 -11
  6. data/app/controllers/concerns/hydra/collections_controller_behavior.rb +18 -8
  7. data/app/helpers/collections_helper.rb +6 -2
  8. data/app/models/concerns/hydra/collections/metadata.rb +2 -2
  9. data/app/views/collections/_button_remove_from_collection.html.erb +4 -6
  10. data/app/views/collections/_document_header.html.erb +1 -4
  11. data/app/views/collections/_form.html.erb +7 -7
  12. data/app/views/collections/_search_form.html.erb +4 -4
  13. data/app/views/collections/show.html.erb +29 -5
  14. data/app/views/layouts/collections.html.erb +0 -1
  15. data/hydra-collections.gemspec +1 -0
  16. data/lib/hydra-collections.rb +0 -1
  17. data/lib/hydra/collections/version.rb +1 -1
  18. data/solr/config/_rest_managed.json +3 -0
  19. data/solr/config/admin-extra.html +31 -0
  20. data/solr/config/elevate.xml +36 -0
  21. data/solr/config/mapping-ISOLatin1Accent.txt +246 -0
  22. data/solr/config/protwords.txt +21 -0
  23. data/solr/config/schema.xml +372 -0
  24. data/solr/config/scripts.conf +24 -0
  25. data/solr/config/solrconfig.xml +300 -0
  26. data/solr/config/spellings.txt +2 -0
  27. data/solr/config/stopwords.txt +58 -0
  28. data/solr/config/stopwords_en.txt +58 -0
  29. data/solr/config/synonyms.txt +31 -0
  30. data/solr/config/xslt/example.xsl +132 -0
  31. data/solr/config/xslt/example_atom.xsl +67 -0
  32. data/solr/config/xslt/example_rss.xsl +66 -0
  33. data/solr/config/xslt/luke.xsl +337 -0
  34. data/spec/controllers/catalog_controller_spec.rb +6 -14
  35. data/spec/controllers/collections_controller_spec.rb +67 -61
  36. data/spec/controllers/other_collections_controller_spec.rb +1 -1
  37. data/spec/controllers/selects_collections_spec.rb +33 -33
  38. data/spec/factories.rb +10 -1
  39. data/spec/factories/users.rb +1 -11
  40. data/spec/features/create_collection_spec.rb +17 -0
  41. data/spec/helpers/collections_helper_spec.rb +44 -35
  42. data/spec/models/collection_spec.rb +8 -10
  43. data/spec/spec_helper.rb +9 -0
  44. data/spec/test_app_templates/app/views/catalog/_sort_and_per_page.html.erb +2 -3
  45. data/spec/test_app_templates/lib/generators/test_app_generator.rb +0 -4
  46. data/spec/views/collections/_form.html.erb_spec.rb +15 -0
  47. data/spec/views/collections/show.html.erb_spec.rb +1 -1
  48. data/tasks/hydra-collections-dev.rake +6 -6
  49. metadata +37 -14
  50. data/app/helpers/collections_search_helper.rb +0 -11
  51. data/app/models/concerns/hydra/collections/actions.rb +0 -22
  52. data/config/jetty.yml +0 -6
  53. data/lib/hydra/collections/collectible.rb +0 -25
  54. data/spec/helpers/collections_search_helper_spec.rb +0 -16
  55. data/spec/lib/collectible_spec.rb +0 -39
  56. data/spec/test_app_templates/config/blacklight.yml +0 -22
  57. data/tasks/jetty.rake +0 -40
@@ -1,11 +0,0 @@
1
- # View Helper methods for Hydra Collections in search results
2
- module CollectionsSearchHelper
3
-
4
- # @param [String] collection_pid the pid of a collection
5
- # @return [String] the title of the collection if available, otherwise its pid
6
- def collection_name(collection_pid)
7
- #TODO this can be loaded from solr
8
- Collection.find(collection_pid).title || collection_pid
9
- end
10
-
11
- end
@@ -1,22 +0,0 @@
1
- module Hydra::Collections
2
- module Actions
3
- extend ActiveSupport::Concern
4
-
5
- included do
6
- Deprecation.warn(Actions, "Hydra::Collections::Actions is deprecated and will be removed in 6.0.0")
7
- before_create :set_date_uploaded
8
- before_save :set_date_modified
9
- end
10
-
11
- private
12
-
13
- def set_date_uploaded
14
- self.date_uploaded = Date.today
15
- end
16
-
17
- def set_date_modified
18
- self.date_modified = Date.today
19
- end
20
- end
21
- end
22
-
@@ -1,6 +0,0 @@
1
- default:
2
- startup_wait: 45
3
- jetty_port: 8983
4
- java_opts:
5
- - "-Xmx256m"
6
- - "-XX:MaxPermSize=128m"
@@ -1,25 +0,0 @@
1
- # This module adds a `has_many :collections` association to any models that you mix it into, using the :has_collection_member property
2
- # It also provides methods to help you index the information as a facet
3
- require 'deprecation'
4
- module Hydra::Collections
5
- module Collectible
6
- extend ActiveSupport::Concern
7
- extend Deprecation
8
-
9
- included do
10
- include Hydra::Works::WorkBehavior
11
- Deprecation.warn(Collectible, "Hydra::Collections::Collectible is deprecated. include Hydra::Works::WorkBehavior instead. Hydra::Collections::Collectible will be removed in Hydra::Collections 7.0")
12
- end
13
-
14
- def collection_ids
15
- Deprecation.warn(Collectible, "collection_ids is deprecated and will be removed in Hydra::Collections 7.0. Use in_collections.map(&:id) instead.")
16
- in_collections.map(&:id)
17
- end
18
-
19
- def collections
20
- Deprecation.warn(Collectible, "collections is deprecated and will be removed in Hydra::Collections 7.0. Use in_collections instead.")
21
- in_collections
22
- end
23
-
24
- end
25
- end
@@ -1,16 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe CollectionsSearchHelper, :type => :helper do
4
- describe "collection_name" do
5
- let(:collection_without_title) { Collection.create!() }
6
- let(:collection_with_title) { Collection.create!(title: "Title of Collection 2") }
7
-
8
- it "should return the pid if no title available" do
9
- expect(collection_name(collection_without_title.id)).to eq collection_without_title.id
10
- end
11
-
12
- it "should return the title value associated with the given pid" do
13
- expect(collection_name(collection_with_title.id)).to eq "Title of Collection 2"
14
- end
15
- end
16
- end
@@ -1,39 +0,0 @@
1
- require "spec_helper"
2
-
3
- describe Hydra::Collections::Collectible do
4
- before do
5
- class CollectibleThing < ActiveFedora::Base
6
- include Hydra::Collections::Collectible
7
- end
8
- end
9
-
10
- let(:collection1) { FactoryGirl.build(:collection) }
11
- let(:collection2) { FactoryGirl.create(:collection) }
12
- let(:collectible) { CollectibleThing.create }
13
-
14
- after do
15
- Object.send(:remove_const, :CollectibleThing)
16
- end
17
-
18
- describe "collections associations" do
19
- before do
20
- allow(Deprecation).to receive(:warn)
21
- collection1.members << collectible
22
- collection1.save
23
- collection2.members << collectible
24
- collection2.save
25
- end
26
-
27
- it "queries the members" do
28
- expect(collectible.reload.collections).to eq [collection1, collection2]
29
- end
30
-
31
- it "counts the members" do
32
- expect(collectible.reload.collections.size).to eq 2
33
- end
34
-
35
- it "queries the ids" do
36
- expect(collectible.reload.collection_ids).to eq [collection1.id, collection2.id]
37
- end
38
- end
39
- end
@@ -1,22 +0,0 @@
1
- # = jetty_path key
2
- # each environment can have a jetty_path with absolute or relative
3
- # (to app root) path to a jetty/solr install. This is used
4
- # by the rake tasks that start up solr automatically for testing
5
- # and by rake solr:marc:index.
6
- #
7
- # jetty_path is not used by a running Blacklight application
8
- # at all. In general you do NOT need to deploy solr in Jetty, you can deploy it
9
- # however you want.
10
- # jetty_path is only required for rake tasks that need to know
11
- # how to start up solr, generally for automated testing.
12
-
13
- development:
14
- adapter: solr
15
- url: http://localhost:8983/solr/development
16
- test: &test
17
- adapter: solr
18
- url: <%= "http://127.0.0.1:#{ENV['TEST_JETTY_PORT'] || 8983}/solr/test" %>
19
- production:
20
- adapter: solr
21
- url: <%= ENV['SOLR_URL'] || "http://127.0.0.1:8983/solr/blacklight-core" %>
22
-
@@ -1,40 +0,0 @@
1
- namespace :jetty do
2
- desc "Copies the default Solr & Fedora configs into the bundled Hydra Testing Server"
3
- task :config do
4
- Rake::Task["jetty:config_fedora"].invoke
5
- Rake::Task["jetty:config_solr"].invoke
6
- end
7
-
8
- desc "Copies the contents of solr_conf into the Solr development-core and test-core of Testing Server"
9
- task :config_solr do
10
- FileList['solr_conf/conf/*'].each do |f|
11
- cp("#{f}", 'jetty/solr/development-core/conf/', :verbose => true)
12
- cp("#{f}", 'jetty/solr/test-core/conf/', :verbose => true)
13
- end
14
- end
15
-
16
- desc "Copies a custom fedora config for the bundled Hydra Testing Server"
17
- task :config_fedora do
18
- # load a custom fedora.fcfg -
19
- if defined?(Rails.root)
20
- app_root = Rails.root
21
- else
22
- app_root = File.join(File.dirname(__FILE__),"..")
23
- end
24
-
25
- fcfg = File.join(app_root,"fedora_conf","conf","development","fedora.fcfg")
26
- if File.exists?(fcfg)
27
- puts "copying over development/fedora.fcfg"
28
- cp("#{fcfg}", 'jetty/fedora/default/server/config/', :verbose => true)
29
- else
30
- puts "#{fcfg} file not found -- skipping fedora config"
31
- end
32
- fcfg = File.join(app_root,"fedora_conf","conf","test","fedora.fcfg")
33
- if File.exists?(fcfg)
34
- puts "copying over test/fedora.fcfg"
35
- cp("#{fcfg}", 'jetty/fedora/test/server/config/', :verbose => true)
36
- else
37
- puts "#{fcfg} file not found -- skipping fedora config"
38
- end
39
- end
40
- end