lib/collectionspace/mapper/tools/record_status_service_client.rb
def lookup(value)
          response = if ns_prefix == 'relations'
                       client.find_relation(subject_csid: value[:sub], object_csid: value[:obj], rel_type: value[:prd])
                     else
                       lookup_non_relationship(value)
                     end

          ct = count_results(response)
          if ct == 0
            reportable_result
          elsif ct == 1
            reportable_result(response.parsed[response_top][response_nested])
          elsif ct > 1
            raise CollectionSpace::Mapper::MultipleCsRecordsFoundError, ct unless use_first?

            item = response.parsed[response_top][response_nested].first
            num_found = response.parsed[response_top][response_nested].length
            reportable_result(item).merge({multiple_recs_found: num_found})
          end
        end
# if there are failures in looking up records due to parentheses, single/double
#  quotes, special characters, etc., this should be resolved in the
#  collectionspace-client code.
# Tests in examples/search.rb
if there are failures in looking up records due to parentheses, single/double
quotes, special characters, etc., this should be resolved in the
collectionspace-client code.
if there are failures in looking up records due to parentheses single / double quotes special characters etc . this should be resolved in the collectionspace - client code .
def lookup(value)
          response = if ns_prefix == 'relations'
                       client.find_relation(subject_csid: value[:sub], object_csid: value[:obj], rel_type: value[:prd])
                     else
                       lookup_non_relationship(value)
                     end
          ct = count_results(response)
          if ct == 0
            reportable_result
          elsif ct == 1
            reportable_result(response.parsed[response_top][response_nested])
          elsif ct > 1
            raise CollectionSpace::Mapper::MultipleCsRecordsFoundError, ct unless use_first?
            item = response.parsed[response_top][response_nested].first
            num_found = response.parsed[response_top][response_nested].length
            reportable_result(item).merge({multiple_recs_found: num_found})
          end
        end
def lookup ( value ) response = if ns_prefix == 'relations' client . find_relation ( subject_csid : value [ :sub ] , object_csid : value [ :obj ] , rel_type : value [ :prd ] ) else lookup_non_relationship ( value ) end ct = count_results ( response ) if ct == 0 reportable_result elsif ct == 1 reportable_result ( response . parsed [ response_top ] [ response_nested ] ) elsif ct > 1 raise CollectionSpace :: Mapper :: MultipleCsRecordsFoundError , ct unless use_first? item = response . parsed [ response_top ] [ response_nested ] . first num_found = response . parsed [ response_top ] [ response_nested ] . length reportable_result ( item ) . merge ( { multiple_recs_found : num_found } ) end end
if there are failures in looking up records due to parentheses, single/double
quotes, special characters, etc., this should be resolved in the
collectionspace-client code.
if there are failures in looking up records due to parentheses single / double quotes special characters etc . this should be resolved in the collectionspace - client code .
value