| 44 | | # TODO: Get this information via the database OR the user |
|---|
| 45 | | params[:queue_url][:source_type] = "web" |
|---|
| 46 | | params[:queue_url][:source_name] = "drone_interface" |
|---|
| 47 | | @queue_url = QueueUrl.new_from_hash(params[:queue_url]) |
|---|
| | 44 | # Create a job hash for the requested URL |
|---|
| | 45 | job_hash = { |
|---|
| | 46 | :source => { |
|---|
| | 47 | :feed_type => 'web', |
|---|
| | 48 | :name => 'drone_interface', |
|---|
| | 49 | }, |
|---|
| | 50 | :notify_source => (params[:notify]), |
|---|
| | 51 | :queue_urls => { |
|---|
| | 52 | params[:queue_url][:url] => params[:queue_url][:priority] |
|---|
| | 53 | } |
|---|
| | 54 | } |
|---|
| | 55 | if not params[:address].nil? |
|---|
| | 56 | job_hash[:source][:response_protocol] = 'smtp' |
|---|
| | 57 | job_hash[:source][:response_address] = params[:address] |
|---|
| | 58 | end |
|---|
| | 59 | |
|---|
| | 60 | # Create a controller object for insert_drone_job logic |
|---|
| | 61 | c = HcDatabaseController.new() |
|---|
| | 62 | job_id = c.insert_drone_job(job_hash) |
|---|
| | 63 | # Get the inserted job |
|---|
| | 64 | job = DroneJob.find(job_id) |
|---|
| | 65 | @queue_url = [] |
|---|
| | 66 | if not job.nil? |
|---|
| | 67 | @queue_url << job.queue_urls |
|---|
| | 68 | end |
|---|