warclight 0.2.0 → 0.3.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 30e0c2b3c96bda4a0c197bc20f9e15987294a6e7
4
- data.tar.gz: 55ecd9497198b8742025d37755a30e18ac432a19
3
+ metadata.gz: 8e1a86239db7cb3980ec2b5ccc0cfb0363cfa38f
4
+ data.tar.gz: e76c85f197a7e161db4f044b1b802a495eac909b
5
5
  SHA512:
6
- metadata.gz: 0ed70a7e4dff2676c6a35fecc199fa0861e6ab5c1b9ca26dd1f2be9b5fc734b5c6a830e50038fb05ec43fff4aa551f4ec337cdf2ca7971c7e9a24919be8bdb81
7
- data.tar.gz: 23a4970ac3c95637b4c871fe308f5ca39221a5c02274ced5ed9e2b236072eff9acdb33c0936be87c6237136ab72a2fd0536d9c09794e80f7bddb6e9da4fbe381
6
+ metadata.gz: feccb07631707fb23b3039844a8d1d377af30e9e6ae0698a274a4b015b45086ebb2d7d2d695f24fdd148e20392e5b47b3c498b5dbb1bd92b2cad1c5786551572
7
+ data.tar.gz: 572b71c85c56a2c51c6a919680affb04089b97ff0a55e5d030f904186bda420ec90f5284c9b42f8c96e8b3483afbf96a34711b4a3696efb543ec1f97ba8ac1eb
data/.rubocop.yml CHANGED
@@ -17,8 +17,6 @@ Metrics/LineLength:
17
17
  Max: 120
18
18
  Exclude:
19
19
  - 'Gemfile'
20
- - 'lib/warclight/custom_document.rb' # XPaths get long
21
- - 'lib/warclight/custom_component.rb' # XPaths get long
22
20
 
23
21
  Metrics/ModuleLength:
24
22
  Max: 120
@@ -26,6 +24,9 @@ Metrics/ModuleLength:
26
24
  Metrics/ClassLength:
27
25
  Max: 120
28
26
 
27
+ Metrics/MethodLength:
28
+ Max: 20
29
+
29
30
  Metrics/BlockLength:
30
31
  Exclude:
31
32
  - !ruby/regexp /\.rake$/
@@ -33,10 +34,6 @@ Metrics/BlockLength:
33
34
  - 'spec/**/*'
34
35
  - 'lib/warclight/custom_document.rb'
35
36
 
36
- Metrics/MethodLength:
37
- Exclude:
38
- - 'lib/warclight/custom_document.rb' # warclight_field_definitions too long
39
-
40
37
  Performance/RegexpMatch:
41
38
  Enabled: false
42
39
 
@@ -47,10 +44,6 @@ Rails/OutputSafety:
47
44
  RSpec/ExampleLength:
48
45
  Enabled: false
49
46
 
50
- RSpec/FilePath:
51
- Exclude:
52
- - 'spec/lib/warclight/viewers/oembed_spec.rb' # Default file path is o_embed, and that looks weird
53
-
54
47
  RSpec/MultipleExpectations:
55
48
  Enabled: false
56
49
 
data/CHANGELOG.md CHANGED
@@ -1,5 +1,16 @@
1
1
  # Change Log
2
2
 
3
+ ## [v0.2.0](https://github.com/archivesunleashed/warclight/tree/v0.2.0) (2017-09-07)
4
+ [Full Changelog](https://github.com/archivesunleashed/warclight/compare/v0.1.1...v0.2.0)
5
+
6
+ **Implemented enhancements:**
7
+
8
+ - 'url' field value should be presented as a link [\#20](https://github.com/archivesunleashed/warclight/issues/20)
9
+
10
+ **Closed issues:**
11
+
12
+ - Additional fields in the standard search [\#23](https://github.com/archivesunleashed/warclight/issues/23)
13
+
3
14
  ## [v0.1.1](https://github.com/archivesunleashed/warclight/tree/v0.1.1) (2017-08-20)
4
15
  [Full Changelog](https://github.com/archivesunleashed/warclight/compare/v0.1.0...v0.1.1)
5
16
 
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+
3
+ ##
4
+ # Generic Helpers used in Warclight
5
+ module WarclightHelper
6
+ def url_to_link(options = {})
7
+ safe_join(options[:value].map do |url|
8
+ begin
9
+ res = Net::HTTP.get_response(URI(url))
10
+ if res.code.start_with?('1', '2', '3')
11
+ link_to(url, url, target: '_blank') << ' 🔗'
12
+ else
13
+ url + ' (Not available)'
14
+ end
15
+ rescue
16
+ url + ' (Not available)'
17
+ end
18
+ end, '')
19
+ end
20
+
21
+ def return_five(options = {})
22
+ options[:value][0, 5].join('; ') + '...'
23
+ end
24
+ end
@@ -20,7 +20,7 @@ class CatalogController < ApplicationController
20
20
  }
21
21
 
22
22
  # solr field configuration for search results/index views
23
- config.index.title_field = 'title'
23
+ config.index.title_field = ['title', 'resourcename_s']
24
24
 
25
25
  # solr fields that will be treated as facets by the blacklight application
26
26
  # The ordering of the field names is the order of the display
@@ -50,10 +50,11 @@ class CatalogController < ApplicationController
50
50
 
51
51
  config.add_facet_field 'content_type_norm', label: 'General Content Type', collapse: false
52
52
  config.add_facet_field 'crawl_year', label: 'Crawl Year', collapse: false
53
- config.add_facet_field 'public_suffix', label: 'Public Suffix', collapse: false
54
- config.add_facet_field 'domain', label: 'Domain'
55
- config.add_facet_field 'links_domains', label: 'Links Domains'
56
- config.add_facet_field 'content_language', label: 'Content Language'
53
+ config.add_facet_field 'public_suffix', label: 'Public Suffix', collapse: false, limit: true
54
+ config.add_facet_field 'domain', label: 'Domain', limit: true
55
+ config.add_facet_field 'links_domains', label: 'Links Domains', limit: true
56
+ config.add_facet_field 'content_language', label: 'Content Language', limit: true
57
+ config.add_facet_field 'resourcename_s', label: 'Filename', limit: true
57
58
  config.add_facet_field 'institution', label: 'Institution'
58
59
  config.add_facet_field 'collection_name', label: 'Collection Name'
59
60
  config.add_facet_field 'collection_number', label: 'Collection Number'
@@ -74,13 +75,12 @@ class CatalogController < ApplicationController
74
75
  config.add_index_field 'institution', label: 'Institution', link_to_facet: true
75
76
  config.add_index_field 'collection_name', label: 'Collection Name', link_to_facet: true
76
77
  config.add_index_field 'collection_number', label: 'Collection Number', link_to_facet: true
77
- config.add_index_field 'links_domains', label: 'This page links to', link_to_facet: true,
78
- separator_options: { words_connector: '; ' }
78
+ config.add_index_field 'links_domains', label: 'This page links to', helper_method: :return_five
79
79
 
80
80
  # solr fields to be displayed in the show (single result) view
81
81
  # The ordering of the field names is the order of the display
82
- config.add_show_field 'title', label: 'Title'
83
- config.add_show_field 'url', label: 'URL (live web)', helper_method: :link_to_live_web
82
+ config.add_show_field 'url', label: 'URL', helper_method: :url_to_link
83
+ config.add_show_field 'resourcename_s', label: 'Filename', link_to_facet: true
84
84
  config.add_show_field 'host', label: 'Host', link_to_facet: true
85
85
  config.add_show_field 'institution', label: 'Institution', link_to_facet: true
86
86
  config.add_show_field 'collection_name', label: 'Collection Name', link_to_facet: true
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Warclight
4
- VERSION = '0.2.0'
4
+ VERSION = '0.3.0'
5
5
  end
data/solr/conf/schema.xml CHANGED
@@ -23,6 +23,9 @@
23
23
  <field name="_root_" type="string" indexed="true" docValues="true" />
24
24
  <field name="_text_" type="text_general" indexed="true" stored="false" multiValued="true"/>
25
25
 
26
+ <!--Not defined in SolrFields. Schema only defintion -->
27
+ <field name="index_time" type="date" indexed="true" stored="false" docValues="true" default="NOW" />
28
+
26
29
  <!-- BL UKWA: additional -->
27
30
  <field name="access_terms" type="string" indexed="true" docValues="true" multiValued="true"/>
28
31
  <field name="author" type="string" indexed="true" docValues="true"/>
@@ -73,6 +76,7 @@
73
76
  <field name="last_modified" type="tdate" indexed="true" stored="true" docValues="true"/>
74
77
  <field name="last_modified_year" type="string" indexed="true" docValues="true"/>
75
78
  <field name="license_url" type="string" indexed="true" docValues="true" multiValued="true"/>
79
+ <field name="links_images" type="string" indexed="true" docValues="true" multiValued="true"/>
76
80
  <field name="links_domains" type="string" indexed="true" docValues="true" multiValued="true"/>
77
81
  <field name="links_hosts" type="string" indexed="true" docValues="true" multiValued="true"/>
78
82
  <field name="links_hosts_surts" type="string" indexed="true" docValues="true" multiValued="true"/>
@@ -94,6 +98,7 @@
94
98
  <field name="sentiment_score" type="float" indexed="true" stored="true" multiValued="false"/>
95
99
  <field name="sentiment" type="string" indexed="true" docValues="true" multiValued="false"/>
96
100
  <field name="server" type="string" indexed="true" docValues="true" multiValued="true"/>
101
+ <field name="source_file_path" type="string" indexed="true" docValues="true" />
97
102
  <field name="source_file_offset" type="tlong" indexed="true" stored="true" />
98
103
  <field name="source_file" type="string" indexed="true" docValues="true" />
99
104
  <field name="status_code" type="int" indexed="true" stored="true" docValues="true" />
@@ -114,12 +119,15 @@
114
119
  <field name="wct_target_id" type="string" indexed="true" docValues="true" multiValued="false"/>
115
120
  <field name="wct_title" type="string" indexed="true" docValues="true"/>
116
121
  <field name="xml_root_ns" type="string" indexed="true" docValues="true" multiValued="false"/>
122
+ <field name="warc_key_id" type="string" indexed="true" docValues="true" multiValued="false"/>
123
+ <field name="warc_ip" type="string" indexed="true" docValues="true" multiValued="false"/>
117
124
  <!--:BL UKWA -->
118
125
 
119
- <!--:User Supplied Values - Web Archives for Historical Research -->
126
+ <!-- User supplied Archive-It fields: -->
120
127
  <field name="institution" type="string" indexed="true" multiValued="false" docValues="true"/>
121
128
  <field name="collection_name" type="string" indexed="true" multiValued="false" docValues="true"/>
122
129
  <field name="collection_number" type="string" indexed="true" multiValued="false" docValues="true"/>
130
+ <!--:User supplied Archive-It fields -->
123
131
 
124
132
  <dynamicField name="*_i" type="int" indexed="true" stored="true"/>
125
133
  <dynamicField name="*_is" type="ints" indexed="true" stored="true"/>
@@ -153,6 +161,10 @@
153
161
  <dynamicField name="attr_*" type="text_general" indexed="true" stored="true" multiValued="true"/>
154
162
  <dynamicField name="random_*" type="random" />
155
163
 
164
+ <!--:IMAGE EXIF-->
165
+ <field name="exif_location" type="location" indexed="true" stored="true" multiValued="false"/>
166
+ <field name="exif_version" type="string" indexed="true" stored="true" multiValued="false"/>
167
+
156
168
  <!-- BL UKWA: additional -->
157
169
  <dynamicField name="ssdeep_hash_bs_*" type="string" indexed="true" stored="true" multiValued="false"/>
158
170
  <dynamicField name="ssdeep_hash_ngram_bs_*" type="literal_ngram" indexed="true" stored="true" multiValued="false"/>
@@ -181,6 +193,7 @@
181
193
  <copyField source="wct_description" dest="text"/>
182
194
  <copyField source="url" dest="text"/>
183
195
  <copyField source="content" dest="text"/>
196
+ <copyField source="resourcename" dest="resourcename_s" indexed="false" stored="false" docValues="true"/>
184
197
 
185
198
  <types>
186
199
  <fieldType name="string" class="solr.StrField" sortMissingLast="true" />
@@ -51,9 +51,6 @@
51
51
  <maxTime>${solr.autoCommit.maxTime:15000}</maxTime>
52
52
  <openSearcher>false</openSearcher>
53
53
  </autoCommit>
54
- <autoSoftCommit>
55
- <maxTime>${solr.autoSoftCommit.maxTime:-1}</maxTime>
56
- </autoSoftCommit>
57
54
  </updateHandler>
58
55
 
59
56
  <query>
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: warclight
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nick Ruest
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-09-07 00:00:00.000000000 Z
11
+ date: 2017-10-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: blacklight
@@ -218,7 +218,7 @@ files:
218
218
  - app/assets/stylesheets/warclight/application.scss
219
219
  - app/assets/stylesheets/warclight/warclight.scss
220
220
  - app/controllers/concerns/warclight/field_config_helpers.rb
221
- - app/helpers/warclight/application_helper.rb
221
+ - app/helpers/warclight_helper.rb
222
222
  - app/jobs/warclight/application_job.rb
223
223
  - app/models/concerns/warclight/catalog.rb
224
224
  - app/models/concerns/warclight/search_behavior.rb
@@ -1,13 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Warclight
4
- ##
5
- # Helper methods for Warclight.
6
- module ApplicationHelper
7
- def link_to_live_web(options = {})
8
- safe_join(options[:value].map do |url|
9
- link_to(url, url, target: '_blank') << ' 🔗'
10
- end, '')
11
- end
12
- end
13
- end