module PIM::Services::ImportService

Public Instance Methods

__import_service() click to toggle source
# File services.rb, line 2596
def __import_service
  __service(:importService)
end
abort_import(import_summary_id, script_stack_trace = '', &block) click to toggle source
# File services.rb, line 2583
def abort_import import_summary_id, script_stack_trace = '', &block
  summary_handler = SummaryHandler.new(&block) if block
  __import_service.abort_import(import_summary_id, summary_handler, script_stack_trace)
end
convert_import_url_value(import_summary_id, url, as_private_asset = false) click to toggle source
# File services.rb, line 2588
def convert_import_url_value import_summary_id, url, as_private_asset = false
  __import_service.convert_import_url_value(import_summary_id, url, as_private_asset)
end
create_chunk_summary(import_summary_id) click to toggle source
# File services.rb, line 2555
def create_chunk_summary import_summary_id
  __import_service.create_chunk_summary(import_summary_id)
end
create_chunk_tasks(import_summary_id, number_of_items, chunk_size) click to toggle source
# File services.rb, line 2543
def create_chunk_tasks import_summary_id, number_of_items, chunk_size
  create_import_chunks(import_summary_id, :number_of_items => number_of_items, :chunk_size => chunk_size)
end
create_import_chunks(import_summary_id, opts = {}) click to toggle source
# File services.rb, line 2547
def create_import_chunks import_summary_id, opts = {}
  __import_service.create_import_chunks(import_summary_id,
                               opts[:entity_type] || 'ITEM',
                               opts[:number_of_items],
                               opts[:number_of_chunks],
                               opts[:chunk_size])
end
get_import_stream(import_summary_id) click to toggle source
# File services.rb, line 2524
def get_import_stream import_summary_id
  __import_service.get_import_stream(import_summary_id)
end
Also aliased as: get_input_stream
get_input_stream(import_summary_id)
Alias for: get_import_stream
import_item(item, chunk_summary, location = nil) click to toggle source
# File services.rb, line 2559
def import_item item, chunk_summary, location = nil
  item = item.as_json if item.is_a?(PIM::Item)
  __import_service.import_item(item, chunk_summary, location)
end
import_items(import_summary_id, chunk_nr, chunk_size, chunk_offset, item_location_pairs) click to toggle source
# File services.rb, line 2564
def import_items import_summary_id, chunk_nr, chunk_size, chunk_offset, item_location_pairs
  item_location_pairs.map! do |pair|
    item = pair[:item] || pair['item']
    item = item.as_json if item.is_a?(PIM::Item)
    location = pair[:location] || pair['location']
    action = pair[:action] || pair['action']
    error_message = pair[:error_message] || pair['error_message']
    pair = {
      'item' => item,
      'location' => location,
      'action' => action,
      'error_message' => error_message
    }
    next pair
  end

  __import_service.import_items import_summary_id, chunk_nr, chunk_size, chunk_offset, item_location_pairs
end
reload_import_asset(import_asset) click to toggle source
# File services.rb, line 2592
def reload_import_asset import_asset
  __import_service.reload_import_asset(import_asset)
end
start_import(import_summary_id, &block) click to toggle source
# File services.rb, line 2533
def start_import import_summary_id, &block
  summary_handler = SummaryHandler.new(&block) if block
  __import_service.start_import(import_summary_id, summary_handler)
end
update_import(import_summary_id, chunk_summary = nil, &block) click to toggle source
# File services.rb, line 2538
def update_import import_summary_id, chunk_summary = nil, &block
  summary_handler = SummaryHandler.new(&block) if block
  __import_service.update_import(import_summary_id, chunk_summary, summary_handler)
end