Skip to content
This repository has been archived by the owner on Sep 26, 2019. It is now read-only.

Commit

Permalink
Merge pull request geoadmin#1063 from geoadmin/fix_proxy
Browse files Browse the repository at this point in the history
Add ogcproxyUrl to gaGlobalOptions
  • Loading branch information
Gilbert Jeiziner committed Feb 5, 2014
2 parents b69f063 + 1282716 commit 53dc246
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 13 deletions.
13 changes: 7 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ help:
@echo
@echo "- BASE_URL_PATH Base URL path (current value: $(BASE_URL_PATH))"
@echo "- SERVICE_URL Service URL (current value: $(SERVICE_URL))"
@echo "- GEOADMIN_URL Geoadmin URL (current value: $(GEOADMIN_URL))"
@echo

.PHONY: all
Expand Down Expand Up @@ -124,12 +125,12 @@ prd/style/print.css: src/style/print.less src/style/app_print.less node_modules

prd/index.html: src/index.mako.html prd/lib/build.js prd/style/app.css .build-artefacts/python-venv/bin/mako-render .build-artefacts/python-venv/bin/htmlmin
mkdir -p $(dir $@)
.build-artefacts/python-venv/bin/mako-render --var "device=desktop" --var "mode=prod" --var "version=$(VERSION)" --var "base_url_path=$(BASE_URL_PATH)" --var "service_url=$(SERVICE_URL)" $< > $@
.build-artefacts/python-venv/bin/mako-render --var "device=desktop" --var "mode=prod" --var "version=$(VERSION)" --var "base_url_path=$(BASE_URL_PATH)" --var "service_url=$(SERVICE_URL)" --var "geoadmin_url=$(GEOADMIN_URL)" $< > $@
.build-artefacts/python-venv/bin/htmlmin $@ $@

prd/mobile.html: src/index.mako.html .build-artefacts/python-venv/bin/mako-render .build-artefacts/python-venv/bin/htmlmin
mkdir -p $(dir $@)
.build-artefacts/python-venv/bin/mako-render --var "device=mobile" --var "mode=prod" --var "version=$(VERSION)" --var "base_url_path=$(BASE_URL_PATH)" --var "service_url=$(SERVICE_URL)" $< > $@
.build-artefacts/python-venv/bin/mako-render --var "device=mobile" --var "mode=prod" --var "version=$(VERSION)" --var "base_url_path=$(BASE_URL_PATH)" --var "service_url=$(SERVICE_URL)" --var "geoadmin_url=$(GEOADMIN_URL)" $< > $@
.build-artefacts/python-venv/bin/htmlmin $@ $@

prd/img/: src/img/*
Expand Down Expand Up @@ -163,16 +164,16 @@ src/style/print.css: src/style/print.less src/style/app_print.less node_modules
node_modules/.bin/lessc $(LESS_PARAMETERS) $< $@

src/index.html: src/index.mako.html .build-artefacts/python-venv/bin/mako-render
.build-artefacts/python-venv/bin/mako-render --var "device=desktop" --var "version=" --var "base_url_path=$(BASE_URL_PATH)" --var "service_url=$(SERVICE_URL)" $< > $@
.build-artefacts/python-venv/bin/mako-render --var "device=desktop" --var "version=" --var "base_url_path=$(BASE_URL_PATH)" --var "service_url=$(SERVICE_URL)" --var "geoadmin_url=$(GEOADMIN_URL)" $< > $@

src/mobile.html: src/index.mako.html .build-artefacts/python-venv/bin/mako-render
.build-artefacts/python-venv/bin/mako-render --var "device=mobile" --var "version=" --var "base_url_path=$(BASE_URL_PATH)" --var "service_url=$(SERVICE_URL)" $< > $@
.build-artefacts/python-venv/bin/mako-render --var "device=mobile" --var "version=" --var "base_url_path=$(BASE_URL_PATH)" --var "service_url=$(SERVICE_URL)" --var "geoadmin_url=$(GEOADMIN_URL)" $< > $@

src/TemplateCacheModule.js: src/TemplateCacheModule.mako.js $(SRC_COMPONENTS_PARTIALS_FILES) .build-artefacts/python-venv/bin/mako-render
.build-artefacts/python-venv/bin/mako-render --var "partials=$(subst src/,,$(SRC_COMPONENTS_PARTIALS_FILES))" --var "basedir=src" $< > $@

apache/app.conf: apache/app.mako-dot-conf prd/lib/build.js prd/style/app.css .build-artefacts/python-venv/bin/mako-render
.build-artefacts/python-venv/bin/mako-render --var "base_url_path=$(BASE_URL_PATH)" --var "service_url=$(SERVICE_URL)" --var "base_dir=$(CURDIR)" $< > $@
.build-artefacts/python-venv/bin/mako-render --var "base_url_path=$(BASE_URL_PATH)" --var "service_url=$(SERVICE_URL)" --var "geoadmin_url=$(GEOADMIN_URL)" --var "base_dir=$(CURDIR)" $< > $@

test/karma-conf-dev.js: test/karma-conf.mako.js .build-artefacts/python-venv/bin/mako-render
.build-artefacts/python-venv/bin/mako-render $< > $@
Expand Down Expand Up @@ -256,7 +257,7 @@ deploy/deploy-branch.cfg: deploy/deploy-branch.mako.cfg .build-artefacts/last-gi
.build-artefacts/python-venv/bin/mako-render --var "git_branch=$(GIT_BRANCH)" $< > $@

rc_branch: rc_branch.mako .build-artefacts/last-git-branch .build-artefacts/python-venv/bin/mako-render
.build-artefacts/python-venv/bin/mako-render --var "base_url=$(GIT_BRANCH)" --var "service_url=$(SERVICE_URL)" $< > $@
.build-artefacts/python-venv/bin/mako-render --var "base_url=$(GIT_BRANCH)" --var "service_url=$(SERVICE_URL)" --var "geoadmin_url=$(GEOADMIN_URL)" $< > $@

scripts/00-$(GIT_BRANCH).conf: scripts/00-branch.mako-dot-conf .build-artefacts/last-git-branch .build-artefacts/python-venv/bin/mako-render
.build-artefacts/python-venv/bin/mako-render --var "git_branch=$(GIT_BRANCH)" $< > $@
Expand Down
1 change: 1 addition & 0 deletions rc_dev
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export BASE_URL_PATH=/main
export SERVICE_URL=//mf-chsdi3.dev.bgdi.ch
export GEOADMIN_URL=//mf-geoadmin3.dev.bgdi.ch

1 change: 1 addition & 0 deletions rc_int
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export BASE_URL_PATH=/main
export SERVICE_URL=//mf-chsdi3.int.bgdi.ch
export GEOADMIN_URL=//mf-geoadmin3.int.bgdi.ch

1 change: 1 addition & 0 deletions rc_prod
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export DEPLOY_TARGET=prod
export BASE_URL_PATH=/main
export SERVICE_URL=//api3.geo.admin.ch
export GEOADMIN_URL=//map.geo.admin.ch

4 changes: 2 additions & 2 deletions src/components/map/MapService.js
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@
});

this.$get = function($http, gaPopup, gaDefinePropertiesForLayer,
gaMapClick, gaMapUtils, $rootScope) {
gaMapClick, gaMapUtils, gaGlobalOptions, $rootScope) {
var Kml = function(proxyUrl) {

/**
Expand Down Expand Up @@ -465,7 +465,7 @@
};
this.proxyUrl = proxyUrl;
};
return new Kml(this.proxyUrl);
return new Kml(gaGlobalOptions.ogcproxyUrl);
};
});

Expand Down
7 changes: 2 additions & 5 deletions src/index.mako.html
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,8 @@ <h3 class="popover-title">
module.constant('gaGlobalOptions', {
serviceUrl : '${service_url}',
baseUrlPath: '${base_url_path}',
version: '${version}'
version: '${version}',
ogcproxyUrl: location.protocol + '${geoadmin_url}${base_url_path}' + '/ogcproxy?url='
});

module.config(['gaLayersProvider', function(gaLayersProvider) {
Expand All @@ -526,10 +527,6 @@ <h3 class="popover-title">
'${base_url_path}/${version}rest/services/all/MapServer/';
}]);

module.config(['gaKmlProvider', function(gaKmlProvider) {
gaKmlProvider.proxyUrl = location.protocol + '${service_url}/ogcproxy?url=';
}]);

module.config(['$sceDelegateProvider', function($sceDelegateProvider) {
var validatorUrl = 'http://www.kmlvalidator.org/validate.htm';
var whitelist = $sceDelegateProvider.resourceUrlWhitelist();
Expand Down

0 comments on commit 53dc246

Please sign in to comment.