changeset 557:abcb67f5cab4

better configurable annotation server.
author casties
date Wed, 26 Sep 2012 23:20:06 +0200
parents c7fed4285d25
children 6ab436383fca
files zpt/layer_text_annotator.zpt
diffstat 1 files changed, 11 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/zpt/layer_text_annotator.zpt	Wed Sep 26 16:50:04 2012 +0200
+++ b/zpt/layer_text_annotator.zpt	Wed Sep 26 23:20:06 2012 +0200
@@ -31,12 +31,18 @@
   <!-- <script tal:attributes="src string:$rootUrl/template/annotator_files/lib/plugin/filter.js"></script> -->
 
   <script type="text/javascript" 
-    tal:define="annUrl python:'http://echo.mpiwg-berlin.mpg.de/documents%s?pn=%s'%(docinfo['documentPath'],pageinfo['pn']);
-    resUrl python:'http://echo.mpiwg-berlin.mpg.de/documents%s'%(docinfo['documentPath']));
+    tal:define="global annServerUrl string:http://tuxserve03.mpiwg-berlin.mpg.de/AnnotationManager;
+    annUrl python:'http://echo.mpiwg-berlin.mpg.de/documents%s?pn=%s'%(docinfo['documentPath'],pageinfo['pn']);
+    resUrl python:'http://echo.mpiwg-berlin.mpg.de/documents%s'%(docinfo['documentPath']);
     global annUser python:here.getAuthenticatedUser(anon='anonymous');
     global annGroup python:request.get('annotator_group', None);
     permUser python:test(annGroup, 'group:%s'%annGroup, annUser);"
-    tal:content="structure string:var annotatorPageUrl='$annUrl'; var annotatorResourceUrl='$resUrl'; var annotatorUser='$annUser'; var permissionUser='$permUser';"></script>
+    tal:content="structure string:
+    var annotatorServerUrl='$annServerUrl';
+    var annotatorPageUrl='$annUrl'; 
+    var annotatorResourceUrl='$resUrl'; 
+    var annotatorUser='$annUser'; 
+    var permissionUser='$permUser';"></script>
 
   <script type="text/javascript">
             // <!--
@@ -67,8 +73,7 @@
                         return user;
                     }
                 }).addPlugin('Store', {
-                    prefix: 'http://tuxserve03.mpiwg-berlin.mpg.de/AnnotationManager/annotator',
-                    //prefix: 'http://localhost:18080/AnnotationManager/annotator',
+                    prefix: annotatorServerUrl+'/annotator',
                     annotationData : {
                         'uri' : uri,
                         'resource' : annotatorResourceUrl
@@ -113,7 +118,7 @@
           <select class="autosubmit" name="annotator_group">
             <option value="" tal:attributes="selected not:annGroup;"> </option>
             <option
-              tal:repeat="group python:here.getAnnotatorGroupsForUser(user=annUser,annotationServerUrl='http://localhost:18080/AnnotationManager')"
+              tal:repeat="group python:here.getAnnotatorGroupsForUser(user=annUser,annotationServerUrl=annServerUrl)"
               tal:attributes="value group/id; selected python:group['id']==annGroup;" tal:content="group/name" />
           </select> <br /> 
           <input type="submit" value="Go!" />