Skip to content

Commit 188a562

Browse files
committed
IPR title search with test cases and acceptable diffs
- Legacy-Id: 697
1 parent 760c119 commit 188a562

6 files changed

Lines changed: 51 additions & 1 deletion

ietf/ipr/search.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,15 @@ def search(request, type="", q="", id=""):
174174
# Search by title of IPR disclosure
175175
# IPR list with documents
176176
elif type == "ipr_title_search":
177-
pass
177+
iprs = IprDetail.objects.filter(title__icontains=q, status__in=[1,3]).order_by("-submitted_date", "-ipr_id")
178+
count = iprs.count()
179+
iprs = [ ipr for ipr in iprs if not ipr.updated_by.all() ]
180+
# Some extra information, to help us render 'and' between the
181+
# last two documents in a sequence
182+
mark_last_doc(iprs)
183+
return render("ipr/search_iprtitle_result.html", {"q": q, "iprs": iprs, "count": count },
184+
context_instance=RequestContext(request) )
185+
178186
else:
179187
raise ValueError("Unexpected search type in IPR query: %s" % type)
180188
return django.http.HttpResponseRedirect(request.path)

ietf/ipr/testurl.list

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,22 +10,32 @@
1010

1111
200 /ipr/search/ https://datatracker.ietf.org/public/ipr_search.cgi
1212
302 /ipr/search/?option=document_search # incomplete argument set gives redirect
13+
1314
200 /ipr/search/?document_search=mod&option=document_search https://datatracker.ietf.org/public/ipr_search.cgi?option=document_search&document_search=mod
1415
200,sort /ipr/search/?id_document_tag=2220&option=document_search https://datatracker.ietf.org/public/ipr_search.cgi?option=document_search&id_document_tag=2220
16+
1517
200,sort /ipr/search/?rfc_search=1034&option=rfc_search https://datatracker.ietf.org/public/ipr_search.cgi?option=rfc_search&rfc_search=1034 # Loong result, RFC search
1618
200 /ipr/search/?rfc_search=4444&option=rfc_search https://datatracker.ietf.org/public/ipr_search.cgi?option=rfc_search&rfc_search=4444 # Empty result, RFC search
19+
1720
200 /ipr/search/?patent_search=nortel&option=patent_search https://datatracker.ietf.org/public/ipr_search.cgi?option=patent_search&patent_search=nortel
1821
200 /ipr/search/?patent_search=nortelxz&option=patent_search https://datatracker.ietf.org/public/ipr_search.cgi?option=patent_search&patent_search=nortelxz # Empty result
22+
1923
200,sort,ignore:quote /ipr/search/?wg_search=dnsext&option=wg_search https://datatracker.ietf.org/public/ipr_search.cgi?option=wg_search&wg_search=dnsext
2024
#200,sort,ignore:quote /ipr/search/?wg_search=aaa&option=wg_search https://datatracker.ietf.org/public/ipr_search.cgi?option=wg_search&wg_search=aaa # FIXME This fails, needs revisiting
2125
200,sort,ignore:quote /ipr/search/?wg_search=acct&option=wg_search https://datatracker.ietf.org/public/ipr_search.cgi?option=wg_search&wg_search=acct # Empty result
26+
2227
200,sort,ignore:quote /ipr/search/?option=title_search&title_search=AAA https://datatracker.ietf.org/public/ipr_search.cgi?option=title_search&title_search=AAA
2328
200,sort,ignore:quote /ipr/search/?option=title_search&title_search=AAAxz https://datatracker.ietf.org/public/ipr_search.cgi?option=title_search&title_search=AAAxz # Empty result
29+
2430
200,sort /ipr/search/?patent_info_search=123&option=patent_info_search https://datatracker.ietf.org/public/ipr_search.cgi?option=patent_info_search&patent_info_search=123
2531
200,sort /ipr/search/?patent_info_search=31415&option=patent_info_search https://datatracker.ietf.org/public/ipr_search.cgi?option=patent_info_search&patent_info_search=31415 # Empty result
32+
2633
200 /ipr/search/?patent_info_search=12&option=patent_info_search https://datatracker.ietf.org/public/ipr_search.cgi?option=patent_info_search&patent_info_search=12 # Error: at least 3 characters
2734
200 /ipr/search/?patent_info_search=abc&option=patent_info_search https://datatracker.ietf.org/public/ipr_search.cgi?option=patent_info_search&patent_info_search=abc # Error: at least 1 digit
2835

36+
200 /ipr/search/?option=ipr_title_search&ipr_title_search=nortel https://datatracker.ietf.org/public/ipr_search.cgi?option=ipr_title_search&ipr_title_search=nortel
37+
200 /ipr/search/?option=ipr_title_search&ipr_title_search=nortelxz https://datatracker.ietf.org/public/ipr_search.cgi?option=ipr_title_search&ipr_title_search=nortelxz # Empty result
38+
2939

3040
200 /ipr/about/ https://datatracker.ietf.org/public/ipr_disclosure.cgi
3141
200 /ipr/2006/
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{% extends "ipr/search_result.html" %}
2+
{% load ietf_filters %}
3+
{% block search_header %}{% if not count %}Search result on {{ q }}{% else %}IPR Disclosure Title Search Result{% endif %}{% endblock %}</b></td></tr>
4+
{% block intro_prefix %}IPR that{% endblock %}
5+
{% block intro_suffix %}and has the string <b><i>"{{ q }}"</i></b> within the IPR disclosure title.{% endblock %}
6+
{% block search_failed %}No IPR disclosures with the word(s) "<i>{{ q }}</i>" in the title have been submitted{% endblock %}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
--- https://datatracker.ietf.org/public/ipr_search.cgi?option=ipr_title_search&ipr_title_search=nortel
2+
+++ /ipr/search/?option=ipr_title_search&ipr_title_search=nortel
3+
@@ -211,2 +211,2 @@
4+
-IPR that has word(s) "nortel" in the title, and is not related to a
5+
-specific IETF contribution.
6+
+IPR that is not related to a specific IETF contribution. and has the
7+
+string "nortel" within the IPR disclosure title.
8+
@@ -217,2 +217,2 @@
9+
-IPR that has word(s) "nortel" in the title, and is not related to a
10+
-specific IETF contribution.
11+
+IPR that is not related to a specific IETF contribution. and has the
12+
+string "nortel" within the IPR disclosure title.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
--- https://datatracker.ietf.org/public/ipr_search.cgi?option=ipr_title_search&ipr_title_search=nortelxz
2+
+++ /ipr/search/?option=ipr_title_search&ipr_title_search=nortelxz
3+
@@ -2,3 +2,5 @@
4+
-Search result on "nortelxz"
5+
-No IPR disclosures with the word(s)"nortelxz" in the title have been
6+
-submitted.
7+
+Search result on nortelxz
8+
+No IPR disclosures with the word(s) "nortelxz" in the title have been
9+
+submitted
10+
+IPR Search Main Page IPR Disclosure Page
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
--- https://datatracker.ietf.org/public/ipr_search.cgi?option=patent_info_search&patent_info_search=12
2+
+++ /ipr/search/?patent_info_search=12&option=patent_info_search
3+
@@ -4,1 +4,1 @@
4+
-Please send problem reports to ietf-action@ietf.org.

0 commit comments

Comments
 (0)