Class: ODDB::State::Admin::WaitForFachinfo

Inherits:
Global show all
Defined in:
src/state/admin/wait_for_fachinfo.rb

Defined Under Namespace

Classes: Model

Constant Summary

VIEW =
View::Admin::WaitForFachinfo

Constants inherited from Global

HOME_STATE, ZONE

Constants inherited from Global

DIRECT_EVENT, GLOBAL_MAP, HOME_STATE, LIMITED, PRINT_STATES, READONLY_STATES, RESOLVE_STATES, REVERSE_MAP, VIEW, ZONE_NAVIGATION

Constants included from UmlautSort

FILTER_PAIRS

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Methods inherited from Global

#zone_navigation

Methods inherited from Global

#_search_drugs, #_search_drugs_state, #_trigger, #add_to_interaction_basket, #allowed?, #atc_chooser, #checkout, #clear_interaction_basket, #creditable?, #direct_request_path, #doctorlist, #download, #export_csv, #extend, #fachinfo, #feedbacks, #help_navigation, #home_navigation, #home_state, #hospitallist, #interaction_basket, #limit_state, #limited?, #logout, #navigation, #notify, #password_reset, #paypal_return, #powerlink, #print, #proceed_download, #proceed_poweruser, #resolve, #resolve_state, #rss, #search, #show, #snapback_event, #sort, #sponsorlink, #suggest_address, #switch, #unique_email, #user_input, #user_navigation, #ywesee_contact, #zone_navigation, #zones

Methods included from LoginMethods

#autologin, #login

Methods included from UmlautSort

#sort_model, #umlaut_filter

Instance Attribute Details

- (Object) wait_counter

Returns the value of attribute wait_counter



23
24
25
# File 'src/state/admin/wait_for_fachinfo.rb', line 23

def wait_counter
  @wait_counter
end

Instance Method Details

- (Object) init



25
26
27
28
29
# File 'src/state/admin/wait_for_fachinfo.rb', line 25

def init
  super
  @wait = true
  @wait_counter = 0
end

- (Object) signal_done(document, path, model, mimetype, language, link)



49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# File 'src/state/admin/wait_for_fachinfo.rb', line 49

def signal_done(document, path, model, mimetype, language, link)
  if(document.is_a?(FachinfoDocument))
    @language = language
    @document = document
    @mime_type = mimetype
  else
    user = @session.user
    log = Log.new(Time.now)
    report = "Email: \#{user.name}\nName:  \#{user.name_first} \#{user.name_last}\nLink:  \#{link}\n"
    if(document.is_a?(Exception))
      report = ([
        link, nil, document.class, document.message
      ] + document.backtrace).join("\n")
    end
    log.report = report
    log.files = { 
      path => mimetype 
    }
    subject = "Fachinfo Parse Error Reg: #{model.iksnr}, Language; #{language}"
    log.notify subject, @session.user.name
  end
  @wait = false
end

- (Object) wait



30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# File 'src/state/admin/wait_for_fachinfo.rb', line 30

def wait
  if(@wait)
    @wait_counter+= 1
    if(@wait_counter > 4)
      @wait_counter = 0
    end
    self
  elsif(@document)
    model = Model.new
    model.push(@document)
    model.registration = @model
    model.mime_type = @mime_type
    fi_confirm = State::Admin::FachinfoConfirm.new(@session, model)
    fi_confirm.language = @language
    fi_confirm
  else
    @previous  
  end
end