lib/libis/services/rosetta/service.rb in libis-services-0.0.2 vs lib/libis/services/rosetta/service.rb in libis-services-0.0.3
- old
+ new
@@ -2,10 +2,11 @@
require_relative 'producer_handler'
require_relative 'deposit_handler'
require_relative 'sip_handler'
require_relative 'ie_handler'
require_relative 'collection_handler'
+require_relative 'oai_pmh'
require 'libis/tools/mets_file'
require 'csv'
require 'write_xlsx'
@@ -14,22 +15,24 @@
module Libis
module Services
module Rosetta
+ # noinspection RubyTooManyInstanceVariablesInspection
class Service
attr_reader :pds_service, :producer_service, :deposit_service, :sip_service, :ie_service, :collection_service
# @param [String] base_url
- def initialize(base_url = 'http://depot.lias.be', pds_url = 'https://pds.libis.be')
+ def initialize(base_url = 'http://depot.lias.be', pds_url = 'https://pds.libis.be', opts = {})
@pds_service = Libis::Services::Rosetta::PdsHandler.new pds_url
- @producer_service = Libis::Services::Rosetta::ProducerHandler.new base_url
- @deposit_service = Libis::Services::Rosetta::DepositHandler.new base_url
- @sip_service = Libis::Services::Rosetta::SipHandler.new base_url
- @ie_service = Libis::Services::Rosetta::IeHandler.new base_url
- @collection_service = Libis::Services::Rosetta::CollectionHandler.new base_url
+ @producer_service = Libis::Services::Rosetta::ProducerHandler.new base_url, opts
+ @deposit_service = Libis::Services::Rosetta::DepositHandler.new base_url, opts
+ @sip_service = Libis::Services::Rosetta::SipHandler.new base_url, opts
+ @ie_service = Libis::Services::Rosetta::IeHandler.new base_url, opts
+ @collection_service = Libis::Services::Rosetta::CollectionHandler.new base_url, opts
+ @oai_pmh_service = Libis::Services::Rosetta::OaiPmh.new base_url, opts
end
# @param [String] name
# @param [String] passwd
# @param [String] institute
@@ -38,9 +41,10 @@
handle = @pds_service.login(name, passwd, institute)
@producer_service.pds_handle = handle
@deposit_service.pds_handle = handle
@sip_service.pds_handle = handle
@ie_service.pds_handle = handle
+ @collection_service.pds_handle = handle
handle
end
# Searches for all deposits in the date range and for the given flow id. The method returns a list of all
# deposits, including information about the sip, the related IEs and a breakdown of the IE's METS file.