curation_concerns-models 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -0
- data/Rakefile +1 -1
- data/app/actors/concerns/curation_concerns/manages_embargoes_actor.rb +11 -19
- data/app/actors/curation_concerns/base_actor.rb +41 -45
- data/app/actors/curation_concerns/embargo_actor.rb +19 -0
- data/app/actors/curation_concerns/file_set_actor.rb +200 -0
- data/app/actors/curation_concerns/lease_actor.rb +19 -0
- data/app/actors/curation_concerns/work_actor_behavior.rb +55 -58
- data/app/indexers/curation_concerns/collection_indexer.rb +10 -0
- data/app/indexers/curation_concerns/file_set_indexing_service.rb +24 -0
- data/app/{services/curation_concerns/generic_work_indexing_service.rb → indexers/curation_concerns/work_indexing_service.rb} +6 -6
- data/app/jobs/active_fedora_id_based_job.rb +5 -12
- data/app/jobs/audit_job.rb +11 -17
- data/app/jobs/characterize_job.rb +8 -7
- data/app/jobs/create_derivatives_job.rb +8 -11
- data/app/jobs/import_url_job.rb +12 -25
- data/app/jobs/ingest_file_job.rb +16 -0
- data/app/jobs/ingest_local_file_job.rb +14 -35
- data/app/jobs/resolrize_job.rb +3 -5
- data/app/jobs/upload_set_update_job.rb +68 -0
- data/app/models/checksum_audit_log.rb +2 -3
- data/app/models/concerns/curation_concerns/ability.rb +18 -10
- data/app/models/concerns/curation_concerns/basic_metadata.rb +1 -3
- data/app/models/concerns/curation_concerns/collection_behavior.rb +13 -14
- data/app/models/concerns/curation_concerns/file_set/belongs_to_upload_sets.rb +15 -0
- data/app/models/concerns/curation_concerns/{generic_file → file_set}/belongs_to_works.rb +8 -14
- data/app/models/concerns/curation_concerns/file_set/derivatives.rb +54 -0
- data/app/models/concerns/curation_concerns/{generic_file → file_set}/full_text_indexing.rb +1 -2
- data/app/models/concerns/curation_concerns/{generic_file → file_set}/indexing.rb +2 -2
- data/app/models/concerns/curation_concerns/{generic_file → file_set}/versions.rb +2 -3
- data/app/models/concerns/curation_concerns/file_set_behavior.rb +36 -0
- data/app/models/concerns/curation_concerns/generic_file.rb +1 -1
- data/app/models/concerns/curation_concerns/has_representative.rb +6 -7
- data/app/models/concerns/curation_concerns/human_readable_type.rb +5 -7
- data/app/models/concerns/curation_concerns/permissions.rb +2 -2
- data/app/models/concerns/curation_concerns/permissions/readable.rb +0 -1
- data/app/models/concerns/curation_concerns/permissions/writable.rb +10 -51
- data/app/models/concerns/curation_concerns/serializers.rb +3 -5
- data/app/models/concerns/curation_concerns/solr_document_behavior.rb +37 -40
- data/app/models/concerns/curation_concerns/upload_set_behavior.rb +38 -0
- data/app/models/concerns/curation_concerns/user.rb +4 -51
- data/app/models/concerns/curation_concerns/with_file_sets.rb +28 -0
- data/app/models/concerns/curation_concerns/{generic_work_behavior.rb → work_behavior.rb} +12 -6
- data/app/models/curation_concerns/classify_concern.rb +7 -7
- data/app/models/curation_concerns/quick_classification_query.rb +6 -7
- data/app/models/single_use_link.rb +34 -0
- data/app/models/upload_set.rb +3 -0
- data/app/services/curation_concerns/derivative_path.rb +32 -0
- data/app/services/curation_concerns/{generic_file_audit_service.rb → file_set_audit_service.rb} +17 -18
- data/app/services/curation_concerns/indexes_thumbnails.rb +14 -0
- data/app/services/curation_concerns/local_file_service.rb +10 -0
- data/app/services/curation_concerns/lock_manager.rb +40 -0
- data/app/services/curation_concerns/noid.rb +1 -1
- data/app/services/curation_concerns/persist_derivatives.rb +33 -0
- data/app/services/curation_concerns/persist_directly_contained_output_file_service.rb +26 -0
- data/app/services/curation_concerns/repository_audit_service.rb +1 -3
- data/app/services/curation_concerns/thumbnail_path_service.rb +46 -0
- data/app/services/curation_concerns/time_service.rb +7 -0
- data/app/services/curation_concerns/versioning_service.rb +11 -12
- data/curation_concerns-models.gemspec +6 -6
- data/lib/curation_concerns/configuration.rb +154 -0
- data/lib/curation_concerns/messages.rb +26 -26
- data/lib/curation_concerns/models.rb +5 -14
- data/lib/curation_concerns/models/engine.rb +0 -30
- data/lib/curation_concerns/models/utils.rb +4 -4
- data/lib/curation_concerns/models/version.rb +1 -1
- data/lib/generators/curation_concerns/models/abstract_migration_generator.rb +8 -7
- data/lib/generators/curation_concerns/models/clamav_generator.rb +3 -3
- data/lib/generators/curation_concerns/models/install_generator.rb +13 -20
- data/lib/generators/curation_concerns/models/templates/app/models/file_set.rb +4 -0
- data/lib/generators/curation_concerns/models/templates/config/clamav.rb +1 -1
- data/lib/generators/curation_concerns/models/templates/config/curation_concerns.rb +52 -65
- data/lib/generators/curation_concerns/models/templates/config/redis_config.rb +13 -17
- data/lib/generators/curation_concerns/models/templates/config/resque_config.rb +2 -1
- data/lib/generators/curation_concerns/models/templates/migrations/create_checksum_audit_logs.rb +3 -3
- data/lib/generators/curation_concerns/models/templates/migrations/create_single_use_links.rb +12 -0
- data/lib/tasks/curation_concerns-models_tasks.rake +4 -62
- data/lib/tasks/migrate.rake +1 -1
- data/lib/tasks/resque.rake +1 -0
- data/lib/tasks/solr_reindex.rake +1 -1
- metadata +59 -52
- data/app/actors/curation_concerns/generic_file_actor.rb +0 -150
- data/app/jobs/active_fedora_pid_based_job.rb +0 -6
- data/app/jobs/copy_permissions_job.rb +0 -24
- data/app/models/concerns/curation_concerns/generic_file/characterization.rb +0 -89
- data/app/models/concerns/curation_concerns/generic_file/content.rb +0 -8
- data/app/models/concerns/curation_concerns/generic_file/export.rb +0 -343
- data/app/models/concerns/curation_concerns/generic_file_behavior.rb +0 -44
- data/app/models/concerns/curation_concerns/with_basic_metadata.rb +0 -98
- data/app/models/concerns/curation_concerns/with_generic_files.rb +0 -29
- data/app/models/datastreams/fits_datastream.rb +0 -148
- data/app/services/curation_concerns/characterization_service.rb +0 -71
- data/app/services/curation_concerns/full_text_extraction_service.rb +0 -38
- data/app/services/curation_concerns/generic_file_indexing_service.rb +0 -14
- data/lib/curation_concerns/models/resque.rb +0 -36
- data/lib/generators/curation_concerns/models/fulltext_generator.rb +0 -28
- data/lib/generators/curation_concerns/models/templates/app/models/generic_file.rb +0 -4
- data/lib/generators/curation_concerns/models/templates/config/resque_admin.rb +0 -10
@@ -1,36 +0,0 @@
|
|
1
|
-
# Borrowed from:
|
2
|
-
# https://github.com/jeremy/resque-rails/blob/master/lib/resque/rails/queue.rb
|
3
|
-
module CurationConcerns
|
4
|
-
module Resque
|
5
|
-
class Queue
|
6
|
-
attr_reader :default_queue_name
|
7
|
-
|
8
|
-
def initialize(default_queue_name)
|
9
|
-
@default_queue_name = default_queue_name
|
10
|
-
end
|
11
|
-
|
12
|
-
def push(job)
|
13
|
-
push_tries = 0
|
14
|
-
queue = job.respond_to?(:queue_name) ? job.queue_name : default_queue_name
|
15
|
-
begin
|
16
|
-
::Resque.enqueue_to queue, MarshaledJob, Base64.encode64(Marshal.dump(job))
|
17
|
-
rescue Redis::CannotConnectError
|
18
|
-
ActiveFedora::Base.logger.error "Redis is down!"
|
19
|
-
rescue Redis::TimeoutError => error
|
20
|
-
ActiveFedora::Base.logger.warn "Redis Timed out. Trying again! #{job.inspect}"
|
21
|
-
push_tries+=1
|
22
|
-
# fail for good if the tries is greater than 3
|
23
|
-
raise error if push_tries >=3
|
24
|
-
sleep 0.01
|
25
|
-
retry
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
29
|
-
|
30
|
-
class MarshaledJob
|
31
|
-
def self.perform(marshaled_job)
|
32
|
-
Marshal.load(Base64.decode64(marshaled_job)).run
|
33
|
-
end
|
34
|
-
end
|
35
|
-
end
|
36
|
-
end
|
@@ -1,28 +0,0 @@
|
|
1
|
-
# -*- encoding : utf-8 -*-
|
2
|
-
require 'rails/generators'
|
3
|
-
|
4
|
-
class CurationConcerns::Models::FulltextGenerator < Rails::Generators::Base
|
5
|
-
source_root File.expand_path('../templates', __FILE__)
|
6
|
-
|
7
|
-
desc """
|
8
|
-
This generator makes the following changes to your application:
|
9
|
-
1. Copies solrconfig.xml into solr_conf/conf/
|
10
|
-
2. Reconfigures jetty
|
11
|
-
"""
|
12
|
-
|
13
|
-
def banner
|
14
|
-
say_status("warning", "GENERATING CURATION_CONCERNS FULL-TEXT", :yellow)
|
15
|
-
end
|
16
|
-
|
17
|
-
# Copy CurationConcerns's solrconfig into the dir from which the jetty:config task pulls
|
18
|
-
# CurationConcerns's solrconfig includes full-text extraction
|
19
|
-
def copy_solr_config
|
20
|
-
src = File.join(__FILE__, '..', '..', '..', '..', '..', '..', 'solr_conf', 'conf', 'solrconfig.xml')
|
21
|
-
copy_file File.expand_path(src), 'solr_conf/conf/solrconfig.xml', force: true
|
22
|
-
end
|
23
|
-
|
24
|
-
# Copy config, schema, and jars into jetty dir if it exists
|
25
|
-
def reconfigure_jetty
|
26
|
-
rake "curation_concerns:jetty:config" if File.directory?('jetty')
|
27
|
-
end
|
28
|
-
end
|
@@ -1,10 +0,0 @@
|
|
1
|
-
module CurationConcerns
|
2
|
-
class ResqueAdmin
|
3
|
-
def self.matches?(request)
|
4
|
-
current_user = request.env['warden'].user
|
5
|
-
return false if current_user.blank?
|
6
|
-
# TODO code a group here that makes sense
|
7
|
-
#current_user.groups.include? 'umg/up.dlt.scholarsphere-admin'
|
8
|
-
end
|
9
|
-
end
|
10
|
-
end
|