app/services/bplmodels/curator_export_service.rb
def ark_for_fileset
      ark_params = {
        is_file_set_of_ssim: @payload.fetch(@payload.keys.first).fetch(:file_set_of).fetch(:ark_id),
        filename_base_ssi: @payload.fetch(@payload.keys.first).fetch(:file_name_base)
      }
      q_params = []
      ark_params.each do |k, v|
        q_params << "#{k}:\"#{v}\""
      end
      begin
        curator_solr_service = RSolr.connect(url: BPL_CONFIG_GLOBAL['curator_solr'])
        response = curator_solr_service.select(params: { q: q_params.join(' AND ') })
        docs = response['response']['docs']
        docs.count == 1 ? docs.first['id'] : nil
      rescue
        nil
      end
    end
# needed for filesets that don't exist in Fedora (e.g. Filestreams::Metadata)
# can't query ark-manager, try DC3 Solr instead
needed for filesets that don't exist in Fedora
can't query ark-manager, try DC3 Solr instead
needed for filesets that don ' t exist in Fedora can ' t query ark - manager try DC3 Solr instead
def ark_for_fileset
      ark_params = {
        is_file_set_of_ssim: @payload.fetch(@payload.keys.first).fetch(:file_set_of).fetch(:ark_id),
        filename_base_ssi: @payload.fetch(@payload.keys.first).fetch(:file_name_base)
      }
      q_params = []
      ark_params.each do |k, v|
        q_params << "#{k}:\"#{v}\""
      end
      begin
        curator_solr_service = RSolr.connect(url: BPL_CONFIG_GLOBAL['curator_solr'])
        response = curator_solr_service.select(params: { q: q_params.join(' AND ') })
        docs = response['response']['docs']
        docs.count == 1 ? docs.first['id'] : nil
      rescue
        nil
      end
    end
def ark_for_fileset ark_params = { is_file_set_of_ssim : @payload . fetch ( @payload . keys . first ) . fetch ( :file_set_of ) . fetch ( :ark_id ) , filename_base_ssi : @payload . fetch ( @payload . keys . first ) . fetch ( :file_name_base ) } q_params = [ ] ark_params . each do | k , v | q_params << "#{k}:\"#{v}\"" end begin curator_solr_service = RSolr . connect ( url : BPL_CONFIG_GLOBAL [ 'curator_solr' ] ) response = curator_solr_service . select ( params : { q : q_params . join ( ' AND ' ) } ) docs = response [ 'response' ] [ 'docs' ] docs . count == 1 ? docs . first [ 'id' ] : nil rescue nil end end
needed for filesets that don't exist in Fedora (e.g.
needed for filesets that don ' t exist in Fedora ( e . g .