Changeset 3568 for sandbox

Show
Ignore:
Timestamp:
06/16/10 21:34:48 (2 years ago)
Author:
elemoine
Message:

svn merge -r 3498:HEAD http://www.mapfish.org/svn/mapfish/framework/server/trunk .

Location:
sandbox/tsauerwein/server
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • sandbox/tsauerwein/server

    • Property svn:mergeinfo changed from /framework/server/trunk:3436-3497 to /framework/server/trunk:3436-3497,3499-3567
  • sandbox/tsauerwein/server/mapfish/controllers/printer.py

    r3386 r3568  
    2727import re 
    2828import simplejson 
     29import urlparse 
    2930 
    3031from pylons.controllers import WSGIController 
     
    207208        """ 
    208209        actionUrl = url(controller="printer", action=actionName, id=id) 
     210 
     211        # in 2.0 we'll support "baseurl" only, so the following code 
     212        # block will be removed. And the fromAction argument of this 
     213        # function will also be removed. 
    209214        if request.params.has_key('url'): 
    210215            fullUrl = request.params['url'].encode('utf8') 
     
    215220                return fullUrl[0:-len(myUrl)] + actionUrl 
    216221            log.warn("Cannot guess the base URL for " + fullUrl + " (action=" + myUrl + ")") 
    217         return request.scheme + "://" + request.host + actionUrl 
     222 
     223        if request.params.has_key('baseurl'): 
     224            return request.params['baseurl'].encode('utf8') + actionUrl.split('/')[-1] 
     225        return urlparse.urlunparse((request.scheme, request.host, actionUrl, None, None, None)) 
    218226 
    219227    def _addURLs(self, json):