[model][xs]: tweak to _backendFromString to remove option to look up backends specified as full module pathes as this is a liable to bugs and it is not being used.
This commit is contained in:
16
dist/recline.dataset.js
vendored
16
dist/recline.dataset.js
vendored
@@ -262,22 +262,8 @@ my.Dataset = Backbone.Model.extend({
|
|||||||
|
|
||||||
// ### _backendFromString(backendString)
|
// ### _backendFromString(backendString)
|
||||||
//
|
//
|
||||||
// See backend argument to initialize for details
|
// Look up a backend module from a backend string (look in recline.Backend)
|
||||||
_backendFromString: function(backendString) {
|
_backendFromString: function(backendString) {
|
||||||
var parts = backendString.split('.');
|
|
||||||
// walk through the specified path xxx.yyy.zzz to get the final object which should be backend class
|
|
||||||
var current = window;
|
|
||||||
for(ii=0;ii<parts.length;ii++) {
|
|
||||||
if (!current) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
current = current[parts[ii]];
|
|
||||||
}
|
|
||||||
if (current) {
|
|
||||||
return current;
|
|
||||||
}
|
|
||||||
|
|
||||||
// alternatively we just had a simple string
|
|
||||||
var backend = null;
|
var backend = null;
|
||||||
if (recline && recline.Backend) {
|
if (recline && recline.Backend) {
|
||||||
_.each(_.keys(recline.Backend), function(name) {
|
_.each(_.keys(recline.Backend), function(name) {
|
||||||
|
|||||||
16
dist/recline.js
vendored
16
dist/recline.js
vendored
@@ -1438,22 +1438,8 @@ my.Dataset = Backbone.Model.extend({
|
|||||||
|
|
||||||
// ### _backendFromString(backendString)
|
// ### _backendFromString(backendString)
|
||||||
//
|
//
|
||||||
// See backend argument to initialize for details
|
// Look up a backend module from a backend string (look in recline.Backend)
|
||||||
_backendFromString: function(backendString) {
|
_backendFromString: function(backendString) {
|
||||||
var parts = backendString.split('.');
|
|
||||||
// walk through the specified path xxx.yyy.zzz to get the final object which should be backend class
|
|
||||||
var current = window;
|
|
||||||
for(ii=0;ii<parts.length;ii++) {
|
|
||||||
if (!current) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
current = current[parts[ii]];
|
|
||||||
}
|
|
||||||
if (current) {
|
|
||||||
return current;
|
|
||||||
}
|
|
||||||
|
|
||||||
// alternatively we just had a simple string
|
|
||||||
var backend = null;
|
var backend = null;
|
||||||
if (recline && recline.Backend) {
|
if (recline && recline.Backend) {
|
||||||
_.each(_.keys(recline.Backend), function(name) {
|
_.each(_.keys(recline.Backend), function(name) {
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ var dataset = new recline.model.Dataset({
|
|||||||
// information about data source e.g.
|
// information about data source e.g.
|
||||||
url: http://url.to.my.data.endpoint/
|
url: http://url.to.my.data.endpoint/
|
||||||
// backend string or object
|
// backend string or object
|
||||||
backend: the backend we are using - see below
|
backend: a string identifying the backend we are using - see below
|
||||||
});
|
});
|
||||||
|
|
||||||
// initialize dataset with data from the backend.
|
// initialize dataset with data from the backend.
|
||||||
@@ -55,7 +55,10 @@ dataset.docCount // total number of Records in the last query
|
|||||||
fields on this Dataset (this can be set explicitly, or, will be set by
|
fields on this Dataset (this can be set explicitly, or, will be set by
|
||||||
Dataset.fetch()
|
Dataset.fetch()
|
||||||
* docCount: total number of records in this dataset
|
* docCount: total number of records in this dataset
|
||||||
* backend: the Backend (instance) for this Dataset.
|
* backend: the Backend (instance) for this Dataset. (NB: this is a the backend
|
||||||
|
attribute on the object itself not the backend in the Backbone attributes
|
||||||
|
i.e. the result of dataset.get('backend'). The latter is a string identifying
|
||||||
|
the backend.
|
||||||
* queryState: a `Query` object which stores current queryState. queryState may
|
* queryState: a `Query` object which stores current queryState. queryState may
|
||||||
be edited by other components (e.g. a query editor view) changes will trigger
|
be edited by other components (e.g. a query editor view) changes will trigger
|
||||||
a Dataset query.
|
a Dataset query.
|
||||||
|
|||||||
16
src/model.js
16
src/model.js
@@ -262,22 +262,8 @@ my.Dataset = Backbone.Model.extend({
|
|||||||
|
|
||||||
// ### _backendFromString(backendString)
|
// ### _backendFromString(backendString)
|
||||||
//
|
//
|
||||||
// See backend argument to initialize for details
|
// Look up a backend module from a backend string (look in recline.Backend)
|
||||||
_backendFromString: function(backendString) {
|
_backendFromString: function(backendString) {
|
||||||
var parts = backendString.split('.');
|
|
||||||
// walk through the specified path xxx.yyy.zzz to get the final object which should be backend class
|
|
||||||
var current = window;
|
|
||||||
for(ii=0;ii<parts.length;ii++) {
|
|
||||||
if (!current) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
current = current[parts[ii]];
|
|
||||||
}
|
|
||||||
if (current) {
|
|
||||||
return current;
|
|
||||||
}
|
|
||||||
|
|
||||||
// alternatively we just had a simple string
|
|
||||||
var backend = null;
|
var backend = null;
|
||||||
if (recline && recline.Backend) {
|
if (recline && recline.Backend) {
|
||||||
_.each(_.keys(recline.Backend), function(name) {
|
_.each(_.keys(recline.Backend), function(name) {
|
||||||
|
|||||||
Reference in New Issue
Block a user