hydra_mediated 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (123) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +18 -0
  3. data/.rspec +1 -0
  4. data/Gemfile +7 -0
  5. data/HYDRA_MEDIATED_VERSION +1 -0
  6. data/README.md +36 -0
  7. data/Rakefile +5 -0
  8. data/app/assets/images/blacklight/bg.png +0 -0
  9. data/app/assets/images/blacklight/border.png +0 -0
  10. data/app/assets/images/blacklight/bul_sq_gry.gif +0 -0
  11. data/app/assets/images/blacklight/checkmark.gif +0 -0
  12. data/app/assets/images/blacklight/logo.png +0 -0
  13. data/app/assets/images/blacklight/magnifying_glass.gif +0 -0
  14. data/app/assets/images/blacklight/remove.gif +0 -0
  15. data/app/assets/images/blacklight/separator.gif +0 -0
  16. data/app/assets/images/blacklight/start_over.gif +0 -0
  17. data/app/assets/images/rails.png +0 -0
  18. data/app/assets/javascripts/application.js +17 -0
  19. data/app/assets/javascripts/items.js.coffee +3 -0
  20. data/app/assets/stylesheets/application.css +14 -0
  21. data/app/assets/stylesheets/blacklight.css.scss +4 -0
  22. data/app/assets/stylesheets/items.css.scss +3 -0
  23. data/app/controllers/application_controller.rb +10 -0
  24. data/app/controllers/catalog_controller.rb +165 -0
  25. data/app/controllers/items_controller.rb +34 -0
  26. data/app/controllers/submissions_controller.rb +7 -0
  27. data/app/helpers/application_helper.rb +2 -0
  28. data/app/helpers/items_helper.rb +5 -0
  29. data/app/mailers/.gitkeep +0 -0
  30. data/app/models/.gitkeep +0 -0
  31. data/app/models/ability.rb +3 -0
  32. data/app/models/ead.rb +3 -0
  33. data/app/models/etd.rb +3 -0
  34. data/app/models/generic.rb +3 -0
  35. data/app/models/generic_file.rb +3 -0
  36. data/app/models/item.rb +4 -0
  37. data/app/models/solr_document.rb +33 -0
  38. data/app/models/user.rb +22 -0
  39. data/app/views/catalog/_home_text.html.erb +9 -0
  40. data/app/views/catalog/_show_tools.html.erb +44 -0
  41. data/app/views/devise/confirmations/new.html.erb +12 -0
  42. data/app/views/devise/mailer/confirmation_instructions.html.erb +5 -0
  43. data/app/views/devise/mailer/reset_password_instructions.html.erb +8 -0
  44. data/app/views/devise/mailer/unlock_instructions.html.erb +7 -0
  45. data/app/views/devise/passwords/edit.html.erb +16 -0
  46. data/app/views/devise/passwords/new.html.erb +12 -0
  47. data/app/views/devise/registrations/edit.html.erb +29 -0
  48. data/app/views/devise/registrations/new.html.erb +18 -0
  49. data/app/views/devise/sessions/new.html.erb +17 -0
  50. data/app/views/devise/shared/_links.erb +25 -0
  51. data/app/views/devise/unlocks/new.html.erb +12 -0
  52. data/app/views/items/done.html.erb +3 -0
  53. data/app/views/items/edit.html.erb +25 -0
  54. data/app/views/items/new.html.erb +22 -0
  55. data/app/views/items/submit.html.erb +6 -0
  56. data/app/views/items/upload.html.erb +5 -0
  57. data/app/views/layouts/application.html.erb +14 -0
  58. data/app/views/submissions/new.html.erb +13 -0
  59. data/config.ru +4 -0
  60. data/config/SolrMarc/config-test.properties +37 -0
  61. data/config/SolrMarc/config.properties +37 -0
  62. data/config/SolrMarc/index.properties +97 -0
  63. data/config/SolrMarc/index_scripts/dewey.bsh +47 -0
  64. data/config/SolrMarc/index_scripts/format.bsh +126 -0
  65. data/config/SolrMarc/translation_maps/README_MAPS +1 -0
  66. data/config/SolrMarc/translation_maps/callnumber_map.properties +407 -0
  67. data/config/SolrMarc/translation_maps/composition_era_map.properties +56 -0
  68. data/config/SolrMarc/translation_maps/country_map.properties +379 -0
  69. data/config/SolrMarc/translation_maps/format_map.properties +50 -0
  70. data/config/SolrMarc/translation_maps/instrument_map.properties +101 -0
  71. data/config/SolrMarc/translation_maps/language_map.properties +490 -0
  72. data/config/application.rb +66 -0
  73. data/config/boot.rb +6 -0
  74. data/config/database.yml +25 -0
  75. data/config/environment.rb +5 -0
  76. data/config/locales/devise.en.yml +59 -0
  77. data/config/locales/en.yml +5 -0
  78. data/config/routes.rb +20 -0
  79. data/db/migrate/20130606160529_devise_create_users.rb +46 -0
  80. data/db/migrate/20130606160531_add_devise_guests_to_users.rb +15 -0
  81. data/db/migrate/20130606160536_create_searches.rb +16 -0
  82. data/db/migrate/20130606160537_create_bookmarks.rb +18 -0
  83. data/db/migrate/20130606160538_remove_editable_fields_from_bookmarks.rb +12 -0
  84. data/db/migrate/20130606160539_add_user_types_to_bookmarks_searches.rb +16 -0
  85. data/db/schema.rb +54 -0
  86. data/db/seeds.rb +7 -0
  87. data/doc/README_FOR_APP +2 -0
  88. data/fedora_conf/conf/development/fedora.fcfg +953 -0
  89. data/fedora_conf/conf/test/fedora.fcfg +953 -0
  90. data/hydra_mediated.gemspec +22 -0
  91. data/lib/assets/.gitkeep +0 -0
  92. data/lib/hydra/mediated/ability.rb +17 -0
  93. data/lib/hydra/mediated/generic_file.rb +13 -0
  94. data/lib/hydra/mediated/item.rb +35 -0
  95. data/lib/hydra_mediated.rb +21 -0
  96. data/lib/tasks/.gitkeep +0 -0
  97. data/log/.gitkeep +0 -0
  98. data/public/404.html +26 -0
  99. data/public/422.html +26 -0
  100. data/public/500.html +25 -0
  101. data/public/favicon.ico +0 -0
  102. data/public/robots.txt +5 -0
  103. data/script/rails +6 -0
  104. data/solr_conf/conf/schema.xml +273 -0
  105. data/solr_conf/conf/solrconfig.xml +167 -0
  106. data/solr_conf/solr.xml +35 -0
  107. data/spec/controllers/items_controller_spec.rb +56 -0
  108. data/spec/helpers/items_helper_spec.rb +8 -0
  109. data/spec/models/ability_spec.rb +24 -0
  110. data/spec/models/item_spec.rb +26 -0
  111. data/spec/spec_helper.rb +33 -0
  112. data/test/fixtures/.gitkeep +0 -0
  113. data/test/fixtures/users.yml +11 -0
  114. data/test/functional/.gitkeep +0 -0
  115. data/test/integration/.gitkeep +0 -0
  116. data/test/performance/browsing_test.rb +12 -0
  117. data/test/test_helper.rb +13 -0
  118. data/test/unit/.gitkeep +0 -0
  119. data/test/unit/user_test.rb +7 -0
  120. data/vendor/assets/javascripts/.gitkeep +0 -0
  121. data/vendor/assets/stylesheets/.gitkeep +0 -0
  122. data/vendor/plugins/.gitkeep +0 -0
  123. metadata +222 -0
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 36156e09a192907d270903fb979a2bbe965538f7
4
+ data.tar.gz: 5592c88347dd12c9c2450aa9c02119db270a02e6
5
+ SHA512:
6
+ metadata.gz: 0b876c609fd4b828114f5a847008832cb7c6e0e8c642107bf464b6d28f7a779fee9acc424a0ca1c032071d4993d7e16653c41d1a55b19e9bf8991414565bcdd1
7
+ data.tar.gz: 79970140e57d5c581b3d8562a99f224a70b950ea31c072c3b6e0d2ddff7381acdbbaf41971befdb58678d65b05b5a4011dba0b54baa6c84c08c0d8ba3703500f
@@ -0,0 +1,18 @@
1
+ # See http://help.github.com/ignore-files/ for more about ignoring files.
2
+ #
3
+ # If you find yourself ignoring temporary files generated by your text editor
4
+ # or operating system, you probably want to add a global ignore instead:
5
+ # git config --global core.excludesfile ~/.gitignore_global
6
+
7
+ # Ignore bundler config
8
+ /.bundle
9
+
10
+ # Ignore the default SQLite database.
11
+ /db/*.sqlite3
12
+
13
+ # Ignore all logfiles and tempfiles.
14
+ /log/*.log
15
+ /tmp
16
+
17
+ jetty
18
+ Gemfile.lock
data/.rspec ADDED
@@ -0,0 +1 @@
1
+ --color
data/Gemfile ADDED
@@ -0,0 +1,7 @@
1
+ source 'http://rubygems.org'
2
+
3
+ # Please see sufia.gemspec for dependency information.
4
+ gemspec
5
+
6
+ # Required for doing pagination inside an engine. See https://github.com/amatsuda/kaminari/pull/322
7
+ gem 'kaminari', github: 'harai/kaminari', branch: 'route_prefix_prototype'
@@ -0,0 +1 @@
1
+ 0.0.1
@@ -0,0 +1,36 @@
1
+ # Goals
2
+ * Prototype an ingest workflow that is potentially useful to several institutions
3
+ * Demonstrate how to rely on sufia-models when creating a new gem
4
+ * Prove (test) the usefulness of sufia-models
5
+ * Use hydra-collections when dealing with sets of object
6
+ * How to use hydra-editor for using metadata
7
+ * Extracting the multi-file upload from sufia
8
+
9
+ # Setup
10
+
11
+ in your Gemfile add:
12
+
13
+ ```ruby
14
+ gem 'hydra_mediated'
15
+ ```
16
+
17
+ ```
18
+ rails g blacklight --devise
19
+ rails g hydra:head -f
20
+ rake db:migrate
21
+
22
+ Add to config/routes.rb before the blacklight routes:
23
+ ```ruby
24
+ mount HydraMediated::Engine => '/'
25
+ ```
26
+
27
+ # if you are using rails 3
28
+ ```
29
+ rm public/index.html
30
+ ```
31
+
32
+ # if you are using rails 4 pin to a compatible branch of sufia-models
33
+ in the gemfile add
34
+ ```ruby
35
+ gem 'sufia-models', github: 'projecthydra/sufia', branch: 'rails4'
36
+ ```
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env rake
2
+ # Add your own tasks in files placed in lib/tasks ending in .rake,
3
+ # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
4
+ #
5
+ require "bundler/gem_tasks"
@@ -0,0 +1,17 @@
1
+ // This is a manifest file that'll be compiled into application.js, which will include all the files
2
+ // listed below.
3
+ //
4
+ // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
5
+ // or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
6
+ //
7
+ // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
8
+ // the compiled file.
9
+ //
10
+ // WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD
11
+ // GO AFTER THE REQUIRES BELOW.
12
+ //
13
+ //= require jquery
14
+ //= require jquery_ujs
15
+ //
16
+ //= require blacklight/blacklight
17
+ //= require hydra-editor/hydra-editor
@@ -0,0 +1,3 @@
1
+ # Place all the behaviors and hooks related to the matching controller here.
2
+ # All this logic will automatically be available in application.js.
3
+ # You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/
@@ -0,0 +1,14 @@
1
+ /*
2
+ * This is a manifest file that'll be compiled into application.css, which will include all the files
3
+ * listed below.
4
+ *
5
+ * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
6
+ * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
7
+ *
8
+ * You're free to add application-wide styles to this file and they'll appear at the top of the
9
+ * compiled file, but it's generally better to create a new file per style scope.
10
+ *
11
+ *= require_self
12
+ *= require blacklight
13
+ *= require hydra-editor/hydra-editor
14
+ */
@@ -0,0 +1,4 @@
1
+ @import 'bootstrap';
2
+ @import 'bootstrap-responsive';
3
+
4
+ @import 'blacklight/blacklight';
@@ -0,0 +1,3 @@
1
+ // Place all the styles related to the items controller here.
2
+ // They will automatically be included in application.css.
3
+ // You can use Sass (SCSS) here: http://sass-lang.com/
@@ -0,0 +1,10 @@
1
+ class ApplicationController < ActionController::Base
2
+ # Adds a few additional behaviors into the application controller
3
+ include Blacklight::Controller
4
+ # Please be sure to impelement current_user and user_session. Blacklight depends on
5
+ # these methods in order to perform user specific actions.
6
+
7
+ layout 'blacklight'
8
+
9
+ protect_from_forgery
10
+ end
@@ -0,0 +1,165 @@
1
+ # -*- encoding : utf-8 -*-
2
+ require 'blacklight/catalog'
3
+
4
+ class CatalogController < ApplicationController
5
+
6
+ include Blacklight::Catalog
7
+ include Hydra::Controller::ControllerBehavior
8
+ # These before_filters apply the hydra access controls
9
+ before_filter :enforce_show_permissions, :only=>:show
10
+ # This applies appropriate access controls to all solr queries
11
+ CatalogController.solr_search_params_logic += [:add_access_controls_to_solr_params]
12
+ # This filters out objects that you want to exclude from search results, like FileAssets
13
+ CatalogController.solr_search_params_logic += [:exclude_unwanted_models]
14
+
15
+
16
+ configure_blacklight do |config|
17
+ config.default_solr_params = {
18
+ :qt => 'search',
19
+ :rows => 10
20
+ }
21
+
22
+ # solr field configuration for search results/index views
23
+ config.index.show_link = 'title_tesim'
24
+ config.index.record_display_type = 'has_model_ssim'
25
+
26
+ # solr field configuration for document/show views
27
+ config.show.html_title = 'title_tesim'
28
+ config.show.heading = 'title_tesim'
29
+ config.show.display_type = 'has_model_ssim'
30
+
31
+ # solr fields that will be treated as facets by the blacklight application
32
+ # The ordering of the field names is the order of the display
33
+ #
34
+ # Setting a limit will trigger Blacklight's 'more' facet values link.
35
+ # * If left unset, then all facet values returned by solr will be displayed.
36
+ # * If set to an integer, then "f.somefield.facet.limit" will be added to
37
+ # solr request, with actual solr request being +1 your configured limit --
38
+ # you configure the number of items you actually want _tsimed_ in a page.
39
+ # * If set to 'true', then no additional parameters will be sent to solr,
40
+ # but any 'sniffed' request limit parameters will be used for paging, with
41
+ # paging at requested limit -1. Can sniff from facet.limit or
42
+ # f.specific_field.facet.limit solr request params. This 'true' config
43
+ # can be used if you set limits in :default_solr_params, or as defaults
44
+ # on the solr side in the request handler itself. Request handler defaults
45
+ # sniffing requires solr requests to be made with "echoParams=all", for
46
+ # app code to actually have it echo'd back to see it.
47
+ #
48
+ # :show may be set to false if you don't want the facet to be drawn in the
49
+ # facet bar
50
+ config.add_facet_field solr_name('object_type', :facetable), :label => 'Format'
51
+ config.add_facet_field solr_name('pub_date', :facetable), :label => 'Publication Year'
52
+ config.add_facet_field solr_name('subject_topic', :facetable), :label => 'Topic', :limit => 20
53
+ config.add_facet_field solr_name('language', :facetable), :label => 'Language', :limit => true
54
+ config.add_facet_field solr_name('lc1_letter', :facetable), :label => 'Call Number'
55
+ config.add_facet_field solr_name('subject_geo', :facetable), :label => 'Region'
56
+ config.add_facet_field solr_name('subject_era', :facetable), :label => 'Era'
57
+
58
+ # Have BL send all facet field names to Solr, which has been the default
59
+ # previously. Simply remove these lines if you'd rather use Solr request
60
+ # handler defaults, or have no facets.
61
+ config.default_solr_params[:'facet.field'] = config.facet_fields.keys
62
+ #use this instead if you don't want to query facets marked :show=>false
63
+ #config.default_solr_params[:'facet.field'] = config.facet_fields.select{ |k, v| v[:show] != false}.keys
64
+
65
+
66
+ # solr fields to be displayed in the index (search results) view
67
+ # The ordering of the field names is the order of the display
68
+ config.add_index_field solr_name('title', :stored_searchable, type: :string), :label => 'Title:'
69
+ config.add_index_field solr_name('title_vern', :stored_searchable, type: :string), :label => 'Title:'
70
+ config.add_index_field solr_name('author', :stored_searchable, type: :string), :label => 'Author:'
71
+ config.add_index_field solr_name('author_vern', :stored_searchable, type: :string), :label => 'Author:'
72
+ config.add_index_field solr_name('format', :symbol), :label => 'Format:'
73
+ config.add_index_field solr_name('language', :stored_searchable, type: :string), :label => 'Language:'
74
+ config.add_index_field solr_name('published', :stored_searchable, type: :string), :label => 'Published:'
75
+ config.add_index_field solr_name('published_vern', :stored_searchable, type: :string), :label => 'Published:'
76
+ config.add_index_field solr_name('lc_callnum', :stored_searchable, type: :string), :label => 'Call number:'
77
+
78
+ # solr fields to be displayed in the show (single result) view
79
+ # The ordering of the field names is the order of the display
80
+ config.add_show_field solr_name('title', :stored_searchable, type: :string), :label => 'Title:'
81
+ config.add_show_field solr_name('title_vern', :stored_searchable, type: :string), :label => 'Title:'
82
+ config.add_show_field solr_name('subtitle', :stored_searchable, type: :string), :label => 'Subtitle:'
83
+ config.add_show_field solr_name('subtitle_vern', :stored_searchable, type: :string), :label => 'Subtitle:'
84
+ config.add_show_field solr_name('author', :stored_searchable, type: :string), :label => 'Author:'
85
+ config.add_show_field solr_name('author_vern', :stored_searchable, type: :string), :label => 'Author:'
86
+ config.add_show_field solr_name('format', :symbol), :label => 'Format:'
87
+ config.add_show_field solr_name('url_fulltext_tsim', :stored_searchable, type: :string), :label => 'URL:'
88
+ config.add_show_field solr_name('url_suppl_tsim', :stored_searchable, type: :string), :label => 'More Information:'
89
+ config.add_show_field solr_name('language', :stored_searchable, type: :string), :label => 'Language:'
90
+ config.add_show_field solr_name('published', :stored_searchable, type: :string), :label => 'Published:'
91
+ config.add_show_field solr_name('published_vern', :stored_searchable, type: :string), :label => 'Published:'
92
+ config.add_show_field solr_name('lc_callnum', :stored_searchable, type: :string), :label => 'Call number:'
93
+ config.add_show_field solr_name('isbn', :stored_searchable, type: :string), :label => 'ISBN:'
94
+
95
+ # "fielded" search configuration. Used by pulldown among other places.
96
+ # For supported keys in hash, see rdoc for Blacklight::SearchFields
97
+ #
98
+ # Search fields will inherit the :qt solr request handler from
99
+ # config[:default_solr_parameters], OR can specify a different one
100
+ # with a :qt key/value. Below examples inherit, except for subject
101
+ # that specifies the same :qt as default for our own internal
102
+ # testing purposes.
103
+ #
104
+ # The :key is what will be used to identify this BL search field internally,
105
+ # as well as in URLs -- so changing it after deployment may break bookmarked
106
+ # urls. A display label will be automatically calculated from the :key,
107
+ # or can be specified manually to be different.
108
+
109
+ # This one uses all the defaults set by the solr request handler. Which
110
+ # solr request handler? The one set in config[:default_solr_parameters][:qt],
111
+ # since we aren't specifying it otherwise.
112
+
113
+ config.add_search_field 'all_fields', :label => 'All Fields'
114
+
115
+
116
+ # Now we see how to over-ride Solr request handler defaults, in this
117
+ # case for a BL "search field", which is really a dismax aggregate
118
+ # of Solr search fields.
119
+
120
+ config.add_search_field('title') do |field|
121
+ # :solr_local_parameters will be sent using Solr LocalParams
122
+ # syntax, as eg {! qf=$title_qf }. This is neccesary to use
123
+ # Solr parameter de-referencing like $title_qf.
124
+ # See: http://wiki.apache.org/solr/LocalParams
125
+ field.solr_local_parameters = {
126
+ :qf => '$title_qf',
127
+ :pf => '$title_pf'
128
+ }
129
+ end
130
+
131
+ config.add_search_field('author') do |field|
132
+ field.solr_local_parameters = {
133
+ :qf => '$author_qf',
134
+ :pf => '$author_pf'
135
+ }
136
+ end
137
+
138
+ # Specifying a :qt only to show it's possible, and so our internal automated
139
+ # tests can test it. In this case it's the same as
140
+ # config[:default_solr_parameters][:qt], so isn't actually neccesary.
141
+ config.add_search_field('subject') do |field|
142
+ field.qt = 'search'
143
+ field.solr_local_parameters = {
144
+ :qf => '$subject_qf',
145
+ :pf => '$subject_pf'
146
+ }
147
+ end
148
+
149
+ # "sort results by" select (pulldown)
150
+ # label in pulldown is followed by the name of the SOLR field to sort by and
151
+ # whether the sort is ascending or descending (it must be asc or desc
152
+ # except in the relevancy case).
153
+ config.add_sort_field 'score desc, pub_date_dtsi desc, title_tesi asc', :label => 'relevance'
154
+ config.add_sort_field 'pub_date_dtsi desc, title_tesi asc', :label => 'year'
155
+ config.add_sort_field 'author_tesi asc, title_tesi asc', :label => 'author'
156
+ config.add_sort_field 'title_tesi asc, pub_date_dtsi desc', :label => 'title'
157
+
158
+ # If there are more than this many search results, no spelling ("did you
159
+ # mean") suggestion is offered.
160
+ config.spell_max = 5
161
+ end
162
+
163
+
164
+
165
+ end
@@ -0,0 +1,34 @@
1
+ class ItemsController < ApplicationController
2
+ load_and_authorize_resource only: [:new, :create, :upload, :update, :submit, :done]
3
+
4
+ def new
5
+ if Item.available_resource_types.values.include? params[:resource_type]
6
+ @item = params[:resource_type].constantize.new
7
+ @item.initialize_fields
8
+ else
9
+ raise "Invalid item type"
10
+ end
11
+ end
12
+
13
+ def create
14
+ @item.attributes = params[:item]
15
+ @item.save!
16
+ redirect_to mediated.upload_item_path(@item)
17
+ end
18
+
19
+ def upload
20
+ end
21
+
22
+ def update
23
+ @item.attributes = params[:item]
24
+ @item.save!
25
+ redirect_to mediated.submit_item_path(@item)
26
+ end
27
+
28
+ def submit
29
+ end
30
+
31
+ def done
32
+ end
33
+
34
+ end
@@ -0,0 +1,7 @@
1
+ class SubmissionsController < ApplicationController
2
+ before_filter :authenticate_user!
3
+
4
+ def new
5
+ end
6
+
7
+ end
@@ -0,0 +1,2 @@
1
+ module ApplicationHelper
2
+ end
@@ -0,0 +1,5 @@
1
+ module ItemsHelper
2
+ def available_collections
3
+ { 'Special Collection X' => 123, 'Faculty Pre-prints' => 223, 'Faculty Pre-prints' => 223 }
4
+ end
5
+ end
File without changes
File without changes
@@ -0,0 +1,3 @@
1
+ class Ability
2
+ include Hydra::Mediated::Ability
3
+ end
@@ -0,0 +1,3 @@
1
+ class EAD < ActiveFedora::Base
2
+ include Hydra::Mediated::Item
3
+ end
@@ -0,0 +1,3 @@
1
+ class ETD < ActiveFedora::Base
2
+ include Hydra::Mediated::Item
3
+ end
@@ -0,0 +1,3 @@
1
+ class Generic < ActiveFedora::Base
2
+ include Hydra::Mediated::Item
3
+ end
@@ -0,0 +1,3 @@
1
+ class GenericFile < ActiveFedora::Base
2
+ include Hydra::Mediated::GenericFile
3
+ end
@@ -0,0 +1,4 @@
1
+ class Item < ActiveFedora::Base
2
+ include Hydra::Mediated::Item
3
+
4
+ end
@@ -0,0 +1,33 @@
1
+ # -*- encoding : utf-8 -*-
2
+ class SolrDocument
3
+
4
+ include Blacklight::Solr::Document
5
+
6
+ # self.unique_key = 'id'
7
+
8
+ # The following shows how to setup this blacklight document to display marc documents
9
+ extension_parameters[:marc_source_field] = :marc_display
10
+ extension_parameters[:marc_format_type] = :marcxml
11
+ use_extension( Blacklight::Solr::Document::Marc) do |document|
12
+ document.key?( :marc_display )
13
+ end
14
+
15
+ # Email uses the semantic field mappings below to generate the body of an email.
16
+ SolrDocument.use_extension( Blacklight::Solr::Document::Email )
17
+
18
+ # SMS uses the semantic field mappings below to generate the body of an SMS email.
19
+ SolrDocument.use_extension( Blacklight::Solr::Document::Sms )
20
+
21
+ # DublinCore uses the semantic field mappings below to assemble an OAI-compliant Dublin Core document
22
+ # Semantic mappings of solr stored fields. Fields may be multi or
23
+ # single valued. See Blacklight::Solr::Document::ExtendableClassMethods#field_semantics
24
+ # and Blacklight::Solr::Document#to_semantic_values
25
+ # Recommendation: Use field names from Dublin Core
26
+ use_extension( Blacklight::Solr::Document::DublinCore)
27
+ field_semantics.merge!(
28
+ :title => "title_display",
29
+ :author => "author_display",
30
+ :language => "language_facet",
31
+ :format => "format"
32
+ )
33
+ end