Class: AjaxExport

Inherits:
Service show all
Defined in:
app/service_adaptors/ajax_export.rb

Overview

This is an abstract superclass other services over-ride to get extra ajaxy windows upon click on link.

Direct Known Subclasses

EmailExport, TxtHoldingExport

Constant Summary

Constants inherited from Service

Service::LinkOutFilterTask, Service::StandardTask

Instance Attribute Summary

Attributes inherited from Service

#group, #name, #priority, #request, #service_id, #status, #task, #url

Instance Method Summary collapse

Methods inherited from Service

#credits, #display_name, #handle_wrapper, #link_out_filter, #preempted_by, required_config_params, #translate

Constructor Details

#initialize(config) ⇒ AjaxExport

Returns a new instance of AjaxExport.



6
7
8
# File 'app/service_adaptors/ajax_export.rb', line 6

def initialize(config)
  super(config)
end

Instance Method Details

#handle(request) ⇒ Object



17
18
19
20
21
22
23
24
25
26
27
# File 'app/service_adaptors/ajax_export.rb', line 17

def handle(request)    
    
  request.add_service_response(:service=>self, 
    :display_text => @display_text,
    :display_text_i18n => @display_text_i18n,
    :link_supports_ajax_call => true,
    :notes=> @note,
    :service_type_value => 'export_citation'  )

  return request.dispatched(self, true)
end

#response_url(service_response, params) ⇒ Object



29
30
31
32
33
34
35
36
# File 'app/service_adaptors/ajax_export.rb', line 29

def response_url(service_response, params)
  # Hash that caller will pass to url_for to create an internally
  # facing link.
  return {:controller=>@form_controller, 
   :action=>@form_action, 
   :id => service_response.id, 
   :format => params[:format]}
end

#service_types_generatedObject

Standard method, used by background service updater. See Service docs.



11
12
13
14
15
# File 'app/service_adaptors/ajax_export.rb', line 11

def service_types_generated
  types = [ ServiceTypeValue[:export_citation] ]
  
  return types
end