sufia 7.2.0 → 7.3.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.codeclimate.yml +2 -0
- data/.rubocop.yml +3 -0
- data/.rubocop_todo.yml +1 -2
- data/.travis.yml +0 -1
- data/Gemfile +2 -1
- data/README.md +23 -106
- data/app/actors/sufia/apply_permission_template_actor.rb +19 -0
- data/app/actors/sufia/create_with_remote_files_actor.rb +2 -2
- data/app/actors/sufia/default_admin_set_actor.rb +42 -0
- data/app/actors/sufia/interpret_visibility_actor.rb +115 -0
- data/app/assets/images/collection.png +0 -0
- data/app/assets/javascripts/sufia.js +6 -0
- data/app/assets/javascripts/sufia/admin/admin_set/participants.es6 +9 -0
- data/app/assets/javascripts/sufia/admin/admin_set/visibility.es6 +134 -0
- data/app/assets/javascripts/sufia/admin/admin_set_controls.es6 +11 -0
- data/app/assets/javascripts/sufia/app.js +27 -5
- data/app/assets/javascripts/sufia/autocomplete.es6 +15 -0
- data/app/assets/javascripts/sufia/autocomplete/work.es6 +29 -0
- data/app/assets/javascripts/sufia/dashboard_actions.js +2 -4
- data/app/assets/javascripts/sufia/save_work/save_work_control.es6 +14 -2
- data/app/assets/javascripts/sufia/save_work/uploaded_files.es6 +7 -2
- data/app/assets/javascripts/sufia/save_work/visibility_component.es6 +245 -4
- data/app/assets/javascripts/sufia/select_work_type.es6 +38 -0
- data/app/assets/javascripts/sufia/workflow_actions_affix.js +14 -0
- data/app/assets/stylesheets/sufia/_dashboard.scss +50 -29
- data/app/assets/stylesheets/sufia/_footer.scss +30 -0
- data/app/assets/stylesheets/sufia/_header.scss +3 -4
- data/app/assets/stylesheets/sufia/_home-page.scss +10 -8
- data/app/assets/stylesheets/sufia/_select_work_type.scss +43 -0
- data/app/assets/stylesheets/sufia/_sufia.scss +4 -1
- data/app/assets/stylesheets/sufia/_variables.scss +3 -0
- data/app/assets/stylesheets/sufia/admin.scss +66 -169
- data/app/assets/stylesheets/sufia/blacklight_gallery.scss +17 -0
- data/app/authorities/qa/authorities/find_works.rb +15 -0
- data/app/controllers/concerns/sufia/batch_edits_controller_behavior.rb +2 -1
- data/app/controllers/concerns/sufia/batch_uploads_controller_behavior.rb +26 -13
- data/app/controllers/concerns/sufia/collections_controller_behavior.rb +25 -0
- data/app/controllers/concerns/sufia/controller.rb +8 -0
- data/app/controllers/concerns/sufia/deny_access_override_behavior.rb +1 -1
- data/app/controllers/concerns/sufia/file_sets_controller_behavior.rb +5 -14
- data/app/controllers/concerns/sufia/homepage_controller_behavior.rb +2 -0
- data/app/controllers/concerns/sufia/users_controller_behavior.rb +18 -7
- data/app/controllers/concerns/sufia/works_controller_behavior.rb +13 -10
- data/app/controllers/my/collections_controller.rb +5 -0
- data/app/controllers/my/shares_controller.rb +5 -0
- data/app/controllers/my/works_controller.rb +5 -0
- data/app/controllers/stats_controller.rb +1 -1
- data/app/controllers/sufia/admin/admin_sets_controller.rb +20 -2
- data/app/controllers/sufia/admin/permission_template_accesses_controller.rb +15 -0
- data/app/controllers/sufia/admin/permission_templates_controller.rb +29 -0
- data/app/controllers/sufia/admin_controller.rb +2 -0
- data/app/controllers/sufia/trophies_controller.rb +0 -2
- data/app/forms/sufia/forms/admin_set_form.rb +19 -0
- data/app/forms/sufia/forms/batch_edit_form.rb +16 -6
- data/app/forms/sufia/forms/batch_upload_form.rb +3 -2
- data/app/forms/sufia/forms/permission_template_form.rb +115 -0
- data/app/forms/sufia/forms/work_form.rb +6 -0
- data/app/helpers/batch_edits_helper.rb +1 -1
- data/app/helpers/sufia/citations_behavior.rb +0 -5
- data/app/helpers/sufia/citations_behaviors/formatters.rb +0 -1
- data/app/helpers/sufia/sufia_helper_behavior.rb +38 -6
- data/app/indexers/sufia/collection_indexer.rb +6 -0
- data/app/jobs/batch_create_job.rb +7 -15
- data/app/models/batch_upload_item.rb +2 -0
- data/app/models/concerns/sufia/ability.rb +12 -1
- data/app/models/sufia/permission_template.rb +102 -0
- data/app/models/sufia/permission_template_access.rb +18 -0
- data/app/presenters/sufia/admin_set_presenter.rb +1 -1
- data/app/presenters/sufia/model_icon.rb +7 -0
- data/app/presenters/sufia/select_type_list_presenter.rb +37 -0
- data/app/presenters/sufia/select_type_presenter.rb +35 -0
- data/app/presenters/sufia/work_show_presenter.rb +0 -2
- data/app/search_builders/collection_search_builder.rb +0 -2
- data/app/search_builders/sufia/admin_set_search_builder.rb +24 -0
- data/app/search_builders/sufia/catalog_search_builder.rb +10 -4
- data/app/search_builders/sufia/find_works_search_builder.rb +44 -0
- data/app/search_builders/sufia/my_search_builder_behavior.rb +0 -4
- data/app/search_builders/sufia/my_works_search_builder.rb +1 -1
- data/app/services/sufia/actor_factory.rb +6 -2
- data/app/services/sufia/admin_set_create_service.rb +22 -0
- data/app/services/sufia/admin_set_service.rb +46 -16
- data/app/services/sufia/collection_thumbnail_path_service.rb +10 -0
- data/app/services/sufia/workflow/abstract_notification.rb +39 -0
- data/app/services/sufia/workflow/changes_required_notification.rb +22 -0
- data/app/services/sufia/workflow/complete_notification.rb +22 -0
- data/app/services/sufia/workflow/pending_review_notification.rb +21 -0
- data/app/services/sufia/workflow/workflow_by_admin_set_strategy.rb +15 -0
- data/app/views/_masthead.html.erb +4 -4
- data/app/views/_toolbar.html.erb +31 -9
- data/app/views/_user_util_links.html.erb +7 -7
- data/app/views/batch_edits/edit.html.erb +24 -12
- data/app/views/catalog/_thumbnail_list_collection.html.erb +1 -1
- data/app/views/collections/_form.html.erb +2 -2
- data/app/views/collections/_media_display.html.erb +1 -1
- data/app/views/curation_concerns/base/_find_work_widget.html.erb +16 -0
- data/app/views/curation_concerns/base/_form.html.erb +6 -0
- data/app/views/curation_concerns/base/_form_child_work_relationships.html.erb +1 -1
- data/app/views/curation_concerns/base/_form_metadata.html.erb +1 -1
- data/app/views/curation_concerns/base/_form_parent_work_relationships.html.erb +43 -0
- data/app/views/curation_concerns/base/_form_progress.html.erb +7 -4
- data/app/views/curation_concerns/base/_form_relationships.html.erb +6 -6
- data/app/views/curation_concerns/base/_form_share.html.erb +1 -2
- data/app/views/curation_concerns/base/_guts4form.html.erb +1 -1
- data/app/views/curation_concerns/base/_social_media.html.erb +1 -1
- data/app/views/curation_concerns/base/_workflow_actions_widget.erb +3 -0
- data/app/views/curation_concerns/base/edit.html.erb +1 -1
- data/app/views/curation_concerns/base/new.html.erb +1 -1
- data/app/views/curation_concerns/base/show.html.erb +4 -1
- data/app/views/curation_concerns/file_sets/_show_actions.html.erb +0 -3
- data/app/views/dashboard/_create_work_action.html.erb +20 -0
- data/app/views/dashboard/_index_partials/_heading_actions.html.erb +9 -22
- data/app/views/layouts/admin.html.erb +8 -68
- data/app/views/layouts/curation_concerns/1_column.html.erb +4 -31
- data/app/views/layouts/homepage.html.erb +15 -45
- data/app/views/layouts/sufia-dashboard.html.erb +1 -36
- data/app/views/layouts/sufia.html.erb +49 -0
- data/app/views/my/_document_list.html.erb +1 -1
- data/app/views/my/_facet_limit.html.erb +2 -2
- data/app/views/my/_index_partials/_default_group.html.erb +10 -10
- data/app/views/my/_index_partials/_list_collections.html.erb +1 -1
- data/app/views/my/_sort_and_per_page.html.erb +8 -8
- data/app/views/records/edit_fields/_rights.html.erb +0 -1
- data/app/views/shared/_footer.html.erb +1 -1
- data/app/views/shared/_select_work_type_modal.html.erb +34 -0
- data/app/views/sufia/admin/_collections.html.erb +31 -0
- data/app/views/sufia/admin/_sidebar.html.erb +35 -23
- data/app/views/sufia/admin/admin_sets/_form.html.erb +38 -15
- data/app/views/sufia/admin/admin_sets/_form_metadata.html.erb +2 -0
- data/app/views/sufia/admin/admin_sets/_form_participant_table.html.erb +21 -0
- data/app/views/sufia/admin/admin_sets/_form_participants.html.erb +68 -0
- data/app/views/sufia/admin/admin_sets/_form_visibility.html.erb +58 -0
- data/app/views/sufia/admin/admin_sets/index.html.erb +29 -33
- data/app/views/sufia/admin/admin_sets/show.html.erb +3 -0
- data/app/views/sufia/admin/show.html.erb +22 -19
- data/app/views/sufia/batch_uploads/_form.html.erb +2 -1
- data/app/views/sufia/homepage/index.html.erb +11 -3
- data/app/views/sufia/uploads/_js_templates.html.erb +15 -11
- data/app/views/users/_user_row.html.erb +10 -0
- data/app/views/users/index.html.erb +1 -12
- data/config/features.rb +2 -0
- data/config/locales/sufia.en.yml +122 -37
- data/config/routes.rb +4 -1
- data/db/migrate/20161021175854_create_permission_template.rb +11 -0
- data/db/migrate/20161021180154_create_permission_template_access.rb +11 -0
- data/db/migrate/20161116222307_add_release_to_permission_templates.rb +6 -0
- data/lib/generators/sufia/install_generator.rb +12 -3
- data/lib/generators/sufia/templates/catalog_controller.rb +3 -13
- data/lib/generators/sufia/templates/workflow.json.erb +65 -0
- data/lib/generators/sufia/upgrade700_generator.rb +1 -1
- data/lib/generators/sufia/work/templates/locale.en.yml.erb +37 -0
- data/lib/generators/sufia/{work_generator.rb → work/work_generator.rb} +25 -5
- data/lib/sufia.rb +0 -1
- data/lib/sufia/engine.rb +7 -0
- data/lib/sufia/move_all_works_to_admin_set.rb +8 -0
- data/lib/sufia/version.rb +1 -1
- data/lib/tasks/migrate.rake +8 -0
- data/spec/actors/sufia/apply_permission_template_actor_spec.rb +64 -0
- data/spec/actors/sufia/create_with_remote_files_actor_spec.rb +8 -0
- data/spec/actors/sufia/default_admin_set_actor_spec.rb +43 -0
- data/spec/actors/sufia/interpret_visibility_actor_spec.rb +266 -0
- data/spec/authorities/qa/authorities/find_works_spec.rb +55 -0
- data/spec/controllers/batch_edits_controller_spec.rb +1 -6
- data/spec/controllers/citations_controller_spec.rb +49 -10
- data/spec/controllers/collections_controller_spec.rb +39 -0
- data/spec/controllers/curation_concerns/generic_works_controller_spec.rb +22 -1
- data/spec/controllers/dashboard_controller_spec.rb +0 -8
- data/spec/controllers/depositors_controller_spec.rb +2 -2
- data/spec/controllers/downloads_controller_spec.rb +2 -2
- data/spec/controllers/my/collections_controller_spec.rb +5 -0
- data/spec/controllers/my/shares_controller_spec.rb +5 -0
- data/spec/controllers/my/works_controller_spec.rb +5 -0
- data/spec/controllers/stats_controller_spec.rb +1 -1
- data/spec/controllers/sufia/admin/admin_sets_controller_spec.rb +33 -5
- data/spec/controllers/sufia/admin/permission_template_accesses_controller_spec.rb +36 -0
- data/spec/controllers/sufia/admin/permission_templates_controller_spec.rb +46 -0
- data/spec/controllers/sufia/admin_controller_spec.rb +6 -0
- data/spec/controllers/sufia/batch_uploads_controller_spec.rb +40 -42
- data/spec/controllers/sufia/homepage_controller_spec.rb +14 -0
- data/spec/controllers/sufia/trophies_controller_spec.rb +17 -4
- data/spec/controllers/users_controller_spec.rb +13 -4
- data/spec/factories/permission_template_accesses.rb +5 -0
- data/spec/factories/permission_templates.rb +5 -0
- data/spec/factories/sipity_entities.rb +7 -0
- data/spec/factories/users.rb +4 -0
- data/spec/factories/workflow_states.rb +6 -0
- data/spec/factories/workflows.rb +5 -0
- data/spec/features/admin_admin_set_spec.rb +6 -4
- data/spec/features/batch_edit_spec.rb +0 -1
- data/spec/features/collection_spec.rb +4 -4
- data/spec/features/edit_work_spec.rb +1 -0
- data/spec/features/work_show_spec.rb +10 -0
- data/spec/forms/sufia/forms/admin_set_form_spec.rb +2 -1
- data/spec/forms/sufia/forms/batch_edit_form_spec.rb +30 -0
- data/spec/forms/sufia/forms/permission_template_form_spec.rb +196 -0
- data/spec/forms/sufia/forms/work_form_spec.rb +35 -1
- data/spec/helpers/batch_edits_helper_spec.rb +4 -4
- data/spec/helpers/blacklight_helper_spec.rb +1 -1
- data/spec/helpers/sufia_helper_spec.rb +39 -7
- data/spec/indexers/sufia/collection_indexer_spec.rb +12 -0
- data/spec/javascripts/autocomplete_spec.js.coffee +46 -6
- data/spec/javascripts/visibility_component_spec.js +491 -0
- data/spec/jobs/batch_create_job_spec.rb +27 -28
- data/spec/lib/sufia/arkivo_spec.rb +14 -0
- data/spec/lib/sufia/controlled_vocabulary/importer/downloader_spec.rb +31 -0
- data/spec/lib/sufia/move_all_works_to_admin_set_spec.rb +13 -0
- data/spec/lib/sufia/zotero_spec.rb +8 -0
- data/spec/models/sufia/ability_spec.rb +54 -14
- data/spec/models/sufia/permission_template_spec.rb +144 -0
- data/spec/models/sufia/user_usage_stats_spec.rb +8 -2
- data/spec/presenters/sufia/homepage_presenter_spec.rb +1 -1
- data/spec/presenters/sufia/select_type_list_presenter_spec.rb +26 -0
- data/spec/presenters/sufia/select_type_presenter_spec.rb +21 -0
- data/spec/search_builder/sufia/admin_set_search_builder_spec.rb +57 -0
- data/spec/search_builder/sufia/catalog_search_builder_spec.rb +40 -14
- data/spec/search_builder/sufia/find_works_search_builder_spec.rb +60 -0
- data/spec/search_builder/sufia/my_shares_search_builder_spec.rb +4 -1
- data/spec/search_builder/sufia/single_admin_set_search_builder_spec.rb +5 -1
- data/spec/services/sufia/actor_factory_spec.rb +13 -5
- data/spec/services/sufia/admin_set_create_service_spec.rb +27 -0
- data/spec/services/sufia/admin_set_service_spec.rb +104 -17
- data/spec/services/sufia/workflow/changes_required_notification_spec.rb +32 -0
- data/spec/services/sufia/workflow/complete_notification_spec.rb +32 -0
- data/spec/services/sufia/workflow/pending_review_notification_spec.rb +31 -0
- data/spec/services/sufia/workflow/workflow_by_admin_set_strategy_spec.rb +22 -0
- data/spec/spec_helper.rb +24 -5
- data/spec/support/proxies.rb +1 -1
- data/spec/test_app_templates/lib/generators/test_app_generator.rb +4 -0
- data/spec/views/_toolbar.html.erb_spec.rb +23 -6
- data/spec/views/batch_edits/edit.html.erb_spec.rb +7 -1
- data/spec/views/collections/_form_for_select_collection.html.erb_spec.rb +1 -3
- data/spec/views/curation_concerns/base/_find_work_widget.html.erb_spec.rb +22 -0
- data/spec/views/curation_concerns/base/_form.html.erb_spec.rb +7 -0
- data/spec/views/curation_concerns/base/_form_child_work_relationships.html.erb_spec.rb +1 -0
- data/spec/views/curation_concerns/base/_form_parent_work_relationships.html.erb_spec.rb +114 -0
- data/spec/views/curation_concerns/base/_form_progress.html.erb_spec.rb +3 -2
- data/spec/views/curation_concerns/base/_social_media.html.erb_spec.rb +1 -1
- data/spec/views/curation_concerns/base/edit.html.erb_spec.rb +1 -1
- data/spec/views/curation_concerns/base/show.html.erb_spec.rb +5 -1
- data/spec/views/curation_concerns/file_sets/_show_actions.html.erb_spec.rb +2 -2
- data/spec/views/dashboard/create_work_action.html.erb_spec.rb +27 -0
- data/spec/views/dashboard/index_spec.rb +7 -2
- data/spec/views/my/_sort_and_per_page.html.erb_spec.rb +33 -0
- data/spec/views/shared/select_work_type_modal.html.erb_spec.rb +32 -0
- data/spec/views/sufia/admin/admin_sets/_form.html.erb_spec.rb +18 -0
- data/spec/views/sufia/admin/admin_sets/_form_participants.html.erb_spec.rb +13 -0
- data/spec/views/sufia/admin/admin_sets/_form_visibility.html.erb_spec.rb +23 -0
- data/spec/views/sufia/batch_uploads/_form.html.erb_spec.rb +2 -12
- data/spec/views/sufia/homepage/index.html.erb_spec.rb +29 -8
- data/sufia.gemspec +5 -6
- data/tasks/sufia-dev.rake +6 -10
- data/template.rb +15 -0
- metadata +140 -28
- data/app/assets/stylesheets/sufia/widgets.css +0 -288
- data/app/helpers/sufia/citations_behaviors/formatters/endnote_formatter.rb +0 -49
- data/app/models/domain_term.rb +0 -4
- data/app/views/citations/file.html.erb +0 -0
- data/app/views/records/_rights_modal.html.erb +0 -1
- data/db/migrate/20160328222160_create_local_authorities.rb +0 -50
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f8da2d85b23ab091afabbe8a3fc3f547fff86b94
|
4
|
+
data.tar.gz: 149f28dc13a30a9141d30b3035c0afaa4cd087a6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7dfb177dad78057657aecbabcb3afc5f72d821ec24b98e6d6d2a87795f7e14c23c400e80b8818eac2252850d414d3b912c4ab354ee2dc28a2b15d0dd69e31f5a
|
7
|
+
data.tar.gz: 6dd363cc82aabe925013a2e8bf2de2d2c77651dd29ac10c8cabd19bbac949dda976abfd9913a0c4c89e0dbbb8b4f5fa0a72d0c466add9b4d2f038d291d5d68dd
|
data/.codeclimate.yml
CHANGED
data/.rubocop.yml
CHANGED
data/.rubocop_todo.yml
CHANGED
@@ -51,7 +51,7 @@ RSpec/NamedSubject:
|
|
51
51
|
Enabled: false
|
52
52
|
|
53
53
|
RSpec/ExampleLength:
|
54
|
-
Max: 7
|
54
|
+
Max: 7
|
55
55
|
Exclude:
|
56
56
|
- 'spec/controllers/api/items_controller_spec.rb'
|
57
57
|
- 'spec/controllers/authorities_controller_spec.rb'
|
@@ -113,4 +113,3 @@ RSpec/AnyInstance:
|
|
113
113
|
- 'spec/presenters/sufia/work_usage_spec.rb'
|
114
114
|
- 'spec/presenters/sufia/file_usage_spec.rb'
|
115
115
|
- 'spec/services/sufia/repository_audit_service_spec.rb'
|
116
|
-
|
data/.travis.yml
CHANGED
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -27,15 +27,10 @@ Jump in: [![Slack Status](http://slack.projecthydra.org/badge.svg)](http://slack
|
|
27
27
|
* [Environments](#environments)
|
28
28
|
* [Ruby](#ruby)
|
29
29
|
* [Creating a Sufia\-based app](#creating-a-sufia-based-app)
|
30
|
+
* [Redis](#redis)
|
30
31
|
* [Rails](#rails)
|
31
|
-
* [Sufia's Ruby\-related dependencies](#sufias-ruby-related-dependencies)
|
32
|
-
* [Install Sufia](#install-sufia)
|
33
32
|
* [Generate a primary work type](#generate-a-primary-work-type)
|
34
|
-
* [
|
35
|
-
* [Start Redis](#start-redis)
|
36
|
-
* [Start Solr](#start-solr)
|
37
|
-
* [Start FCRepo](#start-fcrepo)
|
38
|
-
* [Spin up the web server](#spin-up-the-web-server)
|
33
|
+
* [Start servers](#start-servers)
|
39
34
|
* [Managing a Sufia\-based app](#managing-a-sufia-based-app)
|
40
35
|
* [License](#license)
|
41
36
|
* [Contributing](#contributing)
|
@@ -49,49 +44,7 @@ Sufia uses the full power of [Hydra](http://projecthydra.org/) and extends it to
|
|
49
44
|
|
50
45
|
## Feature list
|
51
46
|
|
52
|
-
Sufia has the
|
53
|
-
|
54
|
-
* Multiple file upload, and folder uploads (for Chrome browser only)
|
55
|
-
* Flexible user- and group-based access controls
|
56
|
-
* Transcoding of audio and video files
|
57
|
-
* Generation and validation of identifiers
|
58
|
-
* Generation of derivatives (served from the filesystem, not the repository)
|
59
|
-
* Fixity checking
|
60
|
-
* Version control
|
61
|
-
* Characterization of uploaded files
|
62
|
-
* Forms for batch editing metadata
|
63
|
-
* Faceted search and browse
|
64
|
-
* Social media interaction
|
65
|
-
* User profiles
|
66
|
-
* User dashboard for file management
|
67
|
-
* Highlighted files on profile
|
68
|
-
* Sharing w/ groups and users
|
69
|
-
* User notifications
|
70
|
-
* Activity streams
|
71
|
-
* Background jobs
|
72
|
-
* Single-use links
|
73
|
-
* Google Analytics for usage statistics
|
74
|
-
* Integration w/ cloud storage providers
|
75
|
-
* Google Scholar-specific metadata embedding
|
76
|
-
* Schema.org microdata, Open Graph meta tags, and Twitter cards for rich snippets
|
77
|
-
* User-managed collections for grouping files
|
78
|
-
* Full-text indexing & searching
|
79
|
-
* Responsive, fluid, Bootstrap 3-based UI
|
80
|
-
* Dynamically configurable featured works and researchers on homepage
|
81
|
-
* Proxy deposit and transfers of ownership
|
82
|
-
* Integration with Zotero for automatic population of user content
|
83
|
-
* Suggested values from controlled vocabularies provided by [Questioning Authority](https://github.com/projecthydra-labs/questioning_authority)
|
84
|
-
* [ResourceSync](http://www.openarchives.org/rs/1.0/resourcesync) capability lists and resource lists
|
85
|
-
* Administrative sets (curated collections)
|
86
|
-
* Administrative dashboard, w/ feature flippers to turn features on and off in the UI
|
87
|
-
* Contact form
|
88
|
-
* Customizable banner image
|
89
|
-
* Flexible object model: upload and manage single-file works, multi-file works, zero-file works, and works-within-works
|
90
|
-
* Geonames integration for location-oriented metadata fields
|
91
|
-
* Virus detection for uploaded files
|
92
|
-
* Citation formatting suggestions
|
93
|
-
|
94
|
-
See the [Sufia Management Guide](https://github.com/projecthydra/sufia/wiki/Sufia-Management-Guide) to learn which features listed above are turned on by default and which require configuration.
|
47
|
+
Sufia has many features. [Read more about what they are and how to turn them on](https://github.com/projecthydra/sufia/wiki/Feature-matrix). See the [Sufia Management Guide](https://github.com/projecthydra/sufia/wiki/Sufia-Management-Guide) to learn more.
|
95
48
|
|
96
49
|
For non-technical documentation about Sufia, see its [documentation site](http://sufia.io/).
|
97
50
|
|
@@ -115,15 +68,15 @@ After installing the Prerequisites:
|
|
115
68
|
|
116
69
|
Sufia 7.x requires the following software to work:
|
117
70
|
|
118
|
-
1. Solr version >= 5.x (tested up to 6.
|
119
|
-
1. [Fedora Commons](http://www.fedora-commons.org/) digital repository version >= 4.5.1 (tested up to 4.
|
71
|
+
1. [Solr](http://lucene.apache.org/solr/) version >= 5.x (tested up to 6.3.0)
|
72
|
+
1. [Fedora Commons](http://www.fedora-commons.org/) digital repository version >= 4.5.1 (tested up to 4.7.0)
|
120
73
|
1. A SQL RDBMS (MySQL, PostgreSQL), though **note** that SQLite will be used by default if you're looking to get up and running quickly
|
121
74
|
1. [Redis](http://redis.io/), a key-value store
|
122
75
|
1. [ImageMagick](http://www.imagemagick.org/) with JPEG-2000 support
|
123
76
|
1. [FITS](#characterization) version 0.8.x (0.8.5 is known to be good)
|
124
77
|
1. [LibreOffice](#derivatives)
|
125
78
|
|
126
|
-
**NOTE:
|
79
|
+
**NOTE: The [Sufia Development Guide](https://github.com/projecthydra/sufia/wiki/Sufia-Development-Guide) has instructions for installing Solr and Fedora in a development environment.**
|
127
80
|
|
128
81
|
### Characterization
|
129
82
|
|
@@ -154,32 +107,29 @@ We recommend either Ruby 2.3 or the latest 2.2 version.
|
|
154
107
|
|
155
108
|
# Creating a Sufia-based app
|
156
109
|
|
157
|
-
##
|
110
|
+
## Redis
|
158
111
|
|
159
|
-
|
112
|
+
[Redis](http://redis.io/) is a key-value store that Sufia uses to provide activity streams on repository objects and users, and to prevent race conditions as a global mutex when modifying order-persisting objects.
|
160
113
|
|
161
|
-
|
162
|
-
gem install rails -v 5.0.0.1
|
163
|
-
rails new my_app
|
164
|
-
```
|
114
|
+
Starting up Redis will depend on your operating system, and may in fact already be started on your system. You may want to consult the [Redis documentation](http://redis.io/documentation) for help doing this.
|
165
115
|
|
166
|
-
##
|
116
|
+
## Rails
|
167
117
|
|
168
|
-
|
118
|
+
Generate a new Rails application. We recommend the latest Rails 5.0 or 4.2 release.
|
169
119
|
|
170
120
|
```
|
171
|
-
|
121
|
+
# If you don't already have Rails at your disposal...
|
122
|
+
gem install rails -v 5.0.0.1
|
123
|
+
rails new my_app -m https://raw.githubusercontent.com/projecthydra/sufia/master/template.rb
|
172
124
|
```
|
173
125
|
|
174
|
-
|
175
|
-
|
176
|
-
## Install Sufia
|
177
|
-
|
178
|
-
Install Sufia into your app using its built-in install generator. This step adds a number of files that Sufia requires within your Rails app, including e.g. a number of database migrations.
|
126
|
+
Generating a new Rails application using Sufia's template above takes cares of a number of steps for you, including:
|
179
127
|
|
180
|
-
|
181
|
-
|
182
|
-
|
128
|
+
* Adding Sufia (and any of its dependencies) to your application `Gemfile`, to declare that Sufia is a dependency of your application
|
129
|
+
* Running `bundle install`, to install Sufia and its dependencies
|
130
|
+
* Running Sufia's install generator, to add a number of files that Sufia requires within your Rails app, including e.g. database migrations
|
131
|
+
* Loading all of Sufia's database migrations into your application's database
|
132
|
+
* Loading Sufia's default workflows into your application's database
|
183
133
|
|
184
134
|
## Generate a primary work type
|
185
135
|
|
@@ -197,45 +147,12 @@ or
|
|
197
147
|
rails generate sufia:work MovingImage
|
198
148
|
```
|
199
149
|
|
200
|
-
##
|
201
|
-
|
202
|
-
Now that Sufia's required database migrations have been generated into your app, you'll need to load them into your application's database.
|
203
|
-
|
204
|
-
```
|
205
|
-
rake db:migrate
|
206
|
-
```
|
207
|
-
|
208
|
-
## Start Redis
|
209
|
-
|
210
|
-
[Redis](http://redis.io/) is a key-value store that Sufia uses to provide activity streams on repository objects and users, and to prevent race conditions as a global mutex when modifying order-persisting objects.
|
211
|
-
|
212
|
-
Starting up Redis will depend on your operating system, and may in fact already be started on your system. You may want to consult the [Redis documentation](http://redis.io/documentation) for help doing this.
|
213
|
-
|
214
|
-
## Start Solr
|
215
|
-
|
216
|
-
If you already have an instance of Solr that you would like to use, you may skip this step. Open a new terminal window and type:
|
217
|
-
```
|
218
|
-
solr_wrapper -d solr/config/ --collection_name hydra-development
|
219
|
-
```
|
220
|
-
|
221
|
-
You can check to see if Solr is started by going to [localhost:8983](http://localhost:8983/).
|
222
|
-
|
223
|
-
## Start FCRepo
|
224
|
-
|
225
|
-
If you already have an instance of FCRepo that you would like to use, you may skip this step. Open a new terminal window and type:
|
226
|
-
|
227
|
-
```
|
228
|
-
fcrepo_wrapper -p 8984
|
229
|
-
```
|
230
|
-
|
231
|
-
You can check to see if FCRepo is started by going to [localhost:8984](http://localhost:8984/).
|
232
|
-
|
233
|
-
## Spin up the web server
|
150
|
+
## Start servers
|
234
151
|
|
235
|
-
To test-drive your new Sufia application, spin up the
|
152
|
+
To test-drive your new Sufia application in development mode, spin up the servers that Sufia needs (Solr, Fedora, and Rails):
|
236
153
|
|
237
154
|
```
|
238
|
-
|
155
|
+
rake hydra:server
|
239
156
|
```
|
240
157
|
|
241
158
|
And now you should be able to browse to [localhost:3000](http://localhost:3000/) and see the application. Note that this web server is purely for development purposes; you will want to use a more fully featured [web server](#web-server) for production-like environments.
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module Sufia
|
2
|
+
class ApplyPermissionTemplateActor < CurationConcerns::Actors::AbstractActor
|
3
|
+
def create(attributes)
|
4
|
+
add_edit_users(attributes)
|
5
|
+
next_actor.create(attributes)
|
6
|
+
end
|
7
|
+
|
8
|
+
protected
|
9
|
+
|
10
|
+
def add_edit_users(attributes)
|
11
|
+
return unless attributes[:admin_set_id].present?
|
12
|
+
template = Sufia::PermissionTemplate.find_by!(admin_set_id: attributes[:admin_set_id])
|
13
|
+
curation_concern.edit_users = template.access_grants.where(agent_type: 'user', access: 'manage').pluck(:agent_id)
|
14
|
+
curation_concern.edit_groups = template.access_grants.where(agent_type: 'group', access: 'manage').pluck(:agent_id)
|
15
|
+
curation_concern.read_users = template.access_grants.where(agent_type: 'user', access: 'view').pluck(:agent_id)
|
16
|
+
curation_concern.read_groups = template.access_grants.where(agent_type: 'group', access: 'view').pluck(:agent_id)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -31,9 +31,9 @@ module Sufia
|
|
31
31
|
actor = CurationConcerns::Actors::FileSetActor.new(fs, user)
|
32
32
|
actor.create_metadata(curation_concern, visibility: curation_concern.visibility)
|
33
33
|
fs.save!
|
34
|
-
uri = URI.parse(url)
|
34
|
+
uri = URI.parse(URI.encode(url))
|
35
35
|
if uri.scheme == 'file'
|
36
|
-
IngestLocalFileJob.perform_later(fs, uri.path, user)
|
36
|
+
IngestLocalFileJob.perform_later(fs, URI.decode(uri.path), user)
|
37
37
|
else
|
38
38
|
ImportUrlJob.perform_later(fs, log(actor.user))
|
39
39
|
end
|
@@ -0,0 +1,42 @@
|
|
1
|
+
module Sufia
|
2
|
+
# Ensures that the default AdminSet id is set if this form doesn't have
|
3
|
+
# an admin_set_id provided. This should come before the
|
4
|
+
# CurationConcerns::Actors::InitializeWorkflowActor, so that the correct
|
5
|
+
# workflow can be kicked off.
|
6
|
+
class DefaultAdminSetActor < CurationConcerns::Actors::AbstractActor
|
7
|
+
def create(attributes)
|
8
|
+
ensure_admin_set_attribute!(attributes)
|
9
|
+
next_actor.create(attributes)
|
10
|
+
end
|
11
|
+
|
12
|
+
def update(attributes)
|
13
|
+
ensure_admin_set_attribute!(attributes)
|
14
|
+
next_actor.update(attributes)
|
15
|
+
end
|
16
|
+
|
17
|
+
private
|
18
|
+
|
19
|
+
def ensure_admin_set_attribute!(attributes)
|
20
|
+
return if attributes[:admin_set_id].present?
|
21
|
+
attributes[:admin_set_id] = default_admin_set_id
|
22
|
+
end
|
23
|
+
|
24
|
+
DEFAULT_ID = 'admin_set/default'.freeze
|
25
|
+
|
26
|
+
def default_admin_set_id
|
27
|
+
create_default_admin_set unless default_exists?
|
28
|
+
DEFAULT_ID
|
29
|
+
end
|
30
|
+
|
31
|
+
def default_exists?
|
32
|
+
AdminSet.exists?(DEFAULT_ID)
|
33
|
+
end
|
34
|
+
|
35
|
+
# Creates the default AdminSet and an associated PermissionTemplate with workflow
|
36
|
+
def create_default_admin_set
|
37
|
+
AdminSet.create!(id: DEFAULT_ID, title: ['Default Admin Set']).tap do |_as|
|
38
|
+
PermissionTemplate.create!(admin_set_id: DEFAULT_ID, workflow_name: 'default')
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
@@ -0,0 +1,115 @@
|
|
1
|
+
module Sufia
|
2
|
+
class InterpretVisibilityActor < CurationConcerns::Actors::InterpretVisibilityActor
|
3
|
+
# Override CC to ensure our custom 'validate' method is used
|
4
|
+
def create(attributes)
|
5
|
+
@intention = Intention.new(attributes)
|
6
|
+
attributes = @intention.sanitize_params
|
7
|
+
validate(attributes) && apply_visibility(attributes) && next_actor.create(attributes)
|
8
|
+
end
|
9
|
+
|
10
|
+
# Override CC to ensure our custom 'validate' method is used
|
11
|
+
def update(attributes)
|
12
|
+
@intention = Intention.new(attributes)
|
13
|
+
attributes = @intention.sanitize_params
|
14
|
+
validate(attributes) && apply_visibility(attributes) && next_actor.update(attributes)
|
15
|
+
end
|
16
|
+
|
17
|
+
private
|
18
|
+
|
19
|
+
# Validate against selected AdminSet's PermissionTemplate (if any)
|
20
|
+
def validate(attributes)
|
21
|
+
# If AdminSet was selected, look for its PermissionTemplate
|
22
|
+
template = Sufia::PermissionTemplate.find_by(admin_set_id: attributes[:admin_set_id]) if attributes[:admin_set_id].present?
|
23
|
+
|
24
|
+
validate_lease(template) && validate_release_type(template) && validate_visibility(attributes, template) && validate_embargo(attributes, template)
|
25
|
+
end
|
26
|
+
|
27
|
+
# Validate that a lease is allowed by AdminSet's PermissionTemplate
|
28
|
+
def validate_lease(template)
|
29
|
+
# Leases are only allowable if a template doesn't require a release period or have any specific visibility requirement
|
30
|
+
# (Note: permission template release/visibility options do not support leases)
|
31
|
+
return true unless @intention.wants_lease? && template.present? && (template.release_period.present? || template.visibility.present?)
|
32
|
+
|
33
|
+
curation_concern.errors.add(:visibility, 'Lease option is not allowed by permission template for selected AdminSet.')
|
34
|
+
false
|
35
|
+
end
|
36
|
+
|
37
|
+
# Validate the selected release settings against template, checking for when embargoes/leases are not allowed
|
38
|
+
def validate_release_type(template)
|
39
|
+
# It's valid as long as embargo is not specified when a template requires no release delays
|
40
|
+
return true unless @intention.wants_embargo? && template.present? && template.release_no_delay?
|
41
|
+
|
42
|
+
curation_concern.errors.add(:visibility, 'Visibility specified does not match permission template "no release delay" requirement for selected AdminSet.')
|
43
|
+
false
|
44
|
+
end
|
45
|
+
|
46
|
+
# Validate visibility complies with AdminSet template requirements
|
47
|
+
def validate_visibility(attributes, template)
|
48
|
+
# NOTE: For embargo/lease, attributes[:visibility] will be nil (see sanitize_params), so visibility will be validated as part of embargo/lease
|
49
|
+
return true unless attributes[:visibility].present?
|
50
|
+
|
51
|
+
# Validate against template's visibility requirements
|
52
|
+
return true if validate_template_visibility(attributes[:visibility], template)
|
53
|
+
|
54
|
+
curation_concern.errors.add(:visibility, 'Visibility specified does not match permission template visibility requirement for selected AdminSet.')
|
55
|
+
false
|
56
|
+
end
|
57
|
+
|
58
|
+
# When specified, validate embargo is a future date that complies with AdminSet template requirements (if any)
|
59
|
+
def validate_embargo(attributes, template)
|
60
|
+
return true unless @intention.wants_embargo?
|
61
|
+
|
62
|
+
embargo_release_date = parse_date(attributes[:embargo_release_date])
|
63
|
+
|
64
|
+
# When embargo required, date must be in future AND matches any template requirements
|
65
|
+
return true if valid_future_date?(embargo_release_date) &&
|
66
|
+
valid_template_embargo_date?(embargo_release_date, template) &&
|
67
|
+
valid_template_visibility_after_embargo?(attributes, template)
|
68
|
+
|
69
|
+
curation_concern.errors.add(:visibility, 'When setting visibility to "embargo" you must also specify embargo release date.') unless embargo_release_date.present?
|
70
|
+
false
|
71
|
+
end
|
72
|
+
|
73
|
+
# Validate an date attribute is in the future
|
74
|
+
def valid_future_date?(date, attribute_name: :embargo_release_date)
|
75
|
+
return true if date.present? && date.future?
|
76
|
+
|
77
|
+
curation_concern.errors.add(attribute_name, "Must be a future date.")
|
78
|
+
false
|
79
|
+
end
|
80
|
+
|
81
|
+
# Validate an embargo date against permission template restrictions
|
82
|
+
def valid_template_embargo_date?(date, template)
|
83
|
+
return true unless template.present?
|
84
|
+
|
85
|
+
# Validate against template's release_date requirements
|
86
|
+
return true if template.valid_release_date?(date)
|
87
|
+
|
88
|
+
curation_concern.errors.add(:embargo_release_date, "Release date specified does not match permission template release requirements for selected AdminSet.")
|
89
|
+
false
|
90
|
+
end
|
91
|
+
|
92
|
+
# Validate the post-embargo visibility against permission template requirements (if any)
|
93
|
+
def valid_template_visibility_after_embargo?(attributes, template)
|
94
|
+
# Validate against template's visibility requirements
|
95
|
+
return true if validate_template_visibility(attributes[:visibility_after_embargo], template)
|
96
|
+
|
97
|
+
curation_concern.errors.add(:visibility_after_embargo, "Visibility after embargo does not match permission template visibility requirements for selected AdminSet.")
|
98
|
+
false
|
99
|
+
end
|
100
|
+
|
101
|
+
# Validate that a given visibility value satisfies template requirements
|
102
|
+
def validate_template_visibility(visibility, template)
|
103
|
+
return true unless template.present?
|
104
|
+
|
105
|
+
template.valid_visibility?(visibility)
|
106
|
+
end
|
107
|
+
|
108
|
+
# Parse date from string. Returns nil if date_string is not a valid date
|
109
|
+
def parse_date(date_string)
|
110
|
+
datetime = Time.zone.parse(date_string) if date_string.present?
|
111
|
+
return datetime.to_date unless datetime.nil?
|
112
|
+
nil
|
113
|
+
end
|
114
|
+
end
|
115
|
+
end
|
Binary file
|
@@ -52,6 +52,9 @@
|
|
52
52
|
//= require sufia/flot_stats
|
53
53
|
// Provide AMD module support
|
54
54
|
//= require almond
|
55
|
+
//= require sufia/admin/admin_set_controls
|
56
|
+
//= require sufia/admin/admin_set/participants
|
57
|
+
//= require sufia/admin/admin_set/visibility
|
55
58
|
//= require sufia/save_work
|
56
59
|
//= require sufia/permissions
|
57
60
|
//= require sufia/notifications
|
@@ -59,7 +62,9 @@
|
|
59
62
|
//= require sufia/autocomplete/location
|
60
63
|
//= require sufia/autocomplete/subject
|
61
64
|
//= require sufia/autocomplete/language
|
65
|
+
//= require sufia/autocomplete/work
|
62
66
|
//= require sufia/relationships
|
67
|
+
//= require sufia/select_work_type
|
63
68
|
//= require curation_concerns/collections
|
64
69
|
//= require hydra-editor/hydra-editor
|
65
70
|
//= require nestable
|
@@ -67,6 +72,7 @@
|
|
67
72
|
//= require curation_concerns/file_manager/save_manager
|
68
73
|
//= require curation_concerns/file_manager/member
|
69
74
|
//= require curation_concerns/file_manager
|
75
|
+
//= require sufia/workflow_actions_affix
|
70
76
|
|
71
77
|
// this needs to be after batch_select so that the form ids get setup correctly
|
72
78
|
//= require sufia/batch_edit
|