sufia 3.1.0 → 3.1.1

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.
Files changed (33) hide show
  1. checksums.yaml +4 -4
  2. data/History.md +10 -0
  3. data/SUFIA_VERSION +1 -1
  4. data/lib/generators/sufia/sufia_generator.rb +18 -85
  5. data/lib/sufia/controller.rb +1 -1
  6. data/lib/sufia/version.rb +1 -1
  7. data/sufia-models/lib/generators/sufia/models/install_generator.rb +99 -0
  8. data/sufia-models/lib/generators/sufia/models/templates/config/clamav.rb +1 -0
  9. data/sufia-models/lib/generators/sufia/models/templates/config/mailboxer.rb +17 -0
  10. data/{lib/generators/sufia → sufia-models/lib/generators/sufia/models}/templates/config/redis.yml +0 -0
  11. data/{lib/generators/sufia → sufia-models/lib/generators/sufia/models}/templates/config/redis_config.rb +1 -1
  12. data/{lib/generators/sufia → sufia-models/lib/generators/sufia/models}/templates/config/resque_admin.rb +0 -0
  13. data/{lib/generators/sufia → sufia-models/lib/generators/sufia/models}/templates/config/resque_config.rb +1 -1
  14. data/sufia-models/lib/generators/sufia/models/templates/config/setup_mail.rb +3 -0
  15. data/sufia-models/lib/generators/sufia/models/templates/config/sufia.rb +81 -0
  16. data/sufia-models/lib/generators/sufia/models/templates/migrations/acts_as_follower_migration.rb +17 -0
  17. data/sufia-models/lib/generators/sufia/models/templates/migrations/add_avatars_to_users.rb +9 -0
  18. data/sufia-models/lib/generators/sufia/models/templates/migrations/add_groups_to_users.rb +11 -0
  19. data/sufia-models/lib/generators/sufia/models/templates/migrations/add_ldap_attrs_to_user.rb +27 -0
  20. data/sufia-models/lib/generators/sufia/models/templates/migrations/add_social_to_users.rb +13 -0
  21. data/sufia-models/lib/generators/sufia/models/templates/migrations/create_checksum_audit_logs.rb +20 -0
  22. data/sufia-models/lib/generators/sufia/models/templates/migrations/create_local_authorities.rb +50 -0
  23. data/sufia-models/lib/generators/sufia/models/templates/migrations/create_single_use_links.rb +12 -0
  24. data/sufia-models/lib/generators/sufia/models/templates/migrations/create_trophies.rb +10 -0
  25. data/sufia-models/lib/generators/sufia/models/templates/migrations/create_version_committers.rb +15 -0
  26. data/sufia-models/lib/sufia/models/jobs/batch_update_job.rb +2 -2
  27. data/sufia-models/lib/sufia/models/version.rb +1 -1
  28. data/tasks/sufia-dev.rake +0 -1
  29. metadata +23 -12
  30. data/lib/generators/sufia/templates/config/clamav.rb +0 -14
  31. data/lib/generators/sufia/templates/config/mailboxer.rb +0 -31
  32. data/lib/generators/sufia/templates/config/setup_mail.rb +0 -17
  33. data/lib/generators/sufia/templates/config/sufia.rb +0 -82
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 94bdabbd0da949b6909f8a09f6c6db08910fa0d8
4
- data.tar.gz: 363c5ec11e4dc93850a79dbf7cdd8a9a9a231870
3
+ metadata.gz: 9537c0a90f4be9d2b36af8a62645507199ffc77a
4
+ data.tar.gz: e536d9a829d4be48d76cbbdbf2eb12a3950f044f
5
5
  SHA512:
6
- metadata.gz: 38714b26c3d16dfcb2ff8da8e03515ecff0bbd9171fb75c568f828aa327e64bbb7b2d0ffea855fbf9286ed64a77098f5e4c114682a6c2b470353ca4b35893006
7
- data.tar.gz: 2c48c93673ec0fc8d540f801a945cf0ac10f0cbc487406ad3ddb91afad2e2a8e2d4e9567627135060cc32fadcb1618d3e06c0f583a15f61c1616322d5f2f9631
6
+ metadata.gz: 6f23c82aa2258904b7cf4e5d15b898f0b03b0ece32b811fe2ef8b24625e554ddae9bbb4df1e2f82f96a618974d4060264499c60759129e20e48bf02f2ba5b284
7
+ data.tar.gz: 2e1a0d550205dc06fec99458409b305e527d87d605e1720bfb99c42e228008c31cbc321e8bdf57fe39356d3c7b52ea6f6ec9264e1eeb42e1c74822d503bb0ec1
data/History.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # History of Sufia releases
2
2
 
3
+ ## 3.1.1
4
+ * Extracting sufia generator behavior [Jeremy Friesen]
5
+
6
+ * Don't use Sufia::Engine in the generated initializer [Justin Coyne]
7
+
8
+ * Removed unused code [Justin Coyne]
9
+
10
+ * Changed from a tag to span. fixes #32 [Carolyn Cole]
11
+
12
+
3
13
  ## 3.1.0
4
14
  * Make fits instructions more verbose [Carolyn Cole]
5
15
 
@@ -1 +1 @@
1
- 3.1.0
1
+ 3.1.1
@@ -1,85 +1,46 @@
1
1
  # -*- encoding : utf-8 -*-
2
2
  require 'rails/generators'
3
- require 'rails/generators/migration'
3
+ require 'rails/generators/migration'
4
4
 
5
5
  class SufiaGenerator < Rails::Generators::Base
6
6
  include Rails::Generators::Migration
7
7
 
8
8
  source_root File.expand_path('../templates', __FILE__)
9
-
9
+
10
10
  argument :model_name, :type => :string , :default => "user"
11
11
  desc """
12
12
  This generator makes the following changes to your application:
13
- 1. Creates several database migrations if they do not exist in /db/migrate
14
- 2. Adds user behavior to the user model
15
- 3. Adds controller behavior to the application controller
16
- 4. Creates the sufia.rb configuration file
17
- 5. Copies the catalog controller into the local app
18
- 6. Adds Sufia::SolrDocumentBehavior to app/models/solr_document.rb
19
- 7. Generates mailboxer
20
- """
21
-
22
- # Implement the required interface for Rails::Generators::Migration.
23
- # taken from http://github.com/rails/rails/blob/master/activerecord/lib/generators/active_record.rb
24
- def self.next_migration_number(path)
25
- unless @prev_migration_nr
26
- @prev_migration_nr = Time.now.utc.strftime("%Y%m%d%H%M%S").to_i
27
- else
28
- @prev_migration_nr += 1
29
- end
30
- @prev_migration_nr.to_s
31
- end
13
+ 1. Runs sufia-models:install
14
+ 2. Adds controller behavior to the application controller
15
+ 3. Copies the catalog controller into the local app
16
+ """
32
17
 
33
- # Setup the database migrations
34
- def copy_migrations
35
- # Can't get this any more DRY, because we need this order.
36
- %w{acts_as_follower_migration.rb add_social_to_users.rb create_single_use_links.rb add_ldap_attrs_to_user.rb
37
- add_avatars_to_users.rb create_checksum_audit_logs.rb create_version_committers.rb
38
- add_groups_to_users.rb create_local_authorities.rb create_trophies.rb}.each do |f|
39
- better_migration_template f
40
- end
41
- end
42
-
43
- # Add behaviors to the user model
44
- def inject_sufia_user_behavior
45
- file_path = "app/models/#{model_name.underscore}.rb"
46
- if File.exists?(file_path)
47
- inject_into_class file_path, model_name.classify do
48
- "# Connects this user object to Sufia behaviors. " +
49
- "\n include Sufia::User\n"
50
- end
51
- else
52
- puts " \e[31mFailure\e[0m Sufia requires a user object. This generators assumes that the model is defined in the file #{file_path}, which does not exist. If you used a different name, please re-run the generator and provide that name as an argument. Such as \b rails -g sufia client"
53
- end
18
+ def run_required_generators
19
+ generate "blacklight --devise"
20
+ generate "hydra:head -f"
21
+ generate "sufia:models:install"
54
22
  end
55
23
 
56
24
  # Add behaviors to the application controller
57
- def inject_sufia_controller_behavior
25
+ def inject_sufia_controller_behavior
58
26
  controller_name = "ApplicationController"
59
27
  file_path = "app/controllers/application_controller.rb"
60
- if File.exists?(file_path)
61
- insert_into_file file_path, :after => 'include Blacklight::Controller' do
62
- " \n# Adds Sufia behaviors into the application controller \n" +
28
+ if File.exists?(file_path)
29
+ insert_into_file file_path, :after => 'include Blacklight::Controller' do
30
+ " \n# Adds Sufia behaviors into the application controller \n" +
63
31
  " include Sufia::Controller\n"
64
32
  end
65
33
  gsub_file file_path, "layout 'blacklight'", "layout :search_layout"
66
34
  else
67
- puts " \e[31mFailure\e[0m Could not find #{file_path}. To add Sufia behaviors to your Controllers, you must include the Sufia::Controller module in the Controller class definition."
35
+ puts " \e[31mFailure\e[0m Could not find #{file_path}. To add Sufia behaviors to your Controllers, you must include the Sufia::Controller module in the Controller class definition."
68
36
  end
69
37
  end
70
-
71
- def create_configuration_files
72
- copy_file "config/sufia.rb", "config/initializers/sufia.rb"
73
- copy_file "config/redis.yml", "config/redis.yml"
74
- copy_file "config/redis_config.rb", "config/initializers/redis_config.rb"
75
- copy_file "config/resque_admin.rb", "config/initializers/resque_admin.rb"
76
- copy_file "config/resque_config.rb", "config/initializers/resque_config.rb"
77
- end
38
+
78
39
 
79
40
  def catalog_controller
80
41
  copy_file "catalog_controller.rb", "app/controllers/catalog_controller.rb"
81
42
  end
82
-
43
+
83
44
 
84
45
  # The engine routes have to come after the devise routes so that /users/sign_in will work
85
46
  def inject_routes
@@ -92,37 +53,9 @@ add_groups_to_users.rb create_local_authorities.rb create_trophies.rb}.each do
92
53
  mount Sufia::Engine => '/'\n"
93
54
  sentinel = /devise_for :users/
94
55
  inject_into_file 'config/routes.rb', routing_code, { :after => sentinel, :verbose => false }
95
-
96
- end
97
-
98
- # Add behaviors to the SolrDocument model
99
- def inject_sufia_solr_document_behavior
100
- file_path = "app/models/solr_document.rb"
101
- if File.exists?(file_path)
102
- inject_into_class file_path, "SolrDocument" do
103
- " # Adds Sufia behaviors to the SolrDocument.\n" +
104
- " include Sufia::SolrDocumentBehavior\n"
105
- end
106
- else
107
- puts " \e[31mFailure\e[0m Sufia requires a SolrDocument object. This generators assumes that the model is defined in the file #{file_path}, which does not exist."
108
- end
109
- end
110
56
 
111
- def install_mailboxer
112
- generate "mailboxer:install"
113
- end
114
-
115
- private
116
-
117
- def better_migration_template (file)
118
- begin
119
- migration_template "migrations/#{file}", "db/migrate/#{file}"
120
- sleep 1 # ensure scripts have different time stamps
121
- rescue
122
- puts " \e[1m\e[34mMigrations\e[0m " + $!.message
123
- end
124
57
  end
125
58
 
126
- end
59
+ end
127
60
 
128
61
 
@@ -53,7 +53,7 @@ module Sufia::Controller
53
53
  return if action_name == "index" && controller_name == "mailbox"
54
54
  if user_signed_in?
55
55
  @notify_number= current_user.mailbox.inbox(:unread => true).count
56
- @batches=current_user.mailbox.inbox.map {|msg| msg.last_message.body[/<a class="batchid ui-helper-hidden">(.*)<\/a>The file(.*)/,1]}.select{|val| !val.blank?}
56
+ @batches=current_user.mailbox.inbox.map {|msg| msg.last_message.body[/<span class="batchid ui-helper-hidden">(.*)<\/span>The file(.*)/,1]}.select{|val| !val.blank?}
57
57
  end
58
58
  end
59
59
 
@@ -1,3 +1,3 @@
1
1
  module Sufia
2
- VERSION = "3.1.0"
2
+ VERSION = "3.1.1"
3
3
  end
@@ -0,0 +1,99 @@
1
+ # -*- encoding : utf-8 -*-
2
+ require 'rails/generators'
3
+ require 'rails/generators/migration'
4
+
5
+ class Sufia::Models::InstallGenerator < Rails::Generators::Base
6
+ include Rails::Generators::Migration
7
+
8
+ source_root File.expand_path('../templates', __FILE__)
9
+
10
+ argument :model_name, :type => :string , :default => "user"
11
+ desc """
12
+ This generator makes the following changes to your application:
13
+ 1. Creates several database migrations if they do not exist in /db/migrate
14
+ 2. Adds user behavior to the user model
15
+ 3. Creates the sufia.rb configuration file
16
+ 4. Adds Sufia::SolrDocumentBehavior to app/models/solr_document.rb
17
+ 5. Generates mailboxer
18
+ """
19
+
20
+ # Implement the required interface for Rails::Generators::Migration.
21
+ # taken from http://github.com/rails/rails/blob/master/activerecord/lib/generators/active_record.rb
22
+ def self.next_migration_number(path)
23
+ unless @prev_migration_nr
24
+ @prev_migration_nr = Time.now.utc.strftime("%Y%m%d%H%M%S").to_i
25
+ else
26
+ @prev_migration_nr += 1
27
+ end
28
+ @prev_migration_nr.to_s
29
+ end
30
+
31
+ # Setup the database migrations
32
+ def copy_migrations
33
+ # Can't get this any more DRY, because we need this order.
34
+ [
35
+ "acts_as_follower_migration.rb",
36
+ "add_social_to_users.rb",
37
+ "create_single_use_links.rb",
38
+ "add_ldap_attrs_to_user.rb",
39
+ "add_avatars_to_users.rb",
40
+ "create_checksum_audit_logs.rb",
41
+ "create_version_committers.rb",
42
+ "add_groups_to_users.rb",
43
+ "create_local_authorities.rb",
44
+ "create_trophies.rb"
45
+ ].each do |f|
46
+ better_migration_template f
47
+ end
48
+ end
49
+
50
+ # Add behaviors to the user model
51
+ def inject_sufia_user_behavior
52
+ file_path = "app/models/#{model_name.underscore}.rb"
53
+ if File.exists?(file_path)
54
+ inject_into_class file_path, model_name.classify do
55
+ "# Connects this user object to Sufia behaviors. " +
56
+ "\n include Sufia::User\n"
57
+ end
58
+ else
59
+ puts " \e[31mFailure\e[0m Sufia requires a user object. This generators assumes that the model is defined in the file #{file_path}, which does not exist. If you used a different name, please re-run the generator and provide that name as an argument. Such as \b rails -g sufia client"
60
+ end
61
+ end
62
+
63
+ def create_configuration_files
64
+ copy_file "config/sufia.rb", "config/initializers/sufia.rb"
65
+ copy_file "config/redis.yml", "config/redis.yml"
66
+ copy_file "config/redis_config.rb", "config/initializers/redis_config.rb"
67
+ copy_file "config/resque_admin.rb", "config/initializers/resque_admin.rb"
68
+ copy_file "config/resque_config.rb", "config/initializers/resque_config.rb"
69
+ end
70
+
71
+ # Add behaviors to the SolrDocument model
72
+ def inject_sufia_solr_document_behavior
73
+ file_path = "app/models/solr_document.rb"
74
+ if File.exists?(file_path)
75
+ inject_into_class file_path, "SolrDocument" do
76
+ " # Adds Sufia behaviors to the SolrDocument.\n" +
77
+ " include Sufia::SolrDocumentBehavior\n"
78
+ end
79
+ else
80
+ puts " \e[31mFailure\e[0m Sufia requires a SolrDocument object. This generators assumes that the model is defined in the file #{file_path}, which does not exist."
81
+ end
82
+ end
83
+
84
+ def install_mailboxer
85
+ generate "mailboxer:install"
86
+ end
87
+
88
+ private
89
+
90
+ def better_migration_template(file)
91
+ begin
92
+ migration_template "migrations/#{file}", "db/migrate/#{file}"
93
+ sleep 1 # ensure scripts have different time stamps
94
+ rescue
95
+ puts " \e[1m\e[34mMigrations\e[0m " + $!.message
96
+ end
97
+ end
98
+
99
+ end
@@ -0,0 +1 @@
1
+ ClamAV.instance.loaddb() if defined? ClamAV
@@ -0,0 +1,17 @@
1
+ Mailboxer.setup do |config|
2
+
3
+ #Configures if you applications uses or no the email sending for Notifications and Messages
4
+ config.uses_emails = true
5
+
6
+ #Configures the default from for the email sent for Messages and Notifications of Mailboxer
7
+ config.default_from = "no-reply@mailboxer.com"
8
+
9
+ #Configures the methods needed by mailboxer
10
+ config.email_method = :mailboxer_email
11
+ config.name_method = :name
12
+
13
+ #Configures if you use or not a search engine and wich one are you using
14
+ #Supported enignes: [:solr,:sphinx]
15
+ config.search_enabled = false
16
+ config.search_engine = :solr
17
+ end
@@ -7,7 +7,7 @@ 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
- $redis.client.disconnect if $redis
10
+ $redis.client.disconnect if $redis
11
11
  $redis = Redis.new(host: config[:host], port: config[:port], thread_safe: true) rescue nil
12
12
  Resque.redis = $redis
13
13
  Resque.redis.client.reconnect if Resque.redis
@@ -2,4 +2,4 @@ config = YAML::load(ERB.new(IO.read(File.join(Rails.root, 'config', 'redis.yml')
2
2
  Resque.redis = Redis.new(host: config[:host], port: config[:port], thread_safe: true)
3
3
 
4
4
  Resque.inline = Rails.env.test?
5
- Resque.redis.namespace = "#{Sufia::Engine.config.id_namespace}:#{Rails.env}"
5
+ Resque.redis.namespace = "#{Sufia.config.id_namespace}:#{Rails.env}"
@@ -0,0 +1,3 @@
1
+ ActionMailer::Base.smtp_settings = {
2
+ :address => "smtp.psu.edu"
3
+ }
@@ -0,0 +1,81 @@
1
+ # Returns an array containing the vhost 'CoSign service' value and URL
2
+ Sufia.config do |config|
3
+
4
+ config.fits_to_desc_mapping= {
5
+ :file_title => :title,
6
+ :file_author => :creator
7
+ }
8
+
9
+ # Specify a different template for your repositories unique identifiers
10
+ # config.noid_template = ".reeddeeddk"
11
+
12
+ config.max_days_between_audits = 7
13
+
14
+ config.cc_licenses = {
15
+ 'Attribution 3.0 United States' => 'http://creativecommons.org/licenses/by/3.0/us/',
16
+ 'Attribution-ShareAlike 3.0 United States' => 'http://creativecommons.org/licenses/by-sa/3.0/us/',
17
+ 'Attribution-NonCommercial 3.0 United States' => 'http://creativecommons.org/licenses/by-nc/3.0/us/',
18
+ 'Attribution-NoDerivs 3.0 United States' => 'http://creativecommons.org/licenses/by-nd/3.0/us/',
19
+ 'Attribution-NonCommercial-NoDerivs 3.0 United States' => 'http://creativecommons.org/licenses/by-nc-nd/3.0/us/',
20
+ 'Attribution-NonCommercial-ShareAlike 3.0 United States' => 'http://creativecommons.org/licenses/by-nc-sa/3.0/us/',
21
+ 'Public Domain Mark 1.0' => 'http://creativecommons.org/publicdomain/mark/1.0/',
22
+ 'CC0 1.0 Universal' => 'http://creativecommons.org/publicdomain/zero/1.0/',
23
+ 'All rights reserved' => 'All rights reserved'
24
+ }
25
+
26
+ config.cc_licenses_reverse = Hash[*config.cc_licenses.to_a.flatten.reverse]
27
+
28
+ config.resource_types = {
29
+ "Article" => "Article",
30
+ "Audio" => "Audio",
31
+ "Book" => "Book",
32
+ "Capstone Project" => "Capstone Project",
33
+ "Conference Proceeding" => "Conference Proceeding",
34
+ "Dataset" => "Dataset",
35
+ "Dissertation" => "Dissertation",
36
+ "Image" => "Image",
37
+ "Journal" => "Journal",
38
+ "Map or Cartographic Material" => "Map or Cartographic Material",
39
+ "Masters Thesis" => "Masters Thesis",
40
+ "Part of Book" => "Part of Book",
41
+ "Poster" => "Poster",
42
+ "Presentation" => "Presentation",
43
+ "Project" => "Project",
44
+ "Report" => "Report",
45
+ "Research Paper" => "Research Paper",
46
+ "Software or Program Code" => "Software or Program Code",
47
+ "Video" => "Video",
48
+ "Other" => "Other",
49
+ }
50
+
51
+ config.permission_levels = {
52
+ "Choose Access"=>"none",
53
+ "View/Download" => "read",
54
+ "Edit" => "edit"
55
+ }
56
+
57
+ config.owner_permission_levels = {
58
+ "Edit" => "edit"
59
+ }
60
+
61
+ config.queue = Sufia::Resque::Queue
62
+
63
+ # Map hostnames onto Google Analytics tracking IDs
64
+ # config.google_analytics_id = 'UA-99999999-1'
65
+
66
+
67
+ # Where to store tempfiles, leave blank for the system temp directory (e.g. /tmp)
68
+ # config.temp_file_base = '/home/developer1'
69
+
70
+ # If you have ffmpeg installed and want to transcode audio and video uncomment this line
71
+ # config.enable_ffmpeg = true
72
+
73
+ # Specify the Fedora pid prefix:
74
+ # config.id_namespace = "sufia"
75
+
76
+ # Specify the path to the file characterization tool:
77
+ # config.fits_path = "fits.sh"
78
+
79
+ end
80
+
81
+ Date::DATE_FORMATS[:standard] = "%m/%d/%Y"
@@ -0,0 +1,17 @@
1
+ class ActsAsFollowerMigration < ActiveRecord::Migration
2
+ def self.up
3
+ create_table :follows, :force => true do |t|
4
+ t.references :followable, :polymorphic => true, :null => false
5
+ t.references :follower, :polymorphic => true, :null => false
6
+ t.boolean :blocked, :default => false, :null => false
7
+ t.timestamps
8
+ end
9
+
10
+ add_index :follows, ["follower_id", "follower_type"], :name => "fk_follows"
11
+ add_index :follows, ["followable_id", "followable_type"], :name => "fk_followables"
12
+ end
13
+
14
+ def self.down
15
+ drop_table :follows
16
+ end
17
+ end
@@ -0,0 +1,9 @@
1
+ class AddAvatarsToUsers < ActiveRecord::Migration
2
+ def self.up
3
+ add_attachment :users, :avatar
4
+ end
5
+
6
+ def self.down
7
+ remove_attachment :users, :avatar
8
+ end
9
+ end
@@ -0,0 +1,11 @@
1
+ class AddGroupsToUsers < ActiveRecord::Migration
2
+ def self.up
3
+ add_column :users, :group_list, :text
4
+ add_column :users, :groups_last_update, :datetime
5
+ end
6
+
7
+ def self.down
8
+ remove_column :users, :group_list
9
+ remove_column :users, :groups_last_update
10
+ end
11
+ end
@@ -0,0 +1,27 @@
1
+ class AddLdapAttrsToUser < ActiveRecord::Migration
2
+ def self.up
3
+ add_column :users, :display_name, :string
4
+ add_column :users, :address, :string
5
+ add_column :users, :admin_area, :string
6
+ add_column :users, :department, :string
7
+ add_column :users, :title, :string
8
+ add_column :users, :office, :string
9
+ add_column :users, :chat_id, :string
10
+ add_column :users, :website, :string
11
+ add_column :users, :affiliation, :string
12
+ add_column :users, :telephone, :string
13
+ end
14
+
15
+ def self.down
16
+ remove_column :users, :display_name
17
+ remove_column :users, :address
18
+ remove_column :users, :admin_area
19
+ remove_column :users, :department
20
+ remove_column :users, :title
21
+ remove_column :users, :office
22
+ remove_column :users, :chat_id
23
+ remove_column :users, :website
24
+ remove_column :users, :affiliation
25
+ remove_column :users, :telephone
26
+ end
27
+ end
@@ -0,0 +1,13 @@
1
+ class AddSocialToUsers < ActiveRecord::Migration
2
+ def self.up
3
+ add_column :users, :facebook_handle, :string
4
+ add_column :users, :twitter_handle, :string
5
+ add_column :users, :googleplus_handle, :string
6
+ end
7
+
8
+ def self.down
9
+ remove_column :users, :facebook_handle, :string
10
+ remove_column :users, :twitter_handle, :string
11
+ remove_column :users, :googleplus_handle, :string
12
+ end
13
+ end
@@ -0,0 +1,20 @@
1
+ class CreateChecksumAuditLogs < ActiveRecord::Migration
2
+ def self.up
3
+ create_table :checksum_audit_logs do |t|
4
+ t.string :pid
5
+ t.string :dsid
6
+ t.string :version
7
+ t.integer :pass
8
+ t.string :expected_result
9
+ t.string :actual_result
10
+ t.timestamps
11
+ end
12
+ add_index :checksum_audit_logs, [:pid, :dsid], :name=>'by_pid_and_dsid', :order => {:created_at => "DESC" }
13
+
14
+ end
15
+
16
+ def self.down
17
+ remove_index(:checksum_audit_logs, :name => 'by_pid_and_dsid')
18
+ drop_table :checksum_audit_logs
19
+ end
20
+ end
@@ -0,0 +1,50 @@
1
+ class CreateLocalAuthorities < ActiveRecord::Migration
2
+ def self.up
3
+ create_table :local_authority_entries, :force => true do |t|
4
+ t.integer :local_authority_id
5
+ t.string :label
6
+ t.string :uri
7
+ end
8
+
9
+ create_table :local_authorities, :force => true do |t|
10
+ t.string :name, :unique => true
11
+ end
12
+
13
+ create_table :domain_terms, :force => true do |t|
14
+ t.string :model
15
+ t.string :term
16
+ end
17
+
18
+ create_table :domain_terms_local_authorities, :id => false do |t|
19
+ t.integer :domain_term_id, :foreign_key => true
20
+ t.integer :local_authority_id, :foreign_key => true
21
+ end
22
+
23
+ create_table :subject_local_authority_entries, :force => true do |t|
24
+ t.string :label
25
+ t.string :lowerLabel
26
+ t.string :url
27
+ end
28
+
29
+ add_index :local_authority_entries, [:local_authority_id, :label], :name => 'entries_by_term_and_label'
30
+ add_index :local_authority_entries, [:local_authority_id, :uri], :name => 'entries_by_term_and_uri'
31
+ add_index :domain_terms, [:model, :term], :name => 'terms_by_model_and_term'
32
+ add_index :domain_terms_local_authorities, [:local_authority_id, :domain_term_id], :name => 'dtla_by_ids1'
33
+ add_index :domain_terms_local_authorities, [:domain_term_id, :local_authority_id], :name => 'dtla_by_ids2'
34
+ add_index :subject_local_authority_entries, [:lowerLabel], :name => 'entries_by_lower_label'
35
+ end
36
+
37
+ def self.down
38
+ drop_table :local_authority_entries
39
+ drop_table :local_authorities
40
+ drop_table :domain_terms
41
+ drop_table :domain_terms_local_authorities
42
+ drop_table :subject_local_authority_entries
43
+ remove_index :local_authority_entries, :name => "entries_by_term_and_label"
44
+ remove_index :local_authority_entries, :name => "entries_by_term_and_uri"
45
+ remove_index :domain_terms, :name => "terms_by_model_and_term"
46
+ remove_index :subject_local_authority_entries, :name => 'entries_by_lower_label'
47
+ remove_index :domain_terms_local_authorities, :name => 'dtla_by_ids1'
48
+ remove_index :domain_terms_local_authorities, :name => 'dtla_by_ids2'
49
+ end
50
+ 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
@@ -0,0 +1,10 @@
1
+ class CreateTrophies < ActiveRecord::Migration
2
+ def change
3
+ create_table :trophies do |t|
4
+ t.integer :user_id
5
+ t.string :generic_file_id
6
+
7
+ t.timestamps
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,15 @@
1
+ class CreateVersionCommitters < ActiveRecord::Migration
2
+ def self.up
3
+ create_table :version_committers do |t|
4
+ t.string :obj_id
5
+ t.string :datastream_id
6
+ t.string :version_id
7
+ t.string :committer_login
8
+ t.timestamps
9
+ end
10
+ end
11
+
12
+ def self.down
13
+ drop_table :version_committers
14
+ end
15
+ end
@@ -44,10 +44,10 @@ class BatchUpdateJob
44
44
 
45
45
  job_user = User.batchuser()
46
46
 
47
- message = '<a class="batchid ui-helper-hidden">ss-'+batch.noid+'</a>The file(s) '+ file_list(@saved)+ " have been saved." unless @saved.empty?
47
+ message = '<span class="batchid ui-helper-hidden">ss-'+batch.noid+'</span>The file(s) '+ file_list(@saved)+ " have been saved." unless @saved.empty?
48
48
  job_user.send_message(user, message, 'Batch upload complete') unless @saved.empty?
49
49
 
50
- message = '<a class="batchid ui-helper-hidden">'+batch.noid+'</a>The file(s) '+ file_list(@denied)+" could not be updated. You do not have sufficient privileges to edit it." unless @denied.empty?
50
+ message = '<span class="batchid ui-helper-hidden">'+batch.noid+'</span>The file(s) '+ file_list(@denied)+" could not be updated. You do not have sufficient privileges to edit it." unless @denied.empty?
51
51
  job_user.send_message(user, message, 'Batch upload permission denied') unless @denied.empty?
52
52
 
53
53
  end
@@ -1,5 +1,5 @@
1
1
  module Sufia
2
2
  module Models
3
- VERSION = "3.1.0"
3
+ VERSION = "3.1.1"
4
4
  end
5
5
  end
@@ -22,7 +22,6 @@ task :spec => :generate do
22
22
  end
23
23
  end
24
24
 
25
- gem_home = File.expand_path('../../', __FILE__)
26
25
 
27
26
  desc "Run specs"
28
27
  RSpec::Core::RakeTask.new(:rspec) do |t|
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sufia
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.0
4
+ version: 3.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Coyne
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-08-09 00:00:00.000000000 Z
11
+ date: 2013-08-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sufia-models
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 3.1.0
19
+ version: 3.1.1
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 3.1.0
26
+ version: 3.1.1
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: blacklight
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -476,14 +476,6 @@ files:
476
476
  - lib/generators/sufia/sufia_generator.rb
477
477
  - lib/generators/sufia/templates/catalog_controller.rb
478
478
  - lib/generators/sufia/templates/config/action_dispatch_http_upload_monkey_patch.rb
479
- - lib/generators/sufia/templates/config/clamav.rb
480
- - lib/generators/sufia/templates/config/mailboxer.rb
481
- - lib/generators/sufia/templates/config/redis.yml
482
- - lib/generators/sufia/templates/config/redis_config.rb
483
- - lib/generators/sufia/templates/config/resque_admin.rb
484
- - lib/generators/sufia/templates/config/resque_config.rb
485
- - lib/generators/sufia/templates/config/setup_mail.rb
486
- - lib/generators/sufia/templates/config/sufia.rb
487
479
  - lib/generators/sufia/templates/migrations/acts_as_follower_migration.rb
488
480
  - lib/generators/sufia/templates/migrations/add_avatars_to_users.rb
489
481
  - lib/generators/sufia/templates/migrations/add_groups_to_users.rb
@@ -642,6 +634,25 @@ files:
642
634
  - sufia-models/app/models/trophy.rb
643
635
  - sufia-models/app/models/version_committer.rb
644
636
  - sufia-models/config/locales/sufia.en.yml
637
+ - sufia-models/lib/generators/sufia/models/install_generator.rb
638
+ - sufia-models/lib/generators/sufia/models/templates/config/clamav.rb
639
+ - sufia-models/lib/generators/sufia/models/templates/config/mailboxer.rb
640
+ - sufia-models/lib/generators/sufia/models/templates/config/redis.yml
641
+ - sufia-models/lib/generators/sufia/models/templates/config/redis_config.rb
642
+ - sufia-models/lib/generators/sufia/models/templates/config/resque_admin.rb
643
+ - sufia-models/lib/generators/sufia/models/templates/config/resque_config.rb
644
+ - sufia-models/lib/generators/sufia/models/templates/config/setup_mail.rb
645
+ - sufia-models/lib/generators/sufia/models/templates/config/sufia.rb
646
+ - sufia-models/lib/generators/sufia/models/templates/migrations/acts_as_follower_migration.rb
647
+ - sufia-models/lib/generators/sufia/models/templates/migrations/add_avatars_to_users.rb
648
+ - sufia-models/lib/generators/sufia/models/templates/migrations/add_groups_to_users.rb
649
+ - sufia-models/lib/generators/sufia/models/templates/migrations/add_ldap_attrs_to_user.rb
650
+ - sufia-models/lib/generators/sufia/models/templates/migrations/add_social_to_users.rb
651
+ - sufia-models/lib/generators/sufia/models/templates/migrations/create_checksum_audit_logs.rb
652
+ - sufia-models/lib/generators/sufia/models/templates/migrations/create_local_authorities.rb
653
+ - sufia-models/lib/generators/sufia/models/templates/migrations/create_single_use_links.rb
654
+ - sufia-models/lib/generators/sufia/models/templates/migrations/create_trophies.rb
655
+ - sufia-models/lib/generators/sufia/models/templates/migrations/create_version_committers.rb
645
656
  - sufia-models/lib/sufia/models.rb
646
657
  - sufia-models/lib/sufia/models/active_fedora/redis.rb
647
658
  - sufia-models/lib/sufia/models/active_record/redis.rb
@@ -1,14 +0,0 @@
1
- # Copyright © 2012 The Pennsylvania State University
2
- #
3
- # Licensed under the Apache License, Version 2.0 (the "License");
4
- # you may not use this file except in compliance with the License.
5
- # You may obtain a copy of the License at
6
- #
7
- # http://www.apache.org/licenses/LICENSE-2.0
8
- #
9
- # Unless required by applicable law or agreed to in writing, software
10
- # distributed under the License is distributed on an "AS IS" BASIS,
11
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- # See the License for the specific language governing permissions and
13
- # limitations under the License.
14
- ClamAV.instance.loaddb() if defined? ClamAV
@@ -1,31 +0,0 @@
1
- # Copyright © 2012 The Pennsylvania State University
2
- #
3
- # Licensed under the Apache License, Version 2.0 (the "License");
4
- # you may not use this file except in compliance with the License.
5
- # You may obtain a copy of the License at
6
- #
7
- # http://www.apache.org/licenses/LICENSE-2.0
8
- #
9
- # Unless required by applicable law or agreed to in writing, software
10
- # distributed under the License is distributed on an "AS IS" BASIS,
11
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- # See the License for the specific language governing permissions and
13
- # limitations under the License.
14
-
15
- Mailboxer.setup do |config|
16
-
17
- #Configures if you applications uses or no the email sending for Notifications and Messages
18
- config.uses_emails = true
19
-
20
- #Configures the default from for the email sent for Messages and Notifications of Mailboxer
21
- config.default_from = "no-reply@mailboxer.com"
22
-
23
- #Configures the methods needed by mailboxer
24
- config.email_method = :mailboxer_email
25
- config.name_method = :name
26
-
27
- #Configures if you use or not a search engine and wich one are you using
28
- #Supported enignes: [:solr,:sphinx]
29
- config.search_enabled = false
30
- config.search_engine = :solr
31
- end
@@ -1,17 +0,0 @@
1
- # Copyright © 2012 The Pennsylvania State University
2
- #
3
- # Licensed under the Apache License, Version 2.0 (the "License");
4
- # you may not use this file except in compliance with the License.
5
- # You may obtain a copy of the License at
6
- #
7
- # http://www.apache.org/licenses/LICENSE-2.0
8
- #
9
- # Unless required by applicable law or agreed to in writing, software
10
- # distributed under the License is distributed on an "AS IS" BASIS,
11
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- # See the License for the specific language governing permissions and
13
- # limitations under the License.
14
-
15
- ActionMailer::Base.smtp_settings = {
16
- :address => "smtp.psu.edu"
17
- }
@@ -1,82 +0,0 @@
1
- # Returns an array containing the vhost 'CoSign service' value and URL
2
- Sufia.config do |config|
3
-
4
- config.fits_to_desc_mapping= {
5
- :file_title => :title,
6
- :file_author => :creator
7
- }
8
-
9
- # Specify a different template for your repositories unique identifiers
10
- # config.noid_template = ".reeddeeddk"
11
-
12
- config.max_days_between_audits = 7
13
-
14
- config.cc_licenses = {
15
- 'Attribution 3.0 United States' => 'http://creativecommons.org/licenses/by/3.0/us/',
16
- 'Attribution-ShareAlike 3.0 United States' => 'http://creativecommons.org/licenses/by-sa/3.0/us/',
17
- 'Attribution-NonCommercial 3.0 United States' => 'http://creativecommons.org/licenses/by-nc/3.0/us/',
18
- 'Attribution-NoDerivs 3.0 United States' => 'http://creativecommons.org/licenses/by-nd/3.0/us/',
19
- 'Attribution-NonCommercial-NoDerivs 3.0 United States' => 'http://creativecommons.org/licenses/by-nc-nd/3.0/us/',
20
- 'Attribution-NonCommercial-ShareAlike 3.0 United States' => 'http://creativecommons.org/licenses/by-nc-sa/3.0/us/',
21
- 'Public Domain Mark 1.0' => 'http://creativecommons.org/publicdomain/mark/1.0/',
22
- 'CC0 1.0 Universal' => 'http://creativecommons.org/publicdomain/zero/1.0/',
23
- 'All rights reserved' => 'All rights reserved'
24
- }
25
-
26
- config.cc_licenses_reverse = Hash[*config.cc_licenses.to_a.flatten.reverse]
27
-
28
- config.resource_types = {
29
- "Article" => "Article",
30
- "Audio" => "Audio",
31
- "Book" => "Book",
32
- "Capstone Project" => "Capstone Project",
33
- "Conference Proceeding" => "Conference Proceeding",
34
- "Dataset" => "Dataset",
35
- "Dissertation" => "Dissertation",
36
- "Image" => "Image",
37
- "Journal" => "Journal",
38
- "Map or Cartographic Material" => "Map or Cartographic Material",
39
- "Masters Thesis" => "Masters Thesis",
40
- "Part of Book" => "Part of Book",
41
- "Poster" => "Poster",
42
- "Presentation" => "Presentation",
43
- "Project" => "Project",
44
- "Report" => "Report",
45
- "Research Paper" => "Research Paper",
46
- "Software or Program Code" => "Software or Program Code",
47
- "Video" => "Video",
48
- "Other" => "Other",
49
- }
50
-
51
- config.permission_levels = {
52
- "Choose Access"=>"none",
53
- "View/Download" => "read",
54
- "Edit" => "edit"
55
- }
56
-
57
- config.owner_permission_levels = {
58
- "Edit" => "edit"
59
- }
60
-
61
- config.queue = Sufia::Resque::Queue
62
-
63
- # Map hostnames onto Google Analytics tracking IDs
64
- # config.google_analytics_id = 'UA-99999999-1'
65
-
66
-
67
- # Where to store tempfiles, leave blank for the system temp directory (e.g. /tmp)
68
- # config.temp_file_base = '/home/developer1'
69
-
70
- # If you have ffmpeg installed and want to transcode audio and video uncomment this line
71
- # config.enable_ffmpeg = true
72
-
73
- # Specify the Fedora pid prefix:
74
- # config.id_namespace = "sufia"
75
-
76
- # Specify the path to the file characterization tool:
77
- # config.fits_path = "fits.sh"
78
-
79
- end
80
-
81
- Date::DATE_FORMATS[:standard] = "%m/%d/%Y"
82
-