|
1 | | -class DetailsController < ApplicationController |
| 1 | +class DetailsController < SubsitesController |
2 | 2 | include Dcv::CatalogIncludes |
3 | 3 | include Dcv::Sites::SearchableController |
4 | | - extend Dcv::Configurators::BaseBlacklightConfigurator |
| 4 | + include Dcv::Sites::ConfiguredLayouts |
| 5 | + include Dcv::Catalog::CatalogLayout |
5 | 6 |
|
6 | 7 | layout 'details' |
7 | 8 |
|
8 | 9 | _prefixes << 'catalog' # haaaaaaack to not reproduce templates |
9 | 10 |
|
10 | 11 | configure_blacklight do |config| |
11 | | - config.default_solr_params = { |
12 | | - :qt => 'search', |
13 | | - :rows => 20 |
14 | | - } |
15 | | - config.search_state_fields.concat(DETAILS_PARAMS) |
16 | | - config.per_page = [20,60,100] |
17 | | - # solr field configuration for search results/index views |
18 | | - default_index_configuration(config) |
19 | | - default_show_configuration(config) |
20 | | - |
21 | | - # solr fields that will be treated as facets by the blacklight application |
22 | | - # The ordering of the field names is the order of the display |
23 | | - # |
24 | | - # Setting a limit will trigger Blacklight's 'more' facet values link. |
25 | | - # * If left unset, then all facet values returned by solr will be displayed. |
26 | | - # * If set to an integer, then "f.somefield.facet.limit" will be added to |
27 | | - # solr request, with actual solr request being +1 your configured limit -- |
28 | | - # you configure the number of items you actually want _tsimed_ in a page. |
29 | | - # * If set to 'true', then no additional parameters will be sent to solr, |
30 | | - # but any 'sniffed' request limit parameters will be used for paging, with |
31 | | - # paging at requested limit -1. Can sniff from facet.limit or |
32 | | - # f.specific_field.facet.limit solr request params. This 'true' config |
33 | | - # can be used if you set limits in :default_solr_params, or as defaults |
34 | | - # on the solr side in the request handler itself. Request handler defaults |
35 | | - # sniffing requires solr requests to be made with "echoParams=all", for |
36 | | - # app code to actually have it echo'd back to see it. |
37 | | - # |
38 | | - # :show may be set to false if you don't want the facet to be drawn in the |
39 | | - # facet bar |
40 | | - |
41 | | - config.add_facet_fields_to_solr_request! # Required for facet queries |
42 | | - |
43 | | - config.add_facet_field 'lib_project_sim', :label => 'Project' |
44 | | - config.add_facet_field 'lib_collection_sim', :label => 'Collection' |
45 | | - config.add_facet_field 'lib_repo_short_ssim', :label => 'Library Location' |
46 | | - config.add_facet_field 'lib_name_sim', :label => 'Name' |
47 | | - config.add_facet_field 'lib_format_sim', :label => 'Format' |
48 | | - #todo: date |
49 | | - #todo: language |
50 | | - config.add_facet_field 'format_ssi', :label => 'System Format' |
51 | | - |
52 | | - config.add_facet_field 'lc1_letter_sim', :label => 'Call Number' |
53 | | - |
54 | | - # Have BL send all facet field names to Solr, which has been the default |
55 | | - # previously. Simply remove these lines if you'd rather use Solr request |
56 | | - # handler defaults, or have no facets. |
57 | | - config.default_solr_params['facet.field'] = config.facet_fields.map { |key, config| config.field || config.key } |
58 | | - #use this instead if you don't want to query facets marked :show=>false |
59 | | - #config.default_solr_params['facet.field'] = config.facet_fields.select{ |k, v| v[:show] != false}.keys |
60 | | - |
61 | | - |
62 | | - # solr fields to be displayed in the index (search results) view |
63 | | - # The ordering of the field names is the order of the display |
64 | | - config.add_index_field 'title_display_ssm', :label => 'Title' |
65 | | - config.add_index_field 'lib_collection_ssm', :label => 'Collection' |
66 | | - |
67 | | - # solr fields to be displayed in the show (single result) view |
68 | | - # The ordering of the field names is the order of the display |
69 | | - config.add_show_field 'title_display_ssm', :label => 'Title' |
70 | | - config.add_show_field 'identifier_ssim', :label => 'Identifier' |
71 | | - config.add_show_field 'lib_format_ssm', :label => 'Format' |
72 | | - config.add_show_field 'lib_name_ssm', :label => 'Name' |
73 | | - config.add_show_field 'lib_collection_ssm', :label=>"Collection" |
74 | | - |
75 | | - # "fielded" search configuration. Used by pulldown among other places. |
76 | | - # For supported keys in hash, see rdoc for Blacklight::SearchFields |
77 | | - # |
78 | | - # Search fields will inherit the :qt solr request handler from |
79 | | - # config[:default_solr_parameters], OR can specify a different one |
80 | | - # with a :qt key/value. Below examples inherit, except for subject |
81 | | - # that specifies the same :qt as default for our own internal |
82 | | - # testing purposes. |
83 | | - # |
84 | | - # The :key is what will be used to identify this BL search field internally, |
85 | | - # as well as in URLs -- so changing it after deployment may break bookmarked |
86 | | - # urls. A display label will be automatically calculated from the :key, |
87 | | - # or can be specified manually to be different. |
88 | | - |
89 | | - # All Text search configuration, used by main search pulldown. |
90 | | - config.add_search_field 'all_text_teim' do |field| |
91 | | - field.label = 'All Fields' |
92 | | - field.default = true |
93 | | - field.solr_parameters = { |
94 | | - :qf => ['all_text_teim'], |
95 | | - :pf => ['all_text_teim'] |
| 12 | + config.search_state_fields.concat(Dcv::Configurators::BaseBlacklightConfigurator::Constants::DETAILS_PARAMS) |
| 13 | + Dcv::Configurators::DcvBlacklightConfigurator.configure(config) |
| 14 | + # Include this target's content in search results, and any additional publish targets specified in subsites.yml |
| 15 | + configure_blacklight_scope_constraints(config, true) |
| 16 | + config.add_facet_field 'content_availability', label: 'Limit by Availability', show: false, |
| 17 | + query: { |
| 18 | + onsite: { label: 'Reading Room', fq: "{!join from=cul_member_of_ssim to=fedora_pid_uri_ssi}!access_control_levels_ssim:Public*" }, |
| 19 | + public: { label: 'Public', fq: "{!join from=cul_member_of_ssim to=fedora_pid_uri_ssi}access_control_levels_ssim:Public*" }, |
96 | 20 | } |
97 | | - end |
98 | | - |
99 | | - config.add_search_field 'search_title_info_search_title_teim' do |field| |
100 | | - field.label = 'Title' |
101 | | - field.solr_parameters = { |
102 | | - :qf => ['search_title_info_search_title_teim'], |
103 | | - :pf => ['search_title_info_search_title_teim'] |
104 | | - } |
105 | | - end |
106 | | - |
107 | | - config.add_search_field 'lib_name_teim' do |field| |
108 | | - field.label = 'Name' |
109 | | - field.solr_parameters = { |
110 | | - :qf => ['lib_name_teim'], |
111 | | - :pf => ['lib_name_teim'] |
112 | | - } |
113 | | - end |
114 | | - |
115 | | - # "sort results by" select (pulldown) |
116 | | - # label in pulldown is followed by the name of the SOLR field to sort by and |
117 | | - # whether the sort is ascending or descending (it must be asc or desc |
118 | | - # except in the relevancy case). |
119 | | - config.add_sort_field 'score desc, title_si asc, lib_date_dtsi desc', :label => 'relevance' |
120 | | - config.add_sort_field 'title_si asc, lib_date_dtsi desc', :label => 'title' |
121 | | - |
122 | | - # If there are more than this many search results, no spelling ("did you |
123 | | - # mean") suggestion is offered. |
124 | | - config.spell_max = 5 |
125 | 21 | end |
126 | 22 |
|
127 | 23 | def show |
|
0 commit comments