* Added IPR search on document title
* Added test cases for this and for addtional empty test results * Some refactoring of IPR search code * Fixed bugs in multiple templates for the empty test result case - Legacy-Id: 685
This commit is contained in:
parent
e5610d3f6c
commit
2bb88100d0
|
@ -44,7 +44,7 @@ def iprs_from_docs(docs):
|
|||
doc.iprs = disclosures
|
||||
iprs += disclosures
|
||||
iprs = list(set(iprs))
|
||||
return iprs
|
||||
return iprs, docs
|
||||
|
||||
def search(request, type="", q="", id=""):
|
||||
wgs = IETFWG.objects.filter(group_type__group_type_id=1).exclude(group_acronym__acronym='2000').select_related().order_by('acronym.acronym')
|
||||
|
@ -61,6 +61,7 @@ def search(request, type="", q="", id=""):
|
|||
log("Got query: type=%s, q=%s, id=%s" % (type, q, id))
|
||||
|
||||
# Search by RFC number or draft-identifier
|
||||
# Document list with IPRs
|
||||
if type in ["document_search", "rfc_search"]:
|
||||
if type == "document_search":
|
||||
if q:
|
||||
|
@ -76,7 +77,7 @@ def search(request, type="", q="", id=""):
|
|||
|
||||
docs = related_docs(first, [])
|
||||
#docs = get_doclist.get_doclist(first)
|
||||
iprs = iprs_from_docs(docs)
|
||||
iprs, docs = iprs_from_docs(docs)
|
||||
return render("ipr/search_doc_result.html", {"q": q, "first": first, "iprs": iprs, "docs": docs},
|
||||
context_instance=RequestContext(request) )
|
||||
elif start.count():
|
||||
|
@ -86,6 +87,7 @@ def search(request, type="", q="", id=""):
|
|||
raise ValueError("Missing or malformed search parameters, or internal error")
|
||||
|
||||
# Search by legal name
|
||||
# IPR list with documents
|
||||
elif type == "patent_search":
|
||||
iprs = IprDetail.objects.filter(legal_name__icontains=q, status__in=[1,3]).order_by("-submitted_date", "-ipr_id")
|
||||
count = iprs.count()
|
||||
|
@ -97,10 +99,12 @@ def search(request, type="", q="", id=""):
|
|||
context_instance=RequestContext(request) )
|
||||
|
||||
# Search by content of email or pagent_info field
|
||||
# IPR list with documents
|
||||
elif type == "patent_info_search":
|
||||
pass
|
||||
|
||||
# Search by wg acronym
|
||||
# Document list with IPRs
|
||||
elif type == "wg_search":
|
||||
try:
|
||||
docs = list(InternetDraft.objects.filter(group__acronym=q))
|
||||
|
@ -110,17 +114,29 @@ def search(request, type="", q="", id=""):
|
|||
docs += list(Rfc.objects.filter(group_acronym=q))
|
||||
|
||||
docs = [ doc for doc in docs if doc.ipr.count() ]
|
||||
iprs = iprs_from_docs(docs)
|
||||
iprs, docs = iprs_from_docs(docs)
|
||||
count = len(iprs)
|
||||
#mark_last_doc(iprs)
|
||||
return render("ipr/search_wg_result.html", {"q": q, "docs": docs, "iprs": iprs, "count": count },
|
||||
return render("ipr/search_wg_result.html", {"q": q, "docs": docs, "count": count },
|
||||
context_instance=RequestContext(request) )
|
||||
|
||||
# Search by rfc and id title
|
||||
# Document list with IPRs
|
||||
elif type == "title_search":
|
||||
pass
|
||||
try:
|
||||
docs = list(InternetDraft.objects.filter(title__icontains=q))
|
||||
except:
|
||||
docs = []
|
||||
docs += list(Rfc.objects.filter(title__icontains=q))
|
||||
|
||||
docs = [ doc for doc in docs if doc.ipr.count() ]
|
||||
iprs, docs = iprs_from_docs(docs)
|
||||
count = len(iprs)
|
||||
return render("ipr/search_doctitle_result.html", {"q": q, "docs": docs, "count": count },
|
||||
context_instance=RequestContext(request) )
|
||||
|
||||
|
||||
# Search by title of IPR disclosure
|
||||
# IPR list with documents
|
||||
elif type == "ipr_title_search":
|
||||
pass
|
||||
else:
|
||||
|
|
|
@ -7,15 +7,21 @@
|
|||
200 /ipr/new-specific/ https://datatracker.ietf.org/public/ipr.cgi
|
||||
200 /ipr/new-third-party/ https://datatracker.ietf.org/public/ipr_notify.cgi
|
||||
200 /ipr/update/ https://datatracker.ietf.org/public/ipr_update_list.cgi
|
||||
|
||||
200 /ipr/search/ https://datatracker.ietf.org/public/ipr_search.cgi
|
||||
302 /ipr/search/?option=document_search # incomplete argument set gives redirect
|
||||
200 /ipr/search/?document_search=mod&option=document_search https://datatracker.ietf.org/public/ipr_search.cgi?option=document_search&document_search=mod
|
||||
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
|
||||
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
|
||||
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
|
||||
200 /ipr/about/ https://datatracker.ietf.org/public/ipr_disclosure.cgi
|
||||
200 /ipr/search/?patent_search=nortel&option=patent_search https://datatracker.ietf.org/public/ipr_search.cgi?option=patent_search&patent_search=nortel
|
||||
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
|
||||
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
|
||||
#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
|
||||
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
|
||||
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
|
||||
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
|
||||
200 /ipr/about/ https://datatracker.ietf.org/public/ipr_disclosure.cgi
|
||||
200 /ipr/2006/
|
||||
200 /ipr/2006/feb/
|
||||
200 /ipr/by-date/
|
||||
|
|
57
ietf/templates/ipr/search_doctitle_result.html
Normal file
57
ietf/templates/ipr/search_doctitle_result.html
Normal file
|
@ -0,0 +1,57 @@
|
|||
{% extends "ipr/search_result.html" %}
|
||||
{% load ietf_filters %}
|
||||
{% block search_result %}
|
||||
<table cellpadding="1" cellspacing="0" border="0">
|
||||
<tr><td colspan="3"><b>{% block search_header %}{% if not count %}Search result on {{ q }}{% else %}Document Title Search Result{% endif %}{% endblock %}</b></td></tr>
|
||||
{% if not count %}
|
||||
<tr>
|
||||
<td></td>
|
||||
<td colspan="2">
|
||||
<b>No IPR disclosures related to a document with the word(s) <i>{{ q }}</i> in the title have been submitted.</b>
|
||||
</td>
|
||||
</tr>
|
||||
{% else %}
|
||||
<tr><td colspan="3">Total number of IPR disclosures found: {{ count }} </td></tr>
|
||||
|
||||
{% block iprlist %}
|
||||
{% for doc in docs %}
|
||||
<tbody bgcolor="#{% cycle dadada,eaeaea as bgcolor %}">
|
||||
<tr >
|
||||
<td colspan="3">
|
||||
IPR that is related to <b><i>{{ doc|rfcspace|lstrip:"0"|rfcnospace }}, "{{ doc.title }}"{% if doc.related %}, {{ doc.relation }} {{ doc.related|rfcspace|lstrip:"0"|rfcnospace }}, "{{ doc.related.title }}"{% endif %},
|
||||
</i></b>which has the string <b>"<i>{{ q }}</i>"</b> within the document title.
|
||||
</td>
|
||||
</tr>
|
||||
{% if doc.iprs %}
|
||||
{% for ipr in doc.iprs %}
|
||||
<tr valign="top">
|
||||
<td width="100">{{ ipr.submitted_date }}</td>
|
||||
<td width="90"><li>ID # {{ ipr.ipr_id }}</li></td>
|
||||
<td>
|
||||
<!--
|
||||
{% for item in ipr.updates.all %}
|
||||
{% ifequal item.updated.status 1 %}
|
||||
IPR disclosure ID# {{ item.updated.ipr_id }}, "<a href="{% url ietf.ipr.views.show item.updated.ipr_id %}">{{ item.updated.title }}</a>" Updated by
|
||||
{% endifequal %}
|
||||
{% endfor %}-->
|
||||
{% for item in ipr.updated_by.all %}
|
||||
{% ifequal item.processed 1 %}
|
||||
IPR disclosure ID# {{ item.ipr.ipr_id }} "<a href="{% url ietf.ipr.views.show item.ipr.ipr_id %}">{{ item.ipr.title }}</a>" Updates
|
||||
{% endifequal %}
|
||||
{% endfor %}
|
||||
<a href="{% url ietf.ipr.views.show %}{{ ipr.ipr_id }}">"{{ ipr.title }}"</a>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
<tr>
|
||||
<td></td>
|
||||
<td colspan="2"><b>No IPR disclosures related to <i>{{ doc|rfcspace|lstrip:"0" }}</i> have been submitted</b></td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
</tbody>
|
||||
{% endfor %}
|
||||
{% endblock %}
|
||||
{% endif %}
|
||||
</table>
|
||||
{% endblock %}
|
|
@ -1,4 +1,4 @@
|
|||
{% extends "ipr/search_result.html" %}
|
||||
{% load ietf_filters %}
|
||||
{% block search_header %}Patent Owner/Applicant Search Result{% endblock %}
|
||||
{% block search_header %}{% if not count %}Search result on {{ q }}{% else %}Patent Owner/Applicant Search Result{% endif %}{% endblock %}</b></td></tr>
|
||||
{% block item_intro %}IPR that was submitted by <b><i>{{ q }}</i></b>,{% endblock %}
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
{% if not iprs %}
|
||||
<tr>
|
||||
<td></td>
|
||||
<td colspan="2"><b>No IPR disclosures have been submitted by <i>{{ q }}</i></b></td>
|
||||
<td colspan="2"><b>No IPR disclosures have been submitted by the <i>{{ q }}</i></b></td>
|
||||
</tr>
|
||||
{% else %}
|
||||
<tr><td colspan="3">Total number of IPR disclosures found: {{ count }} </td></tr>
|
||||
|
|
|
@ -3,11 +3,14 @@
|
|||
{% block search_result %}
|
||||
<table cellpadding="1" cellspacing="0" border="0">
|
||||
<tr><td colspan="3"><b>{% block search_header %}Working Group Search Result{% endblock %}</b></td></tr>
|
||||
{% if not iprs %}
|
||||
{% if not count %}
|
||||
<tr>
|
||||
<td></td>
|
||||
<td colspan="2"><b>No IPR disclosures have been submitted by <i>{{ q }}</i></b></td>
|
||||
<td colspan="2">
|
||||
<b>No IPR disclosures related to the <i>{{ q }}</i> working group have been submitted.</b>
|
||||
</td>
|
||||
</tr>
|
||||
<tr><td colspan="3">Total number of IPR disclosures found: {{ count }} </td></tr>
|
||||
{% else %}
|
||||
<tr><td colspan="3">Total number of IPR disclosures found: {{ count }} </td></tr>
|
||||
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
--- https://datatracker.ietf.org/public/ipr_search.cgi?option=title_search&title_search=AAAxz
|
||||
+++ /ipr/search/?option=title_search&title_search=AAAxz
|
||||
@@ -1,0 +1,1 @@
|
||||
+IPR Disclosure Page
|
||||
@@ -2,0 +3,2 @@
|
||||
+IPR Search Main Page
|
|
@ -0,0 +1,4 @@
|
|||
--- https://datatracker.ietf.org/public/ipr_search.cgi?option=patent_search&patent_search=nortelxz
|
||||
+++ /ipr/search/?patent_search=nortelxz&option=patent_search
|
||||
@@ -4,0 +4,2 @@
|
||||
+IPR Search Main Page IPR Disclosure Page
|
Loading…
Reference in a new issue