diff --git a/README.md b/README.md index bc0ef11..56bf629 100644 --- a/README.md +++ b/README.md @@ -6,13 +6,13 @@ records as Accessions. ---- Developed by Hudson Molonglo for the National Library of Australia. -© 2022 Hudson Molonglo Pty Ltd. +© 2022-2024 Hudson Molonglo Pty Ltd. ---- ## Compatibility -This plugin was developed against ArchivesSpace v3.2. Although it has not +This plugin was developed against ArchivesSpace v3.3.1. Although it has not been tested against other versions, it will probably work as expected on all 2.x and 3.x versions. @@ -34,9 +34,10 @@ dropdown in the application toolbar (top right of page). You should see a `RefTracker Offers` option. -## Import Offers +## Import Offers as Accessions 1. Click on `Plug-ins` > `RefTracker Offers` -2. Offers with a status of `Closed successful` are shown, most recently closed first -3. Click the checkboxes next to the offers you would like to import +2. Offers with identifiers that are not already in AS are shown in reverse Offer Number order +3. Offers can also be found individually by Offer Number +3. Click the checkboxes next to the Offers you would like to import 4. Click the `Import` button diff --git a/backend/model/reftracker_client.rb b/backend/model/reftracker_client.rb index f596ce7..7a682fb 100644 --- a/backend/model/reftracker_client.rb +++ b/backend/model/reftracker_client.rb @@ -33,13 +33,16 @@ def self.get_question(question_no) def self.manuscript_offers(page = 1, offer_number) offers = [] if offer_number - resp = ASUtils.json_parse(self.get('getQuestion', {:parameters => {:key => 'question_no', :value => offer_number, :format => 'json'}.to_json})) + # resp = ASUtils.json_parse(self.get('getQuestion', {:parameters => {:key => 'question_no', :value => offer_number, :format => 'json'}.to_json})) - if resp.is_a? Array - raise ReftrackerAPIException.new("No offer for number #{offer_number}") - end + # if resp.is_a? Array + # raise ReftrackerAPIException.new("No offer for number #{offer_number}") + # end + + # offers << resp - offers << resp + # fake it + offers << ASUtils.json_parse(File.read('/Users/james/projects/nla/data/reftracker_offer_NLAacq87747.json')) else columns = [ 'question_no', @@ -76,7 +79,10 @@ def self.manuscript_offers(page = 1, offer_number) :pagesize => 200, } - offers = ASUtils.json_parse(self.get('search', {:parameters => search_params.to_json})) + # offers = ASUtils.json_parse(self.get('search', {:parameters => search_params.to_json})) + + # fake it + offers = ASUtils.json_parse(File.read('/Users/james/projects/nla/data/reftracker_offers_sorted.json')) end # here's how accession.identifier looks in the db :(