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.
Files changed (99) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +2 -0
  3. data/Rakefile +1 -1
  4. data/app/actors/concerns/curation_concerns/manages_embargoes_actor.rb +11 -19
  5. data/app/actors/curation_concerns/base_actor.rb +41 -45
  6. data/app/actors/curation_concerns/embargo_actor.rb +19 -0
  7. data/app/actors/curation_concerns/file_set_actor.rb +200 -0
  8. data/app/actors/curation_concerns/lease_actor.rb +19 -0
  9. data/app/actors/curation_concerns/work_actor_behavior.rb +55 -58
  10. data/app/indexers/curation_concerns/collection_indexer.rb +10 -0
  11. data/app/indexers/curation_concerns/file_set_indexing_service.rb +24 -0
  12. data/app/{services/curation_concerns/generic_work_indexing_service.rb → indexers/curation_concerns/work_indexing_service.rb} +6 -6
  13. data/app/jobs/active_fedora_id_based_job.rb +5 -12
  14. data/app/jobs/audit_job.rb +11 -17
  15. data/app/jobs/characterize_job.rb +8 -7
  16. data/app/jobs/create_derivatives_job.rb +8 -11
  17. data/app/jobs/import_url_job.rb +12 -25
  18. data/app/jobs/ingest_file_job.rb +16 -0
  19. data/app/jobs/ingest_local_file_job.rb +14 -35
  20. data/app/jobs/resolrize_job.rb +3 -5
  21. data/app/jobs/upload_set_update_job.rb +68 -0
  22. data/app/models/checksum_audit_log.rb +2 -3
  23. data/app/models/concerns/curation_concerns/ability.rb +18 -10
  24. data/app/models/concerns/curation_concerns/basic_metadata.rb +1 -3
  25. data/app/models/concerns/curation_concerns/collection_behavior.rb +13 -14
  26. data/app/models/concerns/curation_concerns/file_set/belongs_to_upload_sets.rb +15 -0
  27. data/app/models/concerns/curation_concerns/{generic_file → file_set}/belongs_to_works.rb +8 -14
  28. data/app/models/concerns/curation_concerns/file_set/derivatives.rb +54 -0
  29. data/app/models/concerns/curation_concerns/{generic_file → file_set}/full_text_indexing.rb +1 -2
  30. data/app/models/concerns/curation_concerns/{generic_file → file_set}/indexing.rb +2 -2
  31. data/app/models/concerns/curation_concerns/{generic_file → file_set}/versions.rb +2 -3
  32. data/app/models/concerns/curation_concerns/file_set_behavior.rb +36 -0
  33. data/app/models/concerns/curation_concerns/generic_file.rb +1 -1
  34. data/app/models/concerns/curation_concerns/has_representative.rb +6 -7
  35. data/app/models/concerns/curation_concerns/human_readable_type.rb +5 -7
  36. data/app/models/concerns/curation_concerns/permissions.rb +2 -2
  37. data/app/models/concerns/curation_concerns/permissions/readable.rb +0 -1
  38. data/app/models/concerns/curation_concerns/permissions/writable.rb +10 -51
  39. data/app/models/concerns/curation_concerns/serializers.rb +3 -5
  40. data/app/models/concerns/curation_concerns/solr_document_behavior.rb +37 -40
  41. data/app/models/concerns/curation_concerns/upload_set_behavior.rb +38 -0
  42. data/app/models/concerns/curation_concerns/user.rb +4 -51
  43. data/app/models/concerns/curation_concerns/with_file_sets.rb +28 -0
  44. data/app/models/concerns/curation_concerns/{generic_work_behavior.rb → work_behavior.rb} +12 -6
  45. data/app/models/curation_concerns/classify_concern.rb +7 -7
  46. data/app/models/curation_concerns/quick_classification_query.rb +6 -7
  47. data/app/models/single_use_link.rb +34 -0
  48. data/app/models/upload_set.rb +3 -0
  49. data/app/services/curation_concerns/derivative_path.rb +32 -0
  50. data/app/services/curation_concerns/{generic_file_audit_service.rb → file_set_audit_service.rb} +17 -18
  51. data/app/services/curation_concerns/indexes_thumbnails.rb +14 -0
  52. data/app/services/curation_concerns/local_file_service.rb +10 -0
  53. data/app/services/curation_concerns/lock_manager.rb +40 -0
  54. data/app/services/curation_concerns/noid.rb +1 -1
  55. data/app/services/curation_concerns/persist_derivatives.rb +33 -0
  56. data/app/services/curation_concerns/persist_directly_contained_output_file_service.rb +26 -0
  57. data/app/services/curation_concerns/repository_audit_service.rb +1 -3
  58. data/app/services/curation_concerns/thumbnail_path_service.rb +46 -0
  59. data/app/services/curation_concerns/time_service.rb +7 -0
  60. data/app/services/curation_concerns/versioning_service.rb +11 -12
  61. data/curation_concerns-models.gemspec +6 -6
  62. data/lib/curation_concerns/configuration.rb +154 -0
  63. data/lib/curation_concerns/messages.rb +26 -26
  64. data/lib/curation_concerns/models.rb +5 -14
  65. data/lib/curation_concerns/models/engine.rb +0 -30
  66. data/lib/curation_concerns/models/utils.rb +4 -4
  67. data/lib/curation_concerns/models/version.rb +1 -1
  68. data/lib/generators/curation_concerns/models/abstract_migration_generator.rb +8 -7
  69. data/lib/generators/curation_concerns/models/clamav_generator.rb +3 -3
  70. data/lib/generators/curation_concerns/models/install_generator.rb +13 -20
  71. data/lib/generators/curation_concerns/models/templates/app/models/file_set.rb +4 -0
  72. data/lib/generators/curation_concerns/models/templates/config/clamav.rb +1 -1
  73. data/lib/generators/curation_concerns/models/templates/config/curation_concerns.rb +52 -65
  74. data/lib/generators/curation_concerns/models/templates/config/redis_config.rb +13 -17
  75. data/lib/generators/curation_concerns/models/templates/config/resque_config.rb +2 -1
  76. data/lib/generators/curation_concerns/models/templates/migrations/create_checksum_audit_logs.rb +3 -3
  77. data/lib/generators/curation_concerns/models/templates/migrations/create_single_use_links.rb +12 -0
  78. data/lib/tasks/curation_concerns-models_tasks.rake +4 -62
  79. data/lib/tasks/migrate.rake +1 -1
  80. data/lib/tasks/resque.rake +1 -0
  81. data/lib/tasks/solr_reindex.rake +1 -1
  82. metadata +59 -52
  83. data/app/actors/curation_concerns/generic_file_actor.rb +0 -150
  84. data/app/jobs/active_fedora_pid_based_job.rb +0 -6
  85. data/app/jobs/copy_permissions_job.rb +0 -24
  86. data/app/models/concerns/curation_concerns/generic_file/characterization.rb +0 -89
  87. data/app/models/concerns/curation_concerns/generic_file/content.rb +0 -8
  88. data/app/models/concerns/curation_concerns/generic_file/export.rb +0 -343
  89. data/app/models/concerns/curation_concerns/generic_file_behavior.rb +0 -44
  90. data/app/models/concerns/curation_concerns/with_basic_metadata.rb +0 -98
  91. data/app/models/concerns/curation_concerns/with_generic_files.rb +0 -29
  92. data/app/models/datastreams/fits_datastream.rb +0 -148
  93. data/app/services/curation_concerns/characterization_service.rb +0 -71
  94. data/app/services/curation_concerns/full_text_extraction_service.rb +0 -38
  95. data/app/services/curation_concerns/generic_file_indexing_service.rb +0 -14
  96. data/lib/curation_concerns/models/resque.rb +0 -36
  97. data/lib/generators/curation_concerns/models/fulltext_generator.rb +0 -28
  98. data/lib/generators/curation_concerns/models/templates/app/models/generic_file.rb +0 -4
  99. data/lib/generators/curation_concerns/models/templates/config/resque_admin.rb +0 -10
@@ -0,0 +1,4 @@
1
+ # Generated by curation_concerns:models:install
2
+ class FileSet < ActiveFedora::Base
3
+ include ::CurationConcerns::FileSetBehavior
4
+ end
@@ -1 +1 @@
1
- ClamAV.instance.loaddb() if defined? ClamAV
1
+ ClamAV.instance.loaddb if defined? ClamAV
@@ -1,4 +1,4 @@
1
- CurationConcerns.config do |config|
1
+ CurationConcerns.configure do |config|
2
2
  config.fits_to_desc_mapping = {
3
3
  file_title: :title,
4
4
  file_author: :creator
@@ -6,78 +6,62 @@ CurationConcerns.config do |config|
6
6
 
7
7
  config.max_days_between_audits = 7
8
8
 
9
- config.cc_licenses = {
10
- 'Attribution 3.0 United States' => 'http://creativecommons.org/licenses/by/3.0/us/',
11
- 'Attribution-ShareAlike 3.0 United States' => 'http://creativecommons.org/licenses/by-sa/3.0/us/',
12
- 'Attribution-NonCommercial 3.0 United States' => 'http://creativecommons.org/licenses/by-nc/3.0/us/',
13
- 'Attribution-NoDerivs 3.0 United States' => 'http://creativecommons.org/licenses/by-nd/3.0/us/',
14
- 'Attribution-NonCommercial-NoDerivs 3.0 United States' => 'http://creativecommons.org/licenses/by-nc-nd/3.0/us/',
15
- 'Attribution-NonCommercial-ShareAlike 3.0 United States' => 'http://creativecommons.org/licenses/by-nc-sa/3.0/us/',
16
- 'Public Domain Mark 1.0' => 'http://creativecommons.org/publicdomain/mark/1.0/',
17
- 'CC0 1.0 Universal' => 'http://creativecommons.org/publicdomain/zero/1.0/',
18
- 'All rights reserved' => 'All rights reserved'
19
- }
20
-
21
- config.cc_licenses_reverse = Hash[*config.cc_licenses.to_a.flatten.reverse]
22
-
23
9
  config.resource_types = {
24
- "Article" => "Article",
25
- "Audio" => "Audio",
26
- "Book" => "Book",
27
- "Capstone Project" => "Capstone Project",
28
- "Conference Proceeding" => "Conference Proceeding",
29
- "Dataset" => "Dataset",
30
- "Dissertation" => "Dissertation",
31
- "Image" => "Image",
32
- "Journal" => "Journal",
33
- "Map or Cartographic Material" => "Map or Cartographic Material",
34
- "Masters Thesis" => "Masters Thesis",
35
- "Part of Book" => "Part of Book",
36
- "Poster" => "Poster",
37
- "Presentation" => "Presentation",
38
- "Project" => "Project",
39
- "Report" => "Report",
40
- "Research Paper" => "Research Paper",
41
- "Software or Program Code" => "Software or Program Code",
42
- "Video" => "Video",
43
- "Other" => "Other",
10
+ 'Article' => 'Article',
11
+ 'Audio' => 'Audio',
12
+ 'Book' => 'Book',
13
+ 'Capstone Project' => 'Capstone Project',
14
+ 'Conference Proceeding' => 'Conference Proceeding',
15
+ 'Dataset' => 'Dataset',
16
+ 'Dissertation' => 'Dissertation',
17
+ 'Image' => 'Image',
18
+ 'Journal' => 'Journal',
19
+ 'Map or Cartographic Material' => 'Map or Cartographic Material',
20
+ 'Masters Thesis' => 'Masters Thesis',
21
+ 'Part of Book' => 'Part of Book',
22
+ 'Poster' => 'Poster',
23
+ 'Presentation' => 'Presentation',
24
+ 'Project' => 'Project',
25
+ 'Report' => 'Report',
26
+ 'Research Paper' => 'Research Paper',
27
+ 'Software or Program Code' => 'Software or Program Code',
28
+ 'Video' => 'Video',
29
+ 'Other' => 'Other'
44
30
  }
45
31
 
46
32
  config.resource_types_to_schema = {
47
- "Article" => "http://schema.org/Article",
48
- "Audio" => "http://schema.org/AudioObject",
49
- "Book" => "http://schema.org/Book",
50
- "Capstone Project" => "http://schema.org/CreativeWork",
51
- "Conference Proceeding" => "http://schema.org/ScholarlyArticle",
52
- "Dataset" => "http://schema.org/Dataset",
53
- "Dissertation" => "http://schema.org/ScholarlyArticle",
54
- "Image" => "http://schema.org/ImageObject",
55
- "Journal" => "http://schema.org/CreativeWork",
56
- "Map or Cartographic Material" => "http://schema.org/Map",
57
- "Masters Thesis" => "http://schema.org/ScholarlyArticle",
58
- "Part of Book" => "http://schema.org/Book",
59
- "Poster" => "http://schema.org/CreativeWork",
60
- "Presentation" => "http://schema.org/CreativeWork",
61
- "Project" => "http://schema.org/CreativeWork",
62
- "Report" => "http://schema.org/CreativeWork",
63
- "Research Paper" => "http://schema.org/ScholarlyArticle",
64
- "Software or Program Code" => "http://schema.org/Code",
65
- "Video" => "http://schema.org/VideoObject",
66
- "Other" => "http://schema.org/CreativeWork",
33
+ 'Article' => 'http://schema.org/Article',
34
+ 'Audio' => 'http://schema.org/AudioObject',
35
+ 'Book' => 'http://schema.org/Book',
36
+ 'Capstone Project' => 'http://schema.org/CreativeWork',
37
+ 'Conference Proceeding' => 'http://schema.org/ScholarlyArticle',
38
+ 'Dataset' => 'http://schema.org/Dataset',
39
+ 'Dissertation' => 'http://schema.org/ScholarlyArticle',
40
+ 'Image' => 'http://schema.org/ImageObject',
41
+ 'Journal' => 'http://schema.org/CreativeWork',
42
+ 'Map or Cartographic Material' => 'http://schema.org/Map',
43
+ 'Masters Thesis' => 'http://schema.org/ScholarlyArticle',
44
+ 'Part of Book' => 'http://schema.org/Book',
45
+ 'Poster' => 'http://schema.org/CreativeWork',
46
+ 'Presentation' => 'http://schema.org/CreativeWork',
47
+ 'Project' => 'http://schema.org/CreativeWork',
48
+ 'Report' => 'http://schema.org/CreativeWork',
49
+ 'Research Paper' => 'http://schema.org/ScholarlyArticle',
50
+ 'Software or Program Code' => 'http://schema.org/Code',
51
+ 'Video' => 'http://schema.org/VideoObject',
52
+ 'Other' => 'http://schema.org/CreativeWork'
67
53
  }
68
54
 
69
55
  config.permission_levels = {
70
- "Choose Access"=>"none",
71
- "View/Download" => "read",
72
- "Edit" => "edit"
56
+ 'Choose Access' => 'none',
57
+ 'View/Download' => 'read',
58
+ 'Edit' => 'edit'
73
59
  }
74
60
 
75
61
  config.owner_permission_levels = {
76
- "Edit" => "edit"
62
+ 'Edit' => 'edit'
77
63
  }
78
64
 
79
- config.queue = CurationConcerns::Resque::Queue
80
-
81
65
  # Enable displaying usage statistics in the UI
82
66
  # Defaults to FALSE
83
67
  # Requires a Google Analytics id and OAuth2 keyfile. See README for more info
@@ -95,6 +79,9 @@ CurationConcerns.config do |config|
95
79
  # Specify the form of hostpath to be used in Endnote exports
96
80
  # config.persistent_hostpath = 'http://localhost/files/'
97
81
 
82
+ # Location on local file system where derivatives will be stored.
83
+ # config.derivatives_path = File.join(Rails.root, 'tmp', 'derivatives')
84
+
98
85
  # If you have ffmpeg installed and want to transcode audio and video uncomment this line
99
86
  # config.enable_ffmpeg = true
100
87
 
@@ -105,6 +92,9 @@ CurationConcerns.config do |config|
105
92
  # Specify a different template for your repository's NOID IDs
106
93
  # config.noid_template = ".reeddeeddk"
107
94
 
95
+ # Store identifier minter's state in a file for later replayability
96
+ # config.minter_statefile = '/tmp/minter-state'
97
+
108
98
  # Specify the prefix for Redis keys:
109
99
  # config.redis_namespace = "curation_concerns"
110
100
 
@@ -115,9 +105,6 @@ CurationConcerns.config do |config|
115
105
  # Leaving it blank will set the start date to when ever the file was uploaded by
116
106
  # NOTE: if you have always sent analytics to GA for downloads and page views leave this commented out
117
107
  # config.analytic_start_date = DateTime.new(2014,9,10)
118
-
119
-
120
-
121
108
  end
122
109
 
123
- Date::DATE_FORMATS[:standard] = "%m/%d/%Y"
110
+ Date::DATE_FORMATS[:standard] = '%m/%d/%Y'
@@ -4,29 +4,25 @@ if defined?(PhusionPassenger)
4
4
  if forked
5
5
  # Re-establish redis connection
6
6
  require 'redis'
7
- config = YAML::load(ERB.new(IO.read(File.join(Rails.root, 'config', 'redis.yml'))).result)[Rails.env].with_indifferent_access
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
10
  $redis.client.disconnect if $redis
11
- $redis = Redis.new(host: config[:host], port: config[:port], thread_safe: true) rescue nil
11
+ $redis = begin
12
+ Redis.new(host: config[:host], port: config[:port], thread_safe: true)
13
+ rescue
14
+ nil
15
+ end
12
16
  Resque.redis = $redis
17
+ Resque.redis.namespace = "#{CurationConcerns.config.redis_namespace}:#{Rails.env}"
13
18
  Resque.redis.client.reconnect if Resque.redis
14
19
  end
15
20
  end
16
21
  else
17
- config = YAML::load(ERB.new(IO.read(File.join(Rails.root, 'config', 'redis.yml'))).result)[Rails.env].with_indifferent_access
18
- $redis = Redis.new(host: config[:host], port: config[:port], thread_safe: true) rescue nil
19
- end
20
-
21
-
22
- # Code borrowed from Obie's Redis patterns talk at RailsConf'12
23
- Nest.class_eval do
24
- def initialize(key, redis=$redis)
25
- super(key.to_param)
26
- @redis = redis
27
- end
28
-
29
- def [](key)
30
- self.class.new("#{self}:#{key.to_param}", @redis)
31
- end
22
+ config = YAML.load(ERB.new(IO.read(File.join(Rails.root, 'config', 'redis.yml'))).result)[Rails.env].with_indifferent_access
23
+ $redis = begin
24
+ Redis.new(host: config[:host], port: config[:port], thread_safe: true)
25
+ rescue
26
+ nil
27
+ end
32
28
  end
@@ -1,4 +1,5 @@
1
- config = YAML::load(ERB.new(IO.read(File.join(Rails.root, 'config', 'redis.yml'))).result)[Rails.env].with_indifferent_access
1
+ require 'resque'
2
+ config = YAML.load(ERB.new(IO.read(File.join(Rails.root, 'config', 'redis.yml'))).result)[Rails.env].with_indifferent_access
2
3
  Resque.redis = Redis.new(host: config[:host], port: config[:port], thread_safe: true)
3
4
 
4
5
  Resque.inline = Rails.env.test?
@@ -1,7 +1,7 @@
1
1
  class CreateChecksumAuditLogs < ActiveRecord::Migration
2
2
  def self.up
3
3
  create_table :checksum_audit_logs do |t|
4
- t.string :generic_file_id
4
+ t.string :file_set_id
5
5
  t.string :file_id
6
6
  t.string :version
7
7
  t.integer :pass
@@ -9,11 +9,11 @@ class CreateChecksumAuditLogs < ActiveRecord::Migration
9
9
  t.string :actual_result
10
10
  t.timestamps
11
11
  end
12
- add_index :checksum_audit_logs, [:generic_file_id, :file_id], name: 'by_generic_file_id_and_file_id', order: {created_at: "DESC" }
12
+ add_index :checksum_audit_logs, [:file_set_id, :file_id], name: 'by_file_set_id_and_file_id', order: { created_at: 'DESC' }
13
13
  end
14
14
 
15
15
  def self.down
16
- remove_index(:checksum_audit_logs, name: 'by_generic_file_id_and_file_id')
16
+ remove_index(:checksum_audit_logs, name: 'by_file_set_id_and_file_id')
17
17
  drop_table :checksum_audit_logs
18
18
  end
19
19
  end
@@ -0,0 +1,12 @@
1
+ class CreateSingleUseLinks < ActiveRecord::Migration
2
+ def change
3
+ create_table :single_use_links do |t|
4
+ t.string :downloadKey
5
+ t.string :path
6
+ t.string :itemId
7
+ t.datetime :expires
8
+
9
+ t.timestamps
10
+ end
11
+ end
12
+ end
@@ -1,75 +1,17 @@
1
- require 'net/http'
1
+ import File.join(Gem::Specification.find_by_name('hydra-works').gem_dir,
2
+ 'lib/tasks/hydra-works_tasks.rake')
2
3
 
3
4
  namespace :curation_concerns do
4
5
  namespace :jetty do
5
6
 
6
- FULLTEXT_JARS = %w(
7
- org/apache/james/apache-mime4j-core/0.7.2/apache-mime4j-core-0.7.2.jar
8
- org/apache/james/apache-mime4j-dom/0.7.2/apache-mime4j-dom-0.7.2.jar
9
- org/apache/solr/solr-cell/4.0.0/solr-cell-4.0.0.jar
10
- org/bouncycastle/bcmail-jdk15/1.45/bcmail-jdk15-1.45.jar
11
- org/bouncycastle/bcprov-jdk15/1.45/bcprov-jdk15-1.45.jar
12
- de/l3s/boilerpipe/boilerpipe/1.1.0/boilerpipe-1.1.0.jar
13
- org/apache/commons/commons-compress/1.4.1/commons-compress-1.4.1.jar
14
- dom4j/dom4j/1.6.1/dom4j-1.6.1.jar
15
- org/apache/pdfbox/fontbox/1.7.0/fontbox-1.7.0.jar
16
- com/ibm/icu/icu4j/49.1/icu4j-49.1.jar
17
- com/googlecode/mp4parser/isoparser/1.0-RC-1/isoparser-1.0-RC-1.jar
18
- jdom/jdom/1.0/jdom-1.0.jar
19
- org/apache/pdfbox/jempbox/1.7.0/jempbox-1.7.0.jar
20
- com/googlecode/juniversalchardet/juniversalchardet/1.0.3/juniversalchardet-1.0.3.jar
21
- com/drewnoakes/metadata-extractor/2.4.0-beta-1/metadata-extractor-2.4.0-beta-1.jar
22
- edu/ucar/netcdf/4.2-min/netcdf-4.2-min.jar
23
- org/apache/pdfbox/pdfbox/1.7.0/pdfbox-1.7.0.jar
24
- org/apache/poi/poi/3.8/poi-3.8.jar
25
- org/apache/poi/poi-ooxml/3.8/poi-ooxml-3.8.jar
26
- org/apache/poi/poi-ooxml-schemas/3.8/poi-ooxml-schemas-3.8.jar
27
- org/apache/poi/poi-scratchpad/3.8/poi-scratchpad-3.8.jar
28
- rome/rome/0.9/rome-0.9.jar
29
- org/ccil/cowan/tagsoup/tagsoup/1.2.1/tagsoup-1.2.1.jar
30
- org/apache/tika/tika-core/1.2/tika-core-1.2.jar
31
- org/apache/tika/tika-parsers/1.2/tika-parsers-1.2.jar
32
- org/gagravarr/vorbis-java-core/0.1/vorbis-java-core-0.1.jar
33
- org/gagravarr/vorbis-java-tika/0.1/vorbis-java-tika-0.1.jar
34
- xerces/xercesImpl/2.9.1/xercesImpl-2.9.1.jar
35
- org/apache/xmlbeans/xmlbeans/2.3.0/xmlbeans-2.3.0.jar
36
- org/tukaani/xz/1.0/xz-1.0.jar
37
- org/aspectj/aspectjrt/1.8.5/aspectjrt-1.8.5.jar
38
- )
39
-
40
7
  desc 'Configure jetty with full-text indexing'
41
8
  task config: :download_jars do
42
9
  Rake::Task['jetty:config'].invoke
43
10
  end
44
11
 
45
- desc 'Download Solr full-text extraction jars'
12
+ desc 'Download Solr full-text extraction jars using Hydra::Works'
46
13
  task :download_jars do
47
- puts "Downloading full-text jars from maven.org ..."
48
- fulltext_dir = 'jetty/solr/lib/contrib/extraction/lib'
49
- FileUtils.mkdir_p(fulltext_dir) unless File.directory?(fulltext_dir)
50
- Dir.chdir(fulltext_dir) do
51
- FULLTEXT_JARS.each do |jar|
52
- destination = jar.split('/').last
53
- download_from_maven(jar, destination) unless File.exists?(destination)
54
- end
55
- end
56
- end
57
- end
58
- end
59
-
60
- def download_from_maven url, dst
61
- full_url = '/remotecontent?filepath=' + url
62
- file = File.open(dst, "wb")
63
- endpoint = Net::HTTP.new('search.maven.org', 443)
64
- endpoint.use_ssl = true
65
- endpoint.start do |http|
66
- puts "Fetching #{full_url}"
67
- begin
68
- http.request_get(full_url) do |resp|
69
- resp.read_body { |segment| file.write(segment) }
70
- end
71
- ensure
72
- file.close
14
+ Rake::Task['hydra_works:jetty:download_jars'].invoke
73
15
  end
74
16
  end
75
17
  end
@@ -4,7 +4,7 @@
4
4
  desc "Migrate audit logs"
5
5
  task audit_logs: :environment do
6
6
  ChecksumAuditLog.all.each do |cs|
7
- cs.generic_file_id = cs.generic_file_id.delete "#{CurationConcerns.config.redis_namespace}:"
7
+ cs.file_set_id = cs.file_set_id.delete "#{CurationConcerns.config.redis_namespace}:"
8
8
  cs.save
9
9
  end
10
10
  end
@@ -6,6 +6,7 @@ task 'resque:setup' => :environment
6
6
  # Set up resque-pool
7
7
  task 'resque:pool:setup' do
8
8
  ActiveRecord::Base.connection.disconnect!
9
+ require 'resque/pool'
9
10
  Resque::Pool.after_prefork do |job|
10
11
  ActiveRecord::Base.establish_connection
11
12
  Resque.redis.client.reconnect
@@ -2,7 +2,7 @@ namespace :curation_concerns do
2
2
  namespace :solr do
3
3
  desc "Enqueue a job to resolrize the repository objects"
4
4
  task reindex: :environment do
5
- CurationConcerns.queue.push(ResolrizeJob.new)
5
+ ResolrizeJob.perform_later
6
6
  end
7
7
  end
8
8
  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.1.0
4
+ version: 0.2.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: 2015-08-18 00:00:00.000000000 Z
11
+ date: 2015-10-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: active_attr
@@ -25,117 +25,117 @@ dependencies:
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
- name: nest
28
+ name: hydra-collections
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '1.1'
33
+ version: 6.0.0.rc1
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: '1.1'
40
+ version: 6.0.0.rc1
41
41
  - !ruby/object:Gem::Dependency
42
- name: hydra-collections
42
+ name: hydra-head
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 6.0.0.alpha
47
+ version: '9.3'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: 6.0.0.alpha
54
+ version: '9.3'
55
55
  - !ruby/object:Gem::Dependency
56
- name: hydra-head
56
+ name: hydra-works
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: 9.2.2
61
+ version: '0.3'
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: 9.2.2
68
+ version: '0.3'
69
69
  - !ruby/object:Gem::Dependency
70
- name: hydra-works
70
+ name: active_fedora-noid
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: '0.1'
75
+ version: '1.0'
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: '0.1'
82
+ version: '1.0'
83
83
  - !ruby/object:Gem::Dependency
84
- name: active-fedora
84
+ name: resque
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
87
  - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: 9.3.0
89
+ version: '1.23'
90
90
  type: :runtime
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: 9.3.0
96
+ version: '1.23'
97
97
  - !ruby/object:Gem::Dependency
98
- name: active_fedora-noid
98
+ name: resque-pool
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
101
  - - "~>"
102
102
  - !ruby/object:Gem::Version
103
- version: 1.0.2
103
+ version: '0.3'
104
104
  type: :runtime
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
108
  - - "~>"
109
109
  - !ruby/object:Gem::Version
110
- version: 1.0.2
110
+ version: '0.3'
111
111
  - !ruby/object:Gem::Dependency
112
- name: resque
112
+ name: qa
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
115
  - - "~>"
116
116
  - !ruby/object:Gem::Version
117
- version: '1.23'
117
+ version: '0.5'
118
118
  type: :runtime
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
122
  - - "~>"
123
123
  - !ruby/object:Gem::Version
124
- version: '1.23'
124
+ version: '0.5'
125
125
  - !ruby/object:Gem::Dependency
126
- name: resque-pool
126
+ name: redlock
127
127
  requirement: !ruby/object:Gem::Requirement
128
128
  requirements:
129
129
  - - "~>"
130
130
  - !ruby/object:Gem::Version
131
- version: '0.3'
131
+ version: 0.1.2
132
132
  type: :runtime
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
136
  - - "~>"
137
137
  - !ruby/object:Gem::Version
138
- version: '0.3'
138
+ version: 0.1.2
139
139
  - !ruby/object:Gem::Dependency
140
140
  name: bundler
141
141
  requirement: !ruby/object:Gem::Requirement
@@ -179,31 +179,34 @@ files:
179
179
  - Rakefile
180
180
  - app/actors/concerns/curation_concerns/manages_embargoes_actor.rb
181
181
  - app/actors/curation_concerns/base_actor.rb
182
- - app/actors/curation_concerns/generic_file_actor.rb
182
+ - app/actors/curation_concerns/embargo_actor.rb
183
+ - app/actors/curation_concerns/file_set_actor.rb
184
+ - app/actors/curation_concerns/lease_actor.rb
183
185
  - app/actors/curation_concerns/work_actor_behavior.rb
186
+ - app/indexers/curation_concerns/collection_indexer.rb
187
+ - app/indexers/curation_concerns/file_set_indexing_service.rb
188
+ - app/indexers/curation_concerns/work_indexing_service.rb
184
189
  - app/jobs/active_fedora_id_based_job.rb
185
- - app/jobs/active_fedora_pid_based_job.rb
186
190
  - app/jobs/audit_job.rb
187
191
  - app/jobs/characterize_job.rb
188
- - app/jobs/copy_permissions_job.rb
189
192
  - app/jobs/create_derivatives_job.rb
190
193
  - app/jobs/import_url_job.rb
194
+ - app/jobs/ingest_file_job.rb
191
195
  - app/jobs/ingest_local_file_job.rb
192
196
  - app/jobs/resolrize_job.rb
197
+ - app/jobs/upload_set_update_job.rb
193
198
  - app/models/checksum_audit_log.rb
194
199
  - app/models/concerns/curation_concerns/ability.rb
195
200
  - app/models/concerns/curation_concerns/basic_metadata.rb
196
201
  - app/models/concerns/curation_concerns/collection_behavior.rb
202
+ - app/models/concerns/curation_concerns/file_set/belongs_to_upload_sets.rb
203
+ - app/models/concerns/curation_concerns/file_set/belongs_to_works.rb
204
+ - app/models/concerns/curation_concerns/file_set/derivatives.rb
205
+ - app/models/concerns/curation_concerns/file_set/full_text_indexing.rb
206
+ - app/models/concerns/curation_concerns/file_set/indexing.rb
207
+ - app/models/concerns/curation_concerns/file_set/versions.rb
208
+ - app/models/concerns/curation_concerns/file_set_behavior.rb
197
209
  - app/models/concerns/curation_concerns/generic_file.rb
198
- - app/models/concerns/curation_concerns/generic_file/belongs_to_works.rb
199
- - app/models/concerns/curation_concerns/generic_file/characterization.rb
200
- - app/models/concerns/curation_concerns/generic_file/content.rb
201
- - app/models/concerns/curation_concerns/generic_file/export.rb
202
- - app/models/concerns/curation_concerns/generic_file/full_text_indexing.rb
203
- - app/models/concerns/curation_concerns/generic_file/indexing.rb
204
- - app/models/concerns/curation_concerns/generic_file/versions.rb
205
- - app/models/concerns/curation_concerns/generic_file_behavior.rb
206
- - app/models/concerns/curation_concerns/generic_work_behavior.rb
207
210
  - app/models/concerns/curation_concerns/has_representative.rb
208
211
  - app/models/concerns/curation_concerns/human_readable_type.rb
209
212
  - app/models/concerns/curation_concerns/permissions.rb
@@ -211,44 +214,49 @@ files:
211
214
  - app/models/concerns/curation_concerns/permissions/writable.rb
212
215
  - app/models/concerns/curation_concerns/serializers.rb
213
216
  - app/models/concerns/curation_concerns/solr_document_behavior.rb
217
+ - app/models/concerns/curation_concerns/upload_set_behavior.rb
214
218
  - app/models/concerns/curation_concerns/user.rb
215
- - app/models/concerns/curation_concerns/with_basic_metadata.rb
216
- - app/models/concerns/curation_concerns/with_generic_files.rb
219
+ - app/models/concerns/curation_concerns/with_file_sets.rb
220
+ - app/models/concerns/curation_concerns/work_behavior.rb
217
221
  - app/models/curation_concerns/classify_concern.rb
218
222
  - app/models/curation_concerns/quick_classification_query.rb
219
- - app/models/datastreams/fits_datastream.rb
223
+ - app/models/single_use_link.rb
224
+ - app/models/upload_set.rb
220
225
  - app/models/version_committer.rb
221
- - app/services/curation_concerns/characterization_service.rb
222
- - app/services/curation_concerns/full_text_extraction_service.rb
223
- - app/services/curation_concerns/generic_file_audit_service.rb
224
- - app/services/curation_concerns/generic_file_indexing_service.rb
225
- - app/services/curation_concerns/generic_work_indexing_service.rb
226
+ - app/services/curation_concerns/derivative_path.rb
227
+ - app/services/curation_concerns/file_set_audit_service.rb
228
+ - app/services/curation_concerns/indexes_thumbnails.rb
229
+ - app/services/curation_concerns/local_file_service.rb
230
+ - app/services/curation_concerns/lock_manager.rb
226
231
  - app/services/curation_concerns/noid.rb
232
+ - app/services/curation_concerns/persist_derivatives.rb
233
+ - app/services/curation_concerns/persist_directly_contained_output_file_service.rb
227
234
  - app/services/curation_concerns/repository_audit_service.rb
235
+ - app/services/curation_concerns/thumbnail_path_service.rb
236
+ - app/services/curation_concerns/time_service.rb
228
237
  - app/services/curation_concerns/versioning_service.rb
229
238
  - config/locales/curation_concerns.en.yml
230
239
  - curation_concerns-models.gemspec
240
+ - lib/curation_concerns/configuration.rb
231
241
  - lib/curation_concerns/messages.rb
232
242
  - lib/curation_concerns/models.rb
233
243
  - lib/curation_concerns/models/engine.rb
234
- - lib/curation_concerns/models/resque.rb
235
244
  - lib/curation_concerns/models/utils.rb
236
245
  - lib/curation_concerns/models/version.rb
237
246
  - lib/generators/curation_concerns/models/abstract_migration_generator.rb
238
247
  - lib/generators/curation_concerns/models/clamav_generator.rb
239
- - lib/generators/curation_concerns/models/fulltext_generator.rb
240
248
  - lib/generators/curation_concerns/models/install_generator.rb
241
249
  - lib/generators/curation_concerns/models/templates/app/models/collection.rb
242
- - lib/generators/curation_concerns/models/templates/app/models/generic_file.rb
250
+ - lib/generators/curation_concerns/models/templates/app/models/file_set.rb
243
251
  - lib/generators/curation_concerns/models/templates/config/clamav.rb
244
252
  - lib/generators/curation_concerns/models/templates/config/curation_concerns.rb
245
253
  - lib/generators/curation_concerns/models/templates/config/mime_types.rb
246
254
  - lib/generators/curation_concerns/models/templates/config/redis.yml
247
255
  - lib/generators/curation_concerns/models/templates/config/redis_config.rb
248
256
  - lib/generators/curation_concerns/models/templates/config/resque-pool.yml
249
- - lib/generators/curation_concerns/models/templates/config/resque_admin.rb
250
257
  - lib/generators/curation_concerns/models/templates/config/resque_config.rb
251
258
  - lib/generators/curation_concerns/models/templates/migrations/create_checksum_audit_logs.rb
259
+ - lib/generators/curation_concerns/models/templates/migrations/create_single_use_links.rb
252
260
  - lib/generators/curation_concerns/models/templates/migrations/create_version_committers.rb
253
261
  - lib/tasks/curation_concerns-models_tasks.rake
254
262
  - lib/tasks/migrate.rake
@@ -274,9 +282,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
274
282
  version: '0'
275
283
  requirements: []
276
284
  rubyforge_project:
277
- rubygems_version: 2.4.5
285
+ rubygems_version: 2.4.5.1
278
286
  signing_key:
279
287
  specification_version: 4
280
288
  summary: Simple institutional repository models for Hydra
281
289
  test_files: []
282
- has_rdoc: