Changeset 599:3b79ae4a23ca in documentViewer


Ignore:
Timestamp:
Nov 19, 2012, 4:15:13 PM (11 years ago)
Author:
casties
Branch:
default
Message:

normalize uri of annotated image.

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • documentViewer.py

    r594 r599  
    536536            docUrl = getParentPath(url)
    537537            metaDom = self.metadataService.getDomFromPathOrUrl(docUrl)
    538             docinfo['imagePath'] = url.replace('/mpiwg/online/', '', 1)
     538            docinfo['imagePath'] = url.replace('/mpiwg/online', '', 1)
    539539
    540540        elif mode=="filepath":
     
    614614        if mode != 'texttool':
    615615            # override image path from texttool with url parameter TODO: how about mode=auto?
    616             docinfo['imagePath'] = url.replace('/mpiwg/online/', '', 1)
     616            docinfo['imagePath'] = url.replace('/mpiwg/online', '', 1)
    617617
    618618        # check numPages
     
    620620            # number of images from digilib
    621621            if docinfo.get('imagePath', None):
    622                 imgpath = docinfo['imagePath'].replace('/mpiwg/online/', '', 1)
     622                imgpath = docinfo['imagePath'].replace('/mpiwg/online', '', 1)
    623623                logging.debug("imgpath=%s"%imgpath)
    624624                docinfo['imageURL'] = "%s?fn=%s"%(self.digilibScalerUrl, imgpath)
     
    639639                docinfo['numPages'] = docinfo['numTextPages']
    640640
     641        # normalize path
     642        if 'imagePath' in docinfo and not docinfo['imagePath'].startswith('/'):
     643            docinfo['imagePath'] = '/' + docinfo['imagePath']
     644
    641645        logging.debug("documentViewer (getdocinfo) docinfo: keys=%s"%docinfo.keys())
    642         #logging.debug("documentViewer (getdocinfo) docinfo: %s"%docinfo)
    643646        # store in session
    644647        self.REQUEST.SESSION['docinfo'] = docinfo
  • zpt/viewer/layer_image_annotator.zpt

    r598 r599  
    1313    tal:define="global annServerUrl string:http://tuxserve03.mpiwg-berlin.mpg.de/AnnotationManager;
    1414    global annTokenUrl string:$viewerUrl/template/token/getLoginToken;
    15     annUrl python:'http://echo.mpiwg-berlin.mpg.de/documents%s?pn=%s'%(docinfo['documentPath'],pageinfo['pn']);
     15    annUrl python:'http://echo.mpiwg-berlin.mpg.de/documents%s?pn=%s'%(docinfo['imagePath'],pageinfo['pn']);
    1616    resUrl python:'http://echo.mpiwg-berlin.mpg.de/documents%s'%(docinfo['documentPath']);
    1717    global annUser python:here.getAuthenticatedUser(anon='anonymous');
Note: See TracChangeset for help on using the changeset viewer.