Patch #6277
closedREST API for Search
Added by Akiko Takano over 16 years ago. Updated over 10 years ago.
Description
Some CMS or Web Application have REST API or RSS/Atom API for search function.
Since search controller don't have to implement any update/delete/create function, I suppose only an xml template is required to support REST API.
This patch is over r4053.
Files
| search_rest_api.patch (1.21 KB) search_rest_api.patch | Akiko Takano, 2010-09-03 02:27 | ||
| search_rest_api_trunk_r15148.patch (3.99 KB) search_rest_api_trunk_r15148.patch | Takenori TAKAKI, 2016-02-25 02:05 |
Updated by Eric Davis over 16 years ago
Actions
#1
- Category set to REST API
I'll need some tests for this patch before it can be reviewed.
Updated by Akiko Takano about 16 years ago
Actions
#2
Thanks for your taking time to see it.
I hope to apply this feature to RedmineAir if implemented.
Updated by Christian Baus about 13 years ago
Actions
#3
+1 for this feature!!
i adapt the patch above for the current redmine version 2.3 and add some extension
Edit: app/controller/search_controller.rb (render part of index action)
respond_to do |format|
format.html { render 'search/index', :layout => !request.xhr? }
format.api { }
end
Add: app/views/search/index.xml.builder
xml.instruct!
xml.search_results :type => 'array' do
@results.each do |result|
xml.result do
xml.title result.event_title
xml.type result.event_type
xml.url url_for(result.event_url(:only_path => false))
xml.description result.event_description
xml.datetime result.event_datetime
if result.class == Issue
xml.id result.id
xml.tracker_id result.tracker_id
xml.project_id result.project_id
xml.subject result.subject
xml.category_id result.category_id
xml.assigned_to_id result.assigned_to_id
xml.priority_id result.priority_id
xml.author_id result.author_id
xml.created_at result.created_on
xml.updated_at result.updated_on
xml.status result.status
xml.subject result.subject
end
if result.class == Project
xml.id result.id
xml.parent_id result.parent_id
xml.created_at result.created_on
xml.updated_at result.updated_on
xml.status result.status
xml.name result.name
custom_field = result.available_custom_fields.select{|f|f.name.eql?("intranet_description")}.first
if custom_field && custom_field.custom_values
xml.intranet_description custom_field.custom_values.first.value
else
xml.intranet_description ""
end
end
end
end
end
Updated by Terence Mill about 13 years ago
Actions
#4
+1
Updated by David Rahusen almost 13 years ago
Actions
#5
+1
Updated by Tony NG almost 12 years ago
Actions
#6
+1
Updated by Matthias Schelling over 11 years ago
Actions
#7
+1
Updated by Dmitry Azarenko about 11 years ago
Actions
#8
+1
Updated by mathew murphy almost 11 years ago
Actions
#9
+1
Updated by Go MAEDA almost 11 years ago
Actions
#10
- Related to Feature #8474: [REST] search issues easily added
Updated by Toshi MARUYAMA almost 11 years ago
Actions
#11
- Related to deleted (Feature #8474: [REST] search issues easily)
Updated by Toshi MARUYAMA almost 11 years ago
Actions
#12
- Has duplicate Feature #8474: [REST] search issues easily added
Updated by Justin Hill almost 11 years ago
Actions
#13
+1
Updated by Go MAEDA almost 11 years ago
Actions
#14
- Target version set to Candidate for next major release
Updated by Takenori TAKAKI almost 11 years ago
Actions
#15
I do appreciate Akiko Takano's work. I would be very happy if I could see the feature in Redmine 3.3.0.
I have updated the patch:
- Compatible with latest trunk (r15148)
- Added event.id to a response
- Added tests
Updated by Go MAEDA almost 11 years ago
Actions
#16
- Target version changed from Candidate for next major release to 3.3.0
The patch created by Takenori TAKAKI works fine on the trunk (r15160) and passed all tests.
I propose to deliver this feature in Redmine 3.3.0.
Updated by Jean-Philippe Lang over 10 years ago
Actions
#17
- Status changed from New to Closed
- Assignee set to Jean-Philippe Lang
Patch committed. I've made a few more changes to support pagination.
Thanks.
Updated by Akiko Takano over 10 years ago
Actions
#18
Jean-Philippe Lang wrote:
Patch committed. I've made a few more changes to support pagination.
Thanks.
Thank you so much for all you did!
Updated by Akiko Takano over 10 years ago
Actions
#19
Hi, TAKAKI-san,
Thank you for your support and providing patch file. I really appreciate it!