From 4f87796e9cb43fb025897700d706c7b8c6e68489 Mon Sep 17 00:00:00 2001 From: Raul Ochoa Date: Mon, 29 Jun 2015 18:58:58 +0200 Subject: [PATCH] Uses backend-foundations branch to use createLayergroup from backend --- lib/cartodb/cartodb_windshaft.js | 2 ++ lib/cartodb/controllers/named_maps.js | 6 +++-- lib/cartodb/controllers/named_static_maps.js | 5 ++-- npm-shrinkwrap.json | 26 ++++++++++---------- package.json | 2 +- 5 files changed, 23 insertions(+), 18 deletions(-) diff --git a/lib/cartodb/cartodb_windshaft.js b/lib/cartodb/cartodb_windshaft.js index b9429a2a..f10bcd01 100644 --- a/lib/cartodb/cartodb_windshaft.js +++ b/lib/cartodb/cartodb_windshaft.js @@ -164,6 +164,7 @@ var CartodbWindshaft = function(serverOptions) { serverOptions, templateMaps, cartoData, + ws.mapBackend, template_baseurl, surrogateKeysCache ); @@ -177,6 +178,7 @@ var CartodbWindshaft = function(serverOptions) { ws, serverOptions, templateMaps, + ws.mapBackend, ws.staticMapBackend, surrogateKeysCache, tablesExtentApi diff --git a/lib/cartodb/controllers/named_maps.js b/lib/cartodb/controllers/named_maps.js index 31c2e0b8..9c8cbe57 100644 --- a/lib/cartodb/controllers/named_maps.js +++ b/lib/cartodb/controllers/named_maps.js @@ -5,11 +5,13 @@ var templateName = require('../backends/template_maps').templateName; var CdbRequest = require('../models/cdb_request'); var NamedMapsCacheEntry = require('../cache/model/named_maps_entry'); -function NamedMapsController(app, serverOptions, templateMaps, metadataBackend, templateBaseUrl, surrogateKeysCache) { +function NamedMapsController(app, serverOptions, templateMaps, metadataBackend, mapBackend, templateBaseUrl, + surrogateKeysCache) { this.app = app; this.serverOptions = serverOptions; this.templateMaps = templateMaps; this.metadataBackend = metadataBackend; + this.mapBackend = mapBackend; this.templateBaseUrl = templateBaseUrl; this.surrogateKeysCache = surrogateKeysCache; } @@ -317,7 +319,7 @@ NamedMapsController.prototype.instantiateTemplate = function(req, res, template_ if ( req.profiler ) req.profiler.done('getUserMapKey'); if ( err ) throw err; fakereq.params.api_key = val; - self.app.createLayergroup(layergroup, fakereq, this); + self.mapBackend.createLayergroup(layergroup, fakereq, this); }, function prepareResponse(err, layergroup) { if ( err ) { diff --git a/lib/cartodb/controllers/named_static_maps.js b/lib/cartodb/controllers/named_static_maps.js index da23b863..f9eeceaa 100644 --- a/lib/cartodb/controllers/named_static_maps.js +++ b/lib/cartodb/controllers/named_static_maps.js @@ -5,11 +5,12 @@ var CdbRequest = require('../models/cdb_request'); var NamedMapsCacheEntry = require('../cache/model/named_maps_entry'); var _ = require('underscore'); -function NamedStaticMapsController(app, serverOptions, templateMaps, staticMapBackend, surrogateKeysCache, +function NamedStaticMapsController(app, serverOptions, templateMaps, mapBackend, staticMapBackend, surrogateKeysCache, tablesExtentApi) { this.app = app; this.serverOptions = serverOptions; this.templateMaps = templateMaps; + this.mapBackend = mapBackend; this.staticMapBackend = staticMapBackend; this.surrogateKeysCache = surrogateKeysCache; this.tablesExtentApi = tablesExtentApi; @@ -114,7 +115,7 @@ NamedStaticMapsController.prototype.named = function(req, res) { }, function setApiKey(err){ assert.ifError(err); - self.app.createLayergroup(layergroupConfig, fakeReq, this); + self.mapBackend.createLayergroup(layergroupConfig, fakeReq, this); }, function prepareResponse(err, layergroup) { assert.ifError(err); diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index e8f837c5..041063d2 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -134,19 +134,19 @@ "resolved": "https://registry.npmjs.org/form-data/-/form-data-1.0.0-rc1.tgz", "dependencies": { "async": { - "version": "1.2.1", + "version": "1.3.0", "from": "async@^1.2.1", - "resolved": "https://registry.npmjs.org/async/-/async-1.2.1.tgz" + "resolved": "https://registry.npmjs.org/async/-/async-1.3.0.tgz" }, "mime-types": { - "version": "2.1.1", + "version": "2.1.2", "from": "mime-types@^2.1.1", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.1.tgz", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.2.tgz", "dependencies": { "mime-db": { - "version": "1.13.0", - "from": "mime-db@~1.13.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.13.0.tgz" + "version": "1.14.0", + "from": "mime-db@~1.14.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.14.0.tgz" } } } @@ -271,13 +271,13 @@ "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz" }, "har-validator": { - "version": "1.7.1", + "version": "1.8.0", "from": "har-validator@^1.6.1", - "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-1.7.1.tgz", + "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-1.8.0.tgz", "dependencies": { "bluebird": { "version": "2.9.30", - "from": "bluebird@^2.9.26", + "from": "bluebird@^2.9.30", "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-2.9.30.tgz" }, "chalk": { @@ -491,9 +491,9 @@ "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.6.0.tgz" }, "windshaft": { - "version": "0.45.0", - "from": "windshaft@0.45.0", - "resolved": "https://registry.npmjs.org/windshaft/-/windshaft-0.45.0.tgz", + "version": "0.45.1", + "from": "https://github.com/CartoDB/Windshaft/tarball/backend-foundations", + "resolved": "https://github.com/CartoDB/Windshaft/tarball/backend-foundations", "dependencies": { "chronograph": { "version": "0.1.0", diff --git a/package.json b/package.json index c05762c3..4b86e524 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "dependencies": { "underscore" : "~1.6.0", "dot": "~1.0.2", - "windshaft": "0.45.0", + "windshaft": "https://github.com/CartoDB/Windshaft/tarball/backend-foundations", "step": "~0.0.5", "queue-async": "~1.0.7", "request": "~2.9.203",