curation_concerns-models 0.9.0 → 0.10.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/indexers/curation_concerns/work_indexer.rb +0 -1
- data/app/models/concerns/curation_concerns/basic_metadata.rb +7 -7
- data/app/models/concerns/curation_concerns/solr_document_behavior.rb +2 -1
- data/app/models/concerns/curation_concerns/work_behavior.rb +9 -0
- data/app/services/curation_concerns/indexes_thumbnails.rb +16 -0
- data/curation_concerns-models.gemspec +1 -1
- data/lib/curation_concerns/models/version.rb +1 -1
- data/lib/generators/curation_concerns/models/templates/app/models/collection.rb +2 -0
- data/lib/generators/curation_concerns/models/templates/config/redis_config.rb +10 -9
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: afd415c4152d3eb3fc25a1d5d63c0261c820ae07
|
4
|
+
data.tar.gz: 051471568f9ab3d2d27ff62a8d8faa5d469c3139
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c2607d15592fe9f7e6acb243256cc33f6b29132b201660328cb427840b3efba3453f5f5c40ce44bab48a8cc5d55cc8b1d685b62143edd0492136ee2cca310483
|
7
|
+
data.tar.gz: 2db872e858e8705f6af5e1060c686b80e01d595125c01492066080916b6e3bd1695bdd72cca78e063fd50c8d81c80a65dcf32ee181653526a810df6ece97964b
|
@@ -15,33 +15,33 @@ module CurationConcerns
|
|
15
15
|
property :resource_type, predicate: ::RDF::Vocab::DC.type do |index|
|
16
16
|
index.as :stored_searchable, :facetable
|
17
17
|
end
|
18
|
-
property :creator, predicate: ::RDF::Vocab::
|
18
|
+
property :creator, predicate: ::RDF::Vocab::DC11.creator do |index|
|
19
19
|
index.as :stored_searchable, :facetable
|
20
20
|
end
|
21
|
-
property :contributor, predicate: ::RDF::Vocab::
|
21
|
+
property :contributor, predicate: ::RDF::Vocab::DC11.contributor do |index|
|
22
22
|
index.as :stored_searchable, :facetable
|
23
23
|
end
|
24
|
-
property :description, predicate: ::RDF::Vocab::
|
24
|
+
property :description, predicate: ::RDF::Vocab::DC11.description do |index|
|
25
25
|
index.type :text
|
26
26
|
index.as :stored_searchable
|
27
27
|
end
|
28
|
-
property :tag, predicate: ::RDF::Vocab::
|
28
|
+
property :tag, predicate: ::RDF::Vocab::DC11.relation do |index|
|
29
29
|
index.as :stored_searchable, :facetable
|
30
30
|
end
|
31
31
|
property :rights, predicate: ::RDF::Vocab::DC.rights do |index|
|
32
32
|
index.as :stored_searchable
|
33
33
|
end
|
34
|
-
property :publisher, predicate: ::RDF::Vocab::
|
34
|
+
property :publisher, predicate: ::RDF::Vocab::DC11.publisher do |index|
|
35
35
|
index.as :stored_searchable, :facetable
|
36
36
|
end
|
37
37
|
property :date_created, predicate: ::RDF::Vocab::DC.created do |index|
|
38
38
|
index.as :stored_searchable
|
39
39
|
end
|
40
40
|
|
41
|
-
property :subject, predicate: ::RDF::Vocab::
|
41
|
+
property :subject, predicate: ::RDF::Vocab::DC11.subject do |index|
|
42
42
|
index.as :stored_searchable, :facetable
|
43
43
|
end
|
44
|
-
property :language, predicate: ::RDF::Vocab::
|
44
|
+
property :language, predicate: ::RDF::Vocab::DC11.language do |index|
|
45
45
|
index.as :stored_searchable, :facetable
|
46
46
|
end
|
47
47
|
property :identifier, predicate: ::RDF::Vocab::DC.identifier do |index|
|
@@ -44,8 +44,9 @@ module CurationConcerns
|
|
44
44
|
fetch(Solrizer.solr_name('hasRelatedMediaFragment', :symbol), []).first
|
45
45
|
end
|
46
46
|
|
47
|
+
# Date created is indexed as a string. This allows users to enter values like: 'Circa 1840-1844'
|
47
48
|
def date_created
|
48
|
-
|
49
|
+
fetch(Solrizer.solr_name("date_created"), []).first
|
49
50
|
end
|
50
51
|
|
51
52
|
def date_modified
|
@@ -23,6 +23,15 @@ module CurationConcerns::WorkBehavior
|
|
23
23
|
def indexer
|
24
24
|
CurationConcerns::WorkIndexer
|
25
25
|
end
|
26
|
+
|
27
|
+
# This governs which partial to draw when you render this type of object
|
28
|
+
def _to_partial_path #:nodoc:
|
29
|
+
@_to_partial_path ||= begin
|
30
|
+
element = ActiveSupport::Inflector.underscore(ActiveSupport::Inflector.demodulize(name))
|
31
|
+
collection = ActiveSupport::Inflector.tableize(name)
|
32
|
+
"curation_concerns/#{collection}/#{element}".freeze
|
33
|
+
end
|
34
|
+
end
|
26
35
|
end
|
27
36
|
|
28
37
|
def to_s
|
@@ -5,8 +5,24 @@ module CurationConcerns
|
|
5
5
|
included do
|
6
6
|
class_attribute :thumbnail_path_service
|
7
7
|
self.thumbnail_path_service = ThumbnailPathService
|
8
|
+
class_attribute :thumbnail_field
|
9
|
+
self.thumbnail_field = 'thumbnail_path_ss'.freeze
|
8
10
|
end
|
9
11
|
|
12
|
+
# Adds thumbnail indexing to the solr document
|
13
|
+
def generate_solr_document
|
14
|
+
super.tap do |solr_doc|
|
15
|
+
index_thumbnails(solr_doc)
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
# Write the thumbnail paths into the solr_document
|
20
|
+
# @params [Hash] solr_document the solr document to add the field to
|
21
|
+
def index_thumbnails(solr_document)
|
22
|
+
solr_document[thumbnail_field] = thumbnail_path
|
23
|
+
end
|
24
|
+
|
25
|
+
# Returns the value for the thumbnail path to put into the solr document
|
10
26
|
def thumbnail_path
|
11
27
|
self.class.thumbnail_path_service.call(object)
|
12
28
|
end
|
@@ -20,7 +20,7 @@ Gem::Specification.new do |spec|
|
|
20
20
|
spec.require_paths = ["lib"]
|
21
21
|
|
22
22
|
spec.add_dependency 'active_attr'
|
23
|
-
spec.add_dependency 'hydra-collections', '~> 8.
|
23
|
+
spec.add_dependency 'hydra-collections', '~> 8.1'
|
24
24
|
spec.add_dependency 'hydra-head', '~> 9.3'
|
25
25
|
spec.add_dependency 'hydra-works', '~> 0.7'
|
26
26
|
spec.add_dependency 'active_fedora-noid', '~> 1.0'
|
@@ -7,21 +7,22 @@ if defined?(PhusionPassenger)
|
|
7
7
|
config = YAML.load(ERB.new(IO.read(File.join(Rails.root, 'config', 'redis.yml'))).result)[Rails.env].with_indifferent_access
|
8
8
|
|
9
9
|
# The important two lines
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
Resque.redis =
|
10
|
+
Redis.current.disconnect!
|
11
|
+
Redis.current = begin
|
12
|
+
Redis.new(config.merge(thread_safe: true))
|
13
|
+
rescue
|
14
|
+
nil
|
15
|
+
end
|
16
|
+
Resque.redis = Redis.current
|
17
17
|
Resque.redis.namespace = "#{CurationConcerns.config.redis_namespace}:#{Rails.env}"
|
18
18
|
Resque.redis.client.reconnect if Resque.redis
|
19
19
|
end
|
20
20
|
end
|
21
21
|
else
|
22
22
|
config = YAML.load(ERB.new(IO.read(File.join(Rails.root, 'config', 'redis.yml'))).result)[Rails.env].with_indifferent_access
|
23
|
-
|
24
|
-
|
23
|
+
require 'redis'
|
24
|
+
Redis.current = begin
|
25
|
+
Redis.new(config.merge(thread_safe: true))
|
25
26
|
rescue
|
26
27
|
nil
|
27
28
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: curation_concerns-models
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.10.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Justin Coyne
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-03-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: active_attr
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '8.
|
33
|
+
version: '8.1'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '8.
|
40
|
+
version: '8.1'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: hydra-head
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|