Class: Lcms::Engine::DocumentsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/lcms/engine/documents_controller.rb

Instance Method Summary collapse

Instance Method Details

#exportObject



13
14
15
16
17
# File 'app/controllers/lcms/engine/documents_controller.rb', line 13

def export
  @excludes = params[:excludes]
  @type = params[:type]
  params[:context] == 'pdf' ? export_pdf : export_gdoc
end

#export_statusObject



19
20
21
22
23
24
25
# File 'app/controllers/lcms/engine/documents_controller.rb', line 19

def export_status
  job_class = params[:context] == 'pdf' ? DocumentGeneratePdfJob : DocumentGenerateGdocJob
  job = job_class.find(params[:jid])
  data = { ready: job.nil? }
  data = data.merge(url: @doc.tmp_link(params[:key])) if params[:key] && job.nil?
  render json: data, status: :ok
end

#showObject



27
28
29
# File 'app/controllers/lcms/engine/documents_controller.rb', line 27

def show
  @props = CurriculumMap.new(@document.resource).props
end

#show_ltiObject



31
32
33
34
35
36
37
38
# File 'app/controllers/lcms/engine/documents_controller.rb', line 31

def show_lti
  # To allow access from iFrame element
  response.headers.delete 'X-Frame-Options'

  @props = CurriculumMap.new(@document.resource).props.merge(links_new_tab: true)

  render layout: 'lti'
end