Class: MagnoliaClient::Import

Inherits:
ImportExportBase show all
Defined in:
lib/magnolia_i_e.rb

Overview

Class responsible for import specific code

Constant Summary

Constants inherited from ImportExportBase

MagnoliaClient::ImportExportBase::MAGNOLIA_BASE_URL, MagnoliaClient::ImportExportBase::MAGNOLIA_EXPORT_URL, MagnoliaClient::ImportExportBase::MAGNOLIA_IMPORT_URL

Instance Method Summary collapse

Methods inherited from ImportExportBase

#exec, #outfile_path, #pad_data, #process_with_buffer, #process_with_no_buffer, #verbose

Constructor Details

#initialize(options) ⇒ Import

Returns a new instance of Import.



281
282
283
284
285
286
# File 'lib/magnolia_i_e.rb', line 281

def initialize(options)
  super(options)
  @action = "importxml"
  @full_url = @server_url + MAGNOLIA_IMPORT_URL
  @import_file = options.import_file
end

Instance Method Details

#prepare_form_dataObject



288
289
290
291
292
293
294
295
296
297
298
# File 'lib/magnolia_i_e.rb', line 288

def prepare_form_data
  form = {
    :mgnlFileImport=>open(@import_file),
    :mgnlRepository=>@workspace,
    :mgnlPath=>@repository_path,
    :mgnlKeepVersions=>false,
    :mgnlFormat=>false,
    :mgnlUuidBehavior=>"2",
    :command=>@action 
  }
end