Skip to content

Commit 3ba8f23

Browse files
committed
Added IPR search for IPR holder name
- Legacy-Id: 580
1 parent ca041c9 commit 3ba8f23

7 files changed

Lines changed: 92 additions & 19 deletions

File tree

ietf/ipr/search.py

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import django.utils.html
33
from django.shortcuts import render_to_response as render
44
from ietf.idtracker.models import IETFWG, InternetDraft, Rfc
5-
from ietf.ipr.models import IprRfc, IprDraft
5+
from ietf.ipr.models import IprRfc, IprDraft, IprDetail
66
from ietf.ipr.related import related_docs
77
from ietf.utils import log
88

@@ -20,6 +20,8 @@ def search(request, type="", q="", id=""):
2020
id = value
2121
if type and q or id:
2222
log("Got query: type=%s, q=%s, id=%s" % (type, q, id))
23+
24+
# Search by RFC number or draft-identifier
2325
if type in ["document_search", "rfc_search"]:
2426
if type == "document_search":
2527
if q:
@@ -47,20 +49,40 @@ def search(request, type="", q="", id=""):
4749
doc.iprs = disclosures
4850
iprs += disclosures
4951
iprs = list(set(iprs))
50-
return render("ipr/search_doc_result.html", {"first": first, "iprs": iprs, "docs": docs})
52+
return render("ipr/search_doc_result.html", {"q": q, "first": first, "iprs": iprs, "docs": docs})
5153
elif start.count():
52-
return render("ipr/search_doc_list.html", {"docs": start })
54+
return render("ipr/search_doc_list.html", {"q": q, "docs": start })
5355
else:
5456
raise ValueError("Missing or malformed search parameters, or internal error")
57+
58+
# Search by legal name
5559
elif type == "patent_search":
56-
pass
60+
iprs = IprDetail.objects.filter(legal_name__icontains=q, status__in=[1,3]).order_by("-submitted_date", "-ipr_id")
61+
count = iprs.count()
62+
iprs = [ ipr for ipr in iprs if not ipr.updated_by.all() ]
63+
# Some extra information, to help us render 'and' between the
64+
# last two documents in a sequence
65+
for ipr in iprs:
66+
if ipr.drafts.count():
67+
ipr.last_draft = ipr.drafts.all()[int(ipr.drafts.count())-1]
68+
if ipr.rfcs.count():
69+
ipr.last_rfc = ipr.rfcs.all()[int(ipr.rfcs.count())-1]
70+
return render("ipr/search_holder_result.html", {"q": q, "iprs": iprs, "count": count } )
71+
72+
# Search by content of email or pagent_info field
5773
elif type == "patent_info_search":
5874
pass
75+
76+
# Search by wg acronym
5977
elif type == "wg_search":
6078
pass
79+
80+
# Search by rfc and id title
6181
elif type == "title_search":
6282
pass
63-
elif type == "ip_title_search":
83+
84+
# Search by title of IPR disclosure
85+
elif type == "ipr_title_search":
6486
pass
6587
else:
6688
raise ValueError("Unexpected search type in IPR query: %s" % type)

ietf/ipr/testurl.list

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
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
1515
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
1616
200 /ipr/about/ https://datatracker.ietf.org/public/ipr_disclosure.cgi
17+
200 /ipr/search/?option=patent_search&patent_search=nortel https://datatracker.ietf.org/public/ipr_search.cgi?option=patent_search&patent_search=nortel
18+
1719
200 /ipr/2006/
1820
200 /ipr/2006/feb/
1921
200 /ipr/by-date/

ietf/templates/base.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
{% block css %}{% endblock %}
1212
// -->
1313
</style>
14-
</head><body {% block body_attributes %}{% endblock %}>
14+
</head>
15+
<body {% block body_attributes %}{% endblock %}>
1516
<center>
1617
<table border=0 cellpadding=0 cellspacing=0>
1718
<tr>

ietf/templates/ipr/search.html

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
<html>
2-
<head><title>IPR Search Engine </title></head>
3-
<body>
4-
1+
{% extends "base.html" %}
2+
{% block doctype %}{% endblock %}
3+
{% block title %}IPR Search{% endblock %}
4+
{% block content %}
55
<center><br><br>
66
<font color="333366" size=4><b>Document Search</b></font>
77
<hr width="600"><br>
@@ -108,9 +108,6 @@
108108

109109
</table>
110110
<hr width="600"><br><br>
111-
<center><a href="./ipr_disclosure.cgi"><img src="http://www.ietf.org/images/blue.gif" hspace="3" border="0">IPR Disclosure Page</a>
112-
</center><br>
113-
114-
</body></html>
115-
116-
111+
<center><a href="{% url ietf.ipr.views.showlist %}"><img src="http://www.ietf.org/images/blue.gif" hspace="3" border="0">IPR Disclosure Page</a>
112+
</center>
113+
{% endblock %}

ietf/templates/ipr/search_doc_result.html

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
{% block search_result %}
44
<table cellpadding="1" cellspacing="0" border="0">
55

6-
7-
86
<tr><td colspan="3">Total number of IPR disclosures found: {{ iprs|length }} </td></tr>
97
{% for ipr in iprs|dictsort:"submitted_date" %}
108
<tr valign="top" bgcolor="#dadada">
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
{% extends "ipr/search_result.html" %}
2+
{% load ietf_filters %}
3+
{% block search_result %}
4+
<table cellpadding="1" cellspacing="0" border="0">
5+
6+
<tr><td colspan="3"><b>Patent Owner/Applicant Search Result</b></td></tr>
7+
{% if not iprs %}
8+
<tr>
9+
<td></td>
10+
<td colspan="2"><b>No IPR disclosures have been submitted by <i>{{ q }}</i></b></td>
11+
</tr>
12+
{% else %}
13+
<tr><td colspan="3">Total number of IPR disclosures found: {{ count }} </td></tr>
14+
15+
{% for ipr in iprs %}
16+
<tbody bgcolor="#{% cycle dadada,eaeaea as bgcolor %}">
17+
<tr valign="top">
18+
<td colspan="3">IPR that was submitted by <b><i>{{ q }}</i></b>, and is related to
19+
{% for doc in ipr.drafts.all %}
20+
{% ifnotequal ipr.drafts.count 1 %}{% ifequal doc ipr.last_draft %}<b> and </b>{% endifequal %}{% endifnotequal %}
21+
<b><i>{{ doc.document }}, "{{ doc.document.title }},"</i></b>
22+
{% endfor %}
23+
{% for doc in ipr.rfcs.all %}
24+
{% ifnotequal ipr.rfcs.count 1 %}{% ifequal doc ipr.last_rfc %} and {% endifequal %}{% endifnotequal %}
25+
<b><i>{{ doc.document }}, "{{ doc.document.title }},"</i></b>
26+
{% endfor %}
27+
</td>
28+
</tr>
29+
<tr valign="top">
30+
<td width="100">{{ ipr.submitted_date }}</td>
31+
<td width="90"><li>ID # {{ ipr.ipr_id }}</li></td>
32+
<td><a href="{% url ietf.ipr.views.show ipr_id=ipr.ipr_id %}">"{{ ipr.title }}"</a></td>
33+
</tr>
34+
{% for upd in ipr.updates.all %}
35+
{% ifnotequal upd ipr %}
36+
<tr valign="top">
37+
<td width="100">{{ upd.updated.submitted_date }}</td>
38+
<td width="90"><li>ID # {{ upd.updated.ipr_id }}</li></td>
39+
<td>
40+
IPR disclosure ID# {{ ipr.ipr_id }} <a href="{% url ietf.ipr.views.show ipr_id=ipr.ipr_id %}">"{{ ipr.title }}"</a>
41+
Updates <a href="{% url ietf.ipr.views.show ipr_id=upd.ipr_id %}">{{ upd.updated.title }}</a>
42+
</td>
43+
</tr>
44+
{% endifnotequal %}
45+
{% endfor %}
46+
</tbody>
47+
{% endfor %}
48+
49+
{% endif %}
50+
51+
</table>
52+
{% endblock %}

ietf/templates/ipr/search_result.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
{% extends "base.html"}
1+
{% extends "base.html" %}
22
{% block doctype %}{% endblock %}
3+
{% block title %}IPR Search Result{% endblock %}
34
{% block content %}
45
<center>
56
<h2>IPR Disclosures</h2>

0 commit comments

Comments
 (0)