Sha256: afbac0e069a769c29cd4ebdbd41ca2ad04077c74ce251e1a470953ce744afaa1

Contents?: true

Size: 1.33 KB

Versions: 31

Compression:

Stored size: 1.33 KB

Contents

# coding: utf-8

require_relative 'connector'

module Libis
  module Services
    module CollectiveAccess

      class Cataloguing < Connector

        def initialize(host = nil)
          super 'Cataloguing', host
        end

        def add_item(fields, type = nil)
          type ||= 'ca_objects'
          r, a = soap_encode fields
          request :add, type: type, fieldInfo: r, :attributes! => {fieldInfo: a}
        end

        def add_attributes(item, data, type = nil)
          type ||= 'ca_objects'
          r, a = soap_encode data
          request :getAttributesByElement, type: type, item_id: item, attribute_code_or_id: attribute.to_s, attribute_list_array: r, :attributes! => {attribute_list_array: a}

        end

        def add_attribute(item, attribute, data, type = nil)
          type ||= 'ca_objects'
          r, a = soap_encode data
          request :addAttribute, type: type, item_id: item, attribute_code_or_id: attribute.to_s, attribute_data_array: r, :attributes! => {attribute_data_array: a}
        end

        def remove(item, type = nil)
          type ||= 'ca_objects'
          request :remove, type: type, item_id: item
        end

        def remove_attributes(item, type = nil)
          type ||= 'ca_objects'
          request :removeAllAttributes, type: type, item_id: item
        end

      end

    end
  end
end

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
libis-services-0.1.11 lib/libis/services/collective_access/cataloguing.rb
libis-services-0.1.10 lib/libis/services/collective_access/cataloguing.rb
libis-services-0.1.9 lib/libis/services/collective_access/cataloguing.rb
libis-services-0.1.7 lib/libis/services/collective_access/cataloguing.rb
libis-services-0.1.5 lib/libis/services/collective_access/cataloguing.rb
libis-services-0.1.3 lib/libis/services/collective_access/cataloguing.rb
libis-services-0.1.2 lib/libis/services/collective_access/cataloguing.rb
libis-services-0.1.1 lib/libis/services/collective_access/cataloguing.rb
libis-services-0.1.0-java lib/libis/services/collective_access/cataloguing.rb
libis-services-0.0.3 lib/libis/services/collective_access/cataloguing.rb
libis-services-0.0.2 lib/libis/services/collective_access/cataloguing.rb