collectionspace-client 0.1.5 → 0.14.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (36) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/publish.yml +42 -0
  3. data/.gitignore +4 -0
  4. data/.rubocop.yml +8 -0
  5. data/.ruby-version +1 -0
  6. data/Gemfile +2 -0
  7. data/README.md +19 -65
  8. data/Rakefile +44 -3
  9. data/bin/console +26 -0
  10. data/bin/rspec +29 -0
  11. data/collectionspace-client.gemspec +21 -19
  12. data/examples/demo.rb +14 -13
  13. data/examples/media_with_external_file.rb +20 -18
  14. data/examples/purge_empty_vocabs.rb +22 -0
  15. data/examples/reports.rb +178 -0
  16. data/examples/search.rb +25 -58
  17. data/examples/update_password.rb +3 -0
  18. data/lib/collectionspace/client/client.rb +19 -14
  19. data/lib/collectionspace/client/configuration.rb +16 -17
  20. data/lib/collectionspace/client/helpers.rb +145 -99
  21. data/lib/collectionspace/client/refname.rb +114 -0
  22. data/lib/collectionspace/client/request.rb +17 -13
  23. data/lib/collectionspace/client/response.rb +15 -10
  24. data/lib/collectionspace/client/search.rb +12 -7
  25. data/lib/collectionspace/client/service.rb +198 -0
  26. data/lib/collectionspace/client/template.rb +26 -0
  27. data/lib/collectionspace/client/templates/reindex_by_csids.xml.erb +10 -0
  28. data/lib/collectionspace/client/templates/reindex_by_doctype.xml.erb +5 -0
  29. data/lib/collectionspace/client/templates/reindex_full_text.xml.erb +51 -0
  30. data/lib/collectionspace/client/templates/report.xml.erb +16 -0
  31. data/lib/collectionspace/client/templates/reset_media_blob.xml.erb +6 -0
  32. data/lib/collectionspace/client/version.rb +3 -1
  33. data/lib/collectionspace/client.rb +20 -11
  34. metadata +64 -9
  35. data/examples/export.rb +0 -31
  36. data/examples/purge-empty-vocabularies.rb +0 -17
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 102021d7f34434b3f5a79382333ec7677ef7fba8dcdfd2f73daff1a7faa10b59
4
- data.tar.gz: 2510a4f0c3932bb08545e9c263c4357faccad8c6183f43f2e8122bef740dc34c
3
+ metadata.gz: 89651eb1e87693f52f835cbe34eccc510f40888db54696a41082ae114a084817
4
+ data.tar.gz: e3c161e2a64848a1f0065e18da8aa23ad6117995daf62538cf5437bc0192cfc6
5
5
  SHA512:
6
- metadata.gz: 90419be95bd910c0f17e9f0adc9918f702d985278a7b91d0cd531179bacac3e2ce1a1c08aa98510fb7ed66b258451f31923a2013c488110b4e7262383d199feb
7
- data.tar.gz: 031e9d9b52bbe9a83a8c3234bc52f9cbcc5a09c89340c7016dc9d8e5075582954945632cdc133426f42fcbeb6d2fc56995fe1cc7059ca2ba1e30eee47f2b62ca
6
+ metadata.gz: 7d9d9989ff3272bffe9fc99c19036e72004b7e672bc3d02ce5556b69bb478a441a78768d394685534ba83144d76054903bac35fa4f715c50cff32b838e60132c
7
+ data.tar.gz: 7bea83ddcadf1aa7019e196c8ede59cd9e9ffd6fdd9b23a90ff7d0f89666122cb6c865a0b422287cb8a04d4032718e493e48f23b6356d65039a1bde00626e53b
@@ -0,0 +1,42 @@
1
+ name: Publish Gem
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+ - master
8
+ jobs:
9
+ publish:
10
+ runs-on: ubuntu-latest
11
+ permissions:
12
+ contents: write
13
+
14
+ steps:
15
+ - uses: actions/checkout@v3
16
+
17
+ - name: Setup Ruby and install gems
18
+ uses: ruby/setup-ruby@v1
19
+ with:
20
+ bundler-cache: true
21
+ ruby-version: 2.7
22
+ rubygems: latest
23
+
24
+ - name: Release Gem
25
+ run: |
26
+ VERSION=$(bundle exec rake version)
27
+ GEM_VERSION=$(gem list --exact --remote $GEM_NAME)
28
+
29
+ # Publish to RubyGems.org
30
+ if [ "${GEM_VERSION}" != "$GEM_NAME (${VERSION})" ]; then
31
+ gem build $GEM_NAME.gemspec
32
+ gem push "$GEM_NAME-${VERSION}.gem"
33
+ fi
34
+
35
+ # Create a release tag
36
+ if ! git ls-remote --tags --exit-code origin v${VERSION}; then
37
+ git tag v${VERSION}
38
+ git push --tags
39
+ fi
40
+ env:
41
+ GEM_HOST_API_KEY: "${{ secrets.RUBYGEMS_AUTH_TOKEN }}"
42
+ GEM_NAME: collectionspace-client
data/.gitignore CHANGED
@@ -1,6 +1,7 @@
1
1
  *.gem
2
2
  *.swp
3
3
  /.bundle/
4
+ /.vscode
4
5
  /.yardoc
5
6
  /Gemfile.lock
6
7
  /_yardoc/
@@ -9,5 +10,8 @@
9
10
  /examples/my_*.rb
10
11
  /pkg/
11
12
  /spec/reports/
13
+ .byebug_history
14
+ .rspec_status
12
15
  /tmp/
13
16
  collectionobject.rb
17
+ coverage
data/.rubocop.yml ADDED
@@ -0,0 +1,8 @@
1
+ # .rubocop.yml
2
+ AllCops:
3
+ Exclude:
4
+ - '*.gemspec'
5
+ - '*.rake'
6
+ Metrics/BlockLength:
7
+ Exclude:
8
+ - !ruby/regexp /_spec.rb/
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 2.7.4
data/Gemfile CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  source 'https://rubygems.org'
2
4
 
3
5
  # Specify your gem's dependencies in collectionspace-client.gemspec
data/README.md CHANGED
@@ -1,65 +1,22 @@
1
- CollectionSpace Client
2
- ===
1
+ # CollectionSpace Client
3
2
 
4
3
  CollectionSpace API client.
5
4
 
6
- Installation
7
- ---
5
+ ## Installation
8
6
 
9
- Add this line to your application's Gemfile:
7
+ Add this line to your application's Gemfile (replace `$VERSION` with an available tag):
10
8
 
11
9
  ```ruby
12
- gem 'collectionspace-client'
10
+ gem 'collectionspace-client', tag: $VERSION, git: 'https://github.com/collectionspace/collectionspace-client.git'
13
11
  ```
14
12
 
15
- And then execute:
16
-
17
- $ bundle install
18
-
19
- Or install it yourself as:
20
-
21
- $ gem install collectionspace-client
22
-
23
- Usage
24
- ---
25
-
26
- Basic usage:
27
-
28
- ```ruby
29
- require 'collectionspace/client'
30
-
31
- config = CollectionSpace::Configuration.new({
32
- base_uri: "https://cspace.muesum.org/cspace-services",
33
- username: "admin@cspace.muesum.org",
34
- password: "Administrator",
35
- })
36
-
37
- client = CollectionSpace::Client.new(config)
13
+ And then execute `bundle install`.
38
14
 
39
- result = client.post_blob_uri "http://cspace.muesum.org/assets/mueseum.png"
15
+ ## Usage
40
16
 
41
- raise "=(" if result.status_code != 201
17
+ See the sample scripts within the [examples](examples/) directory.
42
18
 
43
- search_args = {
44
- path: "blobs",
45
- type: "blobs_common",
46
- field: "name",
47
- expression: "ILIKE '%museum.png%'",
48
- }
49
-
50
- query = CollectionSpace::Search.new.from_hash search_args
51
-
52
- result = client.search(query)
53
-
54
- if result.status_code == 200
55
- ap result.parsed['abstract_common_list']
56
- end
57
- ```
58
-
59
- See the sample scripts within the `examples` directory for more.
60
-
61
- Development
62
- ---
19
+ ## Development
63
20
 
64
21
  To run the examples:
65
22
 
@@ -75,26 +32,23 @@ To run the tests:
75
32
  bundle exec rake
76
33
  ```
77
34
 
78
- Publishing
79
- ---
80
-
81
- Bump version in `lib/collectionspace/client/version.rb` then:
35
+ ## Releasing
82
36
 
83
37
  ```bash
84
- VERSION=0.1.5
85
- gem build collectionspace-client
86
- gem push collectionspace-client-$VERSION.gem
87
- git tag v$VERSION
88
- git push --tags
38
+ gem install gem-release
39
+ # https://github.com/svenfuchs/gem-release#gem-bump
40
+ gem bump --version $VERSION --tag
41
+ # i.e.
42
+ gem bump --version minor --tag --pretend # dryrun
43
+ gem bump --version minor --tag # do it for real
44
+ # PR and merge will publish new version
89
45
  ```
90
46
 
91
- Contributing
92
- ---
47
+ ## Contributing
93
48
 
94
- Bug reports and pull requests are welcome on GitHub at https://github.com/lyrasis/collectionspace-client.
49
+ Bug reports and pull requests are welcome on GitHub at https://github.com/collectionspace/collectionspace-client.
95
50
 
96
- License
97
- ---
51
+ ## License
98
52
 
99
53
  The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
100
54
 
data/Rakefile CHANGED
@@ -1,6 +1,47 @@
1
- require "bundler/gem_tasks"
2
- require "rspec/core/rake_task"
1
+ # frozen_string_literal: true
2
+
3
+ require 'bundler/gem_tasks'
4
+ require 'rspec/core/rake_task'
5
+ require 'base64'
6
+ require 'collectionspace/client'
3
7
 
4
8
  RSpec::Core::RakeTask.new(:spec)
5
9
 
6
- task :default => :spec
10
+ task default: :spec
11
+
12
+ task :version do
13
+ puts CollectionSpace::Client::VERSION
14
+ end
15
+
16
+ namespace :cli do
17
+ desc "Update a user's password: requires an Admin level account to perform the update"
18
+ task :update_password, [:endpoint, :admin, :password, :user, :new_password] do |_t, args|
19
+ endpoint = args[:endpoint]
20
+ admin = args[:admin]
21
+ password = args[:password]
22
+ user = args[:user]
23
+ new_password = args[:new_password]
24
+
25
+ client = CollectionSpace::Client.new(
26
+ CollectionSpace::Configuration.new(
27
+ base_uri: endpoint,
28
+ username: admin,
29
+ password: password
30
+ )
31
+ )
32
+
33
+ payload = <<~XML
34
+ <ns2:accounts_common xmlns:ns2="http://collectionspace.org/services/account">
35
+ <userId>#{user}</userId>
36
+ <password>#{Base64.encode64(new_password).chomp}</password>
37
+ </ns2:accounts_common>
38
+ XML
39
+
40
+ client.all('accounts').each do |account|
41
+ if account['email'] == user
42
+ puts client.put(account['uri'], payload).parsed
43
+ break
44
+ end
45
+ end
46
+ end
47
+ end
data/bin/console ADDED
@@ -0,0 +1,26 @@
1
+ #! /usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ require 'bundler/setup'
5
+ Bundler.require(:tools)
6
+
7
+ require_relative '../lib/collectionspace/client'
8
+ require 'irb'
9
+
10
+ module CollectionSpace
11
+ ::CS = CollectionSpace # alias only in console to minimize typing
12
+
13
+ module_function
14
+
15
+ def coredev
16
+ CollectionSpace::Client.new(
17
+ CollectionSpace::Configuration.new(
18
+ base_uri: 'https://core.dev.collectionspace.org/cspace-services',
19
+ username: 'admin@core.collectionspace.org',
20
+ password: 'Administrator'
21
+ )
22
+ )
23
+ end
24
+ end
25
+
26
+ IRB.start(__FILE__)
data/bin/rspec ADDED
@@ -0,0 +1,29 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ #
5
+ # This file was generated by Bundler.
6
+ #
7
+ # The application 'rspec' is installed as part of a gem, and
8
+ # this file is here to facilitate running it.
9
+ #
10
+
11
+ require "pathname"
12
+ ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
13
+ Pathname.new(__FILE__).realpath)
14
+
15
+ bundle_binstub = File.expand_path("../bundle", __FILE__)
16
+
17
+ if File.file?(bundle_binstub)
18
+ if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
19
+ load(bundle_binstub)
20
+ else
21
+ abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
22
+ Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
23
+ end
24
+ end
25
+
26
+ require "rubygems"
27
+ require "bundler/setup"
28
+
29
+ load Gem.bin_path("rspec-core", "rspec")
@@ -1,31 +1,33 @@
1
- # coding: utf-8
2
- lib = File.expand_path('../lib', __FILE__)
1
+ lib = File.expand_path('lib', __dir__)
3
2
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
3
  require 'collectionspace/client/version'
5
4
 
6
5
  Gem::Specification.new do |spec|
7
- spec.name = "collectionspace-client"
6
+ spec.name = 'collectionspace-client'
8
7
  spec.version = CollectionSpace::Client::VERSION
9
- spec.authors = ["Mark Cooper"]
10
- spec.email = ["mark.cooper@lyrasis.org"]
8
+ spec.authors = ['Mark Cooper']
9
+ spec.email = ['mark.cooper@lyrasis.org']
11
10
 
12
- spec.summary = %q{CollectionSpace API client.}
13
- spec.homepage = "https://github.com/lyrasis/collectionspace-client.git"
14
- spec.license = "MIT"
11
+ spec.summary = 'CollectionSpace API client.'
12
+ spec.homepage = 'https://github.com/lyrasis/collectionspace-client.git'
13
+ spec.license = 'MIT'
15
14
 
16
15
  spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
17
- spec.bindir = "exe"
16
+ spec.bindir = 'exe'
18
17
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
19
- spec.require_paths = ["lib"]
18
+ spec.require_paths = ['lib']
20
19
 
21
- spec.add_dependency "httparty"
22
- spec.add_dependency "json"
23
- spec.add_dependency "nokogiri"
20
+ spec.add_dependency 'httparty'
21
+ spec.add_dependency 'json'
22
+ spec.add_dependency 'nokogiri'
24
23
 
25
- spec.add_development_dependency "bundler"
26
- spec.add_development_dependency "rake", "~> 10.0"
27
- spec.add_development_dependency "rspec"
28
- spec.add_development_dependency "vcr"
29
- spec.add_development_dependency "webmock"
30
- spec.add_development_dependency "awesome_print"
24
+ spec.add_development_dependency 'awesome_print'
25
+ spec.add_development_dependency 'bundler'
26
+ spec.add_development_dependency 'pry'
27
+ spec.add_development_dependency 'rake', '~> 10.0'
28
+ spec.add_development_dependency 'rspec'
29
+ spec.add_development_dependency 'rubocop'
30
+ spec.add_development_dependency 'simplecov', '~> 0.21'
31
+ spec.add_development_dependency 'vcr'
32
+ spec.add_development_dependency 'webmock'
31
33
  end
data/examples/demo.rb CHANGED
@@ -1,21 +1,22 @@
1
- $LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
1
+ # frozen_string_literal: true
2
+
3
+ $LOAD_PATH.unshift File.expand_path('../lib', __dir__)
2
4
  require 'awesome_print'
3
5
  require 'collectionspace/client'
4
6
 
5
- # CREATE CLIENT WITH DEFAULT (DEMO) CONFIGURATION -- BE NICE!!!
6
- client = CollectionSpace::Client.new
7
- client.config.throttle = 1
7
+ client = CollectionSpace::Client.new(
8
+ CollectionSpace::Configuration.new(
9
+ base_uri: 'https://core.dev.collectionspace.org/cspace-services',
10
+ username: 'admin@core.collectionspace.org',
11
+ password: 'Administrator'
12
+ )
13
+ )
8
14
 
9
15
  # GET REQUEST FOR CONDITIONCHECK RECORDS AND PRINT THE PARSED RESPONSE AND XML
10
16
  response = client.get('conditionchecks')
11
- if response.status_code == 200
12
- ap response.parsed
13
- ap response.xml
14
- end
17
+ ap response.parsed if response.result.success?
15
18
 
16
- # GET ALL INTAKE RECORDS AND PROCESS PER PAGE (INSTEAD OF WAITING FOR ALL)
17
- client.all('media').each do |item|
18
- uri = item["uri"]
19
- intake = client.get uri
20
- ap intake.parsed
19
+ # GET ALL PERSON RECORDS AND PROCESS PER PAGE (INSTEAD OF WAITING FOR ALL)
20
+ client.all('personauthorities/urn:cspace:name(person)/items').each do |item|
21
+ puts item
21
22
  end
@@ -1,26 +1,28 @@
1
- $LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
1
+ # frozen_string_literal: true
2
+
3
+ $LOAD_PATH.unshift File.expand_path('../lib', __dir__)
2
4
  require 'awesome_print'
3
5
  require 'collectionspace/client'
4
6
 
5
- # CREATE CLIENT WITH DEFAULT (DEMO) CONFIGURATION -- BE NICE!!!
6
- client = CollectionSpace::Client.new
7
+ client = CollectionSpace::Client.new(
8
+ CollectionSpace::Configuration.new(
9
+ base_uri: 'https://core.dev.collectionspace.org/cspace-services',
10
+ username: 'admin@core.collectionspace.org',
11
+ password: 'Administrator'
12
+ )
13
+ )
7
14
  client.config.throttle = 1
8
15
 
9
- # ap client.get('media/c453755d-3442-4516-9883').xml.to_xml
10
-
11
- media_url = "https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png"
16
+ media_url = 'https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png'
12
17
  media = <<-XML
13
- <?xml version="1.0" encoding="UTF-8"?>
14
- <document name="media">
15
- <ns2:media_common xmlns:ns2="http://collectionspace.org/services/media" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
16
- <title>GOOGLE</title>
17
- <identificationNumber>GOOGLE-1</identificationNumber>
18
- </ns2:media_common>
19
- </document>
18
+ <?xml version="1.0" encoding="UTF-8"?>
19
+ <document name="media">
20
+ <ns2:media_common xmlns:ns2="http://collectionspace.org/services/media" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
21
+ <title>GOOGLE</title>
22
+ <identificationNumber>GOOGLE-1</identificationNumber>
23
+ </ns2:media_common>
24
+ </document>
20
25
  XML
21
26
 
22
- response = client.post('media', media, { query: { "blobUri" => media_url } })
23
- puts response.status_code
24
- if response.status_code == 201
25
- puts response.headers['location']
26
- end
27
+ response = client.post('media', media, query: { 'blobUri' => media_url })
28
+ puts response.result.headers['location'] if response.result.success?
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ $LOAD_PATH.unshift File.expand_path('../lib', __dir__)
4
+ require 'collectionspace/client'
5
+
6
+ client = CollectionSpace::Client.new(
7
+ CollectionSpace::Configuration.new(
8
+ base_uri: 'https://core.dev.collectionspace.org/cspace-services',
9
+ username: 'admin@core.collectionspace.org',
10
+ password: 'Administrator'
11
+ )
12
+ )
13
+ client.config.throttle = 1
14
+
15
+ client.all('vocabularies').each do |item|
16
+ uri = item['uri']
17
+ puts "Checking vocabulary: #{uri}"
18
+ next unless client.count("#{uri}/items").zero?
19
+
20
+ puts "Purging empty vocabulary:\t#{item['displayName']} (#{item['csid']})"
21
+ client.delete uri
22
+ end
@@ -0,0 +1,178 @@
1
+ # frozen_string_literal: true
2
+
3
+ $LOAD_PATH.unshift File.expand_path('../lib', __dir__)
4
+ require 'awesome_print'
5
+ require 'collectionspace/client'
6
+
7
+ client = CollectionSpace::Client.new(
8
+ CollectionSpace::Configuration.new(
9
+ base_uri: 'https://core.dev.collectionspace.org/cspace-services',
10
+ username: 'admin@core.collectionspace.org',
11
+ password: 'Administrator'
12
+ )
13
+ )
14
+
15
+ # https://github.com/collectionspace/Tools/blob/master/scripts/install_report_records.sh
16
+ # https://github.com/collectionspace/Tools/blob/master/scripts/create-report-records.sh
17
+
18
+ STANDARD_REPORTS = [
19
+ {
20
+ name: 'Acquisition Summary',
21
+ notes: 'An acquisition summary report. Runs on a single record only.',
22
+ doctype: 'Acquisition',
23
+ supports_single_doc: 'true',
24
+ supports_doc_list: 'false',
25
+ supports_group: 'false',
26
+ supports_no_context: 'false',
27
+ filename: 'acq_basic.jrxml',
28
+ mimetype: 'application/pdf'
29
+ },
30
+ {
31
+ name: 'Acquisition Basic List',
32
+ notes: 'Catalog info for objects related to an acquisition record. Runs on a single record only.',
33
+ doctype: 'Acquisition',
34
+ supports_single_doc: 'true',
35
+ supports_doc_list: 'false',
36
+ supports_group: 'false',
37
+ supports_no_context: 'false',
38
+ filename: 'Acq_List_Basic.jrxml',
39
+ mimetype: 'application/pdf'
40
+ },
41
+ {
42
+ name: 'Condition Check Basic List',
43
+ notes: 'Catalog info for objects related to a condition check record. Runs on a single record only.',
44
+ doctype: 'Conditioncheck',
45
+ supports_single_doc: 'true',
46
+ supports_doc_list: 'false',
47
+ supports_group: 'false',
48
+ supports_no_context: 'false',
49
+ filename: 'CC_List_Basic.jrxml',
50
+ mimetype: 'application/pdf'
51
+ },
52
+ {
53
+ name: 'Exhibition Basic List',
54
+ notes: 'Catalog info for objects related to a exhibition record. Runs on a single record only.',
55
+ doctype: 'Exhibition',
56
+ supports_single_doc: 'true',
57
+ supports_doc_list: 'false',
58
+ supports_group: 'false',
59
+ supports_no_context: 'false',
60
+ filename: 'Exhibition_List_Basic.jrxml',
61
+ mimetype: 'application/pdf'
62
+ },
63
+ {
64
+ name: 'Group Basic List',
65
+ notes: 'Catalog info for objects related to a group record. Runs on a single record only.',
66
+ doctype: 'Group',
67
+ supports_single_doc: 'true',
68
+ supports_doc_list: 'false',
69
+ supports_group: 'false',
70
+ supports_no_context: 'false',
71
+ filename: 'Group_List_Basic.jrxml',
72
+ mimetype: 'application/pdf'
73
+ },
74
+ {
75
+ name: 'Loan In Basic List',
76
+ notes: 'Catalog info for objects related to a loan in record. Runs on a single record only.',
77
+ doctype: 'Loanin',
78
+ supports_single_doc: 'true',
79
+ supports_doc_list: 'false',
80
+ supports_group: 'false',
81
+ supports_no_context: 'false',
82
+ filename: 'LoansIn_List_Basic.jrxml',
83
+ mimetype: 'application/pdf'
84
+ },
85
+ {
86
+ name: 'Loan Out Basic List',
87
+ notes: 'Catalog info for objects related to a loan out record. Runs on a single record only.',
88
+ doctype: 'Loanout',
89
+ supports_single_doc: 'true',
90
+ supports_doc_list: 'false',
91
+ supports_group: 'false',
92
+ supports_no_context: 'false',
93
+ filename: 'LoansOut_List_Basic.jrxml',
94
+ mimetype: 'application/pdf'
95
+ },
96
+ {
97
+ name: 'Acquisition Ethnographic Object List',
98
+ notes: 'Core acquisition report. Runs on a single record only.',
99
+ doctype: 'Acquisition',
100
+ supports_single_doc: 'true',
101
+ supports_doc_list: 'false',
102
+ supports_group: 'false',
103
+ supports_no_context: 'false',
104
+ filename: 'coreAcquisition.jrxml',
105
+ mimetype: 'application/pdf'
106
+ },
107
+ {
108
+ name: 'Group Object Ethnographic Object List',
109
+ notes: 'Core group object report. Runs on a single record only.',
110
+ doctype: 'Group',
111
+ supports_single_doc: 'true',
112
+ supports_doc_list: 'false',
113
+ supports_group: 'false',
114
+ supports_no_context: 'false',
115
+ filename: 'coreGroupObject.jrxml',
116
+ mimetype: 'application/pdf'
117
+ },
118
+ {
119
+ name: 'Intake Ethnographic Object List',
120
+ notes: 'Core intake report. Runs on a single record only.',
121
+ doctype: 'Intake',
122
+ supports_single_doc: 'true',
123
+ supports_doc_list: 'false',
124
+ supports_group: 'false',
125
+ supports_no_context: 'false',
126
+ filename: 'coreIntake.jrxml',
127
+ mimetype: 'application/pdf'
128
+ },
129
+ {
130
+ name: 'Loan In Ethnographic Object List',
131
+ notes: 'Core loan in report. Runs on a single record only.',
132
+ doctype: 'Loanin',
133
+ supports_single_doc: 'true',
134
+ supports_doc_list: 'false',
135
+ supports_group: 'false',
136
+ supports_no_context: 'false',
137
+ filename: 'coreLoanIn.jrxml',
138
+ mimetype: 'application/pdf'
139
+ },
140
+ {
141
+ name: 'Loan Out Ethnographic Object List',
142
+ notes: 'Core loan out report. Runs on a single record only.',
143
+ doctype: 'Loanout',
144
+ supports_single_doc: 'true',
145
+ supports_doc_list: 'false',
146
+ supports_group: 'false',
147
+ supports_no_context: 'false',
148
+ filename: 'coreLoanOut.jrxml',
149
+ mimetype: 'application/pdf'
150
+ },
151
+ {
152
+ name: 'Object Exit Ethnographic Object List',
153
+ notes: 'Core object exit report. Runs on a single record only.',
154
+ doctype: 'ObjectExit',
155
+ supports_single_doc: 'true',
156
+ supports_doc_list: 'false',
157
+ supports_group: 'false',
158
+ supports_no_context: 'false',
159
+ filename: 'coreObjectExit.jrxml',
160
+ mimetype: 'application/pdf'
161
+ },
162
+ {
163
+ name: 'Systematic Inventory',
164
+ notes: 'Generate a checklist for performing an inventory on a range of storage locations. Runs on all records, using the provided start and end locations.',
165
+ doctype: 'Locationitem',
166
+ supports_single_doc: 'false',
167
+ supports_doc_list: 'false',
168
+ supports_group: 'false',
169
+ supports_no_context: 'true',
170
+ filename: 'systematicInventory.jrxml',
171
+ mimetype: 'application/pdf'
172
+ }
173
+ ]
174
+
175
+ STANDARD_REPORTS.each do |report|
176
+ response = client.add_report(report)
177
+ puts response.inspect
178
+ end