2017-08-14 11:56:23 +00:00
|
|
|
class Sequencer
|
|
|
|
class Unit
|
|
|
|
module Import
|
|
|
|
module Exchange
|
|
|
|
class AttributeExamples < Sequencer::Unit::Base
|
2017-09-15 10:55:49 +00:00
|
|
|
include ::Sequencer::Unit::Exchange::Folders::Mixin::Folder
|
2017-08-14 11:56:23 +00:00
|
|
|
|
|
|
|
uses :ews_folder_ids
|
|
|
|
provides :ews_attributes_examples
|
|
|
|
|
|
|
|
def process
|
|
|
|
state.provide(:ews_attributes_examples) do
|
|
|
|
::Import::Helper::AttributesExamples.new do |extractor|
|
|
|
|
|
|
|
|
ews_folder_ids.collect do |folder_id|
|
|
|
|
|
2019-06-27 18:26:28 +00:00
|
|
|
ews_folder.find(folder_id).items.each do |resource|
|
|
|
|
attributes = ::Import::Exchange::ItemAttributes.extract(resource)
|
|
|
|
extractor.extract(attributes)
|
|
|
|
break if extractor.enough
|
2017-08-14 11:56:23 +00:00
|
|
|
end
|
2019-06-27 18:26:28 +00:00
|
|
|
rescue NoMethodError => e
|
2020-07-07 06:30:20 +00:00
|
|
|
raise if !e.message.include?('Viewpoint::EWS::')
|
2019-06-27 18:26:28 +00:00
|
|
|
|
|
|
|
logger.error e
|
|
|
|
logger.error "Skipping folder_id '#{folder_id}' due to unsupported entries."
|
|
|
|
|
2017-08-14 11:56:23 +00:00
|
|
|
end
|
|
|
|
end.examples
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|