def __init__(self, request): OGCProxy.__init__(self, request) self.settings = request.registry.settings.get("tinyowsproxy", {}) assert "tinyows_url" in self.settings, "tinyowsproxy.tinyows_url must be set" assert self.default_ogc_server, "mapserverproxy.default_ogc_server must be set" self.user = self.request.user self.role_id = None if self.user is None else self.user.role.id # params hold the parameters we are going to send to TinyOWS self.lower_params = self._get_lower_params(dict(self.request.params))
def __init__(self, request): OGCProxy.__init__(self, request, has_default_ogc_server=True) self.settings = request.registry.settings.get("tinyowsproxy", {}) assert "tinyows_url" in self.settings, "tinyowsproxy.tinyows_url must be set" self.ogc_server = (models.DBSession.query(main.OGCServer).filter( main.OGCServer.name == self.settings["ogc_server"]).one()) self.user = self.request.user # params hold the parameters we are going to send to TinyOWS self.lower_params = self._get_lower_params(dict(self.request.params))
def __init__(self, request): OGCProxy.__init__(self, request) self.settings = request.registry.settings.get("tinyowsproxy", {}) assert \ "tinyows_url" in self.settings, \ "tinyowsproxy.tinyows_url must be set" assert self.default_ogc_server, "mapserverproxy.default_ogc_server must be set" self.user = self.request.user self.role_id = None if self.user is None else self.user.role.id # params hold the parameters we are going to send to TinyOWS self.lower_params = self._get_lower_params(dict(self.request.params))
def test_ogcserver(self): from c2cgeoportal_commons.models.main import OGCServer from c2cgeoportal_geoportal.views.ogcproxy import OGCProxy request = create_dummy_request() request.params.update({"ogcserver": "MixedCaseOGCServer"}) proxy = OGCProxy(request) assert isinstance(proxy.ogc_server, OGCServer) assert proxy.ogc_server.name == "MixedCaseOGCServer" request = create_dummy_request() request.params.update({"OGCSERVER": "MixedCaseOGCServer"}) proxy = OGCProxy(request) assert isinstance(proxy.ogc_server, OGCServer) assert proxy.ogc_server.name == "MixedCaseOGCServer"
def __init__(self, request: pyramid.request.Request): OGCProxy.__init__(self, request) self.config = self.request.registry.settings.get("pdfreport", {})
def _get_headers(self): headers = OGCProxy._get_headers(self) if "tinyows_host" in self.settings: headers["Host"] = self.settings.get("tinyows_host") return headers
def __init__(self, request: Request) -> None: OGCProxy.__init__(self, request) self.user = self.request.user
def __init__(self, request): OGCProxy.__init__(self, request) self.user = self.request.user
def __init__(self, request): OGCProxy.__init__(self, request) self.config = self.request.registry.settings.get("pdfreport", {})