Module: Alma

Defined in:
lib/alma/electronic/batch_utils.rb,
lib/alma.rb,
lib/alma/bib.rb,
lib/alma/net.rb,
lib/alma/fine.rb,
lib/alma/loan.rb,
lib/alma/user.rb,
lib/alma/error.rb,
lib/alma/config.rb,
lib/alma/course.rb,
lib/alma/bib_set.rb,
lib/alma/library.rb,
lib/alma/request.rb,
lib/alma/version.rb,
lib/alma/bib_item.rb,
lib/alma/fine_set.rb,
lib/alma/loan_set.rb,
lib/alma/location.rb,
lib/alma/response.rb,
lib/alma/user_set.rb,
lib/alma/course_set.rb,
lib/alma/electronic.rb,
lib/alma/alma_record.rb,
lib/alma/bib_holding.rb,
lib/alma/library_set.rb,
lib/alma/request_set.rb,
lib/alma/api_defaults.rb,
lib/alma/bib_item_set.rb,
lib/alma/location_set.rb,
lib/alma/user_request.rb,
lib/alma/request_options.rb,
lib/alma/payment_response.rb,
lib/alma/renewal_response.rb,
lib/alma/electronic/business.rb,
lib/alma/item_request_options.rb,
lib/alma/availability_response.rb

Overview

Contains batch processing utils for Alma Electronic APIs.

This class and its methods are used to iterate over Alma Electronic IDs to process and fetch Alma electronic objects via the Alma Electronic APIs. The https calls are logged and can be used to rerun the batch process without making any further http calls or to just rerun parts of the full batch.

Defined Under Namespace

Modules: ApiDefaults, Error Classes: AlmaRecord, AvailabilityResponse, Bib, BibHolding, BibItem, BibItemSet, BibRequest, BibSet, Configuration, Course, CourseSet, Electronic, Fine, FineSet, ItemRequest, ItemRequestOptions, Library, LibrarySet, Loan, LoanSet, Location, LocationSet, Net, PaymentResponse, RenewalResponse, RequestOptions, RequestSet, Response, ResultSet, StandardError, User, UserRequest, UserSet

Constant Summary collapse

ROOT =
File.dirname __dir__
VERSION =
"0.6.1"
INVENTORY_SUBFIELD_MAPPING =
{
    "AVA" => {
        "INVENTORY_TYPE" => "physical",
        "a" => "institution",
        "b" => "library_code",
        "c" => "location",
        "d" => "call_number",
        "e" => "availability",
        "f" => "total_items",
        "g" => "non_available_items",
        "j" => "location_code",
        "k" => "call_number_type",
        "p" => "priority",
        "q" => "library",
        "t" => "holding_info",
        "8" => "holding_id",
    },
    "AVD" => {
        "INVENTORY_TYPE" => "digital",
        "a" => "institution",
        "b" => "representations_id",
        "c" => "representation",
        "d" => "repository_name",
        "e" => "label",
    },
    "AVE" => {
        "INVENTORY_TYPE" => "electronic",
        "c" => "collection_id",
        "e" => "activation_status",
        "l" => "library_code",
        "m" => "collection",
        "n" => "public_note",
        "s" => "coverage_statement",
        "t" => "interface_name",
        "u" => "link_to_service_page",
        "8" => "portfolio_pid",
    }
}

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.configurationObject

Returns the value of attribute configuration.



5
6
7
# File 'lib/alma/config.rb', line 5

def configuration
  @configuration
end

Class Method Details

._configure_debuggingObject



28
29
30
31
32
# File 'lib/alma/config.rb', line 28

def self._configure_debugging
  if configuration.enable_debug_output
    Net.debug_output configuration.debug_output_stream
  end
end

._configure_loggingObject



19
20
21
22
23
24
25
26
# File 'lib/alma/config.rb', line 19

def self._configure_logging
  if configuration.enable_log_requests
    primo_logger = configuration.logger
    log_level = Alma.configuration.log_level
    log_format = Alma.configuration.log_format
    Net.logger primo_logger, log_level, log_format
  end
end

.configure {|configuration| ... } ⇒ Object

Yields:



8
9
10
11
12
# File 'lib/alma/config.rb', line 8

def self.configure()
  self.configuration ||= Configuration.new
  yield(configuration) if block_given?
  on_configure
end

.on_configureObject



14
15
16
17
# File 'lib/alma/config.rb', line 14

def self.on_configure
  _configure_logging
  _configure_debugging
end