arclight 1.0.1 → 1.1.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.
- checksums.yaml +4 -4
- data/.solr_wrapper +0 -3
- data/app/assets/stylesheets/arclight/application.scss +1 -0
- data/app/assets/stylesheets/arclight/modules/layout.scss +5 -5
- data/app/assets/stylesheets/arclight/modules/search_form.scss +9 -0
- data/app/assets/stylesheets/arclight/modules/truncator.scss +2 -0
- data/app/components/arclight/bookmark_component.html.erb +1 -1
- data/app/components/arclight/breadcrumb_component.rb +1 -1
- data/app/components/arclight/breadcrumbs_hierarchy_component.html.erb +2 -2
- data/app/components/arclight/document_collection_hierarchy_component.html.erb +8 -4
- data/app/components/arclight/document_component.html.erb +1 -1
- data/app/components/arclight/document_components_hierarchy_component.html.erb +2 -2
- data/app/components/arclight/group_component.html.erb +6 -2
- data/app/components/arclight/index_metadata_field_component.html.erb +1 -2
- data/app/components/arclight/search_bar_component.html.erb +3 -1
- data/app/components/arclight/search_bar_component.rb +1 -1
- data/app/components/arclight/search_result_breadcrumbs_component.html.erb +6 -3
- data/app/components/arclight/search_result_title_component.html.erb +3 -1
- data/app/helpers/arclight/ead_format_helpers.rb +87 -0
- data/app/helpers/arclight_helper.rb +11 -0
- data/app/models/arclight/parent.rb +0 -10
- data/app/models/concerns/arclight/solr_document.rb +9 -4
- data/app/views/catalog/_document_list.html.erb +8 -0
- data/app/views/catalog/_group.html.erb +1 -1
- data/arclight.gemspec +0 -1
- data/lib/arclight/normalized_date.rb +5 -10
- data/lib/arclight/traject/ead2_component_config.rb +54 -13
- data/lib/arclight/traject/ead2_config.rb +46 -14
- data/lib/arclight/version.rb +1 -1
- data/lib/generators/arclight/install_generator.rb +1 -1
- data/lib/generators/arclight/templates/catalog_controller.rb +47 -5
- data/lib/generators/arclight/templates/config/locales/arclight.en.yml +9 -0
- data/lib/generators/arclight/templates/config/repositories.yml +2 -2
- data/package.json +1 -1
- data/solr/conf/schema.xml +7 -1
- data/solr/conf/solrconfig.xml +59 -44
- data/template.rb +5 -5
- metadata +5 -17
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: '0060929ca8a027d2a87b11cafdde627b697a89bf74f730afa56df065b306888a'
|
|
4
|
+
data.tar.gz: 0b563a21799214597af797f4a4cfb64ad2d2e4ea30143a99450cea4f53560db4
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: fc7cea71a4cf57660c9d1779a90fa45cb1f38073e477a81f43782dd236028f4a5f536ae699ecec3b5a07048466c1ab738d96d6e5fdbb236c5e877816cc3c5878
|
|
7
|
+
data.tar.gz: 837319216ebcf25d60170bf9066bb6f7c6ce8a0b2459e128e763ff51b733e708285900cc2f4966d09ceb4cfa73f20c020a9b552b7b33da9613a28bcd0492c135
|
data/.solr_wrapper
CHANGED
|
@@ -3,6 +3,3 @@
|
|
|
3
3
|
collection:
|
|
4
4
|
dir: solr/conf/
|
|
5
5
|
name: blacklight-core
|
|
6
|
-
|
|
7
|
-
# Added as workaround for https://github.com/cbeer/solr_wrapper/issues/150
|
|
8
|
-
checksum: 1ff1bd22255b0ae5a1ade1d03596c1f35d4fa69fa1a16e823eaa554b30ba1311f031af6e1f95a94dbdd3a1dbf308eeb068e7303b74f83584a8bb443505078cbb
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
padding-bottom: $spacer;
|
|
10
10
|
margin-bottom: $spacer * .75;
|
|
11
11
|
width: 100%;
|
|
12
|
-
|
|
12
|
+
|
|
13
13
|
$bent-arrow: "data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='20' height='15'><path fill-rule='evenodd' d='M1.5 1.5A.5.5 0 0 0 1 2v4.8a2.5 2.5 0 0 0 2.5 2.5h9.793l-3.347 3.346a.5.5 0 0 0 .708.708l4.2-4.2a.5.5 0 0 0 0-.708l-4-4a.5.5 0 0 0-.708.708L13.293 8.3H3.5A1.5 1.5 0 0 1 2 6.8V2a.5.5 0 0 0-.5-.5z'></path></svg>";
|
|
14
14
|
|
|
15
15
|
.breadcrumb {
|
|
@@ -131,11 +131,11 @@
|
|
|
131
131
|
}
|
|
132
132
|
}
|
|
133
133
|
|
|
134
|
-
svg.bi {
|
|
134
|
+
svg.bi {
|
|
135
135
|
vertical-align: text-bottom;
|
|
136
136
|
color: $light-icon-color;
|
|
137
137
|
}
|
|
138
|
-
|
|
138
|
+
|
|
139
139
|
.dropdown-item svg.bi {
|
|
140
140
|
color: $dark-icon-color;
|
|
141
141
|
}
|
|
@@ -144,7 +144,7 @@
|
|
|
144
144
|
.bookmark-toggle {
|
|
145
145
|
display: inline;
|
|
146
146
|
margin-left: 1em;
|
|
147
|
-
|
|
147
|
+
|
|
148
148
|
.toggle-bookmark {
|
|
149
149
|
display: inline;
|
|
150
150
|
margin-bottom: 0;
|
|
@@ -177,7 +177,7 @@ dl.deflist dt {
|
|
|
177
177
|
text-align: left;
|
|
178
178
|
}
|
|
179
179
|
|
|
180
|
-
.chronlist-head, .list-head {
|
|
180
|
+
.chronlist-head, .list-head, .index-head, .table-head {
|
|
181
181
|
caption-side: top;
|
|
182
182
|
font-size: 1.25rem;
|
|
183
183
|
font-weight: 500;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// Original style comes from https://github.com/twbs/bootstrap/blob/v5.3.2/scss/_dropdown.scss#L184
|
|
2
|
+
// via https://github.com/projectblacklight/blacklight/blob/v8.1.0/app/assets/stylesheets/blacklight/_search_form.scss#L25
|
|
3
|
+
.input-group > .search-autocomplete-wrapper {
|
|
4
|
+
ul {
|
|
5
|
+
li {
|
|
6
|
+
white-space: normal;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
}
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
}) do %>
|
|
12
12
|
<div class="checkbox toggle-bookmark">
|
|
13
13
|
<label class="toggle-bookmark" data-checkboxsubmit-target="label">
|
|
14
|
-
<input type="checkbox" class="toggle-bookmark" data-checkboxsubmit-target="checkbox"
|
|
14
|
+
<input type="checkbox" class="toggle-bookmark" data-checkboxsubmit-target="checkbox" <%= 'checked="checked"' if bookmarked? %>>
|
|
15
15
|
<span data-checkboxsubmit-target="span"><%= bookmarked? ? "#{blacklight_icon(:bookmark).html_safe}<span class=\"sr-only visually-hidden\">#{t('blacklight.search.bookmarks.present')}</span>".html_safe : "#{blacklight_icon(:bookmark).html_safe}<span class=\"sr-only visually-hidden\">#{t('blacklight.search.bookmarks.absent')}</span>".html_safe %></span>
|
|
16
16
|
</label>
|
|
17
17
|
</div>
|
|
@@ -29,7 +29,7 @@ module Arclight
|
|
|
29
29
|
yield build_repository_link
|
|
30
30
|
|
|
31
31
|
@document.parents.each do |parent|
|
|
32
|
-
yield tag.li(class: 'breadcrumb-item') { link_to(parent.label, solr_document_path(parent.
|
|
32
|
+
yield tag.li(class: 'breadcrumb-item') { link_to(parent.label, solr_document_path(parent.id)) }
|
|
33
33
|
end
|
|
34
34
|
end
|
|
35
35
|
|
|
@@ -9,12 +9,12 @@
|
|
|
9
9
|
<% if collection %>
|
|
10
10
|
<li class="breadcrumb-item breadcrumb-item-2">
|
|
11
11
|
<span aria-hidden="true"><%= blacklight_icon :collection, classes: 'al-collection-content-icon' %></span>
|
|
12
|
-
<span class="breadcrumb-text"><%= link_to collection.label, solr_document_path(collection.
|
|
12
|
+
<span class="breadcrumb-text"><%= link_to collection.label, solr_document_path(collection.id) %></span>
|
|
13
13
|
|
|
14
14
|
<ol class="breadcrumb">
|
|
15
15
|
<% parents_under_collection.each do |parent| %>
|
|
16
16
|
<li class="breadcrumb-item breadcrumb-item-3">
|
|
17
|
-
<span class="breadcrumb-text"><%= link_to parent.label, solr_document_path(parent.
|
|
17
|
+
<span class="breadcrumb-text"><%= link_to parent.label, solr_document_path(parent.id) %></span>
|
|
18
18
|
</li>
|
|
19
19
|
<% end %>
|
|
20
20
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<%= content_tag :li,
|
|
2
|
-
id: @document.id,
|
|
2
|
+
id: "#{@document.id}-hierarchy-item",
|
|
3
3
|
data: {
|
|
4
4
|
'document-id': @document.id.to_s.parameterize,
|
|
5
5
|
'document-counter': @counter,
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
<div class="documentHeader" data-document-id="<%= document.id %>">
|
|
11
11
|
<% if document.children? %>
|
|
12
12
|
<%= link_to('',
|
|
13
|
-
"
|
|
13
|
+
"#collapsible-hierarchy-#{document.id}",
|
|
14
14
|
class: "al-toggle-view-children#{ ' collapsed' unless show_expanded?}",
|
|
15
15
|
aria: {
|
|
16
16
|
label: t('arclight.hierarchy.view_all'),
|
|
@@ -24,7 +24,11 @@
|
|
|
24
24
|
%>
|
|
25
25
|
<% end %>
|
|
26
26
|
<div class="index_title document-title-heading" data-turbo="false">
|
|
27
|
-
|
|
27
|
+
<% if current_target? %>
|
|
28
|
+
<%= document.normalized_title %>
|
|
29
|
+
<% else %>
|
|
30
|
+
<%= helpers.link_to_document document, counter: @counter %>
|
|
31
|
+
<% end %>
|
|
28
32
|
<% if document.children? %>
|
|
29
33
|
<span class="badge badge-pill bg-secondary badge-secondary al-number-of-children-badge"><%= document.number_of_children %><span class="sr-only visually-hidden"><%= t(:'arclight.views.index.number_of_components', count: document.number_of_children) %></span></span>
|
|
30
34
|
<% end %>
|
|
@@ -37,7 +41,7 @@
|
|
|
37
41
|
|
|
38
42
|
<%= render Arclight::IndexMetadataFieldComponent.with_collection(@presenter&.field_presenters.select { |field| field.field_config.collection_context }, classes: ['col pl-0 my-0']) %>
|
|
39
43
|
<% if document.number_of_children > 0 %>
|
|
40
|
-
<%= content_tag(:div, id: "
|
|
44
|
+
<%= content_tag(:div, id: "collapsible-hierarchy-#{document.id}",
|
|
41
45
|
class: "collapse al-collection-context-collapsible al-hierarchy-level-#{document.component_level} #{'show' if show_expanded?}"
|
|
42
46
|
) do %>
|
|
43
47
|
<%= render Arclight::DocumentComponentsHierarchyComponent.new(document: @document, target_index: target_index) %>
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
<% elsif document.children? %>
|
|
33
33
|
<div id="contents">
|
|
34
34
|
<h2 class="al-show-sub-heading"><%= t 'arclight.views.show.contents' %></h2>
|
|
35
|
-
<%= helpers.turbo_frame_tag "al-hierarchy-#{document.id}", loading: 'lazy', src: helpers.hierarchy_solr_document_path(id: document.id, paginate: true, per_page: 50) %>
|
|
35
|
+
<%= helpers.turbo_frame_tag "al-hierarchy-#{document.id}-document", loading: 'lazy', src: helpers.hierarchy_solr_document_path(id: document.id, paginate: true, key: '-document', per_page: 50) %>
|
|
36
36
|
</div>
|
|
37
37
|
<% end %>
|
|
38
38
|
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
<% end %>
|
|
19
19
|
<% elsif paginate? %>
|
|
20
20
|
<%# render the first N documents, and let the user expand the remaining if desired %>
|
|
21
|
-
<%= helpers.turbo_frame_tag "al-hierarchy-#{@document.id}", loading: ('lazy' unless @target_index >= 0), src: hierarchy_path(limit: @maximum_left_gap) %>
|
|
21
|
+
<%= helpers.turbo_frame_tag "al-hierarchy-#{@document.id}-sidebar", loading: ('lazy' unless @target_index >= 0), src: hierarchy_path(limit: @maximum_left_gap, key: '-sidebar') %>
|
|
22
22
|
<%= tag.turbo_frame id: "al-hierarchy-#{@document.id}-right" do %>
|
|
23
23
|
<ul>
|
|
24
24
|
<li>
|
|
@@ -28,5 +28,5 @@
|
|
|
28
28
|
<% end %>
|
|
29
29
|
<% else %>
|
|
30
30
|
<%# there aren't enough to bother paginating, so load them all at once %>
|
|
31
|
-
<%= helpers.turbo_frame_tag "al-hierarchy-#{@document.id}", loading: ('lazy' unless @target_index >= 0), src: hierarchy_path %>
|
|
31
|
+
<%= helpers.turbo_frame_tag "al-hierarchy-#{@document.id}-sidebar", loading: ('lazy' unless @target_index >= 0), src: hierarchy_path(key: '-sidebar') %>
|
|
32
32
|
<% end %>
|
|
@@ -7,8 +7,12 @@
|
|
|
7
7
|
</div>
|
|
8
8
|
<% end %>
|
|
9
9
|
<h3><%= helpers.link_to_document document %></h3>
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
<% document.extent.each do |extent| %>
|
|
11
|
+
<%= tag.span extent, class: 'al-document-extent badge' unless compact? %>
|
|
12
|
+
<% end %>
|
|
13
|
+
<dl>
|
|
14
|
+
<%= render Arclight::IndexMetadataFieldComponent.with_collection(presenter.field_presenters.select { |field| !compact? || field.field_config.compact }) %>
|
|
15
|
+
</dl>
|
|
12
16
|
</div>
|
|
13
17
|
</div>
|
|
14
18
|
</div>
|
|
@@ -4,8 +4,7 @@
|
|
|
4
4
|
<%= tag.dd(class: @classes + ['truncator'], data: { controller: 'arclight-truncate' }) do %>
|
|
5
5
|
<%= tag.div @field.render, class: 'content', data: { arclight_truncate_target: 'content' } %>
|
|
6
6
|
<%= button_tag(type: :button, class: 'btn btn-sm btn-link px-0',
|
|
7
|
-
data: { action: 'click->arclight-truncate#trigger' }
|
|
8
|
-
aria: { hidden: true }) do %>
|
|
7
|
+
data: { action: 'click->arclight-truncate#trigger' }) do %>
|
|
9
8
|
<%= tag.span t('arclight.truncation.view_more'), class: 'view-more' %>
|
|
10
9
|
<%= tag.span t('arclight.truncation.view_less'), class: 'view-less' %>
|
|
11
10
|
<%= tag.span(class: 'icon') %>
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
<%= render(Blacklight::SearchBarComponent.new(
|
|
2
2
|
**@kwargs,
|
|
3
|
-
params: @params.merge(f: (@params[:f] || {}).except(:collection))
|
|
3
|
+
params: @params.merge(f: (@params[:f] || {}).except(:collection)),
|
|
4
|
+
q: @q,
|
|
5
|
+
search_field: @search_field)) do |c| %>
|
|
4
6
|
|
|
5
7
|
<% c.with_before_input_group do %>
|
|
6
8
|
<div class="input-group within-collection-dropdown">
|
|
@@ -25,7 +25,7 @@ module Arclight
|
|
|
25
25
|
end
|
|
26
26
|
|
|
27
27
|
def collection_name
|
|
28
|
-
@collection_name ||= Array(@params.dig(:f, :collection)).first ||
|
|
28
|
+
@collection_name ||= Array(@params.dig(:f, :collection)).reject(&:empty?).first ||
|
|
29
29
|
helpers.current_context_document&.collection_name
|
|
30
30
|
end
|
|
31
31
|
end
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
<header class="documentHeader row" data-document-id="<%= @document.id %>">
|
|
2
2
|
<h3 class="index_title document-title-heading col">
|
|
3
3
|
<%= helpers.link_to_document @document, counter: @counter %>
|
|
4
|
-
|
|
4
|
+
<% @document.extent.each do |extent| %>
|
|
5
|
+
<%= tag.span extent, class: 'al-document-extent badge' unless compact? %>
|
|
6
|
+
<% end %>
|
|
5
7
|
<%= tag.span class: 'al-document-container text-muted ml-auto' do %>
|
|
6
8
|
<%= @document.containers.join(', ') %>
|
|
7
9
|
<% end if @document.containers.present? %>
|
|
@@ -23,13 +23,34 @@ module Arclight
|
|
|
23
23
|
.scrub!(:strip).to_html
|
|
24
24
|
end
|
|
25
25
|
|
|
26
|
+
# rubocop:disable Metrics/AbcSize
|
|
26
27
|
def ead_to_html_scrubber
|
|
27
28
|
Loofah::Scrubber.new do |node|
|
|
28
29
|
format_render_attributes(node) if node.attr('render').present?
|
|
30
|
+
convert_to_span(node) if CONVERT_TO_SPAN_TAGS.include? node.name
|
|
31
|
+
convert_to_br(node) if CONVERT_TO_BR_TAG.include? node.name
|
|
32
|
+
format_links(node) if %w[extptr extref extrefloc ptr ref].include? node.name
|
|
29
33
|
format_lists(node) if %w[list chronlist].include? node.name
|
|
34
|
+
format_indexes(node) if node.name == 'index'
|
|
35
|
+
format_tables(node) if node.name == 'table'
|
|
30
36
|
node
|
|
31
37
|
end
|
|
32
38
|
end
|
|
39
|
+
# rubocop:enable Metrics/AbcSize
|
|
40
|
+
|
|
41
|
+
# Tags that should be converted to <span> tags because of formatting conflicts between XML and HTML
|
|
42
|
+
CONVERT_TO_SPAN_TAGS = ['title'].freeze
|
|
43
|
+
|
|
44
|
+
# Tags that should be converted to HTML <br/> tags
|
|
45
|
+
CONVERT_TO_BR_TAG = ['lb'].freeze
|
|
46
|
+
|
|
47
|
+
def convert_to_span(node)
|
|
48
|
+
node.name = 'span'
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
def convert_to_br(node)
|
|
52
|
+
node.name = 'br'
|
|
53
|
+
end
|
|
33
54
|
|
|
34
55
|
def condense_whitespace(str)
|
|
35
56
|
str.squish.strip.gsub(/>[\n\s]+</, '><')
|
|
@@ -91,6 +112,17 @@ module Arclight
|
|
|
91
112
|
end
|
|
92
113
|
end
|
|
93
114
|
|
|
115
|
+
def format_links(node)
|
|
116
|
+
node.remove_attribute('target')
|
|
117
|
+
node.remove_attribute('type')
|
|
118
|
+
if %w[extptr extref extrefloc].include? node.name
|
|
119
|
+
node['target'] = '_blank'
|
|
120
|
+
node['class'] = 'external-link'
|
|
121
|
+
end
|
|
122
|
+
node.content = node['title'] if (%w[extptr ptr].include? node.name) && node['title'].present?
|
|
123
|
+
node.name = 'a' if node['href'].present?
|
|
124
|
+
end
|
|
125
|
+
|
|
94
126
|
def format_lists(node)
|
|
95
127
|
format_simple_lists(node) if node.name == 'list' && node['type'] != 'deflist'
|
|
96
128
|
format_deflists(node) if node.name == 'list' && node['type'] == 'deflist'
|
|
@@ -218,5 +250,60 @@ module Arclight
|
|
|
218
250
|
end
|
|
219
251
|
multi_events.each { |event_node| event_node.name = 'div' }
|
|
220
252
|
end
|
|
253
|
+
|
|
254
|
+
# Format EAD <index> elements
|
|
255
|
+
def format_indexes(node)
|
|
256
|
+
index_head = node.at_css('head')
|
|
257
|
+
index_head&.name = 'h3'
|
|
258
|
+
index_head&.add_class('index-head')
|
|
259
|
+
index_head['id'] = ['index-', index_head.text].join.parameterize if index_head.present?
|
|
260
|
+
format_indexentries(node)
|
|
261
|
+
node.name = 'div'
|
|
262
|
+
end
|
|
263
|
+
|
|
264
|
+
# Grab all of the <indexentry> children as a nodeset, move them into
|
|
265
|
+
# a <table>, wrap each entry in a <tr> & each value in a <td>.
|
|
266
|
+
def format_indexentries(node)
|
|
267
|
+
indexentries = node.css('indexentry')
|
|
268
|
+
return if indexentries.blank?
|
|
269
|
+
|
|
270
|
+
indexentries.first.previous = '<table class="table indexentries" />'
|
|
271
|
+
indexentries.map do |i|
|
|
272
|
+
i.parent = node.at_css('table.table.indexentries')
|
|
273
|
+
i.wrap('<tr/>')
|
|
274
|
+
i.element_children.map { |c| c.wrap('<td/>') }
|
|
275
|
+
# Assuming two columns in an index, create a blank cell for entries
|
|
276
|
+
# with a missing value.
|
|
277
|
+
i.add_child('<td/>') if i.element_children.count == 1
|
|
278
|
+
end
|
|
279
|
+
end
|
|
280
|
+
|
|
281
|
+
# Format EAD <table> elements, converting <tgroup> to HTML <table>.
|
|
282
|
+
# Ignoring <colspec>, @colname, @colwidth complex rendering
|
|
283
|
+
# logic for now.
|
|
284
|
+
# rubocop:disable Metrics/AbcSize, Metrics/MethodLength
|
|
285
|
+
def format_tables(node)
|
|
286
|
+
node.remove_attribute('frame')
|
|
287
|
+
node.name = 'div' if node.css('tgroup').present?
|
|
288
|
+
format_table_head(node)
|
|
289
|
+
tgroups = node.css('tgroup')
|
|
290
|
+
tgroups&.map do |t|
|
|
291
|
+
t.name = 'table'
|
|
292
|
+
t.remove_attribute('cols')
|
|
293
|
+
t.add_class('table')
|
|
294
|
+
t.css('row').map { |r| r.name = 'tr' }
|
|
295
|
+
t.css('thead entry').map { |e| e.name = 'th' }
|
|
296
|
+
t.css('tbody entry').map { |e| e.name = 'td' }
|
|
297
|
+
end
|
|
298
|
+
end
|
|
299
|
+
# rubocop:enable Metrics/AbcSize, Metrics/MethodLength
|
|
300
|
+
|
|
301
|
+
def format_table_head(node)
|
|
302
|
+
table_head = node.at_css('head')
|
|
303
|
+
return if table_head.blank?
|
|
304
|
+
|
|
305
|
+
table_head.name = 'h3'
|
|
306
|
+
table_head.add_class('table-head')
|
|
307
|
+
end
|
|
221
308
|
end
|
|
222
309
|
end
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
module ArclightHelper
|
|
6
6
|
include Arclight::EadFormatHelpers
|
|
7
7
|
include Arclight::FieldConfigHelpers
|
|
8
|
+
include Blacklight::DocumentHelperBehavior
|
|
8
9
|
include Blacklight::LayoutHelperBehavior
|
|
9
10
|
|
|
10
11
|
def repository_collections_path(repository)
|
|
@@ -91,6 +92,16 @@ module ArclightHelper
|
|
|
91
92
|
end
|
|
92
93
|
end
|
|
93
94
|
|
|
95
|
+
##
|
|
96
|
+
# Override of BL core https://github.com/projectblacklight/blacklight/blob/v8.1.0/app/helpers/blacklight/document_helper_behavior.rb#L55
|
|
97
|
+
# Remove document_type check. It isn't a method on arclight documents
|
|
98
|
+
# Check if the document is in the user's bookmarks
|
|
99
|
+
# @param [Blacklight::Document] document
|
|
100
|
+
# @return [Boolean]
|
|
101
|
+
def bookmarked?(document)
|
|
102
|
+
current_bookmarks.any? { |x| x.document_id == document.id }
|
|
103
|
+
end
|
|
104
|
+
|
|
94
105
|
def current_context_document
|
|
95
106
|
@document
|
|
96
107
|
end
|
|
@@ -17,15 +17,5 @@ module Arclight
|
|
|
17
17
|
def collection?
|
|
18
18
|
level == 'collection'
|
|
19
19
|
end
|
|
20
|
-
|
|
21
|
-
##
|
|
22
|
-
# Concatenates the eadid and the id, to return an "id" in the context of
|
|
23
|
-
# Blacklight and Solr
|
|
24
|
-
# @return [String]
|
|
25
|
-
def global_id
|
|
26
|
-
return id if eadid == id
|
|
27
|
-
|
|
28
|
-
"#{eadid}#{id}"
|
|
29
|
-
end
|
|
30
20
|
end
|
|
31
21
|
end
|
|
@@ -7,11 +7,11 @@ module Arclight
|
|
|
7
7
|
extend ActiveSupport::Concern
|
|
8
8
|
|
|
9
9
|
included do
|
|
10
|
-
attribute :parent_ids, :array, '
|
|
10
|
+
attribute :parent_ids, :array, 'parent_ids_ssim'
|
|
11
11
|
attribute :parent_labels, :array, 'parent_unittitles_ssm'
|
|
12
12
|
attribute :parent_levels, :array, 'parent_levels_ssm'
|
|
13
13
|
attribute :unitid, :string, 'unitid_ssm'
|
|
14
|
-
attribute :extent, :
|
|
14
|
+
attribute :extent, :array, 'extent_ssm'
|
|
15
15
|
attribute :abstract, :string, 'abstract_html_tesm'
|
|
16
16
|
attribute :scope, :string, 'scopecontent_html_tesm'
|
|
17
17
|
attribute :creator, :string, 'creator_ssm'
|
|
@@ -111,8 +111,13 @@ module Arclight
|
|
|
111
111
|
end
|
|
112
112
|
|
|
113
113
|
def containers
|
|
114
|
-
# NOTE:
|
|
115
|
-
fetch('containers_ssim', []).
|
|
114
|
+
# NOTE: Keep uppercase characters if present, but upcase the first if not already
|
|
115
|
+
containers_field = fetch('containers_ssim', []).reject(&:empty?)
|
|
116
|
+
return [] if containers_field.blank?
|
|
117
|
+
|
|
118
|
+
containers_field.map do |container|
|
|
119
|
+
container.dup.sub!(/\A./, &:upcase)
|
|
120
|
+
end
|
|
116
121
|
end
|
|
117
122
|
|
|
118
123
|
# @return [Array<String>] with embedded highlights using <em>...</em>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<% # Override to conditionally add id="documents" on div. When documents are grouped it causes duplicate id issues %>
|
|
2
|
+
<% # https://github.com/projectblacklight/blacklight/blob/v8.1.0/app/views/catalog/_document_list.html.erb %>
|
|
3
|
+
<% # container for all documents in index list view -%>
|
|
4
|
+
<% view_config = local_assigns[:view_config] || blacklight_config&.view_config(document_index_view_type) %>
|
|
5
|
+
<div <%= 'id="documents"'.html_safe unless grouped? %> class="al-document-listings documents-<%= view_config&.key || document_index_view_type %>">
|
|
6
|
+
<% document_presenters = documents.map { |doc| document_presenter(doc) } -%>
|
|
7
|
+
<%= render view_config.document_component.with_collection(document_presenters, partials: view_config.partials, counter_offset: @response&.start || 0) %>
|
|
8
|
+
</div>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
<% # container for all groups in index view -%>
|
|
2
|
-
<div class='al-grouped-results'>
|
|
2
|
+
<div id="documents" class='al-grouped-results'>
|
|
3
3
|
<%= render (blacklight_config.view_config(document_index_view_type).group_component || Arclight::GroupComponent).with_collection(@response.groups) %>
|
|
4
4
|
</div>
|
data/arclight.gemspec
CHANGED
|
@@ -39,16 +39,11 @@ module Arclight
|
|
|
39
39
|
|
|
40
40
|
# @see http://www2.archivists.org/standards/DACS/part_I/chapter_2/4_date for rules
|
|
41
41
|
def normalize
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
else
|
|
48
|
-
result = nil
|
|
49
|
-
end
|
|
50
|
-
|
|
51
|
-
result&.strip
|
|
42
|
+
result = []
|
|
43
|
+
result << inclusive if inclusive.present?
|
|
44
|
+
result << other if other.present?
|
|
45
|
+
result << "bulk #{bulk}" if bulk.present?
|
|
46
|
+
result.compact.map(&:strip).join(', ')
|
|
52
47
|
end
|
|
53
48
|
end
|
|
54
49
|
end
|
|
@@ -29,6 +29,7 @@ settings do
|
|
|
29
29
|
provide 'title_normalizer', 'Arclight::NormalizedTitle'
|
|
30
30
|
provide 'reader_class_name', 'Arclight::Traject::NokogiriNamespacelessReader'
|
|
31
31
|
provide 'logger', Logger.new($stderr)
|
|
32
|
+
provide 'component_identifier_format', '%<root_id>s_%<ref_id>s'
|
|
32
33
|
end
|
|
33
34
|
|
|
34
35
|
NAME_ELEMENTS = %w[corpname famname name persname].freeze
|
|
@@ -60,6 +61,7 @@ DID_SEARCHABLE_NOTES_FIELDS = %w[
|
|
|
60
61
|
abstract
|
|
61
62
|
materialspec
|
|
62
63
|
physloc
|
|
64
|
+
note
|
|
63
65
|
].freeze
|
|
64
66
|
|
|
65
67
|
# ==================
|
|
@@ -67,7 +69,9 @@ DID_SEARCHABLE_NOTES_FIELDS = %w[
|
|
|
67
69
|
#
|
|
68
70
|
# NOTE: All fields should be stored in Solr
|
|
69
71
|
# ==================
|
|
70
|
-
to_field 'ref_ssi' do |record, accumulator,
|
|
72
|
+
to_field 'ref_ssi' do |record, accumulator, context|
|
|
73
|
+
next if context.output_hash['ref_ssi']
|
|
74
|
+
|
|
71
75
|
accumulator << if record.attribute('id').blank?
|
|
72
76
|
strategy = Arclight::MissingIdStrategy.selected
|
|
73
77
|
hexdigest = strategy.new(record).to_hexdigest
|
|
@@ -90,10 +94,14 @@ to_field 'ref_ssm' do |_record, accumulator, context|
|
|
|
90
94
|
end
|
|
91
95
|
|
|
92
96
|
to_field 'id' do |_record, accumulator, context|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
+
next if context.output_hash['id']
|
|
98
|
+
|
|
99
|
+
data = {
|
|
100
|
+
root_id: settings[:root].output_hash['id']&.first,
|
|
101
|
+
ref_id: context.output_hash['ref_ssi']&.first
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
accumulator << (settings[:component_identifier_format] % data)
|
|
97
105
|
end
|
|
98
106
|
|
|
99
107
|
to_field 'title_filing_ssi', extract_xpath('./did/unittitle'), first_only
|
|
@@ -131,6 +139,11 @@ to_field 'parent_ssi' do |_record, accumulator, _context|
|
|
|
131
139
|
accumulator.concat settings[:parent].output_hash['ref_ssi'] || settings[:parent].output_hash['id']
|
|
132
140
|
end
|
|
133
141
|
|
|
142
|
+
to_field 'parent_ids_ssim' do |_record, accumulator, _context|
|
|
143
|
+
accumulator.concat(settings[:parent].output_hash['parent_ids_ssim'] || [])
|
|
144
|
+
accumulator.concat settings[:parent].output_hash['id']
|
|
145
|
+
end
|
|
146
|
+
|
|
134
147
|
to_field 'parent_unittitles_ssm' do |_rec, accumulator, _context|
|
|
135
148
|
accumulator.concat(settings[:parent].output_hash['parent_unittitles_ssm'] || [])
|
|
136
149
|
accumulator.concat settings[:parent].output_hash['normalized_title_ssm'] || []
|
|
@@ -155,12 +168,42 @@ to_field 'collection_ssim' do |_record, accumulator, _context|
|
|
|
155
168
|
accumulator.concat settings[:root].output_hash['normalized_title_ssm']
|
|
156
169
|
end
|
|
157
170
|
|
|
158
|
-
|
|
159
|
-
to_field '
|
|
171
|
+
# This accumulates direct text from a physdesc, ignoring child elements handled elsewhere
|
|
172
|
+
to_field 'physdesc_tesim', extract_xpath('./did/physdesc', to_text: false) do |_record, accumulator|
|
|
173
|
+
accumulator.map! do |element|
|
|
174
|
+
physdesc = []
|
|
175
|
+
element.children.map do |child|
|
|
176
|
+
next if child.instance_of?(Nokogiri::XML::Element)
|
|
177
|
+
|
|
178
|
+
physdesc << child.text&.strip unless child.text&.strip&.empty?
|
|
179
|
+
end.flatten
|
|
180
|
+
physdesc.join(' ') unless physdesc.empty?
|
|
181
|
+
end
|
|
182
|
+
end
|
|
183
|
+
|
|
184
|
+
to_field 'extent_ssm' do |record, accumulator|
|
|
185
|
+
physdescs = record.xpath('./did/physdesc')
|
|
186
|
+
extents_per_physdesc = physdescs.map do |physdesc|
|
|
187
|
+
extents = physdesc.xpath('./extent').map { |e| e.text.strip }
|
|
188
|
+
# Join extents within the same physdesc with an empty string
|
|
189
|
+
extents.join(' ') unless extents.empty?
|
|
190
|
+
end
|
|
191
|
+
|
|
192
|
+
# Add each physdesc separately to the accumulator
|
|
193
|
+
accumulator.concat(extents_per_physdesc)
|
|
194
|
+
end
|
|
195
|
+
|
|
196
|
+
to_field 'extent_tesim' do |_record, accumulator, context|
|
|
197
|
+
accumulator.concat context.output_hash['extent_ssm'] || []
|
|
198
|
+
end
|
|
199
|
+
|
|
200
|
+
to_field 'physfacet_tesim', extract_xpath('./did/physdesc/physfacet')
|
|
201
|
+
to_field 'dimensions_tesim', extract_xpath('./did/physdesc/dimensions')
|
|
202
|
+
|
|
203
|
+
to_field 'indexes_html_tesm', extract_xpath('./index', to_text: false)
|
|
204
|
+
to_field 'indexes_tesim', extract_xpath('./index')
|
|
160
205
|
|
|
161
|
-
to_field 'creator_ssm', extract_xpath('./did/origination')
|
|
162
206
|
to_field 'creator_ssim', extract_xpath('./did/origination')
|
|
163
|
-
to_field 'creators_ssim', extract_xpath('./did/origination')
|
|
164
207
|
to_field 'creator_sort' do |record, accumulator|
|
|
165
208
|
accumulator << record.xpath('./did/origination').map(&:text).join(', ')
|
|
166
209
|
end
|
|
@@ -214,7 +257,7 @@ to_field 'digital_objects_ssm', extract_xpath('./dao|./did/dao', to_text: false)
|
|
|
214
257
|
end
|
|
215
258
|
end
|
|
216
259
|
|
|
217
|
-
to_field '
|
|
260
|
+
to_field 'date_range_isim', extract_xpath('./did/unitdate/@normal', to_text: false) do |_record, accumulator|
|
|
218
261
|
range = Arclight::YearRange.new
|
|
219
262
|
next range.years if accumulator.blank?
|
|
220
263
|
|
|
@@ -244,8 +287,6 @@ to_field 'access_subjects_ssm' do |_record, accumulator, context|
|
|
|
244
287
|
accumulator.concat(context.output_hash.fetch('access_subjects_ssim', []))
|
|
245
288
|
end
|
|
246
289
|
|
|
247
|
-
to_field 'acqinfo_ssim', extract_xpath('/ead/archdesc/acqinfo/*[local-name()!="head"]')
|
|
248
|
-
to_field 'acqinfo_ssim', extract_xpath('/ead/archdesc/descgrp/acqinfo/*[local-name()!="head"]')
|
|
249
290
|
to_field 'acqinfo_ssim', extract_xpath('./acqinfo/*[local-name()!="head"]')
|
|
250
291
|
to_field 'acqinfo_ssim', extract_xpath('./descgrp/acqinfo/*[local-name()!="head"]')
|
|
251
292
|
|
|
@@ -264,7 +305,6 @@ end
|
|
|
264
305
|
DID_SEARCHABLE_NOTES_FIELDS.map do |selector|
|
|
265
306
|
to_field "#{selector}_html_tesm", extract_xpath("./did/#{selector}", to_text: false)
|
|
266
307
|
end
|
|
267
|
-
to_field 'did_note_ssm', extract_xpath('./did/note')
|
|
268
308
|
|
|
269
309
|
# =============================
|
|
270
310
|
# Each component child document
|
|
@@ -280,6 +320,7 @@ to_field 'components' do |record, accumulator, context|
|
|
|
280
320
|
provide :counter, context.settings[:counter]
|
|
281
321
|
provide :depth, context.settings[:depth].to_i + 1
|
|
282
322
|
provide :component_traject_config, context.settings[:component_traject_config]
|
|
323
|
+
provide :component_identifier_format, context.settings[:component_identifier_format]
|
|
283
324
|
end
|
|
284
325
|
|
|
285
326
|
i.load_config_file(context.settings[:component_traject_config])
|
|
@@ -48,14 +48,17 @@ DID_SEARCHABLE_NOTES_FIELDS = %w[
|
|
|
48
48
|
abstract
|
|
49
49
|
materialspec
|
|
50
50
|
physloc
|
|
51
|
+
note
|
|
51
52
|
].freeze
|
|
52
53
|
|
|
53
54
|
settings do
|
|
55
|
+
provide 'component_traject_config', File.join(__dir__, 'ead2_component_config.rb')
|
|
56
|
+
provide 'date_normalizer', 'Arclight::NormalizedDate'
|
|
57
|
+
provide 'title_normalizer', 'Arclight::NormalizedTitle'
|
|
54
58
|
provide 'reader_class_name', 'Arclight::Traject::NokogiriNamespacelessReader'
|
|
55
59
|
provide 'solr_writer.commit_on_close', 'true'
|
|
56
60
|
provide 'repository', ENV.fetch('REPOSITORY_ID', nil)
|
|
57
61
|
provide 'logger', Logger.new($stderr)
|
|
58
|
-
provide 'component_traject_config', File.join(__dir__, 'ead2_component_config.rb')
|
|
59
62
|
end
|
|
60
63
|
|
|
61
64
|
each_record do |_record, context|
|
|
@@ -100,22 +103,18 @@ end
|
|
|
100
103
|
to_field 'unitid_ssm', extract_xpath('/ead/archdesc/did/unitid')
|
|
101
104
|
to_field 'unitid_tesim', extract_xpath('/ead/archdesc/did/unitid')
|
|
102
105
|
|
|
103
|
-
to_field '
|
|
104
|
-
|
|
106
|
+
to_field 'normalized_date_ssm' do |_record, accumulator, context|
|
|
107
|
+
accumulator << settings['date_normalizer'].constantize.new(
|
|
105
108
|
context.output_hash['unitdate_inclusive_ssm'],
|
|
106
109
|
context.output_hash['unitdate_bulk_ssim'],
|
|
107
110
|
context.output_hash['unitdate_other_ssim']
|
|
108
111
|
).to_s
|
|
109
|
-
title = context.output_hash['title_ssm'].first
|
|
110
|
-
accumulator << Arclight::NormalizedTitle.new(title, dates).to_s
|
|
111
112
|
end
|
|
112
113
|
|
|
113
|
-
to_field '
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
context.output_hash['unitdate_other_ssim']
|
|
118
|
-
).to_s
|
|
114
|
+
to_field 'normalized_title_ssm' do |_record, accumulator, context|
|
|
115
|
+
title = context.output_hash['title_ssm']&.first
|
|
116
|
+
date = context.output_hash['normalized_date_ssm']&.first
|
|
117
|
+
accumulator << settings['title_normalizer'].constantize.new(title, date).to_s
|
|
119
118
|
end
|
|
120
119
|
|
|
121
120
|
to_field 'collection_title_tesim' do |_record, accumulator, context|
|
|
@@ -185,11 +184,41 @@ to_field 'digital_objects_ssm', extract_xpath('/ead/archdesc/did/dao|/ead/archde
|
|
|
185
184
|
end
|
|
186
185
|
end
|
|
187
186
|
|
|
188
|
-
|
|
189
|
-
to_field '
|
|
187
|
+
# This accumulates direct text from a physdesc, ignoring child elements handled elsewhere
|
|
188
|
+
to_field 'physdesc_tesim', extract_xpath('/ead/archdesc/did/physdesc', to_text: false) do |_record, accumulator|
|
|
189
|
+
accumulator.map! do |element|
|
|
190
|
+
physdesc = []
|
|
191
|
+
element.children.map do |child|
|
|
192
|
+
next if child.instance_of?(Nokogiri::XML::Element)
|
|
193
|
+
|
|
194
|
+
physdesc << child.text&.strip unless child.text&.strip&.empty?
|
|
195
|
+
end.flatten
|
|
196
|
+
physdesc.join(' ') unless physdesc.empty?
|
|
197
|
+
end
|
|
198
|
+
end
|
|
199
|
+
|
|
200
|
+
to_field 'extent_ssm' do |record, accumulator|
|
|
201
|
+
physdescs = record.xpath('/ead/archdesc/did/physdesc')
|
|
202
|
+
extents_per_physdesc = physdescs.map do |physdesc|
|
|
203
|
+
extents = physdesc.xpath('./extent').map { |e| e.text.strip }
|
|
204
|
+
# Join extents within the same physdesc with an empty string
|
|
205
|
+
extents.join(' ') unless extents.empty?
|
|
206
|
+
end
|
|
207
|
+
|
|
208
|
+
# Add each physdesc separately to the accumulator
|
|
209
|
+
accumulator.concat(extents_per_physdesc)
|
|
210
|
+
end
|
|
211
|
+
|
|
212
|
+
to_field 'extent_tesim' do |_record, accumulator, context|
|
|
213
|
+
accumulator.concat context.output_hash['extent_ssm'] || []
|
|
214
|
+
end
|
|
215
|
+
|
|
216
|
+
to_field 'physfacet_tesim', extract_xpath('/ead/archdesc/did/physdesc/physfacet')
|
|
217
|
+
to_field 'dimensions_tesim', extract_xpath('/ead/archdesc/did/physdesc/dimensions')
|
|
218
|
+
|
|
190
219
|
to_field 'genreform_ssim', extract_xpath('/ead/archdesc/controlaccess/genreform')
|
|
191
220
|
|
|
192
|
-
to_field '
|
|
221
|
+
to_field 'date_range_isim', extract_xpath('/ead/archdesc/did/unitdate/@normal', to_text: false) do |_record, accumulator|
|
|
193
222
|
range = Arclight::YearRange.new
|
|
194
223
|
next range.years if accumulator.blank?
|
|
195
224
|
|
|
@@ -198,6 +227,9 @@ to_field 'date_range_ssim', extract_xpath('/ead/archdesc/did/unitdate/@normal',
|
|
|
198
227
|
accumulator.replace range.years
|
|
199
228
|
end
|
|
200
229
|
|
|
230
|
+
to_field 'indexes_html_tesm', extract_xpath('/ead/archdesc/index', to_text: false)
|
|
231
|
+
to_field 'indexes_tesim', extract_xpath('/ead/archdesc/index')
|
|
232
|
+
|
|
201
233
|
SEARCHABLE_NOTES_FIELDS.map do |selector|
|
|
202
234
|
to_field "#{selector}_html_tesm", extract_xpath("/ead/archdesc/#{selector}/*[local-name()!='head']", to_text: false) do |_record, accumulator|
|
|
203
235
|
accumulator.map!(&:to_html)
|
data/lib/arclight/version.rb
CHANGED
|
@@ -139,13 +139,13 @@ class CatalogController < ApplicationController
|
|
|
139
139
|
# (note: It is case sensitive when searching values)
|
|
140
140
|
|
|
141
141
|
config.add_facet_field 'collection', field: 'collection_ssim', limit: 10
|
|
142
|
-
config.add_facet_field '
|
|
143
|
-
config.add_facet_field 'date_range', field: '
|
|
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
144
|
config.add_facet_field 'level', field: 'level_ssim', limit: 10
|
|
145
145
|
config.add_facet_field 'names', field: 'names_ssim', limit: 10
|
|
146
146
|
config.add_facet_field 'repository', field: 'repository_ssim', limit: 10
|
|
147
|
-
config.add_facet_field '
|
|
148
|
-
config.add_facet_field '
|
|
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
149
|
|
|
150
150
|
# Have BL send all facet field names to Solr, which has been the default
|
|
151
151
|
# previously. Simply remove these lines if you'd rather use Solr request
|
|
@@ -231,6 +231,20 @@ class CatalogController < ApplicationController
|
|
|
231
231
|
pf: '${pf_title}'
|
|
232
232
|
}
|
|
233
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
|
|
234
248
|
|
|
235
249
|
# These are the parameters passed through in search_state.params_for_search
|
|
236
250
|
config.search_state_fields += %i[id group hierarchy_context original_document]
|
|
@@ -262,7 +276,7 @@ class CatalogController < ApplicationController
|
|
|
262
276
|
# ===========================
|
|
263
277
|
|
|
264
278
|
# Collection Show Page - Summary Section
|
|
265
|
-
config.add_summary_field 'creators', field: '
|
|
279
|
+
config.add_summary_field 'creators', field: 'creator_ssim', link_to_facet: true
|
|
266
280
|
config.add_summary_field 'abstract', field: 'abstract_html_tesm', helper_method: :render_html_tags
|
|
267
281
|
config.add_summary_field 'extent', field: 'extent_ssm'
|
|
268
282
|
config.add_summary_field 'language', field: 'language_ssim'
|
|
@@ -279,7 +293,13 @@ class CatalogController < ApplicationController
|
|
|
279
293
|
config.add_background_field 'accruals', field: 'accruals_html_tesm', helper_method: :render_html_tags
|
|
280
294
|
config.add_background_field 'phystech', field: 'phystech_html_tesm', helper_method: :render_html_tags
|
|
281
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
|
|
282
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
|
|
283
303
|
|
|
284
304
|
# Collection Show Page - Related Section
|
|
285
305
|
config.add_related_field 'relatedmaterial', field: 'relatedmaterial_html_tesm', helper_method: :render_html_tags
|
|
@@ -287,6 +307,7 @@ class CatalogController < ApplicationController
|
|
|
287
307
|
config.add_related_field 'otherfindaid', field: 'otherfindaid_html_tesm', helper_method: :render_html_tags
|
|
288
308
|
config.add_related_field 'altformavail', field: 'altformavail_html_tesm', helper_method: :render_html_tags
|
|
289
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
|
|
290
311
|
|
|
291
312
|
# Collection Show Page - Indexed Terms Section
|
|
292
313
|
config.add_indexed_terms_field 'access_subjects', field: 'access_subjects_ssim', link_to_facet: true, separator_options: {
|
|
@@ -307,6 +328,9 @@ class CatalogController < ApplicationController
|
|
|
307
328
|
last_word_connector: '<br/>'
|
|
308
329
|
}
|
|
309
330
|
|
|
331
|
+
config.add_indexed_terms_field 'indexes', field: 'indexes_html_tesm',
|
|
332
|
+
helper_method: :render_html_tags
|
|
333
|
+
|
|
310
334
|
# ==========================
|
|
311
335
|
# COMPONENT SHOW PAGE FIELDS
|
|
312
336
|
# ==========================
|
|
@@ -319,17 +343,32 @@ class CatalogController < ApplicationController
|
|
|
319
343
|
}, if: lambda { |_context, _field_config, document|
|
|
320
344
|
document.containers.present?
|
|
321
345
|
}
|
|
346
|
+
config.add_component_field 'creators', field: 'creator_ssim', link_to_facet: true
|
|
322
347
|
config.add_component_field 'abstract', field: 'abstract_html_tesm', helper_method: :render_html_tags
|
|
323
348
|
config.add_component_field 'extent', field: 'extent_ssm'
|
|
324
349
|
config.add_component_field 'scopecontent', field: 'scopecontent_html_tesm', helper_method: :render_html_tags
|
|
350
|
+
config.add_component_field 'language', field: 'language_ssim'
|
|
325
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
|
|
326
353
|
config.add_component_field 'appraisal', field: 'appraisal_html_tesm', helper_method: :render_html_tags
|
|
327
354
|
config.add_component_field 'custodhist', field: 'custodhist_html_tesm', helper_method: :render_html_tags
|
|
328
355
|
config.add_component_field 'processinfo', field: 'processinfo_html_tesm', helper_method: :render_html_tags
|
|
329
356
|
config.add_component_field 'arrangement', field: 'arrangement_html_tesm', helper_method: :render_html_tags
|
|
330
357
|
config.add_component_field 'accruals', field: 'accruals_html_tesm', helper_method: :render_html_tags
|
|
331
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
|
|
332
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
|
|
333
372
|
|
|
334
373
|
# Component Show Page - Indexed Terms Section
|
|
335
374
|
config.add_component_indexed_terms_field 'access_subjects', field: 'access_subjects_ssim', link_to_facet: true, separator_options: {
|
|
@@ -350,6 +389,9 @@ class CatalogController < ApplicationController
|
|
|
350
389
|
last_word_connector: '<br/>'
|
|
351
390
|
}
|
|
352
391
|
|
|
392
|
+
config.add_component_indexed_terms_field 'indexes', field: 'indexes_html_tesm',
|
|
393
|
+
helper_method: :render_html_tags
|
|
394
|
+
|
|
353
395
|
# =================
|
|
354
396
|
# ACCESS TAB FIELDS
|
|
355
397
|
# =================
|
|
@@ -18,6 +18,10 @@ en:
|
|
|
18
18
|
accruals: Accruals
|
|
19
19
|
phystech: Physical / technical requirements
|
|
20
20
|
physloc: Physical location
|
|
21
|
+
physdesc: Physical description
|
|
22
|
+
physfacet: Physical facet
|
|
23
|
+
dimensions: Dimensions
|
|
24
|
+
indexes: Indexes
|
|
21
25
|
descrules: Rules or conventions
|
|
22
26
|
|
|
23
27
|
relatedmaterial: Related material
|
|
@@ -25,6 +29,11 @@ en:
|
|
|
25
29
|
otherfindaid: Other finding aids
|
|
26
30
|
altformavail: Alternative form available
|
|
27
31
|
originalsloc: Location of originals
|
|
32
|
+
materialspec: Material specific details
|
|
33
|
+
fileplan: File plan
|
|
34
|
+
odd: Other descriptive data
|
|
35
|
+
note: Note
|
|
36
|
+
did_note: Note
|
|
28
37
|
|
|
29
38
|
access_subjects: Subjects
|
|
30
39
|
names_coll: Names
|
|
@@ -7,7 +7,7 @@ nlm:
|
|
|
7
7
|
<div class="al-repository-street-address-building">Building 38, Room 1E-21</div>
|
|
8
8
|
<div class="al-repository-street-address-address1">8600 Rockville Pike</div>
|
|
9
9
|
<div class="al-repository-street-address-city_state_zip_country">Bethesda, MD 20894, USA</div>
|
|
10
|
-
thumbnail_url: "https://
|
|
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
11
|
request_types:
|
|
12
12
|
google_form:
|
|
13
13
|
request_url: 'https://docs.google.com/a/stanford.edu/forms/d/e/1FAIpQLSeOamhY_IcFw4sPnz0ddwWWkrPaHbM5wp7JVbOLOL_mIusEyw/viewform'
|
|
@@ -24,7 +24,7 @@ sul-spec:
|
|
|
24
24
|
<div class="al-repository-street-address-building">Green Library</div>
|
|
25
25
|
<div class="al-repository-street-address-address1">557 Escondido Mall</div>
|
|
26
26
|
<div class="al-repository-street-address-city_state_zip_country">Stanford, CA 94305, USA</div>
|
|
27
|
-
thumbnail_url: 'https://
|
|
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
28
|
request_types:
|
|
29
29
|
aeon_web_ead:
|
|
30
30
|
request_url: 'https://sample.request.com'
|
data/package.json
CHANGED
data/solr/conf/schema.xml
CHANGED
|
@@ -338,6 +338,7 @@
|
|
|
338
338
|
<copyField source="places_ssim" dest="place_teim"/>
|
|
339
339
|
<copyField source="names_ssim" dest="name_teim"/>
|
|
340
340
|
<copyField source="access_subjects_ssim" dest="subject_teim"/>
|
|
341
|
+
<copyField source="containers_ssim" dest="container_teim" />
|
|
341
342
|
|
|
342
343
|
<!-- The catch all `text` field -->
|
|
343
344
|
<!-- grab the fielded searches -->
|
|
@@ -345,9 +346,11 @@
|
|
|
345
346
|
<copyField source="places_ssim" dest="text" />
|
|
346
347
|
<copyField source="names_ssim" dest="text" />
|
|
347
348
|
<copyField source="access_subjects_ssim" dest="text" />
|
|
349
|
+
<copyField source="containers_ssim" dest="text" />
|
|
350
|
+
|
|
348
351
|
<!-- grab the searchable notes -->
|
|
349
352
|
<copyField source="abstract_tesim" dest="text" />
|
|
350
|
-
<copyField source="
|
|
353
|
+
<copyField source="accessrestrict_tesim" dest="text" />
|
|
351
354
|
<copyField source="accruals_tesim" dest="text" />
|
|
352
355
|
<copyField source="acqinfo_tesim" dest="text" />
|
|
353
356
|
<copyField source="altformavail_tesim" dest="text" />
|
|
@@ -358,10 +361,13 @@
|
|
|
358
361
|
<copyField source="custodhist_tesim" dest="text" />
|
|
359
362
|
<copyField source="did_note_tesim" dest="text" />
|
|
360
363
|
<copyField source="fileplan_tesim" dest="text" />
|
|
364
|
+
<copyField source="indexes_tesim" dest="text" />
|
|
365
|
+
<copyField source="language_ssim" dest="text" />
|
|
361
366
|
<copyField source="materialspec_tesim" dest="text" />
|
|
362
367
|
<copyField source="note_tesim" dest="text" />
|
|
363
368
|
<copyField source="odd_tesim" dest="text" />
|
|
364
369
|
<copyField source="originalsloc_tesim" dest="text" />
|
|
370
|
+
<copyField source="parent_unittitles_tesim" dest="text" />
|
|
365
371
|
<copyField source="physdesc_tesim" dest="text" />
|
|
366
372
|
<copyField source="physloc_tesim" dest="text" />
|
|
367
373
|
<copyField source="phystech_tesim" dest="text" />
|
data/solr/conf/solrconfig.xml
CHANGED
|
@@ -75,7 +75,15 @@
|
|
|
75
75
|
<int name="rows">10</int>
|
|
76
76
|
|
|
77
77
|
<str name="q.alt">*:*</str>
|
|
78
|
-
|
|
78
|
+
|
|
79
|
+
<!-- Minimum Should Match parameter (mm) -->
|
|
80
|
+
<str name="mm">4<90%</str>
|
|
81
|
+
<!-- 1-4 term query, all must match
|
|
82
|
+
5+ term query, 90% must match; rounded down, so e.g.:
|
|
83
|
+
* 5-10 term query, all but one must match
|
|
84
|
+
* 11-20 term query, all but two must match
|
|
85
|
+
* 21-29 term query, all but three must match, etc.
|
|
86
|
+
-->
|
|
79
87
|
|
|
80
88
|
<!-- this qf and pf are used by default, if not otherwise specified by
|
|
81
89
|
client. The default blacklight_config will use these for the
|
|
@@ -85,6 +93,11 @@
|
|
|
85
93
|
http://wiki.apache.org/solr/LocalParams
|
|
86
94
|
-->
|
|
87
95
|
|
|
96
|
+
<!-- In general, matches using the pf parameter should be boosted higher
|
|
97
|
+
than qf, so the proximity of multiple search terms in the matching
|
|
98
|
+
documents is significant in relevance scoring. See:
|
|
99
|
+
https://solr.apache.org/guide/solr/latest/query-guide/dismax-query-parser.html#pf-phrase-fields-parameter
|
|
100
|
+
-->
|
|
88
101
|
<str name="qf">
|
|
89
102
|
collection_title_tesim^150
|
|
90
103
|
title_tesim^100
|
|
@@ -93,84 +106,86 @@
|
|
|
93
106
|
name_teim^10
|
|
94
107
|
place_teim^10
|
|
95
108
|
subject_teim^2
|
|
109
|
+
id
|
|
110
|
+
ead_ssi
|
|
111
|
+
ref_ssm
|
|
112
|
+
unitid_ssm
|
|
113
|
+
container_teim
|
|
114
|
+
parent_unittitles_tesim
|
|
96
115
|
text
|
|
97
116
|
</str>
|
|
98
117
|
<str name="pf">
|
|
99
|
-
collection_title_tesim^
|
|
100
|
-
title_tesim^
|
|
101
|
-
normalized_title_teim^
|
|
102
|
-
unitid_identifier_match^
|
|
103
|
-
name_teim^
|
|
104
|
-
place_teim^
|
|
105
|
-
subject_teim^
|
|
106
|
-
|
|
118
|
+
collection_title_tesim^300
|
|
119
|
+
title_tesim^200
|
|
120
|
+
normalized_title_teim^200
|
|
121
|
+
unitid_identifier_match^80
|
|
122
|
+
name_teim^20
|
|
123
|
+
place_teim^20
|
|
124
|
+
subject_teim^5
|
|
125
|
+
id^2
|
|
126
|
+
ead_ssi^2
|
|
127
|
+
ref_ssm^2
|
|
128
|
+
unitid_ssm^2
|
|
129
|
+
container_teim^2
|
|
130
|
+
parent_unittitles_tesim^2
|
|
131
|
+
text^2
|
|
107
132
|
</str>
|
|
108
133
|
|
|
134
|
+
<str name="qf_container">
|
|
135
|
+
container_teim
|
|
136
|
+
</str>
|
|
137
|
+
<str name="pf_container">
|
|
138
|
+
container_teim^2
|
|
139
|
+
</str>
|
|
140
|
+
<str name="qf_identifier">
|
|
141
|
+
id
|
|
142
|
+
ead_ssi
|
|
143
|
+
ref_ssm
|
|
144
|
+
unitid_ssm
|
|
145
|
+
</str>
|
|
146
|
+
<str name="pf_identifier">
|
|
147
|
+
id^2
|
|
148
|
+
ead_ssi^2
|
|
149
|
+
ref_ssm^2
|
|
150
|
+
unitid_ssm^2
|
|
151
|
+
</str>
|
|
109
152
|
<str name="qf_name">
|
|
110
153
|
name_teim
|
|
111
154
|
</str>
|
|
112
155
|
<str name="pf_name">
|
|
113
|
-
name_teim
|
|
156
|
+
name_teim^2
|
|
114
157
|
</str>
|
|
115
158
|
<str name="qf_place">
|
|
116
159
|
place_teim
|
|
117
160
|
</str>
|
|
118
161
|
<str name="pf_place">
|
|
119
|
-
place_teim
|
|
162
|
+
place_teim^2
|
|
120
163
|
</str>
|
|
121
164
|
<str name="qf_subject">
|
|
122
165
|
subject_teim
|
|
123
166
|
</str>
|
|
124
167
|
<str name="pf_subject">
|
|
125
|
-
subject_teim
|
|
168
|
+
subject_teim^2
|
|
126
169
|
</str>
|
|
127
170
|
<str name="qf_title">
|
|
128
171
|
title_tesim
|
|
129
172
|
normalized_title_teim
|
|
130
173
|
</str>
|
|
131
174
|
<str name="pf_title">
|
|
132
|
-
title_tesim
|
|
133
|
-
normalized_title_teim
|
|
175
|
+
title_tesim^2
|
|
176
|
+
normalized_title_teim^2
|
|
134
177
|
</str>
|
|
135
178
|
|
|
136
179
|
<int name="ps">3</int>
|
|
137
180
|
<float name="tie">0.01</float>
|
|
138
181
|
|
|
139
|
-
<str name="fl">
|
|
140
|
-
id,
|
|
141
|
-
score,
|
|
142
|
-
abstract_html_tesm,
|
|
143
|
-
accessrestrict_html_tesm,
|
|
144
|
-
child_component_count_isi,
|
|
145
|
-
containers_ssim,
|
|
146
|
-
creator_ssm,
|
|
147
|
-
extent_ssm,
|
|
148
|
-
geogname_ssm,
|
|
149
|
-
has_online_content_ssim,
|
|
150
|
-
language_ssim,
|
|
151
|
-
level_ssm,
|
|
152
|
-
repository_ssm,
|
|
153
|
-
scopecontent_html_tesm,
|
|
154
|
-
title_ssm,
|
|
155
|
-
normalized_title_ssm,
|
|
156
|
-
normalized_date_ssm,
|
|
157
|
-
unitid_ssm,
|
|
158
|
-
parent_ssim,
|
|
159
|
-
parent_unittitles_ssm,
|
|
160
|
-
ead_ssi,
|
|
161
|
-
ref_ssm,
|
|
162
|
-
component_level_isim,
|
|
163
|
-
parent_access_restrict_tesm,
|
|
164
|
-
parent_access_terms_tesm,
|
|
165
|
-
names_coll_ssim
|
|
166
|
-
places_ssim
|
|
167
|
-
</str>
|
|
182
|
+
<str name="fl">*</str>
|
|
168
183
|
|
|
169
184
|
<str name="facet">true</str>
|
|
170
185
|
<str name="facet.mincount">1</str>
|
|
171
186
|
<str name="facet.field">level_ssim</str>
|
|
172
187
|
<str name="facet.field">creator_ssim</str>
|
|
173
|
-
<str name="facet.field">
|
|
188
|
+
<str name="facet.field">date_range_isim</str>
|
|
174
189
|
<str name="facet.field">names_ssim</str>
|
|
175
190
|
<str name="facet.field">geogname_ssim</str>
|
|
176
191
|
<str name="facet.field">access_subjects_ssim</str>
|
data/template.rb
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
gem 'arclight'
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
after_bundle do
|
|
6
|
+
generate 'blacklight:install', '--devise'
|
|
7
|
+
generate 'arclight:install', '-f'
|
|
6
8
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
rake 'db:migrate'
|
|
9
|
+
rake 'db:migrate'
|
|
10
|
+
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: arclight
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.0
|
|
4
|
+
version: 1.1.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Darren Hardy
|
|
@@ -11,7 +11,7 @@ authors:
|
|
|
11
11
|
autorequire:
|
|
12
12
|
bindir: exe
|
|
13
13
|
cert_chain: []
|
|
14
|
-
date: 2023-
|
|
14
|
+
date: 2023-12-19 00:00:00.000000000 Z
|
|
15
15
|
dependencies:
|
|
16
16
|
- !ruby/object:Gem::Dependency
|
|
17
17
|
name: blacklight
|
|
@@ -271,20 +271,6 @@ dependencies:
|
|
|
271
271
|
- - ">="
|
|
272
272
|
- !ruby/object:Gem::Version
|
|
273
273
|
version: '0'
|
|
274
|
-
- !ruby/object:Gem::Dependency
|
|
275
|
-
name: webdrivers
|
|
276
|
-
requirement: !ruby/object:Gem::Requirement
|
|
277
|
-
requirements:
|
|
278
|
-
- - ">="
|
|
279
|
-
- !ruby/object:Gem::Version
|
|
280
|
-
version: '0'
|
|
281
|
-
type: :development
|
|
282
|
-
prerelease: false
|
|
283
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
284
|
-
requirements:
|
|
285
|
-
- - ">="
|
|
286
|
-
- !ruby/object:Gem::Version
|
|
287
|
-
version: '0'
|
|
288
274
|
description: ''
|
|
289
275
|
email:
|
|
290
276
|
- drh@stanford.edu
|
|
@@ -336,6 +322,7 @@ files:
|
|
|
336
322
|
- app/assets/stylesheets/arclight/modules/mastheads.scss
|
|
337
323
|
- app/assets/stylesheets/arclight/modules/repositories.scss
|
|
338
324
|
- app/assets/stylesheets/arclight/modules/repository_card.scss
|
|
325
|
+
- app/assets/stylesheets/arclight/modules/search_form.scss
|
|
339
326
|
- app/assets/stylesheets/arclight/modules/search_results.scss
|
|
340
327
|
- app/assets/stylesheets/arclight/modules/show_collection.scss
|
|
341
328
|
- app/assets/stylesheets/arclight/modules/truncator.scss
|
|
@@ -431,6 +418,7 @@ files:
|
|
|
431
418
|
- app/views/arclight/requests/_aeon_external_request_endpoint.html.erb
|
|
432
419
|
- app/views/arclight/requests/_aeon_web_ead.html.erb
|
|
433
420
|
- app/views/arclight/requests/_google_form.html.erb
|
|
421
|
+
- app/views/catalog/_document_list.html.erb
|
|
434
422
|
- app/views/catalog/_group.html.erb
|
|
435
423
|
- app/views/catalog/_group_toggle.html.erb
|
|
436
424
|
- app/views/catalog/_search_results_header.html.erb
|
|
@@ -513,7 +501,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
513
501
|
- !ruby/object:Gem::Version
|
|
514
502
|
version: '0'
|
|
515
503
|
requirements: []
|
|
516
|
-
rubygems_version: 3.4.
|
|
504
|
+
rubygems_version: 3.4.10
|
|
517
505
|
signing_key:
|
|
518
506
|
specification_version: 4
|
|
519
507
|
summary: A Blacklight-based environment to support discovery and delivery for archives
|