Sha256: 30a220e5e7c40fcd8df4ae6a6e735be08298bc5816e99fcf805164a13980c381
Contents?: true
Size: 1.02 KB
Versions: 5
Compression:
Stored size: 1.02 KB
Contents
require 'rubydora' module ActiveFedora class RubydoraConnection attr_accessor :options, :connection def initialize(params={}) params = params.dup self.options = params connect end def connect(force=false) return unless @connection.nil? or force allowable_options = [:url, :user, :password, :timeout, :open_timeout, :ssl_client_cert, :ssl_client_key, :validateChecksum] client_options = options.reject { |k,v| not allowable_options.include?(k) } #puts "CLIENT OPTS #{client_options.inspect}" @connection = Rubydora.connect client_options Rubydora::Transaction.after_rollback do |options| begin case options[:method] when :ingest solr = ActiveFedora::SolrService.instance.conn solr.delete_by_id(options[:pid]) solr.commit else ActiveFedora::Base.find(options[:pid]).update_index end rescue # no-op end end end end end
Version data entries
5 entries across 5 versions & 1 rubygems