Skip to content

Commit

Permalink
Merge pull request #5 from hudmol/for-21x
Browse files Browse the repository at this point in the history
For 21x
  • Loading branch information
jambun authored May 6, 2020
2 parents a4ead13 + 4c3f7af commit bc2bc45
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 35 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
NLA Staff Spreadsheet Importer Plugin
=====================================

An ArchivesSpace (v1.5.2) plugin developed for the National Library of Australia by Hudson Molonglo.
An ArchivesSpace (v2.1.x) plugin developed for the National Library of Australia by Hudson Molonglo.

It adds three new Import Types to the Import Data Job Type.
It adds the following Import Types to the Import Data Job Type.

* Arrearage spreadsheet
* Donor Box List spreadsheet
Expand Down
52 changes: 21 additions & 31 deletions backend/converters/basic_resource_converter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ def initialize(input_file)
resource_id
access_conditions
use_conditions
granted_note
scopecontent_note
processing_note_1
processing_note_2
Expand Down Expand Up @@ -121,39 +120,30 @@ def create_resource(row)


def format_rights_statement(row)
if ASConstants.VERSION.start_with?('v1')
{
:rights_type => 'institutional_policy',
:permissions => row['access_conditions'],
:restrictions => row['use_conditions'],
:granted_note => row['granted_note']
notes = []
if row['access_conditions']
notes << {
:jsonmodel_type => "note_rights_statement",
:label => "Access Conditions (eg Available for Reference. Not for Loan)",
:type => 'additional_information',
:content => [ row['access_conditions'] ]
}
else
notes = []
if row['access_conditions']
notes << {
:jsonmodel_type => "note_rights_statement",
:label => "Access Conditions (eg Available for Reference. Not for Loan)",
:type => 'additional_information',
:content => [ row['access_conditions'] ]
}
end
if row['use_conditions']
notes << {
:jsonmodel_type => "note_rights_statement",
:label => "Use Conditions (eg copying not permitted)",
:type => 'additional_information',
:content => [ row['use_conditions'] ]
}
end

{
:rights_type => 'other',
:other_rights_basis => 'donor',
:start_date => Time.now.to_date.iso8601,
:notes => notes
end
if row['use_conditions']
notes << {
:jsonmodel_type => "note_rights_statement",
:label => "Use Conditions (eg copying not permitted)",
:type => 'additional_information',
:content => [ row['use_conditions'] ]
}
end

{
:rights_type => 'other',
:other_rights_basis => 'donor',
:start_date => Time.now.to_date.iso8601,
:notes => notes
}
end


Expand Down
Loading

0 comments on commit bc2bc45

Please sign in to comment.