changeset 527:652cc8d3f1a9

fixed bug with text when layer is only annotator.
author casties
date Thu, 12 Apr 2012 14:27:37 +0200
parents 3f375a048402
children f8a5f63eafc0
files MpdlXmlTextServer.py zpt/common_template.zpt zpt/layer_text_annotator.zpt
diffstat 3 files changed, 7 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/MpdlXmlTextServer.py	Tue Apr 10 19:41:44 2012 +0200
+++ b/MpdlXmlTextServer.py	Thu Apr 12 14:27:37 2012 +0200
@@ -234,7 +234,7 @@
         # check for multiple layers
         if len(modes) > 1:
             logging.debug("getTextPage: more than one mode=%s"%mode)
-            
+                        
         # search mode
         if 'search' in modes:
             # add highlighting
@@ -251,12 +251,9 @@
         if 'dict' in modes:
             # dict is called textPollux in the backend
             textmode = 'textPollux'
-        elif len(modes) == 0:
+        else:
             # text is default mode
             textmode = 'text'
-        else:
-            # just take first mode
-            textmode = modes[0]
         
         textParams['mode'] = textmode
         
--- a/zpt/common_template.zpt	Tue Apr 10 19:41:44 2012 +0200
+++ b/zpt/common_template.zpt	Thu Apr 12 14:27:37 2012 +0200
@@ -42,8 +42,7 @@
         title="Original page number" tal:define="originalPage pageinfo/pageNumberOrig | nothing"
         tal:condition="python:originalPage!=None"> (<span tal:replace="originalPage" /><span
         tal:define="originalPageNorm pageinfo/pageNumberOrigNorm | nothing" tal:condition="python:originalPageNorm!=None"> [<span
-          tal:replace="originalPageNorm" />]
-      </span>)
+          tal:replace="originalPageNorm" />]</span>)
       </span> <input type="submit" value="Go" /> of <span tal:replace="numPages" /> <a tal:condition="right"
         tal:attributes="href python:here.getLink('pn',right)">&gt;</a> <span tal:condition="not:right">&gt;</span> <a
         tal:condition="rightest" tal:attributes="href python:here.getLink('pn',rightest)">&gt;|</a> <span
--- a/zpt/layer_text_annotator.zpt	Tue Apr 10 19:41:44 2012 +0200
+++ b/zpt/layer_text_annotator.zpt	Thu Apr 12 14:27:37 2012 +0200
@@ -40,10 +40,10 @@
                 var uri = window.location.href.split(/#|\?/).shift();
                 var devAnnotator = new Annotator(elem).addPlugin('Auth', {
                     //tokenUrl: 'http://annotateit.org/api/token'
-                    tokenUrl : 'http://localhost:8080/test/annotator/token?user=casties'
+                    tokenUrl : 'template/token?user=anonymous'
                 //autoFetch: false
                 }).addPlugin('Permissions', {
-                    user : 'casties',
+                    user : 'anonymous',
                     userString : function(user) {
                         if (user && user.name) {
                             return user.name;
@@ -57,8 +57,8 @@
                         return user;
                     }
                 }).addPlugin('Store', {
-                    prefix : 'http://localhost:18080/AnnotationManager/annotator',
-                    //prefix: 'http://virtuoso.mpiwg-berlin.mpg.de:8080/AnnotationManager/annotator',
+                    //prefix : 'http://localhost:18080/AnnotationManager/annotator',
+                    prefix: 'http://virtuoso.mpiwg-berlin.mpg.de:8080/AnnotationManager/annotator',
                     //prefix: 'http://annotateit.org/api',
                     annotationData : {
                         'uri' : uri