Changeset 735

Show
Ignore:
Timestamp:
06/17/08 21:00:43 (5 years ago)
Author:
pvalsecc
Message:

Uses print.url for the {id}.pdf url

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • sandbox/camptocamp/MapFishUnhcr/server/python/mapfish/controllers/printer.py

    r731 r735  
    115115            self.start_response('200 OK', [ 
    116116                    ('Content-Type','application/json; charset=utf-8')]) 
    117             baseURL = "http://" + request.host 
     117            baseURL = self._getBaseURL() 
    118118            return simplejson.dumps({ 
    119119                'getURL': baseURL + url_for(action = "get", id = curId) 
     
    147147            self.url = None 
    148148 
     149    def _getBaseURL(self): 
     150        if self.url: 
     151            return self.url 
     152        else: 
     153            return "http://" + request.host 
     154     
     155 
    149156    def _addURLs(self, json): 
    150157        expr = re.compile('}$') 
    151         if self.url: 
    152             baseURL = self.url 
    153         else: 
    154             baseURL = "http://" + request.host 
     158        baseURL = self._getBaseURL() 
    155159        printURL = simplejson.dumps(baseURL + url_for(action = "doPrint")) 
    156160        createURL = simplejson.dumps(baseURL + url_for(action = "create"))