Class: Hyrax::Configuration
- Inherits:
-
Object
- Object
- Hyrax::Configuration
- Includes:
- Callbacks
- Defined in:
- lib/hyrax/configuration.rb
Overview
Handles configuration for the Hyrax engine.
This class provides a series of accessors for setting and retrieving global engine options. For convenient reference, options are grouped into the following functional areas:
-
Analytics
-
Files
-
Groups
-
Identifiers
-
IIIF
-
Local Storage
-
System Dependencies
-
Theme
-
Valkyrie
Groups
Hyrax has special handling for three groups: “admin”, “registered”, and “public”.
These settings support using custom names for these functional groups in object ACLs.
Identifiers
IIIF
Objects in Hyrax serve out IIIF manifests. These configuration options toggle server availability, allow customization of image and info URL generation, and provide other hooks for custom IIIF behavior.
Local Storage
Hyrax applications need local disk access to store working copies of files for a variety of purposes. Some of these storage paths need to be available all application processes. These options control the paths to use for each type of file.
System Dependiencies
Theme
Options related to the overall appearance of Hyrax.
Valkyrie
Options for toggling Hyrax’s “Wings” valkyrie adapter and configuring valkyrie.
Analytics collapse
-
#analytic_start_date ⇒ Object
Returns the value of attribute analytic_start_date.
-
#analytics ⇒ Object
Returns the value of attribute analytics.
- #analytics_provider ⇒ Object
-
#analytics_reporting ⇒ Object
Returns the value of attribute analytics_reporting.
- #analytics_start_date ⇒ Object
Files collapse
-
#characterization_options ⇒ Hash
Of options like :fits_servlet.
- #characterization_proxy ⇒ Object
-
#characterization_runner ⇒ Object
Override characterization runner.
-
#characterization_service ⇒ #run
@ see Hyrax::Characterization::ValkyrieCharacterizationService.
-
#derivative_mime_type_mappings ⇒ Object
Maps mimetypes to create_*_derivatives methods.
-
#derivative_services ⇒ Array
The registered candidate derivative services.
- #disable_include_metadata ⇒ Object
-
#file_set_file_service ⇒ Class
Implementer of FileSetFileService.
-
#file_set_include_metadata ⇒ Boolean
(also: #file_set_include_metadata?)
Whether to include static metadata for file_sets.
-
#file_set_model ⇒ #constantize
A string representation of the admin set model.
- #fixity_service ⇒ Object
- #flexible ⇒ Object (also: #flexible?)
- #flexible_classes ⇒ Object
- #max_days_between_fixity_checks ⇒ Object
-
#valkyrie_transition ⇒ Object
Returns the value of attribute valkyrie_transition.
Groups collapse
- #admin_user_group_name ⇒ String
- #public_user_group_name ⇒ String
- #registered_user_group_name ⇒ String
Identifier Minting collapse
-
#enable_noids ⇒ Object
writeonly
Sets the attribute enable_noids.
- #minter_statefile ⇒ Object
- #noid_minter_class ⇒ Object
- #noid_template ⇒ Object
IIIF collapse
-
#iiif_image_compliance_level_uri ⇒ String
URL that indicates your IIIF image server compliance level.
-
#iiif_image_server ⇒ Object
writeonly
Sets the attribute iiif_image_server.
-
#iiif_image_size_default ⇒ #String
IIIF image size default.
-
#iiif_image_url_builder ⇒ #call
URL that resolves to an image provided by a IIIF image server.
-
#iiif_info_url_builder ⇒ #call
URL that resolves to an info.json file provided by a IIIF image server.
-
#iiif_manifest_cache_duration ⇒ Integer
Duration in which we should cache the generated IIIF manifest.
-
#iiif_metadata_fields ⇒ #Array
IIIF metadata - fields to display in the metadata section.
-
#rendering_predicate ⇒ RDF::URI
Set predicate for rendering to dc:hasFormat as defined in IIIF Presentation API context: iiif.io/api/presentation/2/context.json.
Local Storage collapse
- #bagit_dir ⇒ Object
- #branding_path ⇒ Object
- #cache_path ⇒ Object
- #derivatives_path ⇒ Object
- #upload_path ⇒ Object
- #working_path ⇒ Object
System Dependencies collapse
- #enable_ffmpeg ⇒ Object
- #ffmpeg_path ⇒ Object
- #fits_message_length ⇒ Object
- #fits_path ⇒ Object
- #import_export_jar_file_path ⇒ Object
- #virus_scanner ⇒ Object
Theme collapse
- #banner_image ⇒ Object
- #breadcrumb_builder ⇒ Object
- #disable_freyja ⇒ Boolean
- #disable_frigg ⇒ Boolean
- #disable_wings ⇒ Boolean
-
#display_media_download_link ⇒ Object
writeonly
Sets the attribute display_media_download_link.
Valkyrie collapse
-
#fedora_connection_builder ⇒ #call
A HTTP connection to use for Valkyrie Fedora requests.
-
#query_index_from_valkyrie ⇒ Boolean
Whether to use the valkyrie index.
-
#use_valkyrie ⇒ Object
writeonly
Sets the attribute use_valkyrie.
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
-
#admin_set_include_metadata ⇒ Boolean
(also: #admin_set_include_metadata?)
Whether to include static metadata for admin_sets.
-
#admin_set_model ⇒ #constantize
A string representation of the admin set model.
- #admin_set_predicate ⇒ Object
- #administrative_set_form ⇒ Class
- #administrative_set_indexer ⇒ Class
-
#arkivo_api ⇒ Object
writeonly
Sets the attribute arkivo_api.
- #audit_user_key ⇒ Object
- #batch_user_key ⇒ Object
-
#browse_everything ⇒ Object
writeonly
Sets the attribute browse_everything.
-
#citations ⇒ Object
writeonly
Sets the attribute citations.
-
#collection_include_metadata ⇒ Boolean
(also: #collection_include_metadata?)
Whether to include static metadata for collections.
-
#collection_model ⇒ #constantize
A string representation of the collection model.
- #collection_type_index_field ⇒ Object
- #contact_email ⇒ Object
-
#default_active_workflow_name ⇒ String
When an admin set is created, we need to activate a workflow.
-
#display_microdata ⇒ Object
writeonly
Sets the attribute display_microdata.
-
#display_share_button_when_not_logged_in ⇒ Object
writeonly
Should a button with “Share my work” show on the front page to users who are not logged in?.
-
#enable_local_ingest ⇒ Object
Returns the value of attribute enable_local_ingest.
-
#extract_full_text ⇒ Object
writeonly
Sets the attribute extract_full_text.
- #feature_config_path ⇒ Object
- #file_set_form ⇒ Class
- #file_set_indexer ⇒ Class
- #id_field ⇒ Object
- #identifier_registrars ⇒ Object
- #index_field_mapper ⇒ Object
- #ingest_queue_name ⇒ Object
- #libreoffice_path ⇒ Object
- #license_service_class ⇒ Object
- #location_service ⇒ Object
- #lock_retry_count ⇒ Object
- #lock_retry_delay ⇒ Object
- #lock_time_to_live ⇒ Object
- #logger ⇒ Logger
- #max_notifications_for_dashboard ⇒ Object
- #microdata_default_type ⇒ Object
- #owner_permission_levels ⇒ Object
- #pcdm_collection_form ⇒ Class
- #pcdm_collection_indexer ⇒ Class
- #pcdm_object_form_builder ⇒ Proc
- #pcdm_object_indexer_builder ⇒ Proc
- #permission_levels ⇒ Object
- #permission_options ⇒ Object
- #persistent_hostpath ⇒ Object
- #publisher ⇒ Object
- #range_for_number_of_results_to_display_per_page ⇒ Array<Integer>
-
#realtime_notifications ⇒ Object
writeonly
rubocop:disable Layout/LineLength.
-
#redis_connection ⇒ Object
Returns the value of attribute redis_connection.
- #redis_namespace ⇒ Object
- #registered_ingest_dirs ⇒ Object
- #rights_statement_service_class ⇒ Object
-
#schema_loader_config_search_paths ⇒ Array<Pathname>
(also: #simple_schema_loader_config_search_paths, #m3_schema_loader_config_search_paths)
A configuration for modifying the SimpleSchemaLoader#config_search_paths which will allow gems to add their own metadata yaml files and easily keep them within the gem.
- #show_work_item_rows ⇒ Object
- #solr_default_method ⇒ Object
- #solr_select_path ⇒ Object
- #subject_prefix ⇒ Object
- #system_user_key ⇒ Object
-
#temp_file_base ⇒ Object
Returns the value of attribute temp_file_base.
- #translate_id_to_uri ⇒ Object
- #translate_uri_to_id ⇒ Object
- #uploader ⇒ Object
-
#visibility_map ⇒ Hyrax::VisibilityMap
A mapping from visibility string values to permissions; the default and reference implementation is provided by VisibilityMap.
-
#work_default_metadata ⇒ Boolean
(also: #work_default_metadata?)
this is deprecated and will be removed in a future release.
-
#work_include_metadata ⇒ Boolean
(also: #work_include_metadata?)
Whether to include static metadata for works.
-
#work_requires_files ⇒ Object
writeonly
Sets the attribute work_requires_files.
Analytics collapse
Files collapse
- #admin_set_flexible? ⇒ Boolean
- #collection_flexible? ⇒ Boolean
-
#file_set_class ⇒ Class
The configured admin set model class.
- #file_set_flexible? ⇒ Boolean
-
#lookup_mimes(type) ⇒ Object
First see if we can get them from the FileSet model.
-
#mime_types_map ⇒ Object
rubocop:disable Metrics/MethodLength.
- #valkyrie_transition? ⇒ Boolean
Identifier Minting collapse
IIIF collapse
-
#iiif_image_server? ⇒ Boolean
Enable IIIF image service.
Theme collapse
Valkyrie collapse
- #branding_storage_adapter ⇒ Valkyrie::StorageAdapter
- #branding_storage_adapter=(adapter) ⇒ Object
- #derivatives_storage_adapter ⇒ Valkyrie::StorageAdapter
- #derivatives_storage_adapter=(adapter) ⇒ Object
-
#index_adapter ⇒ #save, ...
An indexing adapter.
- #index_adapter=(adapter) ⇒ Object
-
#use_valkyrie? ⇒ Boolean
Whether to use valkyrie storage features.
Instance Method Summary collapse
- #active_deposit_agreement_acceptance? ⇒ Boolean
-
#admin_set_class ⇒ Class
The configured admin set model class.
-
#admin_set_class_for_wings ⇒ Object
private
There are assumptions baked into Wings and tests regarding what the correct conceptual admin set will be.
- #arkivo_api? ⇒ Boolean
- #browse_everything? ⇒ Boolean
- #citations? ⇒ Boolean
-
#collection_class ⇒ Class
The configured collection model class.
-
#collection_class_for_wings ⇒ Object
private
There are assumptions baked into Wings and tests regarding what the correct conceptual collection will be.
-
#curation_concerns ⇒ Array<Class>
The registered curation concerns.
-
#default_admin_set ⇒ Hyrax::AdministrativeSet
The default admin set.
-
#default_admin_set_id ⇒ String
The default admin set id.
- #display_microdata? ⇒ Boolean
- #display_share_button_when_not_logged_in? ⇒ Boolean
- #extract_full_text? ⇒ Boolean
-
#geonames_username=(username) ⇒ Object
rubocop:enable Layout/LineLength.
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #realtime_notifications? ⇒ Boolean
-
#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.
-
#reset_default_admin_set ⇒ Object
If the default admin set is changed, call reset.
- #work_requires_files? ⇒ Boolean
Methods included from Callbacks
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
66 67 68 69 70 |
# File 'lib/hyrax/configuration.rb', line 66 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
915 916 917 |
# File 'lib/hyrax/configuration.rb', line 915 def active_deposit_agreement_acceptance=(value) @active_deposit_agreement_acceptance = value end |
#activity_to_show_default_seconds_since_now ⇒ Object
881 882 883 |
# File 'lib/hyrax/configuration.rb', line 881 def activity_to_show_default_seconds_since_now @activity_to_show_default_seconds_since_now ||= 24 * 60 * 60 end |
#admin_set_include_metadata ⇒ Boolean Also known as: admin_set_include_metadata?
Returns whether to include static metadata for admin_sets.
1059 |
# File 'lib/hyrax/configuration.rb', line 1059 attr_writer :admin_set_include_metadata |
#admin_set_model ⇒ #constantize
Returns a string representation of the admin set model.
1031 1032 1033 |
# File 'lib/hyrax/configuration.rb', line 1031 def admin_set_model @admin_set_model ||= 'Hyrax::AdministrativeSet' end |
#admin_set_predicate ⇒ Object
922 923 924 |
# File 'lib/hyrax/configuration.rb', line 922 def admin_set_predicate @admin_set_predicate ||= ::RDF::Vocab::DC.isPartOf end |
#admin_user_group_name ⇒ String
404 405 406 |
# File 'lib/hyrax/configuration.rb', line 404 def admin_user_group_name @admin_user_group_name ||= 'admin' end |
#administrative_set_form ⇒ Class
1099 1100 1101 |
# File 'lib/hyrax/configuration.rb', line 1099 def administrative_set_form @administrative_set_form ||= Hyrax::Forms::AdministrativeSetForm end |
#administrative_set_indexer ⇒ Class
1131 1132 1133 |
# File 'lib/hyrax/configuration.rb', line 1131 def administrative_set_indexer @administrative_set_indexer ||= Hyrax::Indexers::AdministrativeSetIndexer end |
#analytic_start_date ⇒ Object
Returns the value of attribute analytic_start_date.
178 179 180 |
# File 'lib/hyrax/configuration.rb', line 178 def analytic_start_date @analytic_start_date end |
#analytics ⇒ Object
Returns the value of attribute analytics.
124 125 126 |
# File 'lib/hyrax/configuration.rb', line 124 def analytics @analytics end |
#analytics_provider ⇒ Object
158 159 160 161 |
# File 'lib/hyrax/configuration.rb', line 158 def analytics_provider @analytics_provider ||= ENV.fetch('HYRAX_ANALYTICS_PROVIDER', 'ga4') end |
#analytics_reporting ⇒ Object
Returns the value of attribute analytics_reporting.
134 135 136 |
# File 'lib/hyrax/configuration.rb', line 134 def analytics_reporting @analytics_reporting end |
#analytics_start_date ⇒ Object
171 172 173 174 |
# File 'lib/hyrax/configuration.rb', line 171 def analytics_start_date @analytics_start_date ||= ENV.fetch('ANALYTICS_START_DATE', Time.zone.today - 1.year) end |
#arkivo_api=(value) ⇒ Object (writeonly)
Sets the attribute arkivo_api
885 886 887 |
# File 'lib/hyrax/configuration.rb', line 885 def arkivo_api=(value) @arkivo_api = value end |
#audit_user_key ⇒ Object
980 981 982 |
# File 'lib/hyrax/configuration.rb', line 980 def audit_user_key @audit_user_key ||= '[email protected]' end |
#bagit_dir ⇒ Object
540 541 542 |
# File 'lib/hyrax/configuration.rb', line 540 def bagit_dir @bagit_dir ||= "tmp/descriptions" end |
#banner_image ⇒ Object
627 628 629 630 |
# File 'lib/hyrax/configuration.rb', line 627 def # This image can be used for free and without attribution. See here for source and license: https://github.com/samvera/hyrax/issues/1551#issuecomment-326624909 ||= 'https://user-images.githubusercontent.com/101482/29949206-ffa60d2c-8e67-11e7-988d-4910b8787d56.jpg' end |
#batch_user_key ⇒ Object
975 976 977 |
# File 'lib/hyrax/configuration.rb', line 975 def batch_user_key @batch_user_key ||= '[email protected]' end |
#branding_path ⇒ Object
570 571 572 |
# File 'lib/hyrax/configuration.rb', line 570 def branding_path @branding_path ||= Pathname.new(ENV.fetch('HYRAX_BRANDING_PATH', Rails.root.join('public', 'branding'))) end |
#breadcrumb_builder ⇒ Object
633 634 635 |
# File 'lib/hyrax/configuration.rb', line 633 def ||= Hyrax::BootstrapBreadcrumbsBuilder end |
#browse_everything=(value) ⇒ Object (writeonly)
Sets the attribute browse_everything
865 866 867 |
# File 'lib/hyrax/configuration.rb', line 865 def browse_everything=(value) @browse_everything = value end |
#cache_path ⇒ Object
564 565 566 |
# File 'lib/hyrax/configuration.rb', line 564 def cache_path @cache_path ||= ->() { Pathname.new(ENV.fetch('HYRAX_CACHE_PATH') { Rails.root.join('tmp', 'cache') }) } end |
#characterization_options ⇒ Hash
Returns of options like :fits_servlet.
198 |
# File 'lib/hyrax/configuration.rb', line 198 attr_writer :characterization_options |
#characterization_proxy ⇒ Object
208 209 210 |
# File 'lib/hyrax/configuration.rb', line 208 def characterization_proxy @characterization_proxy ||= :original_file end |
#characterization_runner ⇒ Object
Override characterization runner
213 214 215 |
# File 'lib/hyrax/configuration.rb', line 213 def characterization_runner @characterization_runner end |
#characterization_service ⇒ #run
@ see Hyrax::Characterization::ValkyrieCharacterizationService
188 |
# File 'lib/hyrax/configuration.rb', line 188 attr_writer :characterization_service |
#citations=(value) ⇒ Object (writeonly)
Sets the attribute citations
870 871 872 |
# File 'lib/hyrax/configuration.rb', line 870 def citations=(value) @citations = value end |
#collection_include_metadata ⇒ Boolean Also known as: collection_include_metadata?
Returns whether to include static metadata for collections.
1006 |
# File 'lib/hyrax/configuration.rb', line 1006 attr_writer :collection_include_metadata |
#collection_model ⇒ #constantize
Returns a string representation of the collection model.
993 994 995 |
# File 'lib/hyrax/configuration.rb', line 993 def collection_model @collection_model ||= 'Hyrax::PcdmCollection' end |
#collection_type_index_field ⇒ Object
985 986 987 |
# File 'lib/hyrax/configuration.rb', line 985 def collection_type_index_field @collection_type_index_field ||= 'collection_type_gid_ssim' end |
#contact_email ⇒ Object
1211 1212 1213 |
# File 'lib/hyrax/configuration.rb', line 1211 def contact_email @contact_email ||= "[email protected]" 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.
97 98 99 |
# File 'lib/hyrax/configuration.rb', line 97 def default_active_workflow_name @default_active_workflow_name end |
#derivative_mime_type_mappings ⇒ Object
these used to be set by Hydra::Works::MimeTypes methods injected into ‘FileSet`. for backwards compatibility, those are used as defaults if present, but since `FileSet` is an application side model (and slated to be removed) we shouldn’t count on it providing these methods.
Maps mimetypes to create_*_derivatives methods
278 279 280 281 282 283 284 285 |
# File 'lib/hyrax/configuration.rb', line 278 def derivative_mime_type_mappings @derivative_mime_type_mappings ||= { audio: lookup_mimes(:audio_mime_types), image: lookup_mimes(:image_mime_types), office: lookup_mimes(:office_mime_types), pdf: lookup_mimes(:pdf_mime_types), video: lookup_mimes(:video_mime_types) } end |
#derivative_services ⇒ Array
The registered candidate derivative services. In the array, the first ‘valid?` candidate will handle the derivative generation.
293 294 295 |
# File 'lib/hyrax/configuration.rb', line 293 def derivative_services @derivative_services ||= [Hyrax::FileSetDerivativesService] end |
#derivatives_path ⇒ Object
546 547 548 |
# File 'lib/hyrax/configuration.rb', line 546 def derivatives_path @derivatives_path ||= Pathname.new(ENV.fetch('HYRAX_DERIVATIVES_PATH', Rails.root.join('tmp', 'derivatives'))) end |
#disable_freyja ⇒ Boolean
647 648 649 650 |
# File 'lib/hyrax/configuration.rb', line 647 def disable_freyja return @disable_freyja unless @disable_freyja.nil? ActiveModel::Type::Boolean.new.cast(ENV.fetch('HYRAX_SKIP_FREYJA', false)) end |
#disable_frigg ⇒ Boolean
655 656 657 658 |
# File 'lib/hyrax/configuration.rb', line 655 def disable_frigg return @disable_frigg unless @disable_frigg.nil? ActiveModel::Type::Boolean.new.cast(ENV.fetch('HYRAX_SKIP_FRIGG', false)) end |
#disable_include_metadata ⇒ Object
371 372 373 |
# File 'lib/hyrax/configuration.rb', line 371 def ||= ActiveModel::Type::Boolean.new.cast(ENV.fetch('HYRAX_DISABLE_INCLUDE_METADATA', false)) end |
#disable_wings ⇒ Boolean
639 640 641 642 |
# File 'lib/hyrax/configuration.rb', line 639 def disable_wings return @disable_wings unless @disable_wings.nil? ActiveModel::Type::Boolean.new.cast(ENV.fetch('HYRAX_SKIP_WINGS', false)) end |
#display_media_download_link=(value) ⇒ Object (writeonly)
Sets the attribute display_media_download_link
661 662 663 |
# File 'lib/hyrax/configuration.rb', line 661 def display_media_download_link=(value) @display_media_download_link = value end |
#display_microdata=(value) ⇒ Object (writeonly)
Sets the attribute display_microdata
745 746 747 |
# File 'lib/hyrax/configuration.rb', line 745 def display_microdata=(value) @display_microdata = value end |
#display_share_button_when_not_logged_in=(value) ⇒ Object (writeonly)
Should a button with “Share my work” show on the front page to users who are not logged in?
1161 1162 1163 |
# File 'lib/hyrax/configuration.rb', line 1161 def (value) = value end |
#enable_ffmpeg ⇒ Object
578 579 580 581 |
# File 'lib/hyrax/configuration.rb', line 578 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.
743 744 745 |
# File 'lib/hyrax/configuration.rb', line 743 def enable_local_ingest @enable_local_ingest end |
#enable_noids=(value) ⇒ Object (writeonly)
Sets the attribute enable_noids
425 426 427 |
# File 'lib/hyrax/configuration.rb', line 425 def enable_noids=(value) @enable_noids = value end |
#extract_full_text=(value) ⇒ Object (writeonly)
Sets the attribute extract_full_text
1220 1221 1222 |
# File 'lib/hyrax/configuration.rb', line 1220 def extract_full_text=(value) @extract_full_text = value end |
#feature_config_path ⇒ Object
739 740 741 |
# File 'lib/hyrax/configuration.rb', line 739 def feature_config_path @feature_config_path ||= Rails.root.join('config', 'features.yml') end |
#fedora_connection_builder ⇒ #call
A HTTP connection to use for Valkyrie Fedora requests
698 699 700 701 702 703 704 705 706 |
# File 'lib/hyrax/configuration.rb', line 698 def fedora_connection_builder @fedora_connection_builder ||= lambda { |url| Faraday.new(url) do |f| f.request :multipart f.request :url_encoded f.adapter Faraday.default_adapter end } end |
#ffmpeg_path ⇒ Object
we recommend setting the FFMPEG path with the ‘HYRAX_FFMPEG_PATH` environment variable
587 588 589 |
# File 'lib/hyrax/configuration.rb', line 587 def ffmpeg_path @ffmpeg_path ||= ENV.fetch('HYRAX_FFMPEG_PATH', 'ffmpeg') end |
#file_set_file_service ⇒ Class
Returns implementer of FileSetFileService.
323 |
# File 'lib/hyrax/configuration.rb', line 323 attr_writer :file_set_file_service |
#file_set_form ⇒ Class
1106 1107 1108 |
# File 'lib/hyrax/configuration.rb', line 1106 def file_set_form @file_set_form ||= Hyrax::Forms::FileSetForm end |
#file_set_include_metadata ⇒ Boolean Also known as: file_set_include_metadata?
Returns whether to include static metadata for file_sets.
314 |
# File 'lib/hyrax/configuration.rb', line 314 attr_writer :file_set_include_metadata |
#file_set_indexer ⇒ Class
1138 1139 1140 |
# File 'lib/hyrax/configuration.rb', line 1138 def file_set_indexer @file_set_indexer ||= Hyrax::Indexers::FileSetIndexer end |
#file_set_model ⇒ #constantize
Returns a string representation of the admin set model.
301 302 303 |
# File 'lib/hyrax/configuration.rb', line 301 def file_set_model @file_set_model ||= 'Hyrax::FileSet' end |
#fits_message_length ⇒ Object
600 601 602 |
# File 'lib/hyrax/configuration.rb', line 600 def ||= 5 end |
#fits_path ⇒ Object
we recommend setting the FITS path with the ‘HYRAX_FITS_PATH` environment variable
595 596 597 |
# File 'lib/hyrax/configuration.rb', line 595 def fits_path @fits_path ||= ENV.fetch('HYRAX_FITS_PATH', 'fits.sh') end |
#fixity_service ⇒ Object
329 330 331 |
# File 'lib/hyrax/configuration.rb', line 329 def fixity_service @fixity_service ||= Hyrax::Fixity::ActiveFedoraFixityService end |
#flexible ⇒ Object Also known as: flexible?
335 336 337 338 |
# File 'lib/hyrax/configuration.rb', line 335 def flexible @flexible ||= ActiveModel::Type::Boolean.new.cast(ENV.fetch('HYRAX_FLEXIBLE', false)) end |
#flexible_classes ⇒ Object
343 344 345 346 347 348 349 350 351 352 353 354 355 356 |
# File 'lib/hyrax/configuration.rb', line 343 def flexible_classes flexible_env = ENV.fetch('HYRAX_FLEXIBLE_CLASSES', nil) flexible_env = flexible_env.split(',').map(&:strip) if flexible_env flexible_env ||= if flexible? [ Hyrax.config.collection_model, Hyrax.config.file_set_model, Hyrax.config.admin_set_model ] else [] end @flexible_classes ||= flexible_env end |
#id_field ⇒ Object
1087 1088 1089 |
# File 'lib/hyrax/configuration.rb', line 1087 def id_field @id_field || index_field_mapper.id_field end |
#identifier_registrars ⇒ Object
1242 1243 1244 |
# File 'lib/hyrax/configuration.rb', line 1242 def identifier_registrars @identifier_registrars ||= {} end |
#iiif_image_compliance_level_uri ⇒ String
URL that indicates your IIIF image server compliance level
496 497 498 |
# File 'lib/hyrax/configuration.rb', line 496 def iiif_image_compliance_level_uri @iiif_image_compliance_level_uri ||= 'http://iiif.io/api/image/2/level2.json' end |
#iiif_image_server=(value) ⇒ Object (writeonly)
Sets the attribute iiif_image_server
450 451 452 |
# File 'lib/hyrax/configuration.rb', line 450 def iiif_image_server=(value) @iiif_image_server = value end |
#iiif_image_size_default ⇒ #String
IIIF image size default
503 504 505 |
# File 'lib/hyrax/configuration.rb', line 503 def iiif_image_size_default @iiif_image_size_default ||= '600,' end |
#iiif_image_url_builder ⇒ #call
URL that resolves to an image provided by a IIIF image server
482 483 484 |
# File 'lib/hyrax/configuration.rb', line 482 def iiif_image_url_builder @iiif_image_url_builder ||= ->(file_id, base_url, _size, _format) { "#{base_url}/downloads/#{file_id.split('/').first}" } end |
#iiif_info_url_builder ⇒ #call
URL that resolves to an info.json file provided by a IIIF image server
489 490 491 |
# File 'lib/hyrax/configuration.rb', line 489 def iiif_info_url_builder @iiif_info_url_builder ||= ->(_file_id, _base_url) { '' } end |
#iiif_manifest_cache_duration ⇒ Integer
Duration in which we should cache the generated IIIF manifest. Default is 30 days (in seconds).
519 520 521 |
# File 'lib/hyrax/configuration.rb', line 519 def iiif_manifest_cache_duration @iiif_manifest_cache_duration ||= 30.days.to_i end |
#iiif_metadata_fields ⇒ #Array
IIIF metadata - fields to display in the metadata section
510 511 512 |
# File 'lib/hyrax/configuration.rb', line 510 def ||= Hyrax::Forms::WorkForm.required_fields end |
#import_export_jar_file_path ⇒ Object
607 608 609 |
# File 'lib/hyrax/configuration.rb', line 607 def import_export_jar_file_path @import_export_jar_file_path ||= "tmp/fcrepo-import-export.jar" end |
#index_field_mapper ⇒ Object
1092 1093 1094 |
# File 'lib/hyrax/configuration.rb', line 1092 def index_field_mapper @index_field_mapper ||= ActiveFedora.index_field_mapper end |
#ingest_queue_name ⇒ Object
781 782 783 |
# File 'lib/hyrax/configuration.rb', line 781 def ingest_queue_name @ingest_queue_name ||= :default end |
#libreoffice_path ⇒ Object
861 862 863 |
# File 'lib/hyrax/configuration.rb', line 861 def libreoffice_path @libreoffice_path ||= "soffice" end |
#license_service_class ⇒ Object
834 835 836 |
# File 'lib/hyrax/configuration.rb', line 834 def license_service_class @license_service_class ||= Hyrax::LicenseService end |
#location_service ⇒ Object
910 911 912 |
# File 'lib/hyrax/configuration.rb', line 910 def location_service @location_service ||= Hyrax::LocationService.new end |
#lock_retry_count ⇒ Object
760 761 762 |
# File 'lib/hyrax/configuration.rb', line 760 def lock_retry_count @lock_retry_count ||= 600 # Up to 2 minutes of trying at intervals up to 200ms end |
#lock_retry_delay ⇒ Object
774 775 776 |
# File 'lib/hyrax/configuration.rb', line 774 def lock_retry_delay @lock_retry_delay ||= 200 # milliseconds end |
#lock_time_to_live ⇒ Object
767 768 769 |
# File 'lib/hyrax/configuration.rb', line 767 def lock_time_to_live @lock_time_to_live ||= 60_000 # milliseconds end |
#logger ⇒ Logger
80 81 82 83 84 85 86 |
# File 'lib/hyrax/configuration.rb', line 80 def logger @logger ||= if defined?(Rails) Rails.logger else Valkyrie.logger end end |
#max_days_between_fixity_checks ⇒ Object
384 385 386 |
# File 'lib/hyrax/configuration.rb', line 384 def max_days_between_fixity_checks @max_days_between_fixity_checks ||= 7 end |
#max_notifications_for_dashboard ⇒ Object
876 877 878 |
# File 'lib/hyrax/configuration.rb', line 876 def max_notifications_for_dashboard @max_notifications_for_dashboard ||= 5 end |
#microdata_default_type ⇒ Object
752 753 754 |
# File 'lib/hyrax/configuration.rb', line 752 def microdata_default_type @microdata_default_type ||= 'http://schema.org/CreativeWork' end |
#minter_statefile ⇒ Object
442 443 444 |
# File 'lib/hyrax/configuration.rb', line 442 def minter_statefile @minter_statefile ||= '/tmp/minter-state' end |
#noid_minter_class ⇒ Object
437 438 439 |
# File 'lib/hyrax/configuration.rb', line 437 def noid_minter_class @noid_minter_class ||= ::Noid::Rails::Minter::Db end |
#noid_template ⇒ Object
432 433 434 |
# File 'lib/hyrax/configuration.rb', line 432 def noid_template @noid_template ||= '.reeddeeddk' end |
#owner_permission_levels ⇒ Object
1174 1175 1176 |
# File 'lib/hyrax/configuration.rb', line 1174 def ||= { I18n.t('hyrax.permission_levels.owner.edit') => "edit" } end |
#pcdm_collection_form ⇒ Class
1113 1114 1115 |
# File 'lib/hyrax/configuration.rb', line 1113 def pcdm_collection_form @pcdm_collection_form ||= Hyrax::Forms::PcdmCollectionForm end |
#pcdm_collection_indexer ⇒ Class
1145 1146 1147 |
# File 'lib/hyrax/configuration.rb', line 1145 def pcdm_collection_indexer @pcdm_collection_indexer ||= Hyrax::Indexers::PcdmCollectionIndexer end |
#pcdm_object_form_builder ⇒ Proc
1120 1121 1122 1123 1124 1125 1126 |
# File 'lib/hyrax/configuration.rb', line 1120 def pcdm_object_form_builder return @pcdm_object_form_builder unless @pcdm_object_form_builder.nil? "Hyrax::Forms::PcdmObjectForm".constantize # autoload @pcdm_object_form_builder = lambda do |model_class| Hyrax::Forms::PcdmObjectForm(model_class) end end |
#pcdm_object_indexer_builder ⇒ Proc
1152 1153 1154 1155 1156 1157 1158 |
# File 'lib/hyrax/configuration.rb', line 1152 def pcdm_object_indexer_builder return @pcdm_object_indexer_builder unless @pcdm_object_indexer_builder.nil? "Hyrax::Indexers::PcdmObjectIndexer".constantize # autoload @pcdm_object_indexer_builder = lambda do |model_class| Hyrax::Indexers::PcdmObjectIndexer(model_class) end end |
#permission_levels ⇒ Object
1168 1169 1170 1171 |
# File 'lib/hyrax/configuration.rb', line 1168 def ||= { I18n.t('hyrax.permission_levels.read') => "read", I18n.t('hyrax.permission_levels.edit') => "edit" } end |
#permission_options ⇒ Object
1179 1180 1181 1182 1183 |
# File 'lib/hyrax/configuration.rb', line 1179 def ||= { I18n.t('hyrax.permission_levels.options.none') => "none", I18n.t('hyrax.permission_levels.options.read') => "read", I18n.t('hyrax.permission_levels.options.edit') => "edit" } end |
#persistent_hostpath ⇒ Object
850 851 852 |
# File 'lib/hyrax/configuration.rb', line 850 def persistent_hostpath @persistent_hostpath ||= "http://localhost/files/" end |
#public_user_group_name ⇒ String
411 412 413 |
# File 'lib/hyrax/configuration.rb', line 411 def public_user_group_name @public_user_group_name ||= 'public' end |
#publisher ⇒ Object
1186 1187 1188 |
# File 'lib/hyrax/configuration.rb', line 1186 def publisher @publisher ||= Hyrax::Publisher.instance end |
#query_index_from_valkyrie ⇒ Boolean
Returns whether to use the valkyrie index.
723 724 725 |
# File 'lib/hyrax/configuration.rb', line 723 def query_index_from_valkyrie @query_index_from_valkyrie ||= false end |
#range_for_number_of_results_to_display_per_page ⇒ Array<Integer>
1256 1257 1258 |
# File 'lib/hyrax/configuration.rb', line 1256 def range_for_number_of_results_to_display_per_page @range_for_number_of_results_to_display_per_page ||= [10, 20, 50, 100] end |
#realtime_notifications=(value) ⇒ Object (writeonly)
rubocop:disable Layout/LineLength
891 892 893 |
# File 'lib/hyrax/configuration.rb', line 891 def realtime_notifications=(value) @realtime_notifications = value end |
#redis_connection ⇒ Object
Returns the value of attribute redis_connection.
854 855 856 |
# File 'lib/hyrax/configuration.rb', line 854 def redis_connection @redis_connection end |
#redis_namespace ⇒ Object
856 857 858 |
# File 'lib/hyrax/configuration.rb', line 856 def redis_namespace @redis_namespace ||= ENV.fetch("HYRAX_REDIS_NAMESPACE", "hyrax") end |
#registered_ingest_dirs ⇒ Object
788 789 790 791 792 793 794 795 796 797 798 |
# File 'lib/hyrax/configuration.rb', line 788 def registered_ingest_dirs @registered_ingest_dirs ||= \ if defined? BrowseEverything file_system_dirs = Array.wrap(BrowseEverything.config['file_system'].try(:[], :home)).compact # Include the Rails tmp directory for cases where the BrowseEverything provider is required to download the file to a temporary directory first tmp_dir = [Rails.root.join('tmp').to_s] file_system_dirs + tmp_dir else [] end end |
#registered_user_group_name ⇒ String
418 419 420 |
# File 'lib/hyrax/configuration.rb', line 418 def registered_user_group_name @registered_user_group_name ||= 'registered' end |
#rendering_predicate ⇒ RDF::URI
defaults to dc:hasFormat
Set predicate for rendering to dc:hasFormat as defined in IIIF Presentation API context: iiif.io/api/presentation/2/context.json
530 531 532 |
# File 'lib/hyrax/configuration.rb', line 530 def rendering_predicate @rendering_predicate ||= ::RDF::Vocab::DC.hasFormat end |
#rights_statement_service_class ⇒ Object
845 846 847 |
# File 'lib/hyrax/configuration.rb', line 845 def rights_statement_service_class @rights_statement_service_class ||= Hyrax::RightsStatementService end |
#schema_loader_config_search_paths ⇒ Array<Pathname> Also known as: simple_schema_loader_config_search_paths, m3_schema_loader_config_search_paths
A configuration for modifying the SimpleSchemaLoader#config_search_paths which will allow gems to add their own metadata yaml files and easily keep them within the gem.
1287 1288 1289 |
# File 'lib/hyrax/configuration.rb', line 1287 def schema_loader_config_search_paths @schema_loader_config_search_paths ||= [Rails.root, Hyrax::Engine.root] end |
#show_work_item_rows ⇒ Object
962 963 964 |
# File 'lib/hyrax/configuration.rb', line 962 def show_work_item_rows @show_work_item_rows ||= 10 # rows on show view end |
#solr_default_method ⇒ Object
1237 1238 1239 |
# File 'lib/hyrax/configuration.rb', line 1237 def solr_default_method @solr_default_method ||= :post end |
#solr_select_path ⇒ Object
1232 1233 1234 |
# File 'lib/hyrax/configuration.rb', line 1232 def solr_select_path @solr_select_path ||= ActiveFedora.solr_config.fetch(:select_path, 'select') end |
#subject_prefix ⇒ Object
1216 1217 1218 |
# File 'lib/hyrax/configuration.rb', line 1216 def subject_prefix @subject_prefix ||= "Contact form:" end |
#system_user_key ⇒ Object
970 971 972 |
# File 'lib/hyrax/configuration.rb', line 970 def system_user_key @system_user_key ||= '[email protected]' end |
#temp_file_base ⇒ Object
Returns the value of attribute temp_file_base.
743 744 745 |
# File 'lib/hyrax/configuration.rb', line 743 def temp_file_base @temp_file_base end |
#translate_id_to_uri ⇒ Object
1204 1205 1206 1207 1208 |
# File 'lib/hyrax/configuration.rb', line 1204 def translate_id_to_uri @translate_id_to_uri ||= lambda do |id| "#{ActiveFedora.fedora.host}#{ActiveFedora.fedora.base_path}/#{::Noid::Rails.treeify(id.to_s)}" end end |
#translate_uri_to_id ⇒ Object
1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 |
# File 'lib/hyrax/configuration.rb', line 1192 def translate_uri_to_id @translate_uri_to_id ||= begin baseparts = 2 + [(::Noid::Rails.config.template.gsub(/\.[rsz]/, '').length.to_f / 2).ceil, 4].min lambda do |uri| uri.to_s.split(ActiveFedora.fedora.base_path).last.split('/', baseparts).last end end end |
#upload_path ⇒ Object
559 560 561 |
# File 'lib/hyrax/configuration.rb', line 559 def upload_path @upload_path ||= ->() { Pathname.new(ENV.fetch('HYRAX_UPLOAD_PATH') { Rails.root.join('tmp', 'uploads') }) } end |
#uploader ⇒ Object
1227 1228 1229 |
# File 'lib/hyrax/configuration.rb', line 1227 def uploader @uploader ||= default_uploader_config end |
#use_valkyrie=(value) ⇒ Object (writeonly)
Sets the attribute use_valkyrie
735 736 737 |
# File 'lib/hyrax/configuration.rb', line 735 def use_valkyrie=(value) @use_valkyrie = value end |
#valkyrie_transition ⇒ Object
Returns the value of attribute valkyrie_transition.
377 378 379 |
# File 'lib/hyrax/configuration.rb', line 377 def valkyrie_transition @valkyrie_transition end |
#virus_scanner ⇒ Object
614 615 616 617 618 619 620 621 |
# File 'lib/hyrax/configuration.rb', line 614 def virus_scanner @virus_scanner ||= if Hyrax.primary_work_type.respond_to?(:default_system_virus_scanner) Hyrax.primary_work_type.default_system_virus_scanner else Hyrax::VirusScanner end end |
#visibility_map ⇒ Hyrax::VisibilityMap
A mapping from visibility string values to permissions; the default and reference implementation is provided by VisibilityMap.
1267 1268 1269 |
# File 'lib/hyrax/configuration.rb', line 1267 def visibility_map @visibility_map ||= Hyrax::VisibilityMap.instance end |
#work_default_metadata ⇒ Boolean Also known as: work_default_metadata?
this is deprecated and will be removed in a future release
939 |
# File 'lib/hyrax/configuration.rb', line 939 attr_writer :work_default_metadata |
#work_include_metadata ⇒ Boolean Also known as: work_include_metadata?
Returns whether to include static metadata for works.
929 |
# File 'lib/hyrax/configuration.rb', line 929 attr_writer :work_include_metadata |
#work_requires_files=(value) ⇒ Object (writeonly)
Sets the attribute work_requires_files
955 956 957 |
# File 'lib/hyrax/configuration.rb', line 955 def work_requires_files=(value) @work_requires_files = value end |
#working_path ⇒ Object
552 553 554 |
# File 'lib/hyrax/configuration.rb', line 552 def working_path @working_path ||= Pathname.new(ENV.fetch('HYRAX_UPLOAD_PATH', Rails.root.join('tmp', 'uploads'))) end |
Instance Method Details
#active_deposit_agreement_acceptance? ⇒ Boolean
916 917 918 919 |
# File 'lib/hyrax/configuration.rb', line 916 def active_deposit_agreement_acceptance? return true if @active_deposit_agreement_acceptance.nil? @active_deposit_agreement_acceptance end |
#admin_set_class ⇒ Class
Returns the configured admin set model class.
1037 1038 1039 |
# File 'lib/hyrax/configuration.rb', line 1037 def admin_set_class admin_set_model.constantize end |
#admin_set_class_for_wings ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
There are assumptions baked into Wings and tests regarding what the correct conceptual admin set will be. This helps provide that connective tissue.
It is definitely a hack to appease tests and the Double Combo/Goddess adapter migration.
1050 1051 1052 1053 1054 |
# File 'lib/hyrax/configuration.rb', line 1050 def admin_set_class_for_wings return admin_set_class if admin_set_class < Hyrax::Resource Hyrax::AdministrativeSet end |
#admin_set_flexible? ⇒ Boolean
358 359 360 |
# File 'lib/hyrax/configuration.rb', line 358 def admin_set_flexible? flexible_classes.include?(admin_set_model) || (admin_set_class.respond_to?(:flexible?) && admin_set_class.flexible?) end |
#analytics? ⇒ Boolean
125 126 127 128 |
# File 'lib/hyrax/configuration.rb', line 125 def analytics? @analytics ||= ActiveModel::Type::Boolean.new.cast(ENV.fetch('HYRAX_ANALYTICS', false)) end |
#analytics_reporting? ⇒ Boolean
135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 |
# File 'lib/hyrax/configuration.rb', line 135 def analytics_reporting? @analytics_reporting ||= begin required_env_vars = %w[ HYRAX_ANALYTICS_REPORTING GOOGLE_ANALYTICS_ID GOOGLE_ANALYTICS_PROPERTY_ID ] required_env_vars << if ENV['GOOGLE_ACCOUNT_JSON'].blank? 'GOOGLE_ACCOUNT_JSON_PATH' else 'GOOGLE_ACCOUNT_JSON' end return false if required_env_vars.any? { |var| ENV.fetch(var, '').blank? } ActiveModel::Type::Boolean.new.cast(ENV.fetch('HYRAX_ANALYTICS_REPORTING', false)) end end |
#arkivo_api? ⇒ Boolean
886 887 888 |
# File 'lib/hyrax/configuration.rb', line 886 def arkivo_api? @arkivo_api ||= false end |
#branding_storage_adapter ⇒ Valkyrie::StorageAdapter
673 674 675 |
# File 'lib/hyrax/configuration.rb', line 673 def branding_storage_adapter @branding_storage_adapter ||= Valkyrie::StorageAdapter.find(:branding_disk) end |
#branding_storage_adapter=(adapter) ⇒ Object
679 680 681 |
# File 'lib/hyrax/configuration.rb', line 679 def branding_storage_adapter=(adapter) @branding_storage_adapter = Valkyrie::StorageAdapter.find(adapter.to_sym) end |
#browse_everything? ⇒ Boolean
866 867 868 |
# File 'lib/hyrax/configuration.rb', line 866 def browse_everything? @browse_everything ||= nil end |
#citations? ⇒ Boolean
871 872 873 |
# File 'lib/hyrax/configuration.rb', line 871 def citations? @citations ||= false end |
#collection_class ⇒ Class
Returns the configured collection model class.
999 1000 1001 |
# File 'lib/hyrax/configuration.rb', line 999 def collection_class collection_model.safe_constantize end |
#collection_class_for_wings ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
There are assumptions baked into Wings and tests regarding what the correct conceptual collection will be. This helps provide that connective tissue.
It is definitely a hack to appease tests and the Double Combo/Goddess adapter migration.
1021 1022 1023 1024 1025 |
# File 'lib/hyrax/configuration.rb', line 1021 def collection_class_for_wings return collection_class if collection_class < Hyrax::Resource Hyrax::PcdmCollection end |
#collection_flexible? ⇒ Boolean
362 363 364 |
# File 'lib/hyrax/configuration.rb', line 362 def collection_flexible? flexible_classes.include?(collection_model) || (collection_class.respond_to?(:flexible?) && collection_class.flexible?) end |
#curation_concerns ⇒ Array<Class>
Returns the registered curation concerns.
823 824 825 |
# File 'lib/hyrax/configuration.rb', line 823 def curation_concerns registered_curation_concern_types.map(&:constantize) end |
#default_admin_set ⇒ Hyrax::AdministrativeSet
Returns the default admin set.
1074 1075 1076 |
# File 'lib/hyrax/configuration.rb', line 1074 def default_admin_set @default_admin_set ||= Hyrax::AdminSetCreateService.find_or_create_default_admin_set end |
#default_admin_set_id ⇒ String
Returns the default admin set id.
1067 1068 1069 |
# File 'lib/hyrax/configuration.rb', line 1067 def default_admin_set_id default_admin_set.id.to_s end |
#derivatives_storage_adapter ⇒ Valkyrie::StorageAdapter
685 686 687 |
# File 'lib/hyrax/configuration.rb', line 685 def derivatives_storage_adapter @derivatives_storage_adapter ||= Valkyrie::StorageAdapter.find(:derivatives_disk) end |
#derivatives_storage_adapter=(adapter) ⇒ Object
691 692 693 |
# File 'lib/hyrax/configuration.rb', line 691 def derivatives_storage_adapter=(adapter) @derivatives_storage_adapter = Valkyrie::StorageAdapter.find(adapter.to_sym) end |
#display_media_download_link? ⇒ Boolean
663 664 665 666 |
# File 'lib/hyrax/configuration.rb', line 663 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
746 747 748 749 |
# File 'lib/hyrax/configuration.rb', line 746 def display_microdata? return @display_microdata unless @display_microdata.nil? @display_microdata = true end |
#display_share_button_when_not_logged_in? ⇒ Boolean
1162 1163 1164 1165 |
# File 'lib/hyrax/configuration.rb', line 1162 def return true if .nil? end |
#enable_noids? ⇒ Boolean
426 427 428 429 |
# File 'lib/hyrax/configuration.rb', line 426 def enable_noids? return @enable_noids unless @enable_noids.nil? @enable_noids = true end |
#extract_full_text? ⇒ Boolean
1221 1222 1223 1224 |
# File 'lib/hyrax/configuration.rb', line 1221 def extract_full_text? return @extract_full_text unless @extract_full_text.nil? @extract_full_text = true end |
#file_set_class ⇒ Class
Returns the configured admin set model class.
307 308 309 |
# File 'lib/hyrax/configuration.rb', line 307 def file_set_class file_set_model.constantize end |
#file_set_flexible? ⇒ Boolean
366 367 368 |
# File 'lib/hyrax/configuration.rb', line 366 def file_set_flexible? flexible_classes.include?(file_set_model) || (file_set_class.respond_to?(:flexible?) && file_set_class.flexible?) end |
#geonames_username=(username) ⇒ Object
rubocop:enable Layout/LineLength
906 907 908 |
# File 'lib/hyrax/configuration.rb', line 906 def geonames_username=(username) Qa::Authorities::Geonames.username = username end |
#iiif_image_server? ⇒ Boolean
Default is false
Enable IIIF image service. This is required to use the IIIF viewer enabled show page
If you have run the hyrax:riiif generator, an embedded riiif service will be used to deliver images via IIIF. If you have not, you will need to configure the following other configuration values to work with your image server.
474 475 476 477 |
# File 'lib/hyrax/configuration.rb', line 474 def iiif_image_server? return @iiif_image_server unless @iiif_image_server.nil? @iiif_image_server = false end |
#index_adapter ⇒ #save, ...
Returns an indexing adapter.
711 712 713 |
# File 'lib/hyrax/configuration.rb', line 711 def index_adapter @index_adapter ||= Valkyrie::IndexingAdapter.find(:null_index) end |
#index_adapter=(adapter) ⇒ Object
717 718 719 |
# File 'lib/hyrax/configuration.rb', line 717 def index_adapter=(adapter) @index_adapter = Valkyrie::IndexingAdapter.find(adapter.to_sym) end |
#lookup_mimes(type) ⇒ Object
First see if we can get them from the FileSet model. If not, use configuration. FileSet method names for backwards compatibility.
261 262 263 264 265 |
# File 'lib/hyrax/configuration.rb', line 261 def lookup_mimes(type) vals = "FileSet".safe_constantize.try(type) return vals if vals.is_a?(Array) mime_types_map[type] end |
#mime_types_map ⇒ Object
rubocop:disable Metrics/MethodLength
215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 |
# File 'lib/hyrax/configuration.rb', line 215 def mime_types_map # rubocop:disable Metrics/MethodLength { audio_mime_types: [ 'audio/mp3', 'audio/mpeg', 'audio/wav', 'audio/x-wave', 'audio/x-wav', 'audio/ogg' ], image_mime_types: [ 'image/png', 'image/jpeg', 'image/jpg', 'image/jp2', 'image/bmp', 'image/gif', 'image/tiff' ], office_mime_types: [ 'text/rtf', 'application/msword', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/vnd.oasis.opendocument.text', 'application/vnd.ms-excel', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'application/vnd.ms-powerpoint', 'application/vnd.openxmlformats-officedocument.presentationml.presentation' ], pdf_mime_types: ['application/pdf'], video_mime_types: [ 'video/mpeg', 'video/mp4', 'video/webm', 'video/x-msvideo', 'video/avi', 'video/quicktime', 'application/mxf' ] } end |
#realtime_notifications? ⇒ Boolean
892 893 894 895 896 897 898 899 900 901 902 903 |
# File 'lib/hyrax/configuration.rb', line 892 def realtime_notifications? # Coerce @realtime_notifications to false if server software # does not support WebSockets, and warn the user that we are # overriding the value in0 their config unless it's already # flipped to false if ENV.fetch('SERVER_SOFTWARE', '').match(/Apache.*Phusion_Passenger/).present? Hyrax.logger.warn('Cannot enable realtime notifications atop Passenger + Apache. Coercing `Hyrax.config.realtime_notifications` to `false`. Set this value to `false` in config/initializers/hyrax.rb to stop seeing this warning.') unless @realtime_notifications == false @realtime_notifications = false end return @realtime_notifications unless @realtime_notifications.nil? @realtime_notifications = true end |
#register_curation_concern(*curation_concern_types) ⇒ Object
Registers the given curation concern model in the configuration
809 810 811 812 813 |
# File 'lib/hyrax/configuration.rb', line 809 def register_curation_concern(*curation_concern_types) Array.wrap(curation_concern_types).flatten.compact.each do |cc_type| @registered_concerns << cc_type unless @registered_concerns.include?(cc_type) end end |
#register_roles {|Hyrax::RoleRegistry| ... } ⇒ TrueClass
Exposes a means to register application critical roles
115 116 117 118 |
# File 'lib/hyrax/configuration.rb', line 115 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
818 819 820 |
# File 'lib/hyrax/configuration.rb', line 818 def registered_curation_concern_types @registered_concerns.map { |cc_type| normalize_concern_name(cc_type) } end |
#reset_default_admin_set ⇒ Object
If the default admin set is changed, call reset. The next time one of the default admin set configs is checked, the default_admin_set variable will be updated.
1082 1083 1084 |
# File 'lib/hyrax/configuration.rb', line 1082 def reset_default_admin_set @default_admin_set = nil end |
#use_valkyrie? ⇒ Boolean
Returns whether to use valkyrie storage features.
730 731 732 733 734 |
# File 'lib/hyrax/configuration.rb', line 730 def use_valkyrie? return @use_valkyrie unless @use_valkyrie.nil? return true if disable_wings # always return true if wings is disabled ActiveModel::Type::Boolean.new.cast(ENV.fetch('HYRAX_VALKYRIE', false)) end |
#valkyrie_transition? ⇒ Boolean
378 379 380 381 |
# File 'lib/hyrax/configuration.rb', line 378 def valkyrie_transition? @valkyrie_transition ||= ActiveModel::Type::Boolean.new.cast(ENV.fetch('VALKYRIE_TRANSITION', false)) end |
#work_requires_files? ⇒ Boolean
956 957 958 959 |
# File 'lib/hyrax/configuration.rb', line 956 def work_requires_files? return true if @work_requires_files.nil? @work_requires_files end |