Fix XML print from in show_style for token styles (#110)

This commit is contained in:
Sandro Santilli 2014-01-17 17:47:37 +01:00
parent 8b80ad8ba1
commit c711dc328e

View File

@ -63,7 +63,13 @@ global.environment = require('${CONFIG}');
var serverOptions = require('${BASEDIR}/lib/cartodb/server_options'); // _after_ setting global.environment var serverOptions = require('${BASEDIR}/lib/cartodb/server_options'); // _after_ setting global.environment
var grainstore = require('${BASEDIR}/node_modules/windshaft/node_modules/grainstore/lib/grainstore'); var grainstore = require('${BASEDIR}/node_modules/windshaft/node_modules/grainstore/lib/grainstore');
var mml_store = new grainstore.MMLStore(serverOptions.redis, serverOptions.grainstore); var mml_store = new grainstore.MMLStore(serverOptions.redis, serverOptions.grainstore);
var mml_builder = mml_store.mml_builder({dbname:'${dbname}', table:'${token}'}, var builderconfig = {dbname:'${dbname}'};
if ( '${token}'.match(/^~/) ) {
builderconfig.token = '${token}'.substring(1);
} else {
builderconfig.table = '${token}';
}
var mml_builder = mml_store.mml_builder(builderconfig,
function(err, payload) { function(err, payload) {
if ( err ) throw err; if ( err ) throw err;
mml_builder.toXML(function(err, xml) { mml_builder.toXML(function(err, xml) {