Skip to content

Commit

Permalink
Merge pull request #40 from AtlasSystems/prerelease
Browse files Browse the repository at this point in the history
Prerelease
  • Loading branch information
asmith-atlas authored May 15, 2023
2 parents 6a3afd7 + 657d353 commit c981bef
Show file tree
Hide file tree
Showing 7 changed files with 288 additions and 106 deletions.
82 changes: 69 additions & 13 deletions Readme.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# ArchivesSpace Request Fulfillment via Aeon

**Version:** 20190529
**Version:** 20230302

**Last Updated:** May 29, 2019
**Last Updated:** March 2, 2023


## Table of Contents
Expand All @@ -11,7 +11,8 @@
1. [Table of Contents](#table-of-contents)
2. [Overview](#overview)
3. [Changelog](#changelog)
4. [Configuring Plugin Settings](#configuring-plugin-settings)
4. [Requirements](#requirements)
5. [Configuring Plugin Settings](#configuring-plugin-settings)
1. [Per Repository Configuration Options](#per-repository-configuration-options)
1. [`:aeon_web_url`](#aeonweburl)
2. [`:aeon_return_link_label`](#aeonreturnlinklabel)
Expand All @@ -23,21 +24,25 @@
8. [`:aeon_site_code`](#aeonsitecode)
9. [`:hide_button_for_access_restriction_types`](#hidebuttonforaccessrestrictiontypes)
10. [`:requestable_archival_record_levels`](#requestablearchivalrecordlevels)
11. [`:user_defined_fields`](#userdefinedfields)
11. [`:top_container_mode`](#topcontainermode)
12. [`:disallowed_record_level_message`](#disallowedrecordlevelmessage)
13. [`:no_containers_message`](#nocontainersmessage)
14. [`:restrictions_message`](#restrictionsmessage)
15. [`:user_defined_fields`](#userdefinedfields)
2. [Other Configuration Options](#other-configuration-options)
1. [`:aeon_fulfillment_record_types`](#aeonfulfillmentrecordtypes)
2. [`:aeon_fulfillment_button_position`](#aeonfulfillmentbuttonposition)
3. [Example Configuration](#example-configuration)
5. [Aeon Remote Authentication Configurations](#aeon-remote-authentication-configurations)
6. [Imported Fields](#imported-fields)
6. [Aeon Remote Authentication Configurations](#aeon-remote-authentication-configurations)
7. [Imported Fields](#imported-fields)
1. [Common Fields](#common-fields)
2. [Archival Object Fields](#archival-object-fields)
3. [Accession Fields](#accession-fields)
4. [Resource Fields](#resource-fields)
5. [User Defined Fields](#user-defined-fields)
7. [OpenURL Mappings](#openurl-mappings)
8. [Custom Mappers](#custom-mappers)
9. [Configuring the Aeon Request Form Used](#configuring-the-aeon-request-form-used)
8. [OpenURL Mappings](#openurl-mappings)
9. [Custom Mappers](#custom-mappers)
10. [Configuring the Aeon Request Form Used](#configuring-the-aeon-request-form-used)


## Overview
Expand All @@ -58,7 +63,7 @@ options for the built in PUI requesting functionality, it is also possible to
configure some repositories to continue using the built in PUI requesting
feature for archival objects while allowing other repositories to use Aeon.

This plugin has been tested on ArchivesSpace version 2.2.0. Future releases of
This plugin has been tested on ArchivesSpace version 3.3.1, and requires Aeon Server version 5.2.0 or greater. Future releases of
ArchivesSpace may cause changes in the functionality of this plugin.


Expand Down Expand Up @@ -143,7 +148,15 @@ ArchivesSpace may cause changes in the functionality of this plugin.
- Added the `:user_defined_fields` setting
- **20190529**
- Bug fixes for compatibility with ArchivesSpace v2.6.0 RC1

- **20230302**
- Added `:top_container_mode` setting to support new Aeon Archival Request form.
- Added some additional mapping options.

## Requirements

- Aeon Server 5.2.0 or greater
- ArchivesSpace 3.3.1

## Configuring Plugin Settings

***Please note that the Aeon OpenURLMapping table must be configured in the Customization Manager
Expand Down Expand Up @@ -268,8 +281,8 @@ sent.
#### `:hide_button_for_access_restriction_types`

This setting allows the request button to be hidden for any records that have
any of the listed local access restriction types. The value of this config item
should be an array of restriction types, for example:
any of the listed values in the local_access_restriction_type field of the rights_restriction
of the accessrestrict note. The value of this config item should be an array of restriction types, for example:

`:hide_button_for_access_restriction_types => ['RestrictedSpecColl']`

Expand Down Expand Up @@ -337,6 +350,30 @@ AppConfig[:aeon_fulfillment] = {
}
```

#### `:top_container_mode`

This true/false setting controls whether or not the new top container mode is active for the given repository. This mode has two effects:

- Only top containers associated with the current record are requestable. If no top containers are associated with the current record, then the request button will be replaced by a message (see :no_containers_message setting below).

- When the user clicks the Aeon Request button, they will be taken to the new Aeon Box-Picker form to submit their request(s).

If this setting is true, then the :requests_permitted_for_containers_only should also be set to true.

#### `:disallowed_record_level_message`

This is the message that will be displayed instead of the Aeon Request button if the current record cannot be requested due to the values listed in the :requestable_archival_record_levels setting. If no value is provided, the default value will be "Not requestable". The message should be kept short (30 characters or less) for best appearance.


#### `:no_containers_message`

This is the message that will be displayed instead of the Aeon Request button if the current record has no associated topcontainers and :top_container_mode is active. If no value is provided, the default value will be "No requestable containers". The message should be kept short (30 characters or less) for best appearance.

#### `:restrictions_message`

This is the message that will be displayed instead of the Aeon Request button if the current record cannot be requested because it has active restrictions matching the values in the :hide_button_for_access_restriction_types setting. If no value is provided, the default value will be "Access Restricted". The message should be kept short (30 characters or less) for best appearance.


#### `:user_defined_fields`

This setting allows sites to specify which user defined fields are imported.
Expand Down Expand Up @@ -513,6 +550,9 @@ records.
- `repo_code`
- `repo_name`
- `language`
- semi-colon (`;`) separated string list
- contains the content from the `language` elements listed in `lang_materials`
- for accessions, contains the single value in the `language` element
- `restrictions_apply` (true/false value)
- `display_string`
- `creators`
Expand All @@ -535,6 +575,18 @@ records.
of values that could appear in place of the `{date_label}` placeholder
is controlled by the `date_label` enumeration of your ArchivesSpace
installation.
- `date_expression`
- semi-colon (`;`) separated string list
- contains the combined final_expressions of the single and inclusive dates associated with the record.
- `userestrict`
- semi-colon (`;`) separated string list
- contains the combined contents of all published userestrict notes associated with the record.
- `rights_type`
- semi-colon (`;`) separated string list
- contains the combined rights_type values of all rights statements associated with the record.
- `digital_objects`
- semi-colon (`;`) separated string list
- contains the IDs of all digital objects associated with the record.

The following fields are common to both Accession records and Archival Object
records, but are based on the number of instances associated with the record.
Expand Down Expand Up @@ -567,6 +619,10 @@ and the values of each may differ from instance to instance.
- `instance_top_container_collection_display_string` (semi-colon (`;`) separated string list)
- `instance_top_container_series_identifer` (semi-colon (`;`) separated string list)
- `instance_top_container_series_display_string` (semi-colon (`;`) separated string list)
- `instance_top_container_location_note`
- `instance_top_container_location_title`
- `instance_top_container_location_id`
- `instance_top_container_location_building`

### Archival Object Fields

Expand Down
7 changes: 5 additions & 2 deletions public/models/aeon_accession_mapper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ def json_fields
.reject {|id_comp| id_comp.blank?}
.join('-')

language = json['language']
if language
mappings['language'] = language
end

mappings
end

Expand All @@ -32,8 +37,6 @@ def record_fields
mappings['access_restrictions_note'] = record.access_restrictions_note
end

mappings['language'] = self.record['language']

mappings
end
end
27 changes: 22 additions & 5 deletions public/models/aeon_archival_object_mapper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@ def initialize(archival_object)
super(archival_object)
end

# Override of #show_action? from AeonRecordMapper
def show_action?
return false if !super
return self.requestable_based_on_archival_record_level?
end

# Override for AeonRecordMapper json_fields method.
def json_fields
Expand All @@ -25,6 +20,8 @@ def json_fields
mappings['repository_processing_note'] = json['repository_processing_note']
end

mappings['restrictions_apply'] = restrictions_apply?

mappings
end

Expand All @@ -36,4 +33,24 @@ def record_fields

mappings
end

def restrictions_apply?

if self.record.json['restrictions_apply']
return true
end

self.record['ancestors'].each do |ancestor|
Rails.logger.info("Aeon Fulfillment Plugin") { "Logging ancestor #{ancestor}" }
ancestor_record = archivesspace.get_record(ancestor)
Rails.logger.info("Aeon Fulfillment Plugin") { ancestor_record.to_yaml }



if (ancestor_record.json['restrictions_apply'] == true or ancestor_record.json['restrictions'] == true)
return true
end
end
return false
end
end
Loading

0 comments on commit c981bef

Please sign in to comment.