Ejemplo n.º 1
0
    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))
Ejemplo n.º 2
0
    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))
Ejemplo n.º 3
0
    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))
Ejemplo n.º 4
0
    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"
Ejemplo n.º 5
0
 def __init__(self, request: pyramid.request.Request):
     OGCProxy.__init__(self, request)
     self.config = self.request.registry.settings.get("pdfreport", {})
Ejemplo n.º 6
0
 def _get_headers(self):
     headers = OGCProxy._get_headers(self)
     if "tinyows_host" in self.settings:
         headers["Host"] = self.settings.get("tinyows_host")
     return headers
Ejemplo n.º 7
0
 def __init__(self, request: Request) -> None:
     OGCProxy.__init__(self, request)
     self.user = self.request.user
Ejemplo n.º 8
0
 def __init__(self, request):
     OGCProxy.__init__(self, request)
     self.user = self.request.user
Ejemplo n.º 9
0
 def _get_headers(self):
     headers = OGCProxy._get_headers(self)
     if "tinyows_host" in self.settings:
         headers["Host"] = self.settings.get("tinyows_host")
     return headers
Ejemplo n.º 10
0
 def __init__(self, request: Request) -> None:
     OGCProxy.__init__(self, request)
     self.user = self.request.user
Ejemplo n.º 11
0
 def __init__(self, request):
     OGCProxy.__init__(self, request)
     self.config = self.request.registry.settings.get("pdfreport", {})