Class: Hyrax::Configuration
- Inherits:
-
Object
- Object
- Hyrax::Configuration
- Includes:
- Callbacks
- Defined in:
- lib/hyrax/configuration.rb
Instance Attribute Summary collapse
-
#active_deposit_agreement_acceptance ⇒ Object
writeonly
Sets the attribute active_deposit_agreement_acceptance.
- #activity_to_show_default_seconds_since_now ⇒ Object
-
#always_display_share_button ⇒ Object
writeonly
Should a button with “Share my work” show on the front page to all users (even those not logged in)?.
-
#analytic_start_date ⇒ Object
Returns the value of attribute analytic_start_date.
-
#analytics ⇒ Object
Sets the attribute analytics.
-
#arkivo_api ⇒ Object
writeonly
Sets the attribute arkivo_api.
- #audit_user_key ⇒ Object
- #banner_image ⇒ Object
- #batch_user_key ⇒ Object
- #binaries_directory ⇒ Object
-
#browse_everything ⇒ Object
writeonly
Sets the attribute browse_everything.
- #cache_path ⇒ Object
-
#characterization_runner ⇒ Object
Override characterization runner.
-
#citations ⇒ Object
writeonly
Sets the attribute citations.
- #contact_email ⇒ Object
-
#dashboard_configuration ⇒ Object
rubocop:disable Metrics/MethodLength.
-
#default_active_workflow_name ⇒ String
When an admin set is created, we need to activate a workflow.
- #derivatives_path ⇒ Object
- #descriptions_directory ⇒ Object
-
#display_media_download_link ⇒ Object
writeonly
Sets the attribute display_media_download_link.
-
#display_microdata ⇒ Object
writeonly
Sets the attribute display_microdata.
- #enable_ffmpeg ⇒ Object
-
#enable_local_ingest ⇒ Object
Returns the value of attribute enable_local_ingest.
-
#enable_noids ⇒ Object
writeonly
Sets the attribute enable_noids.
- #feature_config_path ⇒ Object
- #ffmpeg_path ⇒ Object
- #fits_message_length ⇒ Object
- #fits_path ⇒ Object
- #google_analytics_id ⇒ Object (also: #google_analytics_id?)
- #import_export_jar_file_path ⇒ Object
- #ingest_queue_name ⇒ Object
- #libreoffice_path ⇒ Object
- #license_service_class ⇒ Object
- #lock_retry_count ⇒ Object
- #lock_retry_delay ⇒ Object
- #lock_time_to_live ⇒ Object
- #max_days_between_audits ⇒ Object
- #max_notifications_for_dashboard ⇒ Object
- #microdata_default_type ⇒ Object
- #minter_statefile ⇒ Object
-
#model_to_create ⇒ Object
Returns a lambda that takes a hash of attributes and returns a string of the model name.
- #noid_minter_class ⇒ Object
- #noid_template ⇒ Object
- #owner_permission_levels ⇒ Object
- #permission_levels ⇒ Object
- #persistent_hostpath ⇒ Object
- #redis_namespace ⇒ Object
- #subject_prefix ⇒ Object
-
#temp_file_base ⇒ Object
Returns the value of attribute temp_file_base.
- #translate_id_to_uri ⇒ Object
- #translate_uri_to_id ⇒ Object
- #upload_path ⇒ Object
-
#work_requires_files ⇒ Object
writeonly
Sets the attribute work_requires_files.
- #working_path ⇒ Object
Instance Method Summary collapse
- #active_deposit_agreement_acceptance? ⇒ Boolean (also: #active_deposit_agreement_acceptance)
- #always_display_share_button? ⇒ Boolean (also: #always_display_share_button)
- #analytics? ⇒ Boolean (also: #analytics)
- #arkivo_api? ⇒ Boolean (also: #arkivo_api)
- #browse_everything? ⇒ Boolean (also: #browse_everything)
- #citations? ⇒ Boolean (also: #citations)
-
#curation_concerns ⇒ Array<Class>
The registered curation concerns.
- #display_media_download_link? ⇒ Boolean (also: #display_media_download_link)
- #display_microdata? ⇒ Boolean (also: #display_microdata)
- #enable_noids? ⇒ Boolean (also: #enable_noids)
- #geonames_username=(username) ⇒ Object
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
-
#register_curation_concern(*curation_concern_types) ⇒ Object
Registers the given curation concern model in the configuration.
-
#register_roles {|Hyrax::RoleRegistry| ... } ⇒ TrueClass
Exposes a means to register application critical roles.
-
#registered_curation_concern_types ⇒ Array<String>
The normalization done by this method must occur after the initialization process so it can take advantage of irregular inflections from config/initializers/inflections.rb.
- #work_requires_files? ⇒ Boolean (also: #work_requires_files)
Methods included from Callbacks
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
8 9 10 11 12 |
# File 'lib/hyrax/configuration.rb', line 8 def initialize @registered_concerns = [] @role_registry = Hyrax::RoleRegistry.new @default_active_workflow_name = DEFAULT_ACTIVE_WORKFLOW_NAME end |
Instance Attribute Details
#active_deposit_agreement_acceptance=(value) ⇒ Object (writeonly)
Sets the attribute active_deposit_agreement_acceptance
331 332 333 |
# File 'lib/hyrax/configuration.rb', line 331 def active_deposit_agreement_acceptance=(value) @active_deposit_agreement_acceptance = value end |
#activity_to_show_default_seconds_since_now ⇒ Object
316 317 318 |
# File 'lib/hyrax/configuration.rb', line 316 def activity_to_show_default_seconds_since_now @activity_to_show_default_seconds_since_now ||= 24 * 60 * 60 end |
#always_display_share_button=(value) ⇒ Object (writeonly)
Should a button with “Share my work” show on the front page to all users (even those not logged in)?
369 370 371 |
# File 'lib/hyrax/configuration.rb', line 369 def (value) @always_display_share_button = value end |
#analytic_start_date ⇒ Object
Returns the value of attribute analytic_start_date.
82 83 84 |
# File 'lib/hyrax/configuration.rb', line 82 def analytic_start_date @analytic_start_date end |
#analytics=(value) ⇒ Object
Sets the attribute analytics
82 83 84 |
# File 'lib/hyrax/configuration.rb', line 82 def analytics=(value) @analytics = value end |
#arkivo_api=(value) ⇒ Object (writeonly)
Sets the attribute arkivo_api
320 321 322 |
# File 'lib/hyrax/configuration.rb', line 320 def arkivo_api=(value) @arkivo_api = value end |
#audit_user_key ⇒ Object
353 354 355 |
# File 'lib/hyrax/configuration.rb', line 353 def audit_user_key @audit_user_key ||= '[email protected]' end |
#banner_image ⇒ Object
270 271 272 |
# File 'lib/hyrax/configuration.rb', line 270 def @banner_image ||= "https://cloud.githubusercontent.com/assets/92044/18370978/88ecac20-75f6-11e6-8399-6536640ef695.jpg" end |
#batch_user_key ⇒ Object
348 349 350 |
# File 'lib/hyrax/configuration.rb', line 348 def batch_user_key @batch_user_key ||= '[email protected]' end |
#binaries_directory ⇒ Object
188 189 190 |
# File 'lib/hyrax/configuration.rb', line 188 def binaries_directory @binaries_directory ||= "tmp/binaries" end |
#browse_everything=(value) ⇒ Object (writeonly)
Sets the attribute browse_everything
289 290 291 |
# File 'lib/hyrax/configuration.rb', line 289 def browse_everything=(value) @browse_everything = value end |
#cache_path ⇒ Object
364 365 366 |
# File 'lib/hyrax/configuration.rb', line 364 def cache_path @cache_path ||= ->() { Rails.root + 'tmp' + 'uploads' + 'cache' } end |
#characterization_runner ⇒ Object
Override characterization runner
140 141 142 |
# File 'lib/hyrax/configuration.rb', line 140 def characterization_runner @characterization_runner end |
#citations=(value) ⇒ Object (writeonly)
Sets the attribute citations
303 304 305 |
# File 'lib/hyrax/configuration.rb', line 303 def citations=(value) @citations = value end |
#contact_email ⇒ Object
410 411 412 |
# File 'lib/hyrax/configuration.rb', line 410 def contact_email @contact_email ||= "[email protected]" end |
#dashboard_configuration ⇒ Object
rubocop:disable Metrics/MethodLength
196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 |
# File 'lib/hyrax/configuration.rb', line 196 def dashboard_configuration @dashboard_configuration ||= { menu: { index: {}, resource_details: {}, workflow: {}, workflow_roles: {} }, actions: { index: { partials: [ "total_objects_charts", "total_embargo_visibility" ] }, resource_details: { partials: [ "total_objects" ] }, workflow: { partials: [ "workflow" ] } }, data_sources: { resource_stats: Hyrax::ResourceStatisticsSource } } end |
#default_active_workflow_name ⇒ String
The active workflow for an admin set can be changed at a later point.
Changing this value after other AdminSet(s) are created does not alter the already created AdminSet(s)
When an admin set is created, we need to activate a workflow. The :default_active_workflow_name is the name of the workflow we will activate.
26 27 28 |
# File 'lib/hyrax/configuration.rb', line 26 def default_active_workflow_name @default_active_workflow_name end |
#derivatives_path ⇒ Object
51 52 53 |
# File 'lib/hyrax/configuration.rb', line 51 def derivatives_path @derivatives_path ||= Rails.root.join('tmp', 'derivatives') end |
#descriptions_directory ⇒ Object
181 182 183 |
# File 'lib/hyrax/configuration.rb', line 181 def descriptions_directory @descriptions_directory ||= "tmp/descriptions" end |
#display_media_download_link=(value) ⇒ Object (writeonly)
Sets the attribute display_media_download_link
126 127 128 |
# File 'lib/hyrax/configuration.rb', line 126 def display_media_download_link=(value) @display_media_download_link = value end |
#display_microdata=(value) ⇒ Object (writeonly)
Sets the attribute display_microdata
85 86 87 |
# File 'lib/hyrax/configuration.rb', line 85 def display_microdata=(value) @display_microdata = value end |
#enable_ffmpeg ⇒ Object
62 63 64 65 |
# File 'lib/hyrax/configuration.rb', line 62 def enable_ffmpeg return @enable_ffmpeg unless @enable_ffmpeg.nil? @enable_ffmpeg = false end |
#enable_local_ingest ⇒ Object
Returns the value of attribute enable_local_ingest.
82 83 84 |
# File 'lib/hyrax/configuration.rb', line 82 def enable_local_ingest @enable_local_ingest end |
#enable_noids=(value) ⇒ Object (writeonly)
Sets the attribute enable_noids
103 104 105 |
# File 'lib/hyrax/configuration.rb', line 103 def enable_noids=(value) @enable_noids = value end |
#feature_config_path ⇒ Object
78 79 80 |
# File 'lib/hyrax/configuration.rb', line 78 def feature_config_path @feature_config_path ||= Rails.root.join('config', 'features.yml') end |
#ffmpeg_path ⇒ Object
68 69 70 |
# File 'lib/hyrax/configuration.rb', line 68 def ffmpeg_path @ffmpeg_path ||= 'ffmpeg' end |
#fits_message_length ⇒ Object
73 74 75 |
# File 'lib/hyrax/configuration.rb', line 73 def @fits_message_length ||= 5 end |
#fits_path ⇒ Object
135 136 137 |
# File 'lib/hyrax/configuration.rb', line 135 def fits_path @fits_path ||= 'fits.sh' end |
#google_analytics_id ⇒ Object Also known as: google_analytics_id?
378 379 380 |
# File 'lib/hyrax/configuration.rb', line 378 def google_analytics_id @google_analytics_id ||= nil end |
#import_export_jar_file_path ⇒ Object
174 175 176 |
# File 'lib/hyrax/configuration.rb', line 174 def import_export_jar_file_path @import_export_jar_file_path ||= "tmp/fcrepo-import-export.jar" end |
#ingest_queue_name ⇒ Object
167 168 169 |
# File 'lib/hyrax/configuration.rb', line 167 def ingest_queue_name @ingest_queue_name ||= :default end |
#libreoffice_path ⇒ Object
285 286 287 |
# File 'lib/hyrax/configuration.rb', line 285 def libreoffice_path @libreoffice_path ||= "soffice" end |
#license_service_class ⇒ Object
265 266 267 |
# File 'lib/hyrax/configuration.rb', line 265 def license_service_class @license_service_class ||= Hyrax::LicenseService end |
#lock_retry_count ⇒ Object
146 147 148 |
# File 'lib/hyrax/configuration.rb', line 146 def lock_retry_count @lock_retry_count ||= 600 # Up to 2 minutes of trying at intervals up to 200ms end |
#lock_retry_delay ⇒ Object
160 161 162 |
# File 'lib/hyrax/configuration.rb', line 160 def lock_retry_delay @lock_retry_delay ||= 200 # milliseconds end |
#lock_time_to_live ⇒ Object
153 154 155 |
# File 'lib/hyrax/configuration.rb', line 153 def lock_time_to_live @lock_time_to_live ||= 60_000 # milliseconds end |
#max_days_between_audits ⇒ Object
99 100 101 |
# File 'lib/hyrax/configuration.rb', line 99 def max_days_between_audits @max_days_between_audits ||= 7 end |
#max_notifications_for_dashboard ⇒ Object
311 312 313 |
# File 'lib/hyrax/configuration.rb', line 311 def max_notifications_for_dashboard @max_notifications_for_dashboard ||= 5 end |
#microdata_default_type ⇒ Object
94 95 96 |
# File 'lib/hyrax/configuration.rb', line 94 def microdata_default_type @microdata_default_type ||= 'http://schema.org/CreativeWork' end |
#minter_statefile ⇒ Object
122 123 124 |
# File 'lib/hyrax/configuration.rb', line 122 def minter_statefile @minter_statefile ||= '/tmp/minter-state' end |
#model_to_create ⇒ Object
Returns a lambda that takes a hash of attributes and returns a string of the model name. This is called by the batch upload process
422 423 424 |
# File 'lib/hyrax/configuration.rb', line 422 def model_to_create @model_to_create ||= ->(_attributes) { Hyrax.primary_work_type.model_name.name } end |
#noid_minter_class ⇒ Object
117 118 119 |
# File 'lib/hyrax/configuration.rb', line 117 def noid_minter_class @noid_minter_class ||= ActiveFedora::Noid::Minter::Db end |
#noid_template ⇒ Object
112 113 114 |
# File 'lib/hyrax/configuration.rb', line 112 def noid_template @noid_template ||= '.reeddeeddk' end |
#owner_permission_levels ⇒ Object
395 396 397 |
# File 'lib/hyrax/configuration.rb', line 395 def @owner_permission_levels ||= { "Edit Access" => "edit" } end |
#permission_levels ⇒ Object
388 389 390 391 392 |
# File 'lib/hyrax/configuration.rb', line 388 def @permission_levels ||= { "Choose Access" => "none", "View/Download" => "read", "Edit" => "edit" } end |
#persistent_hostpath ⇒ Object
275 276 277 |
# File 'lib/hyrax/configuration.rb', line 275 def persistent_hostpath @persistent_hostpath ||= "http://localhost/files/" end |
#redis_namespace ⇒ Object
280 281 282 |
# File 'lib/hyrax/configuration.rb', line 280 def redis_namespace @redis_namespace ||= "hyrax" end |
#subject_prefix ⇒ Object
415 416 417 |
# File 'lib/hyrax/configuration.rb', line 415 def subject_prefix @subject_prefix ||= "Contact form:" end |
#temp_file_base ⇒ Object
Returns the value of attribute temp_file_base.
82 83 84 |
# File 'lib/hyrax/configuration.rb', line 82 def temp_file_base @temp_file_base end |
#translate_id_to_uri ⇒ Object
405 406 407 |
# File 'lib/hyrax/configuration.rb', line 405 def translate_id_to_uri @translate_id_to_uri ||= ActiveFedora::Noid.config.translate_id_to_uri end |
#translate_uri_to_id ⇒ Object
400 401 402 |
# File 'lib/hyrax/configuration.rb', line 400 def translate_uri_to_id @translate_uri_to_id ||= ActiveFedora::Noid.config.translate_uri_to_id end |
#upload_path ⇒ Object
359 360 361 |
# File 'lib/hyrax/configuration.rb', line 359 def upload_path @upload_path ||= ->() { Rails.root + 'tmp' + 'uploads' } end |
#work_requires_files=(value) ⇒ Object (writeonly)
Sets the attribute work_requires_files
339 340 341 |
# File 'lib/hyrax/configuration.rb', line 339 def work_requires_files=(value) @work_requires_files = value end |
#working_path ⇒ Object
57 58 59 |
# File 'lib/hyrax/configuration.rb', line 57 def working_path @working_path ||= Rails.root.join('tmp', 'uploads') end |
Instance Method Details
#active_deposit_agreement_acceptance? ⇒ Boolean Also known as: active_deposit_agreement_acceptance
332 333 334 335 |
# File 'lib/hyrax/configuration.rb', line 332 def active_deposit_agreement_acceptance? return true if @active_deposit_agreement_acceptance.nil? @active_deposit_agreement_acceptance end |
#always_display_share_button? ⇒ Boolean Also known as:
370 371 372 373 |
# File 'lib/hyrax/configuration.rb', line 370 def return true if @always_display_share_button.nil? @always_display_share_button end |
#analytics? ⇒ Boolean Also known as: analytics
297 298 299 |
# File 'lib/hyrax/configuration.rb', line 297 def analytics? @analytics ||= false end |
#arkivo_api? ⇒ Boolean Also known as: arkivo_api
321 322 323 |
# File 'lib/hyrax/configuration.rb', line 321 def arkivo_api? @arkivo_api ||= false end |
#browse_everything? ⇒ Boolean Also known as: browse_everything
290 291 292 |
# File 'lib/hyrax/configuration.rb', line 290 def browse_everything? @browse_everything ||= nil end |
#citations? ⇒ Boolean Also known as: citations
304 305 306 |
# File 'lib/hyrax/configuration.rb', line 304 def citations? @citations ||= false end |
#curation_concerns ⇒ Array<Class>
Returns the registered curation concerns.
254 255 256 |
# File 'lib/hyrax/configuration.rb', line 254 def curation_concerns registered_curation_concern_types.map(&:constantize) end |
#display_media_download_link? ⇒ Boolean Also known as: display_media_download_link
127 128 129 130 |
# File 'lib/hyrax/configuration.rb', line 127 def display_media_download_link? return @display_media_download_link unless @display_media_download_link.nil? @display_media_download_link = true end |
#display_microdata? ⇒ Boolean Also known as: display_microdata
86 87 88 89 |
# File 'lib/hyrax/configuration.rb', line 86 def display_microdata? return @display_microdata unless @display_microdata.nil? @display_microdata = true end |
#enable_noids? ⇒ Boolean Also known as: enable_noids
104 105 106 107 |
# File 'lib/hyrax/configuration.rb', line 104 def enable_noids? return @enable_noids unless @enable_noids.nil? @enable_noids = true end |
#geonames_username=(username) ⇒ Object
327 328 329 |
# File 'lib/hyrax/configuration.rb', line 327 def geonames_username=(username) Qa::Authorities::Geonames.username = username end |
#register_curation_concern(*curation_concern_types) ⇒ Object
Registers the given curation concern model in the configuration
238 239 240 241 242 243 244 |
# File 'lib/hyrax/configuration.rb', line 238 def register_curation_concern(*curation_concern_types) Array.wrap(curation_concern_types).flatten.compact.each do |cc_type| unless @registered_concerns.include?(cc_type) @registered_concerns << cc_type end end end |
#register_roles {|Hyrax::RoleRegistry| ... } ⇒ TrueClass
Exposes a means to register application critical roles
44 45 46 47 |
# File 'lib/hyrax/configuration.rb', line 44 def register_roles yield(@role_registry) true end |
#registered_curation_concern_types ⇒ Array<String>
The normalization done by this method must occur after the initialization process so it can take advantage of irregular inflections from config/initializers/inflections.rb
249 250 251 |
# File 'lib/hyrax/configuration.rb', line 249 def registered_curation_concern_types @registered_concerns.map { |cc_type| normalize_concern_name(cc_type) } end |
#work_requires_files? ⇒ Boolean Also known as: work_requires_files
340 341 342 343 |
# File 'lib/hyrax/configuration.rb', line 340 def work_requires_files? return true if @work_requires_files.nil? @work_requires_files end |