Added IPR search for IPR holder name

- Legacy-Id: 580
This commit is contained in:
Henrik Levkowetz 2007-06-21 14:56:05 +00:00
parent ca041c9c33
commit 3ba8f23dfe
7 changed files with 92 additions and 19 deletions

View file

@ -2,7 +2,7 @@ import re
import django.utils.html
from django.shortcuts import render_to_response as render
from ietf.idtracker.models import IETFWG, InternetDraft, Rfc
from ietf.ipr.models import IprRfc, IprDraft
from ietf.ipr.models import IprRfc, IprDraft, IprDetail
from ietf.ipr.related import related_docs
from ietf.utils import log
@ -20,6 +20,8 @@ def search(request, type="", q="", id=""):
id = value
if type and q or id:
log("Got query: type=%s, q=%s, id=%s" % (type, q, id))
# Search by RFC number or draft-identifier
if type in ["document_search", "rfc_search"]:
if type == "document_search":
if q:
@ -47,20 +49,40 @@ def search(request, type="", q="", id=""):
doc.iprs = disclosures
iprs += disclosures
iprs = list(set(iprs))
return render("ipr/search_doc_result.html", {"first": first, "iprs": iprs, "docs": docs})
return render("ipr/search_doc_result.html", {"q": q, "first": first, "iprs": iprs, "docs": docs})
elif start.count():
return render("ipr/search_doc_list.html", {"docs": start })
return render("ipr/search_doc_list.html", {"q": q, "docs": start })
else:
raise ValueError("Missing or malformed search parameters, or internal error")
# Search by legal name
elif type == "patent_search":
pass
iprs = IprDetail.objects.filter(legal_name__icontains=q, status__in=[1,3]).order_by("-submitted_date", "-ipr_id")
count = iprs.count()
iprs = [ ipr for ipr in iprs if not ipr.updated_by.all() ]
# Some extra information, to help us render 'and' between the
# last two documents in a sequence
for ipr in iprs:
if ipr.drafts.count():
ipr.last_draft = ipr.drafts.all()[int(ipr.drafts.count())-1]
if ipr.rfcs.count():
ipr.last_rfc = ipr.rfcs.all()[int(ipr.rfcs.count())-1]
return render("ipr/search_holder_result.html", {"q": q, "iprs": iprs, "count": count } )
# Search by content of email or pagent_info field
elif type == "patent_info_search":
pass
# Search by wg acronym
elif type == "wg_search":
pass
# Search by rfc and id title
elif type == "title_search":
pass
elif type == "ip_title_search":
# Search by title of IPR disclosure
elif type == "ipr_title_search":
pass
else:
raise ValueError("Unexpected search type in IPR query: %s" % type)

View file

@ -14,6 +14,8 @@
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/?option=patent_search&patent_search=nortel https://datatracker.ietf.org/public/ipr_search.cgi?option=patent_search&patent_search=nortel
200 /ipr/2006/
200 /ipr/2006/feb/
200 /ipr/by-date/

View file

@ -11,7 +11,8 @@ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
{% block css %}{% endblock %}
// -->
</style>
</head><body {% block body_attributes %}{% endblock %}>
</head>
<body {% block body_attributes %}{% endblock %}>
<center>
<table border=0 cellpadding=0 cellspacing=0>
<tr>

View file

@ -1,7 +1,7 @@
<html>
<head><title>IPR Search Engine </title></head>
<body>
{% extends "base.html" %}
{% block doctype %}{% endblock %}
{% block title %}IPR Search{% endblock %}
{% block content %}
<center><br><br>
<font color="333366" size=4><b>Document Search</b></font>
<hr width="600"><br>
@ -108,9 +108,6 @@
</table>
<hr width="600"><br><br>
<center><a href="./ipr_disclosure.cgi"><img src="http://www.ietf.org/images/blue.gif" hspace="3" border="0">IPR Disclosure Page</a>
</center><br>
</body></html>
<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>
</center>
{% endblock %}

View file

@ -3,8 +3,6 @@
{% block search_result %}
<table cellpadding="1" cellspacing="0" border="0">
<tr><td colspan="3">Total number of IPR disclosures found: {{ iprs|length }} </td></tr>
{% for ipr in iprs|dictsort:"submitted_date" %}
<tr valign="top" bgcolor="#dadada">

View file

@ -0,0 +1,52 @@
{% extends "ipr/search_result.html" %}
{% load ietf_filters %}
{% block search_result %}
<table cellpadding="1" cellspacing="0" border="0">
<tr><td colspan="3"><b>Patent Owner/Applicant Search Result</b></td></tr>
{% if not iprs %}
<tr>
<td></td>
<td colspan="2"><b>No IPR disclosures have been submitted by <i>{{ q }}</i></b></td>
</tr>
{% else %}
<tr><td colspan="3">Total number of IPR disclosures found: {{ count }} </td></tr>
{% for ipr in iprs %}
<tbody bgcolor="#{% cycle dadada,eaeaea as bgcolor %}">
<tr valign="top">
<td colspan="3">IPR that was submitted by <b><i>{{ q }}</i></b>, and is related to
{% for doc in ipr.drafts.all %}
{% ifnotequal ipr.drafts.count 1 %}{% ifequal doc ipr.last_draft %}<b> and </b>{% endifequal %}{% endifnotequal %}
<b><i>{{ doc.document }}, "{{ doc.document.title }},"</i></b>
{% endfor %}
{% for doc in ipr.rfcs.all %}
{% ifnotequal ipr.rfcs.count 1 %}{% ifequal doc ipr.last_rfc %} and {% endifequal %}{% endifnotequal %}
<b><i>{{ doc.document }}, "{{ doc.document.title }},"</i></b>
{% endfor %}
</td>
</tr>
<tr valign="top">
<td width="100">{{ ipr.submitted_date }}</td>
<td width="90"><li>ID # {{ ipr.ipr_id }}</li></td>
<td><a href="{% url ietf.ipr.views.show ipr_id=ipr.ipr_id %}">"{{ ipr.title }}"</a></td>
</tr>
{% for upd in ipr.updates.all %}
{% ifnotequal upd ipr %}
<tr valign="top">
<td width="100">{{ upd.updated.submitted_date }}</td>
<td width="90"><li>ID # {{ upd.updated.ipr_id }}</li></td>
<td>
IPR disclosure ID# {{ ipr.ipr_id }} <a href="{% url ietf.ipr.views.show ipr_id=ipr.ipr_id %}">"{{ ipr.title }}"</a>
Updates <a href="{% url ietf.ipr.views.show ipr_id=upd.ipr_id %}">{{ upd.updated.title }}</a>
</td>
</tr>
{% endifnotequal %}
{% endfor %}
</tbody>
{% endfor %}
{% endif %}
</table>
{% endblock %}

View file

@ -1,5 +1,6 @@
{% extends "base.html"}
{% extends "base.html" %}
{% block doctype %}{% endblock %}
{% block title %}IPR Search Result{% endblock %}
{% block content %}
<center>
<h2>IPR Disclosures</h2>