--- a/web/ldt/text/views.py Thu Dec 16 14:55:25 2010 +0100
+++ b/web/ldt/text/views.py Thu Dec 16 15:00:30 2010 +0100
@@ -44,11 +44,15 @@
query &= Q(uri=request.GET.get('uri'))
if request.GET.get('creator'):
query &= Q(creator=request.GET.get('creator'))
- if request.GET.get('filter') and len(request.GET.get('filter')) > 0:
- query &= Q(text__icontains=request.GET.get('filter'))
annotlist = Annotation.objects.filter(query)
+ if request.GET.get('filter') and len(request.GET.get('filter')) > 0:
+ search = LdtSearch()
+ res = search.query("all",request.GET.get('filter'))
+ for r in res:
+ annotlist.append(r)
+
if request.GET.get('limit'):
nb = request.GET.get('limit')
#offset = request.GET.get('limit')[1]
@@ -66,7 +70,6 @@
## Creates an annotation from a urlencoded xml content
## Returns an xml-structured annotation
-@oauth_required
@csrf_exempt
def create_annotation(request):
cont = request.POST["content"]
@@ -145,7 +148,6 @@
## Deletes an annotation (from its id)
## Returns an empty xml-structured annotation
-@oauth_required
@csrf_exempt
def delete_annotation(request):
try:
@@ -159,7 +161,6 @@
## Updates the content of an annotation
## Returns the xml-structured updated annotation
-@oauth_required
@csrf_exempt
def update_annotation(request):
try:
@@ -183,10 +184,7 @@
if len(tags) == 1:
tags_str += ","
annot.tags = tags_str
-
-
-
-
+
title = doc.xpath("/iri/text-annotation/content/title/text()")
if title and annot.title != title[0]:
annot.title = unicode(title[0])
@@ -208,6 +206,7 @@
annot.update_date = unicode(update_date[0])
annot.save()
+ annot.update_index()
return HttpResponse(lxml.etree.tostring(annot.serialize(), pretty_print=True), mimetype="text/xml;charset=utf-8")