def doGet(request, session): html = """ Pan Zoom iFrame
Fit to screen
Zoom Out
Zoom In
Set Zoom
Panning Mode
 Interact : Disabled
 Pan : Any Mouse Click
 Zoom : Scroll Wheel
Interactive Mode
 Interact : Left Click
 Pan : Disabled
 Zoom : Control Buttons
""" gatewayAddress = request['params'].get('gatewayAddress', '') projectName = request['params'].get('projectName', '') targetURL = request['params'].get('targetURL', '') targetDetailedURL = request['params'].get('targetDetailedURL', '') height = request['params'].get('height', '') width = request['params'].get('width', '') pageId = request['params'].get('pageId', '') def makeURL(page): if page.startswith('/'): URL = "'{gatewayAddress}/data/perspective/client/{projectName}{page}/{pageId}';".format(gatewayAddress=gatewayAddress, projectName=projectName, page=page, pageId=pageId) # URL = "'{gatewayAddress}/data/perspective/client/{projectName}{page}';".format(gatewayAddress=gatewayAddress, projectName=projectName, page=page) else: URL = "'{page}';".format(page=page) return URL def cleanDim(dim): if dim == '': iDim = '100%' elif dim.endswith('%'): iDim = dim elif dim.endswith('px'): iDim = dim else: iDim = '%spx' % dim return '%s;' % iDim html = html.replace("'https://example.com/'; /*replace-target*/", makeURL(targetURL)) html = html.replace("'SDC_PHX_A7'; /*replace-target-detailed*/", makeURL(targetDetailedURL)) html = html.replace("100%; /*replace-width*/", cleanDim(width)) html = html.replace("100%; /*replace-height*/", cleanDim(height)) return {'html': html}