arclight 0.0.1 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (202) hide show
  1. checksums.yaml +5 -5
  2. data/.all-contributorsrc +450 -0
  3. data/.codeclimate.yml +5 -0
  4. data/.eslintrc +22 -0
  5. data/.github/workflows/ruby.yml +44 -0
  6. data/.gitignore +7 -0
  7. data/.rspec +0 -1
  8. data/.rubocop.yml +362 -0
  9. data/.rubocop_todo.yml +122 -0
  10. data/.solr_wrapper +5 -0
  11. data/CONTRIBUTING.md +43 -0
  12. data/CONTRIBUTORS.md +79 -0
  13. data/Gemfile +41 -0
  14. data/LICENSE.txt +1 -0
  15. data/README.md +100 -12
  16. data/Rakefile +13 -3
  17. data/app/assets/images/arclight/logo.png +0 -0
  18. data/app/assets/images/blacklight/bookmark.svg +1 -0
  19. data/app/assets/images/blacklight/collection.svg +5 -0
  20. data/app/assets/images/blacklight/compact.svg +1 -0
  21. data/app/assets/images/blacklight/container.svg +5 -0
  22. data/app/assets/images/blacklight/ead.svg +1 -0
  23. data/app/assets/images/blacklight/file.svg +5 -0
  24. data/app/assets/images/blacklight/folder.svg +1 -0
  25. data/app/assets/images/blacklight/list.svg +1 -0
  26. data/app/assets/images/blacklight/minus.svg +1 -0
  27. data/app/assets/images/blacklight/online.svg +5 -0
  28. data/app/assets/images/blacklight/pdf.svg +1 -0
  29. data/app/assets/images/blacklight/plus.svg +1 -0
  30. data/app/assets/images/blacklight/repository.svg +1 -0
  31. data/app/assets/javascripts/arclight/arclight.js +4 -0
  32. data/app/assets/javascripts/arclight/oembed_controller.js +58 -0
  33. data/app/assets/javascripts/arclight/truncate_controller.js +27 -0
  34. data/app/assets/stylesheets/arclight/application.scss +14 -0
  35. data/app/assets/stylesheets/arclight/build.scss +4 -0
  36. data/app/assets/stylesheets/arclight/modules/collection_search.scss +3 -0
  37. data/app/assets/stylesheets/arclight/modules/hierarchy_and_online_contents.scss +155 -0
  38. data/app/assets/stylesheets/arclight/modules/highlights.scss +11 -0
  39. data/app/assets/stylesheets/arclight/modules/icons.scss +20 -0
  40. data/app/assets/stylesheets/arclight/modules/layout.scss +220 -0
  41. data/app/assets/stylesheets/arclight/modules/mastheads.scss +57 -0
  42. data/app/assets/stylesheets/arclight/modules/repositories.scss +25 -0
  43. data/app/assets/stylesheets/arclight/modules/repository_card.scss +9 -0
  44. data/app/assets/stylesheets/arclight/modules/search_form.scss +9 -0
  45. data/app/assets/stylesheets/arclight/modules/search_results.scss +250 -0
  46. data/app/assets/stylesheets/arclight/modules/show_collection.scss +38 -0
  47. data/app/assets/stylesheets/arclight/modules/truncator.scss +58 -0
  48. data/app/assets/stylesheets/arclight/responsive.scss +13 -0
  49. data/app/assets/stylesheets/arclight/variables.scss +25 -0
  50. data/app/components/arclight/access_component.html.erb +14 -0
  51. data/app/components/arclight/access_component.rb +25 -0
  52. data/app/components/arclight/bookmark_component.html.erb +25 -0
  53. data/app/components/arclight/bookmark_component.rb +9 -0
  54. data/app/components/arclight/breadcrumb_component.rb +40 -0
  55. data/app/components/arclight/breadcrumbs_hierarchy_component.html.erb +34 -0
  56. data/app/components/arclight/breadcrumbs_hierarchy_component.rb +25 -0
  57. data/app/components/arclight/collection_context_component.html.erb +12 -0
  58. data/app/components/arclight/collection_context_component.rb +27 -0
  59. data/app/components/arclight/collection_info_component.html.erb +28 -0
  60. data/app/components/arclight/collection_info_component.rb +26 -0
  61. data/app/components/arclight/collection_sidebar_component.html.erb +15 -0
  62. data/app/components/arclight/collection_sidebar_component.rb +39 -0
  63. data/app/components/arclight/constraints_component.html.erb +7 -0
  64. data/app/components/arclight/constraints_component.rb +17 -0
  65. data/app/components/arclight/document_collection_context_component.html.erb +29 -0
  66. data/app/components/arclight/document_collection_context_component.rb +28 -0
  67. data/app/components/arclight/document_collection_hierarchy_component.html.erb +50 -0
  68. data/app/components/arclight/document_collection_hierarchy_component.rb +62 -0
  69. data/app/components/arclight/document_component.html.erb +39 -0
  70. data/app/components/arclight/document_component.rb +49 -0
  71. data/app/components/arclight/document_components_hierarchy_component.html.erb +32 -0
  72. data/app/components/arclight/document_components_hierarchy_component.rb +28 -0
  73. data/app/components/arclight/document_download_component.html.erb +24 -0
  74. data/app/components/arclight/document_download_component.rb +71 -0
  75. data/app/components/arclight/embed_component.html.erb +10 -0
  76. data/app/components/arclight/embed_component.rb +43 -0
  77. data/app/components/arclight/group_component.html.erb +34 -0
  78. data/app/components/arclight/group_component.rb +23 -0
  79. data/app/components/arclight/header_component.html.erb +5 -0
  80. data/app/components/arclight/header_component.rb +10 -0
  81. data/app/components/arclight/index_metadata_field_component.html.erb +16 -0
  82. data/app/components/arclight/index_metadata_field_component.rb +20 -0
  83. data/app/components/arclight/masthead_component.html.erb +15 -0
  84. data/app/components/arclight/masthead_component.rb +10 -0
  85. data/app/components/arclight/metadata_section_component.html.erb +13 -0
  86. data/app/components/arclight/metadata_section_component.rb +22 -0
  87. data/app/components/arclight/oembed_viewer_component.html.erb +5 -0
  88. data/app/components/arclight/oembed_viewer_component.rb +16 -0
  89. data/app/components/arclight/online_content_filter_component.html.erb +15 -0
  90. data/app/components/arclight/online_content_filter_component.rb +19 -0
  91. data/app/components/arclight/online_status_indicator_component.rb +19 -0
  92. data/app/components/arclight/repository_breadcrumb_component.html.erb +10 -0
  93. data/app/components/arclight/repository_breadcrumb_component.rb +17 -0
  94. data/app/components/arclight/repository_location_component.html.erb +20 -0
  95. data/app/components/arclight/repository_location_component.rb +10 -0
  96. data/app/components/arclight/search_bar_component.html.erb +27 -0
  97. data/app/components/arclight/search_bar_component.rb +32 -0
  98. data/app/components/arclight/search_result_breadcrumbs_component.html.erb +6 -0
  99. data/app/components/arclight/search_result_breadcrumbs_component.rb +37 -0
  100. data/app/components/arclight/search_result_component.html.erb +20 -0
  101. data/app/components/arclight/search_result_component.rb +18 -0
  102. data/app/components/arclight/search_result_title_component.html.erb +15 -0
  103. data/app/components/arclight/search_result_title_component.rb +15 -0
  104. data/app/components/arclight/sidebar_component.html.erb +9 -0
  105. data/app/components/arclight/sidebar_component.rb +19 -0
  106. data/app/components/arclight/upper_metadata_layout_component.rb +10 -0
  107. data/app/components/blacklight/icons/bookmark_component.rb +12 -0
  108. data/app/components/blacklight/icons/collection_component.rb +14 -0
  109. data/app/components/blacklight/icons/compact_component.rb +12 -0
  110. data/app/components/blacklight/icons/container_component.rb +14 -0
  111. data/app/components/blacklight/icons/ead_component.rb +12 -0
  112. data/app/components/blacklight/icons/file_component.rb +14 -0
  113. data/app/components/blacklight/icons/folder_component.rb +12 -0
  114. data/app/components/blacklight/icons/online_component.rb +15 -0
  115. data/app/components/blacklight/icons/pdf_component.rb +12 -0
  116. data/app/components/blacklight/icons/repository_component.rb +12 -0
  117. data/app/controllers/arclight/repositories_controller.rb +40 -0
  118. data/app/helpers/arclight/ead_format_helpers.rb +309 -0
  119. data/app/helpers/arclight/field_config_helpers.rb +26 -0
  120. data/app/helpers/arclight_helper.rb +108 -0
  121. data/app/models/arclight/document_downloads.rb +122 -0
  122. data/app/models/arclight/parent.rb +24 -0
  123. data/app/models/arclight/parents.rb +39 -0
  124. data/app/models/arclight/requests/aeon_external_request.rb +42 -0
  125. data/app/models/arclight/requests/aeon_web_ead.rb +52 -0
  126. data/app/models/arclight/requests/google_form.rb +49 -0
  127. data/app/models/concerns/arclight/catalog.rb +44 -0
  128. data/app/models/concerns/arclight/search_behavior.rb +47 -0
  129. data/app/models/concerns/arclight/solr_document.rb +159 -0
  130. data/app/presenters/arclight/index_presenter.rb +10 -0
  131. data/app/presenters/arclight/show_presenter.rb +54 -0
  132. data/app/views/arclight/.keep +0 -0
  133. data/app/views/arclight/_requests.html.erb +7 -0
  134. data/app/views/arclight/repositories/_repository.html.erb +43 -0
  135. data/app/views/arclight/repositories/index.html.erb +9 -0
  136. data/app/views/arclight/repositories/show.html.erb +37 -0
  137. data/app/views/arclight/requests/_aeon_external_request_endpoint.html.erb +8 -0
  138. data/app/views/arclight/requests/_aeon_web_ead.html.erb +6 -0
  139. data/app/views/arclight/requests/_google_form.html.erb +10 -0
  140. data/app/views/catalog/_document_list.html.erb +8 -0
  141. data/app/views/catalog/_group.html.erb +4 -0
  142. data/app/views/catalog/_group_toggle.html.erb +10 -0
  143. data/app/views/catalog/_search_results_header.html.erb +3 -0
  144. data/app/views/catalog/hierarchy.html.erb +19 -0
  145. data/app/views/catalog/index.html.erb +17 -0
  146. data/app/views/shared/_breadcrumbs.html.erb +3 -0
  147. data/app/views/shared/_main_menu_links.html.erb +6 -0
  148. data/arclight.gemspec +29 -11
  149. data/bin/rails +13 -0
  150. data/config/breadcrumbs.rb +24 -0
  151. data/config/i18n-tasks.yml +134 -0
  152. data/config/importmap.rb +3 -0
  153. data/config/locales/arclight.en.yml +100 -0
  154. data/config/repositories.yml +0 -0
  155. data/config/routes.rb +6 -0
  156. data/docker-compose.yml +16 -0
  157. data/lib/arclight/digital_object.rb +27 -0
  158. data/lib/arclight/engine.rb +47 -0
  159. data/lib/arclight/exceptions.rb +19 -0
  160. data/lib/arclight/hash_absolute_xpath.rb +62 -0
  161. data/lib/arclight/level_label.rb +46 -0
  162. data/lib/arclight/missing_id_strategy.rb +21 -0
  163. data/lib/arclight/normalized_date.rb +49 -0
  164. data/lib/arclight/normalized_id.rb +30 -0
  165. data/lib/arclight/normalized_title.rb +33 -0
  166. data/lib/arclight/repository.rb +116 -0
  167. data/lib/arclight/routes/hierarchy.rb +19 -0
  168. data/lib/arclight/routes.rb +8 -0
  169. data/lib/arclight/traject/ead2_component_config.rb +334 -0
  170. data/lib/arclight/traject/ead2_config.rb +315 -0
  171. data/lib/arclight/traject/nokogiri_namespaceless_reader.rb +22 -0
  172. data/lib/arclight/version.rb +3 -1
  173. data/lib/arclight/year_range.rb +111 -0
  174. data/lib/arclight.rb +11 -1
  175. data/lib/generators/arclight/install_generator.rb +126 -0
  176. data/lib/generators/arclight/templates/arclight.scss +5 -0
  177. data/lib/generators/arclight/templates/catalog_controller.rb +422 -0
  178. data/lib/generators/arclight/templates/config/downloads.yml +25 -0
  179. data/lib/generators/arclight/templates/config/locales/arclight.en.yml +61 -0
  180. data/lib/generators/arclight/templates/config/repositories.yml +53 -0
  181. data/lib/generators/arclight/update_generator.rb +22 -0
  182. data/lib/tasks/index.rake +84 -0
  183. data/package.json +30 -0
  184. data/solr/conf/_rest_managed.json +3 -0
  185. data/solr/conf/admin-extra.html +31 -0
  186. data/solr/conf/elevate.xml +36 -0
  187. data/solr/conf/mapping-ISOLatin1Accent.txt +246 -0
  188. data/solr/conf/protwords.txt +21 -0
  189. data/solr/conf/schema.xml +400 -0
  190. data/solr/conf/solrconfig.xml +328 -0
  191. data/solr/conf/spellings.txt +2 -0
  192. data/solr/conf/stopwords.txt +58 -0
  193. data/solr/conf/stopwords_en.txt +58 -0
  194. data/solr/conf/synonyms.txt +31 -0
  195. data/solr/conf/xslt/example.xsl +132 -0
  196. data/solr/conf/xslt/example_atom.xsl +67 -0
  197. data/solr/conf/xslt/example_rss.xsl +66 -0
  198. data/solr/conf/xslt/luke.xsl +337 -0
  199. data/tasks/arclight.rake +72 -0
  200. data/template.rb +10 -0
  201. metadata +432 -20
  202. data/.travis.yml +0 -5
@@ -0,0 +1,422 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Blacklight controller that handles searches and document requests
4
+ class CatalogController < ApplicationController
5
+ include Blacklight::Catalog
6
+ include Arclight::Catalog
7
+
8
+ configure_blacklight do |config|
9
+ ## Class for sending and receiving requests from a search index
10
+ # config.repository_class = Blacklight::Solr::Repository
11
+ #
12
+ ## Class for converting Blacklight's url parameters to into request parameters for the search index
13
+ # config.search_builder_class = ::SearchBuilder
14
+ #
15
+ ## Model that maps search index responses to the blacklight response model
16
+ # config.response_model = Blacklight::Solr::Response
17
+
18
+ ## Default parameters to send to solr for all search-like requests. See also SearchBuilder#processed_parameters
19
+ config.default_solr_params = {
20
+ rows: 10,
21
+ fl: '*,collection:[subquery]',
22
+ 'collection.q': '{!terms f=id v=$row._root_}',
23
+ 'collection.defType': 'lucene',
24
+ 'collection.fl': '*',
25
+ 'collection.rows': 1
26
+ }
27
+
28
+ # Sets the indexed Solr field that will display with highlighted matches
29
+ config.highlight_field = 'text'
30
+
31
+ # solr path which will be added to solr base url before the other solr params.
32
+ # config.solr_path = 'select'
33
+
34
+ # items to show per page, each number in the array represent another option to choose from.
35
+ # config.per_page = [10,20,50,100]
36
+
37
+ ## Default parameters to send on single-document requests to Solr.
38
+ ## These settings are the Blacklight defaults (see SearchHelper#solr_doc_params) or
39
+ ## parameters included in the Blacklight-jetty document requestHandler.
40
+ #
41
+ config.default_document_solr_params = {
42
+ qt: 'document',
43
+ fl: '*,collection:[subquery]',
44
+ 'collection.q': '{!terms f=id v=$row._root_}',
45
+ 'collection.defType': 'lucene',
46
+ 'collection.fl': '*',
47
+ 'collection.rows': 1
48
+ }
49
+
50
+ config.header_component = Arclight::HeaderComponent
51
+ config.add_results_document_tool(:online, component: Arclight::OnlineStatusIndicatorComponent)
52
+ config.add_results_document_tool(:arclight_bookmark_control, component: Arclight::BookmarkComponent)
53
+
54
+ config.add_results_collection_tool(:group_toggle)
55
+ config.add_results_collection_tool(:sort_widget)
56
+ config.add_results_collection_tool(:per_page_widget)
57
+ config.add_results_collection_tool(:view_type_group)
58
+
59
+ config.add_nav_action(:bookmark, partial: 'blacklight/nav/bookmark', if: :render_bookmarks_control?)
60
+ config.add_nav_action(:search_history, partial: 'blacklight/nav/search_history')
61
+
62
+ # solr field configuration for search results/index views
63
+ config.index.partials = %i[arclight_index_default]
64
+ config.index.title_field = 'normalized_title_ssm'
65
+ config.index.display_type_field = 'level_ssm'
66
+ config.index.document_component = Arclight::SearchResultComponent
67
+ config.index.group_component = Arclight::GroupComponent
68
+ config.index.constraints_component = Arclight::ConstraintsComponent
69
+ config.index.document_presenter_class = Arclight::IndexPresenter
70
+ config.index.search_bar_component = Arclight::SearchBarComponent
71
+ # config.index.thumbnail_field = 'thumbnail_path_ss'
72
+
73
+ # solr field configuration for document/show views
74
+ # config.show.title_field = 'title_display'
75
+ config.show.document_component = Arclight::DocumentComponent
76
+ config.show.sidebar_component = Arclight::SidebarComponent
77
+ config.show.breadcrumb_component = Arclight::BreadcrumbsHierarchyComponent
78
+ config.show.embed_component = Arclight::EmbedComponent
79
+ config.show.access_component = Arclight::AccessComponent
80
+ config.show.online_status_component = Arclight::OnlineStatusIndicatorComponent
81
+ config.show.display_type_field = 'level_ssm'
82
+ # config.show.thumbnail_field = 'thumbnail_path_ss'
83
+ config.show.document_presenter_class = Arclight::ShowPresenter
84
+ config.show.metadata_partials = %i[
85
+ summary_field
86
+ background_field
87
+ related_field
88
+ indexed_terms_field
89
+ access_field
90
+ ]
91
+
92
+ config.show.collection_access_items = %i[
93
+ terms_field
94
+ cite_field
95
+ in_person_field
96
+ contact_field
97
+ ]
98
+
99
+ config.show.component_metadata_partials = %i[
100
+ component_field
101
+ component_indexed_terms_field
102
+ ]
103
+
104
+ config.show.component_access_items = %i[
105
+ component_terms_field
106
+ cite_field
107
+ in_person_field
108
+ contact_field
109
+ ]
110
+
111
+ ##
112
+ # Compact index view
113
+ config.view.compact!
114
+
115
+ # solr fields that will be treated as facets by the blacklight application
116
+ # The ordering of the field names is the order of the display
117
+ #
118
+ # Setting a limit will trigger Blacklight's 'more' facet values link.
119
+ # * If left unset, then all facet values returned by solr will be displayed.
120
+ # * If set to an integer, then "f.somefield.facet.limit" will be added to
121
+ # solr request, with actual solr request being +1 your configured limit --
122
+ # you configure the number of items you actually want _displayed_ in a page.
123
+ # * If set to 'true', then no additional parameters will be sent to solr,
124
+ # but any 'sniffed' request limit parameters will be used for paging, with
125
+ # paging at requested limit -1. Can sniff from facet.limit or
126
+ # f.specific_field.facet.limit solr request params. This 'true' config
127
+ # can be used if you set limits in :default_solr_params, or as defaults
128
+ # on the solr side in the request handler itself. Request handler defaults
129
+ # sniffing requires solr requests to be made with "echoParams=all", for
130
+ # app code to actually have it echo'd back to see it.
131
+ #
132
+ # :show may be set to false if you don't want the facet to be drawn in the
133
+ # facet bar
134
+ #
135
+ # set :index_range to true if you want the facet pagination view to have facet prefix-based navigation
136
+ # (useful when user clicks "more" on a large facet and wants to navigate alphabetically
137
+ # across a large set of results)
138
+ # :index_range can be an array or range of prefixes that will be used to create the navigation
139
+ # (note: It is case sensitive when searching values)
140
+
141
+ config.add_facet_field 'collection', field: 'collection_ssim', limit: 10
142
+ config.add_facet_field 'creators', field: 'creator_ssim', limit: 10
143
+ config.add_facet_field 'date_range', field: 'date_range_isim', range: true
144
+ config.add_facet_field 'level', field: 'level_ssim', limit: 10
145
+ config.add_facet_field 'names', field: 'names_ssim', limit: 10
146
+ config.add_facet_field 'repository', field: 'repository_ssim', limit: 10
147
+ config.add_facet_field 'places', field: 'geogname_ssim', limit: 10
148
+ config.add_facet_field 'access_subjects', field: 'access_subjects_ssim', limit: 10
149
+
150
+ # Have BL send all facet field names to Solr, which has been the default
151
+ # previously. Simply remove these lines if you'd rather use Solr request
152
+ # handler defaults, or have no facets.
153
+ config.add_facet_fields_to_solr_request!
154
+
155
+ # solr fields to be displayed in the index (search results) view
156
+ # The ordering of the field names is the order of the display
157
+ config.add_index_field 'highlight', accessor: 'highlights', separator_options: {
158
+ words_connector: '<br/>',
159
+ two_words_connector: '<br/>',
160
+ last_word_connector: '<br/>'
161
+ }, compact: true, component: Arclight::IndexMetadataFieldComponent
162
+ config.add_index_field 'creator', accessor: true, component: Arclight::IndexMetadataFieldComponent
163
+ config.add_index_field 'abstract_or_scope', accessor: true, truncate: true, repository_context: true, helper_method: :render_html_tags, component: Arclight::IndexMetadataFieldComponent
164
+ config.add_index_field 'breadcrumbs', accessor: :itself, component: Arclight::SearchResultBreadcrumbsComponent, compact: { count: 2 }
165
+
166
+ config.add_facet_field 'access', query: {
167
+ online: { label: 'Online access', fq: 'has_online_content_ssim:true' }
168
+ }
169
+
170
+ # solr fields to be displayed in the show (single result) view
171
+ # The ordering of the field names is the order of the display
172
+
173
+ # "fielded" search configuration. Used by pulldown among other places.
174
+ # For supported keys in hash, see rdoc for Blacklight::SearchFields
175
+ #
176
+ # Search fields will inherit the :qt solr request handler from
177
+ # config[:default_solr_parameters], OR can specify a different one
178
+ # with a :qt key/value. Below examples inherit, except for subject
179
+ # that specifies the same :qt as default for our own internal
180
+ # testing purposes.
181
+ #
182
+ # The :key is what will be used to identify this BL search field internally,
183
+ # as well as in URLs -- so changing it after deployment may break bookmarked
184
+ # urls. A display label will be automatically calculated from the :key,
185
+ # or can be specified manually to be different.
186
+
187
+ # This one uses all the defaults set by the solr request handler. Which
188
+ # solr request handler? The one set in config[:default_solr_parameters][:qt],
189
+ # since we aren't specifying it otherwise.
190
+ config.add_search_field 'all_fields', label: 'All Fields' do |field|
191
+ field.include_in_simple_select = true
192
+ end
193
+
194
+ config.add_search_field 'within_collection' do |field|
195
+ field.include_in_simple_select = false
196
+ field.solr_parameters = {
197
+ fq: '-level_ssim:Collection'
198
+ }
199
+ end
200
+
201
+ # Field-based searches. We have registered handlers in the Solr configuration
202
+ # so we have Blacklight use the `qt` parameter to invoke them
203
+ config.add_search_field 'keyword', label: 'Keyword' do |field|
204
+ field.qt = 'search' # default
205
+ end
206
+ config.add_search_field 'name', label: 'Name' do |field|
207
+ field.qt = 'search'
208
+ field.solr_parameters = {
209
+ qf: '${qf_name}',
210
+ pf: '${pf_name}'
211
+ }
212
+ end
213
+ config.add_search_field 'place', label: 'Place' do |field|
214
+ field.qt = 'search'
215
+ field.solr_parameters = {
216
+ qf: '${qf_place}',
217
+ pf: '${pf_place}'
218
+ }
219
+ end
220
+ config.add_search_field 'subject', label: 'Subject' do |field|
221
+ field.qt = 'search'
222
+ field.solr_parameters = {
223
+ qf: '${qf_subject}',
224
+ pf: '${pf_subject}'
225
+ }
226
+ end
227
+ config.add_search_field 'title', label: 'Title' do |field|
228
+ field.qt = 'search'
229
+ field.solr_parameters = {
230
+ qf: '${qf_title}',
231
+ pf: '${pf_title}'
232
+ }
233
+ end
234
+ config.add_search_field 'container', label: 'Container' do |field|
235
+ field.qt = 'search'
236
+ field.solr_parameters = {
237
+ qf: '${qf_container}',
238
+ pf: '${pf_container}'
239
+ }
240
+ end
241
+ config.add_search_field 'identifier', label: 'Identifier' do |field|
242
+ field.qt = 'search'
243
+ field.solr_parameters = {
244
+ qf: '${qf_identifier}',
245
+ pf: '${pf_identifier}'
246
+ }
247
+ end
248
+
249
+ # These are the parameters passed through in search_state.params_for_search
250
+ config.search_state_fields += %i[id group hierarchy_context original_document]
251
+ config.search_state_fields << { original_parents: [] }
252
+
253
+ # "sort results by" select (pulldown)
254
+ # label in pulldown is followed by the name of the SOLR field to sort by and
255
+ # whether the sort is ascending or descending (it must be asc or desc
256
+ # except in the relevancy case).
257
+ config.add_sort_field 'score desc, title_sort asc', label: 'relevance'
258
+ config.add_sort_field 'date_sort asc', label: 'date (ascending)'
259
+ config.add_sort_field 'date_sort desc', label: 'date (descending)'
260
+ config.add_sort_field 'creator_sort asc', label: 'creator (A-Z)'
261
+ config.add_sort_field 'creator_sort desc', label: 'creator (Z-A)'
262
+ config.add_sort_field 'title_sort asc', label: 'title (A-Z)'
263
+ config.add_sort_field 'title_sort desc', label: 'title (Z-A)'
264
+
265
+ # If there are more than this many search results, no spelling ("did you
266
+ # mean") suggestion is offered.
267
+ config.spell_max = 5
268
+
269
+ # Configuration for autocomplete suggestor
270
+ config.autocomplete_enabled = true
271
+ config.autocomplete_path = 'suggest'
272
+
273
+
274
+ # ===========================
275
+ # COLLECTION SHOW PAGE FIELDS
276
+ # ===========================
277
+
278
+ # Collection Show Page - Summary Section
279
+ config.add_summary_field 'creators', field: 'creator_ssim', link_to_facet: true
280
+ config.add_summary_field 'abstract', field: 'abstract_html_tesm', helper_method: :render_html_tags
281
+ config.add_summary_field 'extent', field: 'extent_ssm'
282
+ config.add_summary_field 'language', field: 'language_ssim'
283
+ config.add_summary_field 'prefercite', field: 'prefercite_html_tesm', helper_method: :render_html_tags
284
+
285
+ # Collection Show Page - Background Section
286
+ config.add_background_field 'scopecontent', field: 'scopecontent_html_tesm', helper_method: :render_html_tags
287
+ config.add_background_field 'bioghist', field: 'bioghist_html_tesm', helper_method: :render_html_tags
288
+ config.add_background_field 'acqinfo', field: 'acqinfo_ssim', helper_method: :render_html_tags
289
+ config.add_background_field 'appraisal', field: 'appraisal_html_tesm', helper_method: :render_html_tags
290
+ config.add_background_field 'custodhist', field: 'custodhist_html_tesm', helper_method: :render_html_tags
291
+ config.add_background_field 'processinfo', field: 'processinfo_html_tesm', helper_method: :render_html_tags
292
+ config.add_background_field 'arrangement', field: 'arrangement_html_tesm', helper_method: :render_html_tags
293
+ config.add_background_field 'accruals', field: 'accruals_html_tesm', helper_method: :render_html_tags
294
+ config.add_background_field 'phystech', field: 'phystech_html_tesm', helper_method: :render_html_tags
295
+ config.add_background_field 'physloc', field: 'physloc_html_tesm', helper_method: :render_html_tags
296
+ config.add_background_field 'physdesc', field: 'physdesc_tesim', helper_method: :render_html_tags
297
+ config.add_background_field 'physfacet', field: 'physfacet_tesim', helper_method: :render_html_tags
298
+ config.add_background_field 'dimensions', field: 'dimensions_tesim', helper_method: :render_html_tags
299
+ config.add_background_field 'materialspec', field: 'materialspec_html_tesm', helper_method: :render_html_tags
300
+ config.add_background_field 'fileplan', field: 'fileplan_html_tesm', helper_method: :render_html_tags
301
+ config.add_background_field 'descrules', field: 'descrules_ssm', helper_method: :render_html_tags
302
+ config.add_background_field 'note', field: 'note_html_tesm', helper_method: :render_html_tags
303
+
304
+ # Collection Show Page - Related Section
305
+ config.add_related_field 'relatedmaterial', field: 'relatedmaterial_html_tesm', helper_method: :render_html_tags
306
+ config.add_related_field 'separatedmaterial', field: 'separatedmaterial_html_tesm', helper_method: :render_html_tags
307
+ config.add_related_field 'otherfindaid', field: 'otherfindaid_html_tesm', helper_method: :render_html_tags
308
+ config.add_related_field 'altformavail', field: 'altformavail_html_tesm', helper_method: :render_html_tags
309
+ config.add_related_field 'originalsloc', field: 'originalsloc_html_tesm', helper_method: :render_html_tags
310
+ config.add_related_field 'odd', field: 'odd_html_tesm', helper_method: :render_html_tags
311
+
312
+ # Collection Show Page - Indexed Terms Section
313
+ config.add_indexed_terms_field 'access_subjects', field: 'access_subjects_ssim', link_to_facet: true, separator_options: {
314
+ words_connector: '<br/>',
315
+ two_words_connector: '<br/>',
316
+ last_word_connector: '<br/>'
317
+ }
318
+
319
+ config.add_indexed_terms_field 'names_coll', field: 'names_coll_ssim', separator_options: {
320
+ words_connector: '<br/>',
321
+ two_words_connector: '<br/>',
322
+ last_word_connector: '<br/>'
323
+ }, helper_method: :link_to_name_facet
324
+
325
+ config.add_indexed_terms_field 'places', field: 'places_ssim', link_to_facet: true, separator_options: {
326
+ words_connector: '<br/>',
327
+ two_words_connector: '<br/>',
328
+ last_word_connector: '<br/>'
329
+ }
330
+
331
+ config.add_indexed_terms_field 'indexes', field: 'indexes_html_tesm',
332
+ helper_method: :render_html_tags
333
+
334
+ # ==========================
335
+ # COMPONENT SHOW PAGE FIELDS
336
+ # ==========================
337
+
338
+ # Component Show Page - Metadata Section
339
+ config.add_component_field 'containers', accessor: 'containers', separator_options: {
340
+ words_connector: ', ',
341
+ two_words_connector: ', ',
342
+ last_word_connector: ', '
343
+ }, if: lambda { |_context, _field_config, document|
344
+ document.containers.present?
345
+ }
346
+ config.add_component_field 'creators', field: 'creator_ssim', link_to_facet: true
347
+ config.add_component_field 'abstract', field: 'abstract_html_tesm', helper_method: :render_html_tags
348
+ config.add_component_field 'extent', field: 'extent_ssm'
349
+ config.add_component_field 'scopecontent', field: 'scopecontent_html_tesm', helper_method: :render_html_tags
350
+ config.add_component_field 'language', field: 'language_ssim'
351
+ config.add_component_field 'acqinfo', field: 'acqinfo_ssim', helper_method: :render_html_tags
352
+ config.add_component_field 'bioghist', field: 'bioghist_html_tesm', helper_method: :render_html_tags
353
+ config.add_component_field 'appraisal', field: 'appraisal_html_tesm', helper_method: :render_html_tags
354
+ config.add_component_field 'custodhist', field: 'custodhist_html_tesm', helper_method: :render_html_tags
355
+ config.add_component_field 'processinfo', field: 'processinfo_html_tesm', helper_method: :render_html_tags
356
+ config.add_component_field 'arrangement', field: 'arrangement_html_tesm', helper_method: :render_html_tags
357
+ config.add_component_field 'accruals', field: 'accruals_html_tesm', helper_method: :render_html_tags
358
+ config.add_component_field 'phystech', field: 'phystech_html_tesm', helper_method: :render_html_tags
359
+ config.add_component_field 'materialspec', field: 'materialspec_html_tesm', helper_method: :render_html_tags
360
+ config.add_component_field 'physloc', field: 'physloc_html_tesm', helper_method: :render_html_tags
361
+ config.add_component_field 'physdesc', field: 'physdesc_tesim', helper_method: :render_html_tags
362
+ config.add_component_field 'physfacet', field: 'physfacet_tesim', helper_method: :render_html_tags
363
+ config.add_component_field 'dimensions', field: 'dimensions_tesim', helper_method: :render_html_tags
364
+ config.add_component_field 'fileplan', field: 'fileplan_html_tesm', helper_method: :render_html_tags
365
+ config.add_component_field 'altformavail', field: 'altformavail_html_tesm', helper_method: :render_html_tags
366
+ config.add_component_field 'otherfindaid', field: 'otherfindaid_html_tesm', helper_method: :render_html_tags
367
+ config.add_component_field 'odd', field: 'odd_html_tesm', helper_method: :render_html_tags
368
+ config.add_component_field 'relatedmaterial', field: 'relatedmaterial_html_tesm', helper_method: :render_html_tags
369
+ config.add_component_field 'separatedmaterial', field: 'separatedmaterial_html_tesm', helper_method: :render_html_tags
370
+ config.add_component_field 'originalsloc', field: 'originalsloc_html_tesm', helper_method: :render_html_tags
371
+ config.add_component_field 'note', field: 'note_html_tesm', helper_method: :render_html_tags
372
+
373
+ # Component Show Page - Indexed Terms Section
374
+ config.add_component_indexed_terms_field 'access_subjects', field: 'access_subjects_ssim', link_to_facet: true, separator_options: {
375
+ words_connector: '<br/>',
376
+ two_words_connector: '<br/>',
377
+ last_word_connector: '<br/>'
378
+ }
379
+
380
+ config.add_component_indexed_terms_field 'names', field: 'names_ssim', separator_options: {
381
+ words_connector: '<br/>',
382
+ two_words_connector: '<br/>',
383
+ last_word_connector: '<br/>'
384
+ }, helper_method: :link_to_name_facet
385
+
386
+ config.add_component_indexed_terms_field 'places', field: 'places_ssim', link_to_facet: true, separator_options: {
387
+ words_connector: '<br/>',
388
+ two_words_connector: '<br/>',
389
+ last_word_connector: '<br/>'
390
+ }
391
+
392
+ config.add_component_indexed_terms_field 'indexes', field: 'indexes_html_tesm',
393
+ helper_method: :render_html_tags
394
+
395
+ # =================
396
+ # ACCESS TAB FIELDS
397
+ # =================
398
+
399
+ # Collection Show Page Access Tab - Terms and Conditions Section
400
+ config.add_terms_field 'restrictions', field: 'accessrestrict_html_tesm', helper_method: :render_html_tags
401
+ config.add_terms_field 'terms', field: 'userestrict_html_tesm', helper_method: :render_html_tags
402
+
403
+ # Component Show Page Access Tab - Terms and Condition Section
404
+ config.add_component_terms_field 'restrictions', field: 'accessrestrict_html_tesm', helper_method: :render_html_tags
405
+ config.add_component_terms_field 'terms', field: 'userestrict_html_tesm', helper_method: :render_html_tags
406
+ config.add_component_terms_field 'parent_restrictions', field: 'parent_access_restrict_tesm', helper_method: :render_html_tags
407
+ config.add_component_terms_field 'parent_terms', field: 'parent_access_terms_tesm', helper_method: :render_html_tags
408
+
409
+ # Collection and Component Show Page Access Tab - In Person Section
410
+ config.add_in_person_field 'repository_location', values: ->(_, document, _) { document.repository_config }, component: Arclight::RepositoryLocationComponent
411
+ config.add_in_person_field 'before_you_visit', values: ->(_, document, _) { document.repository_config&.visit_note }
412
+
413
+ # Collection and Component Show Page Access Tab - How to Cite Section
414
+ config.add_cite_field 'prefercite', field: 'prefercite_html_tesm', helper_method: :render_html_tags
415
+
416
+ # Collection and Component Show Page Access Tab - Contact Section
417
+ config.add_contact_field 'repository_contact', values: ->(_, document, _) { document.repository_config&.contact }
418
+
419
+ # Group header values
420
+ config.add_group_header_field 'abstract_or_scope', accessor: true, truncate: true, helper_method: :render_html_tags
421
+ end
422
+ end
@@ -0,0 +1,25 @@
1
+ #
2
+ # downloads.yml - Use the EAD's <unitid> as the primary key and
3
+ # provide the PDF and/or EAD (.xml) links. The
4
+ # size value should be a String (shown as-is) or
5
+ # the number of bytes in the download.
6
+ # - Pass a template key to use a formatted string
7
+ # which interpolates document accessors into the
8
+ # url using the %{accessor} syntax.
9
+ # - Pass a size_accessor key to pull the size of
10
+ # the file from an accessor in the solr document
11
+ #
12
+ sample_unitid:
13
+ pdf:
14
+ href: 'http://example.com/sample.pdf'
15
+ size: '1.23MB'
16
+ ead:
17
+ href: 'http://example.com/sample.xml'
18
+ size: 123456
19
+ # size_accessor: 'level'
20
+ default:
21
+ disabled: true
22
+ pdf:
23
+ template: 'http://example.com/%{unitid}.pdf'
24
+ ead:
25
+ template: 'http://example.com/%{unitid}.xml'
@@ -0,0 +1,61 @@
1
+ en:
2
+ blacklight:
3
+ search:
4
+ fields:
5
+ abstract: Abstract
6
+ creators: Creator
7
+ extent: Extent
8
+ language: Language
9
+ prefercite: Preferred citation
10
+
11
+ scopecontent: Scope and content
12
+ bioghist: Biographical / historical
13
+ acqinfo: Acquisition information
14
+ appraisal: Appraisal information
15
+ custodhist: Custodial history
16
+ processinfo: Processing information
17
+ arrangement: Arrangement
18
+ accruals: Accruals
19
+ phystech: Physical / technical requirements
20
+ physloc: Physical location
21
+ physdesc: Physical description
22
+ physfacet: Physical facet
23
+ dimensions: Dimensions
24
+ indexes: Indexes
25
+ descrules: Rules or conventions
26
+
27
+ relatedmaterial: Related material
28
+ separatedmaterial: Separated material
29
+ otherfindaid: Other finding aids
30
+ altformavail: Alternative form available
31
+ originalsloc: Location of originals
32
+ materialspec: Material specific details
33
+ fileplan: File plan
34
+ odd: Other descriptive data
35
+ note: Note
36
+
37
+ access_subjects: Subjects
38
+ names_coll: Names
39
+ places: Places
40
+
41
+ containers: Containers
42
+ names: Names
43
+
44
+ restrictions: Restrictions
45
+ terms: Terms of access
46
+ parent_restrictions: Parent restrictions
47
+ parent_terms: Parent terms of access
48
+ repository_location: Location of this collection
49
+ before_you_visit: Before you visit
50
+ repository_contact: Contact
51
+
52
+ facet:
53
+ collection: Collection
54
+ creator: Creator
55
+ date_range: Date range
56
+ level: Level
57
+ names: Names
58
+ repository: Repository
59
+ place: Place
60
+ subject: Subject
61
+ access: Access
@@ -0,0 +1,53 @@
1
+ nlm:
2
+ name: 'National Library of Medicine. History of Medicine Division'
3
+ description: 'NLM’s History of Medicine Division collects, preserves, makes available, and interprets for diverse audiences one of the world’s richest collections of historical material related to human health and disease.'
4
+ contact_html: |
5
+ <div class="al-repository-contact-info"><a href="mailto:hmdref@nlm.nih.gov">hmdref@nlm.nih.gov</a></div>
6
+ location_html: |
7
+ <div class="al-repository-street-address-building">Building 38, Room 1E-21</div>
8
+ <div class="al-repository-street-address-address1">8600 Rockville Pike</div>
9
+ <div class="al-repository-street-address-city_state_zip_country">Bethesda, MD 20894, USA</div>
10
+ thumbnail_url: "https://upload.wikimedia.org/wikipedia/commons/thumb/8/8b/United_States_National_Library_of_Medicine_1999.jpg/500px-United_States_National_Library_of_Medicine_1999.jpg"
11
+ request_types:
12
+ google_form:
13
+ request_url: 'https://docs.google.com/a/stanford.edu/forms/d/e/1FAIpQLSeOamhY_IcFw4sPnz0ddwWWkrPaHbM5wp7JVbOLOL_mIusEyw/viewform'
14
+ request_mappings: "document_url=entry.1980510262&collection_name=entry.619150170&collection_creator=entry.14428541&eadid=entry.996397105&containers=entry.1125277048&title=entry.862815208"
15
+
16
+ sul-spec:
17
+ name: 'Stanford University Libraries. Special Collections and University Archives'
18
+ visit_note: 'Special Collections and University Archives materials are stored offsite and must be paged 36 hours in advance.'
19
+ description: 'The Special Collections and University Archives Department of Stanford University Libraries is committed to acquiring, preserving, and providing access to primary source materials that support the research needs of the Stanford community and beyond. There are three distinct divisions in our department: Manuscripts, Rare Books and University Archives. We welcome all students, scholars and members of the general public to the Field Reading Room. Learn more about using and accessing our collections.'
20
+ contact_html: |
21
+ <div class="al-repository-contact-phone">(650) 725-1022</div>
22
+ <div class="al-repository-contact-info"><a href="mailto:specialcollections@stanford.edu">specialcollections@stanford.edu</a></div>
23
+ location_html: |
24
+ <div class="al-repository-street-address-building">Green Library</div>
25
+ <div class="al-repository-street-address-address1">557 Escondido Mall</div>
26
+ <div class="al-repository-street-address-city_state_zip_country">Stanford, CA 94305, USA</div>
27
+ thumbnail_url: 'https://upload.wikimedia.org/wikipedia/commons/thumb/2/2b/Stanford_University_Green_Library_Bing_Wing.jpg/500px-Stanford_University_Green_Library_Bing_Wing.jpg'
28
+ request_types:
29
+ aeon_web_ead:
30
+ request_url: 'https://sample.request.com'
31
+ request_mappings: 'Action=10&Form=31&Value=ead_url'
32
+
33
+ umich-bhl:
34
+ name: 'University of Michigan. Bentley Historical Library'
35
+ description: 'The Bentley Historical Library collects the materials for and promotes the study of the histories of two great, intertwined institutions, the State of Michigan and the University of Michigan. The Library is open without fee to the public, and we welcome researchers regardless of academic or professional affiliation.'
36
+ contact_html: |
37
+ <div class="al-repository-contact-info"><a href="mailto:bentley.ref@umich.edu">bentley.ref@umich.edu</a></div>
38
+ location_html: |
39
+ <div class="al-repository-street-address-address1">1150 Beal Ave</div>
40
+ <div class="al-repository-street-address-city_state_zip_country">Ann Arbor, MI 48109-2113, USA</div>
41
+ thumbnail_url: 'https://upload.wikimedia.org/wikipedia/commons/thumb/9/93/Bhlexterior.jpg/150px-Bhlexterior.jpg'
42
+ request_types:
43
+ aeon_external_request_endpoint:
44
+ request_url: https://example.com/aeon/aeon.dll
45
+ request_mappings:
46
+ url_params:
47
+ Action: 11
48
+ Type: 200
49
+ static:
50
+ SystemId: ArcLight
51
+ ItemInfo1: manuscript
52
+ accessor:
53
+ ItemTitle: collection_name
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'generators/arclight/install_generator'
4
+
5
+ module Arclight
6
+ ##
7
+ # Arclight Update generator. This subclasses the Install generator, so this is
8
+ # intended to override behavior in the install generator that can allow the
9
+ # downstream application to choose if they want to take our changes or not and
10
+ # can choose to see a diff of our changes to help them decide.
11
+ class Update < Arclight::Install
12
+ source_root File.expand_path('templates', __dir__)
13
+
14
+ def create_blacklight_catalog
15
+ copy_file 'catalog_controller.rb', 'app/controllers/catalog_controller.rb'
16
+ end
17
+
18
+ def solr_config
19
+ directory '../../../../solr', 'solr'
20
+ end
21
+ end
22
+ end